0

Here is what I've tried so far:

  1. using WINHTTP_OPTION_PROXY_PASSWORD & WINHTTP_OPTION_PROXY_PASSWORD

  2. using WinHttpSetCredentials

  3. using plain text like so L"https://username:password@norway-ubuntu-l2tp.expressprovider.com"

Here is my full code with the latest try:

fetch(WCHAR uri_sprintf[])
{ 
    extern DWORD dwReadBytes, chBuffer;
    HINTERNET hB1, hB0, hB2;
    WinHttpSendRequest(hB2=WinHttpOpenRequest(hB1=WinHttpConnect(hB0=WinHttpOpen
        (L"",WINHTTP_ACCESS_TYPE_NAMED_PROXY,L"https://username:password@norway-ubuntu-l2tp.expressprovider.com",
            WINHTTP_NO_PROXY_BYPASS,0),L"www.google.com",INTERNET_DEFAULT_HTTPS_PORT,0),
        NULL,uri_sprintf,NULL,WINHTTP_NO_REFERER,WINHTTP_DEFAULT_ACCEPT_TYPES,WINHTTP_FLAG_SECURE),
        WINHTTP_NO_ADDITIONAL_HEADERS,0,WINHTTP_NO_REQUEST_DATA,0,0,0),

        WinHttpReceiveResponse(hB2,NULL),

        WinHttpQueryDataAvailable(hB2,&dwReadBytes),

        WinHttpReadData(hB2,&chBuffer,dwReadBytes,&dwReadBytes),

        WinHttpCloseHandle(hB2),

    WinHttpCloseHandle(hB1), WinHttpCloseHandle(hB0);
} 
AnArrayOfFunctions
  • 3,452
  • 2
  • 29
  • 66
  • Put `hB0=WinHttpOpen()` in a single line and [check the error code by calling GetLastError()](https://learn.microsoft.com/en-us/windows/desktop/api/Winhttp/nf-winhttp-winhttpopen#return-value) after it. – Rita Han Apr 18 '19 at 02:44
  • @RitaHan-MSFT I'm doing that by IDA - it says empty response I think. But recently I've been thinking that maybe it is not working since ExpressVPN is a VPN and not a proxy. – AnArrayOfFunctions Apr 18 '19 at 08:30
  • Yes, you need to confirm this first. – Rita Han Apr 19 '19 at 00:52

0 Answers0