elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.
 
Inicio Ayuda Ingresar Registrarse
07 Octubre 2008, 06:46  



+  Foro de elhacker.net
|-+  Sistemas Operativos
| |-+  GNU/Linux (Moderador: dxr)
| | |-+  APF (Firewall basado en iptables) para servidores Linux
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Imprimir
Autor Tema: APF (Firewall basado en iptables) para servidores Linux  (Leído 676 veces)
el-brujo
Adm
*****
Desconectado Desconectado

Mensajes: 14.025


La libertad no se suplica, se conquista


Ver Perfil WWW
APF (Firewall basado en iptables) para servidores Linux
« en: 20 Octubre 2006, 17:31 »

APF Firewall

Instalación:
Código:
wget http://www.rfxnetworks.com/downloads/apf-current.tar.gz
tar xvzf apf-current.tar.gz
cd apf-0.9.6-1/
./install.sh

service apf start
/usr/local/sbin/apf -s

Fichero de configuración:

Citar
/etc/apf/conf.apf

Despues de hacer las pruebas dejar:
DEVEL_MODE="0"

Si nos sale un error parecido a este:
apf(9413): unable to load iptables module (ip_tables), aborting.

Cambiamos esto:
SET_MONOKERN="1"

Puertos que queremos abrir (inbound)
IG_TCP_CPORTS="21,22,25,53,80,110"

Si queres bloquear todo el tráfico de salida lo ponemos en 1 (outbound)
EGF="0"

Si queremos usar el módulo antddos poner a 1:
USE_AD="0"

Log:
/var/log/apf_log

Para ver los paquetes que dropeamos:
LOG_DROP="1"

Lo guardará en el syslog, ejemplo:

Proto= Protocolo
SRC= ip origen
SPT= Source Port (puerto d origen)
DST= Destination Port (puerto destino)

Citar
Oct 20 13:59:27 ns2 kernel: ** SANITY ** IN=eth0 OUT=  SRC=213.27.201.254 DST=192.168.0.3 LEN=40 TOS=0x00 PREC=0x00 TTL=54 ID=18779 PROTO=TCP SPT=11629 DPT=80 WINDOW=0 RES=0x00 RST FIN URGP=0
Oct 20 14:00:16 ns2 kernel: ** SANITY ** IN=eth0 OUT=  SRC=213.27.201.254 DST=192.168.0.3 LEN=40 TOS=0x00 PREC=0x00 TTL=54 ID=20376 PROTO=TCP SPT=27734 DPT=80 WINDOW=0 RES=0x00 RST FIN URGP=0
Oct 20 14:00:17 ns2 kernel: ** SANITY ** IN=eth0 OUT=  SRC=213.27.201.254 DST=192.168.0.3 LEN=40 TOS=0x00 PREC=0x00 TTL=54 ID=20382 PROTO=TCP SPT=25943 DPT=80 WINDOW=0 RES=0x00 RST FIN URGP=0
Oct 20 14:00:17 ns2 kernel: ** SANITY ** IN=eth0 OUT=  SRC=213.27.201.254 DST=192.168.0.3 LEN=40 TOS=0x00 PREC=0x00 TTL=54 ID=20387 PROTO=TCP SPT=19026 DPT=80 WINDOW=0 RES=0x00 RST FIN URGP=0
Oct 20 14:00:17 ns2 kernel: ** SANITY ** IN=eth0 OUT=  SRC=213.27.201.254 DST=192.168.0.3 LEN=40 TOS=0x00 PREC=0x00 TTL=54 ID=20397 PROTO=TCP SPT=2155 DPT=80 WINDOW=0 RES=0x00 RST FIN URGP=0
Oct 20 14:00:17 ns2 kernel: ** SANITY ** IN=eth0 OUT=  SRC=213.27.201.254 DST=192.168.0.3 LEN=40 TOS=0x00 PREC=0x00 TTL=54 ID=20407 PROTO=TCP SPT=9294 DPT=80 WINDOW=0 RES=0x00 RST FIN URGP=0
Oct 20 14:00:22 ns2 kernel: ** SANITY ** IN=eth0 OUT=  SRC=213.27.201.254 DST=192.168.0.3 LEN=40 TOS=0x00 PREC=0x00 TTL=54 ID=20687 PROTO=TCP SPT=9269 DPT=80 WINDOW=0 RES=0x00 RST FIN URGP=0
Oct 20 14:00:22 ns2 kernel: ** SANITY ** IN=eth0 OUT=  SRC=213.27.201.254 DST=192.168.0.3 LEN=40 TOS=0x00 PREC=0x00 TTL=54 ID=20694 PROTO=TCP SPT=27223 DPT=80 WINDOW=0 RES=0x00 RST FIN URGP=0
Oct 20 14:00:23 ns2 kernel: ** SANITY ** IN=eth0 OUT=  SRC=213.27.201.254 DST=192.168.0.3 LEN=40 TOS=0x00 PREC=0x00 TTL=54 ID=20830 PROTO=TCP SPT=30938 DPT=80 WINDOW=0 RES=0x00 RST FIN URGP=0
Oct 20 14:00:25 ns2 kernel: ** SANITY ** IN=eth0 OUT=  SRC=213.27.201.254 DST=192.168.0.3 LEN=40 TOS=0x00 PREC=0x00 TTL=54 ID=21038 PROTO=TCP SPT=5377 DPT=80 WINDOW=0 RES=0x00 RST FIN URGP=0
Oct 20 14:00:27 ns2 kernel: ** SANITY ** IN=eth0 OUT=  SRC=213.27.201.254 DST=192.168.0.3 LEN=40 TOS=0x00 PREC=0x00 TTL=54 ID=21219 PROTO=TCP SPT=13341 DPT=80 WINDOW=0 RES=0x00 RST FIN URGP=0
Oct 20 14:00:42 ns2 kernel: ** SANITY ** IN=eth0 OUT=  SRC=213.27.201.254 DST=192.168.0.3 LEN=40 TOS=0x00 PREC=0x00 TTL=54 ID=21990 PROTO=TCP SPT=22960 DPT=80 WINDOW=0 RES=0x00 RST FIN URGP=0
Oct 20 14:02:32 ns2 kernel: ** SANITY ** IN=eth0 OUT=  SRC=213.27.201.254 DST=192.168.0.3 LEN=40 TOS=0x00 PREC=0x00 TTL=54 ID=26386 PROTO=TCP SPT=2826 DPT=80 WINDOW=0 RES=0x00 RST FIN URGP=0

Recuerda que para usar el antidos debes añadir el cron job:

*/8 * * * * root /etc/apf/ad/antidos -a >> /dev/null 2>&1

http://www.r-fx.org/apf/README.antidos

Otros:
- KISS My Firewall
- APF Firewall
- FireStarter

[ IPtables ] Introducción
http://foro.elhacker.net/index.php/topic,102656.0.html

[Iptables] Firewall Básico
http://foro.elhacker.net/index.php/topic,62307.0.html
« Última modificación: 20 Octubre 2006, 19:29 por el-brujo » En línea

Give peace a chance
дٳŦ٭
WebDeveloper & DB Designer
Colaborador

Desconectado Desconectado

Mensajes: 4.467


see u in the hell cowboy


Ver Perfil WWW
Re: APF (Firewall basado en iptables) para servidores Linux
« Respuesta #1 en: 21 Octubre 2006, 04:38 »

wow grujo, muy buena explicación  :D
En línea



La gente sueña por la noche con volar, nosotros salimos por la noche y volamos. JMF.

¡¡¡VIVA MÉXICO!!!
<--v1c1ous-->

Desconectado Desconectado

Mensajes: 756


¡Operadora! ¡Deme el número para el 911! - Homero


Ver Perfil WWW
Re: APF (Firewall basado en iptables) para servidores Linux
« Respuesta #2 en: 21 Octubre 2006, 08:02 »

Muy bueno para Servers Web.
En línea


Páginas: [1] Ir Arriba Imprimir 
Ir a:  







Consolas     La Web de Goku     MilW0rm     MundoDivx

Hispabyte     Truzone     TodoReviews     ZonaPhotoshop

hard-h2o modding    Foros de ayuda    Yashira.org    Videojuegos    indetectables.net   

Noticias Informatica    Seguridad Informática    ADSL    Foros en español    eNYe Sec

Todas las webs afiliadas están libres de publicidad engañosa.

Powered by SMF 1.1.6 | SMF © 2006-2008, Simple Machines LLC
Free counter and web stats