DEV Community

Cover image for Hack The Box: Emdee five for life
Souvik Kar Mahapatra
Souvik Kar Mahapatra

Posted on • Updated on

Hack The Box: Emdee five for life

mdee five for life

The first challenge under the web and most of the votes are for easy. Let's try it out.

CHALLENGE TITLE: Emdee five for life

CHALLENGE DESCRIPTION: Can you encrypt fast enough?

The only thing that comes to mind after reading the title and description is, MD5. So the task looks pretty easy, all we have to do is encrypt a random string displayed on the website. Then submit the encrypted string.

Head over to md5.cz to encrypt.

oNbzpf0JAXYbMvDTyb8W --> 5db3c17ae9a5326e66af94741d69858c

but wait, on submitting the encrypted sting it mocks us "Too slow!" 🤨 along with a new string to encrypt. So seems like we have to accomplish this as fast as possible. How about automating the process?

automation

and here is the code:

import requests
import hashlib
from bs4 import BeautifulSoup

req=requests.session()
#change URL according to yours
url="http://144.126.196.140:30844/"

get_req=req.get(url)
html=get_req.content

soup = BeautifulSoup(html, 'html.parser')
hash_val=soup.h3.get_text().encode('utf-8')

md5hash=hashlib.md5(hash_val).hexdigest()
data=dict(hash=md5hash)
post_res=req.post(url=url,data=data)
print("flag:",post_res.text)
Enter fullscreen mode Exit fullscreen mode

and we have the flag. See you on the next challenge ✌️.

Discussion (0)