Skip to content

Instantly share code, notes, and snippets.

@tbhaxor
Last active August 12, 2019 20:54
Show Gist options
  • Save tbhaxor/b0acf98022d243aeafd1bcf7954c0c82 to your computer and use it in GitHub Desktop.
Save tbhaxor/b0acf98022d243aeafd1bcf7954c0c82 to your computer and use it in GitHub Desktop.
Script for Emdee five for life
#!/usr/bin/python3
# -------------------
# Author: Gurkirat Singh <tbhaxor@gmail.com>
# -------------------
import requests
import sys
import hashlib
import re
if len(sys.argv) < 2:
print("usage: {} [port]".format(sys.argv[0]))
exit(1)
pass
URI = "http://docker.hackthebox.eu:{}".format(sys.argv[1])
r = requests.session()
data = r.get(URI).text
txt = re.findall(r"(?:<h3 align='center'>)(.+)(?:</h3)", data)[0]
md5 = hashlib.md5(txt.encode()).hexdigest()
data = r.post(URI, data={"hash": md5}).text
flag = re.findall(r"HTB\{.+\}", data)[0]
print(flag)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment