IDS/Portsentry
Aller à la navigation
Aller à la recherche
PortSentry
PortSentry est un IDS (Système de Détection d'Intrusion) permettant de détecter les attaques de type scan port et ainsi réagir via iptables, ipchains, ipfwadm, route...
Installation de PortSentry
$ apt-get install portsentry
Contenu du fichier /etc/portsentry/portsentry.conf :
############################ # Configuration PortSentry # ############################ ADVANCED_PORTS_TCP="1024" ADVANCED_PORTS_UDP="1024" ADVANCED_EXCLUDE_TCP="113,139" ADVANCED_EXCLUDE_UDP="520,138,137,67" IGNORE_FILE="/etc/portsentry/portsentry.ignore" HISTORY_FILE="/var/lib/portsentry/portsentry.history" BLOCKED_FILE="/var/lib/portsentry/portsentry.blocked" RESOLVE_HOST = "0" BLOCK_UDP="1" BLOCK_TCP="1" KILL_ROUTE="/sbin/iptables -I INPUT -s $TARGET$ -j DROP" SCAN_TRIGGER="0" # EOF
Contenu du fichier /etc/default/portsentry :
###################### # Default PortSentry # ###################### TCP_MODE="atcp" UDP_MODE="audp"
Contenu du fichier /etc/logrotate.d/portsentry :
#####################
# Rotate PortSentry #
#####################
/var/lib/portsentry/portsentry.* {
weekly
rotate 4
compress
missingok
notifempty
create 0640 root root
sharedscripts
postrotate
/etc/init.d/portsentry restart > /dev/null 2>&1
endscript
}
Lancement de PortSentry :
$ /etc/init.d/portsentry start
Vous pouvez réaliser un test depuis une autre machine grace à nmap et vous pourrez voir le resultat directement dans /var/log/messages de la machine utilisant PortSentry.