Shavlik Script Catalog: Open Port Scanner

Version 4

    Author: Shavlik
    Category: Network
    Inputs: List of ports to scan. Default will scan for vCenter Protect ports for agentless scan, agentless deployment, and agent communication "22, 23, 25, 80, 135, 139, 443, 445, 5120".
    Minimum ITScripts engine version required:  8.0.0.0
    Modifies the target machine: No
    Name: Open Port Scanner
    Outputs: A single CSV file containing the results of the port scan

    Purpose: Scan for open ports contained in the PortsList argument

    Script Version: 1.0.0.3

    Target Type: Any

     

    Technical Description:

    The purpose of this script is to help troubleshoot communication issues between console and target machines for Agentless and Agent based actions.  This does not preclude the possibility of scanning for additional ports you may want to also verify.  The broader the list of ports the longer the script run will take.  The port list is comma delimited.  The script will begin with a simple ping of the machine to verify it is present and responsive.  The script proceeds to connect to each port on the target using .net's socket connect method.  Each port in the port list argument is attempted and results are received in the OpsMon up to 90 characters.  Full results are viewable in the results, which are viewable in the ITScript Results view.  Right click on the machine in a run and view machine output.  Example output:

     

    "ComputerName","IP Address","Open Ports","Scanned Ports List"
    "MyMachineName","IPv4 or IPv6 Address","135, 139, 443, 445","22, 23, 25, 80, 135, 139, 443, 445, 5120"

     

    Possible status results in OpsMon could include:

    "Host: $ipaddress - not found"

    "Host: $ST_ComputerName - not found"

    "IP: $ipaddress - Open ports: $successPorts"

    "IP: $ipaddress - None of the selected ports are open"