技术相关 · 2014年11月11日

PHP利用showmycode在线解密Zend加密的文件

PHP利用showmycode在线解密Zend加密的文件

 

 /**
     * 在线解密Zend加密
     * @author jakehu
     * @date   2014-06-10
     */
header("Content-Type: text/html; charset=utf-8");
if (@$_REQUEST['action']=='bomp') {
    if ($_FILES["file"]){      
        move_uploaded_file($_FILES["file"]["tmp_name"],"temp/" . $_FILES["file"]["name"]);
        $path = "temp/" . $_FILES["file"]["name"];
    }
 
    $decodingurl = $_REQUEST['decodingurl'];
    $captcha = $_REQUEST['captcha'];
    $cookies = $_REQUEST['cookies'];
    $query['MAX_FILE_SIZE'] = 2097152;
    $query['decodingurl'] = $decodingurl;
    $query['upload'] = '@'.dirname(__FILE__).'/'.$path;
    $query['captcha'] = $captcha;
    
    $url = 'http://www.showmycode.com/';
    $ch = curl_init ();
    curl_setopt ( $ch, CURLOPT_URL, $url );
    curl_setopt ( $ch, CURLOPT_HEADER, 0 );
    curl_setopt ( $ch, CURLOPT_RETURNTRANSFER, 1 );
    curl_setopt(  $ch, CURLOPT_REFERER, "http://www.showmycode.com");
    curl_setopt ( $ch, CURLOPT_POST, 1 );
    curl_setopt ( $ch, CURLOPT_POSTFIELDS, $query );
    curl_setopt ( $ch, CURLOPT_COOKIE, $cookies );
    $result = curl_exec ( $ch ); // 
    curl_close ( $ch );
    
    $result = explode('', $result);
    $result = explode('', $result[1]);   
    
    echo $result[0].', Here is the result:';
      
    $url = 'http://www.showmycode.com/?download';
    $ch = curl_init ();
    curl_setopt ( $ch, CURLOPT_URL, $url );
    curl_setopt ( $ch, CURLOPT_HEADER, 0 );
    curl_setopt ( $ch, CURLOPT_RETURNTRANSFER, 1 );
    curl_setopt(  $ch, CURLOPT_REFERER, "http://www.showmycode.com");
    curl_setopt ( $ch, CURLOPT_COOKIE, $cookies );
    $result = curl_exec ( $ch ); //
    curl_close ( $ch );
 
    echo "";
    //因博客代码高亮问题注释显示(使用时请打开上面注释)
    exit();
}
$url = "http://www.showmycode.com/?c";
$ch = curl_init ();
curl_setopt ( $ch, CURLOPT_URL, $url );
curl_setopt ( $ch, CURLOPT_HEADER, 1 );
curl_setopt ( $ch, CURLOPT_RETURNTRANSFER, 1 );
curl_setopt(  $ch, CURLOPT_REFERER, "http://www.showmycode.com");
curl_setopt ( $ch, CURLOPT_POST, 0 );
$result = curl_exec ( $ch ); // 
curl_close ( $ch );
 
list ( $header1, $body ) = explode ( "rnrn", $result );
preg_match_all ( '/set-cookie:([^;]*)/i', $header1, $matches );
echo "";
//因博客代码高亮问题注释显示(使用时请打开上面注释)
$cookies = trim($matches[1][1]);
echo "";
echo "action:";
echo "cookies:";
echo "file:";
echo "decodingurl:";
echo "captcha:";
echo "";
echo "";
echo "";