Skip to content

Commit

Permalink
Removing the last of the double-quoted strings (now single-quoted)
Browse files Browse the repository at this point in the history
  • Loading branch information
derv82 committed Aug 18, 2018
1 parent c4ed911 commit ebb7cac
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 30 deletions.
4 changes: 2 additions & 2 deletions wifite/attack/all.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def attack_multiple(cls, targets):
targets_remaining -= 1

bssid = target.bssid
essid = target.essid if target.essid_known else "{O}ESSID unknown{W}"
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))
Expand Down Expand Up @@ -64,7 +64,7 @@ def attack_single(cls, target, targets_remaining):
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

for attack in attacks:
Expand Down
46 changes: 23 additions & 23 deletions wifite/attack/wep.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def run(self):
# Use our interface's MAC address for the attacks.
client_mac = Ifconfig.get_mac(Configuration.interface)
# Keep us authenticated
fakeauth_proc = Aireplay(self.target, "fakeauth")
fakeauth_proc = Aireplay(self.target, 'fakeauth')
elif len(airodump_target.clients) == 0:
# Failed to fakeauth, can't use our MAC.
# And there are no associated clients. Use one and tell the user.
Expand Down Expand Up @@ -108,16 +108,16 @@ def run(self):
current_ivs = airodump_target.ivs
total_ivs = previous_ivs + current_ivs

status = "%d/{C}%d{W} IVs" % (total_ivs, Configuration.wep_crack_at_ivs)
status = '%d/{C}%d{W} IVs' % (total_ivs, Configuration.wep_crack_at_ivs)
if fakeauth_proc:
if fakeauth_proc and fakeauth_proc.status:
status += ", {G}fakeauth{W}"
status += ', {G}fakeauth{W}'
else:
status += ", {R}no-auth{W}"
status += ', {R}no-auth{W}'
if aireplay.status is not None:
status += ", %s" % aireplay.status
status += ', %s' % aireplay.status
Color.clear_entire_line()
Color.pattack("WEP", airodump_target, "%s" % attack_name, status)
Color.pattack('WEP', airodump_target, '%s' % attack_name, status)

# Check if we cracked it.
if aircrack and aircrack.is_cracked():
Expand All @@ -141,7 +141,7 @@ def run(self):

if aircrack and aircrack.is_running():
# Aircrack is running in the background.
Color.p("and {C}cracking{W}")
Color.p('and {C}cracking{W}')

# Check number of IVs, crack if necessary
if total_ivs > Configuration.wep_crack_at_ivs:
Expand Down Expand Up @@ -180,7 +180,7 @@ def run(self):
# If .xor is not there, the process failed.
Color.pl('\n{!} {O}%s attack{R} did not generate a .xor file' % attack_name)
# XXX: For debugging
Color.pl('{?} {O}Command: {R}%s{W}' % " ".join(aireplay.cmd))
Color.pl('{?} {O}Command: {R}%s{W}' % ' '.join(aireplay.cmd))
Color.pl('{?} {O}Output:\n{R}%s{W}' % aireplay.get_output())
break

Expand All @@ -193,8 +193,8 @@ def run(self):
if replay_file:
Color.pl('{+} {C}forged packet{W},' +
' {G}replaying...{W}')
wep_attack_type = WEPAttackType("forgedreplay")
attack_name = "forgedreplay"
wep_attack_type = WEPAttackType('forgedreplay')
attack_name = 'forgedreplay'
aireplay = Aireplay(self.target,
'forgedreplay',
client_mac=client_mac,
Expand All @@ -206,7 +206,7 @@ def run(self):
break
else:
Color.pl('\n{!} {O}aireplay-ng exited unexpectedly{W}')
Color.pl('{?} {O}Command: {R}%s{W}' % " ".join(aireplay.cmd))
Color.pl('{?} {O}Command: {R}%s{W}' % ' '.join(aireplay.cmd))
Color.pl('{?} {O}Output:\n{R}%s{W}' % aireplay.get_output())
break # Continue to other attacks

Expand Down Expand Up @@ -268,29 +268,29 @@ def user_wants_to_stop(self, current_attack, attacks_remaining, target):
or if we should stop attacking this target (returns True).
'''
if target is None:
Color.pl("")
Color.pl('')
return True
target_name = target.essid if target.essid_known else target.bssid

Color.pl("\n\n{!} {O}Interrupted")
Color.pl("{+} {W}Next steps:")
Color.pl('\n\n{!} {O}Interrupted')
Color.pl('{+} {W}Next steps:')

# Deauth clients & retry
attack_index = 1
Color.pl(" {G}1{W}: {O}Deauth clients{W} and {G}retry{W} {C}%s attack{W} against {G}%s{W}" % (current_attack, target_name))
Color.pl(' {G}1{W}: {O}Deauth clients{W} and {G}retry{W} {C}%s attack{W} against {G}%s{W}' % (current_attack, target_name))

# Move onto a different WEP attack
for attack_name in attacks_remaining:
attack_index += 1
Color.pl(" {G}%d{W}: Start new {C}%s attack{W} against {G}%s{W}" % (attack_index, attack_name, target_name))
Color.pl(' {G}%d{W}: Start new {C}%s attack{W} against {G}%s{W}' % (attack_index, attack_name, target_name))

# Stop attacking entirely
attack_index += 1
Color.pl(" {G}%d{W}: {R}Stop attacking, {O}Move onto next target{W}" % attack_index)
Color.pl(' {G}%d{W}: {R}Stop attacking, {O}Move onto next target{W}' % attack_index)
while True:
answer = raw_input(Color.s("{?} Select an option ({G}1-%d{W}): " % attack_index))
answer = raw_input(Color.s('{?} Select an option ({G}1-%d{W}): ' % attack_index))
if not answer.isdigit() or int(answer) < 1 or int(answer) > attack_index:
Color.pl("{!} {R}Invalid input: {O}Must enter a number between {G}1-%d{W}" % attack_index)
Color.pl('{!} {R}Invalid input: {O}Must enter a number between {G}1-%d{W}' % attack_index)
continue
answer = int(answer)
break
Expand All @@ -300,7 +300,7 @@ def user_wants_to_stop(self, current_attack, attacks_remaining, target):
deauth_count = 1
Color.clear_entire_line()

Color.p("\r{+} {O}Deauthenticating *broadcast*{W} (all clients)...")
Color.p('\r{+} {O}Deauthenticating *broadcast*{W} (all clients)...')
Aireplay.deauth(target.bssid, essid=target.essid)

attacking_mac = Ifconfig.get_mac(Configuration.interface)
Expand All @@ -309,13 +309,13 @@ def user_wants_to_stop(self, current_attack, attacks_remaining, target):
continue # Don't deauth ourselves.

Color.clear_entire_line()
Color.p("\r{+} {O}Deauthenticating client {C}%s{W}..." % client.station)
Color.p('\r{+} {O}Deauthenticating client {C}%s{W}...' % client.station)

Aireplay.deauth(target.bssid, client_mac=client.station, essid=target.essid)
deauth_count += 1

Color.clear_entire_line()
Color.pl("\r{+} Sent {C}%d {O}deauths{W}" % deauth_count)
Color.pl('\r{+} Sent {C}%d {O}deauths{W}' % deauth_count)

# Re-insert current attack to top of list of attacks remaining
attacks_remaining.insert(0, current_attack)
Expand Down Expand Up @@ -357,7 +357,7 @@ def fake_auth(self):
if __name__ == '__main__':
Configuration.initialize(True)
from ..model.target import Target
fields = "A4:2B:8C:16:6B:3A, 2015-05-27 19:28:44, 2015-05-27 19:28:46, 6, 54e,WEP, WEP, , -58, 2, 0, 0. 0. 0. 0, 9, Test Router Please Ignore, ".split(',')
fields = 'A4:2B:8C:16:6B:3A, 2015-05-27 19:28:44, 2015-05-27 19:28:46, 6, 54e,WEP, WEP, , -58, 2, 0, 0. 0. 0. 0, 9, Test Router Please Ignore, '.split(',')
target = Target(fields)
wep = AttackWEP(target)
wep.run()
Expand Down
2 changes: 1 addition & 1 deletion wifite/attack/wps.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def run_reaver(self):
from ..tools.reaver import Reaver
reaver = Reaver(self.target)
if not reaver.is_pixiedust_supported():
Color.pl("{!} {R}your version of 'reaver' does not support the {O}WPS pixie-dust attack{W}")
Color.pl('{!} {R}your version of "reaver" does not support the {O}WPS pixie-dust attack{W}')
return False
else:
# Reaver: Pixie-dust
Expand Down
8 changes: 4 additions & 4 deletions wifite/util/scanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def print_targets(self):
return

if self.previous_target_count > 0:
# We need to "overwrite" the previous list of targets.
# We need to 'overwrite' the previous list of targets.
if Configuration.verbose <= 1:
# Don't clear screen buffer in verbose mode.
if self.previous_target_count > len(self.targets) or \
Expand All @@ -125,7 +125,7 @@ def print_targets(self):
Process.call('clear')
else:
# We can fit the targets in the terminal without scrolling
# "Move" cursor up so we will print over the previous list
# 'Move' cursor up so we will print over the previous list
Color.pl(Scanner.UP_CHAR * (3 + self.previous_target_count))

self.previous_target_count = len(self.targets)
Expand Down Expand Up @@ -188,7 +188,7 @@ def select_targets(self):
+ ' You may need to wait longer,'
+ ' or you may have issues with your wifi card')

# Return all targets if user specified a wait time ("pillage").
# Return all targets if user specified a wait time ('pillage').
if Configuration.scan_time > 0:
return self.targets

Expand Down Expand Up @@ -224,7 +224,7 @@ def select_targets(self):


if __name__ == '__main__':
# "Test" script will display targets and selects the appropriate one
# 'Test' script will display targets and selects the appropriate one
Configuration.initialize()
try:
s = Scanner()
Expand Down

0 comments on commit ebb7cac

Please sign in to comment.