SYN Scanning (Half-Open)
What you'll learn: How to scan ports stealthily by sending SYN packets without completing the full TCP handshake.
What Is SYN Scanning?
Remember TCP Connect Scanning completes the full three-way handshake (SYN → SYN-ACK → ACK)? SYN scanning stops halfway through. You send a SYN packet, wait for the response, then immediately send a RST (reset) to tear down the connection before it's fully established. If the port is open, you'll receive a SYN-ACK; if closed, you'll get a RST.
Think of it like knocking on someone's door (SYN), hearing them start to open it (SYN-ACK), then walking away before they fully open it. You confirmed someone's home without actually entering—or leaving a full record of your visit in their guest log.
Why Use SYN Scanning?
Advantages over TCP Connect Scanning:
- Stealthier: Many older intrusion detection systems don't log incomplete connections, since no full TCP session was established
- Faster: No need to complete and properly close connections
- Less resource-intensive: Doesn't tie up connection slots on the target system
Raw Socket Requirements
Here's the catch: to send a SYN packet without completing the handshake, you can't use normal system socket calls (which handle the full handshake automatically). You need raw socket access to craft packets manually. This typically requires:
- Administrator/root privileges on your scanning machine
- The ability to construct TCP packets from scratch
- Direct access to the network interface
Key Takeaway: SYN scanning is stealthier and faster than full TCP Connect scanning because it uses incomplete handshakes, but requires raw socket privileges to craft custom packets.