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 9b19902 commit 23a3691
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion server.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,11 @@ def proxy_check_filtered(data, webserver, port, scheme, method, url):
print ("[*] Filtered from %s:%s" % (webserver.decode(client_encoding), str(port)))

try:
savedir = './savedfiles'
if not os.path.exists(savedir):
os.makedirs(savedir)
current_time = datetime.now().strftime("%Y%m%d%H%M%S")
file_path = ("./savedfiles/%s_%s.bin" % (current_time, webserver.decode(client_encoding)))
file_path = os.path.join(savedir, ("%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))
Expand Down

0 comments on commit 23a3691

Please sign in to comment.