BloodHoundAD / BloodHound

Six Degrees of Domain Admin
GNU General Public License v3.0
9.8k stars 1.73k forks source link

MD4 not supported in Bloodhound-python #627

Closed bushdav closed 1 year ago

bushdav commented 1 year ago

Hi,

MD4 within hashlib is no longer supported and some and below error is being thrown while running bloodhound python

My Environment : Kali 2022.2 Bloodhound version 4.2.0

Error Message

Traceback (most recent call last): File "/usr/lib/python3/dist-packages/ldap3/utils/ntlm.py", line 497, in ntowf_v2 password_digest = hashlib.new('MD4', self._password.encode('utf-16-le')).digest() File "/usr/lib/python3.10/hashlib.py", line 166, in __hash_new return get_builtin_constructor(name)(data) File "/usr/lib/python3.10/hashlib.py", line 123, in get_builtin_constructor raise ValueError('unsupported hash type ' + name) ValueError: unsupported hash type MD4

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/local/bin/bloodhound-python", line 33, in sys.exit(load_entry_point('bloodhound==1.5.0', 'console_scripts', 'bloodhound-python')()) File "/usr/local/lib/python3.10/dist-packages/bloodhound/init.py", line 310, in main bloodhound.run(collect=collect, File "/usr/local/lib/python3.10/dist-packages/bloodhound/init.py", line 79, in run self.pdc.prefetch_info('objectprops' in collect, 'acl' in collect, cache_computers=do_computer_enum) File "/usr/local/lib/python3.10/dist-packages/bloodhound/ad/domain.py", line 468, in prefetch_info self.get_objecttype() File "/usr/local/lib/python3.10/dist-packages/bloodhound/ad/domain.py", line 238, in get_objecttype self.ldap_connect() File "/usr/local/lib/python3.10/dist-packages/bloodhound/ad/domain.py", line 70, in ldap_connect ldap = self.ad.auth.getLDAPConnection(hostname=ip, File "/usr/local/lib/python3.10/dist-packages/bloodhound/ad/authentication.py", line 78, in getLDAPConnection if not conn.bind(): File "/usr/lib/python3/dist-packages/ldap3/core/connection.py", line 621, in bind response = self.do_ntlm_bind(controls) File "/usr/lib/python3/dist-packages/ldap3/core/connection.py", line 1388, in do_ntlm_bind request = bind_operation(self.version, 'SICILY_RESPONSE_NTLM', ntlm_client, File "/usr/lib/python3/dist-packages/ldap3/operation/bind.py", line 81, in bind_operation server_creds = name.create_authenticate_message() File "/usr/lib/python3/dist-packages/ldap3/utils/ntlm.py", line 379, in create_authenticate_message nt_challenge_response = self.compute_nt_response() File "/usr/lib/python3/dist-packages/ldap3/utils/ntlm.py", line 485, in compute_nt_response response_key_nt = self.ntowf_v2() File "/usr/lib/python3/dist-packages/ldap3/utils/ntlm.py", line 501, in ntowf_v2 password_digest = MD4.new(self._password.encode('utf-16-le')).digest() File "/usr/local/lib/python3.10/dist-packages/Crypto/Hash/MD4.py", line 84, in new return MD4Hash().new(data) File "/usr/local/lib/python3.10/dist-packages/Crypto/Hash/MD4.py", line 71, in new return MD4Hash(data) File "/usr/local/lib/python3.10/dist-packages/Crypto/Hash/MD4.py", line 68, in init HashAlgo.init(self, hashFactory, data) File "/usr/local/lib/python3.10/dist-packages/Crypto/Hash/hashalgo.py", line 51, in init self.update(data) File "/usr/local/lib/python3.10/dist-packages/Crypto/Hash/hashalgo.py", line 69, in update return self._hash.update(data) SystemError: PY_SSIZE_T_CLEAN macro must be defined for '#' formats

JonasBK commented 1 year ago

Hi!

Bloodhound.py is not developed and maintained by us. You should report the bug here instead: https://github.com/fox-it/BloodHound.py