2

I have a computer located on a Internet network that has some security policies, which I don't have control over. I am looking for a program, user script, or web service that can give me a list of which ports are open for outbound connections (outbound connections = connections from my computer to a server located outside my computer's network).

It should work on Microsoft Windows or Linux. Any price or license is fine.

2
  • 1
    I could imagine a tool that tries to connect to an external server (probably maintained by this tool's maintainers) that would listen for connection on every single port. Would that be OK?
    – Nicolas Raoul
    Oct 20, 2017 at 3:02
  • @NicolasRaoul yes that'd be ok. I have added one answer doing this. Oct 20, 2017 at 3:18

1 Answer 1

4

The website portquiz.net can be used to check which ports are open for outbound connection, e.g. as follows (I took the command from http://thomasmullaly.com/2013/04/13/outgoing-port-tester/):

sudo apt-get install -y nmap
nmap -Pn --top-ports 1000 portquiz.net

Another way to do so, from https://gist.github.com/enginefeeder101/0805faf3862d88a97d66:

#!/bin/bash

task(){
  LC_ALL=C nc -vzw5 portquiz.net $1 2>&1 | grep -v 'Connection timed out'
}

N=50                               # Specify number of ports to check at once
(
  for port in {1..65535}; do       # Specify port range to check here
    ((i=i%N)); ((i++==0)) && wait
    task "$port" &
  done
)
1
  • 1
    Very cool that portquiz.net is a free service :-)
    – Nicolas Raoul
    Oct 20, 2017 at 3:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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