I wrote a script today that basically goes through and finds all websites on our servers and displays the ones that have Joomla and what version of Joomla it has installed.
Example Output:
Retrieving Site List…
[http://www.breweryarts.org] [Mambo] [4.5.4]
[http://www.artbyblair.com] [Mambo] [4.5.4]
[http://www.budgaugh.com] [Joomla!] [1.0.13]
[http://www.ecomadness.com] [Joomla!] [1.0.15]
[http://www.janusstudio.com] [Joomla!] [1.0.11]
[http://www.sharonchandler.com] [Mambo] [4.5.4]
See code below:
#!/usr/local/bin/php -q <?php /* Joomla Scanner * Author: Sterling Hamilton * Date: 10.09.2008 * * Use from the command line. * Example default use: # php JoomlaScanner.php * -> This will search all domains and see if they have Joomla. * -> If they do it will find what version of Joomla it is and display it along with the proper domain. */ echo "\033[32mRetrieving Site List...\033[0m\n"; $strSiteList = shell_exec("find /home/virtual -maxdepth 6 -regex '.*/html/pathway.php'"); $strSiteList = str_replace("/home/virtual/", NULL, $strSiteList); $strSiteList = str_replace("/fst/var/www/html/pathway.php", NULL, $strSiteList); $arySiteList = explode("\n",$strSiteList); $arySiteList = array_slice($arySiteList,0,count($arySiteList)-1); foreach($arySiteList as $site) { $domain = shell_exec("grep '^\$mosConfig_live_site' /home/virtual/$site/fst/var/www/html/configuration.php"); $domain = str_replace('$mosConfig_live_site = \'',NULL,$domain); $domain = trim(str_replace('\';',NULL,$domain)); $product = trim(shell_exec("grep '\$PRODUCT' /home/virtual/$site/fst/var/www/html/includes/version.php")); $version = trim(shell_exec("grep '\$RELEASE' /home/virtual/$site/fst/var/www/html/includes/version.php")); $subversion = trim(shell_exec("grep '\$DEV_LEVEL' /home/virtual/$site/fst/var/www/html/includes/version.php")); $product = str_replace('var $PRODUCT',NULL,$product); $product = str_replace('= \'',NULL,trim($product)); $product = str_replace('\';',NULL,$product); $version = str_replace('var $RELEASE',NULL,$version); $version = str_replace('= \'',NULL,trim($version)); $version = str_replace('\';',NULL,$version); $subversion = str_replace('var $DEV_LEVEL',NULL,$subversion); $subversion = str_replace('= \'',NULL,trim($subversion)); $subversion = str_replace('\';',NULL,$subversion); echo "[\033[35m$domain\033[0m] [$product] [\033[31m$version.$subversion\033[0m]\n"; } ?>