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!}

  • 3
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值