Building the TCP Header
Build a TCP header for a SYN scanner.
We'll cover the following...
Examining a TCP header
We’ve built the IP layer of a network packet, which indicates the IP address of the target system. To perform port scanning, we also need the concept of ports, which requires building a TCP or UDP layer on top of the IP layer.
In this case, we’re developing a SYN scanner, so we’ll need to add a TCP layer. To start, let’s take a look at a sample SYN packet from our packet capture.
Press + to interact
from scapy. all import *packets = rdpcap('http.cap')packets[0][TCP].show()
Looking at the output above, we see that several fields are defined within the TCP ...