Skip to main content

You can perform the following steps:

Check Apache Modules

Apache Struts 2 is typically integrated with Java applications and runs on servlet containers like Apache Tomcat. However, if you want to check for any signs of Struts 2 on Apache, you can look for loaded Apache modules. Run the following command:

apache2ctl -M

Look for modules related to Struts or Java. For example, if you see a module named mod_struts or anything related to Java, it might indicate Struts 2 is installed.

Response

Command 'apache2ctl' not found, but can be installed with:

apt install apache2

If the command apachectl isn't installed as per my response, then as a reference Apache modules are typically stored in the /etc/apache2/mods-enabled/ directory. Each enabled module is represented by a symbolic link to the corresponding module file in the /etc/apache2/mods-available/ directory.

Here's a command you can use to list the enabled Apache modules:

ls /etc/apache2/mods-enabled/

This will show you the symbolic links to the enabled modules. The target of the symbolic links points to the actual module files in the mods-available directory.

 

Check Apache Configuration Files

Review the Apache configuration files to see if there are any references or configurations related to Struts 2. Common locations for Apache configuration files are /etc/apache2/apache2.conf and /etc/apache2/sites-enabled/.

grep -r "struts" /etc/apache2/

This command will search for the string "struts" in Apache configuration files.

Response - nothing found.

 

Check Web Application Directories

Struts 2 applications are usually deployed as web applications. Check the web application directories on your Apache server. By default, Apache web files are stored in /var/www/html/ or in virtual host directories.

ls -l /var/www/html/

Check if there are any Struts-related directories or files.

 

Access Apache Server

Try accessing your Apache server using a web browser. If Struts 2 is installed, you might see Struts-related URLs in the browser's address bar or pages indicating Struts 2.

 

Check Running Processes

Check if there are any running Java processes that might indicate the presence of a Java-based web application like Struts 2. You can use the ps command for this:

ps aux | grep java

Look for Java processes that are running web applications.

Response

solr         932  0.6  9.2 4084576 748092 ?      Sl   01:27   0:35 java -server -Xms512m -Xmx512m -XX:+UseG1GC -XX:+PerfDisableSharedMem -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=250 -XX:+UseLargePages -XX:+AlwaysPreTouch -XX:+ExplicitGCInvokesConcurrent -verbose:gc -XX:+PrintHeapAtGC -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+PrintTenuringDistribution -XX:+PrintGCApplicationStoppedTime -Xloggc:/var/solr/logs/solr_gc.log -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=9 -XX:GCLogFileSize=20M -Dsolr.jetty.inetaccess.includes= -Dsolr.jetty.inetaccess.excludes= -Dsolr.log.dir=/var/solr/logs -Djetty.port=8983 -DSTOP.PORT=7983 -DSTOP.KEY=solrrocks -Duser.timezone=UTC -XX:-OmitStackTraceInFastThrow -XX:OnOutOfMemoryError=/opt/solr/bin/oom_solr.sh 8983 /var/solr/logs -Djetty.home=/opt/solr/server -Dsolr.solr.home=/var/solr/data -Dsolr.data.home= -Dsolr.install.dir=/opt/solr -Dsolr.default.confdir=/opt/solr/server/solr/configsets/_default/conf -Dlog4j.configurationFile=/var/solr/log4j2.xml -Dlog4j2.formatMsgNoLookups=true -Xss256k -Dsolr.log.muteconsole -jar start.jar --module=http --module=gzip
_dr+   12187  0.0  0.0   8164   592 pts/0    S+   02:55   0:00 grep --color=auto java

 

Keep in mind that Apache Struts 2 is often used with a servlet container like Apache Tomcat rather than directly with Apache HTTP Server. If you are using a servlet container, you might need to check its configuration and logs instead.

 

Related articles

Andrew Fletcher18 Mar 2024
Resolving CVE-2022-48624 less issue
To resolve the CVE-2022-48624 vulnerability on Ubuntu using Nginx, it's crucial to understand that the issue lies within the "less" package, not Nginx itself. The vulnerability affects "less" before version 606, where close_altfile in filename.c in less omits shell_quote calls for LESSCLOSE,...
Andrew Fletcher06 Mar 2024
Terminal command to find and replace
In many terminal text editors, you use find command as reference in Terminal commands - find.  How about find and replace.  This action depends on the specific text editor you're using in the terminal.  Here are a few common terminal text editors and how you can find and replace...