I have a CentOS 6 server with nmap 5.51 installed on it. I issue the following command:
nmap -sS -PN -p1-1024 --traceroute --reason -O -sV {My IP} -vv
(This is all "don't quote me")
-sS is a type of scan where TCP connections are not fully established
-PN means skip checking if host is online
-p1-65535 is the port range
--traceroute means add traceroute
--reason "Shows the reason each port is set to a specific state and the reason each host is up or down."
-O means OS detection
-sV detects the version of the program listening on each port
-vv means "be verbose"
So anyway... I run this command, wait a few minutes, it prints the result and EXITS. I open another terminal window (or tab), try to connect to that same server through SSH... And the connection times out. This happens every time, and only after running nmap. Rebooting is the only thing that fixes it.
It seems that if I already have a connection, it keeps communicating, but new ones get refused. Like I said, nmap has already exited, and I made sure it's not in the process list (ps uax | grep nmap).
And another thing, the weirdest of all: everything is fine while nmap runs. It's when it goes away that shenanigans start.
But this is not consistent. When I added the argument -T2 ("polite" scanning), the server went down instantly, including existing connections.
What next?
Note that the server that screws up is the one that does the scanning, not the target.