Skip to content

Instantly share code, notes, and snippets.

@c0psrul3
Created April 15, 2016 23:01
Show Gist options
  • Save c0psrul3/ea0cdacdf8cd29cfaa9a5979b2b1a06b to your computer and use it in GitHub Desktop.
Save c0psrul3/ea0cdacdf8cd29cfaa9a5979b2b1a06b to your computer and use it in GitHub Desktop.
1..1024 | % {$test= new-object system.Net.Sockets.TcpClient; $wait = $test.beginConnect("allports.exposed",$_,$null,$null); ($wait.asyncwaithandle.waitone(250,$false)); if($test.Connected){echo "$_ open"}else{echo "$_ closed"}} | select-string " "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment