Last active
March 4, 2024 07:21
-
-
Save egre55/71363e4fe06ff3cf135a3d6e3d2924a1 to your computer and use it in GitHub Desktop.
egress check one-liner
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Ugly PowerShell egress check one-liner (works in Constrained Language Mode) | |
# NMap top 50 ports. Checking > 50 may cause Memory DoS | |
foreach ($i in 50,21,22,23,25,26,53,80,81,110,111,113,135,139,143,179,199,443,445,465,514,515,548,554,587,646,993,995,1025,1026,1027,1433,1720,1723,2000,2001,3306,3389,5060,5666,5900,6001,8000,8008,8080,8443,8888,10000,32768,49152,49154){Start-Job -ScriptBlock {param($i) & Test-NetConnection -ComputerName 10.10.10.10 -Port $i} -ArgumentList $i} Get-Job | Wait-Job | Get-Job | Receive-Job |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment