导航:首页 > 编程语言 > 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相关的资料

热点内容
脉脉app干什么用的 浏览:357
拽姐是哪个app 浏览:858
云服务器删除了还有吗 浏览:232
macbook可以用单片机嘛 浏览:307
南阳php招聘 浏览:814
去哪里找按摩师很漂亮的app 浏览:818
86x99用简便算法计算 浏览:830
php截图flash 浏览:272
卸载联想app哪个好 浏览:719
php文字转图片 浏览:330
豆客后台怎么加密码 浏览:574
jpg转换pdf破解版 浏览:978
php基础书籍推荐 浏览:777
服务器与外网不通如何验证 浏览:351
电子版是不是就是文件夹 浏览:51
游戏属性文件加密 浏览:464
如何让安卓手机桌面图标下移 浏览:530
ubuntuphp5环境搭建 浏览:101
赌瘾解压视频 浏览:919
晋城移动dns服务器地址 浏览:296