Commit db5ced8d authored by Eloy Degen's avatar Eloy Degen

Submit to database

parent bea076fb
......@@ -51,6 +51,8 @@ def insert_db(pkt):
'rcv_date': current_date.strftime('%Y-%m-%d %H:%M:%S'),
}
query = '''INSERT INTO `detection_app_packet` (`src_ip`, `dst_ip`, `src_port`, `dst_port`, `content`, `rcv_date`) VALUES ("{ip_src}","{ip_dst}","{src_port}","{dst_port}","{content}","{rcv_date}");'''
result = cursor.execute(query.format(**format_string))
connection.commit()
print(" IP src " + str(ip_src) + " UDP sport " + str(udp_sport))
print(" IP dst " + str(ip_dst) + " UDP dport " + str(udp_dport))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment