Skip to content

Commit

Permalink
anonymize data even in raw content
Browse files Browse the repository at this point in the history
part of #56
  • Loading branch information
xhdix committed Jun 2, 2022
1 parent b84777b commit e3f3be6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions utils/convert_packetlist.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env python3

from base64 import b64encode
from dataclasses import replace


# this function source: https://stackoverflow.com/a/64410921
Expand All @@ -13,8 +14,7 @@ def packet2json(packet_obj, public_ip):
packet_dict[layer] = {}
elif '=' in line:
key, val = line.split('=', 1)
if val == public_ip:
val = '127.1.2.7'
val = val.replace(public_ip, '127.1.2.7')
if layer == 'Raw' and key.strip() == 'load':
packet_dict[layer][key.strip()] = b64encode(
packet_obj['Raw'].load).decode()
Expand Down

0 comments on commit e3f3be6

Please sign in to comment.