Skip to content

Commit

Permalink
Update server.py
Browse files Browse the repository at this point in the history
  • Loading branch information
gnh1201 authored Feb 18, 2024
1 parent d7f5a9b commit 9b19902
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion server.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,17 @@ def proxy_check_filtered(data, webserver, port, scheme, method, url):
filtered = filtered or bool(re.search(r'https://[a-zA-Z0-9.-]+/users/[a-zA-Z0-9]{10}/statuses/[0-9]+', text))

if filtered:
print ("[*] Filtered data from %s:%s" % (webserver.decode(client_encoding), str(port)))
print ("[*] Filtered from %s:%s" % (webserver.decode(client_encoding), str(port)))

try:
current_time = datetime.now().strftime("%Y%m%d%H%M%S")
file_path = ("./savedfiles/%s_%s.bin" % (current_time, webserver.decode(client_encoding)))
with open(file_path, 'wb') as file:
file.write(data)
print ("[*] Saved the file: %s" % (file_path))
except Exception as e:
print ("[*] Failed to save the file: %s" % (str(e)))

#print ("[*] ====== start preview data =====")
#print ("%s" % (text))
#print ("[*] ====== end preview data =====")
Expand Down

0 comments on commit 9b19902

Please sign in to comment.