User Added to Privileged Group

Identifies a user being added to a privileged group in Active Directory. Privileged accounts and groups in Active Directory are those to which powerful rights, privileges, and permissions are granted that allow them to perform nearly any action in Active Directory and on domain-joined systems.

Elastic rule (View on GitHub)

  1[metadata]
  2creation_date = "2021/01/09"
  3integration = ["system", "windows"]
  4maturity = "production"
  5updated_date = "2024/08/07"
  6
  7[rule]
  8author = ["Elastic", "Skoetting"]
  9description = """
 10Identifies a user being added to a privileged group in Active Directory. Privileged accounts and groups in Active
 11Directory are those to which powerful rights, privileges, and permissions are granted that allow them to perform nearly
 12any action in Active Directory and on domain-joined systems.
 13"""
 14from = "now-9m"
 15index = ["winlogbeat-*", "logs-system.*", "logs-windows.*"]
 16language = "eql"
 17license = "Elastic License v2"
 18name = "User Added to Privileged Group"
 19note = """## Triage and analysis
 20
 21### Investigating User Added to Privileged Group in Active Directory
 22
 23Privileged accounts and groups in Active Directory are those to which powerful rights, privileges, and permissions are granted that allow them to perform nearly any action in Active Directory and on domain-joined systems.
 24
 25Attackers can add users to privileged groups to maintain a level of access if their other privileged accounts are uncovered by the security team. This allows them to keep operating after the security team discovers abused accounts.
 26
 27This rule monitors events related to a user being added to a privileged group.
 28
 29#### Possible investigation steps
 30
 31- Identify the user account that performed the action and whether it should manage members of this group.
 32- Contact the account owner and confirm whether they are aware of this activity.
 33- Investigate other alerts associated with the user/host during the past 48 hours.
 34
 35### False positive analysis
 36
 37- This attack abuses a legitimate Active Directory mechanism, so it is important to determine whether the activity is legitimate, if the administrator is authorized to perform this operation, and if there is a need to grant the account this level of privilege.
 38
 39### Response and remediation
 40
 41- Initiate the incident response process based on the outcome of the triage.
 42- If the admin is not aware of the operation, activate your Active Directory incident response plan.
 43- If the user does not need the administrator privileges, remove the account from the privileged group.
 44- Review the privileges of the administrator account that performed the action.
 45- Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
 46- Using the incident response data, update logging and audit policies to improve the mean time to detect (MTTD) and the mean time to respond (MTTR).
 47"""
 48references = [
 49    "https://docs.microsoft.com/en-us/windows-server/identity/ad-ds/plan/security-best-practices/appendix-b--privileged-accounts-and-groups-in-active-directory",
 50]
 51risk_score = 47
 52rule_id = "5cd8e1f7-0050-4afc-b2df-904e40b2f5ae"
 53setup = """## Setup
 54
 55If enabling an EQL rule on a non-elastic-agent index (such as beats) for versions <8.2,
 56events will not define `event.ingested` and default fallback for EQL rules was not added until version 8.2.
 57Hence for this rule to work effectively, users will need to add a custom ingest pipeline to populate
 58`event.ingested` to @timestamp.
 59For more details on adding a custom ingest pipeline refer - https://www.elastic.co/guide/en/fleet/current/data-streams-pipeline-tutorial.html
 60"""
 61severity = "medium"
 62tags = [
 63    "Domain: Endpoint",
 64    "OS: Windows",
 65    "Use Case: Threat Detection",
 66    "Tactic: Persistence",
 67    "Resources: Investigation Guide",
 68    "Use Case: Active Directory Monitoring",
 69    "Data Source: Active Directory",
 70    "Data Source: System",
 71]
 72timestamp_override = "event.ingested"
 73type = "eql"
 74
 75query = '''
 76iam where winlog.api == "wineventlog" and event.action == "added-member-to-group" and
 77(
 78    (
 79        group.name : (
 80            "Admin*",
 81            "Local Administrators",
 82            "Domain Admins",
 83            "Enterprise Admins",
 84            "Backup Admins",
 85            "Schema Admins",
 86            "DnsAdmins",
 87            "Exchange Organization Administrators",
 88            "Print Operators",
 89            "Server Operators",
 90            "Account Operators"
 91        )
 92    ) or
 93    (
 94        group.id : (
 95            "S-1-5-32-544",
 96            "S-1-5-21-*-544",
 97            "S-1-5-21-*-512",
 98            "S-1-5-21-*-519",
 99            "S-1-5-21-*-551",
100            "S-1-5-21-*-518",
101            "S-1-5-21-*-1101",
102            "S-1-5-21-*-1102",
103            "S-1-5-21-*-550",
104            "S-1-5-21-*-549",
105            "S-1-5-21-*-548"
106        )
107    )
108)
109'''
110
111
112[[rule.threat]]
113framework = "MITRE ATT&CK"
114[[rule.threat.technique]]
115id = "T1098"
116name = "Account Manipulation"
117reference = "https://attack.mitre.org/techniques/T1098/"
118
119
120[rule.threat.tactic]
121id = "TA0003"
122name = "Persistence"
123reference = "https://attack.mitre.org/tactics/TA0003/"

Triage and analysis

Investigating User Added to Privileged Group in Active Directory

Privileged accounts and groups in Active Directory are those to which powerful rights, privileges, and permissions are granted that allow them to perform nearly any action in Active Directory and on domain-joined systems.

Attackers can add users to privileged groups to maintain a level of access if their other privileged accounts are uncovered by the security team. This allows them to keep operating after the security team discovers abused accounts.

This rule monitors events related to a user being added to a privileged group.

Possible investigation steps

  • Identify the user account that performed the action and whether it should manage members of this group.
  • Contact the account owner and confirm whether they are aware of this activity.
  • Investigate other alerts associated with the user/host during the past 48 hours.

False positive analysis

  • This attack abuses a legitimate Active Directory mechanism, so it is important to determine whether the activity is legitimate, if the administrator is authorized to perform this operation, and if there is a need to grant the account this level of privilege.

Response and remediation

  • Initiate the incident response process based on the outcome of the triage.
  • If the admin is not aware of the operation, activate your Active Directory incident response plan.
  • If the user does not need the administrator privileges, remove the account from the privileged group.
  • Review the privileges of the administrator account that performed the action.
  • Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
  • Using the incident response data, update logging and audit policies to improve the mean time to detect (MTTD) and the mean time to respond (MTTR).

References

Related rules

to-top