magubuntu
(usa Ubuntu)
Enviado em 20/05/2011 - 08:33h
Segue o conteúdo do meu firewall e squid.conf, respectivamente.
#!/bin/bash
# Script de configuração do iptables gerado pelo configurador do Kurumin
# Este script pode ser usado em outras distribuições Linux que utilizam o Kernel 2.4 em diante
firewall_start(){
# Abre para uma faixa de endereços da rede local
iptables -A INPUT -p tcp --syn -s 100.0.6.0/255.255.255.0 -j ACCEPT
# Abre uma porta (inclusive para a Internet)
#iptables -A INPUT -p icmp -i 189.3.202.131 -j ACCEPT
iptables -A INPUT -p tcp --destination-port 21 -j ACCEPT
iptables -A INPUT -p tcp --destination-port 80 -j ACCEPT
iptables -A FORWARD -p tcp --destination-port 110 -j ACCEPT
iptables -A FORWARD -p tcp --destination-port 25 -j ACCEPT
iptables -A INPUT -p tcp --destination-port 143 -j ACCEPT
iptables -A INPUT -p tcp --destination-port 443 -j ACCEPT
iptables -A INPUT -p tcp --destination-port 465 -j ACCEPT
iptables -A INPUT -p tcp --destination-port 995 -j ACCEPT
iptables -A INPUT -p tcp --destination-port 2535 -j DROP
iptables -A INPUT -p tcp --destination-port 139 -j DROP
iptables -A OUTPUT -p tcp --destination-port 139 -j DROP
iptables -A OUTPUT -p tcp --destination-port 4662 -j DROP
iptables -A OUTPUT -p udp --destination-port 4672 -j DROP
iptables -A OUTPUT -p tcp --destination-port 995 -j ACCEPT
#=================== PAINEL SEC ===============================
iptables -I INPUT -s 100.0.6.222 -j DROP
#=================== ESPLANADA =================================
iptables -I INPUT -s 100.0.6.203 -j DROP
#====================TESOURARIA ================================
iptables -I INPUT -s 100.0.6.61 -j DROP
iptables -I INPUT -s 100.0.6.62 -j DROP
iptables -I INPUT -s 100.0.6.63 -j DROP
#====================PROTOCOLO ================================
iptables -I INPUT -s 100.0.6.227 -j DROP
#Regra de saida com IP externo para acesso a internet
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
#acesso atraves da mantenedora
iptables -A INPUT -p tcp -s 201.65.108.130 --dport 22 -j ACCEPT
iptables -A INPUT -p tcp -d 201.65.108.130 --sport 22 -j ACCEPT
#acesso atraves do lab
iptables -A INPUT -p tcp --dport 22 -s 189.44.54.75 -j ACCEPT
iptables -A INPUT -p tcp --dport 22 -s 189.44.54.76 -j ACCEPT
# Priorizacao da porta do oracle para os acessos Internet do sitema Unitri e Microsiga
iptables -t mangle -I FORWARD -p tcp -m multiport --dports 1521,5100,33086,33087,33088 -j TOS --set-tos 16
#Acesso da rede ao servidor de email da Alog
iptables -I FORWARD -d 201.49.208.59 -j ACCEPT
iptables -I FORWARD -s 201.49.208.59 -j ACCEPT
# Serviços epeciais (Digitro , Unitri, Conectividade Social, server mail)
#---------------------------Digitro------------------------------------------------------
#Liberando acesso ao PABX para mantenedora e Digitro
ipabx=100.0.6.7
ipext=189.3.202.132
for i in 189.85.128.10 201.65.108.130 201.65.108.131 100.0.9.0/24; do
iptables -t nat -I PREROUTING -p tcp -m tcp -s $i -d $ipext --dport 987 -j DNAT --to-destination $ipabx
iptables -t nat -I POSTROUTING -p tcp -m tcp -s $i -d $ipabx --dport 987 -j SNAT --to-source $ipext
iptables -A FORWARD -p tcp -m tcp -s $i -d $ipabx --dport 987 -j ACCEPT
iptables -A FORWARD -p tcp -m tcp -d $i -s $ipabx --sport 987 -j ACCEPT
done
#-------------------------Acesso do Zabbix para monitoramento---------------------------------
iptables -A INPUT -p tcp -s 201.65.108.130 -d 189.3.202.132 --dport 10050 -j ACCEPT
iptables -A INPUT -p tcp -d 201.65.108.130 -s 189.3.202.132 --sport 10050 -j ACCEPT
#---------------------------------------------------------------------------------------------
#Acesso VPN PPTP
iptables -A FORWARD -p tcp -s 100.0.6.0/255.255.255.0 -d 0/0 --dport 1723 -j ACCEPT
iptables -A FORWARD -p tcp -d 100.0.6.0/255.255.255.0 -s 0/0 --sport 1723 -j ACCEPT
iptables -A FORWARD -p gre -s 100.0.6.0/255.255.255.0 -d 0/0 -j ACCEPT
iptables -A FORWARD -p gre -d 100.0.6.0/255.255.255.0 -s 0/0 -j ACCEPT
#-----------------------------Unitri------------------------------------------------------
iptables -A FORWARD -p tcp -s 100.0.6.0/255.255.255.0 -d 201.65.108.130 --dport 1521 -j ACCEPT
iptables -A FORWARD -p tcp -d 100.0.6.0/255.255.255.0 -s 201.65.108.130 --sport 1521 -j ACCEPT
iptables -A FORWARD -p tcp -s 100.0.6.0/255.255.255.0 -d 187.62.226.169 --sport 1521 -j ACCEPT
iptables -A FORWARD -p tcp -d 100.0.6.0/255.255.255.0 -s 187.62.226.169 --sport 1521 -j ACCEPT
#Acesso ao servidor WEBService Uira
iptables -A FORWARD -p tcp -s 100.0.6.0/255.255.255.0 -d 201.65.108.130 --dport 3306 -j ACCEPT
iptables -A FORWARD -p tcp -d 100.0.6.0/255.255.255.0 -s 201.65.108.130 --sport 3306 -j ACCEPT
iptables -A INPUT -p tcp --destination-port 1521 -j ACCEPT
#---------CAIXA (Conectividade social)---------
#iptables -t nat -A PREROUTING -i eth0 -s ! 100.0.6.18 -p tcp -m multiport --dport 80,443 -j REDIRECT --to-ports 3128
#iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 200.201.174.207 --dport 80 -j ACCEPT
#iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 200.201.174.204 --dport 80 -j ACCEPT
#iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 200.201.174.204 --dport 2631 -j ACCEPT
iptables -t nat -A PREROUTING -s 100.0.6.0/24 -p tcp -d cmt.caixa.gov.br --dport 80 -j RETURN
iptables -t nat -A PREROUTING -s 100.0.6.0/24 -p tcp -d 200.201.174.204 --dport 80 -j RETURN
### FIM de serviços especiais ###
# Fechando as portas do SSH pra fora
iptables -A INPUT -p tcp --dport 22 -m iprange --src-range 100.0.6.1-100.0.6.40 -j ACCEPT
iptables -A INPUT -p tcp --dport 22 -s 100.0.6.60 -j ACCEPT
iptables -A INPUT -p tcp --dport 22 -j DROP
#iptables -A INPUT -p tcp --dport 2756 -m iprange --src-range 100.0.6.0-100.0.6.255 -j ACCEPT
#iptables -A INPUT -p tcp --dport 2756 -j DROP
# Ignora pings
echo "1" > /proc/sys/net/ipv4/icmp_echo_ignore_all
# Protege contra synflood
echo "1" > /proc/sys/net/ipv4/tcp_syncookies
# Desabilita o suporte a source routed packets
# Esta recurso funciona como um NAT ao contrário, que em certas circunstancias pode permitir que alguem de fora envie pacotes para micros dentro da rede local.
echo "0" > /proc/sys/net/ipv4/conf/eth0/accept_source_route
#echo "0" > /proc/sys/net/ipv4/conf/eth1/accept_source_route
# Proteção contra ICMP Broadcasting
echo "1" > /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts
#============================LIBERACOES POR CAUSA DO BLOQUEIO DO ULTRASURF=====================
# ================================== LIBERA O GMAIL ===========================================
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d
www.google.com --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d google.com --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d
www.gmail.com --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d ssl.google-analytics.com --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 74.125.115.97 --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 72.14.204.19 --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 72.14.204.19/16 --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 74.125.115.97/16 --dport 443 -j ACCEPT
# ================================== LIBERA O YAHOO ===========================================
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d edit.yahoo.com --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d br.yahoo.com --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d
www.yahoo.com.br --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 200.152.161.132 --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 204.2.241.163 --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 200.152.168.167 --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 76.13.6.31 --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 68.142.241.75 --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 68.142.228.136 --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 67.195.182.28 --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 199.93.63.110 --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 69.147.112.160 --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 209.191.92.114 --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 205.128.71.113 --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d br.mc1135.mail.yahoo.com --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d yahoo.com --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d br.adserver.yahoo.com --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d br.mg5.yahoo.com --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d br.mg5.mail.yahoo.com --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d login.yahoo.com --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d s.yimg.com --dport 443 -j ACCEPT
# ====================================== LIBERA O HOTMAIL =========================================
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d
www.hotmail.com --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 96.6.165.186 --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 184.25.5.186 --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 65.54.165.136 --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 65.54.165.175 --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 184.31.5.186 --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 23.1.53.186 --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 96.6.69.186 --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 96.6.72.124 --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 184.51.213.186 --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 173.222.69.17 --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 173.222.69.186 --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 184.51.165.186 --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 96.6.181.186 --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 72.247.69.186 --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 72.247.133.186 --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 72.247.25.186 --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 72.247.0.0 --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 69.58.181.71 --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 184.86.197.186 --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 184.86.200.124 --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 69.58.0.0/16 --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 184.50.165.186 --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 184.50.166.186 --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 184.50.168.124 --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 184.50.0.0/16 --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 96.6.0.0/16 --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 96.17.0.0/16 --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 65.54.165.177 --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 65.54.165.169 --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 65.54.191.45 --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 65.54.165.0/24 --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 201.49.208.59 --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 201.49.208.0/16 --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 65.54.0.0/16 --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 65.54.186.0/24 --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 65.54.165.139 --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 65.54.186.109 --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 65.54.186.10/16 --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 74.125.0.0/16 --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 74.125.91.0/24 --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d hotmail.com --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d login.live.com --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d messenger.hotmail.com --dport 443 -j ACCEPT
# iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d messenger.hotmail.com --dport 1863 -j ACCEPT
# iptables -A FORWARD -s 100.0.6.0/24 -p tcp --dport 1863 -j ACCEPT
# iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 64.4.13.0/24 --dport 1863 -j ACCEPT
# iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 64.4.13.0/24 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 64.4.0.0/16 --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d login.passport.com --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d gateway.messenger.hotmail.com --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d mail.live.com --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d sn116w.snt116.mail.live.com --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d live.com --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d secure.shared.live.com --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 209.87.152.149 --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 209.87.152.0/24 --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 209.87.0.0/16 --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 69.43.160.197 --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 69.43.160.0/24 --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 65.54.165.179 --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 173.223.69.186 --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 65.54.186.17 --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d secure.wlxrs.com --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d secure.shared.live.com --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 65.54.186.107 --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 184.24.181.186 --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 65.54.186.47 --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 184.51.229.186 --dport 443 -j ACCEPT
# ======================== LIBERA MSN PARA ALGUMAS MAQUINAS ===============================
# ======= CPD =======
iptables -A FORWARD -s 100.0.6.100 -p tcp --dport 1863 -j ACCEPT
iptables -A FORWARD -s 100.0.6.100 -d loginnet.passport.com -j ACCEPT
# ======= NESTOR ======
iptables -A FORWARD -s 100.0.6.120 -p tcp --dport 1863 -j ACCEPT
iptables -A FORWARD -s 100.0.6.120 -d loginnet.passport.com -j ACCEPT
# ========================== BLOQUEIA MSN PARA OS DEMAIS ===========================
iptables -A FORWARD -s 100.0.6.0/24 -p tcp --dport 1863 -j REJECT
iptables -A FORWARD -s 100.0.6.0/24 -d loginnet.passport.com -j REJECT
#=======================================LIBERA MSN=============================================
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 207.46.120.172 --dport 443 -j ACCEPT
# iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 207.46.120.172 --dport 1863 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 207.46.118.185 --dport 443 -j ACCEPT
# iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 207.46.118.185 --dport 1863 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 207.46.113.78 --dport 443 -j ACCEPT
# iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 207.46.113.78 --dport 1863 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 207.46.120.0/24 --dport 443 -j ACCEPT
# iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 207.46.120.0/24 --dport 1863 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 207.46.124.113 --dport 443 -j ACCEPT
# iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 207.46.124.113 --dport 1863 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 65.54.48.173 --dport 443 -j ACCEPT
# iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 65.54.48.173 --dport 1863 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 65.54.48.95 --dport 443 -j ACCEPT
# iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 65.54.48.95 --dport 1863 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 65.55.64.254 --dport 443 -j ACCEPT
# iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 65.55.64.254 --dport 1863 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 65.55.71.162 --dport 443 -j ACCEPT
# iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 65.55.71.162 --dport 1863 -j ACCEPT
# iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 65.54.52.62 --dport 1863 -j ACCEPT
# iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 65.54.61.201 --dport 1863 -j ACCEPT
# iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 65.55.71.70 --dport 1863 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 207.46.118.177 --dport 443 -j ACCEPT
# iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 65.54.48.39 --dport 1863 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 65.55.71.161 --dport 443 -j ACCEPT
# iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 65.55.71.161 --dport 1863 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 65.54.48.47 --dport 443 -j ACCEPT
# iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 65.54.48.47 --dport 1863 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 65.54.52.75 --dport 443 -j ACCEPT
# iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 65.54.52.75 --dport 1863 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 65.54.61.206 --dport 443 -j ACCEPT
# iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 65.54.61.206 --dport 1863 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 65.54.52.254 --dport 443 -j ACCEPT
# iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 65.54.52.254 --dport 1863 -j ACCEPT
# iptables -A INPUT -d 23.1.1.165 -p tcp --dport 1863 -m iprange --src-range 100.0.6.40-100.0.6.254 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 23.1.1.165 --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 207.46.118.178 --dport 443 -j ACCEPT
# iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 207.46.118.178 --dport 1863 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 65.55.254.37 --dport 443 -j ACCEPT
# iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 65.55.254.37 --dport 1863 -j ACCEPT
# iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 65.54.49.46 --dport 1863 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 65.54.191.41 --dport 443 -j ACCEPT
# iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 65.54.191.41 --dport 1863 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 65.54.186.19 --dport 443 -j ACCEPT
# iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 65.54.186.19 --dport 1863 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 23.2.184.124 --dport 443 -j ACCEPT
# iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 23.2.184.124 --dport 1863 -j ACCEPT
# iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 173.223.105.165 --dport 1863 -j ACCEPT
# iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 23.1.9.165 --dport 1863 -j ACCEPT
# iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 173.222.137.165 --dport 1863 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 65.54.186.77 --dport 443 -j ACCEPT
# iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 65.54.61.219 --dport 1863 -j ACCEPT
#===================================LIBERA UPDATE WIN XP========================================
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d update.microsoft.com --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d
www.update.microsoft.com --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 65.55.0.0/16 --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 65.55.184.0/24 --dport 443 -j ACCEPT
#====================================LIBERA ZIPMAIL==============================================
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d zipmail.uol.com.br --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d
www.zipmail.com.br --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d visitante.acesso.uol.com.br --dport 443 -j ACCEPT
#====================================LIBERA IG==============================================
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d authmail.ig.com.br --dport 443 -j ACCEPT
#====================================LIBERA GLOBOMAIL==============================================
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d login.globo.com --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 72.14.204.97 --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 201.7.176.103 --dport 443 -j ACCEPT
#====================================LIBERA UNIVERSICRED==============================================
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d intranet.universicred.com.br --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 201.65.108.134 --dport 443 -j ACCEPT
#====================================LIBERA BANCO REAL==============================================
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 200.220.190.101 --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 200.220.0.0/16 --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 64.233.163.83 --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 64.233.0.0/16 --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 137.254.16.66 --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 137.254.0.0/24 --dport 443 -j ACCEPT
#====================================OUTROS==============================================
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 200.194.222.48 --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d
www3.caixa.gov.br --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 200.130.6.170 --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 200.130.0.0/16 --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d nfse.recife.pe.gov.br --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d portaljudicial.caixa.gov.br --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d
www2.bancobrasil.com.br --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d pagamento.serpro.gov.br --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 200.238.107.85 --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d smail-mia.terra.com.br --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 208.70.188.83 --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d
wwwss.bradesco.com.br --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d 200.155.82.2 --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d seguro1.cesgranrio.org.br --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d todoscomanota.com.br --dport 443 -j ACCEPT
iptables -A FORWARD -s 100.0.6.0/24 -p tcp -d consulta.tesouro.fazenda.gov.br --dport 443 -j ACCEPT
# ======================= BLOQUEIO PARA ULTRASURF ===========================================
iptables -A FORWARD -p tcp --dport 443 -m iprange --src-range 100.0.6.41-100.0.6.254 -j DROP
iptables -A FORWARD -p tcp --dport 20873 -m iprange --src-range 100.0.6.41-100.0.6.254 -j DROP
iptables -A FORWARD -p tcp --dport 15899 -m iprange --src-range 100.0.6.41-100.0.6.254 -j DROP
iptables -A FORWARD -p tcp --dport 16904 -m iprange --src-range 100.0.6.41-100.0.6.254 -j DROP
iptables -A FORWARD -p tcp --dport 54700 -m iprange --src-range 100.0.6.41-100.0.6.254 -j DROP
iptables -A FORWARD -p tcp --dport 50110 -m iprange --src-range 100.0.6.41-100.0.6.254 -j DROP
iptables -A FORWARD -p tcp --dport 8085 -m iprange --src-range 100.0.6.41-100.0.6.254 -j DROP
iptables -A FORWARD -p tcp --dport 33011 -m iprange --src-range 100.0.6.41-100.0.6.254 -j DROP
iptables -A FORWARD -p tcp --dport 33190 -m iprange --src-range 100.0.6.41-100.0.6.254 -j DROP
iptables -A FORWARD -p tcp --dport 34387 -m iprange --src-range 100.0.6.41-100.0.6.254 -j DROP
iptables -A FORWARD -p tcp --dport 54539 -m iprange --src-range 100.0.6.41-100.0.6.254 -j DROP
iptables -A FORWARD -p tcp --dport 25101 -m iprange --src-range 100.0.6.41-100.0.6.254 -j DROP
iptables -A FORWARD -p tcp --dport 59879 -m iprange --src-range 100.0.6.41-100.0.6.254 -j DROP
iptables -A FORWARD -p tcp --dport 54296 -m iprange --src-range 100.0.6.41-100.0.6.254 -j DROP
iptables -A FORWARD -p tcp --dport 20255 -m iprange --src-range 100.0.6.41-100.0.6.254 -j DROP
iptables -A FORWARD -p tcp --dport 30603 -m iprange --src-range 100.0.6.41-100.0.6.254 -j DROP
iptables -A FORWARD -p tcp --dport 53877 -m iprange --src-range 100.0.6.41-100.0.6.254 -j DROP
iptables -A FORWARD -p tcp --dport 15440 -m iprange --src-range 100.0.6.41-100.0.6.254 -j DROP
iptables -A FORWARD -p tcp --dport 49287 -m iprange --src-range 100.0.6.41-100.0.6.254 -j DROP
iptables -A FORWARD -p tcp --dport 37940 -m iprange --src-range 100.0.6.41-100.0.6.254 -j DROP
iptables -A FORWARD -p tcp --dport 11106 -m iprange --src-range 100.0.6.41-100.0.6.254 -j DROP
iptables -A FORWARD -p tcp --dport 20031 -m iprange --src-range 100.0.6.41-100.0.6.254 -j DROP
iptables -A FORWARD -p tcp --dport 31547 -m iprange --src-range 100.0.6.41-100.0.6.254 -j DROP
iptables -A FORWARD -p tcp --dport 56610 -m iprange --src-range 100.0.6.41-100.0.6.254 -j DROP
iptables -A FORWARD -p tcp --dport 30640 -m iprange --src-range 100.0.6.41-100.0.6.254 -j DROP
iptables -A FORWARD -p tcp --dport 28878 -m iprange --src-range 100.0.6.41-100.0.6.254 -j DROP
iptables -A FORWARD -p tcp --dport 41473 -m iprange --src-range 100.0.6.41-100.0.6.254 -j DROP
iptables -A FORWARD -p tcp --dport 60613 -m iprange --src-range 100.0.6.41-100.0.6.254 -j DROP
iptables -A FORWARD -p tcp --dport 12217 -m iprange --src-range 100.0.6.41-100.0.6.254 -j DROP
iptables -A FORWARD -p tcp --dport 61914 -m iprange --src-range 100.0.6.41-100.0.6.254 -j DROP
iptables -A FORWARD -p tcp --dport 39361 -m iprange --src-range 100.0.6.41-100.0.6.254 -j DROP
iptables -A FORWARD -p tcp --dport 45807 -m iprange --src-range 100.0.6.41-100.0.6.254 -j DROP
iptables -A FORWARD -p tcp --dport 8080 -m iprange --src-range 100.0.6.41-100.0.6.254 -j DROP
# Proteções diversas contra portscanners, ping of death, ataques DoS, etc.
iptables -A FORWARD -p icmp --icmp-type echo-request -m limit --limit 1/s -j ACCEPT
iptables -A FORWARD -p tcp -m limit --limit 1/s -j ACCEPT
iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A FORWARD -p tcp --tcp-flags SYN,ACK,FIN,RST RST -m limit --limit 1/s -j ACCEPT
iptables -A FORWARD --protocol tcp --tcp-flags ALL SYN,ACK -j DROP
iptables -A FORWARD -m unclean -j DROP
iptables -A INPUT -m state --state INVALID -j DROP
iptables -N VALID_CHECK
iptables -A VALID_CHECK -p tcp --tcp-flags ALL FIN,URG,PSH -j DROP
iptables -A VALID_CHECK -p tcp --tcp-flags ALL SYN,RST,ACK,FIN,URG -j DROP
iptables -A VALID_CHECK -p tcp --tcp-flags ALL ALL -j DROP
iptables -A VALID_CHECK -p tcp --tcp-flags ALL FIN -j DROP
iptables -A VALID_CHECK -p tcp --tcp-flags SYN,RST SYN,RST -j DROP
iptables -A VALID_CHECK -p tcp --tcp-flags SYN,FIN SYN,FIN -j DROP
iptables -A VALID_CHECK -p tcp --tcp-flags ALL NONE -j DROP
# Abre para a interface de loopback.
# Esta regra é essencial para o KDE e outros programas gráficos funcionarem adequadamente.
iptables -A INPUT -p tcp --syn -s 127.0.0.1/255.0.0.0 -j ACCEPT
iptables -A INPUT -i lo -j ACCEPT
# Esta regra é o coração do firewall do Kurumin,
# ela bloqueia qualquer conexão que não tenha sido permitida acima, justamente por isso ela é a última da cadeia.
iptables -A INPUT -p tcp --syn -j DROP
}
firewall_stop(){
iptables -F
iptables -F -t nat
iptables -F -t mangle
iptables -X
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT
}
case "$1" in
"start")
firewall_start
echo "ok."
;;
"stop")
firewall_stop
echo "O firewall está sendo desativado"
sleep 2
echo "ok."
;;
"restart")
echo "O firewall está sendo desativado"
sleep 1
echo "ok."
firewall_stop; firewall_start
;;
*)
iptables -L -n
esac
squid.conf:
http_port 3128 transparent
visible_hostname srvpxcpd
cache_mem 64 MB
maximum_object_size_in_memory 64 KB
maximum_object_size 512 MB
minimum_object_size 0 KB
cache_swap_low 90
cache_swap_high 95
cache_dir ufs /var/spool/squid 2048 16 256
cache_access_log /var/log/squid/access.log
refresh_pattern ^ftp: 15 20% 2280
refresh_pattern ^gopher: 15 0% 2280
refresh_pattern . 15 20% 2280
acl redelocal src 100.0.6.0/24
acl all src 0.0.0.0/0.0.0.0
acl manager proto cache_object
acl localhost src 127.0.0.1/255.255.255.255
acl SSL_ports port 443 563
acl Safe_ports port 21 80 443 563 70 210 280 488 59 777 901 1025-65535
acl purge method PURGE
acl CONNECT method CONNECT
http_access allow manager localhost
http_access deny manager
http_access allow purge localhost
http_access deny purge
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
redirect_program /usr/bin/squidGuard
# Cria outras acls com os IPs que serao aplicados a regra
acl ipsliberados src "/etc/squid/ipsliberados"
acl ipsrestritos src "/etc/squid/ipsrestritos"
http_access allow localhost
http_access allow redelocal
http_access deny all
delay_pools 2
# Significa que teremos dois controles de banda
# Primeiro controle de banda
delay_class 1 2
# -1/-1 significa que nao teremos limites para a delay pool 1
delay_parameters 1 -1/-1 -1/-1
delay_access 1 allow ipsliberados
# Segundo controle de banda
delay_class 2 2
# Limita a banda para +- 64 kbytes
delay_parameters 2 16000/16000 16000/16000
delay_access 2 allow ipsrestritos
#=========== AJUDA NO BLOQUEIO DO MSN =============
acl msn url_regex -i /gateway/gateway.dll
http_access deny msn
#==================================================
ESSA É A SAÍDA DO COMANDO QUE VC FALOU:
root 4628 0.0 0.1 4816 684 ? Ss 07:59 0:00 /usr/sbin/squid -D -sYC
proxy 4631 0.0 0.9 7332 4968 ? S 07:59 0:00 (squid) -D -sYC
proxy 4637 0.0 2.0 12756 10796 ? Ss 07:59 0:00 (squidGuard)
proxy 4638 0.0 1.9 12224 10284 ? Ss 07:59 0:00 (squidGuard)
proxy 4639 0.0 2.0 12356 10324 ? Ss 07:59 0:00 (squidGuard)
proxy 4640 0.0 1.9 11824 9792 ? Ss 07:59 0:00 (squidGuard)
proxy 4641 0.0 1.9 11832 9796 ? Ss 07:59 0:00 (squidGuard)
root 5057 0.0 0.1 3004 748 pts/0 R+ 08:26 0:00 grep squid