
Python exploit for Apache 2.4.49 path traversal and RCE (CVE-2021-41773) that sends crafted requests to execute arbitrary commands on vulnerable servers.
This vulnerability affects versions of Apache HTTP Server 2.4.49. A path validation error allows remote attackers to perform Path Traversal using sequences like .%2e/ to access paths outside the configured root directory.
When the mod_cgi module is enabled, an attacker can execute arbitrary commands by sending specially crafted requests to a CGI file. This allows remote code execution (RCE).
mod_cgi enabledThis script allows exploiting the vulnerability by sending remote commands to the affected server.
curl installedpython3 exploit.py -i <IP_DEL_SERVIDOR> -c <COMANDO>
python3 exploit.py -i 172.17.0.2 -c "id"
python3 exploit.py -i 172.17.0.2 -c "whoami"
python3 exploit.py -i 172.17.0.2 -c "cd ../../../ && ls -la"