igor_chemin
(usa Debian)
Enviado em 10/11/2008 - 16:21h
#
#Administrador: Igor
#Ultima modificacao em :10/11/2008
#
echo "=============================================================="
echo "|::LOAD FIREWALL TAPAJOS STM.................................."
echo "=============================================================="
#
#!/bin/bash
#**limpando regras***
iptables -F
iptables -t nat -F
iptables -t mangle -F
echo "*LIMPANDO REGRAS..........................................[OK]"
#
#*********Compartila internet*****>eth0
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
echo "*ATIVANDO O MASCARAMENTO (NAT)............................[OK]"
#
#*****Ativando trafico da rede****
echo "1" > /proc/sys/net/ipv4/ip_forward
echo "*TRAFICO ATIVADO .........................................[ok]"
#****liberando: porta 22 ssh***
iptables -A INPUT -p tcp --dport 22 -j ACCEPT
echo "*ABRE PORTA 22 SSH........................................[OK]"
#
#****Proxy transparente***********eth1->placa da intranet
iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 80 -j REDIRECT --to-port 3128
echo "*PROXY TRANSPARENT .......................................[OK]"
#
#**********Caixa conectiva***************
iptables -t nat -A PREROUTING -i eth1 -p tcp -d 200.201.174.207 --dport 80 -j ACCEPT
iptables -t nat -A PREROUTING -i eth1 -p tcp -d 200.201.173.68 --dport 80 -j ACCEPT
iptables -t nat -A PREROUTING -i eth1 -p tcp -d 200.201.174.204 --dport 2631 -j ACCEPT
#****ABRE PORTA VNC*************
#iptables -A INPUT -p tcp --dport 5900 -j ACCEPT
#iptables -A IMPUT -p udp --dport 5900 -j ACCEPT
#echo "*ABRE PORTA VNC..........................................[ok]"
#
#******ABRE PORTA ACESSO REMOTO VIA TERMINAL SEVER(WINDOWS 2003)
#iptables -A INPUT -p tcp --dport 3389 -j ACCEPT
#iptables -A INPUT -p udp --dport 3389 -j ACCEPT
#echo "*ABRE PORTA ACESSO REMOTO WIN2003........................[ok]"
#
#********Iginora pings*****
#echo "1"> /proc/sys/net/ipv4/icmp_echo_ignore_all
#echo "*IGINORA PINGS............................................[OK]"
#****Protecao contra spoofing
echo 1 > /proc/sys/net/ipv4/conf/default/rp_filter
echo "*PROTECAO CONTRA SPOOFING.................................[OK]"
#***********PROTECAO CONTRA SYNFLOOD
echo "1"> /proc/sys/net/ipv4/tcp_syncookies
echo "*PROTECAO CONTRA SYSNFLOOD................................[Ok]"
#************PROTECAO CONTRA ICMP BROADCASTING****
echo "1"> /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts
echo "*PROTECAO CONTRA BROADCASTS...............................[OK]"
#**********BçOQUEIA TRACEROUT
iptables -A INPUT -p udp --dport 33435:33525 -j DROP
echo "*BLOQUEIO TRACEOUT........................................[OK]"
#protecao diversas contra , ing of death,ataques dos,etc.
#itables -A INPUT -m state --state INVALID -j DROP
echo "*PROTECAO CONTRA PING OF DEATH............................[OK]"
echo "*PROTECAO CONTRA ATAQUES DOS..............................[OK]"
echo "*ROTECAO CONTRA VARIOS ATAQUES............................[OK]"
# COROA DO FIREWALL************
echo "*FIREWALL CARREGADO!!.....................................[OK]"