Consolidate scan_time and pillage into one argument
This commit is contained in:
@@ -17,12 +17,6 @@ class Arguments(object):
|
|||||||
|
|
||||||
# Global variables
|
# Global variables
|
||||||
glob = parser.add_argument_group('SETTINGS')
|
glob = parser.add_argument_group('SETTINGS')
|
||||||
glob.add_argument('-s',
|
|
||||||
action='store',
|
|
||||||
dest='scan_time',
|
|
||||||
metavar='[scantime]',
|
|
||||||
type=int,
|
|
||||||
help=Color.s('Seconds to scan before attacking (default: {G}ask{W})'))
|
|
||||||
glob.add_argument('-i',
|
glob.add_argument('-i',
|
||||||
action='store',
|
action='store',
|
||||||
dest='interface',
|
dest='interface',
|
||||||
@@ -79,9 +73,13 @@ class Arguments(object):
|
|||||||
help=Color.s('Number of deauth packets to send (default: {G}%d{W})' % Configuration.num_deauths))
|
help=Color.s('Number of deauth packets to send (default: {G}%d{W})' % Configuration.num_deauths))
|
||||||
glob.add_argument('-p',
|
glob.add_argument('-p',
|
||||||
action='store',
|
action='store',
|
||||||
dest='pillage',
|
dest='scan_time',
|
||||||
type=bool,
|
nargs='?',
|
||||||
help=Color.s('Pillage "All" mode to attack everything (default: {G}ask{W})'))
|
const=10,
|
||||||
|
metavar='scantime',
|
||||||
|
type=int,
|
||||||
|
help=Color.s('{G}Pillage{W}: Attack all targets after {C}scantime{W} seconds'))
|
||||||
|
glob.add_argument('--pillage', help=argparse.SUPPRESS, action='store', dest='scan_time', nargs='?', const=10, type=int)
|
||||||
|
|
||||||
# WEP
|
# WEP
|
||||||
wep = parser.add_argument_group('WEP-RELATED')
|
wep = parser.add_argument_group('WEP-RELATED')
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ class Configuration(object):
|
|||||||
|
|
||||||
Configuration.verbose = 0 # Verbosity level.
|
Configuration.verbose = 0 # Verbosity level.
|
||||||
|
|
||||||
Configuration.scan_time = 0 # Scan time
|
Configuration.scan_time = 0 # Time to wait before attacking all targets
|
||||||
Configuration.all_targets = False # Run attacks against all targets automatically
|
Configuration.all_targets = False # Run attacks against all targets automatically
|
||||||
|
|
||||||
Configuration.tx_power = 0 # Wifi transmit power (0 is default)
|
Configuration.tx_power = 0 # Wifi transmit power (0 is default)
|
||||||
@@ -37,7 +37,6 @@ class Configuration(object):
|
|||||||
Configuration.target_essid = None # User-defined AP name
|
Configuration.target_essid = None # User-defined AP name
|
||||||
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.random_mac = False # Should generate a random Mac address at startup.
|
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.num_deauths = 1 # Number of deauth packets to send to each target.
|
||||||
@@ -143,10 +142,7 @@ class Configuration(object):
|
|||||||
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)
|
||||||
if args.scan_time:
|
if args.scan_time:
|
||||||
Configuration.scan_time = args.scan_time
|
Configuration.scan_time = args.scan_time
|
||||||
Color.pl('{+} {C}option:{W} scan time {G}%d{W}' % args.scan_time)
|
Color.pl('{+} {C}option:{W} ({G}pillage{W}) attack all targets after {G}%d{W}s' % args.scan_time)
|
||||||
if args.pillage:
|
|
||||||
Configuration.verbose = args.pillage
|
|
||||||
Color.pl('{+} {C}option:{W} pillage {G}%d{W}' % args.verbose)
|
|
||||||
if args.verbose:
|
if args.verbose:
|
||||||
Configuration.verbose = args.verbose
|
Configuration.verbose = args.verbose
|
||||||
Color.pl('{+} {C}option:{W} verbosity level {G}%d{W}' % args.verbose)
|
Color.pl('{+} {C}option:{W} verbosity level {G}%d{W}' % args.verbose)
|
||||||
|
|||||||
@@ -23,14 +23,13 @@ class Scanner(object):
|
|||||||
self.targets = []
|
self.targets = []
|
||||||
self.target = None # Specific target (based on ESSID/BSSID)
|
self.target = None # Specific target (based on ESSID/BSSID)
|
||||||
|
|
||||||
scan_time = Configuration.scan_time # currently in seconds
|
|
||||||
|
|
||||||
Color.pl("")
|
Color.pl("")
|
||||||
# Loads airodump with interface/channel/etc from Configuration
|
# Loads airodump with interface/channel/etc from Configuration
|
||||||
with Airodump() as airodump:
|
with Airodump() as airodump:
|
||||||
try:
|
try:
|
||||||
# Loop until interrupted (Ctrl+C) or until scan_time is reached (if scan_time was defined)
|
# Loop until interrupted (Ctrl+C)
|
||||||
start_time = time()
|
scan_start_time = time()
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
if airodump.pid.poll() is not None:
|
if airodump.pid.poll() is not None:
|
||||||
# Airodump process died!
|
# Airodump process died!
|
||||||
@@ -65,8 +64,10 @@ class Scanner(object):
|
|||||||
outline += " {G}%s{W}) " % ", ".join([x.essid for x in decloaked])
|
outline += " {G}%s{W}) " % ", ".join([x.essid for x in decloaked])
|
||||||
Color.clear_entire_line()
|
Color.clear_entire_line()
|
||||||
Color.p(outline)
|
Color.p(outline)
|
||||||
if scan_time > 0 and time() > (start_time + scan_time):
|
|
||||||
|
if Configuration.scan_time > 0 and time() > scan_start_time + Configuration.scan_time:
|
||||||
return
|
return
|
||||||
|
|
||||||
sleep(1)
|
sleep(1)
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
pass
|
pass
|
||||||
@@ -157,7 +158,9 @@ class Scanner(object):
|
|||||||
+ " You may need to wait longer,"
|
+ " You may need to wait longer,"
|
||||||
+ " or you may have issues with your wifi card")
|
+ " or you may have issues with your wifi card")
|
||||||
|
|
||||||
if not (Configuration.pillage is True):
|
if Configuration.scan_time > 0:
|
||||||
|
return self.targets
|
||||||
|
|
||||||
self.print_targets()
|
self.print_targets()
|
||||||
Color.clear_entire_line()
|
Color.clear_entire_line()
|
||||||
input_str = '{+} select target(s)'
|
input_str = '{+} select target(s)'
|
||||||
@@ -182,8 +185,6 @@ class Scanner(object):
|
|||||||
else:
|
else:
|
||||||
pass
|
pass
|
||||||
return chosen_targets
|
return chosen_targets
|
||||||
else:
|
|
||||||
return self.targets
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
# Example displays targets and selects the appropriate one
|
# Example displays targets and selects the appropriate one
|
||||||
|
|||||||
Reference in New Issue
Block a user