mirror of
https://github.com/rapid7/metasploit-payloads
synced 2025-03-30 22:19:17 +02: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:
parent
4fe333fcb4
commit
a349e592e3
@ -64,16 +64,18 @@ static HINTERNET get_request_winhttp(HttpTransportContext *ctx, BOOL isGet, cons
|
|||||||
|
|
||||||
autoProxyOpts.dwFlags = WINHTTP_AUTOPROXY_AUTO_DETECT;
|
autoProxyOpts.dwFlags = WINHTTP_AUTOPROXY_AUTO_DETECT;
|
||||||
autoProxyOpts.dwAutoDetectFlags = WINHTTP_AUTO_DETECT_TYPE_DHCP | WINHTTP_AUTO_DETECT_TYPE_DNS_A;
|
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);
|
dprintf("[PROXY] IE config set to autodetect with URL %S", ieConfig.lpszAutoConfigUrl);
|
||||||
|
|
||||||
autoProxyOpts.dwFlags = WINHTTP_AUTOPROXY_CONFIG_URL;
|
autoProxyOpts.dwFlags = WINHTTP_AUTOPROXY_CONFIG_URL;
|
||||||
|
autoProxyOpts.dwAutoDetectFlags = 0;
|
||||||
autoProxyOpts.lpszAutoConfigUrl = ieConfig.lpszAutoConfigUrl;
|
autoProxyOpts.lpszAutoConfigUrl = ieConfig.lpszAutoConfigUrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
autoProxyOpts.fAutoLogonIfChallenged = TRUE;
|
autoProxyOpts.fAutoLogonIfChallenged = TRUE;
|
||||||
|
|
||||||
if (WinHttpGetProxyForUrl(ctx->internet, ctx->url, &autoProxyOpts, &proxyInfo))
|
if (WinHttpGetProxyForUrl(ctx->internet, ctx->url, &autoProxyOpts, &proxyInfo))
|
||||||
{
|
{
|
||||||
ctx->proxy_for_url = malloc(sizeof(WINHTTP_PROXY_INFO));
|
ctx->proxy_for_url = malloc(sizeof(WINHTTP_PROXY_INFO));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user