Hack the box —— Emdee five for life wp

打开题目发现这是一道20分值的web题目

提示:Can you encrypt fast enough?(你加密的够快吗)

进入网页

使用md5加密网站进行加密

他居然说我太慢了

连续试了几次,发现必须得拿出我的pycharm写代码了

思路:得到源码->正则匹配加密字符串->MD5加密->post发送。
 

#!/usr/bin/python3
# -*- coding:utf-8 -*-
"""
@author: maple
@file: md5.py
@time: 2021/1/22 12:49
@desc: 
"""

import requests
import hashlib
import re

url = 'http://178.128.41.22:30979/'

r = requests.session()
html = r.get(url)
text = html.text

output = re.search(r'<h3 align=\'center\'>[a-z|A-Z|0-9]+</h3>', text).group()
output = output.split('>')
output = output[1].split('<')

target = output[0]

final = hashlib.md5(target.encode(encoding='utf-8')).hexdigest()
data = {'hash':final}

posthtml = r.post(url, data=data)
print(posthtml.text)

最后结果

D:\python\venv\Scripts\python.exe D:/python/hackthebox/md5.py
<html>
<head>
<title>emdee five for life</title>
</head>
<body style="background-color:powderblue;">
<h1 align='center'>MD5 encrypt this string</h1><h3 align='center'>bEjMenXY3q9Uu84ZIzSG</h3><p align='center'>HTB{N1c3_ScrIpt1nG_B0i!}</p><center><form action="" method="post">
<input type="text" name="hash" placeholder="MD5" align='center'></input>
</br>
<input type="submit" value="Submit"></input>
</form></center>
</body>
</html>


Process finished with exit code 0

flag:HTB{N1c3_ScrIpt1nG_B0i!}

猜你喜欢

转载自blog.csdn.net/yutao598/article/details/112982248
今日推荐