Various small fixes + tweaks
This commit is contained in:
@@ -77,8 +77,8 @@ class AttackWEP(Attack):
|
||||
|
||||
while True:
|
||||
airodump_target = self.wait_for_target(airodump)
|
||||
Color.p('\r{+} running {C}%s{W} WEP attack ({G}%d IVs{W}) '
|
||||
% (attack_name, airodump_target.ivs))
|
||||
Color.pattack("WEP", airodump_target, "%s attack" % attack_name, "%d IVs" % airodump_target.ivs)
|
||||
#Color.p('\r{+} running {C}%s{W} WEP attack ({G}%d IVs{W}) ' % (attack_name, airodump_target.ivs))
|
||||
|
||||
# Check if we cracked it.
|
||||
if aircrack and aircrack.is_cracked():
|
||||
@@ -219,8 +219,7 @@ class AttackWEP(Attack):
|
||||
|
||||
attacks_remaining = Configuration.wep_attacks[attack_index + 1:]
|
||||
Color.pl("{+} {G}%d{W} attacks remain ({C}%s{W})" % (len(attacks_remaining), ', '.join(attacks_remaining)))
|
||||
prompt = Color.s('{+} type {G}c{W} to {G}continue{W}' +
|
||||
' or {R}s{W} to {R}stop{W}: ')
|
||||
prompt = Color.s('{+} type {G}c{W} to {G}continue{W} or {R}s{W} to {R}stop{W}: ')
|
||||
if raw_input(prompt).lower().startswith('s'):
|
||||
return False
|
||||
else:
|
||||
|
||||
@@ -62,6 +62,7 @@ class AttackWPS(Attack):
|
||||
'-b', self.target.bssid,
|
||||
'-c', self.target.channel,
|
||||
'-K', '1', # pixie-dust attack
|
||||
'--session', '/dev/null', # Don't restart session
|
||||
'-vv' # (very) verbose
|
||||
]
|
||||
|
||||
@@ -126,7 +127,7 @@ class AttackWPS(Attack):
|
||||
elif 'Detected AP rate limiting,' in stdout_last_line:
|
||||
if Configuration.wps_skip_rate_limit:
|
||||
Color.pl('{R}failed: {O}hit WPS rate-limit{W}')
|
||||
Color.pl('{!} {O}use {R}--skip-rate-limit{O} to ignore' +
|
||||
Color.pl('{!} {O}use {R}--ignore-ratelimit{O} to ignore' +
|
||||
' this kind of failure in the future{W}')
|
||||
break
|
||||
step = '({C}step -/8{W}) waiting for AP rate limit'
|
||||
@@ -184,7 +185,7 @@ class AttackWPS(Attack):
|
||||
'-i', Configuration.interface,
|
||||
'-b', self.target.bssid,
|
||||
'-c', self.target.channel,
|
||||
'-a', # Automatically restart session
|
||||
'--session', '/dev/null', # Don't restart session
|
||||
'-vv' # verbose
|
||||
]
|
||||
reaver = Process(command, stdout=stdout_write, stderr=Process.devnull())
|
||||
@@ -273,7 +274,7 @@ class AttackWPS(Attack):
|
||||
if Configuration.wps_skip_rate_limit:
|
||||
Color.pl(state)
|
||||
Color.pl('{!} {R}hit rate limit, stopping{W}\n')
|
||||
Color.pl('{!} {O}use {R}--skip-rate-limit{O} to ignore' +
|
||||
Color.pl('{!} {O}use {R}--ignore-ratelimit{O} to ignore' +
|
||||
' this kind of failure in the future{W}')
|
||||
break
|
||||
|
||||
|
||||
13
py/Color.py
13
py/Color.py
@@ -21,7 +21,7 @@ class Color(object):
|
||||
# Helper string replacements
|
||||
replacements = {
|
||||
'{+}': ' {W}[{G}+{W}]',
|
||||
'{!}': ' {W}[{R}!{W}]'
|
||||
'{!}': ' {O}[{R}!{O}]{W}'
|
||||
}
|
||||
|
||||
last_sameline_length = 0
|
||||
@@ -74,6 +74,17 @@ class Color(object):
|
||||
sys.stdout.flush()
|
||||
Color.last_sameline_length = 0
|
||||
|
||||
@staticmethod
|
||||
def pattack(attack_type, target, attack_name, progress):
|
||||
'''
|
||||
Prints a one-liner for an attack
|
||||
Includes attack type (WEP/WPA), target BSSID/ESSID & power, attack type, and progress
|
||||
[name] ESSID (MAC @ Pwr) Attack_Type: Progress
|
||||
e.g.: [WEP] Router2G (00:11:22 @ 23db) replay attack: 102 IVs
|
||||
'''
|
||||
Color.p("\r{+} {G}%s{W} ({C}%s @ %sdb{W}) {G}%s {C}%s{W}: %s " % (
|
||||
target.essid, target.bssid, target.power, attack_type, attack_name, progress))
|
||||
|
||||
if __name__ == '__main__':
|
||||
Color.pl("{R}Testing{G}One{C}Two{P}Three{W}Done")
|
||||
print Color.s("{C}Testing{P}String{W}")
|
||||
|
||||
@@ -90,7 +90,7 @@ class Interface(object):
|
||||
|
||||
output = Process(['ifconfig', iface]).stdout()
|
||||
mac_regex = ('[a-zA-Z0-9]{2}-' * 6)[:-1]
|
||||
match = re.search('HWaddr (%s)' % mac_regex, output)
|
||||
match = re.search(' (%s)' % mac_regex, output)
|
||||
if not match:
|
||||
raise Exception('Could not find the mac address for %s' % iface)
|
||||
return match.groups()[0].replace('-', ':')
|
||||
|
||||
@@ -23,6 +23,7 @@ class Scanner(object):
|
||||
self.targets = []
|
||||
self.target = None # Specific target (based on ESSID/BSSID)
|
||||
|
||||
Color.pl("")
|
||||
# Loads airodump with interface/channel/etc from Configuration
|
||||
with Airodump() as airodump:
|
||||
try:
|
||||
|
||||
@@ -103,10 +103,12 @@ class Target(object):
|
||||
power = Color.s('{%s}%s' % (color, power))
|
||||
|
||||
wps = Color.s('{O} n/a')
|
||||
if self.wps:
|
||||
if self.wps == True:
|
||||
wps = Color.s('{G} yes')
|
||||
else:
|
||||
elif self.wps == False:
|
||||
wps = Color.s('{R} no')
|
||||
else:
|
||||
wps = Color.s('{O} n/a')
|
||||
|
||||
clients = ' '
|
||||
if len(self.clients) == 1:
|
||||
|
||||
19
py/Wash.py
19
py/Wash.py
@@ -2,9 +2,11 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from Process import Process
|
||||
import re
|
||||
|
||||
class Wash(object):
|
||||
''' Wrapper for Wash program. '''
|
||||
BSSID_REGEX = re.compile("([A-F0-9\:]{17})", re.IGNORECASE)
|
||||
|
||||
def __init__(self):
|
||||
pass
|
||||
@@ -33,21 +35,18 @@ class Wash(object):
|
||||
'-f', capfile # Path to cap file
|
||||
]
|
||||
p = Process(command)
|
||||
for line in p.stdout().split('\n'):
|
||||
# Ignore irrelevant lines
|
||||
if line.strip() == '' or line.startswith('Scanning for'):
|
||||
continue
|
||||
bssid = line.split(' ')[0]
|
||||
|
||||
p.wait()
|
||||
if p.poll() != 0:
|
||||
return
|
||||
|
||||
bssids = [bssid.upper() for bssid in Wash.BSSID_REGEX.findall(p.stdout())]
|
||||
for t in targets:
|
||||
t.wps = t.bssid.upper() in bssids
|
||||
if t.bssid.lower() == bssid.lower():
|
||||
# Update the WPS flag
|
||||
t.wps = True
|
||||
|
||||
# Mark other targets as "no" wps support
|
||||
for t in targets:
|
||||
if t.wps: continue
|
||||
t.wps = False
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
from Target import Target
|
||||
|
||||
Reference in New Issue
Block a user