Skip to content
Snippets Groups Projects
Commit 033b393d authored by Daniel Studený's avatar Daniel Studený
Browse files

Merge branch 'cowrie_lstrip_fix' into 'master'

cowrie/wardenfiler: Replace lstrip with startswith and slicing

See merge request !8
parents cc23cb8e 856e73ca
No related branches found
No related tags found
1 merge request!8cowrie/wardenfiler: Replace lstrip with startswith and slicing
......@@ -156,9 +156,10 @@ class Output(cowrie.core.output.Output):
if self.test_mode:
event["Category"].append("Test")
entry["src_ip"] = entry["src_ip"].lstrip("::ffff:")
if entry.get("dst_ip"):
entry["dst_ip"] = entry["dst_ip"].lstrip("::ffff:")
if entry["src_ip"].startswith("::ffff:"):
entry["src_ip"] = entry["src_ip"][7:]
if entry.get("dst_ip") and entry["dst_ip"].startswith("::ffff:"):
entry["dst_ip"] = entry["dst_ip"][7:]
# detect IPv4 or IPv6
src_af = "IP4" if not ':' in entry["src_ip"] else "IP6"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment