4

Is there a way to get a list of all SSID's and their mac address of reachable signals in my area?

I tried the Nativ WlanApi in my c# code. What I get is the list of all ssid's, but for getting their mac address, I don't have any idea.

This is the code I using for getting the list:

private void show_all_ssids_Click(object sender, EventArgs e)
{
  WlanClient client = new WlanClient();
  foreach ( WlanClient.WlanInterface wlanIface in client.Interfaces )
  {
    // Lists all available networks
    Wlan.WlanAvailableNetwork[] networks = wlanIface.GetAvailableNetworkList( 0 );
    this.ssidList.Text = "";
    foreach ( Wlan.WlanAvailableNetwork network in networks )
    {                    
      //Trace.WriteLine(  GetStringForSSID(network.dot11Ssid));
      this.ssidList.Text += GetStringForSSID(network.dot11Ssid) + "\r\n";
    }
  }
}
static string GetStringForSSID(Wlan.Dot11Ssid ssid)
{
  return Encoding.ASCII.GetString(ssid.SSID, 0, (int)ssid.SSIDLength);
}

I hope there is a way.

Justin
  • 84,773
  • 49
  • 224
  • 367
isicom
  • 41
  • 1
  • 2

2 Answers2

1

In order to get a MAC address you would need to connect to that wireless network. Once you are connected you should be able to get the MAC address of machines on the immediate network using the same methods that you might for traditional wired networks - I believe that the best way of doing that would be by parsing the output of the arp -a command.

Justin
  • 84,773
  • 49
  • 224
  • 367
0

this is the solution:

Dim networksBss As Wlan.WlanBssEntry() = SelectedWifiAdapter.GetNetworkBssList()

For car = 0 To networksBss(i).dot11Bssid.Length - 1
If Len(Hex(networksBss(i).dot11Bssid(car))) = 1 Then ThisScan(i).MAC = ThisScan(i).MAC & "0"
ThisScan(i).MAC = ThisScan(i).MAC & Hex(networksBss(i).dot11Bssid(car)) & ":"

Next

anyway i'm still looking for a way to find details (strenght) of networks with SSID="" associating it with the proper MAC.

Martin Buberl
  • 45,844
  • 25
  • 100
  • 144
Gaucho
  • 1