sotto linux si tende ad usare iptables che è un modulo incluso nel kernel che si occupa di packet filtering
per richiamarlo devi creare uno script da mettere dentro /etc/init.d che contenga le regole di protezione che vuoi applicare scritte secondo la sintassi accettata da iptables...
ad esempio io sto lavorando al mio iptables
Codice:
# /etc/init.d/iptables
# Iptables Configuration File
# For JoErNanO@DeBiAn-BoX1 (Sarge-2.6.8)
# Written By: JoErNanO aka kernelpanic - joernano@gentelibera.it
# Started 2/11/2005, Latest Release 14/11/2005
# Blocks:
# -Everything except from allowed connection which are specified later on
# Allows:
# -Incoming:
# http connections (80)
#
#
#
# Source IPs for Incoming Connections can be specified by editing the file
#
# -Outgoing:
# http connections (80)
# ftp connections (21)
# ssh connections (22)
# dc++ connections (411)
# emule connections (4662:tcp,4672:udp,4661:servers)
# mysql connections (3306)
# msn connections ()
# clamav connections ()
# icmp connections ()
#
#
# -Internal Interfaces:
# eth0
#
# Logs:
# -Every allowed Incoming Connection in /var/iptables/Incoming-log
# -Every blocked Potential Attack in /var/iptables/pAttack-log
# -Every blocked Attack in /var/lib/iptables/Attack-log
# Turn on traffic filtering
*filter
# Define general rules with no ip specifications
# -Block all incoming, outgoing and forward
:INPUT DROP [0:0]
:OUTPUT DROP [0:0]
:FORWARD DROP [0:0]
# Define Incoming Connections
# -Allow everything from local loopback interface
-A INPUT -i lo -j ACCEPT
# -Allow http
-A INPUT -dport 80 -j ACCEPT
# Define Outgoning Connections
# -Allow http
-A OUTPUT -dport 80 -j ACCEPT
# -Allow ftp
-A OUTPUT -dport 21 -j ACCEPT
# -Allow ssh
-A OUTPUT -dport 22 -j ACCEPT
# -Allow dc++
-A OUTPUT -dport 411 -j ACCEPT
# -Allow emule
-A OUTPUT -p tcp -dport 4662 -dport 4661 -p udp -dport 4672 -j ACCEPT
# -Allow mysql
-A OUTPUT -dport 3305
# -Allow msn
# -Allow clamav
# -Allow icmp
-A OUTPUT -p icmp -j ACCEPT
# Define Incoming Connections
# -Allow http
-A INPUT -dport 80 -j ACCEPT
lo devo ancora testare ma la sintassi dovrebbe essere corretta...