insert other network events (port scan, etc..) to network_events_queue Args: network_event: Object of NetworkEvent Class with event parameters network_events_queue: Multiprocessing queue which stores the list of network_events in _dict_ format
(network_event: NetworkEvent, network_events_queue: Queue)
| 106 | |
| 107 | |
| 108 | def insert_to_network_events_queue(network_event: NetworkEvent, network_events_queue: Queue): |
| 109 | """ |
| 110 | insert other network events (port scan, etc..) to network_events_queue |
| 111 | |
| 112 | Args: |
| 113 | network_event: Object of NetworkEvent Class with event parameters |
| 114 | network_events_queue: Multiprocessing queue which stores the list of |
| 115 | network_events in _dict_ format |
| 116 | |
| 117 | Returns: |
| 118 | None |
| 119 | """ |
| 120 | |
| 121 | verbose_info( |
| 122 | messages["received_network_event"].format( |
| 123 | network_event.ip_dest, |
| 124 | network_event.port_dest, |
| 125 | network_event.ip_src, |
| 126 | network_event.port_src, |
| 127 | network_event.machine_name |
| 128 | ) |
| 129 | ) |
| 130 | |
| 131 | # Get country of the source IP Address |
| 132 | network_event.country_ip_src = byte_to_str( |
| 133 | IP2Location.get_country_short( |
| 134 | network_event.ip_src |
| 135 | ) |
| 136 | ) |
| 137 | |
| 138 | # Get country of the destination IP Address |
| 139 | network_event.country_ip_dest = byte_to_str( |
| 140 | IP2Location.get_country_short( |
| 141 | network_event.ip_dest |
| 142 | ) |
| 143 | ) |
| 144 | |
| 145 | network_events_queue.put(network_event.__dict__) |
| 146 | return |
| 147 | |
| 148 | |
| 149 | def push_events_queues_to_database(honeypot_events_queue, network_events_queue): |