Hello everyone I hope you are doing well , in this post I will be sharing my writeup for HTB Emdee Five For Life challenge, which was an easy challenege where you would have to use python to create a script that will do some scrapping for a text and will generate a hash and submit that as POST request .
We are presented with this html page having a string and told to encrpyt it with MD5 but when we try to submit it after encrpyting we get a message “Too Slow”
Intercepting the request with Burp Suite
and found that we have to make a POST request to send the MD5 hash
Also the string is generated randomly so we need to script it and the best language for this is python so I used python libraries requests
, hashlib
and BeautifulSoup
import hashlib
import requests
from bs4 import BeautifulSoup# Persists cookies across all requests
request = requests.session()
# URL For the challenge page
url = "http://159.65.25.97:31667"
page = request.get(url)soup = BeautifulSoup(page.content,"html.parser")
# Saving the string to be encrpyted
string_to_encrpyt = soup.select('h3')[0].text# Caluclating hash of the string
MD5 = hashlib.md5(string_to_encrpyt.encode('utf-8')).hexdigest()# POST data to send
data = {'hash' :MD5}# Sending data as POST request
response = request.post(url,data)
print(response.text)
We got the flag !!!