Building the TCP Header
Explore how to build the TCP header for network packets using Python Scapy, focusing on constructing SYN packets for port scanning. Understand key TCP fields like source and destination ports and flags, and learn to create realistic packets for scanning HTTPS and other services.
We'll cover the following...
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.
Looking at the output above, we see that several fields are defined within the TCP ...