Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not support special characters in passwords #21

Open
h4knet opened this issue Sep 3, 2019 · 3 comments
Open

Do not support special characters in passwords #21

h4knet opened this issue Sep 3, 2019 · 3 comments

Comments

@h4knet
Copy link

h4knet commented Sep 3, 2019

Hello,
When using a password containing a special character like 'à é ù' throw the following error :

[*] Connecting to host...
[*] Binding to host
Traceback (most recent call last):
  File "/usr/local/bin/ldapdomaindump", line 3, in <module>
    ldapdomaindump.main()
  File "/usr/local/lib/python2.7/dist-packages/ldapdomaindump/__init__.py", line 885, in main
    if not c.bind():
  File "/usr/local/lib/python2.7/dist-packages/ldap3/core/connection.py", line 569, in bind
    response = self.do_ntlm_bind(controls)
  File "/usr/local/lib/python2.7/dist-packages/ldap3/core/connection.py", line 1313, in do_ntlm_bind
    result['server_creds'])
  File "/usr/local/lib/python2.7/dist-packages/ldap3/operation/bind.py", line 81, in bind_operation
    server_creds = name.create_authenticate_message()
  File "/usr/local/lib/python2.7/dist-packages/ldap3/utils/ntlm.py", line 379, in create_authenticate_message
    nt_challenge_response = self.compute_nt_response()
  File "/usr/local/lib/python2.7/dist-packages/ldap3/utils/ntlm.py", line 485, in compute_nt_response
    response_key_nt = self.ntowf_v2()
  File "/usr/local/lib/python2.7/dist-packages/ldap3/utils/ntlm.py", line 496, in ntowf_v2
    password_digest = hashlib.new('MD4', self._password.encode('utf-16-le')).digest()
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 0: ordinal not in range(128)

Command used : ldapdomaindump -u "frenchcompany\administrateur" -p "çékàcèheù" -o ldap-dump 192.168.1.1

I was able to get around this by generating and using the hash in the mean time.

@dirkjanm
Copy link
Owner

dirkjanm commented Sep 3, 2019

Thanks for the report, I'll see if I can fix this or if this needs to be fixed upstream in the ldap3 library since the exception triggers there.

@h4knet
Copy link
Author

h4knet commented Sep 3, 2019

Thanks to you for providing this tool !

@zflemingg1
Copy link

I'm having similar issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants