diff --git a/py/Airmon.py b/py/Airmon.py index 49ce750..01cb7a4 100644 --- a/py/Airmon.py +++ b/py/Airmon.py @@ -250,6 +250,17 @@ class Airmon(object): ' {R}%s{O} (PID {R}%s{O})' % (pname, pid)) os.kill(int(pid), signal.SIGTERM) + @staticmethod + def put_interfaces_up(): + Color.pl("{+} {O}Putting interfaces up...") + for interface in Airmon.get_interfaces(): + Color.pl("{+} {B}up into {O}%s" %(interface.name)) + (out,err) = Process.call('ifconfig %s up' %(interface.name)) + + @staticmethod + def start_network_manager(): + Color.pl("{+} {O}Starting NetworkManager") + (out,err) = Process.call('systemctl start NetworkManager') if __name__ == '__main__': Airmon.terminate_conflicting_processes() diff --git a/py/Configuration.py b/py/Configuration.py index e09dbb1..7ded288 100644 --- a/py/Configuration.py +++ b/py/Configuration.py @@ -288,6 +288,10 @@ class Configuration(object): ''' Deletes temp and exist with the given code ''' Configuration.delete_temp() Macchanger.reset_if_changed() + from Airmon import Airmon + Airmon.stop(Configuration.interface) + Airmon.put_interfaces_up() + Airmon.start_network_manager() exit(code) @staticmethod @@ -312,4 +316,3 @@ class Configuration(object): if __name__ == '__main__': Configuration.initialize(False) print Configuration.dump() - diff --git a/py/Interface.py b/py/Interface.py index 19aa9ba..61c2725 100644 --- a/py/Interface.py +++ b/py/Interface.py @@ -92,10 +92,11 @@ class Interface(object): mac_regex = ('[a-zA-Z0-9]{2}-' * 6)[:-1] match = re.search(' (%s)' % mac_regex, output) if not match: - raise Exception('Could not find the mac address for %s' % iface) + match = re.search('unspec (%s)' % mac_regex, output) + if not match: + raise Exception('Could not find the mac address for %s' % iface) return match.groups()[0].replace('-', ':') if __name__ == '__main__': mac = Interface.get_mac() print 'wlan0mon mac address:', mac -