Testing of allowed ports on restricted networks
On several (usually public) networks, i've several times hit case, where I wasn't allowed to use all ports for connection to services, like 22 (SSH), 23(TELNET) and there has been only few whitelisted, but how to find those allowed in order to change ex. VPN or SSH port on server in order to be able to connect?
Well, just do port scan against portquiz.net where are all ports used for serving HTTP site (so you can even give try for example portquiz.net:1234. Then you will get list of all whitelisted ports using:
netcat -vz portquiz.net 1-9999 2>&1 | grep -v failed
Reference: https://superuser.com/questions/577206/how-can-i-check-what-outbound-ports-are-allowed-in-a-network