...

/

Sending Packets in Scapy

Sending Packets in Scapy

Learn how to send and receive packets in Scapy, including sending both single and multiple packets in a single burst.

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.

Press + to interact
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.

Choosing the right send/receive function

Sending packets over the network requires defining an Ethernet header to wrap our IP packet. We can either do this manually or select a Scapy function that does so automatically. ...