boxa
25.06.02, 15:40
Hallo Experten,
ich habe folgendes Script gefunden, das Portscans verhindern soll. Was haltet ihr davon? Ich kenne mich mit den tcp-flags nicht aus. Wann braucht man diese?
#Portscans unterbinden
iptables -N NoPrtScn
iptables -A NoPrtScn -p tcp --dport 113 -i $INET_IFACE -j REJECT --reject-with tcp-reset
iptables -A NoPrtScn -p tcp -i $INET_IFACE --tcp-flags ALL FIN,URG,PSH -j DROP
iptables -A NoPrtScn -p tcp -i $INET_IFACE --tcp-flags ALL FIN -j DROP
iptables -A NoPrtScn -p tcp -i $INET_IFACE --tcp-flags ALL NONE -j DROP
iptables -A NoPrtScn -p tcp -i $INET_IFACE --tcp-flags SYN,FIN SYN,FIN -j DROP
iptables -A NoPrtScn -p tcp -i $INET_IFACE --tcp-flags SYN,RST SYN,RST -j DROP
for TCP_PORT in $RPC_TCP_PORTS;
do
iptables -A NoPrtScn -p tcp -i $INET_IFACE --dport $TCP_PORT -j DROP
done
for UDP_PORT in $RPC_UDP_PORTS
do
iptables -A NoPrtScn -p udp -i $INET_IFACE --dport $UDP_PORT -j DROP
done
ich habe folgendes Script gefunden, das Portscans verhindern soll. Was haltet ihr davon? Ich kenne mich mit den tcp-flags nicht aus. Wann braucht man diese?
#Portscans unterbinden
iptables -N NoPrtScn
iptables -A NoPrtScn -p tcp --dport 113 -i $INET_IFACE -j REJECT --reject-with tcp-reset
iptables -A NoPrtScn -p tcp -i $INET_IFACE --tcp-flags ALL FIN,URG,PSH -j DROP
iptables -A NoPrtScn -p tcp -i $INET_IFACE --tcp-flags ALL FIN -j DROP
iptables -A NoPrtScn -p tcp -i $INET_IFACE --tcp-flags ALL NONE -j DROP
iptables -A NoPrtScn -p tcp -i $INET_IFACE --tcp-flags SYN,FIN SYN,FIN -j DROP
iptables -A NoPrtScn -p tcp -i $INET_IFACE --tcp-flags SYN,RST SYN,RST -j DROP
for TCP_PORT in $RPC_TCP_PORTS;
do
iptables -A NoPrtScn -p tcp -i $INET_IFACE --dport $TCP_PORT -j DROP
done
for UDP_PORT in $RPC_UDP_PORTS
do
iptables -A NoPrtScn -p udp -i $INET_IFACE --dport $UDP_PORT -j DROP
done