Código: Seleccionar todo
#!/bin/sh
Código: Seleccionar todo
/usr/sbin/iptables
Código: Seleccionar todo
$ IPTABLES -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
De tal modo que la conexion esta rehabilitando el estado del puerto despues de 22 de ACCEPT.
Vamos a habilitar el limite de 7 segundo entre la autorizacion y la del origen...
Código: Seleccionar todo
$ IPTABLES -A INPUT -p tcp -m state --state NEW --dport 22 -m recent --update --seconds 7 -j DROP
$ IPTABLES -A INPUT -p tcp -m state --state NEW --dport 22 -m recent --set -j ACCEPT
Código: Seleccionar todo
$ IPTABLES -A INPUT -p icmp --icmp-type echo-request -m limit --limit 1/s -j ACCEPT
$ IPTABLES -A INPUT -p icmp --icmp-type echo-request -j DROP
Código: Seleccionar todo
$ IPTABLES -A INPUT -p tcp --syn -m limit --limit 3/s -j ACCEPT
$ IPTABLES -A INPUT -p tcp --syn -j DROP
La hubicacion de SYSCTL es
/sbin/sysctl
Código: Seleccionar todo
$ SYSCTL -q -w net.ipv4.tcp_syncookies=1
$ SYSCTL -q -w net.ipv4.tcp_fin_timeout=10