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

Method processor

modules/ftp/strong_password/__init__.py:24–47  ·  view source on GitHub ↗

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

(self)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

CredentialEventClass · 0.90

Tested by

no test coverage detected