Skip to content

Commit eb0d8d1

Browse files
Update latest docs
1 parent 34c2b51 commit eb0d8d1

File tree

187 files changed

+18516
-814
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

187 files changed

+18516
-814
lines changed
Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
[[prebuilt-rule-8-19-11-a-scheduled-task-was-created]]
2+
=== A scheduled task was created
3+
4+
Indicates the creation of a scheduled task using Windows event logs. Adversaries can use these to establish persistence, move laterally, and/or escalate privileges.
5+
6+
*Rule type*: eql
7+
8+
*Rule indices*:
9+
10+
* logs-system.security*
11+
* logs-windows.forwarded*
12+
* winlogbeat-*
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*:
25+
26+
* https://docs.microsoft.com/en-us/windows/security/threat-protection/auditing/event-4698
27+
28+
*Tags*:
29+
30+
* Domain: Endpoint
31+
* OS: Windows
32+
* Use Case: Threat Detection
33+
* Tactic: Persistence
34+
* Data Source: Windows Security Event Logs
35+
* Resources: Investigation Guide
36+
37+
*Version*: 114
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+
> **Disclaimer**:
54+
> This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.
55+
56+
57+
*Investigating A scheduled task was created*
58+
59+
60+
Scheduled tasks in Windows automate routine tasks, enhancing efficiency. However, adversaries exploit this feature to maintain persistence, move laterally, or escalate privileges by creating malicious tasks. The detection rule identifies suspicious task creation by filtering out benign tasks and those initiated by system accounts, focusing on potential threats. This approach helps security analysts pinpoint unauthorized task creation indicative of malicious activity.
61+
62+
63+
*Possible investigation steps*
64+
65+
66+
- Review the user account associated with the task creation to determine if it is a known and authorized user, ensuring it is not a system account by checking that the username does not end with a dollar sign.
67+
- Examine the task name and path in the event data to identify if it matches any known benign tasks or if it appears suspicious or unfamiliar.
68+
- Investigate the origin of the task creation by checking the source IP address or hostname, if available, to determine if it aligns with expected network activity.
69+
- Check the task's scheduled actions and triggers to understand what the task is designed to execute and when, looking for any potentially harmful or unexpected actions.
70+
- Correlate the task creation event with other security events or logs around the same time to identify any related suspicious activities or anomalies.
71+
72+
73+
*False positive analysis*
74+
75+
76+
- Scheduled tasks created by system accounts or computer accounts are often benign. These can be excluded by filtering out user names ending with a dollar sign, which typically represent system accounts.
77+
- Tasks associated with common software updates or maintenance, such as those from Hewlett-Packard or Microsoft Visual Studio, are generally non-threatening. These can be excluded by specifying their full task names in the exclusion list.
78+
- OneDrive update tasks are frequently triggered and are usually safe. Exclude these by using patterns that match their task names, such as those starting with "OneDrive Standalone Update Task".
79+
- Regularly review and update the exclusion list to include any new benign tasks that are identified over time, ensuring that the rule remains effective without generating unnecessary alerts.
80+
81+
82+
*Response and remediation*
83+
84+
85+
- Immediately isolate the affected system from the network to prevent potential lateral movement by the adversary.
86+
- Terminate any suspicious scheduled tasks identified by the alert to halt any ongoing malicious activity.
87+
- Conduct a thorough review of the system's scheduled tasks to identify and remove any other unauthorized or suspicious tasks.
88+
- Restore the system from a known good backup if any malicious activity has been confirmed and has potentially compromised system integrity.
89+
- Update and patch the system to the latest security standards to close any vulnerabilities that may have been exploited.
90+
- Monitor the system and network for any signs of re-infection or further unauthorized scheduled task creation.
91+
- Escalate the incident to the security operations center (SOC) or incident response team for further investigation and to determine if additional systems are affected.
92+
93+
==== Rule query
94+
95+
96+
[source, js]
97+
----------------------------------
98+
iam where host.os.type == "windows" and event.action == "scheduled-task-created" and
99+
100+
/* excluding tasks created by the computer account */
101+
not user.name : "*$" and
102+
103+
/* TaskContent is not parsed, exclude by full taskname noisy ones */
104+
not winlog.event_data.TaskName : (
105+
"\\CreateExplorerShellUnelevatedTask",
106+
"\\Hewlett-Packard\\HPDeviceCheck",
107+
"\\Hewlett-Packard\\HP Support Assistant\\WarrantyChecker",
108+
"\\Hewlett-Packard\\HP Support Assistant\\WarrantyChecker_backup",
109+
"\\Hewlett-Packard\\HP Web Products Detection",
110+
"\\Microsoft\\VisualStudio\\Updates\\BackgroundDownload",
111+
"\\OneDrive Standalone Update Task-S-1-5-21*",
112+
"\\OneDrive Standalone Update Task-S-1-12-1-*"
113+
)
114+
115+
----------------------------------
116+
117+
*Framework*: MITRE ATT&CK^TM^
118+
119+
* Tactic:
120+
** Name: Persistence
121+
** ID: TA0003
122+
** Reference URL: https://attack.mitre.org/tactics/TA0003/
123+
* Technique:
124+
** Name: Scheduled Task/Job
125+
** ID: T1053
126+
** Reference URL: https://attack.mitre.org/techniques/T1053/
127+
* Sub-technique:
128+
** Name: Scheduled Task
129+
** ID: T1053.005
130+
** Reference URL: https://attack.mitre.org/techniques/T1053/005/
Lines changed: 183 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,183 @@
1+
[[prebuilt-rule-8-19-11-access-to-a-sensitive-ldap-attribute]]
2+
=== Access to a Sensitive LDAP Attribute
3+
4+
Identify access to sensitive Active Directory object attributes that contains credentials and decryption keys such as unixUserPassword, ms-PKI-AccountCredentials and msPKI-CredentialRoamingTokens.
5+
6+
*Rule type*: eql
7+
8+
*Rule indices*:
9+
10+
* logs-system.security*
11+
* logs-windows.forwarded*
12+
* winlogbeat-*
13+
14+
*Severity*: medium
15+
16+
*Risk score*: 47
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.mandiant.com/resources/blog/apt29-windows-credential-roaming
27+
* https://social.technet.microsoft.com/wiki/contents/articles/11483.windows-credential-roaming.aspx
28+
* https://learn.microsoft.com/en-us/windows/security/threat-protection/auditing/event-4662
29+
30+
*Tags*:
31+
32+
* Domain: Endpoint
33+
* OS: Windows
34+
* Use Case: Threat Detection
35+
* Tactic: Credential Access
36+
* Tactic: Privilege Escalation
37+
* Use Case: Active Directory Monitoring
38+
* Data Source: Active Directory
39+
* Data Source: Windows Security Event Logs
40+
* Resources: Investigation Guide
41+
42+
*Version*: 117
43+
44+
*Rule authors*:
45+
46+
* Elastic
47+
48+
*Rule license*: Elastic License v2
49+
50+
51+
==== Investigation guide
52+
53+
54+
55+
*Triage and analysis*
56+
57+
58+
> **Disclaimer**:
59+
> This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.
60+
61+
62+
*Investigating Access to a Sensitive LDAP Attribute*
63+
64+
65+
LDAP (Lightweight Directory Access Protocol) is crucial for accessing and managing directory information in Active Directory environments. Adversaries may exploit LDAP to access sensitive attributes like passwords and decryption keys, facilitating credential theft or privilege escalation. The detection rule identifies unauthorized access attempts by monitoring specific event codes and attribute identifiers, excluding benign activities to reduce noise, thus highlighting potential security threats.
66+
67+
68+
*Possible investigation steps*
69+
70+
71+
- Review the event logs for event code 4662 to identify the specific user or process attempting to access the sensitive LDAP attributes.
72+
- Check the winlog.event_data.SubjectUserSid to determine the identity of the user or service account involved in the access attempt, excluding the well-known SID S-1-5-18 (Local System).
73+
- Analyze the winlog.event_data.Properties field to confirm which sensitive attribute was accessed, such as unixUserPassword, ms-PKI-AccountCredentials, or msPKI-CredentialRoamingTokens.
74+
- Investigate the context of the access attempt by correlating the event with other logs or alerts around the same timestamp to identify any suspicious patterns or activities.
75+
- Verify the legitimacy of the access by checking if the user or process has a valid reason or permission to access the sensitive attributes, considering the organization's access control policies.
76+
- Assess the potential impact of the access attempt on the organization's security posture, focusing on credential theft or privilege escalation risks.
77+
- Document findings and, if necessary, escalate the incident to the appropriate security team for further action or remediation.
78+
79+
80+
*False positive analysis*
81+
82+
83+
- Access by legitimate administrative accounts: Regular access by system administrators to sensitive LDAP attributes can trigger alerts. To manage this, create exceptions for known administrative accounts by excluding their SIDs from the detection rule.
84+
- Scheduled system processes: Automated tasks or system processes that require access to certain LDAP attributes may cause false positives. Identify these processes and exclude their specific event codes or AccessMasks if they are consistently benign.
85+
- Service accounts: Service accounts that perform routine directory operations might access sensitive attributes as part of their normal function. Exclude these accounts by adding their SIDs to the exception list to prevent unnecessary alerts.
86+
- Monitoring tools: Security or monitoring tools that scan directory attributes for compliance or auditing purposes can generate false positives. Whitelist these tools by excluding their event sources or specific actions from the detection criteria.
87+
88+
89+
*Response and remediation*
90+
91+
92+
- Immediately isolate the affected system from the network to prevent further unauthorized access or data exfiltration.
93+
- Conduct a thorough review of the access logs to identify any unauthorized users or systems that accessed the sensitive LDAP attributes.
94+
- Reset passwords and revoke any potentially compromised credentials associated with the affected accounts, focusing on those with access to sensitive attributes.
95+
- Escalate the incident to the security operations center (SOC) or incident response team for further investigation and to determine the scope of the breach.
96+
- Implement additional monitoring on the affected systems and accounts to detect any further suspicious activities or attempts to access sensitive LDAP attributes.
97+
- Review and update access controls and permissions for sensitive LDAP attributes to ensure they are restricted to only necessary personnel.
98+
- Conduct a post-incident analysis to identify any gaps in security controls and update policies or procedures to prevent similar incidents in the future.
99+
100+
==== Setup
101+
102+
103+
104+
*Setup*
105+
106+
107+
The 'Audit Directory Service Access' logging policy must be configured for (Success, Failure).
108+
Steps to implement the logging policy with Advanced Audit Configuration:
109+
110+
```
111+
Computer Configuration >
112+
Policies >
113+
Windows Settings >
114+
Security Settings >
115+
Advanced Audit Policies Configuration >
116+
Audit Policies >
117+
DS Access >
118+
Audit Directory Service Access (Success,Failure)
119+
```
120+
121+
122+
==== Rule query
123+
124+
125+
[source, js]
126+
----------------------------------
127+
any where host.os.type == "windows" and event.code == "4662" and
128+
129+
not winlog.event_data.SubjectUserSid : "S-1-5-18" and
130+
131+
winlog.event_data.Properties : (
132+
/* unixUserPassword */
133+
"*612cb747-c0e8-4f92-9221-fdd5f15b550d*",
134+
135+
/* ms-PKI-AccountCredentials */
136+
"*b8dfa744-31dc-4ef1-ac7c-84baf7ef9da7*",
137+
138+
/* ms-PKI-DPAPIMasterKeys */
139+
"*b3f93023-9239-4f7c-b99c-6745d87adbc2*",
140+
141+
/* msPKI-CredentialRoamingTokens */
142+
"*b7ff5a38-0818-42b0-8110-d3d154c97f24*"
143+
) and
144+
145+
/*
146+
Excluding noisy AccessMasks
147+
0x0 undefined and 0x100 Control Access
148+
https://learn.microsoft.com/en-us/windows/security/threat-protection/auditing/event-4662
149+
*/
150+
not winlog.event_data.AccessMask in ("0x0", "0x100")
151+
152+
----------------------------------
153+
154+
*Framework*: MITRE ATT&CK^TM^
155+
156+
* Tactic:
157+
** Name: Credential Access
158+
** ID: TA0006
159+
** Reference URL: https://attack.mitre.org/tactics/TA0006/
160+
* Technique:
161+
** Name: OS Credential Dumping
162+
** ID: T1003
163+
** Reference URL: https://attack.mitre.org/techniques/T1003/
164+
* Technique:
165+
** Name: Unsecured Credentials
166+
** ID: T1552
167+
** Reference URL: https://attack.mitre.org/techniques/T1552/
168+
* Sub-technique:
169+
** Name: Private Keys
170+
** ID: T1552.004
171+
** Reference URL: https://attack.mitre.org/techniques/T1552/004/
172+
* Tactic:
173+
** Name: Privilege Escalation
174+
** ID: TA0004
175+
** Reference URL: https://attack.mitre.org/tactics/TA0004/
176+
* Technique:
177+
** Name: Valid Accounts
178+
** ID: T1078
179+
** Reference URL: https://attack.mitre.org/techniques/T1078/
180+
* Sub-technique:
181+
** Name: Domain Accounts
182+
** ID: T1078.002
183+
** Reference URL: https://attack.mitre.org/techniques/T1078/002/

0 commit comments

Comments
 (0)