TCP sequence attacks and session hijacking attacks
TCP sequence attacks, also referred to as TCP session hijacking, refer to a case in which we intercept a conversation between two ends of a connection and impersonate one of the two ends. This is one of many types of man-in-the-middle attacks, when we intercept data between two communicating devices.
To run the TCP session hijacking attacks, we will use Scapy – a packet manipulation tool written in Python. Scapy can be used to capture, decode, fake, and send packets.
To install Scapy on Windows, do the following:
- Install Python version 3.4 or higher.
- Install the
npcap
driver (if you have followed along with this book up to this chapter, you should have it installed by now). - Open
cmd
and runpip3 install scapy
.
To install Scapy for Linux (Ubuntu or Kali), run the following commands:
sudo apt update
sudo apt install python3-scapy
In the following example, we sent a simple packet...