To listen to the probe requests perform the following steps. Note that not all Wi-Fi cards allow you to see the probe requests. If you are not seeing any probe requests it's probably because your Wi-Fi card hides them. I'm using a "D-Link DWA-111 Wireless G USB Adapter" on Windows.
- Install python 3.6.3 (https://www.python.org/downloads/)
- Download my script from here
- Install Npcap 0.94 (https://nmap.org/npcap/). Make sure you click "Support raw 802.11 traffic (and monitor mode) for wireless adapters" during installation. I had to re-boot my computer after the installation to get everything to work well.
- Install Wireshark 2.4.2 (https://www.wireshark.org/#download)
- Set the Wi-Fi card to monitoring mode by running the following command as administrator. "Wi-Fi 2" is the interface name and should be changed to whatever interface you wish to use for the sniffing.
C:\Windows\System32\Npcap\WlanHelper.exe "Wi-Fi 2" mode monitor - Run my script. You may have to change the interface name and tshark path.
python wifi_monitor.py "Wi-Fi 2" "C:\Program Files\Wireshark\tshark.exe"
If everything works you should now see the MAC addresses of devices doing probe requests in your vicinity, something like this:
Date, Time, Number of previous sightings, Is local address?, MAC address
Local addresses are usually not static over time!
2017-11-06 21:13 6312 f4:f5:d8:ff:e0:b9
2017-11-06 21:17 0 X 72:a3:98:af:12:c3
2017-11-06 21:17 200 70:70:0d:ce:21:77
2017-11-06 21:20 201 70:70:0d:ce:21:77
70:70:0d:ce:21:77 Suspicious device
70:70:0d:ce:21:77 will now show up as Suspicious device in the script output. Note that it may take a while before the script re-loads aliases.txt and the change takes effect.
The script saves all the probe requests in log.txt. I have implemented a few scripts that extract statistics from the log file. histogram_of_sighting_times.py creates a histogram of the sighting times for a device.
python histogram_of_sighting_times.py 1 4 12 "Suspicious device"
The script uses Matplotlib so you need to install that before using it (https://matplotlib.org/users/installing.html).
device_graph.py creates a device graph based on how well device sightings correlate temporally. If two devices always show up at the same time they will have a very strong connection in the graph, if two devices have never appeared close to each other in time they will have no connection at all. The created graph (device_graph.gdf) can be analyzed in Gephi (https://gephi.org/) or any similar program. For more information about Gephi check out this post.

No comments:
Post a Comment