byt3bl33d3r / CrackMapExec

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

Cant get cme running. Fresh install. #373

Closed jane-92 closed 4 years ago

jane-92 commented 4 years ago

Hello!

I'm new in pentesting. Setup a lab: DC Windows 2019, 2 Windows 10 (Defender disabled). Trying to get running cme. No luck.

OS: Kali CME Version 5.0.1dev Fresh install using latest release

  1. Runs OK

root@kali:/opt/CrackMapExec# crackmapexec smb 192.168.157.133 SMB 192.168.157.133 445 W10WKS02 [*] Windows 10.0 Build 18362 x64 (name:W10WKS02) (domain:CTRU) (signing:False) (SMBv1:False)

  1. Then run this command and get nothing but...

root@kali:/opt/CrackMapExec# crackmapexec smb 192.168.157.133 -u pparker -p Password2 --shares SMB 192.168.157.133 445 W10WKS02 [*] Windows 10.0 Build 18362 x64 (name:W10WKS02) (domain:CTRU) (signing:False) (SMBv1:False) Traceback (most recent call last): File "src/gevent/greenlet.py", line 766, in gevent._greenlet.Greenlet.run File "/usr/local/lib/python3.8/dist-packages/crackmapexec-5.0.1.dev0-py3.8.egg/cme/protocols/smb.py", line 110, in init connection.init(self, args, db, host) File "/usr/local/lib/python3.8/dist-packages/crackmapexec-5.0.1.dev0-py3.8.egg/cme/connection.py", line 42, in init self.proto_flow() File "/usr/local/lib/python3.8/dist-packages/crackmapexec-5.0.1.dev0-py3.8.egg/cme/connection.py", line 74, in proto_flow self.login() File "/usr/local/lib/python3.8/dist-packages/crackmapexec-5.0.1.dev0-py3.8.egg/cme/connection.py", line 215, in login if self.plaintext_login(self.domain, user, password): return True File "/usr/local/lib/python3.8/dist-packages/crackmapexec-5.0.1.dev0-py3.8.egg/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-05-05T15:08:21Z <Greenlet at 0x7f468b67e6a0: smb(Namespace(clear_obfscripts=False, content=False, c, <protocol.database object at 0x7f468b69e790>, '192.168.157.133')> failed with TypeError

mpgn commented 4 years ago

Hello, I guess it Crackmapexec from apt, try with this one

https://github.com/byt3bl33d3r/CrackMapExec/releases/tag/v5.0.1dev

jane-92 commented 4 years ago

removed package. Installed
Now it's not even starting

root@kali:~# cme Traceback (most recent call last): File "/usr/local/bin/cme", line 11, in load_entry_point('crackmapexec==5.0.1.dev0', 'console_scripts', 'cme')() File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 490, in load_entry_point return get_distribution(dist).load_entry_point(group, name) File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 2859, in load_entry_point return ep.load() File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 2450, in load return self.resolve() File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 2456, in resolve module = import(self.module_name, fromlist=['name'], level=0) File "/usr/local/lib/python3.8/dist-packages/crackmapexec-5.0.1.dev0-py3.8.egg/cme/init.py", line 10, in for module in os.listdir(thirdparty_modules): FileNotFoundError: [Errno 2] No such file or directory: '/usr/local/lib/python3.8/dist-packages/crackmapexec-5.0.1.dev0-py3.8.egg/cme/thirdparty'

jane-92 commented 4 years ago

How do I completely remove it and then install fresh?

mpgn commented 4 years ago

Again, use the binary https://github.com/byt3bl33d3r/CrackMapExec/releases/tag/v5.0.1dev

jane-92 commented 4 years ago

I might be doing something wrong or missing something. I downloaded Source code (zip). Extracted. Navigated to CrackMapExec-5.0.1dev. Ran python3 setup.py install Then I got the error above Should I download any other archives?

mpgn commented 4 years ago

You can also get a compiled cme from this link https://github.com/byt3bl33d3r/CrackMapExec/releases/download/v5.0.1dev/cme-ubuntu-latest.zip

grayghost3425 commented 4 years ago

I am also having this same issue. I have uninstall and reinstall multiple times, built it from source, and downloaded and ran the complied code from the link you provided above.

running on: 5.5.0-kali2-amd64

If I run just this....cme smb ip I get this...... SMB ip 445 hostname [*] Windows 10.0 Build 18362 (name:hostname) (domain:domainname.local) (signing:False) (SMBv1:False)

BUT, if I run this.....cme smb -u username -p 'password' -d domain (or any flag after the IP address) I get this.... Traceback (most recent call last): File "src/gevent/greenlet.py", line 766, in gevent._greenlet.Greenlet.run File "/usr/local/lib/python3.8/dist-packages/crackmapexec-5.0.2.dev0-py3.8.egg/cme/protocols/smb.py", line 110, in init connection.init(self, args, db, host) File "/usr/local/lib/python3.8/dist-packages/crackmapexec-5.0.2.dev0-py3.8.egg/cme/connection.py", line 47, in init self.proto_flow() File "/usr/local/lib/python3.8/dist-packages/crackmapexec-5.0.2.dev0-py3.8.egg/cme/connection.py", line 82, in proto_flow self.login() File "/usr/local/lib/python3.8/dist-packages/crackmapexec-5.0.2.dev0-py3.8.egg/cme/connection.py", line 242, in login if self.plaintext_login(self.domain, user, password): return True File "/usr/local/lib/python3.8/dist-packages/crackmapexec-5.0.2.dev0-py3.8.egg/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 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-05-07T18:45:24Z <Greenlet at 0x7f0bd0906e10: smb(Namespace(aesKey=False, clear_obfscripts=False, co, <protocol.database object at 0x7f0bd087d6a0>, 'ip')> failed with TypeError

mpgn commented 4 years ago

This issue comes from Impacket, update Impacket to version 0.21

pip3 install impacket --upgrade --user