Developing a Valid TCP Layer Response
Understand how to develop valid TCP layer responses for network packets using Python Scapy. This lesson teaches you to set sequence numbers, acknowledgment numbers, and TCP flags correctly to build reliable server or honeypot responses within TCP/IP communications.
We'll cover the following...
Creating responses to TCP/IP queries
When creating a SYN scanner, we build queries and analyze their responses. Defining a valid query is much easier than crafting a response to that query. When creating a request, we can allow several values to be set automatically by Scapy. In a response packet, we need to appropriately set these values to match those defined in a request.
For IP and UDP packet headers, this is relatively simple. However, the complexity of the TCP protocol means that we need to set many more fields within our network packets.
Inside a TCP/IP communication
TCP is a connection-oriented protocol, meaning that it ...