DEV Community

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

Posted on • Edited 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 ✌️.

Hostinger image

Get n8n VPS hosting 3x cheaper than a cloud solution

Get fast, easy, secure n8n VPS hosting from $4.99/mo at Hostinger. Automate any workflow using a pre-installed n8n application and no-code customization.

Start now

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay