The cheat sheet about Java Deserialization vulnerabilities
3,185
163 commits
updated May 26, 2023
A cheat sheet for pentesters and researchers about deserialization vulnerabilities in various Java (JVM) serialization libraries.
Please, use #javadeser hash tag for tweets.
by @pwntester & @cschneider4711
by @cschneider4711 & @pwntester
by @pwntester and O. Mirosh
by @e_rnst
by deadcode.me
by @joaomatosf
by @ianhaken
by @_tint0
https://github.com/frohoff/ysoserial
ysoserial 0.6 payloads:
| payload | author | dependencies | impact (if not RCE) |
|---|---|---|---|
| AspectJWeaver | @Jang | aspectjweaver:1.9.2, commons-collections:3.2.2 | |
| BeanShell1 | @pwntester, @cschneider4711 | bsh:2.0b5 | |
| C3P0 | @mbechler | c3p0:0.9.5.2, mchange-commons-java:0.2.11 | |
| Click1 | @artsploit | click-nodeps:2.3.0, javax.servlet-api:3.1.0 | |
| Clojure | @JackOfMostTrades | clojure:1.8.0 | |
| CommonsBeanutils1 | @frohoff | commons-beanutils:1.9.2, commons-collections:3.1, commons-logging:1.2 | |
| CommonsCollections1 | @frohoff | commons-collections:3.1 | |
| CommonsCollections2 | @frohoff | commons-collections4:4.0 | |
| CommonsCollections3 | @frohoff | commons-collections:3.1 | |
| CommonsCollections4 | @frohoff | commons-collections4:4.0 | |
| CommonsCollections5 | @matthias_kaiser, @jasinner | commons-collections:3.1 | |
| CommonsCollections6 | @matthias_kaiser | commons-collections:3.1 | |
| CommonsCollections7 | @scristalli, @hanyrax, @EdoardoVignati | commons-collections:3.1 | |
| FileUpload1 | @mbechler | commons-fileupload:1.3.1, commons-io:2.4 | file uploading |
| Groovy1 | @frohoff | groovy:2.3.9 | |
| Hibernate1 | @mbechler | ||
| Hibernate2 | @mbechler | ||
| JBossInterceptors1 | @matthias_kaiser | javassist:3.12.1.GA, jboss-interceptor-core:2.0.0.Final, cdi-api:1.0-SP1, javax.interceptor-api:3.1, jboss-interceptor-spi:2.0.0.Final, slf4j-api:1.7.21 | |
| JRMPClient | @mbechler | ||
| JRMPListener | @mbechler | ||
| JSON1 | @mbechler | json-lib🫙jdk15:2.4, spring-aop:4.1.4.RELEASE, aopalliance:1.0, commons-logging:1.2, commons-lang:2.6, ezmorph:1.0.6, commons-beanutils:1.9.2, spring-core:4.1.4.RELEASE, commons-collections:3.1 | |
| JavassistWeld1 | @matthias_kaiser | javassist:3.12.1.GA, weld-core:1.1.33.Final, cdi-api:1.0-SP1, javax.interceptor-api:3.1, jboss-interceptor-spi:2.0.0.Final, slf4j-api:1.7.21 | |
| Jdk7u21 | @frohoff | ||
| Jython1 | @pwntester, @cschneider4711 | jython-standalone:2.5.2 | |
| MozillaRhino1 | @matthias_kaiser | js:1.7R2 | |
| MozillaRhino2 | @_tint0 | js:1.7R2 | |
| Myfaces1 | @mbechler | ||
| Myfaces2 | @mbechler | ||
| ROME | @mbechler | rome:1.0 | |
| Spring1 | @frohoff | spring-core:4.1.4.RELEASE, spring-beans:4.1.4.RELEASE | |
| Spring2 | @mbechler | spring-core:4.1.4.RELEASE, spring-aop:4.1.4.RELEASE, aopalliance:1.0, commons-logging:1.2 | |
| URLDNS | @gebl | jre only vuln detect | |
| Vaadin1 | @kai_ullrich | vaadin-server:7.7.14, vaadin-shared:7.7.14 | |
| Wicket1 | @jacob-baines | wicket-util:6.23.0, slf4j-api:1.6.4 |
Plugins for Burp Suite (detection, ysoserial integration ):
Full shell (pipes, redirects and other stuff):
How it works:
https://github.com/wh1t3p1g/ysoserial
https://github.com/pwntester/JRE8u20_RCE_Gadget
Pure JRE 8 RCE Deserialization gadget
https://github.com/GrrrDog/ACEDcup
File uploading via:
https://gist.github.com/coekie/a27cc406fc9f3dc7a70d
Won't fix DoS via default Java classes (JRE)
https://github.com/topolik/ois-dos/
How it works:
Won't fix DoS using default Java classes (JRE)
no spec tool - You don't need a special tool (just Burp/ZAP + payload)
https://github.com/zerothoughts/jndipoc
https://github.com/welk1n/JNDI-Injection-Exploit
no spec tool
no spec tool
loubia (tested on 11g and 12c, supports t3s)
JavaUnserializeExploits (doesn't work for all Weblogic versions)
Protocol
Default - 7001/tcp on localhost interface
no spec tool
CoalfireLabs/java_deserialization_exploits
no spec tool
Metasploit
https://github.com/njfox/Java-Deserialization-Exploit
no spec tool
no spec tool
no spec tool
no spec tool
no spec tool
no spec tool
CoalfireLabs/java_deserialization_exploits
no spec tool
no spec tool
no spec tool
no spec tool
no spec tool
no spec tool
no spec tool
no spec tool
java -jar ysoserial-*-all.jar CommonsCollections1 'COMMAND_HERE' | nc TARGET_SERVER 5001
fileysoserial Metasploit Exploit: exploit/windows/http/netmotion_mobility_mvcutil_deserialization
How it works:
How it works:
How it works:
How it works:
How it works:
How it works:
Exploitation examples:
vulnerable in specific configuration
How it works:
How it works:
How it works:
How it works:
vulnerable in a non-default configuration when setClassMetadataName() is set
How it works:
How it works:
<= 2016 Update 3
<= 11 update 11
<= 10 Update 22
/ACSServer/messagebroker/amf
at least 2.2.1
based on CVE-2017-5641
How it works:
How it works:
How it works:
How it works:
How it works:
How it works:
Some serialization libs are safe (or almost safe) https://github.com/mbechler/marshalsec
However, it's not a recommendation, but just a list of other libs that has been researched by someone:
196 followers · starred Apr 2021
893 followers · starred Apr 2021
2,396 followers · starred Aug 2020
109 followers · starred Jun 2020
The cheat sheet about Java Deserialization vulnerabilities
3,185
163 commits
updated May 26, 2023
A cheat sheet for pentesters and researchers about deserialization vulnerabilities in various Java (JVM) serialization libraries.
Please, use #javadeser hash tag for tweets.
by @pwntester & @cschneider4711
by @cschneider4711 & @pwntester
by @pwntester and O. Mirosh
by @e_rnst
by deadcode.me
by @joaomatosf
by @ianhaken
by @_tint0
https://github.com/frohoff/ysoserial
ysoserial 0.6 payloads:
| payload | author | dependencies | impact (if not RCE) |
|---|---|---|---|
| AspectJWeaver | @Jang | aspectjweaver:1.9.2, commons-collections:3.2.2 | |
| BeanShell1 | @pwntester, @cschneider4711 | bsh:2.0b5 | |
| C3P0 | @mbechler | c3p0:0.9.5.2, mchange-commons-java:0.2.11 | |
| Click1 | @artsploit | click-nodeps:2.3.0, javax.servlet-api:3.1.0 | |
| Clojure | @JackOfMostTrades | clojure:1.8.0 | |
| CommonsBeanutils1 | @frohoff | commons-beanutils:1.9.2, commons-collections:3.1, commons-logging:1.2 | |
| CommonsCollections1 | @frohoff | commons-collections:3.1 | |
| CommonsCollections2 | @frohoff | commons-collections4:4.0 | |
| CommonsCollections3 | @frohoff | commons-collections:3.1 | |
| CommonsCollections4 | @frohoff | commons-collections4:4.0 | |
| CommonsCollections5 | @matthias_kaiser, @jasinner | commons-collections:3.1 | |
| CommonsCollections6 | @matthias_kaiser | commons-collections:3.1 | |
| CommonsCollections7 | @scristalli, @hanyrax, @EdoardoVignati | commons-collections:3.1 | |
| FileUpload1 | @mbechler | commons-fileupload:1.3.1, commons-io:2.4 | file uploading |
| Groovy1 | @frohoff | groovy:2.3.9 | |
| Hibernate1 | @mbechler | ||
| Hibernate2 | @mbechler | ||
| JBossInterceptors1 | @matthias_kaiser | javassist:3.12.1.GA, jboss-interceptor-core:2.0.0.Final, cdi-api:1.0-SP1, javax.interceptor-api:3.1, jboss-interceptor-spi:2.0.0.Final, slf4j-api:1.7.21 | |
| JRMPClient | @mbechler | ||
| JRMPListener | @mbechler | ||
| JSON1 | @mbechler | json-lib🫙jdk15:2.4, spring-aop:4.1.4.RELEASE, aopalliance:1.0, commons-logging:1.2, commons-lang:2.6, ezmorph:1.0.6, commons-beanutils:1.9.2, spring-core:4.1.4.RELEASE, commons-collections:3.1 | |
| JavassistWeld1 | @matthias_kaiser | javassist:3.12.1.GA, weld-core:1.1.33.Final, cdi-api:1.0-SP1, javax.interceptor-api:3.1, jboss-interceptor-spi:2.0.0.Final, slf4j-api:1.7.21 | |
| Jdk7u21 | @frohoff | ||
| Jython1 | @pwntester, @cschneider4711 | jython-standalone:2.5.2 | |
| MozillaRhino1 | @matthias_kaiser | js:1.7R2 | |
| MozillaRhino2 | @_tint0 | js:1.7R2 | |
| Myfaces1 | @mbechler | ||
| Myfaces2 | @mbechler | ||
| ROME | @mbechler | rome:1.0 | |
| Spring1 | @frohoff | spring-core:4.1.4.RELEASE, spring-beans:4.1.4.RELEASE | |
| Spring2 | @mbechler | spring-core:4.1.4.RELEASE, spring-aop:4.1.4.RELEASE, aopalliance:1.0, commons-logging:1.2 | |
| URLDNS | @gebl | jre only vuln detect | |
| Vaadin1 | @kai_ullrich | vaadin-server:7.7.14, vaadin-shared:7.7.14 | |
| Wicket1 | @jacob-baines | wicket-util:6.23.0, slf4j-api:1.6.4 |
Plugins for Burp Suite (detection, ysoserial integration ):
Full shell (pipes, redirects and other stuff):
How it works:
https://github.com/wh1t3p1g/ysoserial
https://github.com/pwntester/JRE8u20_RCE_Gadget
Pure JRE 8 RCE Deserialization gadget
https://github.com/GrrrDog/ACEDcup
File uploading via:
https://gist.github.com/coekie/a27cc406fc9f3dc7a70d
Won't fix DoS via default Java classes (JRE)
https://github.com/topolik/ois-dos/
How it works:
Won't fix DoS using default Java classes (JRE)
no spec tool - You don't need a special tool (just Burp/ZAP + payload)
https://github.com/zerothoughts/jndipoc
https://github.com/welk1n/JNDI-Injection-Exploit
no spec tool
no spec tool
loubia (tested on 11g and 12c, supports t3s)
JavaUnserializeExploits (doesn't work for all Weblogic versions)
Protocol
Default - 7001/tcp on localhost interface
no spec tool
CoalfireLabs/java_deserialization_exploits
no spec tool
Metasploit
https://github.com/njfox/Java-Deserialization-Exploit
no spec tool
no spec tool
no spec tool
no spec tool
no spec tool
no spec tool
CoalfireLabs/java_deserialization_exploits
no spec tool
no spec tool
no spec tool
no spec tool
no spec tool
no spec tool
no spec tool
no spec tool
java -jar ysoserial-*-all.jar CommonsCollections1 'COMMAND_HERE' | nc TARGET_SERVER 5001
fileysoserial Metasploit Exploit: exploit/windows/http/netmotion_mobility_mvcutil_deserialization
How it works:
How it works:
How it works:
How it works:
How it works:
How it works:
Exploitation examples:
vulnerable in specific configuration
How it works:
How it works:
How it works:
How it works:
vulnerable in a non-default configuration when setClassMetadataName() is set
How it works:
How it works:
<= 2016 Update 3
<= 11 update 11
<= 10 Update 22
/ACSServer/messagebroker/amf
at least 2.2.1
based on CVE-2017-5641
How it works:
How it works:
How it works:
How it works:
How it works:
How it works:
Some serialization libs are safe (or almost safe) https://github.com/mbechler/marshalsec
However, it's not a recommendation, but just a list of other libs that has been researched by someone:
196 followers · starred Apr 2021
893 followers · starred Apr 2021
2,396 followers · starred Aug 2020
109 followers · starred Jun 2020