mirror of
https://github.com/rapid7/metasploit-payloads
synced 2025-03-18 15:14:10 +01:00
Slight tweaks to proxy config function
This commit is contained in:
parent
44f581c0e7
commit
98822709b5
@ -475,7 +475,7 @@ static BOOL server_init_http(Transport* transport)
|
|||||||
dprintf("[WINHTTP] Initialising ...");
|
dprintf("[WINHTTP] Initialising ...");
|
||||||
|
|
||||||
// configure proxy
|
// configure proxy
|
||||||
if (ctx->proxy && wcscmp(ctx->proxy, L"METERPRETER_PROXY") != 0)
|
if (ctx->proxy)
|
||||||
{
|
{
|
||||||
dprintf("[DISPATCH] Configuring with proxy: %S", ctx->proxy);
|
dprintf("[DISPATCH] Configuring with proxy: %S", ctx->proxy);
|
||||||
ctx->internet = WinHttpOpen(ctx->ua, WINHTTP_ACCESS_TYPE_NAMED_PROXY, ctx->proxy, WINHTTP_NO_PROXY_BYPASS, 0);
|
ctx->internet = WinHttpOpen(ctx->ua, WINHTTP_ACCESS_TYPE_NAMED_PROXY, ctx->proxy, WINHTTP_NO_PROXY_BYPASS, 0);
|
||||||
@ -708,22 +708,22 @@ Transport* transport_create_http(MetsrvTransportHttp* config)
|
|||||||
memset(transport, 0, sizeof(Transport));
|
memset(transport, 0, sizeof(Transport));
|
||||||
memset(ctx, 0, sizeof(HttpTransportContext));
|
memset(ctx, 0, sizeof(HttpTransportContext));
|
||||||
|
|
||||||
SAFE_FREE(ctx->ua);
|
dprintf("[TRANS HTTP] Given ua: %S", config->ua);
|
||||||
if (config->ua)
|
if (config->ua[0])
|
||||||
{
|
{
|
||||||
ctx->ua = _wcsdup(config->ua);
|
ctx->ua = _wcsdup(config->ua);
|
||||||
}
|
}
|
||||||
SAFE_FREE(ctx->proxy);
|
dprintf("[TRANS HTTP] Given proxy host: %S", config->proxy.hostname);
|
||||||
if (config->proxy.hostname[0])
|
if (config->proxy.hostname[0])
|
||||||
{
|
{
|
||||||
ctx->proxy = _wcsdup(config->proxy.hostname);
|
ctx->proxy = _wcsdup(config->proxy.hostname);
|
||||||
}
|
}
|
||||||
SAFE_FREE(ctx->proxy_user);
|
dprintf("[TRANS HTTP] Given proxy user: %S", config->proxy.username);
|
||||||
if (config->proxy.username[0])
|
if (config->proxy.username[0])
|
||||||
{
|
{
|
||||||
ctx->proxy_user = _wcsdup(config->proxy.username);
|
ctx->proxy_user = _wcsdup(config->proxy.username);
|
||||||
}
|
}
|
||||||
SAFE_FREE(ctx->proxy_pass);
|
dprintf("[TRANS HTTP] Given proxy pass: %S", config->proxy.password);
|
||||||
if (config->proxy.password[0])
|
if (config->proxy.password[0])
|
||||||
{
|
{
|
||||||
ctx->proxy_pass = _wcsdup(config->proxy.password);
|
ctx->proxy_pass = _wcsdup(config->proxy.password);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user