常见漏洞-shiro
1.Shiro:Apache Shiro框架提供了记住密码的功能(RememberMe),用户登录成功后会生成经过加密并编码的cookie。在服务端对rememberMe的cookie值,先base64 解码然后AES解密再反序列化,就导致了反序列化RCE漏洞。
2.Shiro历史漏洞
Shiro-550
Apache Shiro框架提供了记住密码的功能(RememberMe),用户登录成功后会生成经过加密并编码的cookie。在服务端对rememberMe的cookie值,先 base64 解码然后AES解密再反序列化,就导致了反序列化RCE漏洞。
Shiro-721
由于Apache Shiro cookie中通过 AES-128-CBC 模式加密的rememberMe字段存在问题,用户可通过Padding Oracle 加密生成的攻击代码来构造恶意的rememberMe字段,并重新请求网站,进行反序列化攻击,最终导致任意代码执行。
3.Shiro识别与漏洞发现
(1)Shiro组件识别
抓包重放后,如果显示rememberMe=deleteMe,说明使用了该组件:

(2)Shiro漏洞检测(dnslog)
扫描工具:
https://github.com/fupinglee/ShiroScan
https://github.com/sv3nbeast/ShiroScan
(3)Shiro漏洞利用
Shiro-550利用 (反弹shell)
<1>Nc监听一个端口
<2>Java Runtime 配合 bash 编码
在线编码地址:http://www.jackson-t.ca/runtime-exec-payloads.html

<3>通过ysoserial中JRMP监听模块,监听一个端口并执行反弹shell命令。 java-cp ysoserial.jar ysoserial.exploit.JRMPListener 1099CommonsCollections4 "要执行的命令"

<4>使用shiro.py 生成Payload

<5>随意登录,勾选rememberme


<6>然后将shiro.py生成的rememberMe进行覆盖,监听端口得到反弹shell

Comments | NOTHING