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

Method processor

modules/smtp/strong_password/__init__.py:22–45  ·  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

20 self.log_filename_dump = 'tmp/ohp_smtp_honeypot_logs.json'
21
22 def processor(self):
23 """
24 processor function will be called as a new thread and will be die when kill_flag is True
25 :return:
26 """
27 if os.path.exists(self.log_filename):
28 os.remove(self.log_filename) # remove if exist from past
29 while not self.kill_flag:
30 if os.path.exists(self.log_filename):
31 os.rename(self.log_filename, self.log_filename_dump)
32 data_dump = open(self.log_filename_dump).readlines()
33 for data in data_dump:
34 data = json.loads(data)
35 insert_to_credential_events_collection(
36 CredentialEvent(
37 ip_src=data['ip'],
38 module_name=data['module_name'],
39 date=data['date'],
40 username=data['username'],
41 password=data['password'],
42 )
43 )
44 os.remove(self.log_filename_dump)
45 time.sleep(0.1)
46
47
48def module_configuration():

Callers

nothing calls this directly

Calls 2

CredentialEventClass · 0.90

Tested by

no test coverage detected