Skip to content

BornToBeRoot/PowerShell_IPv4PortScanner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 

Repository files navigation

PowerShell Async Port-Scanner

Powerful asynchronus Port-Scanner which returns a custom PowerShell-Object with basic informations about the scanned Port-Range include Port-Number, Protocol, Service-Name, Service-Description and Status.

Description

This is a powerful asynchronus Port-Scanner working with the PowerShell RunspacePool. You can scan any Port-Range you want. The result will show you all open ports Port-Number, Protocol, Service-Name, Service-Description and Status.

This script also work fine along with my asychronus IP-Scanner published on GitHub too. You can easily pipe the output of the IP-Scanner result in this script.

Screenshot of Working Scanner and Result

Syntax

.\ScanPortsAsync.ps1 [-ComputerName] <String> [[-StartPort] <Int32>] [[-EndPort] <Int32>] [[-Threads] <Int32>] [[-UpdateListFromIANA]] [[-Force]] [<CommonParameters>]

Example

Scan a specific Port-Range (1-500)

.\ScanPortsAsync.ps1 -ComputerName 192.168.1.100 -StartPort 1 -EndPort 500 | Format-Table

You may want to update the official "Service Name and Transport Protocol Port Number Registry" from IANA... Just add the parameter "-UpdateListFromIANA".

.\ScanPortsAsync.ps1 -ComputerName 172.16.2.5 -UpdateListFromIANA

If your PC has enough power, you can use more threads at the same time

.\ScanPortsAsync.ps1 -ComputerName test-pc01 -Threads 250

Output

Port Protocol ServiceName  ServiceDescription               Status
---- -------- -----------  ------------------               ------
  21 tcp      ftp          File Transfer Protocol [Control] open
  53 tcp      domain       Domain Name Server               open
  80 tcp      http         World Wide Web HTTP              open
 139 tcp      netbios-ssn  NETBIOS Session Service          open
 445 tcp      microsoft-ds Microsoft-DS                     open

and if no port list is available (should never happend, because it's uploaded on Github)

Port Protocol Status
---- -------- ------
  21 tcp      open
  53 tcp      open
  80 tcp      open
 139 tcp      open
 445 tcp      open

Offical Port List

ToDo

[x] Integrate Port-List like: 80 (http), 443 (https), etc. [x] You can now enter a hostname as -ComputerName. The script will resolve the IPv4-Address.