[Winpcap-users] Sniffing WiFi access points nearby

gonzalo diethelm gonzalo.diethelm at dcv.cl
Mon Feb 14 05:51:16 PST 2011


This is my first post to this list, and I am a total newbie to WinPCap.

I would like to write code (C / C++) that will produce a list of nearby WiFi access points, providing for each one its name (SSID), signal strength and MAC address (BSSID). This should run on any Windows version from XP SP2. Notice that I need the BSSID for access points to which I am not connected and probably cannot connect (I don't have the credentials).

I already found a nice example of how to get almost all this information using WlanGetAvailableNetworkList(), which is part of the WLAN API. But this function does not return the MAC address (BSSID) for the nearby access points.

I know this is possible because NetStumbler provides this information very quickly. So I am beginning to suspect I would need to do a little packet sniffing in order to achieve what I want in my code. My questions are:

1. Can WinPCap capture packets for a WiFi network card?

2. When my laptop is surrounded by several WiFi access points, are there any packets flowing through the air that could be somehow captured by WinPCap?

3. Say there are packets flowing between my laptop and these access points, to which the laptop is not connected, and say WinPCap has captured a few of these packets. How do I go about extracting information (specifically MAC address) from these packets?

Thanks in advance for your help, and best regards.

-- 
Gonzalo Diethelm 



More information about the Winpcap-users mailing list