『代码审计』ysoserial CB1 反序列化分析
发布日期:2024-05-19 浏览次数: 专利申请、商标注册、软件著作权、资质办理快速响应热线:4006-054-001 微信:15998557370
日期:2023-11-14作者:ICDAT介绍:这篇文章主要是对ysoserial CB1反序列化利用链进行分析。
0x00 前言
最近打了比较多的攻防演练,发现shiro反序列化漏洞真是一把利器,虽然其早在2016年就已经被爆出。而shiro打的多了,就会发现其繁杂的利用链,而在其中,commons-beanutils是绕不过的槛,毕竟shiro自带。这次我们来分析一下CB1利用链。
0x01 环境搭建
新建一个Maven项目,引入commons-beanutils1.9.2。
commons-beanutils commons-beanutils 1.9.1
引入包的时候我们发现其除了commons-beanutils包外,还有commons-collections:3.2.1和commons-logging:1.1.1包。
0x02 payload分析
ysoserial中的payload如下:
package ysoserial.payloads; import java.math.BigInteger;import java.util.PriorityQueue; import org.apache.commons.beanutils.BeanComparator; import ysoserial.payloads.annotation.Authors;import ysoserial.payloads.annotation.Dependencies;import ysoserial.payloads.util.Gadgets;import ysoserial.payloads.util.PayloadRunner;import ysoserial.payloads.util.Reflections; @SuppressWarnings({ "rawtypes", "unchecked" })@Dependencies({"commons-beanutils:commons-beanutils:1.9.2", "commons-collections:commons-collections:3.1", "commons-logging:commons-logging:1.2"})@Authors({ Authors.FROHOFF })public class CommonsBeanutils1 implements ObjectPayload