Python improvements, messaging improvements.
Small code changed as proposed in #128. This should close #128. Slowly moving towards Camel-case in script output.
This commit is contained in:
@@ -22,7 +22,7 @@ class AttackAll(object):
|
||||
essid = target.essid if target.essid_known else '{O}ESSID unknown{W}'
|
||||
|
||||
Color.pl('\n{+} ({G}%d{W}/{G}%d{W})' % (index, len(targets)) +
|
||||
' starting attacks against {C}%s{W} ({C}%s{W})' % (bssid, essid))
|
||||
' Starting attacks against {C}%s{W} ({C}%s{W})' % (bssid, essid))
|
||||
|
||||
should_continue = cls.attack_single(target, targets_remaining)
|
||||
if not should_continue:
|
||||
@@ -67,7 +67,7 @@ class AttackAll(object):
|
||||
attacks.append(AttackWPA(target))
|
||||
|
||||
if len(attacks) == 0:
|
||||
Color.pl('{!} {R}Error: {O}unable to attack: encryption not WEP or WPA')
|
||||
Color.pl('{!} {R}Error: {O}Unable to attack: encryption not WEP or WPA')
|
||||
return
|
||||
|
||||
while len(attacks) > 0:
|
||||
@@ -80,7 +80,7 @@ class AttackAll(object):
|
||||
Color.pexception(e)
|
||||
continue
|
||||
except KeyboardInterrupt:
|
||||
Color.pl('\n{!} {O}interrupted{W}\n')
|
||||
Color.pl('\n{!} {O}Interrupted{W}\n')
|
||||
if not cls.user_wants_to_continue(targets_remaining, len(attacks)):
|
||||
return False # Stop attacking other targets
|
||||
|
||||
@@ -106,9 +106,9 @@ class AttackAll(object):
|
||||
if targets_remaining > 0:
|
||||
prompt_list.append(Color.s('{C}%d{W} target(s)' % targets_remaining))
|
||||
prompt = ' and '.join(prompt_list)
|
||||
Color.pl('{+} %s remain, do you want to continue?' % prompt)
|
||||
Color.pl('{+} %s remain, Do you want to continue?' % prompt)
|
||||
|
||||
prompt = Color.s('{+} type {G}c{W} to {G}continue{W}' +
|
||||
prompt = Color.s('{+} Type {G}c{W} to {G}continue{W}' +
|
||||
' or {R}s{W} to {R}stop{W}: ')
|
||||
|
||||
from ..util.input import raw_input
|
||||
|
||||
@@ -192,7 +192,7 @@ class AttackPMKID(Attack):
|
||||
dumptool = HcxDumpTool(self.target, self.pcapng_file)
|
||||
|
||||
# Let the dump tool run until we have the hash.
|
||||
while self.keep_capturing and dumptool.poll() == None:
|
||||
while self.keep_capturing and dumptool.poll() is None:
|
||||
time.sleep(0.5)
|
||||
|
||||
dumptool.interrupt()
|
||||
@@ -202,7 +202,7 @@ class AttackPMKID(Attack):
|
||||
'''Saves a copy of the pmkid (handshake) to hs/ directory.'''
|
||||
# Create handshake dir
|
||||
if not os.path.exists(Configuration.wpa_handshake_dir):
|
||||
os.mkdir(Configuration.wpa_handshake_dir)
|
||||
os.makedirs(Configuration.wpa_handshake_dir)
|
||||
|
||||
# Generate filesystem-safe filename from bssid, essid and date
|
||||
essid_safe = re.sub('[^a-zA-Z0-9]', '', self.target.essid)
|
||||
|
||||
@@ -205,7 +205,7 @@ class AttackWPA(Attack):
|
||||
'''
|
||||
# Create handshake dir
|
||||
if not os.path.exists(Configuration.wpa_handshake_dir):
|
||||
os.mkdir(Configuration.wpa_handshake_dir)
|
||||
os.makedirs(Configuration.wpa_handshake_dir)
|
||||
|
||||
# Generate filesystem-safe filename from bssid, essid and date
|
||||
if handshake.essid and type(handshake.essid) is str:
|
||||
|
||||
@@ -17,26 +17,22 @@ class AttackWPS(Attack):
|
||||
|
||||
# Drop out if user specified to not use Reaver/Bully
|
||||
if Configuration.use_pmkid_only:
|
||||
Color.pl('\r{!} {O}--pmkid{R} set, ignoring WPS attack on ' +
|
||||
'{O}%s{W}' % self.target.essid)
|
||||
self.success = False
|
||||
return False
|
||||
|
||||
if Configuration.no_wps:
|
||||
Color.pl('\r{!} {O}--no-wps{R} set, ignoring WPS attack on ' +
|
||||
'{O}%s{W}' % self.target.essid)
|
||||
self.success = False
|
||||
return False
|
||||
|
||||
if not Configuration.wps_pixie and self.pixie_dust:
|
||||
Color.pl('\r{!} {O}--no-pixie{R} set, ignoring WPS attack on ' +
|
||||
Color.pl('\r{!} {O}--no-pixie{R} was given, ignoring WPS PIN Attack on ' +
|
||||
'{O}%s{W}' % self.target.essid)
|
||||
self.success = False
|
||||
return False
|
||||
|
||||
if not Configuration.wps_pin and not self.pixie_dust:
|
||||
Color.pl('\r{!} {O}--no-pin{R} set, ignoring WPS attack on ' +
|
||||
'{O}%s{W}' % self.target.essid)
|
||||
Color.pl('\r{!} {O}--no-pin{R} was given, ignoring WPS Pixie-Dust Attack ' +
|
||||
'on {O}%s{W}' % self.target.essid)
|
||||
self.success = False
|
||||
return False
|
||||
|
||||
|
||||
Reference in New Issue
Block a user