diyan / pywinrm

Python library for Windows Remote Management (WinRM)
MIT License
1.06k stars 265 forks source link

What version of NTLM is supported by pywinrm 0.3.0 #299

Closed mrohith92 closed 4 years ago

mrohith92 commented 4 years ago

Hi I would like to know what version of NTLM is supported by pywinrm 0.3.0 ie is NTLMv2 also supported pywinrm 0.2.2 ([https://pypi.org/project/pywinrm/0.2.2/]) supports only NTMLv1 as per the link.

From my understanding pywinrm uses ntlm_auth (i am using ntlm_auth 1.3.0). ntlm_auth modules uses a 'Compatibility flag' to set the NTLM version to be used. Below are details from the code:

The values correspond to the following
                0 : LM and NTLMv1
                1 : LM, NTLMv1 and NTLMv1 with Extended Session Security
                2 : NTLMv1 and NTLMv1 with Extended Session Security
                3-5 : NTLMv2 Only

The default value is 3 (if a no value is provided)

So i would like to understand how does pywinrm set this value.

I have scoured the source code to no avail. There is no mention of the version being set (as far my limited capability goes)

Would appreciate any information on this topic.

Thanks in advance,

jborean93 commented 4 years ago

Pywinrm does not use the NTLM library directly but instead uses requests-ntlm which handles all the calls to the underlying NTLM lib. Since the v1.0.0 release of requests-ntlm it has used ntlm-auth and has it set to use NTLMv2 if available. So basically if you have requests-ntlm 1.0.0 or newer you are using NTLMv2.