def setUp(self): self.cnc_ip = "127.0.0.1" self.cnc_port = "5000" # Run cnc cnc_thread = cnc_main.cnc() cnc_thread.setDaemon(True) cnc_thread.start() try: shutil.rmtree('build') os.remove('in.spec') os.remove('pre.spec') os.remove('post.spec') except: pass if os.path.isdir('c:/temp_deletemeplease'): shutil.rmtree('c:/temp_deletemeplease') with mock.patch('agent.agent_main.input', side_effect=["127.0.0.1", 5000]): # run agent stub agent, self.agent_id, agent_ip, agent_port = agent_main.agent() agent.setDaemon(True) agent.start()
def __init__(self, malware_name): self.cnc_ip = "127.0.0.1" self.cnc_port = "5000" self.malware_exe_path = self.STORAGE_PATH + f"\\{malware_name}.exe" self.malware_csv_path = self.STORAGE_PATH + f"\\{malware_name}.csv" self.malware_json_path = self.STORAGE_PATH + f"\\{malware_name}.json" # Run cnc cnc_thread = cnc_main.cnc() cnc_thread.setDaemon(True) cnc_thread.start() with mock.patch('agent.agent_main.input', side_effect=["127.0.0.1", 5000]): from agent import agent_main # run agent stub agent, self.agent_id, agent_ip, agent_port = agent_main.agent() agent.setDaemon(True) agent.start() values = {'malware_name': f'malware_name_Acceptance', 'malware_description': malware_name } test_status = False self.values = values
def setUp(self): if os.path.isdir('c:/temp_deletemeplease'): shutil.rmtree('c:/temp_deletemeplease') with mock.patch('agent.agent_main.input', return_value="-1"): with mock.patch('agent.agent_main.turn_agent_active', return_value=True): agent_thread, agent_id, self.agent_ip, self.agent_port = agent_main.agent( ) agent_thread.setDaemon(True) agent_thread.start()
def setUp(self): self.cnc_ip = "127.0.0.1" self.cnc_port = "5000" # Run cnc cnc_thread = cnc_main.cnc() cnc_thread.setDaemon(True) cnc_thread.start() with mock.patch('agent.agent_main.input', side_effect=["127.0.0.1", 5000]): # run agent stub agent, agent_id, agent_ip, agent_port = agent_main.agent() agent.setDaemon(True) agent.start()
def setUp(self): # self.sr = SystemRunner('Ardamax') self.cnc_ip = "127.0.0.1" self.cnc_port = "5000" try: shutil.rmtree('build') os.remove('in.spec') os.remove('pre.spec') os.remove('post.spec') except: pass # Run cnc cnc_thread = cnc_main.cnc() cnc_thread.setDaemon(True) cnc_thread.start() with mock.patch('agent.agent_main.input', side_effect=["127.0.0.1", 5000]): # run agent stub agent, self.agent_id, agent_ip, agent_port = agent_main.agent() agent.setDaemon(True) agent.start()