1

I am trying to send a get request using below VBScript:

   dim user, pass,url,Req
   url = "url"
   user = "DOMAIN\USER"
   pass = "mypassword"
   Set Req = CreateObject("Msxml2.ServerXMLHTTP.6.0")  
   Req.Open "GET", url, False
   Req.setRequestHeader "Authorization", "NTLM" + Base64Encode(user + ":" + pass)
   Req.send
   Req.getAllResponseHeaders

This code results with a "Undefined Variable: Base64Encode" error. Removing the Base64Encode does not work either.

I have tried the copy the authentication header from a successful raw request in SOAPUI but still having the 401 error.

On the other hand I have sent the same get request using SOAPUI and Python. So there is nothing wrong with authorization info.

To Sum up: I need a VBScript to send a get request with NTLM authentication without using Base64Encode

GG1919
  • 19
  • 1
  • You can’t authenticate NTLM like that, I think you’re thinking of doing a plain text authorization header which uses `username:password` encoded as base64. – user692942 Jun 23 '21 at 07:47
  • My approach might be wrong but i could not find an authentication method which support NTLM in Msxml2.ServerXMLHTTP object. – GG1919 Jun 23 '21 at 08:01
  • The only way you’ll be able to authenticate with NTLM is by using Windows Authentication on your IIS web application and then it will only authenticate the logged in user. – user692942 Jun 23 '21 at 08:18

0 Answers0