PSpanner: Network Scanner

PSPanner is a lightweight PowerShell script which can help you identify open TCP ports. I created this as certain Anti-Virus vendors block tools such as NMAP.

Network scans are often used for good and can help the blue team identify gaps and potential entry points for attackers.

Using PSPanner

Selecting your destination

If you wish to do a single scan, enter the URL or IP. At this moment of time, it doesn’t support IP ranges. If you wish to scan multiple, enter all destination into a txt file.

Single Destination Scan

Multiple Destination Scan (txt)

The IPs I took from Shodan. I don’t own or advise scanning them.
They were the first ones on the site and are used as an example.

Remote Execution

To remotely execute the script, run the following:

powershell –nop –c “iex(New-Object Net.WebClient).DownloadString(‘location’)”

You will need to replace the location with the file path to wherever you have stored the script. This could be an internal file share \\server\share\PSpanner.ps1 or site https:\\site.com\PSpanner.ps1

Using Test-NetConnection Instead

I did experience a few false positives however, if you wish to use Test-NetConnection instead, simply remove the two lines and the ‘#’ before the command.

I hope you enjoy and it benefits you in some way.
Please feel free to add my on Twitter or contact me with any improvement or feedback.

Should you wish to use the script to monitor external devices, take a look at PSWatcher here: