Skip to content

Instantly share code, notes, and snippets.

@githubfoam
Created December 12, 2023 08:16
Show Gist options
  • Save githubfoam/0edb97974b40b38a4cbe3b1ad67eb4b2 to your computer and use it in GitHub Desktop.
Save githubfoam/0edb97974b40b38a4cbe3b1ad67eb4b2 to your computer and use it in GitHub Desktop.
Investigation Path - cwe id 552
==========================================================================================================
On CentOS 7, the installation path of Apache Tomcat might vary depending on how it was installed.
Default Path: Apache Tomcat is often installed
ls /usr/share/tomcat
ls /usr/local/tomcat
use the find command to locate the Tomcat directory if you're uncertain about the installation path
find / -name tomcat -type d
/etc/selinux/targeted/active/modules/100/tomcat
/etc/tomcat
/var/lib/tomcat
/var/log/tomcat
/var/cache/tomcat
/usr/share/java/tomcat
/usr/share/tomcat
/usr/libexec/tomcat
Checking Environment Variables: Sometimes, the CATALINA_HOME environment variable is set to the Tomcat installation directory
echo $CATALINA_HOME
Check the RPM package information:
rpm -ql tomcat
This command will list all files installed by the Tomcat RPM package. Look for the directory containing the bin directory and the conf directory. This will be your Tomcat installation path.
Use the systemctl command:
systemctl show tomcat
This command will display information about the Tomcat service, including the service file path. The service file typically resides in /etc/systemd/system/ and its name will start with "tomcat." Open the service file and look for the Environment section where you might find the CATALINA_HOME variable defined.
==========================================================================================================
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment