def main(): ''' @brief AtEar main function. ''' wids_process = False from module.network import auto_monitor, stop_monitor try: print "START AtEar-Beta...." # def AtEar-Beta.module.network.stop_monitor() line 314 # Clear the self-made device. stop_monitor() # def AtEar-Beta.module.network.auto_monitor() line 272 # Search for wireless devices, ensure that the support AP mode or monitor mode, # if support makes the device to the supported mode. ret = auto_monitor() if ret == False: # Not supported or Failed to create device in monitor. stop_monitor() return -1 # class AtEar-Beta.module.wids.Wireless_IDS # Prepare a file to store the results. print "START AtEar-WIDS" wids = Wireless_IDS('atear_wids') # def AtEar-Beta.module.wids.Wireless_IDS.run(self) line 78 # Generate wids.run to child process. wids_process = Process(target=wids.run) wids_process.start() print "START AtEar-UI" # Class "main_app" is a flask module. main_app(wids) # Stop Signal except KeyboardInterrupt: stop_monitor() if wids_process: wids_process.terminate()
def main(): ''' @brief AtEar main function. ''' wids_process = False from module.network import auto_monitor, stop_monitor try: print "START AtEar-Beta...." # def AtEar-Beta.module.network.stop_monitor() line 314 # Clear the self-made device. stop_monitor() # def AtEar-Beta.module.network.auto_monitor() line 272 # Search for wireless devices, ensure that the support AP mode or monitor mode, # if support makes the device to the supported mode. ret = auto_monitor() if ret == False: # Not supported or Failed to create device in monitor. stop_monitor() return -1 # class AtEar-Beta.module.wids.Wireless_IDS # Prepare a file to store the results. print "[*] START AtEar-WIDS" wids = Wireless_IDS('atear_wids') # def AtEar-Beta.module.wids.Wireless_IDS.run(self) line 78 # Generate wids.run to child process. wids.start() print "[*] START AtEar-UI" # Class "main_app" is a flask module. main_app(wids) # Stop Signal except KeyboardInterrupt: stop_monitor() if wids_process: wids_process.terminate()
return json.dumps([{}]) return '', 200 def hidden(self, wids_option): if request.method == 'GET': if wids_option == '1': recent_val = wids.get_recent_values() try: recent_val = ast.literal_eval(recent_val) return json.dumps({"message": recent_val}) except: return json.dumps({"message": []}) elif wids_option == '0': wids.stop() return json.dumps({"message": []}) return '', 200 if __name__ == '__main__': from module.network import auto_monitor, stop_monitor try: stop_monitor() auto_monitor() wids = Wireless_IDS('atear_wids') wids_process = Process(target=wids.run) wids_process.start() main_app() # Stop Signal except KeyboardInterrupt: stop_monitor() wids_process.terminate()