Skip to content
RCE Write-up Beginner

Log4j RCE Vulnerability (CVE-2021–44228) Exploitation

A Java application using Log4j logged the User-Agent header without sanitising it, so a JNDI lookup string in that header caused the server to make an outbound connection to an attacker-controlled domain. This confirmed the Log4Shell vulnerability, which could allow remote code execution and full system control.

muhammadwaseem29 Follow

Published on medium.com

I hope this guide helps you. In this article, I will share how I was able to achieve Remote Code Execution (RCE) using the Log4j vulnerability, also known as Log4Shell (CVE-2021–44228).

Muhammad Waseem, on medium.com

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 the application passed unsanitised user input (the User-Agent header) to a vulnerable Log4j version that supports JNDI lookups, allowing the logged string to trigger an outbound connection.

Impact

If the server connects to the attacker's domain, Log4j RCE is possible, which could let an attacker take control of the server.

What the attacker needed

Target runs vulnerable Log4j; attacker can send requests with custom headers; outbound network access from target

The fix

The text recommends updating Log4j to 2.17.1 or later, disabling JNDI lookups, using a WAF, and monitoring logs and network traffic.

How it was found

  1. Choose a target web application.
  2. Capture a request to the target in Burp Suite.
  3. Send the request and confirm the server responds normally.
  4. Modify the User-Agent header to include a JNDI lookup pointing to a Burp Collaborator domain.
  5. Send the modified request and check Burp Collaborator for an interaction.

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. If a program logs text that a user controls, such as the browser name sent with every request, an attacker can put a special instruction in that text. The vulnerable version of Log4j follows that instruction and contacts a server chosen by the attacker, which can lead to the attacker running their own code on the victim's machine.

What is RCE?

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.

More by muhammadwaseem29

View all

1 more disclosed report, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.