MCPcopy Create free account
hub / github.com/OWASP/Python-Honeypot / processor

Method processor

modules/ftp/weak_password/__init__.py:28–50  ·  view source on GitHub ↗

processor function will be called as a new thread and will be die when kill_flag is True :return:

(self)

Source from the content-addressed store, hash-verified

26 os.makedirs(self.DIRECTORY_TO_WATCH)
27
28 def processor(self):
29 """
30 processor function will be called as a new thread and will be die when
31 kill_flag is True
32 :return:
33 """
34 new_file_handler = FileMonitor()
35 new_file_handler.log_filename = self.log_filename
36 new_file_handler.log_filename_dump = self.log_filename_dump
37 new_file_handler.DIRECTORY_TO_WATCH = self.DIRECTORY_TO_WATCH
38 new_file_handler.EXCLUDES = self.EXCLUDES
39 new_file_handler.module_name = self.module_name
40 thread = threading.Thread(target=new_file_handler.run, args=(), name="ftp_weak_password_processor")
41 if os.path.exists(self.log_filename):
42 os.remove(self.log_filename) # remove if exist from past
43 thread.start() # Start the execution
44 while not self.kill_flag:
45 try:
46 time.sleep(0.1)
47 except Exception:
48 pass
49 new_file_handler.stop()
50 terminate_thread(thread)
51
52
53def module_configuration():

Callers

nothing calls this directly

Calls 3

stopMethod · 0.95
FileMonitorClass · 0.90
terminate_threadFunction · 0.90

Tested by

no test coverage detected