09 January 2015
I built an app which would tell me who's home based on whether their personal devices would respond to arp-scan requests on the wifi.
I learned about ARP -- the Address Resolution Protocol and how some people have been able to take advantage of it. An arp-scan is when ARP packets are sent to hosts all over a local network and making note of who replies. At the bare minimum, arp-scanning be used as a tool for system discovery by finding out where the hosts are located and even their MAC Address. This was how I ended approaching the task because if you find someone's phone, more times than not, they're going to be close by. When I say "find", I only mean they're within range of the WiFi router meaning they're inside the house, or close enough to be considered.
Figuring out which MAC addresses are linked to which devices is just a very manual task I don't have a better answer to.
That first script does essentially all we need to in terms of logic -- next we just need a way to display that. I really wanted to keep the interface simple, yet kind of absurd, so that's how we ended up here:
Green means at the house, red means away
Using a Flask python server that was up and running from a previous project, I was able to simply throw a page together quickly and tack it on with it's own url. It's an odd project, I'll give it that, but considering it was just a few hours to learn it all then throw it together... it was a fun project.