IN_LOCALGROUP permission in an Active Directory environment grants an account membership in one of the local groups on a specific system. By obtaining this membership, a user gains the rights and privileges associated with that local group, ranging from the ability to read certain files or registry keys to elevated permissions that might allow software installations or configuration changes. This capability is especially valuable for environments where delegated administration is required on a per-machine basis, ensuring that support teams or application owners can manage system-level tasks without receiving full domain-wide privileges.
However, if misconfigured, the IN_LOCALGROUP permission can introduce serious security vulnerabilities. An attacker who obtains membership in a privileged local group could leverage that foothold to bypass security controls, read or modify sensitive system settings, and potentially escalate privileges. This could allow the attacker to install malicious software, manipulate scheduled tasks, or even tamper with system services actions that might lead to persistent unauthorized access or lateral movement within the network. Ultimately, improperly managed IN_LOCALGROUP membership can compromise the overall security posture of the organization, jeopardizing critical systems and sensitive data.
Identification
PowerShell
Active Directory Module
Using the ActiveDirectory PowerShell module, you can enumerate IN_LOCALGROUP entries.
By leveraging PowerShell’s built-in .NET DirectoryServices namespace, you can enumerate IN_LOCALGROUP entries without relying on any external modules or dependencies.
1. Find-IN_LOCALGROUPSimple function
2. Scan all domain computers
3. Scan a specific computer
Active Directory Users and Computers
To identify IN_LOCALGROUP using Computer Management, follow the steps below
1. Open Active Directory Users and Computers.
2. Right-click on the Computer.
3. Select Manage from the context menu.
4. In the Computer Management window, navigate to the Local Users And Groups section.
5. In the Local Users And Groups, double-click the local group to open it.
6. In the Members list, locate Users and Groups.
7. Click OK to close the dialogs.
Exploitation
Membership in a local group does not necessarily imply an exploitable path.
Mitigation
You can mitigate IN_LOCALGROUP with the following steps:
1. Open Active Directory Users and Computers.
2. Right-click on the Computer.
3. Select Manage from the context menu.
4. In the Computer Management window, navigate to the Local Users And Groups section.
5. In the Local Users And Groups, double-click the local group to open it.
6. In the Members list, select the unwanted user or group, then click Remove.
7. Click OK to close the dialogs.
Detection
Adding new Access Control Entries to Active Directory objects changes the ntSecurityDescriptor attribute of the objects themselves. These changes can be detected with Event IDs 5136 and 4662 to identify dangerous modifications.