$ErrorActionPreference = 'SilentlyContinue' Write-Output "=== [1] DC PORTS 192.168.1.10 / 10.148.0.11 ===" foreach ($ip in @('192.168.1.10','10.148.0.11','192.168.1.1','192.168.1.2')) { foreach ($p in @(53,88,135,139,389,445,464,636,3268,3269,5985,5986,3389,80,443,1433,3306,49152,49153,49154)) { $c = New-Object System.Net.Sockets.TcpClient $a = $c.BeginConnect($ip, $p, $null, $null) if ($a.AsyncWaitHandle.WaitOne(700)) { if ($c.Connected) { Write-Output "OPEN $ip`:$p" } } $c.Close() } } Write-Output "" Write-Output "=== [2] WHOAMI /ALL ===" whoami /all 2>&1 | Out-String | Write-Output Write-Output "=== [3] NLTest DSGETDC ===" nltest /dsgetdc:Turbon.TH 2>&1 | Out-String | Write-Output nltest /dclist:Turbon.TH 2>&1 | Out-String | Write-Output Write-Output "=== [4] NET VIEW ===" net view /domain 2>&1 | Out-String | Write-Output net view 2>&1 | Out-String | Write-Output Write-Output "=== [5] LOCAL USERS / GROUPS ===" net user 2>&1 | Out-String | Write-Output net localgroup administrators 2>&1 | Out-String | Write-Output Write-Output "=== [6] LOGON SESSIONS ===" quser 2>&1 | Out-String | Write-Output net session 2>&1 | Out-String | Write-Output Write-Output "=== [7] CACHED CREDS / cmdkey ===" cmdkey /list 2>&1 | Out-String | Write-Output Write-Output "=== [8] LSASS PID ===" Get-Process lsass | Select-Object Id,ProcessName | Format-Table -AutoSize | Out-String | Write-Output Write-Output "=== [9] DOMAIN INFO via WMI ===" wmic computersystem get domain,partofdomain,username /value 2>&1 | Out-String | Write-Output Write-Output "=== DONE ==="