Search⌘ K
AI Features

Sending Packets in Scapy

Explore how to send and receive custom network packets in Scapy using functions like sr for layer 3 communication. Understand packet wrapping, manage multiple port scans efficiently, and configure timeout and verbosity settings to analyze network responses in port scanning tasks.

Network packet layers recap

We’ve built a SYN scanning packet in Scapy. Now, we’ll look at sending out that packet and receiving a response.

Scapy offers a number of different options for sending and receiving packets. To choose the right one, we need to take another quick look at the TCP/IP and OSI models.

TCP/IP and OSI Network Models
TCP/IP and OSI Network Models

When we defined the SYN scanning packet, we created the IP and TCP headers. IP packets fall at the network layer or layer 3 of the OSI model, so our packets are only defined above this layer. ...