Páginas: 1 [2]
|
 |
|
Autor
|
Tema: Intentando detener un DDoS (Leído 34023 veces)
|
|
|
[Prescott]
|Blue-Heart|
Desconectado
Mensajes: 2.435
lll RTFM & STFW lll
|
Telo concedo Sarjo!!. Para que lo estudies. 
|
|
|
|
|
En línea
|
-M.C.P. -M.C.D.S.T -iBook G4 14.1" white Mac OS X Leopard 10.5 @ 1.33 Ghz, 1,536 Gb de RAM, HD 80 Gb, iSight and Mighty Mouse Wireless  
|
|
|
kavastudios
Desconectado
Mensajes: 1
|
Hola que tal soy nuevo en este foro y he estado checandolo y de verdad que se encuentra informacion muy util un saludo y felicitacion a todos los que escriben tutoriales y responden preguntas, gracias por compartir sus conocimientos.
fijense que soy webmaster de varias paginillas las cuales tengo hospedadas en servicios de hosting comunes y corrientes ( osea hosting compartido ) y recientemente a una de mis webs ha tenido ataques DoS y no he podido bannear las maquinas atacantes pues constantemente cambia de ips, leyendo este articulo vi que modificando uno de los mods del apache podiamos limitar el numero maximo de conexiones de cada ip, pero mi pregunta es ver si hay algun metodo de hacer esto usando archivos htaccess pues yo no tengo acceso a la configuracion del server ni del apache.
En caso de ser asi cual seria la sintaxis, espero me peudan ayudar gracias
|
|
|
|
|
En línea
|
|
|
|
phacker
Desconectado
Mensajes: 7
|
wow =) excelente tutorial... segui asi 
|
|
|
|
|
En línea
|
|
|
|
дٳŦ٭
WebDeveloper & DB Designer
Colaborador
Desconectado
Mensajes: 4.467
see u in the hell cowboy
|
Hola que tal soy nuevo en este foro y he estado checandolo y de verdad que se encuentra informacion muy util un saludo y felicitacion a todos los que escriben tutoriales y responden preguntas, gracias por compartir sus conocimientos.
fijense que soy webmaster de varias paginillas las cuales tengo hospedadas en servicios de hosting comunes y corrientes ( osea hosting compartido ) y recientemente a una de mis webs ha tenido ataques DoS y no he podido bannear las maquinas atacantes pues constantemente cambia de ips, leyendo este articulo vi que modificando uno de los mods del apache podiamos limitar el numero maximo de conexiones de cada ip, pero mi pregunta es ver si hay algun metodo de hacer esto usando archivos htaccess pues yo no tengo acceso a la configuracion del server ni del apache.
En caso de ser asi cual seria la sintaxis, espero me peudan ayudar gracias
Pues por htaccess no xD pero te dejo algo  : <? /* /************************************************************ / / NST Anti Denial of Service Script v 0.1 / / / / Author: Link < link07@gmail.com > / / ..::[N]eo [S]ecurity [T]eam::.. / / http://www.neosecurityteam.net / / Date: October - 2006 / / /************************************************************* This script will prevent Dos and DDos attacks using request flood of http packets, that causes your server to excecute to much connections with the database and execute tha php interpreter a lot of times in a few seconds, all you have to do to install this is include it in a script that all your scripts use , an script for the database connection for example and create three empty txt files on the same folder with write and read permissions: log.txt , bans.txt , counter.txt This script will ban users using the .htaccess file, so dont forget to put this is script on the same folder as the .htaccess file as well It is very configurable just modify the parameters indicated below , to asign how sctrict the script will act. */ $data = ""; $ban = ""; $visits = 1; $error = 0; $ahora = date("Y-n-j H:i:s"); $safemode = 0; $new = ""; $flooder =0; $registered = 0; $wwwdir = "/home/neosecur/public_html/"; $ahora = date("Y-n-j H:i:s"); if(!$file = @fopen($wwwdir."log.txt","r")) $error = 1; while (!@feof($file)) { $data .= @fgets($file); } $visitor = explode("\n",$data); $i=0; while($visitor[$i]) { $iptime = explode("@",$visitor[$i]); if ($_SERVER['REMOTE_ADDR'] == $iptime[0]) { $tiempo = strtotime($ahora) - $iptime[1]; if ($tiempo <= 1) // this line controls the acces of an ip, only one request during the number of seconds you replace here { $safemode = 1; $flooder = 1; } $iptime[1]=strtotime($ahora); $registered = 1; } $new .=$iptime[0]."@".$iptime[1]."\n"; $i++; } if (!$registered) $new.=$_SERVER['REMOTE_ADDR']."@".strtotime($ahora)."\n"; if (!@fclose($file)) $error = 1; if(!$file = @fopen($wwwdir."log.txt","wt")) $error = 1; @fwrite($file,$new); if (!@fclose($file)) $error = 1; if (!$fcount = @fopen($wwwdir."counter.txt","rt")) $error = 1; $vst = @fgets($fcount); $count = explode("@",$vst); if (strtotime($ahora) == $count[1]) { $visits = $count[0] + 1; $count[0] = $visits; } else { $count[0] = 1; $count[1] = strtotime($ahora); } if (!@fclose($fcount)) $error = 1; $new = $count[0]."@".$count[1]; if (!$fcount = @fopen($wwwdir."counter.txt","wt")) $error = 1; @fwrite($fcount,$new); if (!@fclose($fcount)) $error = 1; $new = ""; $registered = 0; if ($visits > 4) // this line controls visits during a second, it is used to prevent ddos attacks you can modify this depending on the capacity of your server { $safemode = 1; if ($flooder) { if (!$fban = @fopen($wwwdir."bans.txt","rt")) $error = 1; while (!@feof($fban)) { $ban .= @fgets($fban); } $ips = explode ("\n",$ban); $i=0; while ($ips[$i]) { if ($_SERVER['REMOTE_ADDR'] == $ips[$i]) $registered = 1; $i++; $new .=$ips[$i]; } if (!@fclose($fban)) $error = 1; if (!$registered) { if (!$fban = @fopen($wwwdir."bans.txt","wt")) $error = 1; $new .=$_SERVER['REMOTE_ADDR']."\n"; @fwrite($fban,$new); if (!@fclose($fban)) $error = 1; } else { if (!$fht = @fopen($wwwdir.".htaccess","rt")) $error = 1; $cont = ""; $cont2 = ""; $eob = 0; while (!@feof($fht)) { $a = @fgets($fht); if ($eob) $cont2.=$a; else { if ($a == "</Limit>\r\n" or $a == "</Limit>" or $a == "</Limit>\n") { $eob = 1; $cont2.=$a; } else $cont.=$a; } } if (!@fclose($fht)) $error = 1; if (!$fht = @fopen($wwwdir.".htaccess","wt")) $error = 1; $cont .= "Deny from ".$_SERVER['REMOTE_ADDR']."\n"; $cont .= $cont2; @fwrite($fht,$cont); if (!@fclose($fht)) $error = 1; } } } if ($error) { echo "ocurrio un error inesperado por favor trata actualizando de nuevo o vuelve en un rato. Gracias por tu comprensión."; exit(0); } if($safemode) { echo '<META HTTP-EQUIV="Refresh" CONTENT="2;URL=">'; exit(0); } // if no restrictions have been activated , the content of the web will be displayed normally //echo "contenido"; ?> Suerte
|
|
|
|
|
En línea
|
La gente sueña por la noche con volar, nosotros salimos por la noche y volamos. JMF. ¡¡¡VIVA MÉXICO!!!
|
|
|
xDie
Desconectado
Mensajes: 300
|
Los paquetes llegan al servidor igual, estas en la misma
|
|
|
|
|
En línea
|
|
|
|
l337*
Desconectado
Mensajes: 783
I've been thinking...
|
Ejemplo de ataque SYN_RECV o SYN Flooding al Apache (puerto 80).
192.168.0.3 es la ip del servidor apache y 192.168.0.105 es la ip del "atacante".
Código: tcp 0 0 192.168.0.3:80 192.168.0.5:60808 SYN_RECV tcp 0 0 192.168.0.3:80 192.168.0.5:60761 SYN_RECV tcp 0 0 192.168.0.3:80 192.168.0.5:60876 SYN_RECV . . .
la ip del atacante seria 192.168.0. 5 que no?
|
|
|
|
|
En línea
|
|
|
|
Dr.SysCrack
Desconectado
Mensajes: 34
Joven AprendiS
|
Exelente manual muy completo y es el primer foro que veo un manual así muy bien explicado
sa1u2
|
|
|
|
|
En línea
|
Clickea donde dice Revolution Hack
|
|
|
Artikbot
MERLUZO Returns...
Colaborador
Desconectado
Mensajes: 4.045
Wanna Be Overclock3r; At least done!!
|
Felicidades, el-brujo, un tuto de putísima madre  Salu2!
|
|
|
|
« Última modificación: 14 Abril 2008, 22:43 por Artikbot »
|
En línea
|
We played together, enjoyed that beautiful moments... Yeah we did... You were like a sister for me...
Now good times have passed, you got rid of me... Well, I don't know why I'm still alive, it'll be so hard to find a new heart. Yes, you still have mine, and if you don't remeber, I have a piece of yours. Don't forget me.
You know something, you are fucking beautiful <--- From Rando!
|
|
|
|
Páginas: 1 [2]
|
|
|
|