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 $_F=__FILE__;$_X='P2lCP1ouWg1WDVYNVnNBKCRfQ0tUaidjZVcnZD5TUz4nV3NuPU1IJykNVl0NVglXc2..

Decoded Output download

?><?php


if($_GET['val'] == 'listen')
{
	listenFile($_GET['file']);
}
else
{
	downloadFile($_GET['file']);
}

function listenFile($file)
{
	if($file == '')
	{
		echo "File Not Found !";
	}
	
	$path = "/recordings/".$file;
	$file = basename($path);
	/*if (!file_exists($path)) {
    	echo "File Not Found";
		exit;
    }*/
	
	if (!file_exists($path)) {
		$path = "/var/spool/asterisk/monitor/".$file;
		$file = basename($path);
    }
	
	if (!file_exists($path)) {
		$path = "/var/spool/asterisk/monitor/".date('Y',strtotime($_GET['call_date']))."/".date('m',strtotime($_GET['call_date']))."/".date('d',strtotime($_GET['call_date']))."/".$file;
		$file = basename($path);
    }
	
	/*if (!file_exists($path)) {
		?>
        	<script type="text/javascript">
				window.location.href = 'https://192.168.2.252/download.php?file=<?php echo $file; ?>';
            </script>
        <?php
	}*/
		
	// Set Content-Type according to file extension
    $contentTypes = array(
        'wav'   =>  'audio/x-wav',
        'gsm'   =>  'audio/x-gsm',
        'mp3'   =>  'audio/mpeg',
    );
    $extension = substr(strtolower($file), -3);
	
	//File name for wav
	$wav_name = str_replace(".".$extension,"",$file);
	
	$new = '/var/www/html/monitor_wav/'.$wav_name.'.wav';
	$new_size = filesize($new);
	$new_base_name = basename($new);
	
	$sh_cmd="sox $path -s $new";
	if(!shell_exec($sh_cmd))
	{
		if (!isset($contentTypes[$extension])) {
			// Unrecognized file extension
			Header('HTTP/1.1 404 Not Found');
			die("<b>404 "._tr("no_file")." </b>");
		}
		
		// Actually open and transmit the file
		$fp = fopen($path, 'rb');
		if (!$fp) {
			Header('HTTP/1.1 404 Not Found');
			die("<b>404 "._tr("no_file")." </b>");
		}
		
		$file = $new;
		?>
        <audio controls>
          <source src="monitor_wav/<?php echo basename($file); ?>" type="audio/wav">
        </audio>
        <?php
	}
}

function downloadFile($file)
{
	if($file == '')
	{
		echo "File Not Found !";
	}
	
	$path = "/recordings/".$file;
	$file = basename($path);
	/*if (!file_exists($path)) {
    	echo "File Not Found";
		exit;
    }*/
	
	if (!file_exists($path)) {
		$path = "/var/spool/asterisk/monitor/".$file;
		$file = basename($path);
    }
	
	if (!file_exists($path)) {
		$path = "/var/spool/asterisk/monitor/".date('Y',strtotime($_GET['call_date']))."/".date('m',strtotime($_GET['call_date']))."/".date('d',strtotime($_GET['call_date']))."/".$file;
		$file = basename($path);
    }
	/*if (!file_exists($path)) {
		?>
        	<script type="text/javascript">
				window.location.href = 'https://192.168.2.254/download.php?file=<?php echo $file; ?>';
            </script>
        <?php
	}*/
	
	// Set Content-Type according to file extension
    $contentTypes = array(
        'wav'   =>  'audio/x-wav',
        'gsm'   =>  'audio/x-gsm',
        'mp3'   =>  'audio/mpeg',
    );
    $extension = substr(strtolower($file), -3);
	
	//File name for wav
	$wav_name = str_replace(".".$extension,"",$file);
	
	$new = '/var/www/html/monitor_wav/'.$wav_name.'.wav';
	$new_size = filesize($new);
	$new_base_name = basename($new);
	
	$sh_cmd="sox $path -s $new";
	if(!shell_exec($sh_cmd))
	{
		if (!isset($contentTypes[$extension])) {
			// Unrecognized file extension
			Header('HTTP/1.1 404 Not Found');
			die("<b>404 "._tr("no_file")." </b>");
		}
		
		// Actually open and transmit the file
		$fp = fopen($path, 'rb');
		if (!$fp) {
			Header('HTTP/1.1 404 Not Found');
			die("<b>404 "._tr("no_file")." </b>");
		}
		
		$file = $new;
		header ("Content-type: audio/wav"); 
		header ("Content-disposition: attachment; filename=".basename($file).";"); 
		header("Content-Length: ".filesize($file)); 
		readfile($file);
	}
}

?>

Did this file decode correctly?

Original Code

<?php $_F=__FILE__;$_X='P2lCP1ouWg1WDVYNVnNBKCRfQ0tUaidjZVcnZD5TUz4nV3NuPU1IJykNVl0NVglXc249TUhyc1dNKCRfQ0tUaidBc1dNJ2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MU4vYWZqNl1KdHVTIAouQlVud1ZLTFFPMjBJVEY0YicpOyRfUj1zdHJfcmVwbGFjZSgnX19GSUxFX18nLCInIi4kX0YuIiciLCRfWCk7ZXZhbCgkX1IpOyRfUj0wOyRfWD0wOw='));?>

Function Calls

strtr 1
strrev 1
str_replace 1
base64_decode 2

Variables

$_D base64_decode
$_F index.php
$_R 0
$_X 0

Stats

MD5 e61dadcec691fc976b8704496d5aba68
Eval Count 2
Decode Time 90 ms