From 8a092df9d624bc56487c376e19a352ebe8ee5137 Mon Sep 17 00:00:00 2001 From: rolen Date: Wed, 6 Mar 2019 10:31:02 +0000 Subject: [PATCH] Use default credentials for the proxy if none provided The UseDefaultCredentials on WebClient (if true) will send creds to the server if requested not the proxy. The Proxy object on WebClient is a IWebProxy which only has a Credentials member (yes could probably cast to WebProxy). This change will send the default creds to the default proxy server --- Files/dropper.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Files/dropper.cs b/Files/dropper.cs index 2dfa4e5..4ed7290 100644 --- a/Files/dropper.cs +++ b/Files/dropper.cs @@ -65,7 +65,8 @@ public class Program proxy.BypassProxyOnLocal = false; x.Proxy = proxy; } else { - x.UseDefaultCredentials = true; + if (null != x.Proxy) + x.Proxy.Credentials = CredentialCache.DefaultCredentials; } var df = "#REPLACEDF#";