1. <?php
    2. error_reporting(0);
    3. highlight_file(__FILE__);
    4. include('waf.php');
    5. $path = 'uploads/'.md5("hacker".$_SERVER['REMOTE_ADDR']);
    6. @mkdir($path, 0755, True);
    7. $action = @$_GET['action'];
    8. if($action === 'upload') {
    9. if ($_FILES["file"]["error"] > 0 && $_FILES["file"]["size"] > 204800){
    10. die('upload error');
    11. } else {
    12. $filename = $_FILES["file"]["name"];
    13. $uploadpath = $path.'/'.$filename;
    14. $content = $_FILES["file"]["tmp_name"];
    15. waf(file_get_contents($content));
    16. move_uploaded_file($_FILES["file"]["tmp_name"], $uploadpath);
    17. var_dump("文件已上传到".$uploadpath);
    18. }
    19. } elseif ($action === 'include') {
    20. $filename = $_POST['filename'];
    21. if(stristr($filename, "uploads") !== false) {
    22. die("Oh, you can not include what you upload.");
    23. }
    24. $realpath = __DIR__.'/'.$filename;
    25. // var_dump($realpath);
    26. include_once($realpath);
    27. }

    等个wp