buuctf web buyflag

打开场景,查看源码,发现a链接,pay.php打开目标页面查看源码,发现提示

<!--
	~~~post money and password~~~
if (isset($_POST['password'])) {
	$password = $_POST['password'];
	if (is_numeric($password)) {
		echo "password can't be number</br>";
	}elseif ($password == 404) {
		echo "Password Right!</br>";
	}
}
-->

页面还有提示

<p>If you want to buy the FLAG:</br>
You must be a student from CUIT!!!</br>
You must be answer the correct password!!!
</p>
<p>Flag need your 100000000 money</p>

不明所以,抓个包看看
抓到cookie里有user=0,结合You must be a student from CUIT!!!,把user改为1,发现有变化,you are Cuiter
那第一个条件已经满足
下面就是满足password,post一个包过去,内容password=404a,由于弱相等,Password条件也满足,只剩下最后一道关
Pay for the flag!!!hacker!!!
那结合

Flag need your 100000000 money

,盲猜需要的参数是money
money=100000000,提示Nember lenth is too long
那么考虑是strcmp来判断钱数是否够
尝试money=1e12,成功拿到flag
或者直接money[]=1,由于是非字符型,所以strcmp函数会直接返回0,而相等也返回0,成功绕过
给一个完整payload
money=1e12&password=404a
参考视频链接:https://www.bilibili.com/video/BV1HL4y1a7UQ/
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值