improved versioning

This commit is contained in:
Palma Solutions LTD
2017-05-12 09:43:34 +02:00
parent 04960308dc
commit 92d504167e

39
sc.php
View File

@@ -191,7 +191,7 @@ Order Deny,Allow
Deny from all
</FilesMatch>
';
foreach(glob("./*/wp-content/uploads/") as $dirname)
foreach(glob("./{**/*,*}/wp-content/uploads/") as $dirname)
{
$hta = fopen($dirname."/.htaccess", "w");
fwrite($hta, $htdata);
@@ -199,7 +199,6 @@ Deny from all
}
// system("for i in `find ../ -type d -path '*/wp-content/uploads';`; do echo $i && echo -e '".$htdata."' >> \$i/.htaccess; done");
// system("for i in `find ../ -type d -path '*/tmp'`; do echo $i && echo -e '".$htdata."' >> \$i/.htaccess; done");
/* Joomla /images may cause a ton of false positive patches so we'll research this further */
// system("for i in `find ./ -type d -path '*/images' -print;`; do echo -e '".$htdata."' >> \$i/.htaccess; done");
@@ -1104,16 +1103,35 @@ $versions = array(
);
echo $versions[0][0];
system('find '.$this->web_dir.' -type f -path '.$versions[0][1].' -exec grep -H '.$versions[0][2].'{} \; ');
echo $versions[1][0];
system('find '.$this->web_dir.' -type f -path '.$versions[1][1].' -exec grep -H '.$versions[1][2].'{} \; ');
foreach(glob("./{**/*,*}".$versions[0][1], GLOB_BRACE) as $versionfile){
$file = file_get_contents($versionfile);
$pattern = preg_quote($versions[0][2], '/');
$pattern = "/^.*$pattern.*\$/m";
if(preg_match_all($pattern, $file, $matches)){
echo "<br />";
echo "Wordpress found:";
echo implode("<br />", $matches[0]);
print_r ("location: ".$versionfile);
}
}
foreach(glob("./{**/*,*}".$versions[1][1], GLOB_BRACE) as $versionfile){
$file = file_get_contents($versionfile);
$pattern = preg_quote($versions[1][2], '/');
$pattern = "/^.*$pattern.*\$/m";
if(preg_match_all($pattern, $file, $matches)){
echo "<br />";
echo "osCommerce found:";
echo implode("<br />", $matches[0]);
print_r ("location: ".$versionfile);
}
}
echo $GLOBALS["red"] . $GLOBALS["br"] . "<h3><b>Scanning account for the installed scripts & their versions...</h3><br /></span>";
echo "<span style='color: #666666';><br /><h4><b>Batch #1 - Most used scripts:</h4><br /></span>";
echo $GLOBALS["red"] . $GLOBALS["br"] . "Wordpress<br /><br /></span>";
system ("find ../ -type f -path '*/wp-includes/version.php' -exec grep -H '\$wp_version =' {} \;");
echo $GLOBALS["red"] . $GLOBALS["br"] . "Joomla<br /><br /></span>";
system ("find ../ -type f -path '*/includes/version.php' -exec grep -H '\$RELEASE\|\$DEV_LEVEL' {} \; ");
@@ -1122,9 +1140,6 @@ system ("find ../ -type f -path '*/libraries/cms/version.php' -exec grep -H '\$R
system ("find ../ -type f -path '*/libraries/cms/version/version.php' -exec grep -H '\$RELEASE\ =\|\$DEV_LEVEL\ =' {} \; ");
system ("find ../ -type f -path '*/libraries/cms/version/version.php' -exec grep -H 'const\ RELEASE\ =\|const\ DEV_LEVEL\ =' {} \; ");
echo $GLOBALS["red"] . $GLOBALS["br"] . "osCommerce<br /><br /></span>";
system ("find ../ -type f -path '*/includes/application_top.php' -exec grep -H \"define('PROJECT_VERSION', 'osCommerce Online Merchant\" {} \;");
echo $GLOBALS["red"] . $GLOBALS["br"] . "ZenCart<br /><br /></span>";
system ("find ../ -type f -path '*/includes/version.php' -exec grep -HA2 \"define('PROJECT_VERSION_NAME', 'Zen Cart');\" {} \;");