";
print "Malware Scanner v{$version} by Malin Cenusa (malin@cenusa.me)\n\n";
print "Directory depth set to {$recurse}\n\n";
$fl = new e_file();
$tree = $fl->get_files($eroot, '\.php|\.sc|.bb|\.gif|\.js|\.htm|\.html|\.htaccess', 'standard', $recurse);
$counter_infected = 0;
$counter_cleaned = 0;
$counter_suspected = 0;
$counter_error = 0;
$counter_warning = 0;
// just in case
set_time_limit(0);
error_reporting(E_ALL);
$pattern = array(
"^(.*)<\?php(.*)eval(\s*)\((\s*)base64_decode(\s*)\((\s*)(.*)(\?><\?php)*\n",
"eval(\s*)\((.*)base64_decode(\s*)\(",
"this.form.upload_file.disabled=false",
"function(\s*)jspw3\(d\,m\,f\)",
"a(\s*)simple(\s*)Web-based(\s*)file(\s*)manager",
"php\_uname(\s*)\(preg_replace(\s*)\(",
"function(\s*)rewrioutclbkxxx1\(",
"eval\(\(base64_decode\(",
"preg_replace\(strrev\(",
"s=base64_decode\(str_replace\(chr\(32\)",
"_GET\[base64_decode\(",
"eval\(base64_decode\(<(.*)POST(.*)>php",
"\.\"
404\s*Not\s*Found<\/title><\/head>",
"@error_reporting\(0\)",
"==========================+(\s*)Credit.Mutuel.ReZult(\s*)+==================",
"X-Mailer:(\s*)The(\s*)Bat\!(\s*)\(v",
"WordPress(\s*)Inserter(\s*)Links",
"The(\s*)Sword(\s*)Config(\s*)Fuck(\s*)Script",
"@kr(\s*)=(\s*);",
"copyto(\s*)=(\s*)explode\(",
"d.=sprintf\(\(substr\(urlencode\(print_r\(array\(",
"eval\(gzinflate\(base64_decode\(",
"eval\(gzinflate\(str_rot13\(base64_decode\(",
"Bank(\s*)of(\s*)America(\s*)\|(\s*)Home(\s*)\|(\s*)Personal",
"Bank(\s*)of(\s*)America(\s*)\|(\s*)Online(\s*)Banking(\s*)\|(\s*)Sign(\s*)In(\s*)to(\s*)Online(\s*)Banking",
"Bank(\s*)of(\s*)America(\s*)\|(\s*)Thank(\s*)you",
"Wells(\s*)Fargo(\s*)Home(\s*)Page",
"Chase(\s*)Online(\s*)-(\s*)Logon",
"Send(\s*)Money,(\s*)Pay(\s*)Online(\s*)or(\s*)Set(\s*)Up(\s*)a(\s*)Merchant(\s*)Account(\s*)with(\s*)PayPal",
"Login(\s*)-(\s*)PayPal",
"Sign(\s*)Up(\s*)for(\s*)PayPal(\s*)-(\s*)It\'s(\s*)Free(\s*)and(\s*)Easy(\s*)to(\s*)Get(\s*)Started",
"My(\s*)Account(\s*)-(\s*)Telstra",
"RBC(\s*)Royal(\s*)Bank(\s*)-(\s*)Sign(\s*)In(\s*)to(\s*)Online(\s*)Banking",
"RBC(\s*)Financial(\s*)Group(\s*)-(\s*)Online(\s*)Banking",
"Online(\s*)Banking(\s*)Security(\s*)and(\s*)Privacy(\s*)Guide(\s*)-(\s*)RBC(\s*)Royal(\s*)Bank",
"~(\s*)Santander(\s*)Online(\s*)Banking(\s*)~",
"Santander(\s*)e-Banking(\s*)?(\s*)Logon(\s*)page",
"Santander(\s*)Online(\s*)Banking",
"eBucks(\s*)>(\s*)Home",
"Chase(\s*)Personal(\s*)Banking(\s*)Investments(\s*)Credit(\s*)Cards(\s*)Home(\s*)Auto(\s*)Commercial(\s*)Small(\s*)Business(\s*)Insurance",
"Yahoo!(\s*)Mail:(\s*)The(\s*)best(\s*)web-based(\s*)email!",
"Remax(\s*)ReZulT(\s*)By",
"ErrorDocument(\s*)404(\s*)http",
"ErrorDocument(\s*)500(\s*)http",
"ErrorDocument(\s*)403(\s*)http",
"%u0c0c%u0c0c",
"String.fromCharCode\(32\)",
"HTTP_REFERER(.*)msn(.*)live",
"SnIpEr_SA",
"php_value(\s*)auto_append_file",
"AddType(\s*)application(\s*).jpg",
"AddHandler(\s*)php5-script(\s*).jpg",
"HTTP_USER_AGENT(.*)google(.*)yahoo",
"HTTP_REFERER(.*)search.yahoo\*",
"Card(.*)number:",
"Mass(.*)Mailer",
"<\?php\s*eval\(\"\?>\"\.base64\_decode\(\"(.*)\"\)\)\;\s*\?>",
"\;if\(aa\.indexOf\(aaa\)\=\=\=0\)",
"function\s*re\(s\,n\,r\,b\,e\)",
"var\s*foobar\s*\=\s*unescape\;",
"auth\_pass\s*\=\s*\"(.*)\"\;\s*eval\(\"",
"<\?php\s*\@copy\(\W\_FILES\[file\]\[tmp\_name\]\,\s*\W\_FILES\[file\]\[name\]\)\;\s*exit\;\s*\?>",
"<\?php\s*\/\/(.*)\_\=\s*\/\/system\s*file\s*do\s*not\s*delete\'\'\;\s*\/\/system\s*file\s*do\s*not\s*delete\s*\W\_\_\s*\=\s*\"(.*)\"\;\W\_\_\_\s*\=\s*\"(.*)\"\;eval\(\W\_\_\_\(\W\_\_\)\)\;",
"preg\_replace\(\"\/\.\+\/esi\"\,\"",
"