Giter Site home page Giter Site logo

righettod / log4shell-payload-grabber Goto Github PK

View Code? Open in Web Editor NEW
3.0 4.0 0.0 11.22 MB

Tool to try to retrieve the java class used as dropper for the RCE in the context of log4shell vulnerability.

License: GNU General Public License v3.0

Shell 0.31% Java 99.69%
log4shell java-8 incident-response-tooling

log4shell-payload-grabber's Introduction

Objective

Build package

Tool to try to retrieve the java class used as dropper for the RCE.

The tool was tested again the following attacks kit:

It is a IntelliJ IDEA project.

Requirements

Java 8 is required for compilation and execution because classes only present in this JDK are used for RMI information retieval.

Need Maven3+ for the building.

Usage

$ java -jar get-payload.jar
[+] Missing LDAP/LDAPS/RMI URL or SER file!
     URL: rmi://127.0.0.1:9997/gchero [--pause]
          ldap://127.0.0.1:9998/gcherG
SER file: 899f0d32098d4f3b8d54ffa21fe9b0b6.ser
1) For RMI, if a second parameter, named '--pause', is specified then
the program wait the user press a key before to end the program allowing taking a heap dump
of the JVM process to capture the loaded remote object.
2) If a SER (serialized java object) file is passed then the program will load it
and wait the user press a key before to end the program allowing taking a heap dump like for RMI.

usage

Full demonstration in this video.

Use the following command to directly extract the download URL of the class when it is available:

$ java -jar get-payload.jar "ldap://127.0.0.1:1389/Basic/TomcatMemshell" | grep "Direct URL" | cut -d" " -f10
http://127.0.0.1:8080/com.feihong.ldap.template.TomcatMemshellTemplate.class

For RMI, a second optional parameter named --pause, can be used to add a "virtual" break point allowing to perform a memory dump of the JVM tool process in order to capture loaded remote object:

usage-rmi-01

usage-rmi-00

Once created, the memory dump can be analyzed with different tools like for example jhat:

usage-rmi-00

usage-ser-00

Compilation

Use the script named package.sh and the binary jar file will be present in the target folder.

Exploit class decompilation

The following tools can be used to achieve this task:

log4shell-payload-grabber's People

Contributors

righettod avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

log4shell-payload-grabber's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.