Skip to content

Commit ad8dcbc

Browse files
[Detection Rules] Adding Documents for v8.11.17 Pre-Built Detection Rules (#5273)
1 parent 1ca90de commit ad8dcbc

File tree

265 files changed

+18962
-2113
lines changed

Some content is hidden

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

265 files changed

+18962
-2113
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
[[prebuilt-rule-8-11-17-account-password-reset-remotely]]
2+
=== Account Password Reset Remotely
3+
4+
Identifies an attempt to reset a potentially privileged account password remotely. Adversaries may manipulate account passwords to maintain access or evade password duration policies and preserve compromised credentials.
5+
6+
*Rule type*: eql
7+
8+
*Rule indices*:
9+
10+
* winlogbeat-*
11+
* logs-system.security*
12+
* logs-windows.forwarded*
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://docs.microsoft.com/en-us/windows/security/threat-protection/auditing/event-4724
27+
* https://stealthbits.com/blog/manipulating-user-passwords-with-mimikatz/
28+
* https://github.com/sbousseaden/EVTX-ATTACK-SAMPLES/blob/master/Credential%20Access/remote_pwd_reset_rpc_mimikatz_postzerologon_target_DC.evtx
29+
* https://www.elastic.co/security-labs/detect-credential-access
30+
31+
*Tags*:
32+
33+
* Domain: Endpoint
34+
* OS: Windows
35+
* Use Case: Threat Detection
36+
* Tactic: Persistence
37+
* Tactic: Impact
38+
39+
*Version*: 115
40+
41+
*Rule authors*:
42+
43+
* Elastic
44+
45+
*Rule license*: Elastic License v2
46+
47+
48+
==== Investigation guide
49+
50+
51+
52+
*Performance*
53+
54+
This rule may cause medium to high performance impact due to logic scoping all remote Windows logon activity.
55+
56+
57+
==== Rule query
58+
59+
60+
[source, js]
61+
----------------------------------
62+
sequence by winlog.computer_name with maxspan=1m
63+
[authentication where event.action == "logged-in" and
64+
/* event 4624 need to be logged */
65+
winlog.logon.type : "Network" and event.outcome == "success" and source.ip != null and
66+
source.ip != "127.0.0.1" and source.ip != "::1" and
67+
not winlog.event_data.TargetUserName : ("svc*", "PIM_*", "_*_", "*-*-*", "*$")] by winlog.event_data.TargetLogonId
68+
/* event 4724 need to be logged */
69+
[iam where event.action == "reset-password" and
70+
(
71+
/*
72+
This rule is very noisy if not scoped to privileged accounts, duplicate the
73+
rule and add your own naming convention and accounts of interest here.
74+
*/
75+
winlog.event_data.TargetUserName: ("*Admin*", "*super*", "*SVC*", "*DC0*", "*service*", "*DMZ*", "*ADM*") or
76+
winlog.event_data.TargetSid : ("S-1-5-21-*-500", "S-1-12-1-*-500")
77+
)
78+
] by winlog.event_data.SubjectLogonId
79+
80+
----------------------------------
81+
82+
*Framework*: MITRE ATT&CK^TM^
83+
84+
* Tactic:
85+
** Name: Persistence
86+
** ID: TA0003
87+
** Reference URL: https://attack.mitre.org/tactics/TA0003/
88+
* Technique:
89+
** Name: Account Manipulation
90+
** ID: T1098
91+
** Reference URL: https://attack.mitre.org/techniques/T1098/
92+
* Tactic:
93+
** Name: Impact
94+
** ID: TA0040
95+
** Reference URL: https://attack.mitre.org/tactics/TA0040/
96+
* Technique:
97+
** Name: Account Access Removal
98+
** ID: T1531
99+
** Reference URL: https://attack.mitre.org/techniques/T1531/
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
[[prebuilt-rule-8-11-17-adding-hidden-file-attribute-via-attrib]]
2+
=== Adding Hidden File Attribute via Attrib
3+
4+
Adversaries can add the 'hidden' attribute to files to hide them from the user in an attempt to evade detection.
5+
6+
*Rule type*: eql
7+
8+
*Rule indices*:
9+
10+
* winlogbeat-*
11+
* logs-endpoint.events.process-*
12+
* logs-windows.*
13+
* endgame-*
14+
* logs-system.security*
15+
16+
*Severity*: low
17+
18+
*Risk score*: 21
19+
20+
*Runs every*: 5m
21+
22+
*Searches indices from*: now-9m ({ref}/common-options.html#date-math[Date Math format], see also <<rule-schedule, `Additional look-back time`>>)
23+
24+
*Maximum alerts per execution*: 100
25+
26+
*References*: None
27+
28+
*Tags*:
29+
30+
* Domain: Endpoint
31+
* OS: Windows
32+
* Use Case: Threat Detection
33+
* Tactic: Defense Evasion
34+
* Tactic: Persistence
35+
* Data Source: Elastic Endgame
36+
* Resources: Investigation Guide
37+
* Data Source: Elastic Defend
38+
39+
*Version*: 112
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 Adding Hidden File Attribute via Attrib*
57+
58+
59+
The `Hidden` attribute is a file or folder attribute that makes the file or folder invisible to regular directory listings when the attribute is set.
60+
61+
Attackers can use this attribute to conceal tooling and malware to prevent administrators and users from finding it, even if they are looking specifically for it.
62+
63+
This rule looks for the execution of the `attrib.exe` utility with a command line that indicates the modification of the `Hidden` attribute.
64+
65+
> **Note**:
66+
> This investigation guide uses the https://www.elastic.co/guide/en/security/master/invest-guide-run-osquery.html[Osquery Markdown Plugin] introduced in Elastic Stack version 8.5.0. Older Elastic Stack versions will display unrendered Markdown in this guide.
67+
68+
69+
*Possible investigation steps*
70+
71+
72+
- Identify the user account that performed the action and whether it should perform this kind of action.
73+
- Contact the account owner and confirm whether they are aware of this activity.
74+
- 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.
75+
- Investigate other alerts associated with the user/host during the past 48 hours.
76+
- Examine the command line to identify the target file or folder.
77+
- Examine the file, which process created it, header, etc.
78+
- If suspicious, retrieve the files' SHA-256 hash values using the PowerShell `Get-FileHash` cmdlet and search for the existence and reputation of the hashes in resources like VirusTotal, Hybrid-Analysis, CISCO Talos, Any.run, etc.
79+
- Examine the host for derived artifacts that indicate suspicious activities:
80+
- Observe and collect information about the following activities in the alert subject host:
81+
- Attempts to contact external domains and addresses.
82+
- Use the Elastic Defend network events to determine domains and addresses contacted by the subject process by filtering by the process' `process.entity_id`.
83+
- Examine the DNS cache for suspicious or anomalous entries.
84+
- !{osquery{"label":"Osquery - Retrieve DNS Cache","query":"SELECT * FROM dns_cache"}}
85+
- Use the Elastic Defend registry events to examine registry keys accessed, modified, or created by the related processes in the process tree.
86+
- Examine the host services for suspicious or anomalous entries.
87+
- !{osquery{"label":"Osquery - Retrieve All Services","query":"SELECT description, display_name, name, path, pid, service_type, start_type, status, user_account FROM services"}}
88+
- !{osquery{"label":"Osquery - Retrieve Services Running on User Accounts","query":"SELECT description, display_name, name, path, pid, service_type, start_type, status, user_account FROM services WHERE\nNOT (user_account LIKE '%LocalSystem' OR user_account LIKE '%LocalService' OR user_account LIKE '%NetworkService' OR\nuser_account == null)\n"}}
89+
- !{osquery{"label":"Osquery - Retrieve Service Unsigned Executables with Virustotal Link","query":"SELECT concat('https://www.virustotal.com/gui/file/', sha1) AS VtLink, name, description, start_type, status, pid,\nservices.path FROM services JOIN authenticode ON services.path = authenticode.path OR services.module_path =\nauthenticode.path JOIN hash ON services.path = hash.path WHERE authenticode.result != 'trusted'\n"}}
90+
91+
92+
*False positive analysis*
93+
94+
95+
- This activity is unlikely to happen legitimately. Benign true positives (B-TPs) can be added as exceptions if necessary.
96+
97+
98+
*Response and remediation*
99+
100+
101+
- Initiate the incident response process based on the outcome of the triage.
102+
- Isolate the involved host to prevent further post-compromise behavior.
103+
- If the triage identified malware, search the environment for additional compromised hosts.
104+
- Implement temporary network rules, procedures, and segmentation to contain the malware.
105+
- Stop suspicious processes.
106+
- Immediately block the identified indicators of compromise (IoCs).
107+
- Inspect the affected systems for additional malware backdoors like reverse shells, reverse proxies, or droppers that attackers could use to reinfect the system.
108+
- Remove and block malicious artifacts identified during triage.
109+
- Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
110+
- 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.
111+
- Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
112+
- 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).
113+
114+
115+
==== Rule query
116+
117+
118+
[source, js]
119+
----------------------------------
120+
process where host.os.type == "windows" and event.type == "start" and
121+
(process.name : "attrib.exe" or ?process.pe.original_file_name == "ATTRIB.EXE") and process.args : "+h" and
122+
not (process.parent.name: "cmd.exe" and process.command_line: "attrib +R +H +S +A *.cui")
123+
124+
----------------------------------
125+
126+
*Framework*: MITRE ATT&CK^TM^
127+
128+
* Tactic:
129+
** Name: Defense Evasion
130+
** ID: TA0005
131+
** Reference URL: https://attack.mitre.org/tactics/TA0005/
132+
* Technique:
133+
** Name: File and Directory Permissions Modification
134+
** ID: T1222
135+
** Reference URL: https://attack.mitre.org/techniques/T1222/
136+
* Sub-technique:
137+
** Name: Windows File and Directory Permissions Modification
138+
** ID: T1222.001
139+
** Reference URL: https://attack.mitre.org/techniques/T1222/001/
140+
* Technique:
141+
** Name: Hide Artifacts
142+
** ID: T1564
143+
** Reference URL: https://attack.mitre.org/techniques/T1564/
144+
* Sub-technique:
145+
** Name: Hidden Files and Directories
146+
** ID: T1564.001
147+
** Reference URL: https://attack.mitre.org/techniques/T1564/001/
148+
* Tactic:
149+
** Name: Persistence
150+
** ID: TA0003
151+
** Reference URL: https://attack.mitre.org/tactics/TA0003/

0 commit comments

Comments
 (0)