Skip to content

Commit f824731

Browse files
Update latest docs
1 parent f7f243b commit f824731

File tree

587 files changed

+25435
-2527
lines changed

Some content is hidden

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

587 files changed

+25435
-2527
lines changed
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
[[prebuilt-rule-8-15-8-active-directory-forced-authentication-from-linux-host-smb-named-pipes]]
2+
=== Active Directory Forced Authentication from Linux Host - SMB Named Pipes
3+
4+
Identifies a potential forced authentication using related SMB named pipes. Attackers may attempt to force targets to authenticate to a host controlled by them to capture hashes or enable relay attacks.
5+
6+
*Rule type*: eql
7+
8+
*Rule indices*:
9+
10+
* logs-endpoint.events.network-*
11+
* logs-system.security-*
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://github.com/p0dalirius/windows-coerced-authentication-methods
27+
* https://www.thehacker.recipes/a-d/movement/mitm-and-coerced-authentications
28+
* https://attack.mitre.org/techniques/T1187/
29+
30+
*Tags*:
31+
32+
* Domain: Endpoint
33+
* OS: Windows
34+
* OS: Linux
35+
* Use Case: Threat Detection
36+
* Tactic: Credential Access
37+
* Data Source: Elastic Defend
38+
* Data Source: Active Directory
39+
* Use Case: Active Directory Monitoring
40+
* Data Source: System
41+
42+
*Version*: 3
43+
44+
*Rule authors*:
45+
46+
* Elastic
47+
48+
*Rule license*: Elastic License v2
49+
50+
51+
==== Setup
52+
53+
54+
55+
*Setup*
56+
57+
58+
This rule uses Elastic Endpoint network events from Linux hosts and system integration events from Domain controllers
59+
for correlation. Both data sources should be collected from the hosts for this detection to work.
60+
61+
The 'Audit Detailed File Share' audit policy must be configured (Success Failure).
62+
Steps to implement the logging policy with Advanced Audit Configuration:
63+
```
64+
Computer Configuration >
65+
Policies >
66+
Windows Settings >
67+
Security Settings >
68+
Advanced Audit Policies Configuration >
69+
Audit Policies >
70+
Object Access >
71+
Audit Detailed File Share (Success,Failure)
72+
```
73+
74+
75+
==== Rule query
76+
77+
78+
[source, js]
79+
----------------------------------
80+
sequence with maxspan=15s
81+
[network where host.os.type == "linux" and event.action == "connection_attempted" and destination.port == 445 and not startswith~(string(destination.ip), string(host.ip))] by host.ip, data_stream.namespace
82+
[file where host.os.type == "windows" and event.code == "5145" and file.name : ("Spoolss", "netdfs", "lsarpc", "lsass", "netlogon", "samr", "efsrpc", "FssagentRpc")] by source.ip, data_stream.namespace
83+
84+
----------------------------------
85+
86+
*Framework*: MITRE ATT&CK^TM^
87+
88+
* Tactic:
89+
** Name: Credential Access
90+
** ID: TA0006
91+
** Reference URL: https://attack.mitre.org/tactics/TA0006/
92+
* Technique:
93+
** Name: Forced Authentication
94+
** ID: T1187
95+
** Reference URL: https://attack.mitre.org/techniques/T1187/
Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
[[prebuilt-rule-8-15-8-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+
19+
*Severity*: low
20+
21+
*Risk score*: 21
22+
23+
*Runs every*: 5m
24+
25+
*Searches indices from*: now-9m ({ref}/common-options.html#date-math[Date Math format], see also <<rule-schedule, `Additional look-back time`>>)
26+
27+
*Maximum alerts per execution*: 100
28+
29+
*References*: None
30+
31+
*Tags*:
32+
33+
* Domain: Endpoint
34+
* OS: Windows
35+
* Use Case: Threat Detection
36+
* Tactic: Defense Evasion
37+
* Tactic: Persistence
38+
* Data Source: Elastic Endgame
39+
* Resources: Investigation Guide
40+
* Data Source: Elastic Defend
41+
* Data Source: System
42+
* Data Source: Microsoft Defender for Endpoint
43+
* Data Source: Sysmon
44+
* Data Source: SentinelOne
45+
46+
*Version*: 313
47+
48+
*Rule authors*:
49+
50+
* Elastic
51+
52+
*Rule license*: Elastic License v2
53+
54+
55+
==== Investigation guide
56+
57+
58+
59+
*Triage and analysis*
60+
61+
62+
63+
*Investigating Adding Hidden File Attribute via Attrib*
64+
65+
66+
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.
67+
68+
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.
69+
70+
This rule looks for the execution of the `attrib.exe` utility with a command line that indicates the modification of the `Hidden` attribute.
71+
72+
> **Note**:
73+
> 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.
74+
75+
76+
*Possible investigation steps*
77+
78+
79+
- Identify the user account that performed the action and whether it should perform this kind of action.
80+
- Contact the account owner and confirm whether they are aware of this activity.
81+
- 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.
82+
- Investigate other alerts associated with the user/host during the past 48 hours.
83+
- Examine the command line to identify the target file or folder.
84+
- Examine the file, which process created it, header, etc.
85+
- 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.
86+
- Examine the host for derived artifacts that indicate suspicious activities:
87+
- Observe and collect information about the following activities in the alert subject host:
88+
- Attempts to contact external domains and addresses.
89+
- Use the Elastic Defend network events to determine domains and addresses contacted by the subject process by filtering by the process' `process.entity_id`.
90+
- Examine the DNS cache for suspicious or anomalous entries.
91+
- !{osquery{"label":"Osquery - Retrieve DNS Cache","query":"SELECT * FROM dns_cache"}}
92+
- Use the Elastic Defend registry events to examine registry keys accessed, modified, or created by the related processes in the process tree.
93+
- Examine the host services for suspicious or anomalous entries.
94+
- !{osquery{"label":"Osquery - Retrieve All Services","query":"SELECT description, display_name, name, path, pid, service_type, start_type, status, user_account FROM services"}}
95+
- !{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"}}
96+
- !{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"}}
97+
98+
99+
*False positive analysis*
100+
101+
102+
- This activity is unlikely to happen legitimately. Benign true positives (B-TPs) can be added as exceptions if necessary.
103+
104+
105+
*Response and remediation*
106+
107+
108+
- Initiate the incident response process based on the outcome of the triage.
109+
- Isolate the involved host to prevent further post-compromise behavior.
110+
- If the triage identified malware, search the environment for additional compromised hosts.
111+
- Implement temporary network rules, procedures, and segmentation to contain the malware.
112+
- Stop suspicious processes.
113+
- Immediately block the identified indicators of compromise (IoCs).
114+
- Inspect the affected systems for additional malware backdoors like reverse shells, reverse proxies, or droppers that attackers could use to reinfect the system.
115+
- Remove and block malicious artifacts identified during triage.
116+
- Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
117+
- 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.
118+
- Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
119+
- 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).
120+
121+
122+
==== Rule query
123+
124+
125+
[source, js]
126+
----------------------------------
127+
process where host.os.type == "windows" and event.type == "start" and
128+
(process.name : "attrib.exe" or ?process.pe.original_file_name == "ATTRIB.EXE") and process.args : "+h" and
129+
not (process.parent.name: "cmd.exe" and process.command_line: "attrib +R +H +S +A *.cui")
130+
131+
----------------------------------
132+
133+
*Framework*: MITRE ATT&CK^TM^
134+
135+
* Tactic:
136+
** Name: Defense Evasion
137+
** ID: TA0005
138+
** Reference URL: https://attack.mitre.org/tactics/TA0005/
139+
* Technique:
140+
** Name: File and Directory Permissions Modification
141+
** ID: T1222
142+
** Reference URL: https://attack.mitre.org/techniques/T1222/
143+
* Sub-technique:
144+
** Name: Windows File and Directory Permissions Modification
145+
** ID: T1222.001
146+
** Reference URL: https://attack.mitre.org/techniques/T1222/001/
147+
* Technique:
148+
** Name: Hide Artifacts
149+
** ID: T1564
150+
** Reference URL: https://attack.mitre.org/techniques/T1564/
151+
* Sub-technique:
152+
** Name: Hidden Files and Directories
153+
** ID: T1564.001
154+
** Reference URL: https://attack.mitre.org/techniques/T1564/001/
155+
* Tactic:
156+
** Name: Persistence
157+
** ID: TA0003
158+
** Reference URL: https://attack.mitre.org/tactics/TA0003/

0 commit comments

Comments
 (0)