An Internet-wide Penetration Study on NAT Boxes via TCP/IP Side Channel

Xuan Feng, Shuo Chen, Haining Wang

TL;DR

Researchers have developed a non-aggressive, Internet-wide scanner that exploits a 25-year-old TCP/IP side channel (shared IPID) to "peek" behind NAT boxes. Their study identified over 30,000 vulnerable gateways across 154 countries that could allow an external attacker to identify and potentially communicate with otherwise "hidden" internal devices like IoT cameras and industrial controls.

What Problem Does This Paper Address?

Network Address Translation (NAT) is the internet's "one-way valve." It allows multiple devices in a local network to share one public IP address while theoretically shielding them from unsolicited inbound traffic. We usually assume that if a device has a private IP (like 192.168.1.5), it is invisible and unreachable from the public web.

While previous research has shown NAT can be bypassed using specific application-layer vulnerabilities (like bugs in UPnP or SIP), this paper investigates a more fundamental threat: TCP/IP layer side channels. The authors wanted to see if basic networking behaviors—common across many operating systems and devices—could be used to conduct a massive, ethical penetration study to find "holes" in NAT security globally.

Methods

The researchers focused on the shared IPID (IP Identification) counter. In older or poorly configured network stacks, a device uses a single global counter to assign an ID number to every packet it sends out, regardless of the destination.

The team built an adaptive scanner that works in three stages:

  1. Pre-filtering: Using ZMap to quickly identify all "alive" hosts in the IPv4 space.
  2. Outpost Selection: Identifying "outposts"—publicly accessible hosts that use a shared IPID counter and, crucially, reside on networks that fail to perform ingress filtering (i.e., they allow packets with spoofed source addresses to enter).
  3. NAT-penetration Detection: This is the "aha" moment. The scanner sends a spoofed SYN packet to the outpost, pretending to be an internal device from the local network.
  4. If the NAT allows the packet, the internal device sends a Reset (RST), causing the outpost's IPID to increment by a specific, predictable amount.
  5. If the NAT blocks it, the outpost eventually times out and retransmits its own packets, creating a different IPID signature.

By monitoring these tiny increments in the ID numbers, the scanner can infer whether a "hole" exists without ever actually compromising the internal network.

Datasets

  • IPv4 Address Space: The authors scanned the entire reachable IPv4 internet.
  • Maxmind GeoIP2: Used to map vulnerable outposts to specific countries, cities, and ISPs.
  • Device Fingerprinting: The authors manually analyzed a random sample of 100 outposts to identify device types (routers, IoT devices, servers) using web-based fingerprinting.

Key Insights and Ideas

  • Legacy Issues Persist: The shared IPID vulnerability was first documented in 1998. Despite being "fixed" in modern Windows and Linux kernels, the study found it is still pervasive in 18% of reachable hosts—mostly in embedded systems and older networking gear.
  • The "Double Vulnerability" Requirement: For this attack to work, a network must have both a shared IPID counter and a lack of ingress filtering. The researchers found that 56.2% of hosts with the IPID vulnerability also failed to block spoofed inbound private-IP packets.
  • Timing as a Filter: To deal with internet "noise" (random traffic changing the IPID), the researchers used the outpost’s own TCP retransmission timers as a clock. By checking if the IPID incremented at the exact millisecond a retransmission was expected, they could distinguish their signal from background noise.

Key Results

  • Scale: The scanner identified 30,691 vulnerable outposts belonging to 4,146 different organizations.
  • Geography: Vulnerabilities were found in 154 countries, with the highest concentrations in the USA, Russia, South Korea, and China.
  • Speed: The adaptive scanner completed a full IPv4 scan in just 5 days while maintaining a very low, "polite" packet rate (0.6 packets per second per host).
  • Affected Devices: The "outposts" weren't just PCs; they included core routers from HUAWEI and Cisco, Vmware ESXi hypervisors, and IoT devices like Hikvision security cameras and solar energy management systems.

Limitations and Future Work

  • Port Limitation: The study primarily targeted hosts with port 80 (HTTP) open to ensure they could trigger a response. Vulnerable devices hiding on other ports were not counted.
  • Noise Filtering: The researchers intentionally discarded hosts with high traffic (high IPID noise) to maintain accuracy. This means their count of 30,000 is likely a conservative lower bound.
  • Ethical Boundaries: As white-hat researchers, they did not attempt to actually exploit the internal devices found. Future work could involve working more closely with ISPs to implement Reverse Path Forwarding (RPF), which would effectively kill this class of side-channel attack by blocking spoofed traffic at the source.

Summary updated

Abstract

Network Address Translation (NAT) plays an essential role in shielding devices inside an internal local area network from direct malicious accesses from the public Internet. However, recent studies show the possibilities of penetrating NAT boxes in some specific circumstances. The penetrated NAT box can be exploited by attackers as a pivot to abuse the otherwise inaccessible internal network resources, leading to serious security consequences. In this paper, we aim to conduct an Internet-wide penetration testing on NAT boxes. The main difference between our study and the previous ones is that ours is based on the TCP/IP side channels. We explore the TCP/IP side channels in the research literature, and find that the shared-IPID side channel is the most suitable for NAT-penetration testing, as it satisfies the three requirements of our study: generality, ethics, and robustness. Based on this side channel, we develop an adaptive scanner that can accomplish the Internet-wide scanning in 5 days in a very non-aggressive manner. The evaluation shows that our scanner is effective in both the controlled network and the real network. Our measurement results reveal that more than 30,000 network middleboxes are potentially vulnerable to NAT penetration. They are distributed across 154 countries and 4,146 different organizations, showing that NAT-penetration poses a serious security threat.
BibTeX
@misc{feng2023internet,
  author = {Xuan Feng and Shuo Chen and Haining Wang},
  title = {{An Internet-wide Penetration Study on NAT Boxes via TCP/IP Side Channel}},
  year = {2023},
  eprint = {2311.17392},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2311.17392},
}
Figure