Incident Response: Analyzing Log4j RCE exploited via Minecraft game
A Minecraft server running a vulnerable Log4j version was exploited via JNDI/LDAP injection, allowing an attacker to execute arbitrary code. The attacker used a crafted log message to trigger the loading of malicious Java classes from an LDAP server, resulting in remote code execution.
Published on systemweakness.com
Log4j2 versions 2.0-beta9 through 2.15.0 (excluding 2.12.x after 2.12.1) are vulnerable to remote code execution using its LDAP (Lightweight Directory Access Protocol) JNDI parser. An attacker who can control log messages or log message parameters can execute arbitrary code loaded from LDAP servers when message lookup…
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
The Log4j library allowed JNDI lookups in log messages, which could be controlled by user input, leading to remote code execution.
Impact
The attacker could execute arbitrary code on the server, potentially leading to full compromise, though in this case only a calculator was launched as a proof of concept.
What the attacker needed
Minecraft server running vulnerable Log4j; Attacker can join the server; Attacker controls an LDAP server
The fix
The vulnerability was fixed in Log4j versions 2.12.2 and 2.15.0 by disabling JNDI by default and restricting LDAP access.
How it was found
- The attacker joined the Minecraft server lobby as a player.
- The attacker sent a crafted message that triggered a JNDI/LDAP lookup.
- The server connected to an attacker-controlled LDAP server and downloaded malicious Java class files.
- The downloaded classes were executed, running a command to open the calculator as proof of concept.
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 logging library used by many Java applications. It had a feature that allowed special strings in log messages to trigger network lookups. An attacker could send a message containing such a string, causing the server to download and run malicious code from an attacker-controlled server.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.