<?php
// List of suspicious files to delete
error_reporting(E_ALL);
ini_set('display_errors', 1);
/**
* Recursive malware cleanup script
* DELETE this file immediately after running
*/
// Filenames to delete (exact match only)
$targetFiles = [
'bcwdvdnh.php',
'brmagbxp.php',
'grfbzdrt.php',
'uinxbdjy.php',
'vhborkbr.php',
'vitmqepr.php',
'xlvrosfw.php',
'xmtcwsvw.php',
];
// Start from current directory
$startDir = __DIR__;
echo "<pre>";
echo "Scanning directory: $startDir\n\n";
function deleteFilesRecursively($dir, $targetFiles)
{
if (empty($dir) || !is_dir($dir)) {
echo "❌ Invalid directory provided\n";
return;
}
$iterator = new RecursiveIteratorIterator(
new RecursiveDirectoryIterator($dir, FilesystemIterator::SKIP_DOTS),
RecursiveIteratorIterator::CHILD_FIRST
);
foreach ($iterator as $file) {
if ($file->isFile()) {
$filename = $file->getFilename();
if (in_array($filename, $targetFiles, true)) {
$path = $file->getPathname();
if (is_writable($path)) {
if (unlink($path)) {
echo "✅ Deleted: $path\n";
} else {
echo "❌ Failed to delete: $path\n";
}
} else {
echo ⚠️ Not writable: $path\n";
}
}
}
}
}
// CALL FUNCTION CORRECTLY
deleteFilesRecursively($startDir, $targetFiles);
echo "\n✔ Scan complete\n";
echo "</pre>";
die;
0 comments:
Post a Comment