SamDecrock / node-http-ntlm

Node.js module to authenticate using HTTP NTLM
MIT License
192 stars 89 forks source link

Still can't access NTLM site #17

Closed pucelle closed 9 years ago

pucelle commented 9 years ago

I don't know why, but I still can't access a site which use NTLM auth.

I found my "createType1Message" function returns "TlRMTVNTUAABAAAAB6IIogAAAAAoAAAAAAAAACgAAAAFASgKAAAADw==", but My Firefix returns "TlRMTVNTUAABAAAAB4IIogAAAAAAAAAAAAAAAAAAAAAGAbEdAAAADw==" at the same place.

Here is some part of the response headers: Server=Microsoft-IIS/6.0 WWW-Authenticate=NTLM MicrosoftSharePointTeamServices=12.0.0.4518 X-Powered-By=ASP.NET

So, is there a different version of NTLM?

SamDecrock commented 9 years ago

I examined the message you provided.

The only difference is the version number of your operation system, mine says: Version 5.1 (Build 2600), which is XP service pack 3

Yours says: Version 6.1 (Build 7601), which is Windows 7 or Windows Server 2008 R2, SP1

If you want, you can change the numbers inside /node_modules/httpntlm/ntlm.js on line 88 like this:

    buf.writeUInt8(5, pos); pos += 1;      //ProductMajorVersion
    buf.writeUInt8(1, pos); pos += 1;      //ProductMinorVersion
    buf.writeUInt16LE(2600, pos); pos += 2; //ProductBuild

becomes

    buf.writeUInt8(6, pos); pos += 1;      //ProductMajorVersion
    buf.writeUInt8(1, pos); pos += 1;      //ProductMinorVersion
    buf.writeUInt16LE(7601, pos); pos += 2; //ProductBuild

And see if it helps. You never know ;-)

pucelle commented 9 years ago

Thanks very much, I will try it tomorrow.

pucelle commented 9 years ago

Hi, SamDecrock, I tried your "7601" today, but it still can't work. But at last!!! I found I added the domain part to the username, and after removing it, all works!!! Thanks very much for your patience and help, Thanks!