3

buuctf-web-[极客大挑战 2019]BuyFlag 1

 3 years ago
source link: http://www.cnblogs.com/junlebao/p/14092468.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

打开网页,然后发现menu中有个buyflag的连接,点进去

j6vqIvV.png!mobile

如果你想买这个flag ,你必须是来自CUIT的一名学生,还必须回答正确的密码。简单了解,我们查看源码,发现思路

YN3i2qu.png!mobile

POST方式传入两个参数,password和money,其中password要绕过is_numeric()函数,并且密码还要等于404,php弱类型匹配,

于是我们直接让password=404a就可以了,既绕过了is_numeric()又完成了password的匹配。然后我们的钱需要100000000于是我们bp抓包发送POST请求

YbEvE37.png!mobile

0是false,1是true

看到这个,感觉就应该是控制是否是CUIT的学生,于是改成1,然后构造参数:password=404a&money=100000000发送时,告诉我们Nember lenth is too long,于是我们改用科学计数法,然后我们再次发送获得flag

之前复现则个题,发现不行,今天复现居然成功了,这道题不难,简单做个笔记吧。主要就是考了点弱类型比较,没什么东西。还有就是有时候数据过长,可以改成科学计数法。当然,大佬博客还有一种方法,利用

strcmp函数的漏洞 。看看这篇文章,韩信点兵,多多益善。简单记录下


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK