22
0
Fork 0
wiki/Howtonfdump.md

1.6 KiB

Cette page a été importée automatiquement de notre ancien wiki mais n'a pas encore été révisée.

Howto !nfdump

Documentation officielle : http://nfdump.sourceforge.net/

installation

# apt install nfdump

Collecter les flows

Il faut au préalable avoir configuré l'export des flows sur vos routeurs et avoir un collecteur de flow en place.

Un collecteur (nfcapd) est fourni avec nfdump. On peut le faire écouter de la façon suivante :

nfcapd -w -D -p 9996 -B 200000 -S 1 -z -I routeur -l /opt/nflow/routeur

Analyser les flows

Lister toutes les connexions vers le port 80 :

nfdump -M /opt/nflow/routeur -T -R 2016/09/07/nfcapd.201609070315:2016/09/07/nfcapd.201609070320 -o extended 'proto tcp and ( src port > 1024 and dst port 80 )'

Lister toutes les connexions vers le port 80 de l'IP 1.2.3.4 :

nfdump -M /opt/nflow/routeur -T -R 2016/09/07/nfcapd.201609070315:2016/09/07/nfcapd.201609070320 -o extended 'proto tcp and host 1.2.3.4 and ( src port > 1024 and dst port 80 )'

Lister toutes les connexions vers le port 80 de l'IP 1.2.3.4 et aggréger sur l'IP source :

nfdump -M /opt/nflow/routeur -T -R 2016/09/07/nfcapd.201609070315:2016/09/07/nfcapd.201609070320 'proto tcp and host 1.2.3.4 and ( src port > 1024 and dst port 80 )' -A srcip

Lister toutes les connexions vers le port 80 de l'IP 1.2.3.4 et faire une somme :

nfdump -M /opt/nflow/routeur -T -R 2016/09/07/nfcapd.201609070315:2016/09/07/nfcapd.201609070320 'proto tcp and host 1.2.3.4 and ( src port > 1024 and dst port 80 )' -s srcip