How I Met Your Router

From Exploit to Physical Location


With minimal effort it is now possible to pinpoint the physical location of a wireless router from a MAC address using services such as Google and Skyhook. As an example of such utility, we used a recent information leakage vulnerability in DD-WRT routers. A Shodan search/ export was performed to obtain an initial list of routers running the affected DD-WRT firmware, followed by a simple web request to obtain the router's MAC address. Finally, the MAC information was resolved to the physical location using Google's unofficial Locations API.

The dataset used for this study is available for download on the right side.


A bug was discovered by Craig Heffner in the DD-WRT firmware that let remote users obtain detailed information about the router. By sending a web request to /, the attacker is able to obtain information such as the MAC address from the router. No brute-forcing or any sort of special payload needs to be sent since the page doesn't require any authentication by default. The info page was enabled by default and even disabling it didn't prevent attackers from grabbing the webpage. To prevent the information disclosure, the router's information page must be set to 'enabled with password protection.'

The following is a sample output from the / file:

{wl_radio::Radio is On} 
{wl_xmit::71 mW} 
{wl_rate::270 Mbps} 
{dhcp_leases:: 'joes-desktop','','xx:xx:xx:xx:2E:41','1 day 00:00:00','102'} 
{dhcp_leases:: 'marys-laptop','','xx:xx:xx:xx:55:E2','1 day 00:00:00','105'} 
{uptime:: 01:35:40 up 8 min, load average: 1.60, 0.80, 0.36} 
{ipinfo:: IP:} 



There are 2 known APIs for resolving a MAC address to the physical location of a router: Google and Skyhook. The Google API is used by products such as Firefox to determine the location of the user, but it isn't officially documented. Skyhook is a company dedicated to providing geolocation lookups and has an official developer kit. For simplicity reasons we used the unofficial Google Locations API though the same can be achieved with Skyhook.


The following code snippet has been taken from the Shodan API library's Wifi Positioning module.

To use the library in your own code, install the Shodan library:

Here's a brief example of how to use the library once it's installed:



At the time of the export (April 11, 2011) there were 5688 search results for DD-WRT routers in Shodan (for all ports, including Telnet and HTTPS). Those results were passed on to a script that attempts to grab the / from those devices, and then look them up using the above code for the Google Locations API.

From the original Shodan export of devices, only 543 returned a proper / page and were successfully resolved using Google Locations.


A larger view of the map is available here.