在创建场景之后打开网页,发现hello world
方法一:使用bp
地址默认是1.php,我们要把它改成index.php(题干提醒访问初始页面)但是直接修改会跳回原来的1.php所以我们需要进行抓包 ,检查为什么会跳转?
跳转是因为在默认访问index.php时响应为302
所以在使用bp抓包后我们将请求处改成index.php
我们可以在响应处直接发现flag
方法二:使用开发者工具(点击f12)
打开hackbar,点开网络功能,重新加载,显示当前地址的网络记录,可以在右边看响应头和请求头。
我们直接在地址处将1.php修改成index.php,可以发现网络功能处已经出现访问记录,然后我们可以在右侧的响应区发现flag
方法三:python脚本编写
import requests
url = "http://61.147.171.105:58804/1.php"
response = requests.get(url, allow_redirects=False)
if 'FLAG' in response.headers and 'flag{' in response.headers['FLAG']:
flag_stare = response.headers['FLAG'].index('flag{')
flag_end = response.headers['FLAG'].index('}', flag_stare) + 1
flag = response.headers['FLAG'][flag_stare:flag_end]
print("存在flag" + flag)
else:
print("未找到flag")
运行之后得到结果flag