Search⌘ K

Developing a Valid IP Layer Response

Explore how to develop valid IP layer responses by understanding IP header fields and reversing source and destination addresses. This lesson helps you craft response packets with Scapy, preparing you to build honeypots and servers that handle network traffic accurately.

Examining the IP layer

The network packets that we’ll use in a honeypot or server have multiple different layers. Typically, the bottom layer is the Ethernet layer, which handles MAC addressing. In general, we can rely on Scapy to define this for us.

The next layer is the IP layer, which defines the source and destination IP addresses and various other fields. Let’s take a look at an IP header in Scapy.

Python 3.8
from scapy.all import *
packets = rdpcap('http.cap')
packets[0][IP].show()

Looking at the ...