lefayjey / linWinPwn

linWinPwn is a bash script that streamlines the use of a number of Active Directory tools
MIT License
1.8k stars 264 forks source link

installation script messes up crackmapexec (oscrypto.errors.LibraryNotFoundError: Error detecting the version of libcrypto) #17

Closed ernestang98 closed 11 months ago

ernestang98 commented 1 year ago

When I ran ./install.sh, it overrides the existing installation of cme and results in the following error:

Traceback (most recent call last):
  File "/usr/bin/crackmapexec", line 8, in <module>
    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 "<frozen importlib._bootstrap>", line 621, in _exec
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/usr/lib/python3/dist-packages/cme/protocols/rdp.py", line 11, in <module>
    from aardwolf.commons.factory import RDPConnectionFactory
  File "/usr/lib/python3/dist-packages/aardwolf/commons/factory.py", line 7, in <module>
    from asyauth.common.credentials import UniCredential
  File "/usr/lib/python3/dist-packages/asyauth/common/credentials/__init__.py", line 182, in <module>
    from asyauth.common.credentials.kerberos import KerberosCredential
  File "/usr/lib/python3/dist-packages/asyauth/common/credentials/kerberos.py", line 9, in <module>
    from minikerberos.common.creds import KerberosCredential as KCRED
  File "/usr/lib/python3/dist-packages/minikerberos/common/creds.py", line 21, in <module>
    from oscrypto.asymmetric import rsa_pkcs1v15_sign, load_private_key
  File "/home/kali/.local/lib/python3.11/site-packages/oscrypto/asymmetric.py", line 19, in <module>
    from ._asymmetric import _unwrap_private_key_info
  File "/home/kali/.local/lib/python3.11/site-packages/oscrypto/_asymmetric.py", line 27, in <module>
    from .kdf import pbkdf1, pbkdf2, pkcs12_kdf
  File "/home/kali/.local/lib/python3.11/site-packages/oscrypto/kdf.py", line 9, in <module>
    from .util import rand_bytes
  File "/home/kali/.local/lib/python3.11/site-packages/oscrypto/util.py", line 14, in <module>
    from ._openssl.util import rand_bytes
  File "/home/kali/.local/lib/python3.11/site-packages/oscrypto/_openssl/util.py", line 6, in <module>
    from ._libcrypto import libcrypto, libcrypto_version_info, handle_openssl_error
  File "/home/kali/.local/lib/python3.11/site-packages/oscrypto/_openssl/_libcrypto.py", line 9, in <module>
    from ._libcrypto_cffi import (
  File "/home/kali/.local/lib/python3.11/site-packages/oscrypto/_openssl/_libcrypto_cffi.py", line 46, in <module>
    raise LibraryNotFoundError('Error detecting the version of libcrypto')
oscrypto.errors.LibraryNotFoundError: Error detecting the version of libcrypto

I suggest removing the line pipx install git+https://github.com/mpgn/CrackMapExec.git --force

Relevant Links:

https://github.com/dbt-labs/dbt-core/issues/3366

https://github.com/wbond/oscrypto/issues/78

https://github.com/mpgn/CrackMapExec/issues/108

https://github.com/wbond/oscrypto/issues/78

lefayjey commented 1 year ago

Thanks for you comment. I would suggest uninstalling the existing installation of cme, since it does not have the --log option. For that, the installation of the latest crackmapexec is needed to use the linWinPwn tool.

lefayjey commented 11 months ago

As crackmapexec has been replaced with NetExec, I will close this issue.