0ctf2017-web-writeup

simplesqlin

http://202.120.7.203/index.php?id=1 ,后面加上and 1=1 和and 1=2,返回结果不同,判断注入点在id,用order by 判断字段数为3,直接使用union select会被waf过滤,使用特殊字符截断关键字后能绕过waf。
playload:

1
http://202.120.7.203/index.php?id=-1%20un%0bion%20se%0blect%201,flag,3%20fro%0bm%20flag

Temmo’s Tiny Shop

注册一个新账号,登陆后,infos中说如果你买东西就会有提示,但是钱只有4000,买不了8000的!HINT!,猜测要用条件竞争刷钱。于是把其它商品买了一遍,再看infos,其中有一条“Maybe you will know something when you know if the cat is alive”,商品名是Erwin Schrodinger’s Cat(薛定谔的猫)(这个梗…),猜想应该是这里存在竞争,于是用burpsuite的Intruder开多个线程对Erwin Schrodinger’s Cat进行买卖操作


把钱刷到了8800

买了hint之后,得到提示select flag from ce63e444b0d049e9c899c9a0336b3c59
经过尝试,注入点应该在参数order,构造sql语句
if(substr((select(flag)from(ce63e444b0d049e9c899c9a0336b3c59)),%s,1)like(0x5c%s),name,price)
可以绕过waf,盲注脚本打一发:


flag{r4ce_c0ndit0n_i5_excited}