How to do it...

Let's use Scapy to perform firewall identification:

  1. To effectively determine whether a TCP port is filtered or not, both a TCP SYN packet and a TCP ACK packet need to be sent to the destination port. Based on the packets that are returned in response to these injections, we can determine whether the ports are filtered. Most likely, the injection of these two packets will result in one of the four different combinations of responses. We will discuss each of these scenarios, what they indicate about filtering associated with the destination port, and how to test for each. These four possible combinations of responses include the following:
    • SYN solicits no response, and ACK solicits an RST response
    • SYN solicits a SYN+ACK or ...

Get Kali Linux Network Scanning Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.