Don't kill+restart aircrack after 30s, wait 60s for target,

Also detect enabled/disabled interfaces when putting in/out of monitor mode.
This commit is contained in:
derv82
2018-04-19 12:59:11 -04:00
parent 1bbc7fefaf
commit adc7d37318
5 changed files with 23 additions and 8 deletions

View File

@@ -222,7 +222,7 @@ class Aireplay(Thread):
if pps == "0":
self.status = "Waiting for packet..."
else:
self.status = "Replaying packet @ %s/sec" % pps
self.status = "Replaying @ %s/sec" % pps
pass
def __del__(self):

View File

@@ -213,7 +213,7 @@ class Airmon(object):
airmon_output = Process(['airmon-ng', 'stop', iface]).stdout()
disabled_iface = Airmon._parse_airmon_stop(airmon_output)
(disabled_iface, enabled_iface) = Airmon._parse_airmon_stop(airmon_output)
if not disabled_iface and iface in Airmon.BAD_DRIVERS:
Color.p('{O}"bad driver" detected{W} ')
@@ -224,6 +224,8 @@ class Airmon(object):
else:
Color.pl('{O}could not disable on {R}%s{W}' % iface)
return (disabled_iface, enabled_iface)
@staticmethod
def _parse_airmon_stop(airmon_output):
@@ -235,17 +237,25 @@ class Airmon(object):
# airmon-ng 1.2rc1 output: wlan0mon (removed)
removed_re = re.compile(r'([a-zA-Z0-9]+).*\(removed\)')
# Enabled interface: (mac80211 station mode vif enabled on [phy4]wlan0)
enabled_re = re.compile(r'\s*\(mac80211 station mode (?:vif )?enabled on (?:\[\w+\])?(\w+)\)\s*')
disabled_iface = None
enabled_iface = None
for line in airmon_output.split('\n'):
matches = disabled_re.match(line)
if matches:
return matches.group(1)
disabled_iface = matches.group(1)
matches = removed_re.match(line)
if matches:
return matches.group(1)
disabled_iface = matches.group(1)
return None
matches = enabled_re.match(line)
if matches:
enabled_iface = matches.group(1)
return (disabled_iface, enabled_iface)
@staticmethod
@@ -386,4 +396,6 @@ class Airmon(object):
if __name__ == '__main__':
Airmon.terminate_conflicting_processes()
iface = Airmon.ask()
Airmon.stop(iface)
(disabled_iface, enabled_iface) = Airmon.stop(iface)
print("Disabled:", disabled_iface)
print("Enabled:", enabled_iface)

View File

@@ -10,11 +10,12 @@ class Ifconfig(object):
'''Put interface up'''
from ..util.process import Process
command = ['ifconfig', interface, 'up']
command = ['ifconfig', interface]
if type(args) is list:
command.extend(args)
elif type(args) is 'str':
command.append(args)
command.append('up')
pid = Process(command)
pid.wait()