Idle Scan

The IDLE/IPID Header Scan is a powerful TCP port scanning method used by attackers to perform complete blind scanning of a remote host by impersonating another computer (known as a "zombie") via IP spoofing.

This scanning technique falls under the category of Third Party and Spoofed TCP Scanning Methods used for Port and Service Discovery.

Mechanism and Purpose

The primary mechanism of the IDLE/IPID Header Scan relies on analyzing the IP Identification (IPID) number of a third-party "zombie" host.

Core Principle (IPID Tracking):

Blind Scanning:

Steps of an IDLE Scan

The process of performing an IDLE scan involves three main steps:

Step 1: Identify and Probe the Zombie Host's IPID

  1. Choose a Zombie: An appropriate or "idle" zombie incrementally assigns IPID packets on a global basis.
  2. Probe the IPID: The attacker sends a SYN+ACK packet to the zombie machine to probe its current IPID number (let's call this value X). This packet is sent to probe the IPID, not to establish a TCP connection.
  3. Zombie Response: Because the zombie did not expect a SYN+ACK packet (it was unsolicited), it denies the connection by returning an RST packet. The attacker analyzes this RST packet to extract the current IPID number (X).

Step 2: Scan the Target Host

  1. Spoofed SYN Packet: The attacker sends a SYN packet to a specific port on the target machine (e.g., port 80), but they spoof the source IP address to make it look like it originated from the zombie.
  2. Target Response (Open Port): If the port on the target is open, the target sends a SYN+ACK packet back to the zombie (since the IP was spoofed) to proceed with the three-way handshake. The zombie, in turn, sends an RST packet to the target because it did not expect the SYN+ACK. This RST packet is the zombie's first outgoing packet, causing its IPID number to be incremented to X+1.
  3. Target Response (Closed Port): If the port on the target is closed, the target responds immediately with an RST packet back to the zombie. The zombie remains idle thereafter, meaning its IPID number does not increment.

Step 3: Re-Probe the Zombie Host

  1. Second IPID Probe: The attacker follows Step 1 again, sending another SYN+ACK packet to the zombie.
  2. Analyze Final IPID: The zombie responds with an RST packet containing its current IPID.
    • If the port on the target was open, the zombie sent one RST packet in Step 2, and one RST packet now, resulting in the IPID being incremented twice. The zombie responds with X+2.
    • If the port on the target was closed, the zombie did not send any packets in Step 2, and only sent one RST packet now, resulting in the IPID being incremented once. The zombie responds with X+1.

By comparing the initial IPID (X) with the final IPID, the attacker can identify the open ports and services on the target machine anonymously.

Nmap Implementation

In Nmap (Network Mapper), the option used to perform an IDLE scan is -sI.

The command syntax used in the sources is nmap -Pn -p- -sI <Zombie> <Target>.

The example output demonstrates the command: #nmap -Pn -p- -sI 10.10.1.11 10.10.1.19. This scan uses the host 10.10.1.11 as the zombie to scan the target host 10.10.1.19.


Step 1

Idle Scan-1752843750504.webp

Step 2

If the port is open

Idle Scan-1752843761945.webp

If the port is closed

Idle Scan-1752843781358.webp

nmap

nmap -Pn -p 80 -sI 10.10.10.20 10.10.10.30