Re: Anti Dos script coded by thrinityGunz
Just remove that script.
A simple PHP script can't stop a DoS or DDoS. It will only stop people of F5ing your page.
Post the whole script because I don't know what those variables are. (Paste it at Pastebin.com - #1 paste tool since 2002!)
Re: Anti Dos script coded by thrinityGunz
Code:
<?php
$crlf=chr(13).chr(10);
$itime=3; //Minimum number of seconds between one-visitor visits
$imaxvisit=10; //Maximum visits in $itime x $imaxvisits seconds
$ipenalty=($itime * $imaxvisit); //Minutes for waitting
$iplogdir="./logs/";
$iplogfile="AttackersIPs.Log";
// Time
$today = date("Y-m-j,G");
$min = date("i");
$sec = date("s");
$r = substr(date("i"),0,1);
$m = substr(date("i"),1,1);
$minute = 0;
$to = 'Your E-mail';
$headers = 'From: Trinity DDOS Shield' . "\r\n";
$subject = "Warning of Possible DoS Attack at $today:$min:$sec";
//Warning Messages:
$message1='<font color="red">Trinity under heavy bandwidth usage or being DDOS attacked!</font><br>';
$message2='Please wait ... ';
$message3=' seconds or try again after some minutes from now.<br>';
$message4='<font color="blue">Protected by DDOS Shield Made by Jesus Christ for Trinityent.</font><br>If you are a human, change IP.<br>We temporarily banned this IP <b>'.$_SERVER["REMOTE_ADDR"].' </b>from DoS attack.';
$message5= 'Trinity has been attacked by a bot or human visiting from this IP address: '.$_SERVER["REMOTE_ADDR"];
$message6='<br><img src="./logs/cross.gif" alt="" border="0">';
//---------------------- End of Initialization ---------------------------------------
//Get file time:
$ipfile=substr(md5($_SERVER["REMOTE_ADDR"]),-3); // -3 means 4096 possible files
$oldtime=0;
if (file_exists($iplogdir.$ipfile)) $oldtime=filemtime($iplogdir.$ipfile);
//Update times:
$time=time();
if ($oldtime<$time) $oldtime=$time;
$newtime=$oldtime+$itime;
// Check human or bot:
if ($newtime>=$time+$itime*$imaxvisit)
{
// To block visitor:
touch($iplogdir.$ipfile,$time+$itime*($imaxvisit-1)+$ipenalty);
header("HTTP/1.0 503 Service Temporarily Unavailable");
header("Connection: close");
header("Content-Type: text/html");
echo '<html><head><title>Trinityent DDOS Sheild</title></head><body><p align="center"><strong>'
.$message1.'</strong>'.$br;
echo $message2.$ipenalty.$message3.$message4.$message6.'</p></body></html>'.$crlf;
// Mailing Warning Message to Site Admin
{
@mail($to, $subject, $message5, $headers);
}
// logging:
$fp=@fopen($iplogdir.$iplogfile,"a");
if ($fp!==FALSE)
{
$useragent='<unknown user agent>';
if (isset($_SERVER["HTTP_USER_AGENT"])) $useragent=$_SERVER["HTTP_USER_AGENT"];
@fputs($fp,$_SERVER["REMOTE_ADDR"].' on '.date("D, d M Y, H:i:s").' as '.$useragent.$crlf);
}
@fclose($fp);
exit();
}
//Modify file time:
touch($iplogdir.$ipfile,$newtime);
?>
i cant get to bin paste lol
Re: Anti Dos script coded by thrinityGunz
Have you tried making the destination folder? So it could find it?
Re: Anti Dos script coded by thrinityGunz
the folder is being made.
Re: Anti Dos script coded by thrinityGunz
Not sure about try this
Code:
// Modify file time:
$touch($iplogdir.$ipfile,$newtime);
Re: Anti Dos script coded by thrinityGunz
the code you give makes no sense at all and no it dosent work
Re: Anti Dos script coded by thrinityGunz
It's only logging... Just delete it and dont log it, if you are that certain the script is going to work, because it wont
Re: Anti Dos script coded by thrinityGunz
Well I said not sure though. well good luck fixing it i have no idea though ^^.