Need a powershell script to scan the status of system port in remote machine

This topic contains 1 reply, has 2 voices, and was last updated by Profile photo of Don Jones Don Jones 1 year, 7 months ago.

  • Author
    Posts
  • #28719
    Profile photo of Manoj D
    Manoj D
    Participant

    Hi Friends,

    I need a script to fetch the status of TCP port connection from Source machine with respective destination and port details.

    Source_Name Source_IP Destination_Name Destination_IP Portocol Port Status
    Server_1 192.168.1.2 Destination_1 10.10.20.21 TCP 20501 Opened/Closed
    Server_1 192.168.1.2 Destination_2 10.10.20.22 TCP 80 Opened/Closed
    Server_1 192.168.1.2 Destination_3 10.10.20.23 TCP 1417 Opened/Closed
    Server_1 192.168.1.2 Destination_4 10.10.20.24 TCP 9997 Opened/Closed
    Server_1 192.168.1.2 Destination_5 10.10.20.25 TCP 25051 Opened/Closed
    Server_2 192.168.1.3 Destination_1 10.10.20.21 TCP 80 Opened/Closed
    Server_2 192.168.1.3 Destination_2 10.10.20.22 TCP 80 Opened/Closed
    Server_2 192.168.1.3 Destination_3 10.10.20.23 TCP 443 Opened/Closed
    Server_2 192.168.1.3 Destination_4 10.10.20.24 TCP 80 Opened/Closed
    Server_2 192.168.1.3 Destination_5 10.10.20.25 TCP 9997 Opened/Closed
    Server_3 192.168.1.4 Destination_1 10.10.20.21 TCP 80 Opened/Closed
    Server_3 192.168.1.4 Destination_2 10.10.20.22 TCP 80 Opened/Closed
    Server_3 192.168.1.4 Destination_3 10.10.20.23 TCP 443 Opened/Closed
    Server_3 192.168.1.4 Destination_4 10.10.20.24 TCP 80 Opened/Closed
    Server_3 192.168.1.4 Destination_5 10.10.20.25 TCP 9997 Opened/Closed

    Scenario:
    The above given data are stored in CSV as a file name called "firewall.csv"

    From my desktop I need to generate a report of the status Port availability with respect to destination name or IP. But this should check with source name or IP and not in my desktop. Basically Source machine varies like development, testing and Production for all these severs I will not have login permission to do telnet individually. So from my desktop I need to pull the telnet report of all the source machine with their respective destination and port details as given above.

    1. Here the challenges is to skip the authentication while scanning the source machine. Because I don't have privilege for Prod machines. When I try to run the TCP Connection script I am getting an error like, " Access denied,PSSessionStateBroken. Conencting to remote server failed with the following message:ACCESS DENIED ".

    2. It should not scan my local desktop, it has to scan the source machine with their respective destination and port details.

    Thanks

  • #28722
    Profile photo of Don Jones
    Don Jones
    Keymaster

    If you don't have permission, then you can't do this. The whole point of security is to stop unauthorized people from gaining this information. An intruder could simply scan machines and figure out what was available, otherwise.

You must be logged in to reply to this topic.