MTCTF2022(CB+Shiro绕过)
MTCTF 2022easyjava | NSSCTF (ctfer.vip)
Shiro绕过+CB链
<!--Shiro框架-->
<dependency>
<groupId>org.apache.shiro</groupId>
<artifactId>shiro-spring</artifactId>
<version>1.5.2</version>
</dependency>
<!--hibernate-->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>4.3.8.Final</version>
</dependency>Shiro版本1.5.2,存在认证鉴权绕过方式
CVE-2020-13933
影响版本:shiro < 1.6.0
当请求中出现了 ; 的 URL 编码 %3b 时
shiro 会 url 解码成
;,然后截断后面的内容,进行匹配,例如/audit/aaa%3baaa->/audit/aaa。spring & tomcat 会处理成
/audit/aaa;aaa。
注意这个application.properties里指定了上下文路径
server.servlet.context-path=/web
ShiroConfig设置了过滤规则:
/;/web/admin/hello可绕过
MyObjectInputStream重写了ObjectInputStream的resolveClass方法
出题人不知道是故意的还是不小心的,traxTemplatesImpl少了个.
那就直接打Shiro的CB链了
LdapAttribute#getAttributeDefinition
若java.util.PriorityQueue也被禁了
java.lang.NoSuchMethodException: Unknown property 'class' on class 'class com.sun.jndi.ldap.LdapAttribute',可能是因为这个类是final的缘故,后面遇到再看吧。。。
Last updated
Was this helpful?