This how to applies to Linux based, cPanel, and Plesk servers.
If you are looking to find out who on your server is running old insecure versions of Joomla, then the following commands will help to track them down. This will scan through all your users home directories, find out who has Joomla installed, and will get the version they are running. Once you have this information, you can then contact that customer, and instruct them that they need to update their software to help keep both their account, and the sever in general secure.
On a cPanel server run the following command. Note this is to be run as an entire command, not separate commands.
find /home/*/public_html/ -type f \( -iwholename '*/libraries/joomla/version.php' -o -iwholename '*/libraries/cms/version.php' -o -iwholename '*/libraries/cms/version/version.php' \) -print -exec perl -e 'while (<>) { $release = $1 if m/ \$RELEASE\s+= .([\d.]+).;/; $dev = $1 if m/ \$DEV_LEVEL\s+= .(\d+).;/; } print qq($release.$dev\n);' {} \; && echo "-"
On a Plesk server run the following command. Again, this is to be run as a single command.
find /var/www/vhosts/*/httpdocs/ -type f \( -iwholename '*/libraries/joomla/version.php' -o -iwholename '*/libraries/cms/version.php' -o -iwholename '*/libraries/cms/version/version.php' \) -print -exec perl -e 'while (<>) { $release = $1 if m/ \$RELEASE\s+= .([\d.]+).;/; $dev = $1 if m/ \$DEV_LEVEL\s+= .(\d+).;/; } print qq($release.$dev\n);' {} \; && echo "-"
The output should look something like this.
/home/username1/public_html/hormec/libraries/joomla/version.php
1.5.11
/home/username2/public_html/libraries/joomla/version.php
1.5.15
/home/username2/public_html/site/libraries/joomla/version.php
1.5.15
The above is for a cPanel server. For a plesk server, it’ll output the same, but will have the proper plesk paths.