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

[-] Got error: module 'enum' has no attribute '_decompose' #163

Closed
cpt-kernel opened this issue Aug 15, 2023 · 7 comments
Closed

[-] Got error: module 'enum' has no attribute '_decompose' #163

cpt-kernel opened this issue Aug 15, 2023 · 7 comments

Comments

@cpt-kernel
Copy link

I have installed from source in a virtual environment, however on a Mac I cannot get the program to run unless I use -stdout.

Seems to be a package issue with enum.py and find.py.
Any advice is appreciated.

Traceback (most recent call last):
File "/opt/homebrew/lib/python3.11/site-packages/certipy/commands/find.py", line 782, in security_to_bloodhound_aces
standard_rights = list(rights["rights"])
^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/python@3.11/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/enum.py", line 1482, in iter
yield from self.iter_member(self.value)
File "/opt/homebrew/Cellar/python@3.11/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/enum.py", line 1369, in iter_member_by_def
yield from sorted(
^^^^^^^
File "/opt/homebrew/Cellar/python@3.11/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/enum.py", line 1371, in
key=lambda m: m.sort_order,
^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'sort_order'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/opt/homebrew/lib/python3.11/site-packages/certipy/entry.py", line 60, in main
actionsoptions.action
File "/opt/homebrew/lib/python3.11/site-packages/certipy/commands/parsers/find.py", line 12, in entry
find.entry(options)
File "/opt/homebrew/lib/python3.11/site-packages/certipy/commands/find.py", line 1185, in entry
find.find()
File "/opt/homebrew/lib/python3.11/site-packages/certipy/commands/find.py", line 455, in find
self.output_bloodhound_data(prefix, templates, cas)
File "/opt/homebrew/lib/python3.11/site-packages/certipy/commands/find.py", line 578, in output_bloodhound_data
aces = self.security_to_bloodhound_aces(security)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/certipy/commands/find.py", line 784, in security_to_bloodhound_aces
standard_rights = rights["rights"].to_list()
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/certipy/lib/constants.py", line 265, in to_list
members, _ = enum._decompose(cls, self.value)
^^^^^^^^^^^^^^^
AttributeError: module 'enum' has no attribute '_decompose'

@cpt-kernel
Copy link
Author

This is probably an issue of not understanding venv well.

  1. python3 -m venv tool_venv

  2. source tool_venv/bin/activate
  3. python3 setup.py
  4. tool.py

Errors… traceback /path/to/system/package.py

I expect this to install requirements inside of the venv but it appears to call the incompatible(?) system packages.

@sm00v
Copy link

sm00v commented Aug 15, 2023

Same problem today.

@dev-0x0
Copy link

dev-0x0 commented Aug 22, 2023

I'm having the same issue as the OP, but on kali linux. Used venv, and cloned the newest certipy version. Also found that some commands work only with -stdout (such as 'find'). But for others I get the "module 'enum' has no attribute '_decompose'" error

@badLlama121
Copy link

Same issue today using the certipy-ad package in Kali

@hasr00t
Copy link

hasr00t commented Aug 22, 2023

Same issue with certipy-ad AND installing in a venv with the setup.py on multiple kali/parrot VMs.

@4Kp3n
Copy link

4Kp3n commented Aug 31, 2023

The issue persists making certipy unusable on a fresh Kali installation (properly using a venv).

I tried to locate the error by searching for the offending enum package

❯ pwd
/home/kali/Tools/Certipy

❯ echo $VIRTUAL_ENV
/home/kali/Tools/Certipy/venv

❯ find . -name enum.py
./venv/lib/python3.11/site-packages/dns/enum.py
./venv/lib/python3.11/site-packages/impacket/examples/ntlmrelayx/utils/enum.py
./venv/lib/python3.11/site-packages/impacket/dcerpc/v5/enum.py

I installed older versions for the impacket and dnspython modules but the issue persists.

Did somebody already identified the root cause of this and found a fix or workaround?

@ly4k
Copy link
Owner

ly4k commented Sep 1, 2023

Fixed in version 4.8.0. Upgrade with pip3 install -U certipy-ad

@ly4k ly4k closed this as completed Sep 1, 2023
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

7 participants