1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Three ways to prevent DDOS site

Discussion in 'Security' started by endlesslove, Dec 12, 2011.

  1. #1
    DDOS attack, also called denial of service attack simply means creating a massive virtual visitor to a website address at the same time it was intended to "demolish" host storage makes it run slowly or can not run anymore.
    Method 1: Anti iframe
    [/B][COLOR=#333333][FONT=Times New Roman][I]<script language="JavaScript">[/I][/FONT][/COLOR]
     [COLOR=#333333][FONT=Times New Roman][I]if (top.location != self.location)[/I][/FONT][/COLOR]
     [COLOR=#333333][FONT=Times New Roman][I]{top.location = self.location}[/I][/FONT][/COLOR]
     [COLOR=#333333][FONT=Times New Roman][I]</script>[/I][/FONT][/COLOR][B]
    Code (markup):
    Method 2: Anti-reload malicious website
    If you are attacked like this, you set up your files .htaccess with the content:
    [COLOR=#333333][FONT=Times New Roman][I]RewriteEngine on[/I][/FONT][/COLOR]
     [COLOR=#333333][FONT=Times New Roman][I]RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?domain.com [NC][/I][/FONT][/COLOR]
     [COLOR=#333333][FONT=Times New Roman][I]RewriteRule !antiddos.phtml http://www.domain.com/antiddos.phtml?%{REQUEST_URI} [QSA][/I][/FONT][/COLOR]
    Code (markup):
    Then create a file antiddos.phtml with content
    [COLOR=#333333][FONT=Times New Roman][I]<?[/I][/FONT][/COLOR]
     [COLOR=#333333][FONT=Times New Roman][I]$text = $HTTP_SERVER_VARS['QUERY_STRING'];[/I][/FONT][/COLOR]
     [COLOR=#333333][FONT=Times New Roman][I]$text = preg_replace("#php\&#si",'php?',$text);[/I][/FONT][/COLOR]
     [COLOR=#333333][FONT=Times New Roman][I]echo('<center><a  href=http://www.domain.com/?'.$text.'><font color=red size=5  face=Monotype>[CLICK HERE TO  ENTER]</font></a</center>');[/I][/FONT][/COLOR]
     [COLOR=#333333][FONT=Times New Roman][I]?>[/I][/FONT][/COLOR]
      
    
    Code (markup):
    Method 3: Limit number of connections at a time website
    You add the following code to the home page of the website.
    [COLOR=#333333][FONT=Times New Roman]function server_busy($numer) {[/FONT][/COLOR]
     [COLOR=#333333][FONT=Times New Roman]     if (THIS_IS == 'WEBSITE' && PHP_OS == 'Linux' and @file_exists (  '/proc/loadavg' ) and $filestuff = @file_get_contents ( '/proc/loadavg'  )) {[/FONT][/COLOR]
     [COLOR=#333333][FONT=Times New Roman]        $loadavg = explode ( ' ', $filestuff );[/FONT][/COLOR]
     [COLOR=#333333][FONT=Times New Roman]        if (trim ( $loadavg [0] ) > $numer) {[/FONT][/COLOR]
     [COLOR=#333333][FONT=Times New Roman]            print '<meta http-equiv="content-type" content="text/html; charset=UTF-8" />';[/FONT][/COLOR]
     [COLOR=#333333][FONT=Times New Roman]            print '[/FONT][/COLOR]Traffic is overloaded, please come back after a few minutes.[COLOR=#333333][FONT=Times New Roman]';[/FONT][/COLOR]
     [COLOR=#333333][FONT=Times New Roman]            exit ( 0 );[/FONT][/COLOR]
     [COLOR=#333333][FONT=Times New Roman]        }[/FONT][/COLOR]
     [COLOR=#333333][FONT=Times New Roman]    }[/FONT][/COLOR]
     [COLOR=#333333][FONT=Times New Roman]}[/FONT][/COLOR]
     [COLOR=#333333][FONT=Times New Roman]$srv = server_busy ( 1000 ); // 1000 [/FONT][/COLOR]is the number of visitors at a time
    Code (markup):






     
    endlesslove, Dec 12, 2011 IP
  2. mariusprice

    mariusprice Peon

    Messages:
    24
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    very interesting but are you sure really works?
     
    mariusprice, Dec 12, 2011 IP
  3. endlesslove

    endlesslove Active Member

    Messages:
    205
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    58
    #3
    I used method 1 and method 2, it works very effectively.
     
    endlesslove, Dec 12, 2011 IP
  4. simon2k11

    simon2k11 Greenhorn

    Messages:
    43
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #4
    While these methods are very effective for this type of attack, a large scale ddos would result in the need of a special provider capable of accepting this much bandwidth and ddos mitigation hardware
     
    simon2k11, Dec 14, 2011 IP
  5. Hostingder

    Hostingder Peon

    Messages:
    251
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Has anyone had any experience with method 3? I'm thinking about using it as precaution in case some low life decides to get bored..
     
    Hostingder, Dec 24, 2011 IP
  6. kokopelli

    kokopelli Peon

    Messages:
    2,436
    Likes Received:
    29
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Install and configure CSF firewall - much easier :)
     
    kokopelli, Dec 27, 2011 IP
  7. tays0c

    tays0c Greenhorn

    Messages:
    61
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #7
    I've used that technique before. But something different from yours, I like to deny busy connections, but it's not always the greatest idea!
     
    tays0c, Dec 27, 2011 IP
  8. leetone

    leetone Greenhorn

    Messages:
    50
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #8
    i dont think so its works 100% fine...

    in simple words most of ddoer's attack ok IP Adress
     
    leetone, Dec 30, 2011 IP
  9. BigTim3

    BigTim3 Guest

    Messages:
    266
    Likes Received:
    1
    Best Answers:
    2
    Trophy Points:
    0
    #9
    hardware firewalls work best
     
    BigTim3, Dec 30, 2011 IP