Last active
August 12, 2019 20:54
-
-
Save tbhaxor/b0acf98022d243aeafd1bcf7954c0c82 to your computer and use it in GitHub Desktop.
Script for Emdee five for life
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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