Moved directories

This commit is contained in:
2023-12-18 16:48:13 +01:00
parent 697849f63e
commit fbd69c1109
21 changed files with 0 additions and 0 deletions

22
Day 09/decode.py Normal file
View File

@@ -0,0 +1,22 @@
import os
import re
import datetime
from bs4 import BeautifulSoup
from hackingscripts.pcap_file_extract import PcapExtractor, HttpRequest, HttpResponse
if __name__ == "__main__":
chars = []
pcap_extractor = PcapExtractor("secret_capture.pcapng")
for response in pcap_extractor:
match = re.match(r"/\?door=(\d)", response.get_file_path())
if match and isinstance(response, HttpResponse):
request = response.response_to
ip, port = request.socket.split(":")
port = int(port)
c = chr(port - 56700)
dt = datetime.datetime.strptime(response.headers["Date"], "%a, %d %b %Y %H:%M:%S %Z").timestamp()
chars.append((dt, c))
flag = "".join(entry[1] for entry in sorted(chars))
print("[+] Flag:", flag)

View File

Binary file not shown.