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

Fix for python 3.11 #129

Merged
merged 2 commits into from
Mar 21, 2023
Merged

Fix for python 3.11 #129

merged 2 commits into from
Mar 21, 2023

Conversation

f3rn0s
Copy link
Contributor

@f3rn0s f3rn0s commented Feb 23, 2023

This fixes the issue with _decompose calls...

Essentially, if python supports converting the IntFlags into a list, we do it, otherwise we fall back to old behavior.

See #108 for details.

@f3rn0s
Copy link
Contributor Author

f3rn0s commented Feb 23, 2023

Tested this change out on https://github.com/Orange-Cyberdefense/GOAD, seems to work fine :).

image

@f3rn0s
Copy link
Contributor Author

f3rn0s commented Feb 23, 2023

Also definitely backwards compatible:

image

@f3rn0s
Copy link
Contributor Author

f3rn0s commented Feb 23, 2023

hmmm, looks like the string conversion isn't quite right... I'll take a look

@f3rn0s
Copy link
Contributor Author

f3rn0s commented Feb 23, 2023

Turns out .to_str_list() was calling the old .to_list method which wouldn't return the correct data, so just had to update that function too.

Results in the json are now correct:

      "Enrollment Flag": [
        "IncludeSymmetricAlgorithms",
        "PendAllRequests",
        "PublishToDs",
        "AutoEnrollment"
      ],

Where previously it would return the integer representations of these flags.

@f3rn0s
Copy link
Contributor Author

f3rn0s commented Feb 23, 2023

Looks like the Certipy will have these always exist:

"Private Key Flag": [
    16777216,
    65536
],

Similar to:

Enrollment Flag: [
    None
],
Private Key Flag: [
    AttestNone
],

However using list() makes it so the result doesn't include these (i.e. if it's None, then it will leave Enrollment Flag undefined).

What should the proper handling of this be?

@pich4ya
Copy link

pich4ya commented Mar 5, 2023

Great work! Tested and worked with HTB Escape ;)

@RaduNico
Copy link

The PR worked for me, thanks a bunch

@Acebond
Copy link

Acebond commented Mar 18, 2023

This pull request saved me. Thanks heaps.

@ly4k ly4k merged commit 5dba0a3 into ly4k:main Mar 21, 2023
@ly4k
Copy link
Owner

ly4k commented Mar 21, 2023

Thank you! 🙏🏼

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

Successfully merging this pull request may close these issues.

5 participants