byt3bl33d3r / CrackMapExec

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

unable to run crackmapexec on kali 2023.2 #807

Open V3N0M3X111 opened 10 months ago

V3N0M3X111 commented 10 months ago

Hello team, when I try to run crackmapexec I get the following lines, I have tried uninstalling it and reinstalling it and I get the same thing.

Any ideas or assistance would be greatly appreciated.


$ crackmapexec 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 117, in main args = gen_cli_args() ^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/cme/cli.py", line 76, in gen_cli_args protocol_object = p_loader.load_protocol(protocols[protocol]['path']) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/cme/loaders/protocol_loader.py", line 15, in load_protocol protocol = imp.load_source('protocol', protocol_path) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/imp.py", line 170, in load_source module = _exec(spec, sys.modules[name]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "", line 621, in _exec File "", line 940, in exec_module File "", line 241, in _call_with_frames_removed File "/usr/lib/python3/dist-packages/cme/protocols/rdp.py", line 11, in from aardwolf.commons.factory import RDPConnectionFactory File "/usr/lib/python3/dist-packages/aardwolf/commons/factory.py", line 7, in from asyauth.common.credentials import UniCredential File "/usr/lib/python3/dist-packages/asyauth/common/credentials/init.py", line 182, in from asyauth.common.credentials.kerberos import KerberosCredential File "/usr/lib/python3/dist-packages/asyauth/common/credentials/kerberos.py", line 9, in from minikerberos.common.creds import KerberosCredential as KCRED File "/usr/lib/python3/dist-packages/minikerberos/common/creds.py", line 21, in from oscrypto.asymmetric import rsa_pkcs1v15_sign, load_private_key File "/usr/lib/python3/dist-packages/oscrypto/asymmetric.py", line 19, in from ._asymmetric import _unwrap_private_key_info File "/usr/lib/python3/dist-packages/oscrypto/_asymmetric.py", line 27, in from .kdf import pbkdf1, pbkdf2, pkcs12_kdf File "/usr/lib/python3/dist-packages/oscrypto/kdf.py", line 9, in from .util import rand_bytes File "/usr/lib/python3/dist-packages/oscrypto/util.py", line 14, in from ._openssl.util import rand_bytes File "/usr/lib/python3/dist-packages/oscrypto/_openssl/util.py", line 6, in from ._libcrypto import libcrypto, libcrypto_version_info, handle_openssl_error File "/usr/lib/python3/dist-packages/oscrypto/_openssl/_libcrypto.py", line 9, in from ._libcrypto_cffi import ( File "/usr/lib/python3/dist-packages/oscrypto/_openssl/_libcrypto_cffi.py", line 44, in raise LibraryNotFoundError('Error detecting the version of libcrypto') oscrypto.errors.LibraryNotFoundError: Error detecting the version of libcrypto

suljov commented 10 months ago

got kinda the same. i havent made it work fully but if you uninstall it etc and then update and upgrade kali then install it using pipx it kinda works. i get massive error testing CME and while trying brute-force i get an massive error tho

suljov commented 10 months ago

to kinda naswer my other comment...

i maybe found a loop hole or a reason. test using another wordlist. rockyou is "UTF-8 text" but other wordlists are "ASCII text" and those will work.

but this dont fix the fact it cant read files that are "UTF-8 text", some people want/have to use the rockyou wordlist and cant do it right now

V3N0M3X111 commented 10 months ago

Thanks @suljov !! will give that a try.

github-don commented 10 months ago

Looks like it's a regex fail.

Temporary work around: Replace /usr/lib/python3/dist-packages/oscrypto/_openssl/_libcrypto_cffi.py with it's latest version: https://raw.githubusercontent.com/wbond/oscrypto/master/oscrypto/_openssl/_libcrypto_cffi.py

Note to the random reader, your affected path is more likely to be ~/.shiv/cme_<string>/site-packages/oscrypto/_openssl/_libcrypto_cffi.py

Someone else has been tracking this issue better than me: https://github.com/lefayjey/linWinPwn/issues/17