Score:0

How to hide use of filtering on a given port? (nmap -sS targethost shows "filtered")

ve flag

I have a software listening on port 1234 that I would like to keep hidden from outside world. I know that I can say e.g.

sudo iptables -A INPUT ! -s 1.2.3.4/32 -p tcp -m tcp --dport 9000 -j 1234 --reject-with icmp-port-unreachable

to make the port 1234 accessible only for the remote host 1.2.3.4.

However, other hosts can still run nmap -sS myhost, nmap -sW myhost or some other advanced test to see output such as

PORT     STATE    SERVICE
1234/tcp filtered someservice-guessed-from-port-number

For basic nmap scan (as normal user instead of root) the port 1234 appears to be closed.

Note that this output is identical regardless if any software is actually running on port 1234 or not.

Is it possible to use iptables to make the port 1234 appear totally identical to normal closed port for all hosts except the selected ones? I know that I could modify all ports to appear as filtered but that seems like a workaround instead of true solution.

ve flag
Note that `nmap` uses the `-sS` by default if you run it as `root`. If you run it as normal user, it will run `-sT` by default.
Score:2
in flag

Reply with RST:

-j REJECT --reject-with tcp-reset
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.