byt3bl33d3r / CrackMapExec

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

crackmapexec throws a long list of errors #356

Closed init5-SF closed 4 years ago

init5-SF commented 4 years ago

Describe the bug crackmapexec throws a long list of errors, this behavior started all of a sudden without changing anything in the system If there is any missing or corrupted packages that I can replace/upgrade kindly let me know, it will be greatly apprecdiated.

To Reproduce just use crackmap exec (with a correct or a wrong password) against any host

Screenshots

root@kali:~/Desktop/CTF/offshore# crackmapexec smb 192.168.1.102 -u administrator-p Passw0rd
SMB         192.168.1.102   445    FSOCIETY         [*] Windows 10.0 Build 18362 x64 (name:FSOCIETY) (domain:FSOCIETY) (signing:False) (SMBv1:False)
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 42, in __init__
    self.proto_flow()
  File "/usr/lib/python3/dist-packages/cme/connection.py", line 74, in proto_flow
    self.login()
  File "/usr/lib/python3/dist-packages/cme/connection.py", line 215, in login
    if self.plaintext_login(self.domain, user, password): return True
  File "/usr/lib/python3/dist-packages/cme/protocols/smb.py", line 250, in plaintext_login
    self.conn.login(username, password, domain)
  File "/usr/lib/python3/dist-packages/impacket/smbconnection.py", line 267, in login
    return self._SMBConnection.login(user, password, domain, lmhash, nthash)
  File "/usr/lib/python3/dist-packages/impacket/smb3.py", line 778, in login
    type3, exportedSessionKey = ntlm.getNTLMSSPType3(auth, respToken['ResponseToken'], user, password, domain, lmhash, nthash)
  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-04-29T19:30:17Z <Greenlet at 0x7f9efb2e1bf0: smb(Namespace(clear_obfscripts=False, content=False, c, <protocol.database object at 0x7f9efb240c40>, '192.168.1.102')> failed with TypeError

Crackmapexec info

mpgn commented 4 years ago

Probably duplicate of #355

If not, re-open the issue with more details, is this crackmapexec from apt or from this repo ?

init5-SF commented 4 years ago

Hi, this is from apt. I've uninstalled and reinstalled CME and still getting the same error. CME versions is 5.0.1dev

AnonymousRonin commented 9 months ago

Three years later. If anyone has a solution I'd be all ears. Apt install initially. Then went through the pipx install to see if it would help, it didn't. Installed cme, no help.

--- Logging Traceback (most recent call last): File "/usr/bin/crackmapexec", line 8, in sys.exit(main()) ^^^^^^ File "/usr/lib/python3/dist-packages/cme/crackmapexec.py", line 257, in main asyncio.run( File "/usr/lib/python3.11/asyncio/runners.py", line 190, in run return runner.run(main) ^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/asyncio/runners.py", line 118, in run return self._loop.run_until_complete(task) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete return future.result() ^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/cme/crackmapexec.py", line 105, in start_threadpool await asyncio.gather(jobs) File "/usr/lib/python3/dist-packages/cme/crackmapexec.py", line 69, in run_protocol await asyncio.wait_for( File "/usr/lib/python3.11/asyncio/tasks.py", line 452, in wait_for return await fut ^^^^^^^^^ File "/usr/lib/python3.11/concurrent/futures/thread.py", line 58, in run result = self.fn(self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/cme/connection.py", line 65, in init self.proto_flow() File "/usr/lib/python3/dist-packages/cme/protocols/ftp.py", line 37, in proto_flow if self.login(): ^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/cme/connection.py", line 287, in login for f_pass in password_file: File "", line 322, in decode UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf1 in position 933: invalid continuation byte

AnonymousRonin commented 9 months ago

Forgot, here was the CL entry.

crackmapexec ftp ..*. -u anonymous -p /usr/share/wordlists/rockyou.txt