[CTF]No.0004 [实验吧]登陆一下好吗??
来源:实验吧-决斗场-WEB
类别:SQL注入
来源:http://www.shiyanbar.com/ctf/1942
用到工具:无
尝试
进入网址,得到一下界面
随意输入,返回
返回首页,对关键字进行检测
使用andor'@#
进行登陆,可以看到返回
可知,or
、#
被过滤掉了
构造SQL
猜测程序中使用的sql语句
select ...from ....where username =' ' and password = ' '
构造
select ...from ....where username=''='' and password=''=''
在帐号、密码处输入
'=''
登陆可见
验证通过
原理
username=''
会返回false,然后false=''(NULL)
,结果就是true
了。