byt3bl33d3r / CrackMapExec

A swiss army knife for pentesting networks
BSD 2-Clause "Simplified" License
8.45k stars 1.64k forks source link

TypeError: Missing required parameter 'digestmod'. #386

Closed am-root closed 4 years ago

am-root commented 4 years ago

Describe the bug

  1. Crackmapexec comes preinstalled in ParrotOS just like Kali. When I was using it for learning it gave me this error I thought its my Parrot OS since I did a lot of tinkering in it .
  2. So I cloned the repo and installed it accordingly every steps written in Installation page. Still same error.
  3. Then I did fresh Installation of Parrot OS. Did not change anything in OS configurations. Still same error.

To Reproduce Steps to reproduce the behavior:

  1. I did exactly every step written on installation page
  2. Preinstalled with Parrot OS

Crackmapexec info

Additional context Python Version Python 3.8.3 pip3 version pip 20.1.1 from /usr/local/lib/python3.8/dist-packages/pip (python 3.8)

ERROR Command I typed crackmapexec --verbose smb 10.10.10.169 -u users -p 'Welcome123!' ErrorOutput DEBUG Passed args: {'aesKey': False, 'clear_obfscripts': False, 'content': False, 'continue_on_success': False, 'cred_id': [], 'darrell': False, 'depth': None, 'disks': False, 'domain': None, 'exclude_dirs': '', 'exec_method': None, 'execute': None, 'fail_limit': None, 'force_ps32': False, 'gen_relay_list': None, 'get_file': None, 'gfail_limit': None, 'groups': None, 'hash': [], 'jitter': None, 'kdcHost': False, 'kerberos': False, 'list_modules': False, 'local_auth': False, 'local_groups': None, 'loggedon_users': False, 'lsa': False, 'module': None, 'module_options': [], 'no_bruteforce': False, 'no_output': False, 'ntds': None, 'obfs': False, 'only_files': False, 'pass_pol': False, 'password': ['Welcome123!'], 'pattern': None, 'port': 445, 'protocol': 'smb', 'ps_execute': None, 'put_file': None, 'regex': None, 'rid_brute': None, 'sam': False, 'server': 'https', 'server_host': '0.0.0.0', 'server_port': None, 'sessions': False, 'share': 'C$', 'shares': False, 'show_module_options': False, 'spider': None, 'spider_folder': '.', 'target': ['10.10.10.169'], 'threads': 100, 'timeout': None, 'ufail_limit': None, 'username': ['users'], 'users': None, 'verbose': True, 'wmi': None, 'wmi_namespace': 'root\cimv2'} DEBUG Error retrieving os arch of 10.10.10.169: 'smb' object has no attribute '_conn' SMB 10.10.10.169 445 RESOLUTE [*] (name:RESOLUTE) (domain:megabank.local) (signing:True) (SMBv1:True) 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'. 2020-06-02T06:44:43Z <Greenlet at 0x7f9a875a66a0: smb(Namespace(aesKey=False, clear_obfscripts=False, co, <protocol.database object at 0x7f9a8755ae20>, '10.10.10.169')> failed with TypeError

Hackndo commented 4 years ago

Same issue with python3.8. Works fine with python3.7, for information :) Python3.8 asks for explicit digestmod, but impacket doesn't always provide it. I guess that's an impacket issue, more than CME.

Hackndo commented 4 years ago

Seems fixed in impacket https://github.com/SecureAuthCorp/impacket/pull/711 So maybe your impacket version is out of date (?)

mpgn commented 4 years ago

Duplicate of #380

https://github.com/byt3bl33d3r/CrackMapExec/issues/380#issuecomment-626173555

am-root commented 4 years ago

Duplicate of #380

#380 (comment)

Worked like charm!!! Thanks !!

am-root commented 4 years ago

Seems fixed in impacket SecureAuthCorp/impacket#711 So maybe your impacket version is out of date (?)

pip3 install impacket --upgrade --user just typing above command in terminal works ! It worked for me !