Skip to content

Instantly share code, notes, and snippets.

@mpge
Created July 10, 2015 20:45
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 mpge/269196c0e3547795dd3a to your computer and use it in GitHub Desktop.
Save mpge/269196c0e3547795dd3a to your computer and use it in GitHub Desktop.
Scan all files for eval base64 decode string
$config = array(
'dir' => dirname(__FILENAME__),
);
// DO NOT EDIT BELOW THIS LINE!
function output() {
flush();
ob_flush();
}
echo '<h1>EVALBASE64DECODE Malware Detector</h1><p>Please wait, we are currently searching for possible infected files...</p><br /><hr /><br />';
output();
$string = 'eval(base64_decode(';
$dir = new DirectoryIterator($config['dir']);
foreach ($dir as $file) {
$content = file_get_contents($file->getPathname());
if (strpos($content, $string) !== false) {
echo '<p>Possible Infection Found:&nbsp;'.$file->getPathname().'</p>';
output();
}
}
$dir = $config['dir'];
foreach (glob("$dir/*") as $file) {
$content = file_get_contents("$dir/$file");
if (strpos($content, $string) !== false) {
echo '<p>Possible Infection Found:&nbsp;'."$dir/$file".'</p>';
output();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment