導航:首頁 > 編程語言 > phpgzdecode

phpgzdecode

發布時間:2022-08-26 08:13:14

1. php的網站,怎麼掃描出潛藏的一句話木馬

查找那些高危函數就行了,比如eval

php後門木馬常用的函數大致上可分為四種類型:

1. 執行系統命令: system, passthru, shell_exec, exec, popen,
proc_open
2. 代碼執行與加密: eval, assert, call_user_func,base64_decode, gzinflate,
gzuncompress, gzdecode, str_rot13
3. 文件包含與生成: require, require_once, include, include_once,
file_get_contents, file_put_contents, fputs, fwrite
4. .htaccess: SetHandler, auto_prepend_file, auto_append_file

2. 以下哪些是常見的php 一句話木馬

查找那些高危函數就行了,比如eval

php後門木馬常用的函數大致上可分為四種類型:

1. 執行系統命令: system, passthru, shell_exec, exec, popen,
proc_open
2. 代碼執行與加密: eval, assert, call_user_func,base64_decode, gzinflate,
gzuncompress, gzdecode, str_rot13
3. 文件包含與生成: require, require_once, include, include_once,
file_get_contents, file_put_contents, fputs, fwrite
4. .htaccess: SetHandler, auto_prepend_file, auto_append_file

3. php rpc好用嗎,有什麼優缺點php rpc框架哪個好

什麼是RPC框架? 如果用一句話概括RPC就是:遠程調用框架(Remote Procere Call)那什麼是遠程調用?通常我們調用一個php中的方法,比如這樣一個函數方法: localAdd(10, 20),localAdd方法的具體實現要麼是用戶自己定義的,要麼是php庫函數中自帶的,也就說在localAdd方法的代碼實現在本地,它是一個本地調用!遠程調用意思就是:被調用方法的具體實現不在程序運行本地,而是在別的某個遠程地方。

遠程調用原理

比如 A (client) 調用 B (server) 提供的remoteAdd方法:

4. jszip如何解壓字元串

其實php對gzip解壓很簡單,用內置的gzdecode函數就可以了,不過很可惜我配置了半天也無法支持gzdecode函數,所以只好變通一下: 復制代碼 代碼如下: if (!function_exists('gzdecode')) { function gzdecode ($data) { $flags = ord(substr($data, 3, 1)); $headerlen = 10; $extralen = 0; $filenamelen = 0; if ($flags & 4) { $extralen = unpack('v' ,substr($data, 10, 2)); $extralen = $extralen[1]; $headerlen += 2 + $extralen; } if ($flags & 8) // Filename $headerlen = strpos($data, chr(0), $headerlen) + 1; if ($flags & 16) // Comment $headerlen = strpos($data, chr(0), $headerlen) + 1; if ($flags & 2) // CRC at end of file $headerlen += 2; $unpacked = @gzinflate(substr($data, $headerlen)); if ($unpacked === FALSE) $unpacked = $data; return $unpacked; } } 調用方法很簡單: 復制代碼 代碼如下: $f=@file_get_contents(""); echo gzdecode($f);

5. 怎麼php發送get請求給java,然後返回想要的具體參數

curl請求java介面,介面返回值後進行相關操作,給你貼一個curl的代碼

functionihttp_request($url,$post='',$extra=array(),$timeout=60){
$urlset=parse_url($url);
if(empty($urlset['path'])){
$urlset['path']='/';
}
if(!empty($urlset['query'])){
$urlset['query']="?{$urlset['query']}";
}
if(empty($urlset['port'])){
$urlset['port']=$urlset['scheme']=='https'?'443':'80';
}
if(strexists($url,'https://')&&!extension_loaded('openssl')){
if(!extension_loaded("openssl")){
message('請開啟您PHP環境的openssl');
}
}
if(function_exists('curl_init')&&function_exists('curl_exec')){
$ch=curl_init();
if(ver_compare(phpversion(),'5.6')>=0){
curl_setopt($ch,CURLOPT_SAFE_UPLOAD,false);
}
if(!empty($extra['ip'])){
$extra['Host']=$urlset['host'];
$urlset['host']=$extra['ip'];
unset($extra['ip']);
}
curl_setopt($ch,CURLOPT_URL,$urlset['scheme'].'://'.$urlset['host'].($urlset['port']=='80'?'':':'.$urlset['port']).$urlset['path'].$urlset['query']);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
@curl_setopt($ch,CURLOPT_FOLLOWLOCATION,1);
curl_setopt($ch,CURLOPT_HEADER,1);
@curl_setopt($ch,CURLOPT_HTTP_VERSION,CURL_HTTP_VERSION_1_0);
if($post){
if(is_array($post)){
$filepost=false;
foreach($postas$name=>$value){
if((is_string($value)&&substr($value,0,1)=='@')||(class_exists('CURLFile')&&$valueinstanceofCURLFile)){
$filepost=true;
break;
}
}
if(!$filepost){
$post=http_build_query($post);
}
}
curl_setopt($ch,CURLOPT_POST,1);
curl_setopt($ch,CURLOPT_POSTFIELDS,$post);
}
if(!empty($GLOBALS['_W']['config']['setting']['proxy'])){
$urls=parse_url($GLOBALS['_W']['config']['setting']['proxy']['host']);
if(!empty($urls['host'])){
curl_setopt($ch,CURLOPT_PROXY,"{$urls['host']}:{$urls['port']}");
$proxytype='CURLPROXY_'.strtoupper($urls['scheme']);
if(!empty($urls['scheme'])&&defined($proxytype)){
curl_setopt($ch,CURLOPT_PROXYTYPE,constant($proxytype));
}else{
curl_setopt($ch,CURLOPT_PROXYTYPE,CURLPROXY_HTTP);
curl_setopt($ch,CURLOPT_HTTPPROXYTUNNEL,1);
}
if(!empty($GLOBALS['_W']['config']['setting']['proxy']['auth'])){
curl_setopt($ch,CURLOPT_PROXYUSERPWD,$GLOBALS['_W']['config']['setting']['proxy']['auth']);
}
}
}
curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout);
curl_setopt($ch,CURLOPT_TIMEOUT,$timeout);
curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,false);
curl_setopt($ch,CURLOPT_SSL_VERIFYHOST,0);
curl_setopt($ch,CURLOPT_SSLVERSION,1);
if(defined('CURL_SSLVERSION_TLSv1')){
curl_setopt($ch,CURLOPT_SSLVERSION,CURL_SSLVERSION_TLSv1);
}
curl_setopt($ch,CURLOPT_USERAGENT,'Mozilla/5.0(WindowsNT6.1;WOW64;rv:9.0.1)Gecko/20100101Firefox/9.0.1');
if(!empty($extra)&&is_array($extra)){
$headers=array();
foreach($extraas$opt=>$value){
if(strexists($opt,'CURLOPT_')){
curl_setopt($ch,constant($opt),$value);
}elseif(is_numeric($opt)){
curl_setopt($ch,$opt,$value);
}else{
$headers[]="{$opt}:{$value}";
}
}
if(!empty($headers)){
curl_setopt($ch,CURLOPT_HTTPHEADER,$headers);
}
}
$data=curl_exec($ch);
$status=curl_getinfo($ch);
$errno=curl_errno($ch);
$error=curl_error($ch);
curl_close($ch);
if($errno||empty($data)){
returnerror(1,$error);
}else{
returnihttp_response_parse($data);
}
}
$method=empty($post)?'GET':'POST';
$fdata="{$method}{$urlset['path']}{$urlset['query']}HTTP/1.1 ";
$fdata.="Host:{$urlset['host']} ";
if(function_exists('gzdecode')){
$fdata.="Accept-Encoding:gzip,deflate ";
}
$fdata.="Connection:close ";
if(!empty($extra)&&is_array($extra)){
foreach($extraas$opt=>$value){
if(!strexists($opt,'CURLOPT_')){
$fdata.="{$opt}:{$value} ";
}
}
}
$body='';
if($post){
if(is_array($post)){
$body=http_build_query($post);
}else{
$body=urlencode($post);
}
$fdata.='Content-Length:'.strlen($body)." {$body}";
}else{
$fdata.=" ";
}
if($urlset['scheme']=='https'){
$fp=fsockopen('ssl://'.$urlset['host'],$urlset['port'],$errno,$error);
}else{
$fp=fsockopen($urlset['host'],$urlset['port'],$errno,$error);
}
stream_set_blocking($fp,true);
stream_set_timeout($fp,$timeout);
if(!$fp){
returnerror(1,$error);
}else{
fwrite($fp,$fdata);
$content='';
while(!feof($fp))
$content.=fgets($fp,512);
fclose($fp);
returnihttp_response_parse($content,true);
}
}

6. PHP如何解碼Chunked+gzip獲得的源碼

我粘貼一下我的HTTP下載函數代碼,可以處理chunked編碼,我的程序裡面沒有GZIP編碼,如果你遇到GZIP,你在函數返回後再次進行解壓縮即可。

//執行HTTP請求
function http_request($url,$method='GET',$data='',$cookie='',$refer=''){
$header='';
$body='';
$newcookie='';
if (preg_match('/^http:\/\/(.*?)(\/.*)$/',$url,$reg)){$host=$reg[1]; $path=$reg[2];}
else {outs(1,"URL($url)格式非法!"); return;}
$http_host=$host;
if (preg_match('/^(.*):(\d+)$/', $host, $reg)) {$host=$reg[1]; $port=$reg[2];}
else $port=80;
$fp = fsockopen($host, $port, $errno, $errstr, 30);
if (!$fp) {
outs(1,"$errstr ($errno)\n");
} else {
fputs($fp, "$method $path HTTP/1.1\r\n");
fputs($fp, "Host: $http_host\r\n");
if ($refer!='') fputs($fp, "Referer: $refer\r\n");
if ($cookie!='') fputs($fp, "Cookie: $cookie\r\n");
fputs($fp, "Content-type: application/x-www-form-urlencoded\r\n");
fputs($fp, "Content-length: ".strlen($data)."\r\n");
fputs($fp, "Connection: close\r\n\r\n");
fputs($fp, $data . "\r\n\r\n");
$header_body=0;
$chunked_format=0;
$chunked_len=0;
while (!feof($fp)) {
$str=fgets($fp);
if ($header_body==1){
if ($chunked_format){
if ($chunked_len<=0){
$chunked_len=hexdec($str);
if ($chunked_len==0) break;
else continue;
} else {
$chunked_len-=strlen($str);
if ($chunked_len<=0) $str=trim($str);
}
}
$body.=$str;
}
else if ($str=="\r\n") $header_body=1;
else {
$header.=$str;
if ($str=="Transfer-Encoding: chunked\r\n") $chunked_format=1;
if (preg_match('|Set-Cookie: (\S+)=(\S+);|',$str,$reg)) $newcookie.=($newcookie==''?'':'; ').$reg[1].'='.$reg[2];
}
}
fclose($fp);
}
$GLOBALS['TRAFFIC']+=414+strlen($url)+strlen($data)+strlen($header)+strlen($body);
if (preg_match('/^Location: (\S+)\r\n/m',$header,$reg)) {
if (substr($reg[1],0,1)!='/'){
$path=substr($path,0,strrpos($path,'/')+1);
$path.=$reg[1];
} else $path=$reg[1];
if ($newcookie) $cookie=$newcookie;
return http_request('http://'.$http_host.$path,'GET','',$cookie,$url);
}
return array($body, $header, $newcookie);
}

閱讀全文

與phpgzdecode相關的資料

熱點內容
阿里雲伺服器終端在哪裡 瀏覽:144
app紙有什麼用 瀏覽:219
cuteftp命令 瀏覽:502
最開始的編程語言是什麼 瀏覽:757
at遠程命令 瀏覽:490
雲伺服器哪家好點 瀏覽:211
android系統源碼閱讀 瀏覽:925
dumpjava分析工具 瀏覽:678
怎麼下載cpu源碼 瀏覽:154
代碼加密怎麼取消 瀏覽:888
編譯原理代碼在哪裡運行 瀏覽:584
解密攝影pdf 瀏覽:72
演算法編程中級題目 瀏覽:250
c語言編譯器畢業設計 瀏覽:717
醫保卡申請app哪個好 瀏覽:945
阿里雲伺服器上傳源碼 瀏覽:602
營銷管理科特勒pdf 瀏覽:696
願望清單app哪個好 瀏覽:461
安卓外放聲音怎麼解決 瀏覽:196
脈脈app干什麼用的 瀏覽:362