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/06/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]
 71timestamp_override = "event.ingested"
 72type = "eql"
 73
 74query = '''
 75iam where winlog.api == "wineventlog" and event.action == "added-member-to-group" and
 76(
 77    (
 78        group.name : (
 79            "Admin*",
 80            "Local Administrators",
 81            "Domain Admins",
 82            "Enterprise Admins",
 83            "Backup Admins",
 84            "Schema Admins",
 85            "DnsAdmins",
 86            "Exchange Organization Administrators",
 87            "Print Operators",
 88            "Server Operators",
 89            "Account Operators"
 90        )
 91    ) or
 92    (
 93        group.id : (
 94            "S-1-5-32-544",
 95            "S-1-5-21-*-544",
 96            "S-1-5-21-*-512",
 97            "S-1-5-21-*-519",
 98            "S-1-5-21-*-551",
 99            "S-1-5-21-*-518",
100            "S-1-5-21-*-1101",
101            "S-1-5-21-*-1102",
102            "S-1-5-21-*-550",
103            "S-1-5-21-*-549",
104            "S-1-5-21-*-548"
105        )
106    )
107)
108'''
109
110
111[[rule.threat]]
112framework = "MITRE ATT&CK"
113[[rule.threat.technique]]
114id = "T1098"
115name = "Account Manipulation"
116reference = "https://attack.mitre.org/techniques/T1098/"
117
118
119[rule.threat.tactic]
120id = "TA0003"
121name = "Persistence"
122reference = "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