Flag to close connection after N bytes
The networking swiss army knife
Status: Beta
Brought to you by:
themnemonic
I'd like to use a netcat listener as a way to verify ports are open thru a firewall.
(e.g., I use this: /usr/bin/nc -v -k -l 5001)
This is very useful to make sure the firewall config allow thru certain ephemeral ports.
But starting a netcat listener on an open server means that scanners will likely find it and potentially DDOS it.
A simple solution would be a flag that says close the connect after receiving N bytes (and probably sleep for a while before accepting another connection.)
Hello,
you dont't seem to use the netcat version of sourceforge, but this netcat doesn't use option -k. I doen’t believe, that a limit for incoming bytes, would prevent a DDOS attack. In the case of a DDOS the attacker doesn’t make the full handshake. As an example I refer to the syn-flood attack. These half-open connect uses resources in tcp/ip, so that many of that drive crazy the system. If the service behind the port would realize such a situation, netcat must react by waiting a time. But I’m not the specialist of tcp/ip, so that I doen’t know, if a service would realize the DDOS.
Best Regards
Marc