https://github.com/calebstewart/net-scan
Powershell ping and TCP port scan implementation
https://github.com/calebstewart/net-scan
Last synced: about 1 month ago
JSON representation
Powershell ping and TCP port scan implementation
- Host: GitHub
- URL: https://github.com/calebstewart/net-scan
- Owner: calebstewart
- Created: 2019-01-09T20:35:12.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-01-10T19:02:24.000Z (over 6 years ago)
- Last Synced: 2025-01-29T13:46:44.931Z (3 months ago)
- Language: PowerShell
- Size: 9.77 KB
- Stars: 4
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Net-Scan - Powershell ping and TCP/UDP port scan implementation
This script will perform a ping and TCP/UDP port scan on the given subnet (IP and subnet mask).
## Usage
```
PS C:\>.\Net-Scan.ps1 -ip 192.168.13.1 -mask 255.255.255.0 -tcp 88,443,1434 -udp 53
```# Result
The result is an array of Host objects in Powershell. These objects have the following structure:
- \[string\]host: the host IP address
- \[PSCustomObject\[\]\]ports: an array of open ports
- \[int\]port: the port number
- \[string\]type: either `tcp` or `udp`
- \[string\]state: either `open` or `open|filtered`
- \[boolean\]up: whether the host is up# Port States
There are two different port states returned by this script. The first is `open`. An `open` TCP port indicates a successfull TCP 3-way handshake. An `open` UDP port indicates a response was returned from a UDP port. An `open|filtered` UDP port is a port which did not actively reject the UDP packet, but the response timed out. This could indicate the port is open, or that there is a filtering device between you and the target or the target is simply ignoring your requests. See [nmap manual](https://nmap.org/book/man-port-scanning-techniques.html).