Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

My school has a firewall which limits most outgoing ports. There're only TCP/80, TCP/443, TCP/21 allowed. Is there's a way to find out all the outgoing port allowed by the firewall?

My current idea: open all TCP ports with nc on a remote server, then use nmap to scan which ports are accessible. But how do I do if I don't have a remote server? or is there a public server that opens all the ports for this kind of tests?

share|improve this question
What kind of firewall? Is it linux based? Does it have IPTABLES? tcpdump? –  cybernard Jun 16 '13 at 15:07
@cybernard I don't know. I don't have permission to access the firewall. It shouldn't have very complex rules, as seemly all port blockage is only done by dropping the packages directly. There should be no content filter I guess. –  Shou Ya Jun 16 '13 at 16:52
Do you have permission from the school to do this? –  cybernard Jun 16 '13 at 17:32

2 Answers 2

up vote -1 down vote accepted

WARNING: You better have permission from the school to do this!!! If you do this without permission you could get in serious LEGAL trouble. Getting expelled might be the least of your problems.



grc.com has a project called shields up it will do a basic inbound port scan.

Also I think your confusing inbound and outbound traffic. The ports you listed are legit inbound ports but not used outbound for outbound traffic. When a browser connect to port 80 on a web server the web server automatically changes the outbound port to a random one so the web server can accept the next connection on port 80.

If you can disconnect them from the internet for 30 minutes or so you can connect a laptop to the server directly. Before you do that load and learn how to use nessus. Make sure to have a static IP on the same subnet on the laptop as on the server. After that hit the server with nessus. It will even check for vulnerabilities in your web server and other internet facing software.

Then reconnect it to the internet. You now have a list of thing to fix, or not.

share|improve this answer
It's hard to see how this is the accepted answer. What the asker is looking for is how to detect which ports are being blocked as destination ports for outgoing connections. Not destination ports for incoming connections or source ports for outgoing connections. –  efdee Nov 25 '13 at 8:50

You could see if there's a different response for "Invalid outgoing port" versus "Valid outgoing port but no response from server." For example, if you know port 6667 is invalid, see what response you get (e.g. from telnet) when connecting to a server with a known 6667 port open. Compare that to the response from a non-open port on a server that is allowed by the firewall. If you can distinguish the two, then you don't need that extra server. Otherwise, you do.

Or, just ask your IT admin.

share|improve this answer
Most of these efforts are not entirely valid if your traffic is also subject to packet inspection, and not simple Allow/Deny connect rules. –  maxwellb Jun 16 '13 at 9:22

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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