python error message

Hi Folks,

I’m using a fresh KALI installation. When I use commands like “ldapdomaindump” or “crackmapexec” I get errors like these:

Traceback (most recent call last):
File “src/gevent/greenlet.py”, line 766, in gevent._greenlet.Greenlet.run
File “/usr/lib/python3/dist-packages/cme/protocols/smb.py”, line 110, in init
connection.init(self, args, db, host)
File “/usr/lib/python3/dist-packages/cme/connection.py”, line 47, in init
self.proto_flow()
File “/usr/lib/python3/dist-packages/cme/connection.py”, line 82, in proto_flow
self.login()
File “/usr/lib/python3/dist-packages/cme/connection.py”, line 242, in login
if self.plaintext_login(self.domain, user, password): return True
File “/usr/lib/python3/dist-packages/cme/protocols/smb.py”, line 282, in plaintext_login
self.conn.login(username, password, domain)
File “/usr/lib/python3/dist-packages/impacket/smbconnection.py”, line 265, in login
return self._SMBConnection.login(user, password, domain, lmhash, nthash, ntlmFallback)
File “/usr/lib/python3/dist-packages/impacket/smb.py”, line 3385, in login
self.login_extended(user, password, domain, lmhash, nthash, use_ntlmv2 = True)
File “/usr/lib/python3/dist-packages/impacket/smb.py”, line 3293, in login_extended
type3, exportedSessionKey = ntlm.getNTLMSSPType3(auth, respToken[‘ResponseToken’], user, password, domain, lmhash, nthash, use_ntlmv2 = use_ntlmv2)
File “/usr/lib/python3/dist-packages/impacket/ntlm.py”, line 631, in getNTLMSSPType3
ntResponse, lmResponse, sessionBaseKey = computeResponse(ntlmChallenge[‘flags’], ntlmChallenge[‘challenge’],
File “/usr/lib/python3/dist-packages/impacket/ntlm.py”, line 39, in computeResponse
return computeResponseNTLMv2(flags, serverChallenge, clientChallenge, serverName, domain, user, password,
File “/usr/lib/python3/dist-packages/impacket/ntlm.py”, line 902, in computeResponseNTLMv2
responseKeyNT = NTOWFv2(user, password, domain, nthash)
File “/usr/lib/python3/dist-packages/impacket/ntlm.py”, line 891, in NTOWFv2
return hmac_md5(theHash, user.upper().encode(‘utf-16le’) + domain.encode(‘utf-16le’))
File “/usr/lib/python3/dist-packages/impacket/ntlm.py”, line 882, in hmac_md5
h = hmac.new(key)
File “/usr/lib/python3.8/hmac.py”, line 153, in new
return HMAC(key, msg, digestmod)
File “/usr/lib/python3.8/hmac.py”, line 51, in init
raise TypeError(“Missing required parameter ‘digestmod’.”)
TypeError: Missing required parameter ‘digestmod’.

Every time it has something to do with “parameter digestmod”.

I guess it goes into this direction : ValueError('`digestmod` is required.') in Pytthon3.8 · Issue #702 · fortra/impacket · GitHub

But I don’t know what to do, because I’m using a fresh and clean installation of Kali. I already tried things like “apt-get update / upgrade” + “pip3 install impact”. But nothing helped.

Any idea ?

Thanks in advance,
Raphael

Maybe you have to install impacket instead impact (or it’s a typo)?
pip3 install impacket

I had the same error from CME when i first installed it. I updated all Python packages using pip3 install -U and that got it running

The below seemed to fix it -

pip3 list --outdated --format=freeze | grep -v ‘^-e’ | cut -d = -f 1 | xargs -n1 pip3 install -U

Type your comment> @greyhatyosh said:

I had the same error from CME when i first installed it. I updated all Python packages using pip3 install -U and that got it running

The below seemed to fix it -

pip3 list --outdated --format=freeze | grep -v ‘^-e’ | cut -d = -f 1 | xargs -n1 pip3 install -U

Thank you greyhatyosh, this worked perfectly. How did you come up with this long command?

working for me too. Thank a lot @greyhatyosh

If you tried the appeal method and still failed, I suggest you use the same method as mine

Download CrackMapExec/requirements.txt at master · Porchetta-Industries/CrackMapExec · GitHub

Then install with pip3

do what > @backK said:

If you tried the appeal method and still failed, I suggest you use the same method as mine

Download https://github.com/byt3bl33d3r/CrackMapExec/blob/master/requirements.txt

Then install with pip3

If you guys getting the same error even after doing this ! Its the issue with impacket. Make sure you have the latest and try this command it worked for me :smiley:

pip3 install impacket --upgrade --user

Reference : Missing required parameter 'digestmod' · Issue #380 · byt3bl33d3r/CrackMapExec · GitHub

This was a pain in the ■■■. One of the above steps worked. I did @greyhatyosh steps (thank you!) and also did an impacket update. I would just like to add - make sure you reboot your machine after installing everything.

I had the same problem, thanks to @greyhatyosh’s tips it was solved.
Thanks a lot @greyhatyosh.

I experience the same but tips doesn’t work properly. What I found out is after run this I had crackmapexec 5.0.2 but the last binary is 5.1.1. so, I download the binary and it works fine.

Tips to Fix Runtime Errors in Python
Identify the error message and note the specific problem being reported.
Check the code for logical, mathematical or typographical errors.
Ensure all identifiers are defined properly before being used.
Make sure the correct data types are being used and are being used correctly.

Regards,
Rachel Gomez