Analyzing Packet Responses

Learn how to analyze potential responses to SYN scanning packets to determine which ports on the target system are open/closed.

Examining packet responses

In the previous lesson, we looked at sending and receiving packets in Scapy but didn’t analyze the results. In this lesson, we’ll examine the return values from the sr function and use them to determine which ports are open or closed on the target system.

To start, let’s take another look at our SYN scanning code. Note that the TCP layer has an S flag set, indicating that it is a SYN packet, the first packet in the TCP handshake.

Get hands-on with 1400+ tech skills courses.