[FUG-BR] RES: Filtro L7

Neerlan Amorim neerlan em gmail.com
Sábado Abril 12 16:36:25 BRT 2008


Encontrei um material muito bom sobre filtro l7 em:
http://www.karczmarski.com/snortlog2cmd.html

Estou implantando em um ambiente de testes, vamos ver como fica.
Está ae a dica.

2008/3/12 Klaus Schneider <klausps em gmail.com>:

> Snort inline é perfeito pra isso.
>
> Colocar em kernel space strings e expressões regulares é um tanto
> arriscado,
> já em user space, que se f*da, um overflow daria no máximo acesso a shell
> do
> usuário que está executando o snort.
>
> Snort pode ter um pouco de custo de CPU, mas em compensação, tem tudo, e é
> simples fazer uma regra para ele.
>
> Não importa se o pacote é criptografado ou o protocolo mudou, o fato é que
> ambos podem não detectar o P2P por causa da criptografia.
>
> O negócio é deixar passar apenas protocolos conhecidos e os desconhecidos
> coloque-os em uma fila de QoS de baixa prioridade.
>
> Em 12/03/08, Neerlan Amorim <neerlan em gmail.com> escreveu:
> >
> > Bloqueio de porta nenhum resolve resolve o problema do p2p pode ser via
> > pf,
> > ipfw.....
> > O controle de banda é uma idéia legal. Só lembrando que tem alguns p2p
> que
> > possuem o recurso de criptografia só pra complicar mais ainda.
> >
> > A solução pra p2p REALMENTE é filtro na camada 7, legal seria se
> > desenvolvessem isso pro ipfw. tipo ipfw add deny all from any to any
> > layer7
> > p2p edonkey :)
> >
> > por enquanto a solução é usar o snort_inline+ipfw.
> >
> > 2008/3/12 Bruno Torres Viana <btviana em gmail.com>:
> >
> > > Não sei se vai ajudar muito, aqui eu criei uma regra legal no PF..
> > >
> > > pass log proto tcp from { $internal_net, $external_addr } to any port
> {
> > <
> > > 1024, 1494, 1723, 1863, 3456, 50001 } modulate state flags S/SA
> > >
> > > Ninguém mais conseguiu usar e-mule nem p2p.
> > >
> > > []´s
> > >
> > > 2008/3/12 Tiago Isic Brasil <tiago em isic.com.br>:
> > >
> > > > Boa tarde!
> > > >
> > > > Já tenho algumas soluçoes como descrito, mas precisa ter algo pois,
> > vai
> > > > que alguem solicite, quero todas as portas UDP abertas e TCP abertas
> e
> > > > bloqueio ou shapping do p2p.
> > > >
> > > > att
> > > >
> > > > Tiago ISIC Brasil
> > > >
> > > >
> > > >
> > > >
> > > > Em Qua, 2008-03-12 às 14:43 -0300, Marcello escreveu:
> > > > > Amigo
> > > > > Já tem um bom tempinho que coloquei na lista que para bloquear p2p
> > > basta
> > > > > bloquear o trafego de UDP , liberando apenas o necessário de
> > > preferencia
> > > > > ponto a ponto , por exemplo DNS para servidores de dns , ponto a
> > ponto
> > > > > para VPN e assim por diante, isso não exatamente bloqueia o
> download
> > > mas
> > > > > sim a pesquisa de fontes para downloads , tenho por habito colocar
> o
> > > > > trafego digamos sujo em uma tunnel de baixa prioridade e ainda com
> > uma
> > > > > pequena perda de pacotes , p2p ficam tão ruins que são convencidos
> a
> > > não
> > > > > usa-los , bloquear mesmo 'quase impossivel , mas torna-los
> > > ineficientes
> > > > > essa é a minha receita.
> > > > >
> > > > > []'s
> > > > >
> > > > > Em Qua, 2008-03-12 às 09:56 -0300, Tiago Isic Brasil escreveu:
> > > > > > Bom dia a todos.
> > > > > >
> > > > > > Seguinte estou na lutar por vários dias em criar as rules para o
> > > > > > snort_inline identificar o trafego p2p.
> > > > > > Fiquei mais de 1 dia vendo payloads e mais payloads via tcpdump,
> > > > > > tentando descobrir padroes quando os aplicativos clientes tentam
> a
> > > > > > conexão. Bom estou no momento analizando o fonte do ipp2p para
> > > > encontrar
> > > > > > os benditos padroes, já consegui algumas coisas e criei em forma
> > de
> > > > > > rule, mas o problema " Ainda nao consegui criar as benditas
> regras
> > > do
> > > > > > snort para bloquear pelo menos a tentativa de conexao ".  Nao
> sou
> > > > muito
> > > > > > experiente em gerar as rules, mas estou tentato.
> > > > > >
> > > > > > Meu apelo, queria que o pessoal ajuda-se a criar essas regras em
> > > modo
> > > > > > geral, seria de utilidade de todos. OU quem já possui em seu
> > > ambiente
> > > > e
> > > > > > funciona, por favor compartilhe, seja solidário com a
> comunidade.
> > > > > >
> > > > > > Pensem se conseguirmos bloquear o trafego p2p poderemos chamar
> > mais
> > > > > > adpetos para nosso Sistema Operacional.
> > > > > >
> > > > > > Segue abaixo as minhas rules geradas após analizar os fontes do
> > > ipp2p:
> > > > > >
> > > > > > #Analise de UDP
> > > > > >
> > > > > > reinject udp $HOME_NET any -> $EXTERNAL_NET any (msg:"P2P
> eDonkey
> > > > eMule
> > > > > > Kad commands Client -> Server status request"; content:"|e3
> 96|";)
> > > > > > reinject udp $EXTERNAL_NET any -> $HOME_NET any (msg:"P2P
> eDonkey
> > > > eMule
> > > > > > Kad commands Server -> Client status request"; content:"|e3
> 97|";)
> > > > > >
> > > > > > reinject udp $HOME_NET any -> $EXTERNAL_NET any (msg:"P2P
> eDonkey
> > > > eMule
> > > > > > Kad commands Server description request"; content:"|e3 a2|";
> > > dsize:6;)
> > > > > > reinject udp $HOME_NET any -> $EXTERNAL_NET any (msg:"P2P
> eDonkey
> > > > eMule
> > > > > > Kad commands Server description response"; content:"|e3 9a|";)
> > > > > > reinject udp $HOME_NET any -> $EXTERNAL_NET any (msg:"P2P
> eDonkey
> > > > eMule
> > > > > > Kad commands Server description response"; content:"|e3 92|";)
> > > > > > reinject udp $HOME_NET any -> $EXTERNAL_NET any (msg:"P2P
> eDonkey
> > > > eMule
> > > > > > Kad commands Server description response"; content:"|e4 20|";
> > > > > > dsize:43;)
> > > > > > reinject udp $HOME_NET any -> $EXTERNAL_NET any (msg:"P2P
> eDonkey
> > > > eMule
> > > > > > Kad commands Server description response"; content:"|e4 00|"; )
> > > > > > reinject udp $HOME_NET any -> $EXTERNAL_NET any (msg:"P2P
> eDonkey
> > > > eMule
> > > > > > Kad commands Server description response"; content:"|e4 10|"; )
> > > > > > reinject udp $HOME_NET any -> $EXTERNAL_NET any (msg:"P2P
> eDonkey
> > > > eMule
> > > > > > Kad commands Server description response"; content:"|e4 18|"; )
> > > > > > reinject udp $HOME_NET any -> $EXTERNAL_NET any (msg:"P2P
> eDonkey
> > > > eMule
> > > > > > Kad commands Server description response"; content:"|e4 52|";
> > > > > > dsize:44;)
> > > > > > reinject udp $HOME_NET any -> $EXTERNAL_NET any (msg:"P2P
> eDonkey
> > > > eMule
> > > > > > Kad commands Server description response"; content:"|e4 58|";
> > > > dsize:6;)
> > > > > > reinject udp $HOME_NET any -> $EXTERNAL_NET any (msg:"P2P
> eDonkey
> > > > eMule
> > > > > > Kad commands Server description response"; content:"|e4 59|";
> > > > dsize:2;)
> > > > > > reinject udp $HOME_NET any -> $EXTERNAL_NET any (msg:"P2P
> eDonkey
> > > > eMule
> > > > > > Kad commands Server description response"; content:"|e4 28|"; )
> > > > > > reinject udp $HOME_NET any -> $EXTERNAL_NET any (msg:"P2P
> eDonkey
> > > > eMule
> > > > > > Kad commands Server description response"; content:"|e4 50|";
> > > > > > dsize:4; )
> > > > > > reinject udp $HOME_NET any -> $EXTERNAL_NET any (msg:"P2P
> eDonkey
> > > > eMule
> > > > > > Kad commands Server description response"; content:"|e4 40|";
> > > > > > dsize:48; )
> > > > > >
> > > > > >
> > > > > > reinject udp $EXTERNAL_NET any -> $HOME_NET any (msg:"P2P
> eDonkey
> > > > eMule
> > > > > > Kad commands Server description request"; content:"|e3 a2|";
> > > dsize:6;)
> > > > > > reinject udp $EXTERNAL_NET any -> $HOME_NET any (msg:"P2P
> eDonkey
> > > > eMule
> > > > > > Kad commands Server description response"; content:"|e3 9a|";)
> > > > > > reinject udp $EXTERNAL_NET any -> $HOME_NET any (msg:"P2P
> eDonkey
> > > > eMule
> > > > > > Kad commands Server description response"; content:"|e3 92|";)
> > > > > > reinject udp $EXTERNAL_NET any -> $HOME_NET any (msg:"P2P
> eDonkey
> > > > eMule
> > > > > > Kad commands Server description response"; content:"|e4 20|";
> > > > > > dsize:43;)
> > > > > > reinject udp $EXTERNAL_NET any -> $HOME_NET any (msg:"P2P
> eDonkey
> > > > eMule
> > > > > > Kad commands Server description response"; content:"|e4 00|"; )
> > > > > > reinject udp $EXTERNAL_NET any -> $HOME_NET any (msg:"P2P
> eDonkey
> > > > eMule
> > > > > > Kad commands Server description response"; content:"|e4 10|"; )
> > > > > > reinject udp $EXTERNAL_NET any -> $HOME_NET any (msg:"P2P
> eDonkey
> > > > eMule
> > > > > > Kad commands Server description response"; content:"|e4 18|"; )
> > > > > > reinject udp $EXTERNAL_NET any -> $HOME_NET any (msg:"P2P
> eDonkey
> > > > eMule
> > > > > > Kad commands Server description response"; content:"|e4 52|";
> > > > > > dsize:44;)
> > > > > > reinject udp $EXTERNAL_NET any -> $HOME_NET any (msg:"P2P
> eDonkey
> > > > eMule
> > > > > > Kad commands Server description response"; content:"|e4 58|";
> > > > dsize:6;)
> > > > > > reinject udp $EXTERNAL_NET any -> $HOME_NET any (msg:"P2P
> eDonkey
> > > > eMule
> > > > > > Kad commands Server description response"; content:"|e4 59|";
> > > > dsize:2;)
> > > > > > reinject udp $EXTERNAL_NET any -> $HOME_NET any (msg:"P2P
> eDonkey
> > > > eMule
> > > > > > Kad commands Server description response"; content:"|e4 28|"; )
> > > > > > reinject udp $EXTERNAL_NET any -> $HOME_NET any (msg:"P2P
> eDonkey
> > > > eMule
> > > > > > Kad commands Server description response"; content:"|e4 50|";
> > > > > > dsize:4; )
> > > > > > reinject udp $EXTERNAL_NET any -> $HOME_NET any (msg:"P2P
> eDonkey
> > > > eMule
> > > > > > Kad commands Server description response"; content:"|e4 40|";
> > > > > > dsize:48; )
> > > > > >
> > > > > >
> > > > > > Tambem estou usando as rules padroes do snort o arquivo
> p2p.rulese
> > > > > > tambem da bleeding-p2p.rules.
> > > > > >
> > > > > > E assim que conseguirmos essa proesa, já vai ter artigo passo a
> > > passo
> > > > > > para a instalação e configuraçao do snort_inline +ipfw.
> > > > > >
> > > > > > att
> > > > > >
> > > > > > Tiago ISIC Brasil
> > > > > > -------------------------
> > > > > > Histórico: http://www.fug.com.br/historico/html/freebsd/
> > > > > > Sair da lista: https://www.fug.com.br/mailman/listinfo/freebsd
> > > > >
> > > > >
> > > > > -------------------------
> > > > > Histórico: http://www.fug.com.br/historico/html/freebsd/
> > > > > Sair da lista: https://www.fug.com.br/mailman/listinfo/freebsd
> > > >
> > > > -------------------------
> > > > Histórico: http://www.fug.com.br/historico/html/freebsd/
> > > > Sair da lista: https://www.fug.com.br/mailman/listinfo/freebsd
> > > >
> > >
> > >
> > >
> > > --
> > > -------------------------------
> > > Bruno Torres Viana
> > > http://btviana.blogspot.com
> > > Cel: (27) 9225-4766
> > >
> > >
> > > Todos nós somos ignorantes, porém em assuntos diferentes. Não seja
> > > ignorante
> > > por opção!
> > > -------------------------
> > > Histórico: http://www.fug.com.br/historico/html/freebsd/
> > > Sair da lista: https://www.fug.com.br/mailman/listinfo/freebsd
> > >
> >
> >
> >
> >
> > --
> > Neerlan Amorim
> >
> > ARCNeTI Telecom
> > Tel.: (95) 3623-2789
> > -------------------------
> > Histórico: http://www.fug.com.br/historico/html/freebsd/
> > Sair da lista: https://www.fug.com.br/mailman/listinfo/freebsd
> >
>
>
>
> --
> /*
> * Klaus Schneider
> */
> -------------------------
> Histórico: http://www.fug.com.br/historico/html/freebsd/
> Sair da lista: https://www.fug.com.br/mailman/listinfo/freebsd
>



-- 
Neerlan Amorim


Mais detalhes sobre a lista de discussão freebsd