From a57a57ad41f74636738701126fa070d5d3f030bf Mon Sep 17 00:00:00 2001 From: Roman Hergenreder Date: Fri, 13 Dec 2019 21:34:19 +0100 Subject: [PATCH] Hidden 03 solved --- Hidden 03/decode.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 Hidden 03/decode.py diff --git a/Hidden 03/decode.py b/Hidden 03/decode.py new file mode 100644 index 0000000..5ce6239 --- /dev/null +++ b/Hidden 03/decode.py @@ -0,0 +1,24 @@ +#!/usr/bin/python + +import sys +import socket + +if len(sys.argv) < 2: + print("Invalid usage: %s " % sys.argv[0]) + exit(1) + +OUTFILE = sys.argv[1] +sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +sock.connect(('whale.hacking-lab.com', 17)) + +data = "" + +while True: + buf = sock.recv(16) + if buf: + data += buf.decode("UTF-8") + else: + break + +with open(OUTFILE, "a") as f: + f.write(data.strip())