Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kali Linux error LibraryNotFoundError: Error detecting the version of libcrypto #136

Closed
chikamobina opened this issue Nov 4, 2023 · 10 comments

Comments

@chikamobina
Copy link

└─$ pypykatz
Traceback (most recent call last):
File "/usr/local/bin/pypykatz", line 33, in
sys.exit(load_entry_point('pypykatz==0.6.9', 'console_scripts', 'pypykatz')())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/pypykatz-0.6.9-py3.11.egg/pypykatz/main.py", line 17, in main
File "/usr/local/lib/python3.11/dist-packages/pypykatz-0.6.9-py3.11.egg/pypykatz/kerberos/cmdhelper.py", line 19, in
File "/usr/local/lib/python3.11/dist-packages/pypykatz-0.6.9-py3.11.egg/pypykatz/kerberos/kerberos.py", line 7, in
File "/home/kali/.local/lib/python3.11/site-packages/minikerberos/security.py", line 11, in
from minikerberos.aioclient import AIOKerberosClient
File "/home/kali/.local/lib/python3.11/site-packages/minikerberos/aioclient.py", line 31, in
from minikerberos.common.creds import KerberosCredential
File "/home/kali/.local/lib/python3.11/site-packages/minikerberos/common/creds.py", line 24, in
from oscrypto.asymmetric import rsa_pkcs1v15_sign, load_private_key
File "/usr/local/lib/python3.11/dist-packages/oscrypto-1.3.0-py3.11.egg/oscrypto/asymmetric.py", line 19, in
from ._asymmetric import _unwrap_private_key_info
File "/usr/local/lib/python3.11/dist-packages/oscrypto-1.3.0-py3.11.egg/oscrypto/_asymmetric.py", line 27, in
from .kdf import pbkdf1, pbkdf2, pkcs12_kdf
File "/usr/local/lib/python3.11/dist-packages/oscrypto-1.3.0-py3.11.egg/oscrypto/kdf.py", line 9, in
from .util import rand_bytes
File "/usr/local/lib/python3.11/dist-packages/oscrypto-1.3.0-py3.11.egg/oscrypto/util.py", line 14, in
from ._openssl.util import rand_bytes
File "/usr/local/lib/python3.11/dist-packages/oscrypto-1.3.0-py3.11.egg/oscrypto/_openssl/util.py", line 6, in
from ._libcrypto import libcrypto, libcrypto_version_info, handle_openssl_error
File "/usr/local/lib/python3.11/dist-packages/oscrypto-1.3.0-py3.11.egg/oscrypto/_openssl/_libcrypto.py", line 9, in
from ._libcrypto_cffi import (
File "/usr/local/lib/python3.11/dist-packages/oscrypto-1.3.0-py3.11.egg/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

What doesn’t work for me is the version installed via apt, not the version installed via pip, nothing at all. Please help me solve this problem.

@skelsec
Copy link
Owner

skelsec commented Nov 4, 2023

The issue you're seeing is that oscrypto has some weird error on Kali. To fix it you can update oscrypto by downloading it from github here and install it.

@chikamobina
Copy link
Author

Installed it, now it gives this error. I installed all the dependencies.

Traceback (most recent call last):
File "/usr/local/bin/pypykatz", line 33, in
sys.exit(load_entry_point('pypykatz==0.6.9', 'console_scripts', 'pypykatz')())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/pypykatz-0.6.9-py3.11.egg/pypykatz/main.py", line 17, in main
File "/usr/local/lib/python3.11/dist-packages/pypykatz-0.6.9-py3.11.egg/pypykatz/kerberos/cmdhelper.py", line 19, in
File "/usr/local/lib/python3.11/dist-packages/pypykatz-0.6.9-py3.11.egg/pypykatz/kerberos/kerberos.py", line 7, in
ImportError: cannot import name 'krb5userenum' from 'minikerberos.security' (/home/kali/.local/lib/python3.11/site-packages/minikerberos/security.py)

@chikamobina
Copy link
Author

Can you please tell me? How to solve this now? Thanks a lot

@chikamobina
Copy link
Author

It seems to me that everyone who uses Kali is now faced with this, because all my friends have the same thing. Same errors

@chikamobina
Copy link
Author

#117 If this doesn't help, I tried setting 0.3.5

@iozicbeb
Copy link

This worked for me, first uninstall: python -m pip uninstall oscrypto -y, then install this version: python -m pip install --force-reinstall https://github.com/wbond/oscrypto/archive/d5f3437ed24257895ae1edd9e503cfb352e635a8.zip

@chikamobina
Copy link
Author

This worked for me, first uninstall: python -m pip uninstall oscrypto -y, then install this version: python -m pip install --force-reinstall https://github.com/wbond/oscrypto/archive/d5f3437ed24257895ae1edd9e503cfb352e635a8.zip

Traceback (most recent call last):
File "/usr/local/bin/pypykatz", line 33, in
sys.exit(load_entry_point('pypykatz==0.6.9', 'console_scripts', 'pypykatz')())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/pypykatz-0.6.9-py3.11.egg/pypykatz/main.py", line 17, in main
File "/usr/local/lib/python3.11/dist-packages/pypykatz-0.6.9-py3.11.egg/pypykatz/kerberos/cmdhelper.py", line 19, in
File "/usr/local/lib/python3.11/dist-packages/pypykatz-0.6.9-py3.11.egg/pypykatz/kerberos/kerberos.py", line 7, in
ImportError: cannot import name 'krb5userenum' from 'minikerberos.security' (/home/kali/.local/lib/python3.11/site-packages/minikerberos/security.py)

@chikamobina
Copy link
Author

I fixed it, for some reason I had 2 versions of minikerberos. I installed the latest one and removed the old one.

@S-071
Copy link

S-071 commented Nov 29, 2023

This issue should probably be reopened since it still exists in the currently released version of oscrypto (1.3.0): wbond/oscrypto#78

This will continue to break pypykatz installs relying on the oscrypto pypi package for anyone using an openssl version where the major/minor/patch versions contain multiple digits, such as 3.0.10. There is currently no estimate for when this will be fixed upstream.

@AdrianVollmer
Copy link
Contributor

AdrianVollmer commented Dec 5, 2023

This is an issue of the minikerberos dependency, also from @skelsec. The oscrypto maintainer is dragging his feet a bit (completely understandable for a hobby project), but would it be feasible to switch to the better maintained cryptography package? Note that this is already a dependency of 2nd degree because of asysocks, so it would be quite elegant to get rid of oscrypto. Lots of packages are depending on minikerberos which are now effectively broken.

It would already help if the oscrypt imports would be moved to the function where they are needed so that downstream projects who don't need the PKINIT object won't be affected by this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants