Missing winkerberos
crypt0rr opened this issue · comments
After installing on clean Kali installation (also plays part on macOS), the following module is missing.
bloodyAD -h
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/ldap3/protocol/sasl/kerberos.py", line 47, in <module>
import winkerberos
ModuleNotFoundError: No module named 'winkerberos'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/crypt0rr/.local/bin/bloodyAD", line 5, in <module>
from bloodyAD.main import main
File "/home/crypt0rr/.local/lib/python3.10/site-packages/bloodyAD/__init__.py", line 2, in <module>
from .config import Config, ConnectionHandler
File "/home/crypt0rr/.local/lib/python3.10/site-packages/bloodyAD/config.py", line 1, in <module>
from bloodyAD import patch
File "/home/crypt0rr/.local/lib/python3.10/site-packages/bloodyAD/patch.py", line 269, in <module>
from ldap3.protocol.sasl.kerberos import *
File "/usr/lib/python3/dist-packages/ldap3/protocol/sasl/kerberos.py", line 50, in <module>
raise LDAPPackageUnavailableError('package gssapi (or winkerberos) missing')
ldap3.core.exceptions.LDAPPackageUnavailableError: package gssapi (or winkerberos) missing
Installing winkerberos
from pypi will result in error (both OS).
python3 -m pip install winkerberos
Defaulting to user installation because normal site-packages is not writeable
Collecting winkerberos
Using cached winkerberos-0.9.0.zip (43 kB)
Preparing metadata (setup.py) ... done
Building wheels for collected packages: winkerberos
Building wheel for winkerberos (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [14 lines of output]
running bdist_wheel
running build
running build_ext
building 'winkerberos' extension
creating build
creating build/temp.linux-x86_64-3.10
creating build/temp.linux-x86_64-3.10/src
x86_64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.10 -c src/kerberos_sspi.c -o build/temp.linux-x86_64-3.10/src/kerberos_sspi.o
In file included from src/kerberos_sspi.c:17:
src/kerberos_sspi.h:21:10: fatal error: Windows.h: No such file or directory
21 | #include <Windows.h>
| ^~~~~~~~~~~
compilation terminated.
error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for winkerberos
Running setup.py clean for winkerberos
Failed to build winkerberos
Installing collected packages: winkerberos
Running setup.py install for winkerberos ... error
error: subprocess-exited-with-error
× Running setup.py install for winkerberos did not run successfully.
│ exit code: 1
╰─> [16 lines of output]
running install
/usr/lib/python3/dist-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
running build
running build_ext
building 'winkerberos' extension
creating build
creating build/temp.linux-x86_64-3.10
creating build/temp.linux-x86_64-3.10/src
x86_64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.10 -c src/kerberos_sspi.c -o build/temp.linux-x86_64-3.10/src/kerberos_sspi.o
In file included from src/kerberos_sspi.c:17:
src/kerberos_sspi.h:21:10: fatal error: Windows.h: No such file or directory
21 | #include <Windows.h>
| ^~~~~~~~~~~
compilation terminated.
error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure
× Encountered error while trying to install package.
╰─> winkerberos
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
Fixed by installing requests-kerberos
- python3 -m pip install requests-kerberos
Hello Bart, thanks to raise this issue! It's normally a ldap3 dependency but i didn't anticipate this side effect with my patching. Anyway I had to handle it because the error and the way to fix it can be non-intuitive for the user. See a0cfa21
I'm surprised that installing requests-kerberos fixed the issue for you because it doesn't seem to rely on gssapi or winkerberos. So the import issue should still be triggered I guess?
Btw winkerberos is for Windows environments, this is why you couldn't install it on Kali.