UNWANTED state
Subsystems (3)
Hi,
time ago i wanted to stealth may gateway, so i start dropping outgoing icmp-port-unreachable packets, to avoid UDP scans.
But i had also a '--dport 113 -j REJECT' target to allow faster irc logins, that stopped working since those ICMP were rejected by the new rule. So i hacked the kernel with a patch i also attach, to prevent those packets being generated.
I also start dropping outgoing RST/ACK to prevent TCP scans, but now i have a question:
can an UNWANTED state be useful?
I mean, incoming packets which dstport is closed were classified as UNWANTED. So were possible to drop UNWANTED packets, and a port will be open when some service listens to it and filtered (not closed) when the service doesn't listens.
A simple firewall is having a DROP default policy and open used ports. But what happens when the service listening behind that port stop listenings? The port remains not filtered, and send RST/ACK (or icmp-port-unreachable) when someone tries to connect to it.
Regards, Matteo
Signature · 4 lines
.""`. Matteo Croce <[email protected]> : :" : proud Debian admin and user `. `"` `- Debian - when you have better things to do than fix a system
net/ipv4/udp.c +1 -1
@@ -1165,7 +1165,7 @@ goto csum_error;UDP_INC_STATS_BH (UDP_MIB_NOPORTS ); -icmp_send (skb,ICMP_DEST_UNREACH ,ICMP_PORT_UNREACH ,0 ); +// icmp_send(skb, ICMP_DEST_UNREACH, ICMP_PORT_UNREACH, 0); /* * Hmm. We got an UDP packet to a port to which we
net/ipv6/udp.c +1 -1
@@ -523,7 +523,7 @@ goto discard;UDP6_INC_STATS_BH (UDP_MIB_NOPORTS ); -icmpv6_send (skb,ICMPV6_DEST_UNREACH ,ICMPV6_PORT_UNREACH ,0 , dev); +// icmpv6_send(skb, ICMPV6_DEST_UNREACH, ICMPV6_PORT_UNREACH, 0, dev); kfree_skb (skb);return (0 );