<?php
error_reporting(0);
highlight_file(__FILE__);
include('waf.php');
$path = 'uploads/'.md5("hacker".$_SERVER['REMOTE_ADDR']);
@mkdir($path, 0755, True);
$action = @$_GET['action'];
if($action === 'upload') {
if ($_FILES["file"]["error"] > 0 && $_FILES["file"]["size"] > 204800){
die('upload error');
} else {
$filename = $_FILES["file"]["name"];
$uploadpath = $path.'/'.$filename;
$content = $_FILES["file"]["tmp_name"];
waf(file_get_contents($content));
move_uploaded_file($_FILES["file"]["tmp_name"], $uploadpath);
var_dump("文件已上传到".$uploadpath);
}
} elseif ($action === 'include') {
$filename = $_POST['filename'];
if(stristr($filename, "uploads") !== false) {
die("Oh, you can not include what you upload.");
}
$realpath = __DIR__.'/'.$filename;
// var_dump($realpath);
include_once($realpath);
}
等个wp