
Member-only story
Build a wifi scanner with Python
The other day I was trying to watch Mr.Robot
and my upstairs neighbours were being extra rowdy so I did the neighbourly thing and knocked on their door to let them know, hoping they would calm down and well I basically got the door slammed in my face and resigned myself to live the remainder of my lease with upstairs elephants stomping around but it got me thinking what would Elliot do ? well hack their wifi of course.
👋 Hi there 👋 all my content is free for Medium subscribers, if you are already a subscriber I just wanted to say thank you ! 🎉 If not and you are considering subscribing, you can use my membership referral link, you will be supporting this and other high quality content, Thank you ! ⭐️ Subscribe to Medium ! ⭐️
This hypothetical revenge sounds great on paper but as I have never hacked anything I had no idea where to start, the funny thing is that I got so into it that I completely lost interest in finishing watching Mr.Robot and my stomping neighbours, so here I’ll show you a few things I learned, nothing illegal or even morally dubious, we’ll simply build a wifi scanner…
So the hypothetical hack I imagined Elliot would come up with was something along these lines:1. Find their wifi network. (This is basically all we'll be doing here).
2. Connect to their network ( brute force the wifi password ?)
3. Profit ?To be honest I have no idea how to accomplish 2. & 3. and that does cross a moral and legal line , so I figured at least number 1. get their wifi network and try to connect to it programmatically would be easy, wrong again.My first instinct was to search for a python library that did this (list wifi networks) but I had mixed results and quickly realized this was a hardware issue (talking to your network/wifi card) so it was back to square one and googling on how to do wifi things in the terminal.⚠️ The following works on Mac OSX but if you are on windows your terminal commands will be different.
Network basics
The first thing you need is some network information, mainly the name of your wifi adapter, this can be done…