I want to make a server that responds open to every port that is scanned by nmap (TCP and UDP).

Are there a simple solution to do that?

  • 4
    This really isn't a security question, but a programming question or a server config question. – schroeder Apr 12 '17 at 15:00
  • 1
    iptables can redirect all traffic to a certain port – schroeder Apr 12 '17 at 15:01
  • Are you building a server to test nmap on, or some sort of device to trick people nmap scanning you? Do you still want other services ti function normally on your server (ftp / http etc) – iainpb Apr 12 '17 at 15:02
  • Could you elaborate your question a little bit more? Would you like to create a honeypot and eavesdrop traffic? or would you like to all your traffic be redirected to one application? Or is it as simple as showing all open on nmap? – Ricardo Reimao Apr 12 '17 at 15:02
  • I want to test a connection between 2 distant points. The first make a nmap to a server i want to do. And i want this one responds open to every port to check if the connection block some ports. I realize it's not a security question, but i don't know where i have to ask my question. Sorry for inconvenience. – DSX Apr 13 '17 at 7:03

You could just port-forward (i.e. DNAT) anything incoming from certain ranges to a single port with a generic listener of some form on it.

Something like:

iptables -t nat -A PREROUTING -s -p tcp --dports 0:65535 -j DNAT --to-port 8080

Obviously, whether or not that actually works for your purposes depends on your use-case.

| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.