1
mirror of https://github.com/rapid7/metasploit-payloads synced 2024-12-21 05:35:54 +01:00

Modify the proxy autoconfig code as per Juan Caillava's code at:

https://medium.com/@br4nsh/a-meterpreter-and-windows-proxy-case-4af2b866f4a1
This commit is contained in:
Meatballs 2018-11-19 16:04:26 +00:00
parent 4fe333fcb4
commit a349e592e3

View File

@ -64,16 +64,18 @@ static HINTERNET get_request_winhttp(HttpTransportContext *ctx, BOOL isGet, cons
autoProxyOpts.dwFlags = WINHTTP_AUTOPROXY_AUTO_DETECT;
autoProxyOpts.dwAutoDetectFlags = WINHTTP_AUTO_DETECT_TYPE_DHCP | WINHTTP_AUTO_DETECT_TYPE_DNS_A;
autoProxyOpts.lpszAutoConfigUrl = 0;
}
else
else if (ieConfig.lpszAutoConfigUrl)
{
dprintf("[PROXY] IE config set to autodetect with URL %S", ieConfig.lpszAutoConfigUrl);
autoProxyOpts.dwFlags = WINHTTP_AUTOPROXY_CONFIG_URL;
autoProxyOpts.dwAutoDetectFlags = 0;
autoProxyOpts.lpszAutoConfigUrl = ieConfig.lpszAutoConfigUrl;
}
autoProxyOpts.fAutoLogonIfChallenged = TRUE;
if (WinHttpGetProxyForUrl(ctx->internet, ctx->url, &autoProxyOpts, &proxyInfo))
{
ctx->proxy_for_url = malloc(sizeof(WINHTTP_PROXY_INFO));