Skip to content

Commit f1cdd4f

Browse files
Update latest docs (#6104)
1 parent 73aad62 commit f1cdd4f

File tree

1,398 files changed

+122814
-47967
lines changed

Some content is hidden

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

1,398 files changed

+122814
-47967
lines changed
Lines changed: 160 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
[[prebuilt-rule-8-16-1-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.forwarded*
13+
* logs-windows.sysmon_operational-*
14+
* endgame-*
15+
* logs-system.security*
16+
* logs-m365_defender.event-*
17+
* logs-sentinel_one_cloud_funnel.*
18+
* logs-crowdstrike.fdr*
19+
20+
*Severity*: low
21+
22+
*Risk score*: 21
23+
24+
*Runs every*: 5m
25+
26+
*Searches indices from*: now-9m ({ref}/common-options.html#date-math[Date Math format], see also <<rule-schedule, `Additional look-back time`>>)
27+
28+
*Maximum alerts per execution*: 100
29+
30+
*References*: None
31+
32+
*Tags*:
33+
34+
* Domain: Endpoint
35+
* OS: Windows
36+
* Use Case: Threat Detection
37+
* Tactic: Defense Evasion
38+
* Tactic: Persistence
39+
* Data Source: Elastic Endgame
40+
* Resources: Investigation Guide
41+
* Data Source: Elastic Defend
42+
* Data Source: System
43+
* Data Source: Microsoft Defender for Endpoint
44+
* Data Source: Sysmon
45+
* Data Source: SentinelOne
46+
* Data Source: Crowdstrike
47+
48+
*Version*: 314
49+
50+
*Rule authors*:
51+
52+
* Elastic
53+
54+
*Rule license*: Elastic License v2
55+
56+
57+
==== Investigation guide
58+
59+
60+
61+
*Triage and analysis*
62+
63+
64+
65+
*Investigating Adding Hidden File Attribute via Attrib*
66+
67+
68+
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.
69+
70+
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.
71+
72+
This rule looks for the execution of the `attrib.exe` utility with a command line that indicates the modification of the `Hidden` attribute.
73+
74+
> **Note**:
75+
> 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.
76+
77+
78+
*Possible investigation steps*
79+
80+
81+
- Identify the user account that performed the action and whether it should perform this kind of action.
82+
- Contact the account owner and confirm whether they are aware of this activity.
83+
- 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.
84+
- Investigate other alerts associated with the user/host during the past 48 hours.
85+
- Examine the command line to identify the target file or folder.
86+
- Examine the file, which process created it, header, etc.
87+
- 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.
88+
- Examine the host for derived artifacts that indicate suspicious activities:
89+
- Observe and collect information about the following activities in the alert subject host:
90+
- Attempts to contact external domains and addresses.
91+
- Use the Elastic Defend network events to determine domains and addresses contacted by the subject process by filtering by the process' `process.entity_id`.
92+
- Examine the DNS cache for suspicious or anomalous entries.
93+
- !{osquery{"label":"Osquery - Retrieve DNS Cache","query":"SELECT * FROM dns_cache"}}
94+
- Use the Elastic Defend registry events to examine registry keys accessed, modified, or created by the related processes in the process tree.
95+
- Examine the host services for suspicious or anomalous entries.
96+
- !{osquery{"label":"Osquery - Retrieve All Services","query":"SELECT description, display_name, name, path, pid, service_type, start_type, status, user_account FROM services"}}
97+
- !{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"}}
98+
- !{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"}}
99+
100+
101+
*False positive analysis*
102+
103+
104+
- This activity is unlikely to happen legitimately. Benign true positives (B-TPs) can be added as exceptions if necessary.
105+
106+
107+
*Response and remediation*
108+
109+
110+
- Initiate the incident response process based on the outcome of the triage.
111+
- Isolate the involved host to prevent further post-compromise behavior.
112+
- If the triage identified malware, search the environment for additional compromised hosts.
113+
- Implement temporary network rules, procedures, and segmentation to contain the malware.
114+
- Stop suspicious processes.
115+
- Immediately block the identified indicators of compromise (IoCs).
116+
- Inspect the affected systems for additional malware backdoors like reverse shells, reverse proxies, or droppers that attackers could use to reinfect the system.
117+
- Remove and block malicious artifacts identified during triage.
118+
- Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
119+
- 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.
120+
- Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
121+
- 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).
122+
123+
124+
==== Rule query
125+
126+
127+
[source, js]
128+
----------------------------------
129+
process where host.os.type == "windows" and event.type == "start" and
130+
(process.name : "attrib.exe" or ?process.pe.original_file_name == "ATTRIB.EXE") and process.args : "+h" and
131+
not (process.parent.name: "cmd.exe" and process.command_line: "attrib +R +H +S +A *.cui")
132+
133+
----------------------------------
134+
135+
*Framework*: MITRE ATT&CK^TM^
136+
137+
* Tactic:
138+
** Name: Defense Evasion
139+
** ID: TA0005
140+
** Reference URL: https://attack.mitre.org/tactics/TA0005/
141+
* Technique:
142+
** Name: File and Directory Permissions Modification
143+
** ID: T1222
144+
** Reference URL: https://attack.mitre.org/techniques/T1222/
145+
* Sub-technique:
146+
** Name: Windows File and Directory Permissions Modification
147+
** ID: T1222.001
148+
** Reference URL: https://attack.mitre.org/techniques/T1222/001/
149+
* Technique:
150+
** Name: Hide Artifacts
151+
** ID: T1564
152+
** Reference URL: https://attack.mitre.org/techniques/T1564/
153+
* Sub-technique:
154+
** Name: Hidden Files and Directories
155+
** ID: T1564.001
156+
** Reference URL: https://attack.mitre.org/techniques/T1564/001/
157+
* Tactic:
158+
** Name: Persistence
159+
** ID: TA0003
160+
** Reference URL: https://attack.mitre.org/tactics/TA0003/
Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
1+
[[prebuilt-rule-8-16-1-adfind-command-activity]]
2+
=== AdFind Command Activity
3+
4+
This rule detects the Active Directory query tool, AdFind.exe. AdFind has legitimate purposes, but it is frequently leveraged by threat actors to perform post-exploitation Active Directory reconnaissance. The AdFind tool has been observed in Trickbot, Ryuk, Maze, and FIN6 campaigns. For Winlogbeat, this rule requires Sysmon.
5+
6+
*Rule type*: eql
7+
8+
*Rule indices*:
9+
10+
* logs-endpoint.events.process-*
11+
* winlogbeat-*
12+
* logs-windows.forwarded*
13+
* logs-windows.sysmon_operational-*
14+
* endgame-*
15+
* logs-system.security*
16+
* logs-m365_defender.event-*
17+
* logs-sentinel_one_cloud_funnel.*
18+
* logs-crowdstrike.fdr*
19+
20+
*Severity*: low
21+
22+
*Risk score*: 21
23+
24+
*Runs every*: 5m
25+
26+
*Searches indices from*: now-9m ({ref}/common-options.html#date-math[Date Math format], see also <<rule-schedule, `Additional look-back time`>>)
27+
28+
*Maximum alerts per execution*: 100
29+
30+
*References*:
31+
32+
* http://www.joeware.net/freetools/tools/adfind/
33+
* https://thedfirreport.com/2020/05/08/adfind-recon/
34+
* https://www.fireeye.com/blog/threat-research/2020/05/tactics-techniques-procedures-associated-with-maze-ransomware-incidents.html
35+
* https://www.cybereason.com/blog/dropping-anchor-from-a-trickbot-infection-to-the-discovery-of-the-anchor-malware
36+
* https://www.fireeye.com/blog/threat-research/2019/04/pick-six-intercepting-a-fin6-intrusion.html
37+
* https://usa.visa.com/dam/VCOM/global/support-legal/documents/fin6-cybercrime-group-expands-threat-To-ecommerce-merchants.pdf
38+
39+
*Tags*:
40+
41+
* Domain: Endpoint
42+
* OS: Windows
43+
* Use Case: Threat Detection
44+
* Tactic: Discovery
45+
* Resources: Investigation Guide
46+
* Data Source: Elastic Endgame
47+
* Data Source: Elastic Defend
48+
* Data Source: System
49+
* Data Source: Microsoft Defender for Endpoint
50+
* Data Source: Sysmon
51+
* Data Source: SentinelOne
52+
* Data Source: Crowdstrike
53+
54+
*Version*: 314
55+
56+
*Rule authors*:
57+
58+
* Elastic
59+
60+
*Rule license*: Elastic License v2
61+
62+
63+
==== Investigation guide
64+
65+
66+
67+
*Triage and analysis*
68+
69+
70+
71+
*Investigating AdFind Command Activity*
72+
73+
74+
http://www.joeware.net/freetools/tools/adfind/[AdFind] is a freely available command-line tool used to retrieve information from Active Directory (AD). Network discovery and enumeration tools like `AdFind` are useful to adversaries in the same ways they are effective for network administrators. This tool provides quick ability to scope AD person/computer objects and understand subnets and domain information. There are many https://thedfirreport.com/category/adfind/[examples] of this tool being adopted by ransomware and criminal groups and used in compromises.
75+
76+
77+
*Possible investigation steps*
78+
79+
80+
- 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.
81+
- Identify the user account that performed the action and whether it should perform this kind of action.
82+
- Examine the command line to determine what information was retrieved by the tool.
83+
- Contact the account owner and confirm whether they are aware of this activity.
84+
- Investigate other alerts associated with the user/host during the past 48 hours.
85+
86+
87+
*False positive analysis*
88+
89+
90+
- This rule has a high chance to produce false positives as it is a legitimate tool used by network administrators.
91+
- If this rule is noisy in your environment due to expected activity, consider adding exceptions — preferably with a combination of user and command line conditions.
92+
- Malicious behavior with `AdFind` should be investigated as part of a step within an attack chain. It doesn't happen in isolation, so reviewing previous logs/activity from impacted machines can be very telling.
93+
94+
95+
*Related rules*
96+
97+
98+
- Windows Network Enumeration - 7b8bfc26-81d2-435e-965c-d722ee397ef1
99+
- Enumeration of Administrator Accounts - 871ea072-1b71-4def-b016-6278b505138d
100+
- Enumeration Command Spawned via WMIPrvSE - 770e0c4d-b998-41e5-a62e-c7901fd7f470
101+
102+
103+
*Response and remediation*
104+
105+
106+
- Initiate the incident response process based on the outcome of the triage.
107+
- Isolate the involved host to prevent further post-compromise behavior.
108+
- 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.
109+
- Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
110+
- Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
111+
- 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).
112+
113+
114+
==== Rule query
115+
116+
117+
[source, js]
118+
----------------------------------
119+
process where host.os.type == "windows" and event.type == "start" and
120+
(process.name : "AdFind*.exe" or ?process.pe.original_file_name == "AdFind.exe") and
121+
process.args : ("objectcategory=computer", "(objectcategory=computer)",
122+
"objectcategory=person", "(objectcategory=person)",
123+
"objectcategory=subnet", "(objectcategory=subnet)",
124+
"objectcategory=group", "(objectcategory=group)",
125+
"objectcategory=organizationalunit", "(objectcategory=organizationalunit)",
126+
"objectcategory=attributeschema", "(objectcategory=attributeschema)",
127+
"domainlist", "dcmodes", "adinfo", "dclist", "computers_pwnotreqd", "trustdmp")
128+
129+
----------------------------------
130+
131+
*Framework*: MITRE ATT&CK^TM^
132+
133+
* Tactic:
134+
** Name: Discovery
135+
** ID: TA0007
136+
** Reference URL: https://attack.mitre.org/tactics/TA0007/
137+
* Technique:
138+
** Name: System Network Configuration Discovery
139+
** ID: T1016
140+
** Reference URL: https://attack.mitre.org/techniques/T1016/
141+
* Technique:
142+
** Name: Remote System Discovery
143+
** ID: T1018
144+
** Reference URL: https://attack.mitre.org/techniques/T1018/
145+
* Technique:
146+
** Name: Permission Groups Discovery
147+
** ID: T1069
148+
** Reference URL: https://attack.mitre.org/techniques/T1069/
149+
* Sub-technique:
150+
** Name: Domain Groups
151+
** ID: T1069.002
152+
** Reference URL: https://attack.mitre.org/techniques/T1069/002/
153+
* Technique:
154+
** Name: Account Discovery
155+
** ID: T1087
156+
** Reference URL: https://attack.mitre.org/techniques/T1087/
157+
* Sub-technique:
158+
** Name: Domain Account
159+
** ID: T1087.002
160+
** Reference URL: https://attack.mitre.org/techniques/T1087/002/
161+
* Technique:
162+
** Name: Domain Trust Discovery
163+
** ID: T1482
164+
** Reference URL: https://attack.mitre.org/techniques/T1482/

0 commit comments

Comments
 (0)