module
Apache Tomcat on RedHat Based Systems Insecure Temp Config Privilege Escalation
Disclosed | Created |
---|---|
2016-10-10 | 2023-03-14 |
Disclosed
2016-10-10
Created
2023-03-14
Description
This module exploits a vulnerability in RedHat based systems where
improper file permissions are applied to /usr/lib/tmpfiles.d/tomcat.conf
for Apache Tomcat versions before 7.0.54-8. This may also work against
The configuration files in tmpfiles.d are used by systemd-tmpfiles to manage
temporary files including their creation.
With this weak permission, we're able to inject commands into systemd-tmpfiles
service to write a cron job to execute our payload.
systemd-tmpfiles is executed by default on boot on RedHat-based systems
through systemd-tmpfiles-setup.service. Depending on the system in use,
the execution of systemd-tmpfiles could also be triggered by other
services, cronjobs, startup scripts etc.
This module was tested against Tomcat 7.0.54-3 on Fedora 21.
improper file permissions are applied to /usr/lib/tmpfiles.d/tomcat.conf
for Apache Tomcat versions before 7.0.54-8. This may also work against
The configuration files in tmpfiles.d are used by systemd-tmpfiles to manage
temporary files including their creation.
With this weak permission, we're able to inject commands into systemd-tmpfiles
service to write a cron job to execute our payload.
systemd-tmpfiles is executed by default on boot on RedHat-based systems
through systemd-tmpfiles-setup.service. Depending on the system in use,
the execution of systemd-tmpfiles could also be triggered by other
services, cronjobs, startup scripts etc.
This module was tested against Tomcat 7.0.54-3 on Fedora 21.
Authors
h00die
Dawid Golunski dawid@legalhackers.com
Dawid Golunski dawid@legalhackers.com
Platform
Linux
Architectures
x86, x64
References
Module Options
To display the available options, load the module within the Metasploit console and run the commands ‘show options’ or ‘show advanced’:

NEW
Explore Exposure Command
Confidently identify and prioritize exposures from endpoint to cloud with full attack surface visibility and threat-aware risk context.