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

Function insert_to_credential_events_collection

database/connector.py:197–226  ·  view source on GitHub ↗

insert credentials from honeypot events which are obtained from the module processor to credential_event collection Args: credential_event: Object of CredentialEvent Class with honeypot event credentials Returns: inserted_id

(credential_event: CredentialEvent)

Source from the content-addressed store, hash-verified

195
196
197def insert_to_credential_events_collection(credential_event: CredentialEvent):
198 """
199 insert credentials from honeypot events which are obtained
200 from the module processor to credential_event collection
201
202 Args:
203 credential_event: Object of CredentialEvent Class with honeypot
204 event credentials
205
206 Returns:
207 inserted_id
208 """
209 credential_event.country_ip_src = byte_to_str(
210 IP2Location.get_country_short(
211 credential_event.ip_src
212 )
213 )
214
215 credential_event.machine_name = network_config["real_machine_identifier_name"]
216
217 verbose_info(
218 messages["received_honeypot_credential_event"].format(
219 credential_event.ip_src,
220 credential_event.username,
221 credential_event.password,
222 credential_event.module_name,
223 credential_event.machine_name
224 )
225 )
226 return elasticsearch_events.index(index='credential_events', body=credential_event.__dict__)
227
228
229def insert_to_file_change_events_collection(file_change_event_data: FileEventsData):

Callers 5

processorMethod · 0.90
processorMethod · 0.90
processorMethod · 0.90
processorMethod · 0.90

Calls 3

byte_to_strFunction · 0.90
verbose_infoFunction · 0.90
get_country_shortMethod · 0.80

Tested by 1