Skip to content

Instantly share code, notes, and snippets.

@grok
Created April 28, 2014 15:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save grok/11374758 to your computer and use it in GitHub Desktop.
Save grok/11374758 to your computer and use it in GitHub Desktop.
Little server scanner to help maintain a server I used to work on years ago. This is purely for historical sake.
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]
#!/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";
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment