Snort Basics
UF2-NF1._Seguretat_en_la_xarxa_corporativa#Monitoratge_del_tr.C3.A0fic_en_xarxes
Contingut
Snort (Open Source Network Intrussion System)
Funciona 3 modes:
- Sniffer
- Logger
- IDS (IPS)
Command Line
Execució des de línia de comanda (Sniffer). Funcionament semblant tcpdump
#snort --help #snort -q -v -i eth0 // -q quiet, -v verbose, -i interface #snort -q -A console -i eth0 -c /etc/snort/snort.conf // -A tipus d'alertas 'fast', 'full', 'console', 'test', 'none'
Configuració
/etc/snort/snort.conf /etc/snort/rules/* /etc/snort/classification.config # Classificació i priorització de les regles
Normalment Snort s'executa en un firewall amb dos o més interfases. Primerament cal indicar quines són
var HOME_NET 192.168.1.1
var EXTERNAL_NET 192.168.0.2
Regles
Les regles es codifiquen amb signatures.
El programari ja conté per defecte infinitat de regles, i a més es poden afegir d'altres que va publicant la comunitat
Estructura d'una regla:
- Capçalera
- Acció (alert, log, pass...)
- Protocol
- Origen -> Destí
- Opcions
- Missatge
- Atributs de paquet (mida, flags...)
Per exemple alert icmp $EXTERNAL_NET any -> $HOME_NET any (msg:"ICMP PING NMAP"; dsize:0; itype:8; reference:arachnids,162; classtype:attempted-recon; sid:469; rev:3;)
http://www.wikilearning.com/tutorial/taller_de_sistemas_de_deteccion_de_intrusiones_snort/4735-7
Escaneig de Ports
Al fitxer include /etc/snort/rules/scan.rules
Per exemple
$nmap -sV -sT -p T:80 192.168.1.1
Utilitzar snort i Firewall Tester http://www.inversepath.com/ftester.html
http://www.howtoforge.com/test_your_linux_firewall_with_ftester
Altres: http://tomahawk.sourceforge.net/, sneeze (http://www.securiteam.com/tools/5DP0T0AB5G.html), scapy