Hello,
Today i will tell you how to creat a simple wifi scaning application on Microsoft visual studio.
As i have told you below how to get microsoft visual studio.
First of all Download “Managedwifi.Api” From the link given below:
Now create a new windows form application of c# in visual
studio.
Now copy “Interop.cs” and “WlanApi.cs” Form the downloaded
folder of “Managed wifi”.
Now Goto “Document>Visual
Studio 2013>Projects> ‘the folder of your project name’> ‘again
go to another folder inside with same name’. ” ,and Paste the files there.
Now open your project and follow the steps below:
1.
2.
3.These
will be shown like this:
Now add a list view item from tool box on your form and size it up . you can open tool box
with “ctrl+Alt+X”.
Now Edit Listview by following steps.
1.
2.Add 3 columns .
3. Change the text of 1st column to SSID, 2nd Mac and 3rd to
SIGNALS.
Now add a button to your form from tool box.
It will appear like this:
Now double click on the button. It wil show you a coding
place.
Now paste this code there:
listView1.Items.Clear();
var wlanClient = new WlanClient();
foreach (WlanClient.WlanInterface
wlanInterface in wlanClient.Interfaces)
{
Wlan.WlanBssEntry[]
wlanBssEntries = wlanInterface.GetNetworkBssList();
foreach (Wlan.WlanBssEntry
wlanBssEntry in wlanBssEntries)
{
byte[] macAddr =
wlanBssEntry.dot11Bssid;
var macAddrLen = (uint)macAddr.Length;
var str = new string[(int)macAddrLen];
for (int i = 0; i <
macAddrLen; i++)
{
str[i] = macAddr[i].ToString("x2");
}
string mac = string.Join("",
str);
Wlan.Dot11Ssid ssid =
wlanBssEntry.dot11Ssid;
string networkName = Encoding.ASCII.GetString(ssid.SSID,
0, (int)ssid.SSIDLength);
ListViewItem item = new ListViewItem(networkName);
item.SubItems.Add(mac);
item.SubItems.Add(wlanBssEntry.linkQuality.ToString()
+ "%");
listView1.Items.Add(item);
}
}
It will show some errors but don’t worry about them.
Just go on top and add a header “ using NativeWifi; ”.
This will remove the errors.
Now click on start :
And then press the button of running program.
This will show you the List of wifi networks with their names ,mac address and their signal
strength.
That’s it.
If this was help full the don’t forget to comment and share . J
Wait for my next post i will upload it as soon as possible.
Keep visiting wifimnc.blogspot.com for more updates about wifi hacking.
Thanks for watching.
No comments:
Post a Comment