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

AttributeError: module 'enum' has no attribute '_decompose' #134

Closed
jakefromiowa opened this issue Mar 21, 2023 · 5 comments
Closed

AttributeError: module 'enum' has no attribute '_decompose' #134

jakefromiowa opened this issue Mar 21, 2023 · 5 comments

Comments

@jakefromiowa
Copy link

jakefromiowa commented Mar 21, 2023

First time running into this issue, but no luck trying to figure out why a fresh install (using apt or pip) will not work.

Spits out the error:
[-] Got error: module 'enum' has no attribute '_decompose'
Traceback (most recent call last):
File "/usr/local/lib/python3.11/dist-packages/certipy/entry.py", line 60, in main
actionsoptions.action
File "/usr/local/lib/python3.11/dist-packages/certipy/commands/parsers/find.py", line 12, in entry
find.entry(options)
File "/usr/local/lib/python3.11/dist-packages/certipy/commands/find.py", line 1181, in entry
find.find()
File "/usr/local/lib/python3.11/dist-packages/certipy/commands/find.py", line 346, in find
template.set("certificate_name_flag", certificate_name_flag.to_str_list())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/certipy/lib/structs.py", line 16, in to_str_list
return list(map(lambda x: str(x), self.to_list()))
^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/certipy/lib/structs.py", line 12, in to_list
members, _ = enum._decompose(cls, self.value)
^^^^^^^^^^^^^^^
AttributeError: module 'enum' has no attribute '_decompose'

@exploide
Copy link

Duplicate of #108 and fixed by #129.

@ly4k
Copy link
Owner

ly4k commented Mar 23, 2023

Fixed in 4.4.0

@ly4k ly4k closed this as completed Mar 23, 2023
@kaleemshaik7867
Copy link

kaleemshaik7867 commented Apr 12, 2023

Hello @ly4k ,
I am using kali Linux and the Python version is 3.11 and running certipy 4.4 still got the above error
image

what do you recommend here ?

@mmatthers
Copy link

Add -stdout to the end to see it on the screen, or -text will save the results to a file. Must be a bug

@TacticalGator
Copy link

TacticalGator commented Aug 13, 2023

Hi @ly4k, the issue seems to persist with both -old-bloodhound and -bloodhound flag
I can confirm @kaleemshaik7867

$ python3 -V
Python 3.11.4

$ KRB5CCNAME=lowpriv.ccache certipy find -vulnerable -target dc.test.net -k -no-pass -dns-tcp -ns $IP -dc-ip $IP -bloodhound 
Certipy v4.7.0 - by Oliver Lyak (ly4k)

[*] Finding certificate templates
[*] Found 34 certificate templates
[*] Finding certificate authorities
[*] Found 1 certificate authority
[*] Found 12 enabled certificate templates
[*] Trying to get CA configuration for 'DC-CA' via CSRA
[!] Got error while trying to get CA configuration for 'DC-CA' via CSRA: CASessionError: code: 0x80070005 - E_ACCESSDENIED - General access denied error.
[*] Trying to get CA configuration for 'DC-CA' via RRP
[*] Got CA configuration for 'DC-CA'
[-] Got error: module 'enum' has no attribute '_decompose'
[-] Use -debug to print a stacktrace

[...REDACTED..]
<DEBUG OUTPUT>
Traceback (most recent call last):
  File "/home/kali/.local/lib/python3.11/site-packages/certipy/commands/find.py", line 782, in security_to_bloodhound_aces
    standard_rights = list(rights["rights"])
                      ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/enum.py", line 1482, in __iter__
    yield from self._iter_member_(self._value_)
  File "/usr/lib/python3.11/enum.py", line 1369, in _iter_member_by_def_
    yield from sorted(
               ^^^^^^^
  File "/usr/lib/python3.11/enum.py", line 1371, in <lambda>
    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 "/home/kali/.local/lib/python3.11/site-packages/certipy/entry.py", line 60, in main
    actions[options.action](options)
  File "/home/kali/.local/lib/python3.11/site-packages/certipy/commands/parsers/find.py", line 12, in entry
    find.entry(options)
  File "/home/kali/.local/lib/python3.11/site-packages/certipy/commands/find.py", line 1185, in entry
    find.find()
  File "/home/kali/.local/lib/python3.11/site-packages/certipy/commands/find.py", line 455, in find
    self.output_bloodhound_data(prefix, templates, cas)
  File "/home/kali/.local/lib/python3.11/site-packages/certipy/commands/find.py", line 578, in output_bloodhound_data
    aces = self.security_to_bloodhound_aces(security)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/kali/.local/lib/python3.11/site-packages/certipy/commands/find.py", line 784, in security_to_bloodhound_aces
    standard_rights = rights["rights"].to_list()
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/kali/.local/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'

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

6 participants