9.1.6 Windows Network Checks
← Reference index · Previous: Results and next actions · Next: RDP access | Strategy map | Study methods: Discover attack surfaces
Purpose: Test TCP reachability from a Windows host when source position or available tooling matters.
Test one TCP port from the Windows source host:
Test-NetConnection -ComputerName TARGET -Port PORTS
Read:
TcpTestSucceeded, source and destination addresses. Use one number for PORTS. Failure does not distinguish a closed port, filtering or a path problem.
9.1.6.1 Variants — scan ports 1-1024 or a selected port list
9.1.6.1.1 Scan a low-port range
1..1024 | % {echo ((New-Object Net.Sockets.TcpClient).Connect("DC_IP", $_)) "TCP port $_ is open"} 2>$null
9.1.6.1.2 Check a selected port list
The example list can be changed to the endpoints of interest.
22,80,443,445,3389 | % {echo ((New-Object Net.Sockets.TcpClient).Connect("TARGET", $_)) "TCP port $_ is open"} 2>$null
$_ is the current port; errors are hidden. No printed result does not prove every port is closed. Results reflect the Windows host's access and the stated port selection.