Moved if statement to allow https comms

client_ports
Christopher Truncer 2015-07-07 11:46:39 -04:00
parent 389cc5b8ea
commit f29469b501
1 changed files with 8 additions and 4 deletions

View File

@ -267,6 +267,7 @@ function Invoke-EgressAssess
} }
elseif ($client -eq "https") elseif ($client -eq "https")
{ {
$Url = "https://" + $IP + "/post_data.php" $Url = "https://" + $IP + "/post_data.php"
} }
$uri = New-Object -TypeName System.Uri -ArgumentList $Url $uri = New-Object -TypeName System.Uri -ArgumentList $Url
@ -303,10 +304,13 @@ function Invoke-EgressAssess
Write-Verbose "[*] You did not provide a data type to generate." Write-Verbose "[*] You did not provide a data type to generate."
Return Return
} }
if ($client -eq "https")
{
# This line is required to accept any SSL certificate errors # This line is required to accept any SSL certificate errors
[Net.ServicePointManager]::ServerCertificateValidationCallback = { $true } [Net.ServicePointManager]::ServerCertificateValidationCallback = { $true }
$uri = New-Object -TypeName System.Uri -ArgumentList $Url $uri = New-Object -TypeName System.Uri -ArgumentList $Url
$wc = New-Object -TypeName System.Net.WebClient $wc = New-Object -TypeName System.Net.WebClient
}
if ($proxy) if ($proxy)
{ {
$proxy = [System.Net.WebRequest]::GetSystemWebProxy() $proxy = [System.Net.WebRequest]::GetSystemWebProxy()