Skip to content

Commit 3cb3dc1

Browse files
Update latest docs (#6869)
1 parent c36339a commit 3cb3dc1

File tree

34 files changed

+2833
-69
lines changed

34 files changed

+2833
-69
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
[[prebuilt-rule-8-16-15-account-discovery-command-via-system-account]]
2+
=== Account Discovery Command via SYSTEM Account
3+
4+
Identifies when the SYSTEM account uses an account discovery utility. This could be a sign of discovery activity after an adversary has achieved privilege escalation.
5+
6+
*Rule type*: eql
7+
8+
*Rule indices*:
9+
10+
* winlogbeat-*
11+
* logs-endpoint.events.process-*
12+
* logs-windows.sysmon_operational-*
13+
14+
*Severity*: low
15+
16+
*Risk score*: 21
17+
18+
*Runs every*: 5m
19+
20+
*Searches indices from*: now-9m ({ref}/common-options.html#date-math[Date Math format], see also <<rule-schedule, `Additional look-back time`>>)
21+
22+
*Maximum alerts per execution*: 100
23+
24+
*References*: None
25+
26+
*Tags*:
27+
28+
* Domain: Endpoint
29+
* OS: Windows
30+
* Use Case: Threat Detection
31+
* Tactic: Discovery
32+
* Tactic: Privilege Escalation
33+
* Resources: Investigation Guide
34+
* Data Source: Elastic Defend
35+
* Data Source: Sysmon
36+
37+
*Version*: 214
38+
39+
*Rule authors*:
40+
41+
* Elastic
42+
43+
*Rule license*: Elastic License v2
44+
45+
46+
==== Investigation guide
47+
48+
49+
50+
*Triage and analysis*
51+
52+
53+
54+
*Investigating Account Discovery Command via SYSTEM Account*
55+
56+
57+
After successfully compromising an environment, attackers may try to gain situational awareness to plan their next steps. This can happen by running commands to enumerate network resources, users, connections, files, and installed security software.
58+
59+
This rule looks for the execution of account discovery utilities using the SYSTEM account, which is commonly observed after attackers successfully perform privilege escalation or exploit web applications.
60+
61+
62+
*Possible investigation steps*
63+
64+
65+
- Investigate the process execution chain (parent process tree) for unknown processes. Examine their executable files for prevalence, whether they are located in expected locations, and if they are signed with valid digital signatures.
66+
- If the process tree includes a web-application server process such as w3wp, httpd.exe, nginx.exe and alike, investigate any suspicious file creation or modification in the last 48 hours to assess the presence of any potential webshell backdoor.
67+
- Investigate other alerts associated with the user/host during the past 48 hours.
68+
- Determine how the SYSTEM account is being used. For example, users with administrator privileges can spawn a system shell using Windows services, scheduled tasks or other third party utilities.
69+
70+
71+
*False positive analysis*
72+
73+
74+
- Discovery activities are not inherently malicious if they occur in isolation. As long as the analyst did not identify suspicious activity related to the user or host, such alerts can be dismissed.
75+
76+
77+
*Response and remediation*
78+
79+
80+
- Initiate the incident response process based on the outcome of the triage.
81+
- Isolate the involved hosts to prevent further post-compromise behavior.
82+
- Investigate credential exposure on systems compromised or used by the attacker to ensure all compromised accounts are identified. Reset passwords for these accounts and other potentially compromised credentials, such as email, business systems, and web services.
83+
- Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
84+
- Determine the initial vector abused by the attacker and take action to prevent reinfection via the same vector.
85+
- 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).
86+
- Use the data collected through the analysis to investigate other machines affected in the environment.
87+
88+
89+
==== Setup
90+
91+
92+
93+
*Setup*
94+
95+
96+
If enabling an EQL rule on a non-elastic-agent index (such as beats) for versions <8.2,
97+
events will not define `event.ingested` and default fallback for EQL rules was not added until version 8.2.
98+
Hence for this rule to work effectively, users will need to add a custom ingest pipeline to populate
99+
`event.ingested` to @timestamp.
100+
For more details on adding a custom ingest pipeline refer - https://www.elastic.co/guide/en/fleet/current/data-streams-pipeline-tutorial.html
101+
102+
103+
==== Rule query
104+
105+
106+
[source, js]
107+
----------------------------------
108+
process where host.os.type == "windows" and event.type == "start" and
109+
(?process.Ext.token.integrity_level_name : "System" or
110+
?winlog.event_data.IntegrityLevel : "System") and
111+
(
112+
process.name : "whoami.exe" or
113+
(
114+
process.name : "net1.exe" and not process.parent.name : "net.exe" and not process.args : ("start", "stop", "/active:*")
115+
)
116+
) and
117+
process.parent.executable != null and
118+
not (process.name : "net1.exe" and process.working_directory : "C:\\ProgramData\\Microsoft\\Windows Defender Advanced Threat Protection\\Downloads\\") and
119+
not process.parent.executable :
120+
("C:\\Program Files\\Microsoft Monitoring Agent\\Agent\\MonitoringHost.exe",
121+
"C:\\Program Files\\Dell\\SupportAssistAgent\\SRE\\SRE.exe",
122+
"C:\\Program Files\\Obkio Agent\\main.dist\\ObkioAgentSoftware.exe",
123+
"C:\\Windows\\Temp\\WinGet\\defaultState\\PostgreSQL.PostgreSQL*\\postgresql-*-windows-x64.exe",
124+
"C:\\Program Files\\Obkio Agent\\main.dist\\ObkioAgentSoftware.exe",
125+
"C:\\Program Files (x86)\\SolarWinds\\Agent\\Plugins\\JobEngine\\SWJobEngineWorker2.exe") and
126+
not (process.parent.executable : "C:\\Windows\\Sys?????\\WindowsPowerShell\\v1.0\\powershell.exe" and
127+
process.parent.args : ("C:\\Program Files (x86)\\Microsoft Intune Management Extension\\*.ps1",
128+
"Agent\\Modules\\AdHealthConfiguration\\AdHealthConfiguration.psd1'")) and
129+
not (process.parent.name : "cmd.exe" and process.working_directory : "C:\\Program Files\\Infraon Corp\\SecuraAgent\\")
130+
131+
----------------------------------
132+
133+
*Framework*: MITRE ATT&CK^TM^
134+
135+
* Tactic:
136+
** Name: Discovery
137+
** ID: TA0007
138+
** Reference URL: https://attack.mitre.org/tactics/TA0007/
139+
* Technique:
140+
** Name: System Owner/User Discovery
141+
** ID: T1033
142+
** Reference URL: https://attack.mitre.org/techniques/T1033/
143+
* Tactic:
144+
** Name: Privilege Escalation
145+
** ID: TA0004
146+
** Reference URL: https://attack.mitre.org/tactics/TA0004/
147+
* Technique:
148+
** Name: Valid Accounts
149+
** ID: T1078
150+
** Reference URL: https://attack.mitre.org/techniques/T1078/
151+
* Sub-technique:
152+
** Name: Local Accounts
153+
** ID: T1078.003
154+
** Reference URL: https://attack.mitre.org/techniques/T1078/003/
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
[[prebuilt-rule-8-16-15-delegated-managed-service-account-modification-by-an-unusual-user]]
2+
=== Delegated Managed Service Account Modification by an Unusual User
3+
4+
Detects modifications in the msDS-ManagedAccountPrecededByLink attribute of a delegated managed service account by an unusual subject account. Attackers can abuse this attribute to take over the permission of a target account and inherit it's permissions allowing them to further elevate privileges.
5+
6+
*Rule type*: new_terms
7+
8+
*Rule indices*:
9+
10+
* winlogbeat-*
11+
* logs-system.security*
12+
* logs-windows.forwarded*
13+
14+
*Severity*: high
15+
16+
*Risk score*: 73
17+
18+
*Runs every*: 5m
19+
20+
*Searches indices from*: now-9m ({ref}/common-options.html#date-math[Date Math format], see also <<rule-schedule, `Additional look-back time`>>)
21+
22+
*Maximum alerts per execution*: 100
23+
24+
*References*:
25+
26+
* https://www.akamai.com/blog/security-research/abusing-dmsa-for-privilege-escalation-in-active-directory
27+
28+
*Tags*:
29+
30+
* Domain: Endpoint
31+
* OS: Windows
32+
* Use Case: Threat Detection
33+
* Tactic: Privilege Escalation
34+
* Use Case: Active Directory Monitoring
35+
* Data Source: Active Directory
36+
* Data Source: Windows Security Event Logs
37+
* Resources: Investigation Guide
38+
39+
*Version*: 1
40+
41+
*Rule authors*:
42+
43+
* Elastic
44+
45+
*Rule license*: Elastic License v2
46+
47+
48+
==== Investigation guide
49+
50+
51+
52+
*Triage and analysis*
53+
54+
55+
56+
*Investigating Delegated Managed Service Account Modification by an Unusual User*
57+
58+
59+
60+
*Possible investigation steps*
61+
62+
- Examine the winlog.event_data.SubjectUserName field and verify if he is allowed and used to perform this kind of dMSA changes.
63+
- Examine the winlog.event_data.AttributeValue field to verify the targeted account and if it's supposed to use dMSA.
64+
- Examine if there are any recent dMSA account creation by the same winlog.event_data.SubjectUserName.
65+
- Investigate the history of the identified user account to determine if there are any other suspicious activities or patterns of behavior.
66+
- Collaborate with the IT or security team to determine if the changes were authorized or if further action is needed to secure the environment.
67+
68+
69+
*False positive analysis*
70+
71+
72+
- Migration of legacy service accounts using delegated managed service account.
73+
74+
75+
*Response and remediation*
76+
77+
78+
- Immediately disable the winlog.event_data.SubjectUserName account and revert all changes performed by that account.
79+
- Identify and isolate the source machines from where the SubjectUserName is authenticating.
80+
- Reset passwords for all accounts that were potentially affected or had their permissions altered, focusing on privileged accounts to prevent adversaries from regaining access.
81+
- Escalate the incident to the security operations center (SOC) or incident response team for further investigation and to determine the scope of the breach, including identifying any other compromised systems or accounts.
82+
- Review and update access control policies and security configurations to prevent similar attacks, ensuring that only authorized personnel have the ability to modify critical Active Directory objects or create OU child objects.
83+
84+
==== Rule query
85+
86+
87+
[source, js]
88+
----------------------------------
89+
event.code:5136 and winlog.event_data.AttributeLDAPDisplayName:"msDS-ManagedAccountPrecededByLink"
90+
91+
----------------------------------
92+
93+
*Framework*: MITRE ATT&CK^TM^
94+
95+
* Tactic:
96+
** Name: Privilege Escalation
97+
** ID: TA0004
98+
** Reference URL: https://attack.mitre.org/tactics/TA0004/
99+
* Technique:
100+
** Name: Valid Accounts
101+
** ID: T1078
102+
** Reference URL: https://attack.mitre.org/techniques/T1078/
103+
* Sub-technique:
104+
** Name: Domain Accounts
105+
** ID: T1078.002
106+
** Reference URL: https://attack.mitre.org/techniques/T1078/002/
107+
* Technique:
108+
** Name: Account Manipulation
109+
** ID: T1098
110+
** Reference URL: https://attack.mitre.org/techniques/T1098/
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
[[prebuilt-rule-8-16-15-disabling-lsa-protection-via-registry-modification]]
2+
=== Disabling Lsa Protection via Registry Modification
3+
4+
LSA protecton is provided to prevent nonprotected processes from reading memory and injecting code. This feature provides added security for the credentials that LSA stores and manages. Adversaries may modify the RunAsPPL registry and wait or initiate a system restart to enable Lsass credentials access.
5+
6+
*Rule type*: eql
7+
8+
*Rule indices*:
9+
10+
* winlogbeat-*
11+
* logs-endpoint.events.registry-*
12+
* logs-windows.sysmon_operational-*
13+
* endgame-*
14+
* logs-m365_defender.event-*
15+
* logs-sentinel_one_cloud_funnel.*
16+
17+
*Severity*: high
18+
19+
*Risk score*: 73
20+
21+
*Runs every*: 5m
22+
23+
*Searches indices from*: now-9m ({ref}/common-options.html#date-math[Date Math format], see also <<rule-schedule, `Additional look-back time`>>)
24+
25+
*Maximum alerts per execution*: 100
26+
27+
*References*:
28+
29+
* https://learn.microsoft.com/en-us/windows-server/security/credentials-protection-and-management/configuring-additional-lsa-protection
30+
31+
*Tags*:
32+
33+
* Domain: Endpoint
34+
* OS: Windows
35+
* Use Case: Threat Detection
36+
* Tactic: Defense Evasion
37+
* Resources: Investigation Guide
38+
* Data Source: Elastic Endgame
39+
* Data Source: Elastic Defend
40+
* Data Source: Sysmon
41+
* Data Source: Microsoft Defender for Endpoint
42+
* Data Source: SentinelOne
43+
44+
*Version*: 1
45+
46+
*Rule authors*:
47+
48+
* Elastic
49+
50+
*Rule license*: Elastic License v2
51+
52+
53+
==== Investigation guide
54+
55+
56+
57+
*Triage and analysis*
58+
59+
60+
61+
*Investigating Disabling Lsa Protection via Registry Modification*
62+
63+
64+
For more information about the Lsa Protection and how it works, check the https://learn.microsoft.com/en-us/windows-server/security/credentials-protection-and-management/configuring-additional-lsa-protection[official Microsoft docs page].
65+
66+
Attackers may disable Lsa protection to access Lsass memory for credentals. This rule identifies RunAsPPL registry value modifications.
67+
68+
69+
*Possible investigation steps*
70+
71+
72+
- Verify the context of the change and if it's related to a planned system administration activity.
73+
- Investigate the process execution chain (parent process tree) for unknown processes. Examine their executable files for prevalence, whether they are located in expected locations, and if they are signed with valid digital signatures.
74+
- Investigate other alerts associated with the user/host during the past 48 hours.
75+
- Inspect the host for suspicious or abnormal behaviors in the alert timeframe.
76+
- Investigate abnormal behaviors observed by the subject process such as network connections, registry or file modifications, and any spawned child processes.
77+
78+
79+
*False positive analysis*
80+
81+
82+
- Approved changes to relax the Lsa protection for compatibility with third party solutions such as authentication plugins or alike.
83+
84+
85+
*Response and remediation*
86+
87+
88+
- Initiate the incident response process based on the outcome of the triage.
89+
- Isolate the involved host to prevent further post-compromise behavior.
90+
- If the triage identified malware, search the environment for additional compromised hosts.
91+
- Implement temporary network rules, procedures, and segmentation to contain the malware.
92+
- Stop suspicious processes.
93+
- Immediately block the identified indicators of compromise (IoCs).
94+
- Inspect the affected systems for additional malware backdoors like reverse shells, reverse proxies, or droppers that attackers could use to reinfect the system.
95+
- Remove and block malicious artifacts identified during triage.
96+
- Restore UAC settings to the desired state.
97+
- Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
98+
- Investigate credential exposure on systems compromised or used by the attacker to ensure all compromised accounts are identified. Reset passwords for these accounts and other potentially compromised credentials, such as email, business systems, and web services.
99+
- Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
100+
- 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).
101+
102+
103+
==== Rule query
104+
105+
106+
[source, js]
107+
----------------------------------
108+
registry where host.os.type == "windows" and event.type == "change" and
109+
registry.path : ("HKLM\\SYSTEM\\ControlSet*\\Control\\Lsa\\RunAsPPL", "\\REGISTRY\\MACHINE\\SYSTEM\\ControlSet*\\Control\\Lsa\\RunAsPPL") and
110+
not registry.data.strings : ("1", "0x00000001", "2", "0x00000002")
111+
112+
----------------------------------
113+
114+
*Framework*: MITRE ATT&CK^TM^
115+
116+
* Tactic:
117+
** Name: Defense Evasion
118+
** ID: TA0005
119+
** Reference URL: https://attack.mitre.org/tactics/TA0005/
120+
* Technique:
121+
** Name: Modify Registry
122+
** ID: T1112
123+
** Reference URL: https://attack.mitre.org/techniques/T1112/
124+
* Technique:
125+
** Name: Impair Defenses
126+
** ID: T1562
127+
** Reference URL: https://attack.mitre.org/techniques/T1562/
128+
* Sub-technique:
129+
** Name: Disable or Modify Tools
130+
** ID: T1562.001
131+
** Reference URL: https://attack.mitre.org/techniques/T1562/001/

0 commit comments

Comments
 (0)