TCP-IP Hijacking

TCP/IP Hijacking

TCP/IP hijacking is a form of network-level session hijacking where an attacker exploits the flaws inherent in the Transmission Control Protocol/Internet Protocol (TCP/IP) design to seize control of a valid TCP communication session between two devices.

This attack falls under the category of active attacks as it involves tampering with data in transit or disrupting communication between systems.

Overview

TCP/IP hijacking involves an attacker intercepting an already established TCP connection between two communicating parties (the user and the server) by using spoofed packets and predicting session parameters. In this approach, the attacker uses spoofed packets to redirect the TCP traffic to their own machine. Once this is successful, the victim's connection hangs, and the attacker is able to communicate with the host's machine on behalf of the victim.

By using this technique, an attacker can easily attack systems that use one-time passwords. To launch a TCP/IP hijacking attack, both the victim and attacker must be on the same network. The target server and the victim machines can be located anywhere.

Attack Mechanism

Sequential Attack Steps

The process typically involves the following sequential steps performed by the attacker:

  1. Sniffing and Prediction: The attacker passively monitors the network and sniffs the victim's connection to capture the sequence and acknowledgment numbers. This is crucial because TCP connections rely on these numbers for synchronized communication.

  2. Spoofing: The attacker then sends a spoofed packet to the target server, predicting the next expected sequence number, and spoofing the victim's IP address as the source.

  3. Desynchronization: The server processes the spoofed packet, increments the sequence number, and sends an acknowledgment (ACK) packet back to the victim's IP address. Since the victim did not send the original spoofed packet, they ignore the server's ACK packet. This action effectively desynchronizes the connection between the user and the server.

  4. Control Acquisition: The attacker forces the victim's connection into a desynchronized state and continues to track the sequence numbers, continuously sending spoofed packets that originate from the victim's IP address. The victim's connection hangs, and the attacker is now communicating with the receiver machine on the victim's behalf.

Detailed Attack Process

TCP/IP hijacking is performed through the following steps:

Attack Scenario Example

According to above figure, the next expected sequence number is 1420. If the attacker transmits that packet sequence number before the user does, they can desynchronize the connection between the user and server.

If the attacker sent the data with the expected sequence number before the user could, the server would be synchronized with the attacker. This leads to the establishment of a connection between the attacker and server. Then, the server would drop the data sent by the user with the correct sequence number, believing it to be a resent packet. The user is unaware of the attacker's action and may resend the data packet because the user does not receive an ACK for their TCP packet. However, the server would drop all the packets resent by the user. Thus, the local session hijacking attack is successfully completed.

TCP-IP Hijacking-1755268211903.webp777x572

Key Components of the Attack

Countermeasures

To protect against TCP/IP hijacking and sequence number prediction attacks: