Moved directories
This commit is contained in:
22
Day 09/decode.py
Normal file
22
Day 09/decode.py
Normal 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)
|
||||
BIN
Day 09/secret_capture.pcapng
Normal file
BIN
Day 09/secret_capture.pcapng
Normal file
Binary file not shown.
Reference in New Issue
Block a user