diff --git a/sc.php b/sc.php
index 1bf7aa4..d0be174 100644
--- a/sc.php
+++ b/sc.php
@@ -191,7 +191,7 @@ Order Deny,Allow
Deny from all
';
- 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 "
";
+ echo "Wordpress found:";
+ echo implode("
", $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 "
";
+ echo "osCommerce found:";
+ echo implode("
", $matches[0]);
+ print_r ("location: ".$versionfile);
+ }
+}
+
echo $GLOBALS["red"] . $GLOBALS["br"] . "