aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRich Lundeen <richard.lundeen@gmail.com>2013-06-25 22:07:36 -0700
committerRich Lundeen <richard.lundeen@gmail.com>2013-06-25 22:07:36 -0700
commit98510d80973cc46462cdfe6bd18fe3ec5f64d4bc (patch)
treedcbb8417d6f67b6fc3ebabb1a3fde01298806372
parent05ab35a3af55a5b28cdbc2db73f26ada044bb6d3 (diff)
downloadPowerSploit-98510d80973cc46462cdfe6bd18fe3ec5f64d4bc.tar.gz
PowerSploit-98510d80973cc46462cdfe6bd18fe3ec5f64d4bc.zip
IPv6 support in hosts param
-rw-r--r--Recon/Invoke-Portscan.ps125
1 files changed, 14 insertions, 11 deletions
diff --git a/Recon/Invoke-Portscan.ps1 b/Recon/Invoke-Portscan.ps1
index 7805e13..46a5337 100644
--- a/Recon/Invoke-Portscan.ps1
+++ b/Recon/Invoke-Portscan.ps1
@@ -243,6 +243,8 @@ http://webstersprodigy.net
PROCESS {
+ Set-StrictMode -Version 2.0
+
$version = .13
$hostList = New-Object System.Collections.ArrayList
$portList = New-Object System.Collections.ArrayList
@@ -314,16 +316,7 @@ http://webstersprodigy.net
}
else
{
- try
- {
- $address = [System.Net.IPAddress]::Parse($iHost)
- $hostList.Add($address.IPAddressToString)
- }
- catch
- {
- #we're assuming this is a host name
- $hostList.Add($iHost)
- }
+ $hostList.Add($iHost)
}
}
}
@@ -841,7 +834,17 @@ http://webstersprodigy.net
[Parameter(Mandatory = $True)] [int] $timeout
)
- $sockets[$p] = new-object System.Net.Sockets.TcpClient
+ try {
+ $pAddress = [System.Net.IPAddress]::Parse($h)
+ $sockets[$p] = new-object System.Net.Sockets.TcpClient $pAddress.AddressFamily
+
+ }
+ catch {
+ #we're assuming this is a host name
+ $sockets[$p] = new-object System.Net.Sockets.TcpClient
+ }
+
+
$scriptBlockAsString = @"
#somewhat of a race condition with the timeout, but I don't think it matters