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

Add new SMB module to extract GPO deployed privilege assignments #493

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Yeeb1
Copy link

@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
Contributor

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
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
Contributor

oh right haha, missed that

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