PowerShell Code Blocks
Jump to navigation
Jump to search
PowerShell General Bypass etc
powershell.exe -exec bypass
Note re: runas here too...
TCP Port Scanner (Port Range)
(Note the use of allports.exposed)
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 " "
TCP Port Scanner (Specific Ports)
(Note the use of allports.exposed)
21,22,23,25,80,443,1337 | % {$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 " "