Skip to content

Conversation

@Yeeb1
Copy link
Contributor

@Yeeb1 Yeeb1 commented Nov 24, 2024

Description

A new module to extract privilege assignments from GPOs by parsing the GptTmpl.inf of the Default Domain Policy and spidering for other GPO deployed privileges. The module also resolves the Security Identifiers (SIDs) via LDAP - LDAP resolution can be disabled when the NO_LDAP flag is set.

The file spidering and retrieval functionality in this module was inspired by the gpp_autologin and gpp_password modules, while the LDAPS connection logic was partially adapted from the add-computer module and a fallback to LDAP was added.

Type of change

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

How Has This Been Tested?

  1. Parsing GPO files from an SMB share on a Windows domain controller (tested with SYSVOL read access).
  2. Resolving SIDs using LDAP over SSL (LDAPS) and plaintext LDAP as fallback.
  3. Validating the NO_LDAP flag to ensure LDAP queries are bypassed when enabled.
  4. Tested against a couple of machines which have GptTmpl.inf deployed.

Screenshots:

image

Checklist:

  • I have ran Ruff against my changes (via poetry: poetry run python -m ruff check . --preview, use --fix to automatically fix what it can)
  • My code follows the style guidelines of this project (should be covered by Ruff above)
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas

@NeffIsBack
Copy link
Member

Thanks for the PR! I will take a closer look at it when i have the time.

What i quickly spotted is that it instantiates a new ldap connection. Do you need ldap3 or why is this been done?

@Yeeb1
Copy link
Contributor Author

Yeeb1 commented Dec 4, 2024

Hey!

This is an SMB module, which extracts GptTmpl.inf from the Default Domain Policy and from other deployed GPOs to identify permissions deployed via GPOs. The GptTmpl.inf maps assigned permissions via SIDs, so the ldap3 connection is initiated to resolve the SIDs to users and groups.
Also added the no_ldap flag, which disables the LDAP connectons, so SIDs wont be resolved.

@NeffIsBack
Copy link
Member

oh right haha, missed that

@NeffIsBack
Copy link
Member

Fyi i replaced the share listing with a simple listPath command on the sysvol share to prevent all the --shares logic from running (including the printed privileges).

Copy link
Member

@NeffIsBack NeffIsBack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM:
image

@NeffIsBack NeffIsBack merged commit aec6448 into Pennyw0rth:main Jun 12, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants