Challenges Emdee five for life-easy
思路
入门题目。先get数据,然后POST提交MD5数值,即可获得flag
附上自己写的代码
#!/usr/bin/python3
import requests
import hashlib
from lxml import etree
url = "http://159.65.51.138:30832/"
req = requests.session()
response = req.get(url).content.decode('utf-8')
html=etree.HTML(response,etree.HTMLParser())
result=html.xpath('//h3[@align="center"]/text()')[0]
m = hashlib.md5().update(result.encode("utf-8"))
md5 = m.hexdigest()
data = {'hash':md5}
flag = req.post(url=url,data=data)
print(flag.content.decode('utf-8')) #HTB{N1c3_ScrIpt1nG_B0i!}
本文来自博客园,作者:admax11,转载请注明原文链接:https://www.cnblogs.com/ctfisnull/p/15346046.html