Writing Custom Port Scanners

Learn how to modify our existing SYN scanner to perform other types of port scans, starting with an ACK scan.

SYN scan alternatives

We’ve successfully developed a SYN scanner in Scapy. This type of scanner takes advantage of the structure of the TCP handshake. If a port is open, it will respond to a SYN packet with a SYN/ACK.

However, SYN scans are far from the only type of port scanning. Some other options include:

  • TCP connect scan

  • ACK scan

  • XMAS scan

  • FIN scan

  • NULL scan

Performing an ACK scan

Now, we’ll adapt our existing SYN scanner to other scan types. To start, let’s take a look at our SYN scanner code:

Get hands-on with 1400+ tech skills courses.