Location: PHPKode > projects > WebServer Sentry > icept/log.php
<?
#WebServer Sentry:-
#   Copyright Vic Kaprilian(C)2010 - Contact hide@address.com Version 1.0 WebServer Sentry Anti FLOOD/ANTI DOS SCRIPT
#   Copyright Vic Kaprilian(C)2010 - Contact hide@address.com Version 1.0 WebServer Sentry Anti FLOOD/ANTI DOS SCRIPT
#   Copyright Vic Kaprilian(C)2010 - Contact hide@address.com Version 1.0 WebServer Sentry Anti FLOOD/ANTI DOS SCRIPT	
#   Copyright Vic Kaprilian(C)2010 - Contact hide@address.com Version 1.0 WebServer Sentry Anti FLOOD/ANTI DOS SCRIPT	
#   Copyright Vic Kaprilian(C)2010 - Contact hide@address.com Version 1.0 WebServer Sentry Anti FLOOD/ANTI DOS SCRIPT
#WebServer Sentry uses PHPLOT class and IP2NATIONS and any licensing conditions of PHPLOT/IP2NATIONS remain with its respective copyright
#holder/licensing conditions.
#Reverse engineering this script is not permitted.Modifications to improve its performance are welcome as long as you document this at the sourceforge project page.
#Contact hide@address.com    
#########################################################################################################################################
#########################################################################################################################################
#Welcome to WebServer Sentry: Version 1.0:- Please note that Vic Kaprilian does not accept responsibility for the use of the script or any financial loss and it is being released because the E-Commerce/Internet needs it!.
include_once ('GetDeltaTime.php');
include_once ('dbconnecticept.php');
include_once ('whoisip.php');
$query2="SELECT id,counter,ip,datetime,hostname,browser,name,os,data FROM $tbl_name ORDER BY datetime";
$result=mysql_query($query2);
$numrows=mysql_num_rows($result);
echo "<br>";
echo "<br>";
echo "<div align=\"center\">\n";
echo "<b>Quick View</b>";
echo "</div>";
echo "<div align=\"center\">\n";
echo "<br>\n";
echo "<br>\n";
#echo "<fieldset style=\"width:60%\">\n";
echo "<table border='1'  width='100%' align='center' bgcolor='black'>";
echo "<tr><th>Row ID</th><th>IP</th><th>DATE - TIME</th><th></th><th>HOSTNAME</th><th>BOT</th><th></th><th>COUNTRY</th><th>DATA</th></tr>";
$i=0;
while ($i < $numrows) {
$id=mysql_result($result,$i,"id");
$count=mysql_result($result,$i,"counter");
$ip=mysql_result($result,$i,"ip");
$datetime=mysql_result($result,$i,"datetime");
$hostname=mysql_result($result,$i,"hostname");
$browser=mysql_result($result,$i,"browser");
$name=mysql_result($result,$i,"name");
$os=mysql_result($result,$i,"os");
$data=mysql_result($result,$i,"data");
echo "<tr><td bgcolor='black'>"; 
echo "$id";
echo "</td><td bgcolor='black'>"; 
#echo "$count";
#echo "</td><td bgcolor='white'>"; 
echo "$ip";
echo "</td><td bgcolor='black'>"; 
echo "$datetime";
echo "</td><td bgcolor='black'>"; 
echo "</td><td bgcolor='black'>";
echo "$hostname";
echo "</td>"; 
#if ($browser==""){
#echo "<td bgcolor='lightblue'>"; 
#echo "<font color='black'>"; 
##echo "No Browser Detected";
#echo "</font>"; 
#echo "</td>";
#}else{ 	
#echo "<td bgcolor='purple'>"; 
#echo $browser;
#echo "</td>";
#} 	
if ($name=="Not on bot list - Humanoid?"){
echo "<td bgcolor='yellow'>"; 
echo "<font color='black'>"; 
echo "<BLINK>\n";
echo "Not on bot list - Humanoid/WebSurfer/Unlisted Bot";
echo "</BLINK>\n";
echo "</font>"; 
echo "</td>";
}else{ 	
echo "<td bgcolor='pink'>"; 
echo $name;
echo "</td>";
} 	
#if ($os=="Other"){
#echo "<td bgcolor='black'>"; 
#echo "<font color='white'>"; 
#echo "Other";
#echo "</font>"; 
#echo "</td>";
#}else{ 	
#echo "<td bgcolor='orange'>"; 
#echo $os;
#echo "</td>";
#} 	
echo "<td bgcolor='black'>";
$sql = 'SELECT 
	            c.country 
	        FROM 
	            ip2nationCountries c,
	            ip2nation i 
	        WHERE 
	            i.ip < INET_ATON("'. $ip .'") 
	            AND 
	            c.code = i.country 
	        ORDER BY 
	            i.ip DESC 
	        LIMIT 0,1';
	
	list($countryName) = mysql_fetch_row(mysql_query($sql));
	
list($countryName) = mysql_fetch_row(mysql_query($sql));
echo "</td><td bgcolor='black'>"; 
echo $countryName;
echo "</td>"; 	 	
	// Output full country name
if ($data==""){
echo "<td bgcolor='black'>"; 
echo "<font color='white'>"; 
echo "No Data Detected";
echo "</font>"; 
echo "</td></tr>";
}else{ 	
echo "<td bgcolor='green'>"; 
echo "<BLINK>\n";
echo "DATA REQUEST DETECTED";
echo "</BLINK>\n";
echo "</td></tr>";
} 		
$i++;
}


##########################################################################################
####################################     new      ########################################
$queryalpha = "SELECT id, ip, COUNT(ip), hostname, browser, name, os FROM $tbl_name GROUP BY ip"; 
$resultalpha = mysql_query($queryalpha) or die(mysql_error());
$tme=0;
$num=0;
	$ic="";
// Print out result
while($row = mysql_fetch_array($resultalpha)){
    echo "<tr><td bgcolor='black'>"; 
	echo $row['ip'];
	echo "</td><td bgcolor='black'>";
	echo "No of refreshes --- ";
	echo $row['COUNT(ip)'];
	echo "</td>";
	if ($row['COUNT(ip)'] <= 10 and $tme <1){
	$ia=$row['id'];
	$ib=$row['ip'];
	$ipb=$ib;

	$iho=$ic;
#	echo "<td bgcolor='white'>";
#	echo "</td>";
	echo "<td bgcolor='green'>";
	echo $ipb;
	echo $iho;
	echo "</td></tr>";
}elseif($row['COUNT(ip)'] <= 29 and $tme <1){
	$ia=$row['id'];
	$ib=$row['ip'];
	$ipb=$ib;
	$iho=getIpWhoisText($ib);
	echo "<tr><td bgcolor='orange'>"; 
	echo "<BLINK>\n";
	echo $ipb;
	echo "<tr><td bgcolor='orange'>"; 
	echo $iho;
	echo "</td></tr>";
	echo "</BLINK>\n";
	echo "</td></tr>";
}elseif($row['COUNT(ip)'] <= 40 and $tme <1){
	$ia=$row['id'];
	$ib=$row['ip'];
	$il=$row['hostname'];
	$im=$row['browser'];
	$in=$row['name'];
	$io=$row['os'];
	$ic=getIpWhoisText($ib);
	$ipb=$ib;
	$iho=$ic;
	echo "<td bgcolor='purple'>";
	echo "<BLINK>\n";
	echo $ipb;
	echo "</BLINK>\n";
	echo "</td>";
	echo "<td bgcolor='purple'>";
	echo "<BLINK>\n";
	echo $iho;
	echo "</BLINK>\n";
	echo "</td></tr>";
	echo "<td bgcolor='purple'>";
	echo "<BLINK>\n";
	echo $il;
	echo "</BLINK>\n";
	echo "</td>";
	echo "<td bgcolor='purple'>";
	echo "<BLINK>\n";
	echo $im;
	echo "</BLINK>\n";
	echo "</td>";
	echo "<td bgcolor='purple'>";
	echo "<BLINK>\n";
	echo $in;
	echo "</BLINK>\n";
	echo "</td>";
	echo "<td bgcolor='purple'>";
	echo "<BLINK>\n";
	echo $io;
	echo "</BLINK>\n";
	echo "</td></tr>";
	}elseif($row['COUNT(ip)'] >= 41 and $tme <1){
	$ia=$row['id'];
	$ib=$row['ip'];
	$il=$row['hostname'];
	$im=$row['browser'];
	$in=$row['name'];
	$io=$row['os'];
	$ic=getIpWhoisText($ib);
	$ipb=$ib;
	$iho=$ic;
	echo "<td bgcolor='red'>";
	echo "<BLINK>\n";
	echo $ipb;
	echo "</BLINK>\n";
	echo "</td>";
	echo "<td bgcolor='red'>";
	echo "<BLINK>\n";
	echo $iho;
	echo "</BLINK>\n";
	echo "</td></tr>";
	echo "<td bgcolor='red'>";
	echo "<BLINK>\n";
	echo $il;
	echo "</BLINK>\n";
	echo "</td>";
	echo "<td bgcolor='red'>";
	echo "<BLINK>\n";
	echo $im;
	echo "</BLINK>\n";
	echo "</td>";
	echo "<td bgcolor='red'>";
	echo "<BLINK>\n";
	echo $in;
	echo "</BLINK>\n";
	echo "</td>";
	echo "<td bgcolor='red'>";
	echo "<BLINK>\n";
	echo $io;
	echo "</BLINK>\n";
	echo "</td></tr>";
$sql9="SELECT datetime,MIN(datetime) datetime FROM $tbl_name WHERE ip='$ib' GROUP BY ''";
$result5=mysql_query($sql9) or die(mysql_error());
$sql10="SELECT datetime,MAX(datetime) datetime FROM $tbl_name WHERE ip='$ib' GROUP BY ''";
$result6=mysql_query($sql10) or die(mysql_error());
while($row = mysql_fetch_array($result5)){
$dtTime2 =$row['datetime'];
}
while($row = mysql_fetch_array($result6)){
$dtTime1 =$row['datetime'];
}
$strDeltaTime=GetDeltaTime($dtTime1,$dtTime2);
$tme= ltrim($strDeltaTime, '-');
echo $tme;
}else{
echo "<td bgcolor='black'>";
echo "</td></tr>";
}
}
echo "</table>";
echo "</fieldset>\n";
echo "</div>\n";
if ( $num == 0 ) {
    echo "<br>";
	echo "There are no more entries.";
	echo "<br>";
	echo "The next entry id in the system will be " . ($id+1);
}else{
echo "<br>";
mysql_close();
}
#WebServer Sentry:-
#   Copyright Vic Kaprilian(C)2010 - Contact hide@address.com Version 1.0 WebServer Sentry Anti FLOOD/ANTI DOS SCRIPT
#   Copyright Vic Kaprilian(C)2010 - Contact hide@address.com Version 1.0 WebServer Sentry Anti FLOOD/ANTI DOS SCRIPT
#   Copyright Vic Kaprilian(C)2010 - Contact hide@address.com Version 1.0 WebServer Sentry Anti FLOOD/ANTI DOS SCRIPT	
#   Copyright Vic Kaprilian(C)2010 - Contact hide@address.com Version 1.0 WebServer Sentry Anti FLOOD/ANTI DOS SCRIPT	
#   Copyright Vic Kaprilian(C)2010 - Contact hide@address.com Version 1.0 WebServer Sentry Anti FLOOD/ANTI DOS SCRIPT
#WebServer Sentry uses PHPLOT class and IP2NATIONS and any licensing conditions of PHPLOT/IP2NATIONS remain with its respective copyright
#holder/licensing conditions.
#Reverse engineering this script is not permitted.Modifications to improve its performance are welcome as long as you document this at the sourceforge project page.
#Contact hide@address.com    
#########################################################################################################################################
#########################################################################################################################################
#Welcome to WebServer Sentry: Version 1.0:- Please note that Vic Kaprilian does not accept responsibility for the use of the script or any financial loss and it is being released because the E-Commerce/Internet needs it!.
?>
<html>
<head>
<Title>ACCESS LOG - VKONLINE(c)2009</title>
<link rel="stylesheet" type="text/css" href="i.css" />
</head>
<div align="center">
<a href="http://www.buytodayathome.com/vkonline/wordpress/" target="_blank">
<img src="images/interceptor.gif" border="3" width="180" height="54" />
</a>
</div>
<br>
<br>
<br>
<br>
<div align="center">
Vic Kaprilian&copy; 2010 
<br>
REAL TIME - EXCESSIVE HIT MONITOR AND BLOCKER/IP MONITOR/ DEFENCE SYSTEM 
</div>
</body>
</html>
Return current item: WebServer Sentry