
Get the physical location of wireless router from its MAC address - coderrr
http://coderrr.wordpress.com/2008/09/10/get-the-physical-location-of-wireless-router-from-its-mac-address-bssid/
======
sil3ntmac
one single cmd wee

MYMAC=$(arp -a | awk '/[0-9a-f]:/ { gsub(/^0:|[1-9a-z]0:/, "00:", $4);
gsub(/:/, "", $4); print $4; exit; }') && curl --header "Content-Type:
text/xml" --data "<?xml version='1.0'?><LocationRQ
xmlns='<http://skyhookwireless.com/wps/2005'> version='2.6' street-address-
lookup='full'><authentication
version='2.0'><simple><username>beta</username><realm>js.loki.com</realm></simple></authentication><access-
point><mac>$MYMAC</mac><signal-strength>-50</signal-strength></access-
point></LocationRQ>" <https://api.skyhookwireless.com/wps2/location>

had to change 0: to 00: and strip out those :'s

~~~
sil3ntmac
:P or rather,

curl --header "Content-Type: text/xml" --data "<?xml
version='1.0'?><LocationRQ xmlns='<http://skyhookwireless.com/wps/2005'>
version='2.6' street-address-lookup='full'><authentication
version='2.0'><simple><username>beta</username><realm>js.loki.com</realm></simple></authentication><access-
point><mac>$(arp -a | awk '/[0-9a-f]:/ { gsub(/^0:|:0:/, "00:", $4); gsub(/:/,
"", $4); print $4; exit; }')</mac><signal-strength>-50</signal-
strength></access-point></LocationRQ>"
<https://api.skyhookwireless.com/wps2/location>

~~~
forgeman
Our wonderful scripting adventures don't seem to work anymore... ;( Anyone
able to confirm?

------
forgeman
curl --header "Content-Type: text/xml" --data "<?xml
version='1.0'?><LocationRQ xmlns='<http://skyhookwireless.com/wps/2005'>
version='2.6' street-address-lookup='full'><authentication
version='2.0'><simple><username>beta</username><realm>js.loki.com</realm></simple></authentication><access-
point><mac>YOURMACADDRESS</mac><signal-strength>-50</signal-strength></access-
point></LocationRQ>" <https://api.skyhookwireless.com/wps2/location> <?xml
version="1.0" encoding="UTF-8" standalone="yes"?>

~~~
coderrr
haha cmd line ftw, nice

except you have an extra xml tag at the end

------
coderrr
This is related to, but NOT A DUP of, the post incorrectly titled "Google map
a cellphone knowing its MAC address" at
<http://news.ycombinator.com/item?id=298073>. The article intruiged me but I
knew there had to be an easier way to send any MAC address to their API since
there is no way for them to remotely determine your MAC address. In the blog
post I show how.

------
seiji
Skyhook knows where your access point is because at one time they drove by and
mapped it. Google is probably collecting the same information from their
street view vans. All you need is a laptop with a GPS receiver to log
coordinates and MAC addresses.

So why not do it yourself? <http://wigle.net/> is a public access point MAC
address mapping site run by community contributions of location information.

~~~
coderrr
I looked through the wiggle database. A TON of their information is super old.
Of course there's no way to know how old SkyHook's is since it's totally
private.

~~~
seiji
Skyhook loves to tell you how recent their data is. They re-drive high
turnover areas (colleges) a few times a year. Everything else is quite recent.
With Skyhook's high profile use in the iPhone they can't afford to be out of
date.

Last I checked they had over 45 million access points recorded. With enough
users, the system can become self sustaining. You upload all the detected
access points in your area for a request so it's trivial for them to auto-
update their system if you submitted a newly discovered or changed MAC
address.

------
aasarava
Does this mean that if you upgrade your router and put the old one on eBay and
sell it to someone across the country, Skyhook's data is inaccurate (until
they next drive by)?

~~~
coderrr
yup

