WEP attack specification via command-line
This commit is contained in:
@@ -88,6 +88,30 @@ class Arguments(object):
|
|||||||
type=int,
|
type=int,
|
||||||
help='Restart aircrack after this delay (default: %ds)'
|
help='Restart aircrack after this delay (default: %ds)'
|
||||||
% Configuration.wep_restart_aircrack)
|
% Configuration.wep_restart_aircrack)
|
||||||
|
wep.add_argument('-arpreplay',
|
||||||
|
action='store_true',
|
||||||
|
dest='wep_attack_replay',
|
||||||
|
help='use ARP-replay WEP attack (default: on)')
|
||||||
|
wep.add_argument('-fragment',
|
||||||
|
action='store_true',
|
||||||
|
dest='wep_attack_fragment',
|
||||||
|
help='use fragmentation WEP attack (default: on)')
|
||||||
|
wep.add_argument('-chopchop',
|
||||||
|
action='store_true',
|
||||||
|
dest='wep_attack_chopchop',
|
||||||
|
help='use chop-chop WEP attack (default: on)')
|
||||||
|
wep.add_argument('-caffelatte',
|
||||||
|
action='store_true',
|
||||||
|
dest='wep_attack_caffe',
|
||||||
|
help='use caffe-latte WEP attack (default: on)')
|
||||||
|
wep.add_argument('-p0841',
|
||||||
|
action='store_true',
|
||||||
|
dest='wep_attack_p0841',
|
||||||
|
help='use p0841 WEP attack (default: on)')
|
||||||
|
wep.add_argument('-hirte',
|
||||||
|
action='store_true',
|
||||||
|
dest='wep_attack_hirte',
|
||||||
|
help='use ARP-replay WEP attack (default: on)')
|
||||||
|
|
||||||
# WPA
|
# WPA
|
||||||
wpa = parser.add_argument_group('WPA-RELATED')
|
wpa = parser.add_argument_group('WPA-RELATED')
|
||||||
|
|||||||
@@ -54,15 +54,7 @@ class AttackWEP(Attack):
|
|||||||
|
|
||||||
aircrack = None # Aircrack process, not started yet
|
aircrack = None # Aircrack process, not started yet
|
||||||
|
|
||||||
wep_attack_types = [
|
for attack_name in Configuration.wep_attacks:
|
||||||
'replay',
|
|
||||||
'chopchop',
|
|
||||||
'fragment',
|
|
||||||
'caffelatte',
|
|
||||||
'p0841',
|
|
||||||
'hirte'
|
|
||||||
]
|
|
||||||
for attack_name in wep_attack_types:
|
|
||||||
# Convert to WEPAttackType.
|
# Convert to WEPAttackType.
|
||||||
wep_attack_type = WEPAttackType(attack_name)
|
wep_attack_type = WEPAttackType(attack_name)
|
||||||
|
|
||||||
|
|||||||
@@ -43,12 +43,7 @@ class Configuration(object):
|
|||||||
# "0" means never restart.
|
# "0" means never restart.
|
||||||
Configuration.wep_restart_aircrack = 30 # Seconds to give aircrack to crack
|
Configuration.wep_restart_aircrack = 30 # Seconds to give aircrack to crack
|
||||||
# before restarting the process.
|
# before restarting the process.
|
||||||
# WEP-specific attacks
|
Configuration.wep_crack_at_ivs = 10000 # Number of IVS to start cracking
|
||||||
Configuration.wep_fragment = True
|
|
||||||
Configuration.wep_caffelatte = True
|
|
||||||
Configuration.wep_p0841 = True
|
|
||||||
Configuration.wep_hirte = True
|
|
||||||
Configuration.wep_crack_at_ivs = 10000 # Number of IVS to start cracking
|
|
||||||
|
|
||||||
# WPA variables
|
# WPA variables
|
||||||
Configuration.wpa_filter = False # Only attack WPA networks
|
Configuration.wpa_filter = False # Only attack WPA networks
|
||||||
@@ -189,20 +184,46 @@ class Configuration(object):
|
|||||||
Color.pl('{+} {C}option:{W} will {G}NOT{W} ignore WPS rate limits')
|
Color.pl('{+} {C}option:{W} will {G}NOT{W} ignore WPS rate limits')
|
||||||
|
|
||||||
# Adjust encryption filter
|
# Adjust encryption filter
|
||||||
if Configuration.wep_filter or \
|
Configuration.encryption_filter = []
|
||||||
Configuration.wpa_filter or \
|
|
||||||
Configuration.wps_filter:
|
|
||||||
# Reset filter
|
|
||||||
Configuration.encryption_filter = []
|
|
||||||
if Configuration.wep_filter: Configuration.encryption_filter.append('WEP')
|
if Configuration.wep_filter: Configuration.encryption_filter.append('WEP')
|
||||||
if Configuration.wpa_filter: Configuration.encryption_filter.append('WPA')
|
if Configuration.wpa_filter: Configuration.encryption_filter.append('WPA')
|
||||||
if Configuration.wps_filter: Configuration.encryption_filter.append('WPS')
|
if Configuration.wps_filter: Configuration.encryption_filter.append('WPS')
|
||||||
|
|
||||||
if len(Configuration.encryption_filter) == 3:
|
if len(Configuration.encryption_filter) == 3:
|
||||||
Color.pl('{+} {C}option:{W} targeting {G}all encrypted networks{W}')
|
Color.pl('{+} {C}option:{W} targeting {G}all encrypted networks{W}')
|
||||||
|
elif len(Configuration.encryption_filter) == 0:
|
||||||
|
# Default to scan all types
|
||||||
|
Configuration.encryption_filter = ['WEP', 'WPA', 'WPS']
|
||||||
else:
|
else:
|
||||||
Color.pl('{+} {C}option:{W} targeting networks with encryption: {G}%s{W}'
|
Color.pl('{+} {C}option:{W} ' +
|
||||||
% ' or '.join(Configuration.encryption_filter))
|
'targeting {G}%s-encrypted{W} networks'
|
||||||
|
% '/'.join(Configuration.encryption_filter))
|
||||||
|
|
||||||
|
# Adjust WEP attack list
|
||||||
|
Configuration.wep_attacks = []
|
||||||
|
import sys
|
||||||
|
seen = set()
|
||||||
|
for arg in sys.argv:
|
||||||
|
if arg in seen: continue
|
||||||
|
seen.add(arg)
|
||||||
|
if arg == '-arpreplay': Configuration.wep_attacks.append('replay')
|
||||||
|
if arg == '-fragment': Configuration.wep_attacks.append('fragment')
|
||||||
|
if arg == '-chopchop': Configuration.wep_attacks.append('chopchop')
|
||||||
|
if arg == '-caffelatte': Configuration.wep_attacks.append('caffelatte')
|
||||||
|
if arg == '-p0841': Configuration.wep_attacks.append('p0841')
|
||||||
|
if arg == '-hirte': Configuration.wep_attacks.append('hirte')
|
||||||
|
|
||||||
|
if len(Configuration.wep_attacks) == 0:
|
||||||
|
# Use all attacks
|
||||||
|
Configuration.wep_attacks = ['replay',
|
||||||
|
'fragment',
|
||||||
|
'chopchop',
|
||||||
|
'caffelatte',
|
||||||
|
'p0841',
|
||||||
|
'hirte']
|
||||||
|
elif len(Configuration.wep_attacks) > 0:
|
||||||
|
Color.pl('{+} {C}option:{W} using {G}%s{W} WEP attacks'
|
||||||
|
% '{W}, {G}'.join(Configuration.wep_attacks))
|
||||||
|
|
||||||
# Commands
|
# Commands
|
||||||
if args.cracked: Configuration.show_cracked = True
|
if args.cracked: Configuration.show_cracked = True
|
||||||
|
|||||||
Reference in New Issue
Block a user