-
Notifications
You must be signed in to change notification settings - Fork 191
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Detection Rules] Adding Documents for v8.10.9 Pre-Built Detection Ru…
…les (#4543) * Update latest docs * fixed broken links; added update description * removed deprecated rules * removed deprecation link * adjusted 'attempt-to-deactivate-mfa-for-an-okta-user-account' --------- Co-authored-by: terrancedejesus <[email protected]>
- Loading branch information
1 parent
c94812f
commit f397039
Showing
116 changed files
with
8,074 additions
and
185 deletions.
There are no files selected for viewing
98 changes: 98 additions & 0 deletions
98
...e-packages/8-10-9/prebuilt-rule-8-10-9-account-password-reset-remotely.asciidoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
[[prebuilt-rule-8-10-9-account-password-reset-remotely]] | ||
=== Account Password Reset Remotely | ||
|
||
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. | ||
|
||
*Rule type*: eql | ||
|
||
*Rule indices*: | ||
|
||
* winlogbeat-* | ||
* logs-system.security* | ||
* logs-windows.forwarded* | ||
|
||
*Severity*: medium | ||
|
||
*Risk score*: 47 | ||
|
||
*Runs every*: 5m | ||
|
||
*Searches indices from*: now-9m ({ref}/common-options.html#date-math[Date Math format], see also <<rule-schedule, `Additional look-back time`>>) | ||
|
||
*Maximum alerts per execution*: 100 | ||
|
||
*References*: | ||
|
||
* https://docs.microsoft.com/en-us/windows/security/threat-protection/auditing/event-4724 | ||
* https://stealthbits.com/blog/manipulating-user-passwords-with-mimikatz/ | ||
* https://github.com/sbousseaden/EVTX-ATTACK-SAMPLES/blob/master/Credential%20Access/remote_pwd_reset_rpc_mimikatz_postzerologon_target_DC.evtx | ||
* https://www.elastic.co/security-labs/detect-credential-access | ||
|
||
*Tags*: | ||
|
||
* Domain: Endpoint | ||
* OS: Windows | ||
* Use Case: Threat Detection | ||
* Tactic: Persistence | ||
* Tactic: Impact | ||
|
||
*Version*: 108 | ||
|
||
*Rule authors*: | ||
|
||
* Elastic | ||
|
||
*Rule license*: Elastic License v2 | ||
|
||
|
||
==== Investigation guide | ||
|
||
|
||
[source, markdown] | ||
---------------------------------- | ||
This rule may cause medium to high performance impact due to logic scoping all remote Windows logon activity. | ||
---------------------------------- | ||
|
||
==== Rule query | ||
|
||
|
||
[source, js] | ||
---------------------------------- | ||
sequence by winlog.computer_name with maxspan=1m | ||
[authentication where event.action == "logged-in" and | ||
/* event 4624 need to be logged */ | ||
winlog.logon.type : "Network" and event.outcome == "success" and source.ip != null and | ||
source.ip != "127.0.0.1" and source.ip != "::1" and | ||
not winlog.event_data.TargetUserName : ("svc*", "PIM_*", "_*_", "*-*-*", "*$")] by winlog.event_data.TargetLogonId | ||
/* event 4724 need to be logged */ | ||
[iam where event.action == "reset-password" and | ||
( | ||
/* | ||
This rule is very noisy if not scoped to privileged accounts, duplicate the | ||
rule and add your own naming convention and accounts of interest here. | ||
*/ | ||
winlog.event_data.TargetUserName: ("*Admin*", "*super*", "*SVC*", "*DC0*", "*service*", "*DMZ*", "*ADM*") or | ||
winlog.event_data.TargetSid : ("S-1-5-21-*-500", "S-1-12-1-*-500") | ||
) | ||
] by winlog.event_data.SubjectLogonId | ||
---------------------------------- | ||
|
||
*Framework*: MITRE ATT&CK^TM^ | ||
|
||
* Tactic: | ||
** Name: Persistence | ||
** ID: TA0003 | ||
** Reference URL: https://attack.mitre.org/tactics/TA0003/ | ||
* Technique: | ||
** Name: Account Manipulation | ||
** ID: T1098 | ||
** Reference URL: https://attack.mitre.org/techniques/T1098/ | ||
* Tactic: | ||
** Name: Impact | ||
** ID: TA0040 | ||
** Reference URL: https://attack.mitre.org/tactics/TA0040/ | ||
* Technique: | ||
** Name: Account Access Removal | ||
** ID: T1531 | ||
** Reference URL: https://attack.mitre.org/techniques/T1531/ |
142 changes: 142 additions & 0 deletions
142
...le-packages/8-10-9/prebuilt-rule-8-10-9-direct-outbound-smb-connection.asciidoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,142 @@ | ||
[[prebuilt-rule-8-10-9-direct-outbound-smb-connection]] | ||
=== Direct Outbound SMB Connection | ||
|
||
Identifies unexpected processes making network connections over port 445. Windows File Sharing is typically implemented over Server Message Block (SMB), which communicates between hosts using port 445. When legitimate, these network connections are established by the kernel. Processes making 445/tcp connections may be port scanners, exploits, or suspicious user-level processes moving laterally. | ||
|
||
*Rule type*: eql | ||
|
||
*Rule indices*: | ||
|
||
* winlogbeat-* | ||
* logs-endpoint.events.* | ||
* logs-windows.* | ||
|
||
*Severity*: medium | ||
|
||
*Risk score*: 47 | ||
|
||
*Runs every*: 5m | ||
|
||
*Searches indices from*: now-9m ({ref}/common-options.html#date-math[Date Math format], see also <<rule-schedule, `Additional look-back time`>>) | ||
|
||
*Maximum alerts per execution*: 100 | ||
|
||
*References*: None | ||
|
||
*Tags*: | ||
|
||
* Domain: Endpoint | ||
* OS: Windows | ||
* Use Case: Threat Detection | ||
* Tactic: Lateral Movement | ||
* Resources: Investigation Guide | ||
* Data Source: Elastic Defend | ||
|
||
*Version*: 108 | ||
|
||
*Rule authors*: | ||
|
||
* Elastic | ||
|
||
*Rule license*: Elastic License v2 | ||
|
||
|
||
==== Investigation guide | ||
|
||
|
||
[source, markdown] | ||
---------------------------------- | ||
## Triage and analysis | ||
### Investigating Direct Outbound SMB Connection | ||
This rule looks for unexpected processes making network connections over port 445. Windows file sharing is typically implemented over Server Message Block (SMB), which communicates between hosts using port 445. When legitimate, these network connections are established by the kernel (PID 4). Occurrences of non-system processes using this port can indicate port scanners, exploits, and tools used to move laterally on the environment. | ||
> **Note**: | ||
> This investigation guide uses the {security-guide}/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. | ||
#### Possible investigation steps | ||
- 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. | ||
- Investigate other alerts associated with the user/host during the past 48 hours. | ||
- Contact the account owner and confirm whether they are aware of this activity. | ||
- Investigate any abnormal behavior by the subject process such as network connections, registry or file modifications, and any spawned child processes. | ||
- Examine the host for derived artifacts that indicate suspicious activities: | ||
- Analyze the process executable using a private sandboxed analysis system. | ||
- Observe and collect information about the following activities in both the sandbox and the alert subject host: | ||
- Attempts to contact external domains and addresses. | ||
- Use the Elastic Defend network events to determine domains and addresses contacted by the subject process by filtering by the process' `process.entity_id`. | ||
- Examine the DNS cache for suspicious or anomalous entries. | ||
- !{osquery{"label":"Osquery - Retrieve DNS Cache","query":"SELECT * FROM dns_cache"}} | ||
- Use the Elastic Defend registry events to examine registry keys accessed, modified, or created by the related processes in the process tree. | ||
- Examine the host services for suspicious or anomalous entries. | ||
- !{osquery{"label":"Osquery - Retrieve All Services","query":"SELECT description, display_name, name, path, pid, service_type, start_type, status, user_account FROM services"}} | ||
- !{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"}} | ||
- !{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"}} | ||
- 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. | ||
- Investigate potentially compromised accounts. Analysts can do this by searching for login events (for example, 4624) to the target host after the registry modification. | ||
### False positive analysis | ||
- 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. | ||
### Response and remediation | ||
- Initiate the incident response process based on the outcome of the triage. | ||
- Isolate the involved host to prevent further post-compromise behavior. | ||
- If the triage identified malware, search the environment for additional compromised hosts. | ||
- Implement temporary network rules, procedures, and segmentation to contain the malware. | ||
- Stop suspicious processes. | ||
- Immediately block the identified indicators of compromise (IoCs). | ||
- Inspect the affected systems for additional malware backdoors like reverse shells, reverse proxies, or droppers that attackers could use to reinfect the system. | ||
- Remove and block malicious artifacts identified during triage. | ||
- Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components. | ||
- Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector. | ||
- 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). | ||
---------------------------------- | ||
|
||
==== Rule query | ||
|
||
|
||
[source, js] | ||
---------------------------------- | ||
sequence by process.entity_id with maxspan=2m | ||
[process where host.os.type == "windows" and event.type == "start" and process.pid != 4 and | ||
not user.id : ("S-1-5-19", "S-1-5-20") and | ||
not (process.code_signature.trusted == true and not process.code_signature.subject_name : ("Microsoft*", "Famatech Corp.", "Insecure.Com LLC")) and | ||
not (process.name : "powershell.exe" and process.args : "?:\\ProgramData\\Microsoft\\Windows Defender Advanced Threat Protection\\Downloads\\PSScript_*.ps1") and | ||
not (process.executable : "?:\\EnterpriseCare\\tools\\*\\bin\\java.exe" and process.args : "com.*.launcher.Invoker") and | ||
not (process.executable : "?:\\Docusnap*\\Tools\\*\\nmap.exe" and process.args : "smb-os-discovery.nse") and | ||
not process.executable : | ||
("?:\\Program Files\\*.exe", | ||
"?:\\Program Files (x86)\\*.exe", | ||
"?:\\Windows\\ProPatches\\Installation\\InstallationSandbox*\\stdeploy.exe", | ||
"?:\\Program Files (x86)\\Fortinet\\FSAE\\collectoragent.exe", | ||
"?:\\Program Files (x86)\\Nmap\\nmap.exe", | ||
"?:\\Program Files\\Azure Advanced Threat Protection Sensor\\*\\Microsoft.Tri.Sensor.exe", | ||
"?:\\Program Files\\CloudMatters\\auvik\\AuvikService-release-*\\AuvikService.exe", | ||
"?:\\Program Files\\uptime software\\uptime\\UptimeDataCollector.exe", | ||
"?:\\Program Files\\CloudMatters\\auvik\\AuvikAgentService.exe", | ||
"?:\\Program Files\\Rumble\\rumble-agent-*.exe")] | ||
[network where host.os.type == "windows" and destination.port == 445 and process.pid != 4 and | ||
not cidrmatch(destination.ip, "127.0.0.1", "::1")] | ||
until [process where host.os.type == "windows" and event.type == "end"] | ||
---------------------------------- | ||
|
||
*Framework*: MITRE ATT&CK^TM^ | ||
|
||
* Tactic: | ||
** Name: Lateral Movement | ||
** ID: TA0008 | ||
** Reference URL: https://attack.mitre.org/tactics/TA0008/ | ||
* Technique: | ||
** Name: Remote Services | ||
** ID: T1021 | ||
** Reference URL: https://attack.mitre.org/techniques/T1021/ | ||
* Sub-technique: | ||
** Name: SMB/Windows Admin Shares | ||
** ID: T1021.002 | ||
** Reference URL: https://attack.mitre.org/techniques/T1021/002/ |
130 changes: 130 additions & 0 deletions
130
...ges/8-10-9/prebuilt-rule-8-10-9-exchange-mailbox-export-via-powershell.asciidoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
[[prebuilt-rule-8-10-9-exchange-mailbox-export-via-powershell]] | ||
=== Exchange Mailbox Export via PowerShell | ||
|
||
Identifies the use of the Exchange PowerShell cmdlet, New-MailBoxExportRequest, to export the contents of a primary mailbox or archive to a .pst file. Adversaries may target user email to collect sensitive information. | ||
|
||
*Rule type*: query | ||
|
||
*Rule indices*: | ||
|
||
* winlogbeat-* | ||
* logs-windows.* | ||
|
||
*Severity*: medium | ||
|
||
*Risk score*: 47 | ||
|
||
*Runs every*: 5m | ||
|
||
*Searches indices from*: now-9m ({ref}/common-options.html#date-math[Date Math format], see also <<rule-schedule, `Additional look-back time`>>) | ||
|
||
*Maximum alerts per execution*: 100 | ||
|
||
*References*: | ||
|
||
* https://www.volexity.com/blog/2020/12/14/dark-halo-leverages-solarwinds-compromise-to-breach-organizations/ | ||
* https://docs.microsoft.com/en-us/powershell/module/exchange/new-mailboxexportrequest?view=exchange-ps | ||
* https://www.elastic.co/security-labs/siestagraph-new-implant-uncovered-in-asean-member-foreign-ministry | ||
|
||
*Tags*: | ||
|
||
* Domain: Endpoint | ||
* OS: Windows | ||
* Use Case: Threat Detection | ||
* Tactic: Collection | ||
* Resources: Investigation Guide | ||
* Data Source: PowerShell Logs | ||
|
||
*Version*: 7 | ||
|
||
*Rule authors*: | ||
|
||
* Elastic | ||
|
||
*Rule license*: Elastic License v2 | ||
|
||
|
||
==== Investigation guide | ||
|
||
|
||
[source, markdown] | ||
---------------------------------- | ||
## Triage and analysis | ||
### Investigating Exchange Mailbox Export via PowerShell | ||
The `New-MailBoxExportRequest` cmdlet is used to begin the process of exporting contents of a primary mailbox or archive to a .pst file. Note that this is done on a per-mailbox basis and this cmdlet is available only in on-premises Exchange. | ||
Attackers can abuse this functionality in preparation for exfiltrating contents, which is likely to contain sensitive and strategic data. | ||
#### Possible investigation steps | ||
- 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. | ||
- Investigate other alerts associated with the user/host during the past 48 hours. | ||
- Investigate the export operation: | ||
- Identify the user account that performed the action and whether it should perform this kind of action. | ||
- Contact the account owner and confirm whether they are aware of this activity. | ||
- Check if this operation was approved and performed according to the organization's change management policy. | ||
- Retrieve the operation status and use the `Get-MailboxExportRequest` cmdlet to review previous requests. | ||
- By default, no group in Exchange has the privilege to import or export mailboxes. Investigate administrators that assigned the "Mailbox Import Export" privilege for abnormal activity. | ||
- Investigate if there is a significant quantity of export requests in the alert timeframe. This operation is done on a per-mailbox basis and can be part of a mass export. | ||
- If the operation was completed successfully: | ||
- Check if the file is on the path specified in the command. | ||
- Investigate if the file was compressed, archived, or retrieved by the attacker for exfiltration. | ||
### False positive analysis | ||
- This mechanism can be used legitimately. Analysts can dismiss the alert if the administrator is aware of the activity and it is done with proper approval. | ||
### Response and remediation | ||
- Initiate the incident response process based on the outcome of the triage. | ||
- If the involved host is not the Exchange server, isolate the host to prevent further post-compromise behavior. | ||
- Use the `Remove-MailboxExportRequest` cmdlet to remove fully or partially completed export requests. | ||
- Prioritize cases that involve personally identifiable information (PII) or other classified data. | ||
- 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. | ||
- Review the privileges of users with the "Mailbox Import Export" privilege to ensure that the least privilege principle is being followed. | ||
- Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components. | ||
- Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector. | ||
- 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). | ||
---------------------------------- | ||
|
||
==== Rule query | ||
|
||
|
||
[source, js] | ||
---------------------------------- | ||
event.category:process and host.os.type:windows and | ||
powershell.file.script_block_text : "New-MailboxExportRequest" and | ||
not ( | ||
file.path : ( | ||
?\:\\\\Users\\\\*\\\\AppData\\\\Roaming\\\\Microsoft\\\\Exchange\\\\RemotePowerShell\\\\* or | ||
?\:\\\\Users\\\\*\\\\AppData\\\\Local\\\\Temp\\\\tmp_????????.???\\\\tmp_????????.???.ps?1* or | ||
?\:\\\\Windows\\\\TEMP\\\\tmp_????????.???\\\\tmp_????????.???.ps?1* | ||
) and file.name:(*.psd1 or *.psm1) | ||
) | ||
---------------------------------- | ||
|
||
*Framework*: MITRE ATT&CK^TM^ | ||
|
||
* Tactic: | ||
** Name: Collection | ||
** ID: TA0009 | ||
** Reference URL: https://attack.mitre.org/tactics/TA0009/ | ||
* Technique: | ||
** Name: Data from Local System | ||
** ID: T1005 | ||
** Reference URL: https://attack.mitre.org/techniques/T1005/ | ||
* Technique: | ||
** Name: Email Collection | ||
** ID: T1114 | ||
** Reference URL: https://attack.mitre.org/techniques/T1114/ | ||
* Sub-technique: | ||
** Name: Local Email Collection | ||
** ID: T1114.001 | ||
** Reference URL: https://attack.mitre.org/techniques/T1114/001/ | ||
* Sub-technique: | ||
** Name: Remote Email Collection | ||
** ID: T1114.002 | ||
** Reference URL: https://attack.mitre.org/techniques/T1114/002/ |
Oops, something went wrong.