Proof Of Concept Zero Day log4j Rce
The Log4j logging framework evaluates lookup expressions in logged strings, so an attacker who can get a crafted string logged can make the server fetch a remote Java class and execute it. This allows remote code execution on vulnerable versions.
Hello all, Today, we’ll look at how a specially crafted string can lead to remote code execution (RCE), and how this vulnerability affects the majority of the internet. Let’s dive into the topic.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely, Log4j performs JNDI lookups on logged strings without restricting them, so attacker-controlled input can trigger a remote class load.
Impact
An attacker could achieve remote code execution on servers running vulnerable Log4j versions, potentially leading to full compromise.
What the attacker needed
Vulnerable Log4j version 2.10-2.14; attacker can control logged input; server can make outbound LDAP connections
The fix
The vulnerability was fixed in Log4j version 2.15, though it still requires Java 8; temporary mitigations were also suggested.
How it was found
- Clone the vulnerable app repository and enter the directory.
- Build a Docker image using the provided command.
- Run the Docker container.
- Start a Netcat listener in a new terminal.
- Send a curl request with a crafted User-Agent header.
- Observe the incoming connection on the Netcat listener.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
Log4j is a tool that Java programs use to write log messages. It treats certain text like ${...} as a command to look something up, and an attacker can put such text into something that gets logged, like a username or browser identifier. The server then contacts the attacker's server and runs code from it, giving the attacker control.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.