Custom number of deauths.
Also fixed bug with Airodump's ESSID decloaking: now specifies target access point. Should resolve #31
This commit is contained in:
@@ -322,7 +322,8 @@ class Aireplay(Thread):
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def deauth(target_bssid, essid=None, client_mac=None, num_deauths=1, timeout=2):
|
def deauth(target_bssid, essid=None, client_mac=None, num_deauths=None, timeout=2):
|
||||||
|
num_deauths = num_deauths or Configuration.num_deauths
|
||||||
deauth_cmd = [
|
deauth_cmd = [
|
||||||
"aireplay-ng",
|
"aireplay-ng",
|
||||||
"-0", # Deauthentication
|
"-0", # Deauthentication
|
||||||
|
|||||||
@@ -269,7 +269,7 @@ class Airodump(object):
|
|||||||
deauth_cmd = [
|
deauth_cmd = [
|
||||||
'aireplay-ng',
|
'aireplay-ng',
|
||||||
'-0', # Deauthentication
|
'-0', # Deauthentication
|
||||||
'1', # Number of deauths to perform.
|
str(Configuration.num_deauths), # Number of deauth packets to send
|
||||||
'--ignore-negative-one'
|
'--ignore-negative-one'
|
||||||
]
|
]
|
||||||
for target in self.targets:
|
for target in self.targets:
|
||||||
@@ -290,7 +290,7 @@ class Airodump(object):
|
|||||||
Process(deauth_cmd + ['-a', target.bssid, iface])
|
Process(deauth_cmd + ['-a', target.bssid, iface])
|
||||||
# Deauth clients
|
# Deauth clients
|
||||||
for client in target.clients:
|
for client in target.clients:
|
||||||
Process(deauth_cmd + ['-c', client.bssid, iface])
|
Process(deauth_cmd + ['-a', target.bssid, '-c', client.bssid, iface])
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
''' Example usage. wlan0mon should be in Monitor Mode '''
|
''' Example usage. wlan0mon should be in Monitor Mode '''
|
||||||
|
|||||||
@@ -64,6 +64,13 @@ class Arguments(object):
|
|||||||
action='store_true',
|
action='store_true',
|
||||||
dest='no_deauth',
|
dest='no_deauth',
|
||||||
help=Color.s('Do not deauthenticate clients *EVER* (default: {G}off{W})'))
|
help=Color.s('Do not deauthenticate clients *EVER* (default: {G}off{W})'))
|
||||||
|
glob.add_argument('--num-deauths',
|
||||||
|
action='store',
|
||||||
|
type=int,
|
||||||
|
dest='num_deauths',
|
||||||
|
metavar="[num]",
|
||||||
|
default=None,
|
||||||
|
help=Color.s('Number of deauth packets to send (default: {G}%d{W})' % Configuration.num_deauths))
|
||||||
|
|
||||||
# WEP
|
# WEP
|
||||||
wep = parser.add_argument_group('WEP-RELATED')
|
wep = parser.add_argument_group('WEP-RELATED')
|
||||||
|
|||||||
@@ -264,7 +264,7 @@ class AttackWEP(Attack):
|
|||||||
|
|
||||||
if answer == 1:
|
if answer == 1:
|
||||||
# Deauth clients & retry
|
# Deauth clients & retry
|
||||||
num_deauths = 1
|
deauth_count = 1
|
||||||
Color.clear_entire_line()
|
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)
|
Aireplay.deauth(target.bssid, essid=target.essid)
|
||||||
@@ -272,9 +272,9 @@ class AttackWEP(Attack):
|
|||||||
Color.clear_entire_line()
|
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)
|
Aireplay.deauth(target.bssid, client_mac=client.station, essid=target.essid)
|
||||||
num_deauths += 1
|
deauth_count += 1
|
||||||
Color.clear_entire_line()
|
Color.clear_entire_line()
|
||||||
Color.pl("\r{+} Sent {C}%d {O}deauths{W}" % num_deauths)
|
Color.pl("\r{+} Sent {C}%d {O}deauths{W}" % deauth_count)
|
||||||
# Re-insert current attack to top of list of attacks remaining
|
# Re-insert current attack to top of list of attacks remaining
|
||||||
attacks_remaining.insert(0, current_attack)
|
attacks_remaining.insert(0, current_attack)
|
||||||
return False # Don't stop
|
return False # Don't stop
|
||||||
|
|||||||
@@ -250,7 +250,7 @@ class AttackWPA(Attack):
|
|||||||
target,
|
target,
|
||||||
"Handshake capture",
|
"Handshake capture",
|
||||||
"Deauthing {O}%s{W}" % target_name)
|
"Deauthing {O}%s{W}" % target_name)
|
||||||
Aireplay.deauth(target.bssid, client_mac=client, num_deauths=1, timeout=2)
|
Aireplay.deauth(target.bssid, client_mac=client, timeout=2)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
from Target import Target
|
from Target import Target
|
||||||
|
|||||||
@@ -35,8 +35,9 @@ class Configuration(object):
|
|||||||
Configuration.target_bssid = None # User-defined AP BSSID
|
Configuration.target_bssid = None # User-defined AP BSSID
|
||||||
Configuration.five_ghz = False # Scan 5Ghz channels
|
Configuration.five_ghz = False # Scan 5Ghz channels
|
||||||
Configuration.pillage = False # "All" mode to attack everything
|
Configuration.pillage = False # "All" mode to attack everything
|
||||||
Configuration.random_mac = False
|
Configuration.random_mac = False # Should generate a random Mac address at startup.
|
||||||
Configuration.no_deauth = False # Deauth hidden networks & WPA handshake targets
|
Configuration.no_deauth = False # Deauth hidden networks & WPA handshake targets
|
||||||
|
Configuration.num_deauths = 1 # Number of deauth packets to send to each target.
|
||||||
|
|
||||||
Configuration.encryption_filter = ['WEP', 'WPA', 'WPS']
|
Configuration.encryption_filter = ['WEP', 'WPA', 'WPS']
|
||||||
|
|
||||||
@@ -131,6 +132,9 @@ class Configuration(object):
|
|||||||
if args.no_deauth == True:
|
if args.no_deauth == True:
|
||||||
Configuration.no_deauth = True
|
Configuration.no_deauth = True
|
||||||
Color.pl('{+} {C}option:{W} will {R}not{W} {O}deauth{W} clients during scans or captures')
|
Color.pl('{+} {C}option:{W} will {R}not{W} {O}deauth{W} clients during scans or captures')
|
||||||
|
if args.num_deauths and args.num_deauths > 0:
|
||||||
|
Configuration.num_deauths = args.num_deauths
|
||||||
|
Color.pl('{+} {C}option:{W} will send {G}%d{W} deauth packets when deauthing' % Configuration.num_deauths)
|
||||||
if args.target_essid:
|
if args.target_essid:
|
||||||
Configuration.target_essid = args.target_essid
|
Configuration.target_essid = args.target_essid
|
||||||
Color.pl('{+} {C}option:{W} targeting ESSID {G}%s{W}' % args.target_essid)
|
Color.pl('{+} {C}option:{W} targeting ESSID {G}%s{W}' % args.target_essid)
|
||||||
|
|||||||
Reference in New Issue
Block a user