Location: PHPKode > projects > WebServer Sentry > icept/lass.php
<?
include_once ('dbconnecticept.php');
include_once ('whoisip.php');
include_once('GetDeltaTime.php');
include_once('geturi.php');
include_once ('realip.php');
session_start();
# isset must appear before session variable 112009vk.In this case line8
if (isset($_SESSION['uname']) && !empty($_SESSION['uname'])){
$Loggedby = $_SESSION['uname'];
}else{
header("location:viewall.php");
$Loggedby="";
$ipb="";
}
#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!.
if ($Loggedby != ""){
$ipb=$_POST['jam'];
$sw=$_POST['switch']; 
}else{
mysql_close();
header("location:admin.php");
}
$ipb=trim($ipb);
$o="or";
$a="and";
$n="not";
$p="&";
if (strstr($ipb,$o)){
header("location:admin.php");
}else{
$ipb=$ipb;
}
if (strstr($ipb,$a)){
header("location:admin.php");
}else{
$ipb=$ipb;
}
if (strstr($ipb,$n)){
header("location:admin.php");
}else{
$ipb=$ipb;
}
if (strstr($ipb,$p)){
header("location:admin.php");
}else{
$ipb=$ipb;
}
#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!.
if (strlen($ipb) < 8){
header("location:admin.php");
}else{
$ipb=$ipb;
}
if (strlen($ipb) > 32){
header("location:admin.php");
}else{
$ipb=$ipb;
}
#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!.
$ipb = stripslashes($ipb);
$ipb = mysql_real_escape_string($ipb);
# if switch is in manual add to the block list and get whois else admin page
if ($Loggedby != "" and $sw == "manual"){
$wwho=substr(getIpWhoisText($ipb),0,96);
$query1 = "INSERT INTO $tbl_name4 (pb,wwho) VALUES ('$ipb','$wwho')";
mysql_query($query1);
}elseif($Loggedby != "" and $sw == "blockallonradar"){
$query4 = "SELECT id, ip, COUNT(ip) FROM $tbl_name GROUP BY ip"; 
$result4 = mysql_query($query4) or die(mysql_error());
#Initialise variable for date difference function: Painful routine to code
$dtTime1=0;
$dtTime2=0;
$tme=0;
while($row = mysql_fetch_array($result4)){
# if the count is over trippoint get the IP address and count. Store count as a variable as well as row id, ip       
if ($row['COUNT(ip)'] >= 40){
    $ia=$row['id'];
	$ib=$row['ip'];
	$ic=substr(getIpWhoisText($ib),0,96);
    $iz=$row['COUNT(ip)'];
# still in auto - calculate time between ip refreshes  for a given ip address 	
	$query2="SELECT datetime,MIN(datetime) datetime FROM $tbl_name WHERE ip='$ib' GROUP BY ''";
    $result2=mysql_query($query2) or die(mysql_error());
    
    while($row = mysql_fetch_array($result2)){
    $dtTime2 =$row['datetime'];
    }
#       
    $query3="SELECT datetime,MAX(datetime) datetime FROM $tbl_name WHERE ip='$ib' GROUP BY ''";
    $result3=mysql_query($query3) or die(mysql_error());
#        
    while($row = mysql_fetch_array($result3)){
    $dtTime1 =$row['datetime'];
    }
# exec time calculating function Getdeltatime dtTime 1 is the maximum value ie latest entry  - dtTime2 is the minimum ie First entry    
    $strDeltaTime=GetDeltaTime($dtTime1,$dtTime2);
    $tme= ltrim($strDeltaTime, '-');
    
# if the count is over 40 and the time is lest than ? hours insert in block list.    
    if($iz >= 40 && $tme != 0){
    $query6 = "INSERT INTO $tbl_name4 (pb,wwho) VALUES ('$ib','$ic')";
    mysql_query($query6);
    # Newly added - echo to admin page - remove if doesnt work ok
    }else{
    }
}else{
}
header("location: admin.php");
}
}else{
mysql_close();
header("location:admin.php");
}
?>
<html>
<head>
<Title>Auto Block - VKONLINE(c)2009</title>
<link rel="stylesheet" type="text/css" href="i.css" />
</head>
<br>
<br>
<br>
<br>
<div align="center">
BLOCKING OF IP ADDRESS AS REQUESTED, INTERCEPTOR RADAR
</div>
<div align="center">
<img src="images/radar.gif" border="3" width="250" height="250" />
<img src="images/raaf.gif" border="3" width="554" height="250" />
<img src="images/radar.gif" border="3" width="250" height="250" />
</div>
<div align="center">
<img src="images/interceptor.gif" border="3" width="180" />
</div>
<div align="center">
<br>
<br>
<a href="admin.php"> Back to the Command Center</a>
<br>
<br>
<br>
Vic Kaprilian&copy; 2010 
<br>
REAL TIME - EXCESSIVE HIT MONITOR AND BLOCKER/IP MONITOR/ DEFENCE SYSTEM 
</div>
</body>
</html>


Return current item: WebServer Sentry