<?php
ini_set
("display_errors", "On");
error_reporting(E_ALL | E_STRICT);
if(!isset(
$_GET['c'])){
    
show_source(__FILE__);
    die();
}
function 
rand_string( $length ) {
    
$chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
    
$size = strlen( $chars );
    
$str = '';
    for( 
$i = 0; $i < $length; $i++)
   {
       
$str .= $chars[ rand( 0, $size - 1 ) ];
   }
    return 
$str;
}
$data = $_GET['c'];
$black_list = array(' ', '!', '"', '#', '%', '&', '*', ',', '-', '/', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ':', '<', '>', '?', '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '\\', '^', '`', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '|', '~');
foreach (
$black_list as $b) {
    if (
stripos($data, $b) !== false){
        die(
"WAF!");
    }
}
$filename=rand_string(0x20).'.php';
$folder='uploads/';
$full_filename = $folder.$filename;
if(
file_put_contents($full_filename, '<?php '.$data)){
    echo 
"<a href='".$full_filename."'>WebShell</a></br>";
    echo 
"Enjoy your webshell~";
}else{
    echo 
"Some thing wrong...";
}
?>