打开网页发现是要计算题目
复制数据包中的headers
# -*- coding: utf-8 -*-
import requests
from bs4 import BeautifulSoup
url = 'http://117.173.88.171:21202/'
res = requests.post(url)
temp = res.text.split('快问快答! ')[1].split('?')[0].replace('÷', '/').replace('×', '*')
# # print(f'{temp = }')
ans = eval(temp)
# print(f'{ans = }')
headers = {
'Cache-Control': 'max-age=0',
'Upgrade-Insecure-Requests': '1',
'Origin': 'http://117.173.88.171:20622',
'Content-Type': 'application/x-www-form-urlencoded',
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.60 Safari/537.36',
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9',
'Referer': 'http://117.173.88.171:20622/',
'Accept-Encoding': 'gzip, deflate',
'Accept-Language': 'zh-CN,zh;q=0.9',
'Cookie': 'PHPSESSID=c0bs4tpjcubtmvre14hvfhvgbi',
'Connection': 'close',
}
i = 0
for _ in range(51):
data = {
'answer': int(ans)
}
res = requests.post(url, headers=headers, data=data)
if '算错啦' not in res.text:
i += 1
print(f'{i}:{temp} = {data["answer"]}')
temp = res.text.split('快问快答! ')[1].split('?')[0].replace('÷', '/').replace('×', '*')
ans = eval(temp)
print(res.text)
成功得到flag
flag值:
flag{a4df6cc3-b8a4-4a16-9dcc-59deeef0da07}