T
T
TODO•SEC
Search…
Windows Basic Networking
WINDOWS 'Plumbing'
Displays all connections and listening ports '-a' and ... Displays addresses and port numbers in numerical form '-n' and ... Displays TCP connection template for all connections '-y' (table style - Proto - Local Address - Foreign Address - State - Template) find or findstr to filter output
1
netstat –yan | find “8080”
2
netstat –yan | findstr “22”
Copied!
Filter and show only TCP protocol
1
netstat –yanp tcp
Copied!
Filter and show only UDP protocol
1
netstat –yanp udp -a
Copied!
PING ICMP Statistics
1
netstat -s -p icmp
Copied!

Powershell

Test Connection with Powershell:
1
Test-NetConnection -ComputerName www.google.com -InformationLevel Detailed
Copied!
Ping multiple IP using PowerShell
1
1..99 | % { Test-NetConnection -ComputerName 192.168.1.$_ } | FT -AutoSize
Copied!
Tracert with PowerShell
1
Test-NetConnection www.domain.com –TraceRoute
Copied!
Use PowerShell to check for open port
1
Test-NetConnection -ComputerName www.domain.com -Port 80
Copied!
Alternative syntax for port
1
Test-NetConnection -ComputerName www.domain.com -CommonTCPPort HTTP
Copied!
NSlookup using PowerShell
1
Resolve-DnsName www.domain.com
2
Resolve-DnsName www.domain.com -Type MX -Server 8.8.8.8
Copied!
Permanent Route Add/Remove <"route" + "add"/"DELETE" + network ID + "mask" + subnet mask, dotted decimal + gateway ipv4>
1
route add -p 10.0.0.0/8 192.168.1.254
Copied!
or route add –p 10.X.X.X mask 255.X.X.X 192.168.X.X or route DELETE –p 10.X.X.X mask 255.X.X.X 192.168.X.X
Show Routing table
1
route print
Copied!
Example of basic workflow
1
1 - Print routing table prior to change
2
2 - Delete routes
3
3 - Add routes
4
4 - Print routing table post delete/add routes
5
5 - Ping IP address (presumable in newly added range to test)
6
7
route print
8
route DELETE -p 10.0.0.0 mask 255.255.255.0 192.168.1.254
9
route DELETE -p 192.0.0.0 mask 255.255.255.0 192.168.1.254
10
route ADD -p 10.0.0.0 mask 255.0.0.0 192.168.1.254
11
route ADD -p 192.0.0.0 mask 255.0.0.0 192.168.1.254
12
route print
13
PING 192.168.201.25
14
PING 10.1.0.20
Copied!
Last modified 8d ago
Copy link
Contents
Powershell