Skip to content
leg3ndProjects & tools
01Home02Projects03Tools04Notes
GMT+8
O/ OSCP exploitation reference
Workspace controls Memory only · 0 steps
Visualize path ↗
Command values 0 filled

Temporary connection values clear on reload. Passwords, hashes and tickets remain placeholders. Check address-family syntax in the selected command.

Reference index ↗ Search all procedures & variants ↗
01Discovery02Enumeration03Initial access04Usable access05Local privilege06Active Directory07Internal access08Evidence & reporting

QUICK REFERENCE

Discovery›Services›Web mapping›Web exploitation›Credentials›Public exploits›Sessions & transfers›Linux escalation›Windows escalation›AD enumeration›AD identity attacks›Lateral movement›Pivoting & tunnels›Execution troubleshooting›Integration & evidence›
174 methods · 15 topicsFull reference on GitHub ↗Commands · scripts · next steps
Tools/OSCP/Active Directory/AD identity attacks
← All ad identity attacks tasks

Add a controlled identity to a group through effective membership rights

CommandsIf → thenExplanation & examples

Needs: Exact target group, controlled principal, useful resulting right and a fresh token/logon context

PowerShell commands

# Baseline
Add-DomainGroupMember -Identity TARGET_GROUP -Members CONTROLLED_USER -Verbose
Get-DomainGroupMember -Identity TARGET_GROUP |
  Where-Object { $_.MemberName -eq 'CONTROLLED_USER' }

# Built-in alternative
net group TARGET_GROUP CONTROLLED_USER /add /domain

# Baseline
Remove-DomainGroupMember -Identity TARGET_GROUP -Members CONTROLLED_USER -Verbose -Confirm:$false
net group TARGET_GROUP CONTROLLED_USER /delete /domain

Verify → Verify directory membership and actual service action from a refreshed context, then restore the original membership.

If it fails → An old token, wrong group or nesting/policy behavior can leave authorization unchanged despite a successful modification. More detail ↓

If → then

  • A WinRM listener and a candidate endpoint-authorized account → Use WinRM, WinRS or PowerShell remoting

    Needs: Reachable HTTP(S) listener, accepted authentication and endpoint/session configuration permissions; hash/ticket support depends on client/context

  • Group-to-host access edges or a privileged user's possible session → Validate host access and volatile session candidates

    Needs: Reachable destination service and its actual authorization; session evidence must be current and collection rights sufficient

  • A password tied to a plausible user and service → Validate known passwords and context-specific reuse

    Needs: Correct local/domain/application identity, reachable compatible service, accepted authentication and account state

No useful finding → another task in this topic. Failed check → resolve the failure before ruling out the path.

Explanation & examples

Add a controlled identity to a group through effective membership rights

USE WHEN
A group member-attribute write or equivalent effective right
STARTING ACCESS
A domain identity, appropriate host privilege, or a validated effective directory-object right
RESULT
A verified new group-based authorization capability

Recognize the clue

Select the useful group from mapping and inspect its current member list and exact member-attribute ACL.

Get-DomainGroupMember -Identity TARGET_GROUP
Get-DomainObjectAcl -Identity TARGET_GROUP -ResolveGUIDs
SYNTHETIC EXAMPLE OUTPUT
Target group: ACCESS_GROUP
Effective permitted operation: write member
Controlled account: not currently a member

Means: A membership-write operation can grant a defined group capability once new logon/token state reflects it.

Confirm: Verify effective right, actual group-derived authorization, nesting/token refresh and restoration.

After validation
The membership and a fresh context enable the intended service action: choose the group transition.
Ruled out in this context
The writable attribute is not member or the group grants no intended right: reject that chain.
Still inconclusive
Directory modification without refreshed/accepted authorization leaves practical effect unresolved.

Troubleshooting: An old token, wrong group or nesting/policy behavior can leave authorization unchanged despite a successful modification.

A current session may not receive the new group SID until a fresh logon. Validate with a new session/token, then remove the membership after the authorized objective:

Why it works

Directory membership changes do not automatically refresh existing tokens or every application's group cache. Nested membership and service-specific authorization determine the resulting access.

Worked example · hypothetical

Observation: the controlled account can join a group granting remote management. Test: change membership and create a fresh authorized logon. Illustrative output: WinRM access succeeds only in the new context. Interpretation: record the new right and remove the temporary membership afterward.

New identity, privilege, host or route? Re-enumerate → All topic tasks →

Study guide ↗Full procedure ↗Cheatsheet ↗
HomeProjectsToolsNotes
Interactive toolsOSCP notes ↗Extended OSCP workspace ↗Attack-path visualizer ↗

© 2026 Armaan. Built with curiosity.

GitHub ↗GMT+8