May 16, 2023 by Thibault Debatty | 108 views
Sometimes you want to access services running on unusual ports, like a SSH server running on port 2222 for example. If connection fails, how can we detect the outgoing ports that are filtered or open on the network?
Well, there is a solution: http://portquiz.net/
This server listens on all ports for incoming connections. So you can test for filtered outgoing ports using nmap, netcat, wget or curl. And on windows you can use powershell.
To test a single port:
nmap -p 1234 portquiz.net
Test popular ports:
To test all ports (very slow):
nmap -p- portquiz.net
nc -v portquiz.net 1234
wget -qO- portquiz.net:1234
PS C:\> Test-NetConnection -InformationLevel detailed -ComputerName portquiz.net -Port 80
On this server, there is actually a single (and simple) web server running on port 80. And there is an iptables rule to redirect other ports to this web server:
iptables -t nat -A PREROUTING -p tcp -j DNAT --to-destination :80
You can find the details on the blog post of the author: http://positon.org/portquiz-net-how-it-works