01642 06 11 11 Arrange Call

How to Bypass Port Scan Blocking Firewalls

This guide will help you bypass port scan blocking firewalls using the dark web, TOR. Our pen-test team will often use it as part of an external network pen-test where a number of firewalls and devices are now attempting to block port scans.

Please see Bypassing Post Scan Blocking video for this in youtube format!

The Linux distro we are using is Kali Linux.

Step 1: Download the GitHub Repo

Open your linux terminal, install git with sudo apt install git. Then, download the code by using git clone https://github.com/NorthInfosecTesting/tor_port_scan.git.

Step 2: Install the Requirements

Once the GitHub Repo is downloaded, you need to ensure any prerequisites are installed.

  1. Change directory to the downloaded tor_port_scan directory by entering cd tor_port_scan
  2. Install TOR by entering sudo apt install tor
  3. You may need to uncommect ControlPort 9051 from the file /etc/tor/torrc by removing the # from #ControlPort 9051


  4. Enter sudo systemctl restart tor, then sudo systemctl start tor
  5. Ensure pip and python3 is installed, and enter python3 install -r requirements.txt

Step 3: Script Parameters

Now the requirements are installed, the TOR port scan python script is ready to run. However, first lets check what parameters can be passed to the script.

  1. python3 scan.py -h will bring up the usage menu.
  2. python3 scan.py [target] will execute a port scan changing the TOR address every 5 ports.
  3. You can use the --tor-interval [n] flag to change the number of ports scanned before the TOR IP address is changed. For example, python3 python3 scan.py --tor-interval 10 [target]
  4. The timeout -t flag can be used to enter the TIMEOUT seconds to wait before connection timeout for each port.
  5. The jobs -j flag can be used to set the maximum number of open connections at the same time.