mirror of
https://github.com/AbdullahRizwan101/CTF-Writeups
synced 2025-02-16 20:18:24 +00:00
1.2 KiB
1.2 KiB
HackTheBox-Emdee Five For Life
![](https://imgur.com/38Q4TnW.png)
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"
![](https://imgur.com/Cqov6VD.png)
Intercepting the request with Burp Suite
and found that we have to make a POST request to send the MD5 hash
![](https://i.imgur.com/iOW0886.png)
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)
![](https://i.imgur.com/UOndl6L.png)
We got the flag !!!