4 069
contributi
Nessun oggetto della modifica |
|||
Riga 78: | Riga 78: | ||
$IPT -A INPUT -p icmp --icmp-type timestamp-request -m state --state NEW -j ACCEPT | $IPT -A INPUT -p icmp --icmp-type timestamp-request -m state --state NEW -j ACCEPT | ||
$IPT -A INPUT -p icmp --icmp-type timestamp-reply -m state --state ESTABLISHED,RELATED -j ACCEPT | $IPT -A INPUT -p icmp --icmp-type timestamp-reply -m state --state ESTABLISHED,RELATED -j ACCEPT | ||
$IPT -A INPUT -p icmp -m icmp --icmp-type 8 -j ACCEPT | |||
$IPT -A OUTPUT -p icmp -m icmp --icmp-type 8 -j ACCEPT | |||
Riga 84: | Riga 86: | ||
############################################### | ############################################### | ||
$IPT -A INPUT -s 10.0.0.0/8 -j DROP | |||
$IPT -A INPUT -s 169.254.0.0/16 -j DROP | |||
$IPT -A INPUT -s 172.16.0.0/12 -j DROP | |||
$IPT -A INPUT -s 127.0.0.0/8 -j DROP | |||
$IPT -A INPUT -s 192.168.0.0/24 -j DROP | |||
$IPT -A INPUT -s 192.168.1.0/24 -j DROP | |||
$IPT -A INPUT -s 192.168.10.0/24 -j DROP | |||
$IPT -A INPUT -s 224.0.0.0/4 -j DROP | |||
$IPT -A INPUT -d 224.0.0.0/4 -j DROP | |||
$IPT -A INPUT -s 240.0.0.0/5 -j DROP | |||
$IPT -A INPUT -d 240.0.0.0/5 -j DROP | |||
$IPT -A INPUT -s 0.0.0.0/8 -j DROP | |||
$IPT -A INPUT -d 0.0.0.0/8 -j DROP | |||
$IPT -A INPUT -d 239.255.255.0/24 -j DROP | |||
$IPT -A INPUT -d 255.255.255.255 -j DROP | |||
######################################## | |||
# Mi proteggo da attacchi SMURF | |||
######################################## | |||
$IPT -A INPUT -p icmp -m icmp --icmp-type address-mask-request -j DROP | |||
$IPT -A INPUT -p icmp -m icmp --icmp-type timestamp-request -j DROP | |||
$IPT -A INPUT -p icmp -m icmp -m limit --limit 1/second -j ACCEPT | |||
$IPT -A INPUT -p tcp -m tcp --tcp-flags RST RST -m limit --limit 2/second --limit-burst 2 -j ACCEPT | |||
##################################### | |||
# Elimino pacchetti non validi | |||
##################################### | |||
$IPT -A INPUT -m state --state INVALID -j DROP | |||
$IPT -A FORWARD -m state --state INVALID -j DROP | |||
$IPT -A OUTPUT -m state --state INVALID -j DROP | |||
############################################## | |||
# Impedisco i port scan e loggo i tentativi | |||
# Gli IP sono bloccati per 24 ore | |||
############################################## | |||
$IPT -A INPUT -m recent --name portscan --rcheck --seconds 86400 -j DROP | |||
$IPT -A FORWARD -m recent --name portscan --rcheck --seconds 86400 -j DROP | |||
$IPT -A INPUT -p tcp -m tcp --dport 139 -m recent --name portscan --set -j LOG --log-prefix "portscan:" | |||
$IPT -A INPUT -p tcp -m tcp --dport 139 -m recent --name portscan --set -j DROP | |||