Adventures in Primary Group Behavior, Reporting, and Exploit...#1796
Open
carlospolop wants to merge 1 commit intomasterfrom
Open
Adventures in Primary Group Behavior, Reporting, and Exploit...#1796carlospolop wants to merge 1 commit intomasterfrom
carlospolop wants to merge 1 commit intomasterfrom
Conversation
Collaborator
Author
🔗 Additional ContextOriginal Blog Post: https://trustedsec.com/blog/adventures-in-primary-group-behavior-reporting-and-exploitation Content Categories: Based on the analysis, this content was categorized under "Windows Hardening -> Active Directory Methodology (add/update content near DCShadow / Privileged Groups / AD enumeration to cover primaryGroupID-based effective membership, tooling discrepancies, and recursion edge cases)". Repository Maintenance:
Review Notes:
Bot Version: HackTricks News Bot v1.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 Automated Content Update
This PR was automatically generated by the HackTricks News Bot based on a technical blog post.
📝 Source Information
🎯 Content Summary
Title/Context
The post (TrustedSec, dated January 22, 2026) deep-dives how Active Directory (AD) determines and reports group membership when a user’s
primaryGroupIDchanges, and why this creates real-world monitoring/IR blind spots. It also validates common attacker assumptions (e.g., “setprimaryGroupIDto Domain Admins and you’re stealthy”) and shows what is and isn’t actually possible.How AD primary group membership works...
🔧 Technical Details
Changing AD effective group membership can be achieved by modifying a user’s
primaryGroupID(e.g., settingprimaryGroupID=512to gain effective Domain Admins privileges) using directory-write primitives such as DCShadow (e.g., via mimikatz). However, primary group changes are coupled to membership semantics: modifying PGID replaces the primary group relationship and strips membership from the previously configured primary group, preventing a clean “decoupled/hidden” membership state.Enumeration/monitoring evasion can be achieved by exploiting tooling discrepancies in how AD membership is reported. Queries that read only the group’s
memberattribute or the user’smemberOfbacklink (e.g.,Get-ADGroup -properties member(s),Get-ADUser -properties memberOf, ADSI Edit viewingmember) can omit primary-group-derived members, while higher-level resolvers (e.g.,Get-ADGroupMe...🤖 Agent Actions
Updated src/windows-hardening/active-directory-methodology/dcshadow.md with a new section detailing primaryGroupID abuse, enforcement behavior, and enumeration blind spots (including tool discrepancies, nested-group recursion gaps, and DACL-based hiding). Added detection/monitoring PowerShell snippets and consolidated references (including the TrustedSec post).
This PR was automatically created by the HackTricks Feed Bot. Please review the changes carefully before merging.