[Security Content] Add Investigation Guides to Windows Rules - 2 (#2534)
* [Security Content] Add Investigation Guides to Windows Rules - 2 * tags * Adjust some phrasing based on the review * Update credential_access_bruteforce_admin_account.toml * Missing Osquery Note * Missing note
This commit is contained in:
@@ -45,7 +45,7 @@ This rule uses a machine learning job to detect a Windows process that is rare a
|
||||
- Validate the activity is not related to planned patches, updates, network administrator activity, or legitimate software installations.
|
||||
- Validate if the activity has a consistent cadence (for example, if it runs monthly or quarterly), as it could be part of a monthly or quarterly business process.
|
||||
- Examine the arguments and working directory of the process. These may provide indications as to the source of the program or the nature of the tasks it is performing.
|
||||
- Examine the host for derived artifacts that indicates suspicious activities:
|
||||
- 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.
|
||||
|
||||
@@ -45,7 +45,7 @@ This rule uses a machine learning job to detect a Windows process that is rare a
|
||||
- Validate the activity is not related to planned patches, updates, network administrator activity, or legitimate software installations.
|
||||
- Validate if the activity has a consistent cadence (for example, if it runs monthly or quarterly), as it could be part of a monthly or quarterly business process.
|
||||
- Examine the arguments and working directory of the process. These may provide indications as to the source of the program or the nature of the tasks it is performing.
|
||||
- Examine the host for derived artifacts that indicates suspicious activities:
|
||||
- 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.
|
||||
|
||||
@@ -48,7 +48,7 @@ This rule uses a machine learning job to detect an anomalous Windows process wit
|
||||
- Validate the activity is not related to planned patches, updates, network administrator activity, or legitimate software installations.
|
||||
- Validate if the activity has a consistent cadence (for example, if it runs monthly or quarterly), as it could be part of a monthly or quarterly business process.
|
||||
- Examine the arguments and working directory of the process. These may provide indications as to the source of the program or the nature of the tasks it is performing.
|
||||
- Examine the host for derived artifacts that indicates suspicious activities:
|
||||
- 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.
|
||||
|
||||
@@ -34,7 +34,7 @@ This rule looks for network events where `certutil.exe` contacts IP ranges other
|
||||
- Investigate other alerts associated with the user/host during the past 48 hours.
|
||||
- Investigate if the downloaded file was executed.
|
||||
- Determine the context in which `certutil.exe` and the file were run.
|
||||
- Examine the host for derived artifacts that indicates suspicious activities:
|
||||
- Examine the host for derived artifacts that indicate suspicious activities:
|
||||
- Analyze the downloaded file 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.
|
||||
|
||||
@@ -36,7 +36,7 @@ This rule looks for processes outside known legitimate program locations communi
|
||||
- Investigate other alerts associated with the user/host during the past 48 hours.
|
||||
- Verify whether the digital signature exists in the executable.
|
||||
- Identify the operation type (upload, download, tunneling, etc.).
|
||||
- Examine the host for derived artifacts that indicates suspicious activities:
|
||||
- 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.
|
||||
|
||||
@@ -36,7 +36,7 @@ The `Desktopimgdownldr.exe` utility is used to to configure lockscreen/desktop i
|
||||
- Investigate other alerts associated with the user/host during the past 48 hours.
|
||||
- Assess whether this behavior is prevalent in the environment by looking for similar occurrences across hosts.
|
||||
- Check the reputation of the domain or IP address used to host the downloaded file or if the user downloaded the file from an internal system.
|
||||
- Examine the host for derived artifacts that indicates suspicious activities:
|
||||
- Examine the host for derived artifacts that indicate suspicious activities:
|
||||
- Analyze the file 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.
|
||||
|
||||
@@ -32,7 +32,7 @@ The `MpCmdRun.exe` is a command-line tool part of Windows Defender and is used t
|
||||
- Contact the account owner and confirm whether they are aware of this activity.
|
||||
- Investigate other alerts associated with the user/host during the past 48 hours.
|
||||
- Check the reputation of the domain or IP address used to host the downloaded file.
|
||||
- Examine the host for derived artifacts that indicates suspicious activities:
|
||||
- Examine the host for derived artifacts that indicate suspicious activities:
|
||||
- Analyze the file 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.
|
||||
|
||||
@@ -32,7 +32,7 @@ PowerShell is one of system administrators' main tools for automation, report ro
|
||||
- Evaluate whether the user needs to use PowerShell to complete tasks.
|
||||
- Investigate other alerts associated with the user/host during the past 48 hours.
|
||||
- Check the reputation of the domain or IP address used to host the downloaded file.
|
||||
- Examine the host for derived artifacts that indicates suspicious activities:
|
||||
- Examine the host for derived artifacts that indicate suspicious activities:
|
||||
- Analyze the file 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.
|
||||
|
||||
@@ -33,7 +33,7 @@ This rule looks for DLLs and executables downloaded using `cscript.exe` or `wscr
|
||||
#### 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.
|
||||
- Examine the host for derived artifacts that indicates suspicious activities:
|
||||
- Examine the host for derived artifacts that indicate suspicious activities:
|
||||
- Analyze both the script and the executable involved 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.
|
||||
|
||||
@@ -33,7 +33,7 @@ This rule identifies suspicious network connections that attempt to blend in wit
|
||||
#### 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.
|
||||
- Examine the host for derived artifacts that indicates suspicious activities:
|
||||
- Examine the host for derived artifacts that indicate suspicious activities:
|
||||
- Analyze the executable involved 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.
|
||||
|
||||
@@ -31,7 +31,7 @@ TeamViewer is a remote access and remote control tool used by helpdesks and syst
|
||||
- Contact the user to gather information about who and why was conducting the remote access.
|
||||
- Investigate other alerts associated with the user/host during the past 48 hours.
|
||||
- Check whether the company uses TeamViewer for the support activities and if there is a support ticket related to this access.
|
||||
- Examine the host for derived artifacts that indicates suspicious activities:
|
||||
- Examine the host for derived artifacts that indicate suspicious activities:
|
||||
- Analyze the file 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.
|
||||
|
||||
@@ -4,7 +4,7 @@ integration = ["system", "windows"]
|
||||
maturity = "production"
|
||||
min_stack_comments = "New fields added: required_fields, related_integrations, setup"
|
||||
min_stack_version = "8.3.0"
|
||||
updated_date = "2023/02/01"
|
||||
updated_date = "2023/02/09"
|
||||
|
||||
[rule]
|
||||
author = ["Elastic"]
|
||||
@@ -20,27 +20,48 @@ license = "Elastic License v2"
|
||||
name = "Privileged Account Brute Force"
|
||||
note = """## Triage and analysis
|
||||
|
||||
### Investigating Privileged Account Brute Force
|
||||
|
||||
Adversaries with no prior knowledge of legitimate credentials within the system or environment may guess passwords to attempt access to accounts. Without knowledge of the password for an account, an adversary may opt to guess the password using a repetitive or iterative mechanism systematically. More details can be found [here](https://attack.mitre.org/techniques/T1110/001/).
|
||||
|
||||
This rule identifies potential password guessing/brute force activity from a single address against an account that contains the `admin` pattern on its name, which is likely a highly privileged account.
|
||||
|
||||
> **Note**:
|
||||
> This investigation guide uses the [Osquery Markdown Plugin](https://www.elastic.co/guide/en/security/master/invest-guide-run-osquery.html) introduced in Elastic Stack version 8.5.0. Older Elastic Stack versions will display unrendered Markdown in this guide.
|
||||
|
||||
#### Possible investigation steps
|
||||
|
||||
- Investigate the logon failure reason code and the targeted user names.
|
||||
- Investigate the logon failure reason code and the targeted user name.
|
||||
- Prioritize the investigation if the account is critical or has administrative privileges over the domain.
|
||||
- Investigate the source IP address of the failed Network Logon attempts.
|
||||
- Investigate other alerts associated with the user/host during the past 48 hours.
|
||||
- Identify whether these attempts are coming from the internet or are internal.
|
||||
- Investigate other alerts associated with the involved users and source host during the past 48 hours.
|
||||
- Identify the source and the target computer and their roles in the IT environment.
|
||||
- Check whether the involved credentials are used in automation or scheduled tasks.
|
||||
- If this activity is suspicious, contact the account owner and confirm whether they are aware of it.
|
||||
- Examine the source host for derived artifacts that indicate compromise:
|
||||
- Observe and collect information about the following activities in the alert source host:
|
||||
- Attempts to contact external domains and addresses.
|
||||
- Examine the DNS cache for suspicious or anomalous entries.
|
||||
- !{osquery{"query":"SELECT * FROM dns_cache", "label":"Osquery - Retrieve DNS Cache"}}
|
||||
- Examine the host services for suspicious or anomalous entries.
|
||||
- !{osquery{"query":"SELECT description, display_name, name, path, pid, service_type, start_type, status, user_account FROM services","label":"Osquery - Retrieve All Services"}}
|
||||
- !{osquery{"query":"SELECT description, display_name, name, path, pid, service_type, start_type, status, user_account FROM services WHERE NOT (user_account LIKE '%LocalSystem' OR user_account LIKE '%LocalService' OR user_account LIKE '%NetworkService' OR user_account == null)","label":"Osquery - Retrieve Services Running on User Accounts"}}
|
||||
- !{osquery{"query":"SELECT concat('https://www.virustotal.com/gui/file/', sha1) AS VtLink, name, description, start_type, status, pid, services.path FROM services JOIN authenticode ON services.path = authenticode.path OR services.module_path = authenticode.path JOIN hash ON services.path = hash.path WHERE authenticode.result != 'trusted'","label":"Osquery - Retrieve Service Unsigned Executables with Virustotal Link"}}
|
||||
- Investigate potentially compromised accounts. Analysts can do this by searching for login events (for example, 4624) to the host which is the source of this activity.
|
||||
|
||||
### False positive analysis
|
||||
|
||||
- Authentication misconfiguration or obsolete credentials.
|
||||
- Service account password expired.
|
||||
- Trust relationship between the primary domain and the trusted domain issue.
|
||||
- Infrastructure or availability issue.
|
||||
- Domain trust relationship issues.
|
||||
- Infrastructure or availability issues.
|
||||
|
||||
### Response and remediation
|
||||
|
||||
- Initiate the incident response process based on the outcome of the triage.
|
||||
- If the host is a domain controller (DC):
|
||||
- Activate your incident response plan for total Active Directory compromise.
|
||||
- Review the privileges assigned to users that can access the DCs, to ensure that the least privilege principle is being followed and to reduce the attack surface.
|
||||
- Isolate the involved hosts to prevent further post-compromise behavior.
|
||||
- Isolate the source host to prevent further post-compromise behavior.
|
||||
- If the asset is exposed to the internet with RDP or other remote services available, take the necessary measures to restrict access to the asset. If not possible, limit the access via the firewall to only the needed IP addresses. Also, ensure the system uses robust authentication mechanisms and is patched regularly.
|
||||
- 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.
|
||||
- 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.
|
||||
@@ -54,7 +75,7 @@ references = ["https://docs.microsoft.com/en-us/windows/security/threat-protecti
|
||||
risk_score = 47
|
||||
rule_id = "f9790abf-bd0c-45f9-8b5f-d0b74015e029"
|
||||
severity = "medium"
|
||||
tags = ["Elastic", "Host", "Windows", "Threat Detection", "Credential Access"]
|
||||
tags = ["Elastic", "Host", "Windows", "Threat Detection", "Credential Access", "Investigation Guide"]
|
||||
type = "eql"
|
||||
|
||||
query = '''
|
||||
|
||||
+35
-10
@@ -4,7 +4,7 @@ integration = ["system", "windows"]
|
||||
maturity = "production"
|
||||
min_stack_comments = "New fields added: required_fields, related_integrations, setup"
|
||||
min_stack_version = "8.3.0"
|
||||
updated_date = "2023/02/01"
|
||||
updated_date = "2023/02/09"
|
||||
|
||||
[rule]
|
||||
author = ["Elastic"]
|
||||
@@ -20,27 +20,52 @@ license = "Elastic License v2"
|
||||
name = "Multiple Logon Failure Followed by Logon Success"
|
||||
note = """## Triage and analysis
|
||||
|
||||
### Investigating Multiple Logon Failure Followed by Logon Success
|
||||
|
||||
Adversaries with no prior knowledge of legitimate credentials within the system or environment may guess passwords to attempt access to accounts. Without knowledge of the password for an account, an adversary may opt to guess the password using a repetitive or iterative mechanism systematically. More details can be found [here](https://attack.mitre.org/techniques/T1110/001/).
|
||||
|
||||
This rule identifies potential password guessing/brute force activity from a single address, followed by a successful logon, indicating that an attacker potentially successfully compromised the account.
|
||||
|
||||
> **Note**:
|
||||
> This investigation guide uses the [Osquery Markdown Plugin](https://www.elastic.co/guide/en/security/master/invest-guide-run-osquery.html) introduced in Elastic Stack version 8.5.0. Older Elastic Stack versions will display unrendered Markdown in this guide.
|
||||
|
||||
#### Possible investigation steps
|
||||
|
||||
- Investigate the logon failure reason code and the targeted user names.
|
||||
- Investigate the logon failure reason code and the targeted user name.
|
||||
- Prioritize the investigation if the account is critical or has administrative privileges over the domain.
|
||||
- Investigate the source IP address of the failed Network Logon attempts.
|
||||
- Investigate other alerts associated with the user/host during the past 48 hours.
|
||||
- Identify whether these attempts are coming from the internet or are internal.
|
||||
- Investigate other alerts associated with the involved users and source host during the past 48 hours.
|
||||
- Identify the source and the target computer and their roles in the IT environment.
|
||||
- Check whether the involved credentials are used in automation or scheduled tasks.
|
||||
- If this activity is suspicious, contact the account owner and confirm whether they are aware of it.
|
||||
- Examine the source host for derived artifacts that indicate compromise:
|
||||
- Observe and collect information about the following activities in the alert source host:
|
||||
- Attempts to contact external domains and addresses.
|
||||
- Examine the DNS cache for suspicious or anomalous entries.
|
||||
- !{osquery{"query":"SELECT * FROM dns_cache", "label":"Osquery - Retrieve DNS Cache"}}
|
||||
- Examine the host services for suspicious or anomalous entries.
|
||||
- !{osquery{"query":"SELECT description, display_name, name, path, pid, service_type, start_type, status, user_account FROM services","label":"Osquery - Retrieve All Services"}}
|
||||
- !{osquery{"query":"SELECT description, display_name, name, path, pid, service_type, start_type, status, user_account FROM services WHERE NOT (user_account LIKE '%LocalSystem' OR user_account LIKE '%LocalService' OR user_account LIKE '%NetworkService' OR user_account == null)","label":"Osquery - Retrieve Services Running on User Accounts"}}
|
||||
- !{osquery{"query":"SELECT concat('https://www.virustotal.com/gui/file/', sha1) AS VtLink, name, description, start_type, status, pid, services.path FROM services JOIN authenticode ON services.path = authenticode.path OR services.module_path = authenticode.path JOIN hash ON services.path = hash.path WHERE authenticode.result != 'trusted'","label":"Osquery - Retrieve Service Unsigned Executables with Virustotal Link"}}
|
||||
- Investigate potentially compromised accounts. Analysts can do this by searching for login events (for example, 4624) to the host which is the source of this activity.
|
||||
|
||||
### False positive analysis
|
||||
|
||||
- Authentication misconfiguration or obsolete credentials.
|
||||
- Service account password expired.
|
||||
- Trust relationship between the primary domain and the trusted domain issue.
|
||||
- Infrastructure or availability issue.
|
||||
- Domain trust relationship issues.
|
||||
- Infrastructure or availability issues.
|
||||
|
||||
### Related rules
|
||||
|
||||
- Multiple Logon Failure from the same Source Address - 48b6edfc-079d-4907-b43c-baffa243270d
|
||||
|
||||
### Response and remediation
|
||||
|
||||
- Initiate the incident response process based on the outcome of the triage.
|
||||
- If the host is a domain controller (DC):
|
||||
- Activate your incident response plan for total Active Directory compromise.
|
||||
- Review the privileges assigned to users that can access the DCs, to ensure that the least privilege principle is being followed and to reduce the attack surface.
|
||||
- Isolate the involved hosts to prevent further post-compromise behavior.
|
||||
- Isolate the source host to prevent further post-compromise behavior.
|
||||
- If the asset is exposed to the internet with RDP or other remote services available, take the necessary measures to restrict access to the asset. If not possible, limit the access via the firewall to only the needed IP addresses. Also, ensure the system uses robust authentication mechanisms and is patched regularly.
|
||||
- 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.
|
||||
- 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.
|
||||
@@ -54,7 +79,7 @@ references = ["https://docs.microsoft.com/en-us/windows/security/threat-protecti
|
||||
risk_score = 47
|
||||
rule_id = "4e85dc8a-3e41-40d8-bc28-91af7ac6cf60"
|
||||
severity = "medium"
|
||||
tags = ["Elastic", "Host", "Windows", "Threat Detection", "Credential Access"]
|
||||
tags = ["Elastic", "Host", "Windows", "Threat Detection", "Credential Access", "Investigation Guide"]
|
||||
type = "eql"
|
||||
|
||||
query = '''
|
||||
|
||||
@@ -4,7 +4,7 @@ integration = ["system", "windows"]
|
||||
maturity = "production"
|
||||
min_stack_comments = "New fields added: required_fields, related_integrations, setup"
|
||||
min_stack_version = "8.3.0"
|
||||
updated_date = "2023/02/01"
|
||||
updated_date = "2023/02/09"
|
||||
|
||||
[rule]
|
||||
author = ["Elastic"]
|
||||
@@ -20,19 +20,43 @@ license = "Elastic License v2"
|
||||
name = "Multiple Logon Failure from the same Source Address"
|
||||
note = """## Triage and analysis
|
||||
|
||||
### Investigating Multiple Logon Failure from the same Source Address
|
||||
|
||||
Adversaries with no prior knowledge of legitimate credentials within the system or environment may guess passwords to attempt access to accounts. Without knowledge of the password for an account, an adversary may opt to guess the password using a repetitive or iterative mechanism systematically. More details can be found [here](https://attack.mitre.org/techniques/T1110/001/).
|
||||
|
||||
This rule identifies potential password guessing/brute force activity from a single address.
|
||||
|
||||
> **Note**:
|
||||
> This investigation guide uses the [Osquery Markdown Plugin](https://www.elastic.co/guide/en/security/master/invest-guide-run-osquery.html) introduced in Elastic Stack version 8.5.0. Older Elastic Stack versions will display unrendered Markdown in this guide.
|
||||
|
||||
#### Possible investigation steps
|
||||
|
||||
- Investigate the logon failure reason code and the targeted user names.
|
||||
- Prioritize the investigation if the account is critical or has administrative privileges over the domain.
|
||||
- Investigate the source IP address of the failed Network Logon attempts.
|
||||
- Investigate other alerts associated with the user/host during the past 48 hours.
|
||||
- Identify whether these attempts are coming from the internet or are internal.
|
||||
- Investigate other alerts associated with the involved users and source host during the past 48 hours.
|
||||
- Identify the source and the target computer and their roles in the IT environment.
|
||||
- Check whether the involved credentials are used in automation or scheduled tasks.
|
||||
- If this activity is suspicious, contact the account owner and confirm whether they are aware of it.
|
||||
- Examine the source host for derived artifacts that indicate compromise:
|
||||
- Observe and collect information about the following activities in the alert source host:
|
||||
- Attempts to contact external domains and addresses.
|
||||
- Examine the DNS cache for suspicious or anomalous entries.
|
||||
- !{osquery{"query":"SELECT * FROM dns_cache", "label":"Osquery - Retrieve DNS Cache"}}
|
||||
- Examine the host services for suspicious or anomalous entries.
|
||||
- !{osquery{"query":"SELECT description, display_name, name, path, pid, service_type, start_type, status, user_account FROM services","label":"Osquery - Retrieve All Services"}}
|
||||
- !{osquery{"query":"SELECT description, display_name, name, path, pid, service_type, start_type, status, user_account FROM services WHERE NOT (user_account LIKE '%LocalSystem' OR user_account LIKE '%LocalService' OR user_account LIKE '%NetworkService' OR user_account == null)","label":"Osquery - Retrieve Services Running on User Accounts"}}
|
||||
- !{osquery{"query":"SELECT concat('https://www.virustotal.com/gui/file/', sha1) AS VtLink, name, description, start_type, status, pid, services.path FROM services JOIN authenticode ON services.path = authenticode.path OR services.module_path = authenticode.path JOIN hash ON services.path = hash.path WHERE authenticode.result != 'trusted'","label":"Osquery - Retrieve Service Unsigned Executables with Virustotal Link"}}
|
||||
- Investigate potentially compromised accounts. Analysts can do this by searching for login events (for example, 4624) to the host which is the source of this activity
|
||||
|
||||
### False positive analysis
|
||||
|
||||
- Understand the context of the authentications by contacting the asset owners. This activity can be related to a new or existing automation or business process that is in a failing state.
|
||||
- Authentication misconfiguration or obsolete credentials.
|
||||
- Service account password expired.
|
||||
- Trust relationship between the primary domain and the trusted domain issue.
|
||||
- Infrastructure or availability issue.
|
||||
- Domain trust relationship issues.
|
||||
- Infrastructure or availability issues.
|
||||
|
||||
### Related rules
|
||||
|
||||
@@ -41,10 +65,8 @@ note = """## Triage and analysis
|
||||
### Response and remediation
|
||||
|
||||
- Initiate the incident response process based on the outcome of the triage.
|
||||
- If the host is a domain controller (DC):
|
||||
- Activate your incident response plan for total Active Directory compromise.
|
||||
- Review the privileges assigned to users that can access the DCs, to ensure that the least privilege principle is being followed and to reduce the attack surface.
|
||||
- Isolate the involved hosts to prevent further post-compromise behavior.
|
||||
- Isolate the source host to prevent further post-compromise behavior.
|
||||
- If the asset is exposed to the internet with RDP or other remote services available, take the necessary measures to restrict access to the asset. If not possible, limit the access via the firewall to only the needed IP addresses. Also, ensure the system uses robust authentication mechanisms and is patched regularly.
|
||||
- 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.
|
||||
- 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.
|
||||
@@ -58,7 +80,7 @@ references = ["https://docs.microsoft.com/en-us/windows/security/threat-protecti
|
||||
risk_score = 47
|
||||
rule_id = "48b6edfc-079d-4907-b43c-baffa243270d"
|
||||
severity = "medium"
|
||||
tags = ["Elastic", "Host", "Windows", "Threat Detection", "Credential Access"]
|
||||
tags = ["Elastic", "Host", "Windows", "Threat Detection", "Credential Access", "Investigation Guide"]
|
||||
type = "eql"
|
||||
|
||||
query = '''
|
||||
|
||||
@@ -37,7 +37,7 @@ This rule looks for the MSBuild process loading `vaultcli.dll` or `SAMLib.DLL`,
|
||||
- Investigate abnormal behaviors observed by the subject process, such as network connections, registry or file modifications, and any spawned child processes.
|
||||
- Investigate other alerts associated with the user/host during the past 48 hours.
|
||||
- Examine the command line to identify the `.csproj` file location.
|
||||
- Examine the host for derived artifacts that indicates suspicious activities:
|
||||
- Examine the host for derived artifacts that indicate suspicious activities:
|
||||
- Analyze the file 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.
|
||||
|
||||
@@ -39,7 +39,7 @@ Domain-joined hosts usually perform Kerberos traffic using the `lsass.exe` proce
|
||||
- Investigate other alerts associated with the user/host during the past 48 hours.
|
||||
- Check if the Destination IP is related to a Domain Controller.
|
||||
- Review event ID 4769 for suspicious ticket requests.
|
||||
- Examine the host for derived artifacts that indicates suspicious activities:
|
||||
- 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.
|
||||
|
||||
@@ -35,7 +35,7 @@ This rule looks for the creation of memory dump files with file names compatible
|
||||
- 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.
|
||||
- Identify the user account that performed the action and whether it should perform this kind of action.
|
||||
- Investigate other alerts associated with the user/host during the past 48 hours.
|
||||
- Examine the host for derived artifacts that indicates suspicious activities:
|
||||
- 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.
|
||||
|
||||
@@ -34,7 +34,7 @@ Adversaries may attempt to access credential material stored in LSASS process me
|
||||
|
||||
- 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.
|
||||
- Examine the host for derived artifacts that indicates suspicious activities:
|
||||
- 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.
|
||||
|
||||
@@ -4,7 +4,7 @@ integration = ["endpoint", "windows"]
|
||||
maturity = "production"
|
||||
min_stack_comments = "New fields added: required_fields, related_integrations, setup"
|
||||
min_stack_version = "8.3.0"
|
||||
updated_date = "2022/12/14"
|
||||
updated_date = "2023/02/09"
|
||||
|
||||
[rule]
|
||||
author = ["Elastic"]
|
||||
@@ -18,14 +18,64 @@ index = ["winlogbeat-*", "logs-endpoint.events.*", "logs-windows.*", "endgame-*"
|
||||
language = "eql"
|
||||
license = "Elastic License v2"
|
||||
name = "Microsoft Build Engine Using an Alternate Name"
|
||||
note = """## Setup
|
||||
note = """## Triage and analysis
|
||||
|
||||
### Investigating Microsoft Build Engine Using an Alternate Name
|
||||
|
||||
The OriginalFileName attribute of a PE (Portable Executable) file is a metadata field that contains the original name of the executable file when compiled or linked. By using this attribute, analysts can identify renamed instances that attackers can use with the intent of evading detections, application allowlists, and other security protections.
|
||||
|
||||
The Microsoft Build Engine is a platform for building applications. This engine, also known as MSBuild, provides an XML schema for a project file that controls how the build platform processes and builds software, and can be abused to proxy execution of code.
|
||||
|
||||
This rule checks for renamed instances of MSBuild, which can indicate an attempt of evading detections, application allowlists, and other security protections.
|
||||
|
||||
> **Note**:
|
||||
> This investigation guide uses the [Osquery Markdown Plugin](https://www.elastic.co/guide/en/security/master/invest-guide-run-osquery.html) 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.
|
||||
- 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{"query":"SELECT * FROM dns_cache", "label":"Osquery - Retrieve 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{"query":"SELECT description, display_name, name, path, pid, service_type, start_type, status, user_account FROM services","label":"Osquery - Retrieve All Services"}}
|
||||
- !{osquery{"query":"SELECT description, display_name, name, path, pid, service_type, start_type, status, user_account FROM services WHERE NOT (user_account LIKE '%LocalSystem' OR user_account LIKE '%LocalService' OR user_account LIKE '%NetworkService' OR user_account == null)","label":"Osquery - Retrieve Services Running on User Accounts"}}
|
||||
- !{osquery{"query":"SELECT concat('https://www.virustotal.com/gui/file/', sha1) AS VtLink, name, description, start_type, status, pid, services.path FROM services JOIN authenticode ON services.path = authenticode.path OR services.module_path = authenticode.path JOIN hash ON services.path = hash.path WHERE authenticode.result != 'trusted'","label":"Osquery - Retrieve Service Unsigned Executables with Virustotal Link"}}
|
||||
- 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.
|
||||
|
||||
### False positive analysis
|
||||
|
||||
- This activity is unlikely to happen legitimately. Benign true positives (B-TPs) can be added as exceptions if necessary.
|
||||
|
||||
### 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).
|
||||
|
||||
## Setup
|
||||
|
||||
If enabling an EQL rule on a non-elastic-agent index (such as beats) for versions <8.2, events will not define `event.ingested` and default fallback for EQL rules was not added until 8.2, so you will need to add a custom pipeline to populate `event.ingested` to @timestamp for this rule to work.
|
||||
"""
|
||||
risk_score = 21
|
||||
rule_id = "9d110cb3-5f4b-4c9a-b9f5-53f0a1707ae4"
|
||||
severity = "low"
|
||||
tags = ["Elastic", "Host", "Windows", "Threat Detection", "Defense Evasion", "Elastic Endgame"]
|
||||
tags = ["Elastic", "Host", "Windows", "Threat Detection", "Defense Evasion", "Elastic Endgame", "Investigation Guide"]
|
||||
timestamp_override = "event.ingested"
|
||||
type = "eql"
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ integration = ["endpoint", "windows"]
|
||||
maturity = "production"
|
||||
min_stack_comments = "New fields added: required_fields, related_integrations, setup"
|
||||
min_stack_version = "8.3.0"
|
||||
updated_date = "2022/12/14"
|
||||
updated_date = "2023/02/09"
|
||||
|
||||
[rule]
|
||||
author = ["Elastic"]
|
||||
@@ -18,14 +18,48 @@ language = "eql"
|
||||
license = "Elastic License v2"
|
||||
max_signals = 33
|
||||
name = "IIS HTTP Logging Disabled"
|
||||
note = """## Setup
|
||||
note = """## Triage and analysis
|
||||
|
||||
### Investigating IIS HTTP Logging Disabled
|
||||
|
||||
IIS (Internet Information Services) is a Microsoft web server software used to host websites and web applications on Windows. It provides features for serving dynamic and static content, and can be managed through a graphical interface or command-line tools.
|
||||
|
||||
IIS logging is a data source that can be used for security monitoring, forensics, and incident response. It contains mainly information related to requests done to the web server, and can be used to spot malicious activities like webshells. Adversaries can tamper, clear, and delete this data to evade detection, cover their tracks, and slow down incident response.
|
||||
|
||||
This rule monitors commands that disable IIS logging.
|
||||
|
||||
#### 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.
|
||||
- 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.
|
||||
- Investigate other alerts associated with the user/host during the past 48 hours.
|
||||
- Verify if any other anti-forensics behaviors were observed.
|
||||
- Verify whether the logs stored in the `C:\\inetpub\\logs\\logfiles\\w3svc1` directory were deleted after this action.
|
||||
- Check if this operation is done under change management and approved according to the organization's policy.
|
||||
|
||||
### False positive analysis
|
||||
|
||||
- This activity is unlikely to happen legitimately. Benign true positives (B-TPs) can be added as exceptions if necessary.
|
||||
|
||||
### 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.
|
||||
- Re-enable affected logging components, services, and security monitoring.
|
||||
- Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
|
||||
- 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.
|
||||
- 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).
|
||||
|
||||
## Setup
|
||||
|
||||
If enabling an EQL rule on a non-elastic-agent index (such as beats) for versions <8.2, events will not define `event.ingested` and default fallback for EQL rules was not added until 8.2, so you will need to add a custom pipeline to populate `event.ingested` to @timestamp for this rule to work.
|
||||
"""
|
||||
risk_score = 73
|
||||
rule_id = "ebf1adea-ccf2-4943-8b96-7ab11ca173a5"
|
||||
severity = "high"
|
||||
tags = ["Elastic", "Host", "Windows", "Threat Detection", "Defense Evasion", "Elastic Endgame"]
|
||||
tags = ["Elastic", "Host", "Windows", "Threat Detection", "Defense Evasion", "Elastic Endgame", "Investigation Guide"]
|
||||
timestamp_override = "event.ingested"
|
||||
type = "eql"
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ integration = ["endpoint", "windows"]
|
||||
maturity = "production"
|
||||
min_stack_comments = "New fields added: required_fields, related_integrations, setup"
|
||||
min_stack_version = "8.3.0"
|
||||
updated_date = "2022/12/14"
|
||||
updated_date = "2023/02/09"
|
||||
|
||||
[rule]
|
||||
author = ["Elastic"]
|
||||
@@ -17,14 +17,64 @@ index = ["winlogbeat-*", "logs-endpoint.events.*", "logs-windows.*", "endgame-*"
|
||||
language = "eql"
|
||||
license = "Elastic License v2"
|
||||
name = "Renamed AutoIt Scripts Interpreter"
|
||||
note = """## Setup
|
||||
note = """## Triage and analysis
|
||||
|
||||
### Investigating Renamed AutoIt Scripts Interpreter
|
||||
|
||||
The OriginalFileName attribute of a PE (Portable Executable) file is a metadata field that contains the original name of the executable file when compiled or linked. By using this attribute, analysts can identify renamed instances that attackers can use with the intent of evading detections, application allowlists, and other security protections.
|
||||
|
||||
AutoIt is a scripting language and tool for automating tasks on Microsoft Windows operating systems. Due to its capabilities, malicious threat actors can abuse it to create malicious scripts and distribute malware.
|
||||
|
||||
This rule checks for renamed instances of AutoIt, which can indicate an attempt of evading detections, application allowlists, and other security protections.
|
||||
|
||||
> **Note**:
|
||||
> This investigation guide uses the [Osquery Markdown Plugin](https://www.elastic.co/guide/en/security/master/invest-guide-run-osquery.html) 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.
|
||||
- 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{"query":"SELECT * FROM dns_cache", "label":"Osquery - Retrieve 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{"query":"SELECT description, display_name, name, path, pid, service_type, start_type, status, user_account FROM services","label":"Osquery - Retrieve All Services"}}
|
||||
- !{osquery{"query":"SELECT description, display_name, name, path, pid, service_type, start_type, status, user_account FROM services WHERE NOT (user_account LIKE '%LocalSystem' OR user_account LIKE '%LocalService' OR user_account LIKE '%NetworkService' OR user_account == null)","label":"Osquery - Retrieve Services Running on User Accounts"}}
|
||||
- !{osquery{"query":"SELECT concat('https://www.virustotal.com/gui/file/', sha1) AS VtLink, name, description, start_type, status, pid, services.path FROM services JOIN authenticode ON services.path = authenticode.path OR services.module_path = authenticode.path JOIN hash ON services.path = hash.path WHERE authenticode.result != 'trusted'","label":"Osquery - Retrieve Service Unsigned Executables with Virustotal Link"}}
|
||||
- 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.
|
||||
|
||||
### False positive analysis
|
||||
|
||||
- This activity is unlikely to happen legitimately. Benign true positives (B-TPs) can be added as exceptions if necessary.
|
||||
|
||||
### 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).
|
||||
|
||||
## Setup
|
||||
|
||||
If enabling an EQL rule on a non-elastic-agent index (such as beats) for versions <8.2, events will not define `event.ingested` and default fallback for EQL rules was not added until 8.2, so you will need to add a custom pipeline to populate `event.ingested` to @timestamp for this rule to work.
|
||||
"""
|
||||
risk_score = 47
|
||||
rule_id = "2e1e835d-01e5-48ca-b9fc-7a61f7f11902"
|
||||
severity = "medium"
|
||||
tags = ["Elastic", "Host", "Windows", "Threat Detection", "Defense Evasion", "Elastic Endgame"]
|
||||
tags = ["Elastic", "Host", "Windows", "Threat Detection", "Defense Evasion", "Elastic Endgame", "Investigation Guide"]
|
||||
timestamp_override = "event.ingested"
|
||||
type = "eql"
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ integration = ["endpoint", "windows"]
|
||||
maturity = "production"
|
||||
min_stack_comments = "New fields added: required_fields, related_integrations, setup"
|
||||
min_stack_version = "8.3.0"
|
||||
updated_date = "2022/12/14"
|
||||
updated_date = "2023/02/09"
|
||||
|
||||
[rule]
|
||||
author = ["Elastic"]
|
||||
@@ -19,6 +19,56 @@ index = ["winlogbeat-*", "logs-endpoint.events.*", "logs-windows.*"]
|
||||
language = "eql"
|
||||
license = "Elastic License v2"
|
||||
name = "Potential Windows Error Manager Masquerading"
|
||||
note = """## Triage and analysis
|
||||
|
||||
### Investigating Potential Windows Error Manager Masquerading
|
||||
|
||||
By examining the specific traits of Windows binaries -- such as process trees, command lines, network connections, registry modifications, and so on -- it's possible to establish a baseline of normal activity. Deviations from this baseline can indicate malicious activity, such as masquerading and deserve further investigation.
|
||||
|
||||
This rule identifies a potential malicious process masquerading as `wermgr.exe` or `WerFault.exe`, by looking for a process creation with no arguments followed by a network connection.
|
||||
|
||||
> **Note**:
|
||||
> This investigation guide uses the [Osquery Markdown Plugin](https://www.elastic.co/guide/en/security/master/invest-guide-run-osquery.html) 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.
|
||||
- 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{"query":"SELECT * FROM dns_cache", "label":"Osquery - Retrieve 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{"query":"SELECT description, display_name, name, path, pid, service_type, start_type, status, user_account FROM services","label":"Osquery - Retrieve All Services"}}
|
||||
- !{osquery{"query":"SELECT description, display_name, name, path, pid, service_type, start_type, status, user_account FROM services WHERE NOT (user_account LIKE '%LocalSystem' OR user_account LIKE '%LocalService' OR user_account LIKE '%NetworkService' OR user_account == null)","label":"Osquery - Retrieve Services Running on User Accounts"}}
|
||||
- !{osquery{"query":"SELECT concat('https://www.virustotal.com/gui/file/', sha1) AS VtLink, name, description, start_type, status, pid, services.path FROM services JOIN authenticode ON services.path = authenticode.path OR services.module_path = authenticode.path JOIN hash ON services.path = hash.path WHERE authenticode.result != 'trusted'","label":"Osquery - Retrieve Service Unsigned Executables with Virustotal Link"}}
|
||||
- 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
|
||||
|
||||
- This activity is unlikely to happen legitimately. Benign true positives (B-TPs) can be added as exceptions if necessary.
|
||||
|
||||
### 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).
|
||||
"""
|
||||
references = [
|
||||
"https://twitter.com/SBousseaden/status/1235533224337641473",
|
||||
"https://www.hexacorn.com/blog/2019/09/20/werfault-command-line-switches-v0-1/",
|
||||
@@ -27,7 +77,7 @@ references = [
|
||||
risk_score = 47
|
||||
rule_id = "6ea41894-66c3-4df7-ad6b-2c5074eb3df8"
|
||||
severity = "medium"
|
||||
tags = ["Elastic", "Host", "Windows", "Threat Detection", "Defense Evasion"]
|
||||
tags = ["Elastic", "Host", "Windows", "Threat Detection", "Defense Evasion", "Investigation Guide"]
|
||||
type = "eql"
|
||||
|
||||
query = '''
|
||||
|
||||
@@ -33,7 +33,7 @@ This rule identifies network connections established by trusted developer utilit
|
||||
- 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 abnormal behaviors observed by the subject process, such as registry or file modifications, and any spawned child processes.
|
||||
- Investigate other alerts associated with the user/host during the past 48 hours.
|
||||
- Examine the host for derived artifacts that indicates suspicious activities:
|
||||
- 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.
|
||||
|
||||
@@ -35,7 +35,7 @@ Attackers can use .NET reflection to load PEs and DLLs in memory. These payloads
|
||||
- Examine file or network events from the involved PowerShell process for suspicious behavior.
|
||||
- Investigate other alerts associated with the user/host during the past 48 hours.
|
||||
- Evaluate whether the user needs to use PowerShell to complete tasks.
|
||||
- Examine the host for derived artifacts that indicates suspicious activities:
|
||||
- Examine the host for derived artifacts that indicate suspicious activities:
|
||||
- Analyze the script 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.
|
||||
|
||||
@@ -36,7 +36,7 @@ Attackers can embed compressed and encoded payloads in scripts to load directly
|
||||
- Examine file or network events from the involved PowerShell process for suspicious behavior.
|
||||
- Investigate other alerts associated with the user/host during the past 48 hours.
|
||||
- Evaluate whether the user needs to use PowerShell to complete tasks.
|
||||
- Examine the host for derived artifacts that indicates suspicious activities:
|
||||
- Examine the host for derived artifacts that indicate suspicious activities:
|
||||
- Analyze the script 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.
|
||||
|
||||
@@ -36,7 +36,7 @@ This rule identifies suspicious process access events from an unknown memory reg
|
||||
- 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 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 indicates suspicious activities:
|
||||
- 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.
|
||||
|
||||
@@ -33,7 +33,7 @@ This rule looks for the creation of executable files done by system-critical pro
|
||||
- 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 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 indicates suspicious activities:
|
||||
- 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.
|
||||
|
||||
@@ -38,7 +38,7 @@ Attackers can abuse these alternate data streams to hide malicious files, string
|
||||
- Investigate any abnormal behavior by the subject process such as network connections, registry or file modifications, and any spawned child processes.
|
||||
- Investigate other alerts associated with the user/host during the past 48 hours.
|
||||
- Assess whether this behavior is prevalent in the environment by looking for similar occurrences across hosts.
|
||||
- Examine the host for derived artifacts that indicates suspicious activities:
|
||||
- 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.
|
||||
|
||||
@@ -34,7 +34,7 @@ This rule looks for the enumeration of privileged local groups' membership by su
|
||||
- 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 any abnormal account behavior, such as command executions, file creations or modifications, and network connections.
|
||||
- Examine the host for derived artifacts that indicates suspicious activities:
|
||||
- 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.
|
||||
|
||||
@@ -30,7 +30,7 @@ This rule looks for the creation of the `cmd.exe` process with `svchost.exe` as
|
||||
- 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 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 indicates suspicious activities:
|
||||
- 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.
|
||||
|
||||
@@ -31,7 +31,7 @@ This rule looks for the execution of scripts from unusual directories. Attackers
|
||||
- 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.
|
||||
- Examine the command line to determine which commands or scripts were executed.
|
||||
- Examine the host for derived artifacts that indicates suspicious activities:
|
||||
- Examine the host for derived artifacts that indicate suspicious activities:
|
||||
- Analyze the script 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.
|
||||
|
||||
@@ -34,7 +34,7 @@ Attackers can abuse PowerShell in-memory capabilities to inject executables into
|
||||
- Investigate the script 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.
|
||||
- Evaluate whether the user needs to use PowerShell to complete tasks.
|
||||
- Examine the host for derived artifacts that indicates suspicious activities:
|
||||
- Examine the host for derived artifacts that indicate suspicious activities:
|
||||
- Analyze the script 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.
|
||||
|
||||
@@ -40,7 +40,7 @@ Detecting the core implementation of PSReflect means detecting most of the tooli
|
||||
- Check for additional PowerShell and command-line logs that indicate that imported functions were run.
|
||||
- Investigate other alerts associated with the user/host during the past 48 hours.
|
||||
- Evaluate whether the user needs to use PowerShell to complete tasks.
|
||||
- Examine the host for derived artifacts that indicates suspicious activities:
|
||||
- Examine the host for derived artifacts that indicate suspicious activities:
|
||||
- Analyze the script 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.
|
||||
|
||||
@@ -4,7 +4,7 @@ integration = ["endpoint", "windows"]
|
||||
maturity = "production"
|
||||
min_stack_comments = "New fields added: required_fields, related_integrations, setup"
|
||||
min_stack_version = "8.3.0"
|
||||
updated_date = "2022/12/14"
|
||||
updated_date = "2023/02/09"
|
||||
|
||||
[rule]
|
||||
author = ["Elastic"]
|
||||
@@ -25,14 +25,71 @@ index = ["winlogbeat-*", "logs-endpoint.events.*", "logs-windows.*", "endgame-*"
|
||||
language = "eql"
|
||||
license = "Elastic License v2"
|
||||
name = "Process Activity via Compiled HTML File"
|
||||
note = """## Setup
|
||||
note = """## Triage and analysis
|
||||
|
||||
### Investigating Process Activity via Compiled HTML File
|
||||
|
||||
CHM (Compiled HTML) files are a format for delivering online help files on Windows. CHM files are compressed compilations of various content, such as HTML documents, images, and scripting/web-related programming languages such as VBA, JScript, Java, and ActiveX.
|
||||
|
||||
When users double-click CHM files, the HTML Help executable program (`hh.exe`) will execute them. `hh.exe` also can be used to execute code embedded in those files, PowerShell scripts, and executables. This makes it useful for attackers not only to proxy the execution of malicious payloads via a signed binary that could bypass security controls, but also to gain initial access to environments via social engineering methods.
|
||||
|
||||
> **Note**:
|
||||
> This investigation guide uses the [Osquery Markdown Plugin](https://www.elastic.co/guide/en/security/master/invest-guide-run-osquery.html) 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.
|
||||
- Investigate any abnormal behavior by the subject process such as network connections, registry or file modifications, and any spawned child processes.
|
||||
- Investigate the parent process to gain understanding of what triggered this behavior.
|
||||
- Retrieve `.chm`, `.ps1`, and other files that were involved to further examination.
|
||||
- Examine the host for derived artifacts that indicate suspicious activities:
|
||||
- Analyze the process executables, scripts and help files retrieved from the system 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{"query":"SELECT * FROM dns_cache", "label":"Osquery - Retrieve 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{"query":"SELECT description, display_name, name, path, pid, service_type, start_type, status, user_account FROM services","label":"Osquery - Retrieve All Services"}}
|
||||
- !{osquery{"query":"SELECT description, display_name, name, path, pid, service_type, start_type, status, user_account FROM services WHERE NOT (user_account LIKE '%LocalSystem' OR user_account LIKE '%LocalService' OR user_account LIKE '%NetworkService' OR user_account == null)","label":"Osquery - Retrieve Services Running on User Accounts"}}
|
||||
- !{osquery{"query":"SELECT concat('https://www.virustotal.com/gui/file/', sha1) AS VtLink, name, description, start_type, status, pid, services.path FROM services JOIN authenticode ON services.path = authenticode.path OR services.module_path = authenticode.path JOIN hash ON services.path = hash.path WHERE authenticode.result != 'trusted'","label":"Osquery - Retrieve Service Unsigned Executables with Virustotal Link"}}
|
||||
- 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
|
||||
|
||||
- This activity is unlikely to happen legitimately. Benign true positives (B-TPs) can be added as exceptions if necessary.
|
||||
|
||||
### 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.
|
||||
- If the malicious file was delivered via phishing:
|
||||
- Block the email sender from sending future emails.
|
||||
- Block the malicious web pages.
|
||||
- Remove emails from the sender from mailboxes.
|
||||
- Consider improvements to the security awareness program.
|
||||
- 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).
|
||||
|
||||
## Setup
|
||||
|
||||
If enabling an EQL rule on a non-elastic-agent index (such as beats) for versions <8.2, events will not define `event.ingested` and default fallback for EQL rules was not added until 8.2, so you will need to add a custom pipeline to populate `event.ingested` to @timestamp for this rule to work.
|
||||
"""
|
||||
risk_score = 47
|
||||
rule_id = "e3343ab9-4245-4715-b344-e11c56b0a47f"
|
||||
severity = "medium"
|
||||
tags = ["Elastic", "Host", "Windows", "Threat Detection", "Execution", "Elastic Endgame"]
|
||||
tags = ["Elastic", "Host", "Windows", "Threat Detection", "Execution", "Elastic Endgame", "Investigation Guide"]
|
||||
timestamp_override = "event.ingested"
|
||||
type = "eql"
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ This rule looks for unexpected processes making network connections over port 44
|
||||
- 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 indicates suspicious activities:
|
||||
- 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.
|
||||
|
||||
@@ -31,7 +31,7 @@ Adversaries can use network shares to host tooling to support the compromise of
|
||||
- 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.
|
||||
- Review adjacent login events (e.g., 4624) in the alert timeframe to identify the account used to perform this action.
|
||||
- Investigate other alerts associated with the user/host during the past 48 hours.
|
||||
- Examine the host for derived artifacts that indicates suspicious activities:
|
||||
- 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.
|
||||
|
||||
@@ -36,7 +36,7 @@ This rule detects the remote creation or start of a service by correlating a `se
|
||||
- Investigate any abnormal behavior by the subject process such as network connections, registry or file modifications, and any spawned child processes.
|
||||
- Investigate other alerts associated with the user/host during the past 48 hours.
|
||||
- Validate if the activity is not related to planned patches, updates, network administrator activity, or legitimate software installations.
|
||||
- Examine the host for derived artifacts that indicates suspicious activities:
|
||||
- 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.
|
||||
|
||||
@@ -29,7 +29,7 @@ Attackers can replace the `RdrCEF.exe` executable with their own to maintain the
|
||||
- Identify the user account that performed the action and whether it should perform this kind of action.
|
||||
- Investigate other alerts associated with the user/host during the past 48 hours.
|
||||
- Assess whether this behavior is prevalent in the environment by looking for similar occurrences across hosts.
|
||||
- Examine the host for derived artifacts that indicates suspicious activities:
|
||||
- Examine the host for derived artifacts that indicate suspicious activities:
|
||||
- Analyze the file 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.
|
||||
|
||||
@@ -4,27 +4,79 @@ integration = ["endpoint", "windows"]
|
||||
maturity = "production"
|
||||
min_stack_comments = "New fields added: required_fields, related_integrations, setup"
|
||||
min_stack_version = "8.3.0"
|
||||
updated_date = "2022/12/14"
|
||||
updated_date = "2023/02/09"
|
||||
|
||||
[rule]
|
||||
author = ["Elastic"]
|
||||
description = """
|
||||
Attackers may maintain persistence by creating registry keys using AppInit DLLs. AppInit DLLs are loaded by every
|
||||
process using the common library, user32.dll.
|
||||
AppInit DLLs are dynamic-link libraries (DLLs) that are loaded into every process that creates a user interface (loads user32.dll) on Microsoft Windows operating systems. The AppInit DLL mechanism is used to load custom code into user-mode processes, allowing for the customization of the user interface and the behavior of Windows-based applications. Attackers who add those DLLs to the registry locations can execute code with elevated privileges, similar to process injection, and provide a solid and constant persistence on the machine.
|
||||
"""
|
||||
from = "now-9m"
|
||||
index = ["winlogbeat-*", "logs-endpoint.events.*", "logs-windows.*"]
|
||||
language = "eql"
|
||||
license = "Elastic License v2"
|
||||
name = "Registry Persistence via AppInit DLL"
|
||||
note = """## Setup
|
||||
note = """## Triage and analysis
|
||||
|
||||
### Investigating Registry Persistence via AppInit DLL
|
||||
|
||||
AppInit DLLs are dynamic-link libraries (DLLs) that are loaded into every process that creates a user interface (loads `user32.dll`) on Microsoft Windows operating systems. The AppInit DLL mechanism is used to load custom code into user-mode processes, allowing for the customization of the user interface and the behavior of Windows-based applications.
|
||||
|
||||
Attackers who add those DLLs to the registry locations can execute code with elevated privileges, similar to process injection, and provide a solid and constant persistence on the machine.
|
||||
|
||||
This rule identifies modifications on the AppInit registry keys.
|
||||
|
||||
> **Note**:
|
||||
> This investigation guide uses the [Osquery Markdown Plugin](https://www.elastic.co/guide/en/security/master/invest-guide-run-osquery.html) 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.
|
||||
- Review the source process and related DLL file tied to the Windows Registry entry.
|
||||
- Check whether the DLL is signed, and tied to a authorized program used on your environment.
|
||||
- Assess whether this behavior is prevalent in the environment by looking for similar occurrences across hosts.
|
||||
- Retrieve all DLLs under the AppInit registry keys:
|
||||
- !{osquery{"query":"SELECT * FROM registry r where (r.key == 'HKEY_LOCAL_MACHINE\\\\SOFTWARE\\\\Microsoft\\\\Windows NT\\\\CurrentVersion\\\\Windows' or r.key == 'HKEY_LOCAL_MACHINE\\\\SOFTWARE\\\\Wow6432Node\\\\Microsoft\\\\Windows NT\\\\CurrentVersion\\\\Windows') and r.name == 'AppInit_DLLs'","label":"Osquery - Retrieve AppInit Registry Value"}}
|
||||
- Examine the host for derived artifacts that indicate suspicious activities:
|
||||
- Analyze the process executable and the DLLs 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{"query":"SELECT * FROM dns_cache", "label":"Osquery - Retrieve 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{"query":"SELECT description, display_name, name, path, pid, service_type, start_type, status, user_account FROM services","label":"Osquery - Retrieve All Services"}}
|
||||
- !{osquery{"query":"SELECT description, display_name, name, path, pid, service_type, start_type, status, user_account FROM services WHERE NOT (user_account LIKE '%LocalSystem' OR user_account LIKE '%LocalService' OR user_account LIKE '%NetworkService' OR user_account == null)","label":"Osquery - Retrieve Services Running on User Accounts"}}
|
||||
- !{osquery{"query":"SELECT concat('https://www.virustotal.com/gui/file/', sha1) AS VtLink, name, description, start_type, status, pid, services.path FROM services JOIN authenticode ON services.path = authenticode.path OR services.module_path = authenticode.path JOIN hash ON services.path = hash.path WHERE authenticode.result != 'trusted'","label":"Osquery - Retrieve Service Unsigned Executables with Virustotal Link"}}
|
||||
- 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.
|
||||
|
||||
### False positive analysis
|
||||
|
||||
- This activity is unlikely to happen legitimately. Benign true positives (B-TPs) can be added as exceptions if necessary.
|
||||
|
||||
### 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).
|
||||
|
||||
## Setup
|
||||
|
||||
If enabling an EQL rule on a non-elastic-agent index (such as beats) for versions <8.2, events will not define `event.ingested` and default fallback for EQL rules was not added until 8.2, so you will need to add a custom pipeline to populate `event.ingested` to @timestamp for this rule to work.
|
||||
"""
|
||||
risk_score = 47
|
||||
rule_id = "d0e159cf-73e9-40d1-a9ed-077e3158a855"
|
||||
severity = "medium"
|
||||
tags = ["Elastic", "Host", "Windows", "Threat Detection", "Persistence"]
|
||||
tags = ["Elastic", "Host", "Windows", "Threat Detection", "Persistence", "Investigation Guide"]
|
||||
timestamp_override = "event.ingested"
|
||||
type = "eql"
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ Techniques used within malware and by adversaries often leverage the Windows reg
|
||||
- Review the source process and related file tied to the Windows Registry entry.
|
||||
- Validate if the activity is not related to planned patches, updates, network administrator activity, or legitimate software installations.
|
||||
- Assess whether this behavior is prevalent in the environment by looking for similar occurrences across hosts.
|
||||
- Examine the host for derived artifacts that indicates suspicious activities:
|
||||
- Examine the host for derived artifacts that indicate suspicious activities:
|
||||
- Analyze the file 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.
|
||||
|
||||
@@ -38,7 +38,7 @@ This rule looks for the execution of supposed accessibility binaries that don't
|
||||
- Contact the account and system owners and confirm whether they are aware of this activity.
|
||||
- Investigate other alerts associated with the user/host during the past 48 hours.
|
||||
- Assess whether this behavior is prevalent in the environment by looking for similar occurrences across hosts.
|
||||
- Examine the host for derived artifacts that indicates suspicious activities:
|
||||
- Examine the host for derived artifacts that indicate suspicious activities:
|
||||
- Analyze the file 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.
|
||||
|
||||
@@ -32,7 +32,7 @@ Adversaries may achieve persistence by referencing a program with a registry run
|
||||
- Investigate other alerts associated with the user/host during the past 48 hours.
|
||||
- Validate if the activity is not related to planned patches, updates, network administrator activity, or legitimate software installations.
|
||||
- Assess whether this behavior is prevalent in the environment by looking for similar occurrences across hosts.
|
||||
- Examine the host for derived artifacts that indicates suspicious activities:
|
||||
- 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.
|
||||
|
||||
@@ -34,7 +34,7 @@ This rule monitors for commonly abused processes writing to the Startup folder l
|
||||
- Investigate other alerts associated with the user/host during the past 48 hours.
|
||||
- Validate if the activity is not related to planned patches, updates, network administrator activity, or legitimate software installations.
|
||||
- Assess whether this behavior is prevalent in the environment by looking for similar occurrences across hosts.
|
||||
- Examine the host for derived artifacts that indicates suspicious activities:
|
||||
- Examine the host for derived artifacts that indicate suspicious activities:
|
||||
- Analyze the file 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.
|
||||
|
||||
@@ -34,7 +34,7 @@ This rule looks for unsigned processes writing to the Startup folder locations.
|
||||
- Investigate other alerts associated with the user/host during the past 48 hours.
|
||||
- Validate if the activity is not related to planned patches, updates, network administrator activity, or legitimate software installations.
|
||||
- Assess whether this behavior is prevalent in the environment by looking for similar occurrences across hosts.
|
||||
- Examine the host for derived artifacts that indicates suspicious activities:
|
||||
- Examine the host for derived artifacts that indicate suspicious activities:
|
||||
- Analyze the file 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.
|
||||
|
||||
@@ -34,7 +34,7 @@ This rule looks for shortcuts created by wscript.exe or cscript.exe, or js/vbs s
|
||||
- Investigate other alerts associated with the user/host during the past 48 hours.
|
||||
- Validate if the activity is not related to planned patches, updates, network administrator activity, or legitimate software installations.
|
||||
- Assess whether this behavior is prevalent in the environment by looking for similar occurrences across hosts.
|
||||
- Examine the host for derived artifacts that indicates suspicious activities:
|
||||
- Examine the host for derived artifacts that indicate suspicious activities:
|
||||
- Analyze the file 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.
|
||||
|
||||
@@ -34,7 +34,7 @@ This rule will detect uncommon processes spawned by `svchost.exe` with `UsoSvc`
|
||||
- Investigate any abnormal behavior by the subject process such as network connections, registry or file modifications, and any spawned child processes.
|
||||
- Investigate other alerts associated with the user/host during the past 48 hours.
|
||||
- Assess whether this behavior is prevalent in the environment by looking for similar occurrences across hosts.
|
||||
- Examine the host for derived artifacts that indicates suspicious activities:
|
||||
- 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.
|
||||
|
||||
@@ -34,7 +34,7 @@ This rule detects the default execution of the PoC, which overwrites the `elevat
|
||||
- Investigate other alerts associated with the user/host during the past 48 hours.
|
||||
- Look for additional processes spawned by the process, command lines, and network communications.
|
||||
- Assess whether this behavior is prevalent in the environment by looking for similar occurrences across hosts.
|
||||
- Examine the host for derived artifacts that indicates suspicious activities:
|
||||
- Examine the host for derived artifacts that indicate suspicious activities:
|
||||
- Analyze the file 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.
|
||||
|
||||
@@ -4,7 +4,7 @@ integration = ["endpoint", "windows"]
|
||||
maturity = "production"
|
||||
min_stack_comments = "New fields added: required_fields, related_integrations, setup"
|
||||
min_stack_version = "8.3.0"
|
||||
updated_date = "2022/12/14"
|
||||
updated_date = "2023/02/09"
|
||||
|
||||
[rule]
|
||||
author = ["Elastic"]
|
||||
@@ -17,17 +17,69 @@ index = ["winlogbeat-*", "logs-endpoint.events.*", "logs-windows.*"]
|
||||
language = "eql"
|
||||
license = "Elastic License v2"
|
||||
name = "Privilege Escalation via Named Pipe Impersonation"
|
||||
note = """## Setup
|
||||
note = """## Triage and analysis
|
||||
|
||||
### Investigating Privilege Escalation via Named Pipe Impersonation
|
||||
|
||||
A named pipe is a type of inter-process communication (IPC) mechanism used in operating systems like Windows, which allows two or more processes to communicate with each other by sending and receiving data through a well-known point.
|
||||
|
||||
Attackers can abuse named pipes to elevate their privileges by impersonating the security context in which they execute code. Metasploit, for example, creates a service and a random pipe, and then uses the service to connect to the pipe and impersonate the service security context, which is SYSTEM.
|
||||
|
||||
> **Note**:
|
||||
> This investigation guide uses the [Osquery Markdown Plugin](https://www.elastic.co/guide/en/security/master/invest-guide-run-osquery.html) 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.
|
||||
- Inspect the host for suspicious or abnormal behavior in the alert timeframe.
|
||||
- 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:
|
||||
- If any suspicious processes were found, examine 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{"query":"SELECT * FROM dns_cache", "label":"Osquery - Retrieve 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{"query":"SELECT description, display_name, name, path, pid, service_type, start_type, status, user_account FROM services","label":"Osquery - Retrieve All Services"}}
|
||||
- !{osquery{"query":"SELECT description, display_name, name, path, pid, service_type, start_type, status, user_account FROM services WHERE NOT (user_account LIKE '%LocalSystem' OR user_account LIKE '%LocalService' OR user_account LIKE '%NetworkService' OR user_account == null)","label":"Osquery - Retrieve Services Running on User Accounts"}}
|
||||
- !{osquery{"query":"SELECT concat('https://www.virustotal.com/gui/file/', sha1) AS VtLink, name, description, start_type, status, pid, services.path FROM services JOIN authenticode ON services.path = authenticode.path OR services.module_path = authenticode.path JOIN hash ON services.path = hash.path WHERE authenticode.result != 'trusted'","label":"Osquery - Retrieve Service Unsigned Executables with Virustotal Link"}}
|
||||
- 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.
|
||||
|
||||
### False positive analysis
|
||||
|
||||
- This activity is unlikely to happen legitimately. Benign true positives (B-TPs) can be added as exceptions if necessary.
|
||||
|
||||
### 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.
|
||||
- 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.
|
||||
- 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).
|
||||
|
||||
## Setup
|
||||
|
||||
If enabling an EQL rule on a non-elastic-agent index (such as beats) for versions <8.2, events will not define `event.ingested` and default fallback for EQL rules was not added until 8.2, so you will need to add a custom pipeline to populate `event.ingested` to @timestamp for this rule to work.
|
||||
"""
|
||||
references = [
|
||||
"https://www.ired.team/offensive-security/privilege-escalation/windows-namedpipes-privilege-escalation",
|
||||
"https://www.cobaltstrike.com/blog/what-happens-when-i-type-getsystem/",
|
||||
"https://redcanary.com/blog/getsystem-offsec/",
|
||||
]
|
||||
risk_score = 73
|
||||
rule_id = "3ecbdc9e-e4f2-43fa-8cca-63802125e582"
|
||||
severity = "high"
|
||||
tags = ["Elastic", "Host", "Windows", "Threat Detection", "Privilege Escalation"]
|
||||
tags = ["Elastic", "Host", "Windows", "Threat Detection", "Privilege Escalation", "Investigation Guide"]
|
||||
timestamp_override = "event.ingested"
|
||||
type = "eql"
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ The Print Spooler service has some known vulnerabilities that attackers can abus
|
||||
- Investigate any abnormal behavior by the subject process such as network connections, registry or file modifications, and any spawned child processes.
|
||||
- Investigate other alerts associated with the user/host during the past 48 hours.
|
||||
- Inspect the host for suspicious or abnormal behavior in the alert timeframe.
|
||||
- Examine the host for derived artifacts that indicates suspicious activities:
|
||||
- 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.
|
||||
|
||||
@@ -36,7 +36,7 @@ During startup, `eventvwr.exe` checks the registry value of the `HKCU\\Software\
|
||||
- Investigate other alerts associated with the user/host during the past 48 hours.
|
||||
- Inspect the host for suspicious or abnormal behavior in the alert timeframe.
|
||||
- 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 indicates suspicious activities:
|
||||
- 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.
|
||||
|
||||
@@ -36,7 +36,7 @@ This rule identifies an attempt to bypass User Account Control (UAC) by masquera
|
||||
- Investigate other alerts associated with the user/host during the past 48 hours.
|
||||
- Inspect the host for suspicious or abnormal behavior in the alert timeframe.
|
||||
- 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 indicates suspicious activities:
|
||||
- Examine the host for derived artifacts that indicate suspicious activities:
|
||||
- Analyze any suspicious spawned processes 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.
|
||||
|
||||
@@ -36,7 +36,7 @@ This rule identifies attempts to bypass User Account Control (UAC) by hijacking
|
||||
- Investigate other alerts associated with the user/host during the past 48 hours.
|
||||
- Inspect the host for suspicious or abnormal behavior in the alert timeframe.
|
||||
- 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 indicates suspicious activities:
|
||||
- Examine the host for derived artifacts that indicate suspicious activities:
|
||||
- Analyze any suspicious spawned processes 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.
|
||||
|
||||
@@ -33,7 +33,7 @@ This rule uses this information to spot suspicious parent and child processes.
|
||||
- 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 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 indicates suspicious activities:
|
||||
- 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.
|
||||
|
||||
Reference in New Issue
Block a user