Anti DoS Script

Results 1 to 11 of 11
  1. #1
    Proficient Member Twist165 is offline
    MemberRank
    May 2011 Join Date
    167Posts

    Anti DoS Script

    well i have this error
    Code:
    touch() [function.touch]: Unable to create file ./logs/ec5 because No such file or directory in C:\AppServ\www\include\check.php on line 72
    yes i made that file but after that it gives me a new file again
    i made alot of files but it just gives me a new file again and says its not found

    line 72
    Code:
    //Modify file time:
      touch($iplogdir.$ipfile,$newtime);


  2. #2
    Pee Aitch Pee Dave is offline
    MemberRank
    Mar 2011 Join Date
    The NetherlandsLocation
    722Posts

    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!)
    Last edited by Dave; 10-05-11 at 03:55 AM.

  3. #3
    Proficient Member Twist165 is offline
    MemberRank
    May 2011 Join Date
    167Posts

    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

  4. #4
    Valued Member lolkiller is offline
    MemberRank
    Sep 2010 Join Date
    Somewhere.Location
    135Posts

    Re: Anti Dos script coded by thrinityGunz

    Have you tried making the destination folder? So it could find it?

  5. #5
    Proficient Member Twist165 is offline
    MemberRank
    May 2011 Join Date
    167Posts

    Re: Anti Dos script coded by thrinityGunz

    the folder is being made.

  6. #6
    Valued Member lolkiller is offline
    MemberRank
    Sep 2010 Join Date
    Somewhere.Location
    135Posts

    Re: Anti Dos script coded by thrinityGunz

    Not sure about try this

    Code:
      //  Modify file time:
      $touch($iplogdir.$ipfile,$newtime);

  7. #7
    Proficient Member Twist165 is offline
    MemberRank
    May 2011 Join Date
    167Posts

    Re: Anti Dos script coded by thrinityGunz

    the code you give makes no sense at all and no it dosent work

  8. #8
    I am THE DON Joe9099 is offline
    MemberRank
    Jan 2007 Join Date
    England, UkLocation
    3,655Posts

    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

  9. #9
    Valued Member lolkiller is offline
    MemberRank
    Sep 2010 Join Date
    Somewhere.Location
    135Posts

    Re: Anti Dos script coded by thrinityGunz

    Well I said not sure though. well good luck fixing it i have no idea though ^^.

  10. #10
    人◕ ‿‿ ◕人 Forean is offline
    MemberRank
    Jul 2008 Join Date
    1,183Posts

    Re: Anti DoS Script

    To be honest, if you really want a Dos Block, You might want to stick with a Firewall, There has been a few named around this forums, That is your best luck. a PHP script hosted off your web won't do anything.

  11. #11
    Intelligent DoucheBag jur13n is offline
    MemberRank
    Jan 2008 Join Date
    Zwolle,Location
    1,946Posts

    Re: Anti DoS Script

    if u got it on a host,
    make the file changeable by modding it..
    otherwise its blocked



Advertisement