Nmap Firewall-Evasion Walkthrough Shows Limits of Static iptables Rules

Summary
A lab walkthrough demonstrates how Nmap scans evade static iptables rules by varying TCP flags, packet length, TTL, source fields, payloads and options. It recommends stateful inspection, IDS/IPS, rate limiting and host monitoring.
Key points
- The lab uses Kali and Ubuntu hosts with Wireshark captures to show how Nmap probes interact with changing iptables rules.
- FIN, NULL and XMAS scans evade a rule that blocks SYN packets; length-based filters can be bypassed with different packet sizes, fragmentation or added payload.
- TTL filtering can be evaded by setting a value outside the blocked range.
- Trust rules based on source ports, MAC or IP addresses can be bypassed by setting or spoofing those fields; spoofed source IPs may prevent the scanner from receiving replies.
- Payload and TCP-option filtering can be sidestepped by adding matching bytes or using IP-level options that the TCP-option rule does not inspect.
- The article recommends stateful inspection, IDS/IPS, rate limiting, centralized log correlation, network segmentation and strong authentication rather than relying on static header matches.
Article Details
- Topic
- Nmap techniques for bypassing static iptables firewall rules and layered defenses against network reconnaissance
MITRE ATT&CK
Tools
iptablesThis walkthrough shows how Nmap can bypass static iptables rules by changing TCP flags, packet length, TTL, source port, MAC/IP spoofing, payload bytes, and options.NmapThis walkthrough shows how Nmap can bypass static iptables rules by changing TCP flags, packet length, TTL, source port, MAC/IP spoofing, payload bytes, and options.SnortTools such as Snort, Suricata, and Zeek inspect traffic at a much higher level than iptables and recognise the behavioural fingerprints of scanning activity — a sudden burst of SYNs, sequential port probes, or packetsSuricataTools such as Snort, Suricata, and Zeek inspect traffic at a much higher level than iptables and recognise the behavioural fingerprints of scanning activity — a sudden burst of SYNs, sequential port probes, or packetsWiresharkEvery probe in the walkthrough is captured in Wireshark, allowing the reader to observe the byte-level behaviour that determines whether each scan succeeds or fails.ZeekTools such as Snort, Suricata, and Zeek inspect traffic at a much higher level than iptables and recognise the behavioural fingerprints of scanning activity — a sudden burst of SYNs, sequential port probes, or packets
