Detection rules › Elastic
Elastic rules: 1h
Bind Shell via Socket
#Detects the creation of a bind shell via socket. Attackers may spawn bind shells to establish persistence onto a target system.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Execution | |
| Command & Control |
Rule Body
[rule]
description = """
Detects the creation of a bind shell via socket. Attackers may spawn bind shells to establish persistence onto a target
system.
"""
id = "37f6659f-dff4-42bc-91ae-7ed7a9264529"
license = "Elastic License v2"
name = "Bind Shell via Socket"
os_list = ["linux"]
reference = ["https://gtfobins.github.io/gtfobins/socket/"]
version = "1.0.4"
query = '''
process where event.type == "start" and event.action == "exec" and process.name == "socket" and
process.args : "-*s*" and process.args : "-*p*" and process.args : "*sh*" and process.args_count >= 3
'''
min_endpoint_version = "7.15.0"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
tree = true
[[actions]]
action = "kill_process"
field = "process.parent.entity_id"
state = 0
tree = true
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1059"
name = "Command and Scripting Interpreter"
reference = "https://attack.mitre.org/techniques/T1059/"
[[threat.technique.subtechnique]]
id = "T1059.004"
name = "Unix Shell"
reference = "https://attack.mitre.org/techniques/T1059/004/"
[threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1071"
name = "Application Layer Protocol"
reference = "https://attack.mitre.org/techniques/T1071/"
[threat.tactic]
id = "TA0011"
name = "Command and Control"
reference = "https://attack.mitre.org/tactics/TA0011/"
[internal]
min_endpoint_version = "7.15.0"
Stages and Predicates
Stage 1: process
process where event.type == "start" and event.action == "exec" and process.name == "socket" and
process.args : "-*s*" and process.args : "-*p*" and process.args : "*sh*" and process.args_count >= 3
Indicators
These rows show field, operator, and value matches.
Code Signing Policy Modification Through Built-in tools
#Identifies attempts to disable/modify the code signing policy through system native utilities. Code signing provides authenticity on a program, and grants the user with the ability to check whether the program has been tampered with. By allowing the execution of unsigned or self-signed code, threat actors can craft and execute malicious code.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Defense Impairment |
Telemetry Coverage
| Provider | Record / event type |
|---|---|
| Sysmon | Event ID 1: Process creation |
| Security-Auditing | Event ID 4688: A new process has been created. |
Rule Body
[metadata]
creation_date = "2023/01/31"
integration = ["endpoint", "windows", "system", "m365_defender", "sentinel_one_cloud_funnel", "crowdstrike"]
maturity = "production"
updated_date = "2026/05/04"
[transform]
[[transform.osquery]]
label = "Osquery - Retrieve All Non-Microsoft Drivers with Virustotal Link"
query = """
SELECT concat('https://www.virustotal.com/gui/file/', sha1) AS VtLink, class, description, directory, image,
issuer_name, manufacturer, service, signed, subject_name FROM drivers JOIN authenticode ON drivers.image =
authenticode.path JOIN hash ON drivers.image = hash.path WHERE NOT (provider == "Microsoft" AND signed == "1")
"""
[[transform.osquery]]
label = "Osquery - Retrieve All Unsigned Drivers with Virustotal Link"
query = """
SELECT concat('https://www.virustotal.com/gui/file/', sha1) AS VtLink, class, description, directory, image,
issuer_name, manufacturer, service, signed, subject_name FROM drivers JOIN authenticode ON drivers.image =
authenticode.path JOIN hash ON drivers.image = hash.path WHERE signed == "0"
"""
[rule]
author = ["Elastic"]
description = """
Identifies attempts to disable/modify the code signing policy through system native utilities. Code signing provides
authenticity on a program, and grants the user with the ability to check whether the program has been tampered with. By
allowing the execution of unsigned or self-signed code, threat actors can craft and execute malicious code.
"""
from = "now-9m"
index = [
"endgame-*",
"logs-crowdstrike.fdr*",
"logs-endpoint.events.process-*",
"logs-m365_defender.event-*",
"logs-sentinel_one_cloud_funnel.*",
"logs-system.security*",
"logs-windows.forwarded*",
"logs-windows.sysmon_operational-*",
"winlogbeat-*",
]
language = "eql"
license = "Elastic License v2"
name = "Code Signing Policy Modification Through Built-in tools"
note = """## Triage and analysis
### Investigating Code Signing Policy Modification Through Built-in tools
Windows Driver Signature Enforcement (DSE) is a security feature introduced by Microsoft to enforce that only signed drivers can be loaded and executed into the kernel (ring 0). This feature was introduced to prevent attackers from loading their malicious drivers on targets. If the driver has an invalid signature, the system will not allow it to be loaded.
This protection is essential for maintaining the security of the system. However, attackers or even administrators can disable this feature and load untrusted drivers, as this can put the system at risk. Therefore, it is important to keep this feature enabled and only load drivers from trusted sources to ensure the integrity and security of the system.
This rule identifies commands that can disable the Driver Signature Enforcement feature.
> **Note**:
> This investigation guide uses the [Osquery Markdown Plugin](https://www.elastic.co/guide/en/security/current/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
- Identify the user account that performed the action and whether it should perform this kind of action.
- 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.
- Use Osquery and endpoint driver events (`event.category = "driver"`) to investigate if suspicious drivers were loaded into the system after the command was executed.
- $osquery_0
- $osquery_1
- Identify the driver's `Device Name` and `Service Name`.
- Check for alerts from the rules specified in the `Related Rules` section.
### False positive analysis
- This activity should not happen legitimately. The security team should address any potential benign true positive (B-TP), as this configuration can put the user and the domain at risk.
### Related Rules
- First Time Seen Driver Loaded - df0fd41e-5590-4965-ad5e-cd079ec22fa9
- Untrusted Driver Loaded - d8ab1ec1-feeb-48b9-89e7-c12e189448aa
- Code Signing Policy Modification Through Registry - da7733b1-fe08-487e-b536-0a04c6d8b0cd
### 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.
- Disable and uninstall all suspicious drivers found in the system. This can be done via Device Manager. (Note that this step may require you to boot the system into Safe Mode.)
- Remove the related services and registry keys found in the system. Note that the service will probably not stop if the driver is still installed.
- This can be done via PowerShell `Remove-Service` cmdlet.
- Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
- Remove and block malicious artifacts identified during triage.
- Ensure that the Driver Signature Enforcement is enabled on the system.
- 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 = """## Setup
This rule is designed for data generated by [Elastic Defend](https://www.elastic.co/security/endpoint-security), which provides native endpoint detection and response, along with event enrichments designed to work with our detection rules.
Setup instructions: https://ela.st/install-elastic-defend
### Additional data sources
This rule also supports the following third-party data sources. For setup instructions, refer to the links below:
- [CrowdStrike](https://ela.st/crowdstrike-integration)
- [Microsoft Defender XDR](https://ela.st/m365-defender)
- [SentinelOne Cloud Funnel](https://ela.st/sentinel-one-cloud-funnel)
- [Sysmon Event ID 1 - Process Creation](https://ela.st/sysmon-event-1-setup)
- [Windows Process Creation Logs](https://ela.st/audit-process-creation)
"""
risk_score = 47
rule_id = "b43570de-a908-4f7f-8bdb-b2df6ffd8c80"
severity = "medium"
tags = [
"Domain: Endpoint",
"OS: Windows",
"Use Case: Threat Detection",
"Tactic: Defense Evasion",
"Data Source: Elastic Endgame",
"Resources: Investigation Guide",
"Data Source: Elastic Defend",
"Data Source: Windows Security Event Logs",
"Data Source: Microsoft Defender XDR",
"Data Source: Sysmon",
"Data Source: SentinelOne",
"Data Source: Crowdstrike",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
process where host.os.type == "windows" and event.type == "start" and
(process.name: "bcdedit.exe" or ?process.pe.original_file_name == "bcdedit.exe") and process.args: ("-set", "/set") and
process.args: ("TESTSIGNING", "nointegritychecks", "loadoptions", "DISABLE_INTEGRITY_CHECKS")
'''
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1553"
name = "Subvert Trust Controls"
reference = "https://attack.mitre.org/techniques/T1553/"
[[rule.threat.technique.subtechnique]]
id = "T1553.006"
name = "Code Signing Policy Modification"
reference = "https://attack.mitre.org/techniques/T1553/006/"
[rule.threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
Stages and Predicates
Stage 1: process
process where host.os.type == "windows" and event.type == "start" and
(process.name: "bcdedit.exe" or ?process.pe.original_file_name == "bcdedit.exe") and process.args: ("-set", "/set") and
process.args: ("TESTSIGNING", "nointegritychecks", "loadoptions", "DISABLE_INTEGRITY_CHECKS")
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.type | eq |
| field:"event.type" kind:eq value:"start" |
process.args | wildcard |
| field:"process.args" kind:wildcard |
process.name | wildcard |
| field:"process_basename" kind:wildcard value:"bcdedit.exe" |
process.pe.original_file_name | eq |
| field:"OriginalFileName" kind:eq value:"bcdedit.exe" |
Creation or Modification of Domain Backup DPAPI private key
#Identifies the creation or modification of Domain Backup private keys. Adversaries may extract the Data Protection API (DPAPI) domain backup key from a Domain Controller (DC) to be able to decrypt any domain user master key file.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Credential Access |
Rule Body
[metadata]
creation_date = "2020/08/13"
integration = ["endpoint", "windows", "sentinel_one_cloud_funnel", "m365_defender", "crowdstrike"]
maturity = "production"
updated_date = "2026/04/22"
[rule]
author = ["Elastic"]
description = """
Identifies the creation or modification of Domain Backup private keys. Adversaries may extract the Data Protection API
(DPAPI) domain backup key from a Domain Controller (DC) to be able to decrypt any domain user master key file.
"""
from = "now-9m"
index = [
"winlogbeat-*",
"logs-endpoint.events.file-*",
"logs-windows.sysmon_operational-*",
"endgame-*",
"logs-sentinel_one_cloud_funnel.*",
"logs-m365_defender.event-*",
"logs-crowdstrike.fdr*",
]
language = "eql"
license = "Elastic License v2"
name = "Creation or Modification of Domain Backup DPAPI private key"
references = [
"https://www.dsinternals.com/en/retrieving-dpapi-backup-keys-from-active-directory/",
"https://posts.specterops.io/operational-guidance-for-offensive-user-dpapi-abuse-1fb7fac8b107",
]
risk_score = 73
rule_id = "b83a7e96-2eb3-4edf-8346-427b6858d3bd"
severity = "high"
tags = [
"Domain: Endpoint",
"OS: Windows",
"Use Case: Threat Detection",
"Tactic: Credential Access",
"Data Source: Elastic Endgame",
"Data Source: Elastic Defend",
"Data Source: Sysmon",
"Data Source: SentinelOne",
"Data Source: Microsoft Defender XDR",
"Data Source: Crowdstrike",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
file where host.os.type == "windows" and event.type != "deletion" and file.name : ("ntds_capi_*.pfx", "ntds_capi_*.pvk")
'''
note = """## Triage and analysis
### Investigating Creation or Modification of Domain Backup DPAPI private key
#### Possible investigation steps
- Does the alert show a new or changed domain DPAPI backup key artifact?
- Focus: `event.type`, `event.action`, `file.name`, `file.path`, and `file.size`; distinguish `ntds_capi_*.pfx` or `ntds_capi_*.pvk` in temp, user, share, removable, archive, or controlled recovery paths.
- Implication: escalate on create or modify activity in staging paths or analyst home directories because the artifact can unlock domain DPAPI-protected secrets; lower suspicion only when the path is a controlled DC recovery or IR location tied to the same case.
- Is the acting process a recognized recovery tool or an export utility being abused?
- Why: live DC retrieval and offline AD database extraction both create domain-scale DPAPI exposure once backup keys leave controlled recovery.
- Focus: process-start events scoped by `host.id` and `process.entity_id`, checking `process.executable`, `process.command_line`, `process.pe.original_file_name`, `process.parent.command_line`, and `process.code_signature.subject_name`. $investigate_0
- Implication: escalate when a shell, script host, renamed binary, or command line expresses backup-key export outside controlled recovery; lower concern only when tool identity, parent, and output path fit one controlled recovery workflow.
- Did the same process export companion key material or package the result?
- Focus: file events scoped to `process.entity_id`, or `host.id` plus `process.pid` in a tight time window, checking `file.name`, `file.path`, `file.Ext.original.path`, and `file.Ext.original.name`. $investigate_1
- Implication: escalate when the process creates multiple backup-key outputs, writes companion legacy-key material, renames the files, archives them, or stages other credential-sensitive artifacts.
- Hint: if `ntds_capi_*` disappears quickly, trace rename events through `file.Ext.original.path` and `file.Ext.original.name`; if those fields are absent, fall back to current `file.path` plus the same `process.entity_id` or host/PID time window.
- Do the user and host telemetry fit a tightly scoped recovery operator path?
- Focus: `user.id`, `user.name`, `user.domain`, `host.id`, and `host.name`; separate domain recovery, backup, or IR identities from standard users and ad hoc workstations.
- Implication: escalate when the user or host identity is mismatched, generic, or unexplained for domain backup-key handling; treat a plausible operator and host pairing as candidate benign only after the file, process, and artifact evidence also fit the same workflow.
- Did follow-on activity stage the export for off-host use?
- Focus: process, child-process, file, and network events for the recovered process scope, especially `process.command_line`, `process.parent.command_line`, UNC, removable-media, archive, or share values in `file.path`, and off-host connections. $investigate_4 $investigate_5
- Implication: escalate when copy, archive, compression, removable-media, or share-write activity follows the export, especially from a non-DC host; absence of staging evidence narrows scope but does not close the alert by itself.
- If local evidence remains suspicious or unresolved and related-alert telemetry is available, does the same user or host show credential-access, staging, or tier-0 alerts?
- Focus: optional related-alert views for `user.id`, especially DPAPI abuse, LSASS or credential dumping, DCSync, archive or share staging, lateral movement to DCs, or tier-0 persistence. $investigate_2
- Hint: Pivot by `host.id` when user scope is sparse or host role changes urgency; absence of related-alert telemetry is unresolved, not benign. $investigate_3
- Implication: broaden to domain-compromise scoping when related alerts show credential access, DC access, or staging around the same time; absence of related alerts can narrow scope but must not close the alert without local file, process, artifact, and context alignment.
- Escalate on unrecognized export path, export-tool intent, companion artifacts, mismatched user or host, staging, or corroborating tier-0 alerts; close only when telemetry and recovery, backup, or IR verification bind one controlled workflow; preserve and escalate if evidence is mixed or visibility is incomplete.
### False positive analysis
- AD disaster-recovery, backup validation, or IR collection can legitimately export DPAPI domain backup material. Confirm telemetry first: `process.executable`, `process.command_line`, `file.path`, `user.id`, and `host.id` must all align with the same exact workflow.
- Use a recovery ticket, backup job, or IR case only to verify an already aligned telemetry pattern; do not close on records alone. If records are unavailable, recurring telemetry is a candidate benign pattern, not closure, until it verifies one controlled recovery path without contradictory staging.
- Before creating an exception, validate that the same `process.executable`, `process.command_line`, `file.path`, `user.id`, and `host.id` recur across prior alerts from this rule. Build the exception from that confirmed workflow, and avoid exceptions on `file.name` alone, `.pvk` or `.pfx` extensions alone, or the host alone.
### Response and remediation
- If confirmed benign, reverse any temporary containment and record the process path, command-line pattern, export location, operator identity, and host role that justified closure. Create an exception only if that same workflow recurs consistently across prior alerts from this rule.
- If suspicious but unconfirmed, preserve the exported `file.path`, rename evidence from `file.Ext.original.path` or `file.Ext.original.name`, the file-event timeline, recovered `process.entity_id` or `process.pid`, `process.command_line`, responsible `user.id`, `host.id`, and any UNC, removable-media, archive, or share paths before destructive changes. Apply reversible containment first, such as temporarily restricting share access or outbound connectivity for the affected `host.id`; escalate to host isolation or account containment only if companion staging, corroborating alerts, or other findings show broader compromise and the asset role can tolerate it.
- If confirmed malicious, preserve the same artifacts and use endpoint response to isolate the host or terminate the responsible process. If direct response is unavailable, escalate with the preserved artifact set to the team that can act. For domain controllers, weigh service impact before isolation but do not leave the export accessible.
- If unauthorized domain backup-key export is confirmed on a domain controller, activate the organization's Active Directory compromise response plan, preserve evidence needed to scope DPAPI-protected credential exposure, and begin privileged-account hygiene according to that plan.
- Before deleting or rotating anything, review related `host.id` and `user.id` activity for the same exported filenames, companion legacy-key artifacts, archive names, and UNC or share paths. Then eradicate the unauthorized export files, staging archives, copy utilities, scripts, and persistence mechanisms uncovered during the investigation, and remediate the privilege path or access vector that allowed the export.
- After containment, hunt for the same exported filenames, archive names, and UNC or share paths across other hosts.
"""
setup = """## Setup
This rule is designed for data generated by [Elastic Defend](https://www.elastic.co/security/endpoint-security), which provides native endpoint detection and response, along with event enrichments designed to work with our detection rules.
Setup instructions: https://ela.st/install-elastic-defend
### Additional data sources
This rule also supports the following third-party data sources. For setup instructions, refer to the links below:
- [CrowdStrike](https://ela.st/crowdstrike-integration)
- [Microsoft Defender XDR](https://ela.st/m365-defender)
- [SentinelOne Cloud Funnel](https://ela.st/sentinel-one-cloud-funnel)
- [Sysmon Event ID 11 - File Create](https://ela.st/sysmon-event-11-setup)
"""
[rule.investigation_fields]
field_names = [
"@timestamp",
"event.type",
"host.id",
"host.name",
"user.name",
"user.id",
"user.domain",
"process.entity_id",
"process.pid",
"process.executable",
"process.command_line",
"process.parent.command_line",
"process.code_signature.subject_name",
"file.path",
"file.Ext.original.path",
]
[[transform.investigate]]
label = "Process events for the alerting process"
description = ""
providers = [
[
{ excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" },
{ excluded = false, field = "process.entity_id", queryType = "phrase", value = "{{process.entity_id}}", valueType = "string" },
{ excluded = false, field = "event.category", queryType = "phrase", value = "process", valueType = "string" }
],
[
{ excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" },
{ excluded = false, field = "process.pid", queryType = "phrase", value = "{{process.pid}}", valueType = "string" },
{ excluded = false, field = "event.category", queryType = "phrase", value = "process", valueType = "string" }
]
]
relativeFrom = "now-1h"
relativeTo = "now"
[[transform.investigate]]
label = "File activity for the alerting process"
description = ""
providers = [
[
{ excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" },
{ excluded = false, field = "process.entity_id", queryType = "phrase", value = "{{process.entity_id}}", valueType = "string" },
{ excluded = false, field = "event.category", queryType = "phrase", value = "file", valueType = "string" }
],
[
{ excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" },
{ excluded = false, field = "process.pid", queryType = "phrase", value = "{{process.pid}}", valueType = "string" },
{ excluded = false, field = "event.category", queryType = "phrase", value = "file", valueType = "string" }
]
]
relativeFrom = "now-1h"
relativeTo = "now"
[[transform.investigate]]
label = "Alerts associated with this user"
description = ""
providers = [
[
{ excluded = false, field = "event.kind", queryType = "phrase", value = "signal", valueType = "string" },
{ excluded = false, field = "user.id", queryType = "phrase", value = "{{user.id}}", valueType = "string" }
]
]
relativeFrom = "now-48h/h"
relativeTo = "now"
[[transform.investigate]]
label = "Alerts associated with this host"
description = ""
providers = [
[
{ excluded = false, field = "event.kind", queryType = "phrase", value = "signal", valueType = "string" },
{ excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" }
]
]
relativeFrom = "now-48h/h"
relativeTo = "now"
[[transform.investigate]]
label = "Child processes of the export process"
description = ""
providers = [
[
{ excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" },
{ excluded = false, field = "process.parent.entity_id", queryType = "phrase", value = "{{process.entity_id}}", valueType = "string" },
{ excluded = false, field = "event.category", queryType = "phrase", value = "process", valueType = "string" }
]
]
relativeFrom = "now-1h"
relativeTo = "now"
[[transform.investigate]]
label = "Network activity for the export process and children"
description = ""
providers = [
[
{ excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" },
{ excluded = false, field = "process.entity_id", queryType = "phrase", value = "{{process.entity_id}}", valueType = "string" },
{ excluded = false, field = "event.category", queryType = "phrase", value = "network", valueType = "string" }
],
[
{ excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" },
{ excluded = false, field = "process.parent.entity_id", queryType = "phrase", value = "{{process.entity_id}}", valueType = "string" },
{ excluded = false, field = "event.category", queryType = "phrase", value = "network", valueType = "string" }
]
]
relativeFrom = "now-1h"
relativeTo = "now"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1003"
name = "OS Credential Dumping"
reference = "https://attack.mitre.org/techniques/T1003/"
[[rule.threat.technique.subtechnique]]
id = "T1003.003"
name = "NTDS"
reference = "https://attack.mitre.org/techniques/T1003/003/"
[[rule.threat.technique]]
id = "T1552"
name = "Unsecured Credentials"
reference = "https://attack.mitre.org/techniques/T1552/"
[[rule.threat.technique.subtechnique]]
id = "T1552.004"
name = "Private Keys"
reference = "https://attack.mitre.org/techniques/T1552/004/"
[[rule.threat.technique]]
id = "T1555"
name = "Credentials from Password Stores"
reference = "https://attack.mitre.org/techniques/T1555/"
[rule.threat.tactic]
id = "TA0006"
name = "Credential Access"
reference = "https://attack.mitre.org/tactics/TA0006/"
Stages and Predicates
Stage 1: file
file where host.os.type == "windows" and event.type != "deletion" and file.name : ("ntds_capi_*.pfx", "ntds_capi_*.pvk")
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.type | ne |
| field:"event.type" kind:ne value:"deletion" |
file.name | wildcard |
| field:"file.name" kind:wildcard |
Discovery Command Output Written to Suspicious File
#Detects when a discovery command is executed followed by the immediate modification of a suspicious file via the same process. Many types of malware execute discovery commands, save the output to a file, and then exfiltrate that file via their C2 channel.
MITRE ATT&CK Coverage
Telemetry Coverage
Rule Body
[metadata]
creation_date = "2026/01/30"
integration = ["endpoint"]
maturity = "production"
updated_date = "2026/03/24"
[rule]
author = ["Elastic"]
description = """
Detects when a discovery command is executed followed by the immediate modification of a suspicious file via
the same process. Many types of malware execute discovery commands, save the output to a file, and then
exfiltrate that file via their C2 channel.
"""
from = "now-9m"
index = ["logs-endpoint.events.process-*", "logs-endpoint.events.file-*"]
language = "eql"
license = "Elastic License v2"
name = "Discovery Command Output Written to Suspicious File"
note = """ ## Triage and analysis
> **Disclaimer**:
> This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.
### Investigating Discovery Command Output Written to Suspicious File
This rule flags a macOS discovery utility launched from an interactive shell and, within seconds, the same process writing to an unusual or hidden file location, indicating staged reconnaissance for later theft. Adversaries commonly run commands like `whoami`, `ifconfig`, `dscl`, or `system_profiler` and redirect output into `/tmp`, `/Users/Shared`, or a dotfile path to bundle host details before exfiltrating the collected text.
### Possible investigation steps
- Review the created/modified file’s contents, size, and timestamps to confirm it contains discovery output and whether it is being appended across multiple executions.
- Pivot from the initiating process to identify subsequent child processes or shell commands that compress, encrypt, move, or delete the file, indicating staging and cleanup.
- Examine concurrent network activity from the same process tree for outbound connections, file uploads, or suspicious DNS/HTTP requests immediately after the write event.
- Validate the interactive session context by correlating to the logged-in user, terminal/TTY (if available), remote access artifacts (SSH/VPN/remote management), and recent authentication events for that account.
- Hunt on the host for related staging patterns such as additional hidden files in common drop locations, recent archive creation, or persistence changes (LaunchAgents/LaunchDaemons/crontab) around the alert time.
### False positive analysis
- An administrator or troubleshooting script run from bash/zsh may execute built-in discovery commands (e.g., `system_profiler`, `ifconfig`, `dscl`) and redirect the output into `/tmp`, `/private/tmp`, or `/Users/Shared` as a temporary log or support bundle artifact.
- A login/profile shell customization (e.g., `.zshrc`/`.bash_profile`) or local diagnostic routine may run `whoami`/`arch`/`csrutil` and append results into a hidden dotfile path (e.g., `/*/.*`) for auditing or environment validation, creating a short command-then-write pattern.
### Response and remediation
- Isolate the macOS host from the network and suspend or terminate the implicated shell/process tree that executed the discovery command and immediately wrote into locations like `/tmp`, `/Users/Shared`, or hidden dotfiles to prevent further staging or exfiltration.
- Quarantine the written file(s) and any adjacent artifacts (archives, encrypted blobs, renamed copies) from the same directories, preserve them for analysis, and remove the staged data once collection is complete.
- Identify and eradicate the launch point by reviewing the invoking shell history and user startup scripts (e.g., `.zshrc`, `.bash_profile`) for redirection or scripted discovery, and delete any associated persistence (LaunchAgents/LaunchDaemons, cron entries) tied to the same user or file path.
- Rotate credentials and invalidate active sessions for the logged-in user that ran the command, and audit recent remote access methods (SSH, remote management, VPN) used on the host to ensure the account was not compromised.
- Restore the host to a known-good state by reinstalling or reimaging if tampering is suspected, then monitor for re-creation of the same suspicious file paths and repeat discovery-to-file-write behavior from any interactive shell.
- Escalate to IR leadership immediately if the staged file contains host/user inventory data and there is evidence of outbound transfer attempts (new external connections, upload utilities like `curl`/`scp`, or rapid archive creation) following the write event.
"""
risk_score = 47
rule_id = "60da1bd7-c0b9-4ba2-b487-50a672274c04"
severity = "medium"
tags = [
"Domain: Endpoint",
"OS: macOS",
"Use Case: Threat Detection",
"Tactic: Collection",
"Tactic: Discovery",
"Data Source: Elastic Defend",
"Resources: Investigation Guide",
]
type = "eql"
query = '''
sequence by process.entity_id with maxspan=15s
[process where host.os.type == "macos" and event.type == "start" and event.action == "exec" and
process.parent.name in ("bash", "sh", "zsh") and
process.name in ("whoami", "ifconfig", "system_profiler", "dscl", "arch", "csrutil") and
process.args_count == 1]
[file where host.os.type == "macos" and event.action == "modification" and
file.path like ("/Users/Shared/*", "/tmp/*", "/private/tmp/*", "/Library/WebServer/*",
"/Library/Graphics/*", "/Library/Fonts/*", "/private/var/root/Library/HTTPStorages/*", "/*/.*") and
not file.path like ("/private/tmp/*.fifo", "/private/tmp/tcl-tk*")]
'''
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1074"
name = "Data Staged"
reference = "https://attack.mitre.org/techniques/T1074/"
[[rule.threat.technique.subtechnique]]
id = "T1074.001"
name = "Local Data Staging"
reference = "https://attack.mitre.org/techniques/T1074/001/"
[rule.threat.tactic]
id = "TA0009"
name = "Collection"
reference = "https://attack.mitre.org/tactics/TA0009/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1016"
name = "System Network Configuration Discovery"
reference = "https://attack.mitre.org/techniques/T1016/"
[[rule.threat.technique]]
id = "T1033"
name = "System Owner/User Discovery"
reference = "https://attack.mitre.org/techniques/T1033/"
[[rule.threat.technique]]
id = "T1082"
name = "System Information Discovery"
reference = "https://attack.mitre.org/techniques/T1082/"
[rule.threat.tactic]
id = "TA0007"
name = "Discovery"
reference = "https://attack.mitre.org/tactics/TA0007/"
Stages and Predicates
Ordered sequence: each step below must occur in order within 15s, correlated by process.entity_id.
Stage 1: process
[process where host.os.type == "macos" and event.type == "start" and event.action == "exec" and
process.parent.name in ("bash", "sh", "zsh") and
process.name in ("whoami", "ifconfig", "system_profiler", "dscl", "arch", "csrutil") and
process.args_count == 1]
Stage 2: file
[file where host.os.type == "macos" and event.action == "modification" and
file.path like ("/Users/Shared/*", "/tmp/*", "/private/tmp/*", "/Library/WebServer/*",
"/Library/Graphics/*", "/Library/Fonts/*", "/private/var/root/Library/HTTPStorages/*", "/*/.*") and
not file.path like ("/private/tmp/*.fifo", "/private/tmp/tcl-tk*")]
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | eq |
| field:"EventType" kind:eq |
event.type | eq |
| field:"event.type" kind:eq value:"start" |
file.path | wildcard |
| field:"TargetFilename" kind:wildcard |
process.args_count | eq |
| field:"process.args_count" kind:eq value:"1" |
process.name | in |
| field:"process_basename" kind:in |
process.parent.name | in |
| field:"parent_process_basename" kind:in |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
file.path | wildcard | /private/tmp/*.fifo, /private/tmp/tcl-tk* | excludes:file.path field:"file.path" value:"/private/tmp/*.fifo" field:"file.path" value:"/private/tmp/tcl-tk*" |
Disk Image Download and Mount via Hdiutil
#Detects when Curl or NsCurl is used to download a disk image file (.dmg) followed immediately by mounting that disk image using the native Hdiutil binary within a short timespan. Threat actors leverage disk images to deliver additional payload stages and evade security defenses during initial infection chains.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Execution | |
| Stealth | |
| Command & Control |
Telemetry Coverage
Rule Body
[rule]
description = """
Detects when Curl or NsCurl is used to download a disk image file (.dmg) followed immediately by mounting that disk
image using the native Hdiutil binary within a short timespan. Threat actors leverage disk images to deliver additional
payload stages and evade security defenses during initial infection chains.
"""
id = "8eeb017a-0a3f-4e8f-9166-5a695204afb6"
license = "Elastic License v2"
name = "Disk Image Download and Mount via Hdiutil"
os_list = ["macos"]
reference = [
"https://pberba.github.io/security/2025/11/11/macos-infection-vector-applescript-bypass-gatekeeper/",
]
version = "1.0.1"
query = '''
sequence with maxspan=20s
[file where event.action in ("modification", "creation") and process.name in ("curl", "nscurl") and
file.extension == "dmg"] by Effective_process.entity_id
[process where event.type == "start" and event.action == "exec" and process.name == "hdiutil" and
process.args == "mount"] by process.parent.entity_id
'''
min_endpoint_version = "8.16.0"
optional_actions = []
[[actions]]
action = "kill_process"
field = "Effective_process.entity_id"
state = 0
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1059"
name = "Command and Scripting Interpreter"
reference = "https://attack.mitre.org/techniques/T1059/"
[[threat.technique]]
id = "T1204"
name = "User Execution"
reference = "https://attack.mitre.org/techniques/T1204/"
[[threat.technique.subtechnique]]
id = "T1204.002"
name = "Malicious File"
reference = "https://attack.mitre.org/techniques/T1204/002/"
[threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1218"
name = "System Binary Proxy Execution"
reference = "https://attack.mitre.org/techniques/T1218/"
[threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1105"
name = "Ingress Tool Transfer"
reference = "https://attack.mitre.org/techniques/T1105/"
[threat.tactic]
id = "TA0011"
name = "Command and Control"
reference = "https://attack.mitre.org/tactics/TA0011/"
[internal]
min_endpoint_version = "8.16.0"
Stages and Predicates
Ordered sequence: each step below must occur in order within 20s, correlated by Effective_process.entity_id, process.parent.entity_id.
Stage 1: file
[file where event.action in ("modification", "creation") and process.name in ("curl", "nscurl") and
file.extension == "dmg"] by Effective_process.entity_id
Stage 2: process
[process where event.type == "start" and event.action == "exec" and process.name == "hdiutil" and
process.args == "mount"] by process.parent.entity_id
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | eq |
| field:"EventType" kind:eq value:"exec" |
event.action | in |
| field:"EventType" kind:in |
event.type | eq |
| field:"event.type" kind:eq value:"start" |
file.extension | eq |
| field:"file.extension" kind:eq value:"dmg" |
process.args | eq |
| field:"process.args" kind:eq value:"mount" |
process.name | eq |
| field:"process_basename" kind:eq value:"hdiutil" |
process.name | in |
| field:"process_basename" kind:in |
Egress Network Connection from Node.js Descendant
#This rule detects when a network connection is established via a descendant of a Node.js process. Attackers may use Node.js to run scripts that create network connections for various malicious purposes, such as downloading and executing payloads, establishing persistence, or exfiltrating data.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Execution | |
| Command & Control |
Telemetry Coverage
Rule Body
[rule]
description = """
This rule detects when a network connection is established via a descendant of a Node.js process. Attackers may use
Node.js to run scripts that create network connections for various malicious purposes, such as downloading and executing
payloads, establishing persistence, or exfiltrating data.
"""
id = "adf59538-f71f-45e2-a3ae-af95b31c41df"
license = "Elastic License v2"
name = "Egress Network Connection from Node.js Descendant"
os_list = ["macos"]
version = "1.0.8"
query = '''
sequence by process.entity_id with maxspan=1m
[process where event.type == "start" and event.action == "exec" and not process.name == "node" and
(
descendant of [process where event.type == "start" and event.action == "exec" and process.name == "node" and
(
process.command_line : ("*post-install*", "*preinstall*") or
(process.args like "*/npm" and process.args in ("install", "update"))
)] or
(process.parent.name == "node" and process.parent.command_line like ("*post-install*", "*preinstall*")) or
(process.parent.name == "node" and process.parent.args like "*/npm" and process.parent.args in ("install", "update"))
) and not (
(process.name == "sh" and process.args == "-c" and process.args == "node") or
process.args like ("rebuild", "build", "compile", "copyfiles*") or
process.command_line in (
"sh -c :; (node ./preinstall.js > /dev/null 2>&1 || true)",
"""sh -c node -e "try{require('./_postinstall')}catch(e){}" || exit 0"""
)
) and (
process.name like (
"nohup", "setsid", "nc", "ncat", "netcat", "netcat.openbsd", "netcat.traditional", "nc.openbsd",
"nc.traditional", "socat", "telnet", "busybox", "mkfifo", "xterm"
) or
process.executable like (
"/tmp/*", "/var/tmp/*", "/dev/shm/*", "./*", "/run/*", "/var/run/*", "/boot/*", "/sys/*", "/lost+found/*",
"/proc/*", "/var/mail/*", "/var/www/*"
) or
(
process.name == "curl" and process.args like "*http*" and process.args in ("-o", "--output") and
process.args like ("/tmp/*", "/var/tmp/*", "/dev/shm/*", "/private/tmp/*")
) or
(
process.name == "wget" and process.args like "*http*" and process.args in ("-O", "--output-document") and
process.args like ("/tmp/*", "/var/tmp/*", "/dev/shm/*", "/private/tmp/*")
) or
(process.name : "python*" and process.args : "-c" and process.args : (
"*import*pty*spawn*", "*import*subprocess*call*"
)) or
(process.name : "perl*" and process.args : "-e" and process.args : "*socket*" and process.args : (
"*exec*", "*system*"
)) or
(process.name : "ruby*" and process.args : ("-e", "-rsocket") and process.args : (
"*TCPSocket.new*", "*TCPSocket.open*"
)) or
(process.name : "lua*" and process.args : "-e" and process.args : "*socket.tcp*" and process.args : (
"*io.popen*", "*os.execute*"
)) or
(process.name : "php*" and process.args : "-r" and process.args : "*fsockopen*" and process.args : "*/bin/*sh*") or
(process.name : ("awk", "gawk", "mawk", "nawk") and process.args : "*/inet/tcp/*") or
(process.name in ("rvim", "vim", "vimdiff", "rview", "view") and process.args == "-c" and process.args : "*socket*")
) and not (
process.executable like (
"/usr/bin/terraform", "/opt/homebrew/Cellar/git/*/libexec/git-core/git-remote-http", "/usr/local/aws-cli/aws", "/usr/bin/env",
"/Applications/Xcode.app/Contents/Developer/usr/libexec/git-core/git-remote-http", "/usr/lib/git-core/git-remote-https", "/usr/bin/ssh",
"/home/linuxbrew/.linuxbrew/opt/git/libexec/git-core/git-remote-https", "/usr/lib/git-core/git-remote-https", "/usr/bin/git-remote-https",
"/usr/bin/ssh", "/var/lib/docker/*/git-remote-https", "/usr/libexec/git-core/git", "/home/linuxbrew/.linuxbrew/*", "/usr/lib/git-core/git"
) or
process.parent.executable like (
"/opt/homebrew/Library/Homebrew/vendor/portable-ruby/*/bin/ruby", "/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/*/bin/ruby",
"/usr/bin/git"
)
)
]
[network where event.type == "start" and event.action == "connection_attempted" and (
process.name like (
"nohup", "setsid", "nc", "ncat", "netcat", "netcat.openbsd", "netcat.traditional", "nc.openbsd",
"nc.traditional", "socat", "telnet", "busybox", "mkfifo", "xterm",
"curl", "wget", "python*", "perl*", "ruby*", "lua*", "php*", "awk", "gawk", "mawk", "nawk", "rvim", "vim", "vimdiff", "rview",
"view"
) or
process.executable like (
"/tmp/*", "/var/tmp/*", "/dev/shm/*", "./*", "/run/*", "/var/run/*", "/boot/*", "/sys/*", "/lost+found/*",
"/proc/*", "/var/mail/*", "/var/www/*"
)
) and not (
destination.ip == null or destination.ip == "0.0.0.0" or
cidrmatch(
destination.ip, "10.0.0.0/8", "127.0.0.0/8", "169.254.0.0/16", "172.16.0.0/12", "192.0.0.0/24", "192.0.0.0/29",
"192.0.0.8/32", "192.0.0.9/32", "192.0.0.10/32", "192.0.0.170/32", "192.0.0.171/32", "192.0.2.0/24",
"192.31.196.0/24", "192.52.193.0/24", "192.168.0.0/16", "192.88.99.0/24", "224.0.0.0/4", "100.64.0.0/10",
"192.175.48.0/24","198.18.0.0/15", "198.51.100.0/24", "203.0.113.0/24", "240.0.0.0/4", "::1", "FE80::/10",
"FF00::/8"
)
)
]
'''
min_endpoint_version = "7.15.0"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 1
[[actions]]
action = "kill_process"
field = "process.parent.entity_id"
state = 0
[[actions]]
action = "kill_process"
field = "process.parent.entity_id"
state = 1
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1059"
name = "Command and Scripting Interpreter"
reference = "https://attack.mitre.org/techniques/T1059/"
[[threat.technique.subtechnique]]
id = "T1059.004"
name = "Unix Shell"
reference = "https://attack.mitre.org/techniques/T1059/004/"
[threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1071"
name = "Application Layer Protocol"
reference = "https://attack.mitre.org/techniques/T1071/"
[[threat.technique.subtechnique]]
id = "T1071.001"
name = "Web Protocols"
reference = "https://attack.mitre.org/techniques/T1071/001/"
[threat.tactic]
id = "TA0011"
name = "Command and Control"
reference = "https://attack.mitre.org/tactics/TA0011/"
[internal]
min_endpoint_version = "7.15.0"
Stages and Predicates
Ordered sequence: each step below must occur in order within 1m, correlated by process.entity_id.
Stage 1: process
[process where event.type == "start" and event.action == "exec" and not process.name == "node" and
(
descendant of [process where event.type == "start" and event.action == "exec" and process.name == "node" and
(
process.command_line : ("*post-install*", "*preinstall*") or
(process.args like "*/npm" and process.args in ("install", "update"))
)] or
(process.parent.name == "node" and process.parent.command_line like ("*post-install*", "*preinstall*")) or
(process.parent.name == "node" and process.parent.args like "*/npm" and process.parent.args in ("install", "update"))
) and not (
(process.name == "sh" and process.args == "-c" and process.args == "node") or
process.args like ("rebuild", "build", "compile", "copyfiles*") or
process.command_line in (
"sh -c :; (node ./preinstall.js > /dev/null 2>&1 || true)",
"""sh -c node -e "try{require('./_postinstall')}catch(e){}" || exit 0"""
)
) and (
process.name like (
"nohup", "setsid", "nc", "ncat", "netcat", "netcat.openbsd", "netcat.traditional", "nc.openbsd",
"nc.traditional", "socat", "telnet", "busybox", "mkfifo", "xterm"
) or
process.executable like (
"/tmp/*", "/var/tmp/*", "/dev/shm/*", "./*", "/run/*", "/var/run/*", "/boot/*", "/sys/*", "/lost+found/*",
"/proc/*", "/var/mail/*", "/var/www/*"
) or
(
process.name == "curl" and process.args like "*http*" and process.args in ("-o", "--output") and
process.args like ("/tmp/*", "/var/tmp/*", "/dev/shm/*", "/private/tmp/*")
) or
(
process.name == "wget" and process.args like "*http*" and process.args in ("-O", "--output-document") and
process.args like ("/tmp/*", "/var/tmp/*", "/dev/shm/*", "/private/tmp/*")
) or
(process.name : "python*" and process.args : "-c" and process.args : (
"*import*pty*spawn*", "*import*subprocess*call*"
)) or
(process.name : "perl*" and process.args : "-e" and process.args : "*socket*" and process.args : (
"*exec*", "*system*"
)) or
(process.name : "ruby*" and process.args : ("-e", "-rsocket") and process.args : (
"*TCPSocket.new*", "*TCPSocket.open*"
)) or
(process.name : "lua*" and process.args : "-e" and process.args : "*socket.tcp*" and process.args : (
"*io.popen*", "*os.execute*"
)) or
(process.name : "php*" and process.args : "-r" and process.args : "*fsockopen*" and process.args : "*/bin/*sh*") or
(process.name : ("awk", "gawk", "mawk", "nawk") and process.args : "*/inet/tcp/*") or
(process.name in ("rvim", "vim", "vimdiff", "rview", "view") and process.args == "-c" and process.args : "*socket*")
) and not (
process.executable like (
"/usr/bin/terraform", "/opt/homebrew/Cellar/git/*/libexec/git-core/git-remote-http", "/usr/local/aws-cli/aws", "/usr/bin/env",
"/Applications/Xcode.app/Contents/Developer/usr/libexec/git-core/git-remote-http", "/usr/lib/git-core/git-remote-https", "/usr/bin/ssh",
"/home/linuxbrew/.linuxbrew/opt/git/libexec/git-core/git-remote-https", "/usr/lib/git-core/git-remote-https", "/usr/bin/git-remote-https",
"/usr/bin/ssh", "/var/lib/docker/*/git-remote-https", "/usr/libexec/git-core/git", "/home/linuxbrew/.linuxbrew/*", "/usr/lib/git-core/git"
) or
process.parent.executable like (
"/opt/homebrew/Library/Homebrew/vendor/portable-ruby/*/bin/ruby", "/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/*/bin/ruby",
"/usr/bin/git"
)
)
]
Stage 2: network
[network where event.type == "start" and event.action == "connection_attempted" and (
process.name like (
"nohup", "setsid", "nc", "ncat", "netcat", "netcat.openbsd", "netcat.traditional", "nc.openbsd",
"nc.traditional", "socat", "telnet", "busybox", "mkfifo", "xterm",
"curl", "wget", "python*", "perl*", "ruby*", "lua*", "php*", "awk", "gawk", "mawk", "nawk", "rvim", "vim", "vimdiff", "rview",
"view"
) or
process.executable like (
"/tmp/*", "/var/tmp/*", "/dev/shm/*", "./*", "/run/*", "/var/run/*", "/boot/*", "/sys/*", "/lost+found/*",
"/proc/*", "/var/mail/*", "/var/www/*"
)
) and not (
destination.ip == null or destination.ip == "0.0.0.0" or
cidrmatch(
destination.ip, "10.0.0.0/8", "127.0.0.0/8", "169.254.0.0/16", "172.16.0.0/12", "192.0.0.0/24", "192.0.0.0/29",
"192.0.0.8/32", "192.0.0.9/32", "192.0.0.10/32", "192.0.0.170/32", "192.0.0.171/32", "192.0.2.0/24",
"192.31.196.0/24", "192.52.193.0/24", "192.168.0.0/16", "192.88.99.0/24", "224.0.0.0/4", "100.64.0.0/10",
"192.175.48.0/24","198.18.0.0/15", "198.51.100.0/24", "203.0.113.0/24", "240.0.0.0/4", "::1", "FE80::/10",
"FF00::/8"
)
)
]
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | eq |
| field:"EventType" kind:eq |
event.type | eq |
| field:"event.type" kind:eq value:"start" |
process.args | eq |
| field:"process.args" kind:eq value:"-c" |
process.args | in |
| field:"process.args" kind:in |
process.args | wildcard |
| field:"process.args" kind:wildcard |
process.executable | wildcard |
| field:"Image" kind:wildcard |
process.name | eq |
| field:"process_basename" kind:eq |
process.name | in |
| field:"process_basename" kind:in |
process.name | wildcard |
| field:"process_basename" kind:wildcard |
process.parent.args | in |
| field:"process.parent.args" kind:in |
process.parent.args | wildcard |
| field:"process.parent.args" kind:wildcard value:"*/npm" |
process.parent.command_line | wildcard |
| field:"ParentCommandLine" kind:wildcard |
process.parent.name | eq |
| field:"parent_process_basename" kind:eq value:"node" |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.args | eq | -c | excludes:process.args field:"process.args" value:"-c" |
process.args | eq | node | excludes:process.args field:"process.args" value:"node" |
process.name | eq | sh | excludes:process.name field:"process.name" value:"sh" |
process.args | wildcard | rebuild, build, compile, copyfiles* | excludes:process.args |
process.command_line | in | sh -c node -e "try{require('./_postinstall')}catch(e){}" || exit 0, sh -c :; (node ./preinstall.js > /dev/null 2>&1 || true) | excludes:process.command_line |
process.executable | wildcard | /usr/bin/terraform, /opt/homebrew/Cellar/git/*/libexec/git-core/git-remote-http, /usr/local/aws-cli/aws, /usr/bin/env, /Applications/Xcode.app/Contents/Developer/usr/libexec/git-core/git-remote-http, /usr/lib/git-core/git-remote-https, /usr/bin/ssh, /home/linuxbrew/.linuxbrew/opt/git/libexec/git-core/git-remote-https, /usr/lib/git-core/git-remote-https, /usr/bin/git-remote-https, /usr/bin/ssh, /var/lib/docker/*/git-remote-https, /usr/libexec/git-core/git, /home/linuxbrew/.linuxbrew/*, /usr/lib/git-core/git | excludes:process.executable |
process.parent.executable | wildcard | /opt/homebrew/Library/Homebrew/vendor/portable-ruby/*/bin/ruby, /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/*/bin/ruby, /usr/bin/git | excludes:process.parent.executable field:"process.parent.executable" value:"/opt/homebrew/Library/Homebrew/vendor/portable-ruby/*/bin/ruby" field:"process.parent.executable" value:"/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/*/bin/ruby" field:"process.parent.executable" value:"/usr/bin/git" |
process.name | eq | node | excludes:process.name field:"process.name" value:"node" |
destination.ip | cidr_match | 10.0.0.0/8, 127.0.0.0/8, 169.254.0.0/16, 172.16.0.0/12, 192.0.0.0/24, 192.0.0.0/29, 192.0.0.8/32, 192.0.0.9/32, 192.0.0.10/32, 192.0.0.170/32, 192.0.0.171/32, 192.0.2.0/24, 192.31.196.0/24, 192.52.193.0/24, 192.168.0.0/16, 192.88.99.0/24, 224.0.0.0/4, 100.64.0.0/10, 192.175.48.0/24, 198.18.0.0/15, 198.51.100.0/24, 203.0.113.0/24, 240.0.0.0/4, ::1, FE80::/10, FF00::/8 | excludes:destination.ip |
destination.ip | eq | 0.0.0.0 | excludes:destination.ip field:"destination.ip" value:"0.0.0.0" |
destination.ip | is_null | excludes:destination.ip |
Execution of a File Dropped from SMB
#Identifies the execution of a file that was created by the virtual system process and subsequently executed. This may indicate lateral movement via network file shares.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Lateral Movement |
Rule Body
[rule]
description = """
Identifies the execution of a file that was created by the virtual system process and subsequently executed. This may
indicate lateral movement via network file shares.
"""
id = "be55434a-ae96-437e-aaaf-9fb60cd7dff4"
license = "Elastic License v2"
name = "Execution of a File Dropped from SMB"
os_list = ["windows"]
version = "1.0.35"
query = '''
sequence with maxspan=5m
[file where event.action != "deletion" and
/* library dropped via SMB */
process.pid == 4 and user.id : ("S-1-5-21*", "S-1-12-*") and
(file.extension : "exe" or file.Ext.header_bytes : "4d5a*")] by file.path
[process where event.action == "start" and
(
process.parent.name : ("wmiprvse.exe", "wsmprovhost.exe", "RemComSvc*.exe", "psexesvc*.exe", "KaseyaEndpoint.exe", "powershell.exe") or
descendant of [process where event.action == "start" and process.name : ("wmiprvse.exe", "wsmprovhost.exe", "RemComSvc*.exe", "psexesvc*.exe")] or
(process.parent.name : "cmd.exe" and process.Ext.session_info.logon_type : "Network")
) and
/* Signed False Positives */
not (process.code_signature.subject_name :
("RAPIDFIRE TOOLS INC.",
"Arcserve (USA) LLC",
"PDQ.COM CORPORATION",
"Veeam Software Group GmbH",
"Veeam Software AG",
"LANDesk Software, Inc.",
"Cynet Security LTD",
"CyberArk Software Ltd.",
"Barracuda Networks, Inc.",
"AVG Technologies Canada, Inc.",
"ConnectWise, Inc.",
"Ivanti, Inc.",
"FUJITSU LIMITED",
"Shavlik Technologies",
"Kaspersky Lab JSC",
"Netalytics Security Inc",
"Elasticsearch, Inc.",
"Netwrix Corporation",
"Power Admin LLC",
"Notepad++",
"The Apache Software Foundation",
"HashInclude Computech Pvt. Ltd.",
"DIGITAL DEFENSE, INC",
"Snow Software AB",
"GOVERLAN, LLC",
"Veritas Technologies LLC",
"Bitdefender SRL",
"Kaseya Corporation",
"Insecure.Com LLC",
"ZOHO Corporation Private Limited",
"VMware, Inc.",
"Medical Information Technology, Inc.",
"baramundi software AG",
"ServiceNow, Inc.",
"Panda Security, S.L.",
"CoSoSys SRL",
"N-ABLE TECHNOLOGIES LTD",
"CISCO SYSTEMS, INC.",
"TeamViewer Germany GmbH",
"SysAid Technologies LTD",
"Sophos Ltd",
"Ericsson",
"Quest Software Inc.",
"Commvault Systems, Inc.",
"Red Gate Software Ltd",
"itelio GmbH",
"Cocobolo Software, LLC",
"Tenable Network Security Inc.",
"CS.NIWC-ATLANTIC.001",
"Lansweeper",
"Lenovo",
"Acronis International GmbH",
"Cisco WebEx LLC",
"Helge Klein GmbH",
"FireEye, Inc.",
"Oracle America, Inc.",
"Chocolatey Software, Inc.",
"Micro Focus Group Limited",
"Solarwinds Worldwide, LLC",
"Cyberark Software Ltd.",
"AO Kaspersky Lab",
"Symantec Corporation",
"Hornetsecurity GmbH",
"KASEYA US LLC",
"ForeScout Technologies, Inc",
"KASEYA HOLDINGS INC.",
"Kaseya Holdings Inc",
"ConnectSecure LLC",
"Red Gate Software Limited",
"Dell Inc.",
"WatchGuard Technologies, Inc.",
"EFOLDER, INC.",
"Laserfiche") and process.code_signature.trusted == true) and
not (process.code_signature.subject_name in ("Medical Information Technology, Inc.", "CyberArk Software Ltd.", "VMware, Inc.", "Veritas Technologies LLC") and
process.code_signature.status in ("errorTimeStamp", "errorChaining")) and
not (process.code_signature.subject_name : "Microsoft *" and
process.code_signature.trusted == true and
process.pe.original_file_name : ("MOMAgentInstaller.exe", "dotnet-hosting-*-win.exe", "dpmac.exe", "PushClient.exe",
"migrate.exe", "Ms.Dsp.Do.Inc.Installer.exe", "OpenHandleCollector.exe", "VC_redist*.exe")) and
/* fart-it.sourceforge.net, IseExecSvc, OCS Inventory Agent,Tenable MW Scanner and HPCmdSvc */
not process.hash.sha256 in
("c9ef35bed70ffa0981bafd0071185b56fdad8f9c97f3582a4dae9b420959fb97",
"18dc098895ccc8246d417445a36d933c5f8487419b848ebe651fd0e11cb22afa",
"ea98309a35f92443b9c50736ce208656ec72af114ec8aceeb02dfa041ec2d6bc",
"bcf07679ea026f1dfba6f9ab63251e4834dc007bd2c5b9039deb9d900fe1c5e6",
"1c6af94b26f369e2c10819eefb869f873e5540e2c1b7bf4c7c632fc03d67368a",
"6dfc3a0733f427779b250913811baa429002042cb8e7732ea7d334bf725b8bd0",
"ae0fb4bf4a6faa4b808794b6e6ccbdf9f10c1ce01a86ccece002ac63cf09ff29",
"cd5ff596b7bacb117f90893f94fd8c542b659cc58f90ed1fbd0471fe85148bff",
"5e7785fede192d69e408c8c41ba14aead2f4b297c9faecc991e061b093b91f70",
"08d019e46a8755c33ad9ff9b96b5409a9005d87ba4e3cc58bdd8cf10eb0cd987",
"81e6e6feaac8b3267608af98667d3ccf78a15e540e6a5d18858d9147aacd1e16",
"a07b0b72bb00d9e9debd38c2b4bd770beb7d6cf6148d2f7fba50d7a7078deb04",
"bc10fdc46d17765c619db70ef19cd3755a3270692481d8417bfff3fceb4eba10",
"bb53243baeb4e4cc204e5b9981cc0c671e0855f56293df5106b9b3beac30cc15",
"c5593f5d965994a50985b529e77b97c348c7af084dbbaba270d83b1b06302d2c",
"7f8e465edd27cdcd1d28292c35440d745b8bd528e21d6f56eb683b65d922eaed",
"ef7dbfe3a3910ddb93989f0d5d8f1fb4d39e0df7e53f55d042f4ccd80699c81f",
"bb53243baeb4e4cc204e5b9981cc0c671e0855f56293df5106b9b3beac30cc15",
"bc10fdc46d17765c619db70ef19cd3755a3270692481d8417bfff3fceb4eba10",
"ef7dbfe3a3910ddb93989f0d5d8f1fb4d39e0df7e53f55d042f4ccd80699c81f",
"39b3ae96186b7e62b9176e6d2ae27db3e164a7c8c52c094c811dd19d651577f2",
"5e7785fede192d69e408c8c41ba14aead2f4b297c9faecc991e061b093b91f70",
"b9fc7dea50ce1e0637a3628abc89f96d8cfaad1b7c6ad33dd8bb17028ed3eaee",
"5e81eaedc6bba9c9b475f990cdc31ee3c48962fffb63d65afc1447ea6b95f910",
"ec7d2582c06d28191b2efaf6780cdfa5c1319f3081bd001d4572cbeea0068b48",
"68591e82d0091f12e15f3c21cbf643793bc2b5a14ef46408bb06f794669f7f0b",
"156f567b058b5e067a64f3d5736a78bbf9669c822fc5f95620a759c288e2224b",
"e659b5a7045bd1820a0efd3e324ebd4a72ecebd0981deb6cbe1899c95351dc91",
"84633fd9a39188ca937188decdeb746a0be3476d68f7ccde4d742fa8ca5dc1f6",
"4208e349ff97a2dc6100ee9e5e61e23ab650b316e62dd4a25d1119a08a59f298",
"52b196bbe9016488c735e7b41805b651261ffa5d7aa86eb6a1d0095be83687b2",
"85640066a45c1fd934f3faf2a8db926ed77b622be7cfcce15a25707abf604d55",
"cb7f34839ce80b7aaef9f8d61bc61b1f471fdfc514c13a675350077bbf27b24c",
"c6d195690a617791e7e9f483597cea1f68fbe59e3f9b1989a1d324f00e9d1c80",
"c6d195690a617791e7e9f483597cea1f68fbe59e3f9b1989a1d324f00e9d1c80",
"9e3cd4d957f1130e8308357b921d2475afd1519704f0a176a062d06d96199da2",
"5485ca7e2be4afc76aadd97536192cf2850228fe338083d6bab4c981bd6ddf92",
"0a765aa0610aba8d792b0153779a52a922ae5a5741af52373abb17e9e10c24ed",
"5968e3951cb6bf4368b866597f06317e576e6efc14d360dfffc336f1213e3a08",
"10d422f089daeeff80644ff1e45ecfcf83a7501dd5edc22477f3717f36b321f6") and
not (process.code_signature.subject_name == "CyberArk Software Ltd." and
process.executable : "?:\\Windows\\CAInvokerService.exe" and process.pe.original_file_name == "PSMWinAgentInvoker.exe") and
not (process.pe.original_file_name in ("ccmsetup.exe", "OneDriveSetup.exe") and process.code_signature.subject_name : "Microsoft*" and
process.code_signature.trusted == true) and
not (process.parent.name : "powershell.exe" and process.executable : ("?:\\Program Files (x86)\\*", "?:\\Program Files\\*")) and
not (process.executable : "?:\\Program Files\\BearingPoint\\*\\KRS.CorrespondenceJobService.exe" and process.parent.name : "wsmprovhost.exe")
] by process.executable
'''
min_endpoint_version = "8.10.0"
optional_actions = []
reputation = true
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 1
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1021"
name = "Remote Services"
reference = "https://attack.mitre.org/techniques/T1021/"
[[threat.technique.subtechnique]]
id = "T1021.002"
name = "SMB/Windows Admin Shares"
reference = "https://attack.mitre.org/techniques/T1021/002/"
[threat.tactic]
id = "TA0008"
name = "Lateral Movement"
reference = "https://attack.mitre.org/tactics/TA0008/"
[internal]
min_endpoint_version = "8.10.0"
Stages and Predicates
Ordered sequence: each step below must occur in order within 5m, correlated by file.path, process.executable.
Stage 1: file
[file where event.action != "deletion" and
process.pid == 4 and user.id : ("S-1-5-21*", "S-1-12-*") and
(file.extension : "exe" or file.Ext.header_bytes : "4d5a*")] by file.path
Stage 2: process
[process where event.action == "start" and
(
process.parent.name : ("wmiprvse.exe", "wsmprovhost.exe", "RemComSvc*.exe", "psexesvc*.exe", "KaseyaEndpoint.exe", "powershell.exe") or
descendant of [process where event.action == "start" and process.name : ("wmiprvse.exe", "wsmprovhost.exe", "RemComSvc*.exe", "psexesvc*.exe")] or
(process.parent.name : "cmd.exe" and process.Ext.session_info.logon_type : "Network")
) and
not (process.code_signature.subject_name :
("RAPIDFIRE TOOLS INC.",
"Arcserve (USA) LLC",
"PDQ.COM CORPORATION",
"Veeam Software Group GmbH",
"Veeam Software AG",
"LANDesk Software, Inc.",
"Cynet Security LTD",
"CyberArk Software Ltd.",
"Barracuda Networks, Inc.",
"AVG Technologies Canada, Inc.",
"ConnectWise, Inc.",
"Ivanti, Inc.",
"FUJITSU LIMITED",
"Shavlik Technologies",
"Kaspersky Lab JSC",
"Netalytics Security Inc",
"Elasticsearch, Inc.",
"Netwrix Corporation",
"Power Admin LLC",
"Notepad++",
"The Apache Software Foundation",
"HashInclude Computech Pvt. Ltd.",
"DIGITAL DEFENSE, INC",
"Snow Software AB",
"GOVERLAN, LLC",
"Veritas Technologies LLC",
"Bitdefender SRL",
"Kaseya Corporation",
"Insecure.Com LLC",
"ZOHO Corporation Private Limited",
"VMware, Inc.",
"Medical Information Technology, Inc.",
"baramundi software AG",
"ServiceNow, Inc.",
"Panda Security, S.L.",
"CoSoSys SRL",
"N-ABLE TECHNOLOGIES LTD",
"CISCO SYSTEMS, INC.",
"TeamViewer Germany GmbH",
"SysAid Technologies LTD",
"Sophos Ltd",
"Ericsson",
"Quest Software Inc.",
"Commvault Systems, Inc.",
"Red Gate Software Ltd",
"itelio GmbH",
"Cocobolo Software, LLC",
"Tenable Network Security Inc.",
"CS.NIWC-ATLANTIC.001",
"Lansweeper",
"Lenovo",
"Acronis International GmbH",
"Cisco WebEx LLC",
"Helge Klein GmbH",
"FireEye, Inc.",
"Oracle America, Inc.",
"Chocolatey Software, Inc.",
"Micro Focus Group Limited",
"Solarwinds Worldwide, LLC",
"Cyberark Software Ltd.",
"AO Kaspersky Lab",
"Symantec Corporation",
"Hornetsecurity GmbH",
"KASEYA US LLC",
"ForeScout Technologies, Inc",
"KASEYA HOLDINGS INC.",
"Kaseya Holdings Inc",
"ConnectSecure LLC",
"Red Gate Software Limited",
"Dell Inc.",
"WatchGuard Technologies, Inc.",
"EFOLDER, INC.",
"Laserfiche") and process.code_signature.trusted == true) and
not (process.code_signature.subject_name in ("Medical Information Technology, Inc.", "CyberArk Software Ltd.", "VMware, Inc.", "Veritas Technologies LLC") and
process.code_signature.status in ("errorTimeStamp", "errorChaining")) and
not (process.code_signature.subject_name : "Microsoft *" and
process.code_signature.trusted == true and
process.pe.original_file_name : ("MOMAgentInstaller.exe", "dotnet-hosting-*-win.exe", "dpmac.exe", "PushClient.exe",
"migrate.exe", "Ms.Dsp.Do.Inc.Installer.exe", "OpenHandleCollector.exe", "VC_redist*.exe")) and
not process.hash.sha256 in
("c9ef35bed70ffa0981bafd0071185b56fdad8f9c97f3582a4dae9b420959fb97",
"18dc098895ccc8246d417445a36d933c5f8487419b848ebe651fd0e11cb22afa",
"ea98309a35f92443b9c50736ce208656ec72af114ec8aceeb02dfa041ec2d6bc",
"bcf07679ea026f1dfba6f9ab63251e4834dc007bd2c5b9039deb9d900fe1c5e6",
"1c6af94b26f369e2c10819eefb869f873e5540e2c1b7bf4c7c632fc03d67368a",
"6dfc3a0733f427779b250913811baa429002042cb8e7732ea7d334bf725b8bd0",
"ae0fb4bf4a6faa4b808794b6e6ccbdf9f10c1ce01a86ccece002ac63cf09ff29",
"cd5ff596b7bacb117f90893f94fd8c542b659cc58f90ed1fbd0471fe85148bff",
"5e7785fede192d69e408c8c41ba14aead2f4b297c9faecc991e061b093b91f70",
"08d019e46a8755c33ad9ff9b96b5409a9005d87ba4e3cc58bdd8cf10eb0cd987",
"81e6e6feaac8b3267608af98667d3ccf78a15e540e6a5d18858d9147aacd1e16",
"a07b0b72bb00d9e9debd38c2b4bd770beb7d6cf6148d2f7fba50d7a7078deb04",
"bc10fdc46d17765c619db70ef19cd3755a3270692481d8417bfff3fceb4eba10",
"bb53243baeb4e4cc204e5b9981cc0c671e0855f56293df5106b9b3beac30cc15",
"c5593f5d965994a50985b529e77b97c348c7af084dbbaba270d83b1b06302d2c",
"7f8e465edd27cdcd1d28292c35440d745b8bd528e21d6f56eb683b65d922eaed",
"ef7dbfe3a3910ddb93989f0d5d8f1fb4d39e0df7e53f55d042f4ccd80699c81f",
"bb53243baeb4e4cc204e5b9981cc0c671e0855f56293df5106b9b3beac30cc15",
"bc10fdc46d17765c619db70ef19cd3755a3270692481d8417bfff3fceb4eba10",
"ef7dbfe3a3910ddb93989f0d5d8f1fb4d39e0df7e53f55d042f4ccd80699c81f",
"39b3ae96186b7e62b9176e6d2ae27db3e164a7c8c52c094c811dd19d651577f2",
"5e7785fede192d69e408c8c41ba14aead2f4b297c9faecc991e061b093b91f70",
"b9fc7dea50ce1e0637a3628abc89f96d8cfaad1b7c6ad33dd8bb17028ed3eaee",
"5e81eaedc6bba9c9b475f990cdc31ee3c48962fffb63d65afc1447ea6b95f910",
"ec7d2582c06d28191b2efaf6780cdfa5c1319f3081bd001d4572cbeea0068b48",
"68591e82d0091f12e15f3c21cbf643793bc2b5a14ef46408bb06f794669f7f0b",
"156f567b058b5e067a64f3d5736a78bbf9669c822fc5f95620a759c288e2224b",
"e659b5a7045bd1820a0efd3e324ebd4a72ecebd0981deb6cbe1899c95351dc91",
"84633fd9a39188ca937188decdeb746a0be3476d68f7ccde4d742fa8ca5dc1f6",
"4208e349ff97a2dc6100ee9e5e61e23ab650b316e62dd4a25d1119a08a59f298",
"52b196bbe9016488c735e7b41805b651261ffa5d7aa86eb6a1d0095be83687b2",
"85640066a45c1fd934f3faf2a8db926ed77b622be7cfcce15a25707abf604d55",
"cb7f34839ce80b7aaef9f8d61bc61b1f471fdfc514c13a675350077bbf27b24c",
"c6d195690a617791e7e9f483597cea1f68fbe59e3f9b1989a1d324f00e9d1c80",
"c6d195690a617791e7e9f483597cea1f68fbe59e3f9b1989a1d324f00e9d1c80",
"9e3cd4d957f1130e8308357b921d2475afd1519704f0a176a062d06d96199da2",
"5485ca7e2be4afc76aadd97536192cf2850228fe338083d6bab4c981bd6ddf92",
"0a765aa0610aba8d792b0153779a52a922ae5a5741af52373abb17e9e10c24ed",
"5968e3951cb6bf4368b866597f06317e576e6efc14d360dfffc336f1213e3a08",
"10d422f089daeeff80644ff1e45ecfcf83a7501dd5edc22477f3717f36b321f6") and
not (process.code_signature.subject_name == "CyberArk Software Ltd." and
process.executable : "?:\\Windows\\CAInvokerService.exe" and process.pe.original_file_name == "PSMWinAgentInvoker.exe") and
not (process.pe.original_file_name in ("ccmsetup.exe", "OneDriveSetup.exe") and process.code_signature.subject_name : "Microsoft*" and
process.code_signature.trusted == true) and
not (process.parent.name : "powershell.exe" and process.executable : ("?:\\Program Files (x86)\\*", "?:\\Program Files\\*")) and
not (process.executable : "?:\\Program Files\\BearingPoint\\*\\KRS.CorrespondenceJobService.exe" and process.parent.name : "wsmprovhost.exe")
] by process.executable
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | eq |
| field:"EventType" kind:eq value:"start" |
event.action | ne |
| field:"EventType" kind:ne value:"deletion" |
file.Ext.header_bytes | wildcard |
| field:"file.Ext.header_bytes" kind:wildcard value:"4d5a*" |
file.extension | wildcard |
| field:"file.extension" kind:wildcard value:"exe" |
process.Ext.session_info.logon_type | wildcard |
| field:"process.Ext.session_info.logon_type" kind:wildcard value:"Network" |
process.parent.name | wildcard |
| field:"parent_process_basename" kind:wildcard |
process.pid | eq |
| field:"process_id" kind:eq value:"4" |
user.id | wildcard |
| field:"user.id" kind:wildcard |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.code_signature.status | in | errorChaining, errorTimeStamp | excludes:process.code_signature.status field:"process.code_signature.status" value:"errorChaining" field:"process.code_signature.status" value:"errorTimeStamp" |
process.code_signature.subject_name | in | CyberArk Software Ltd., Medical Information Technology, Inc., VMware, Inc., Veritas Technologies LLC | excludes:process.code_signature.subject_name |
process.code_signature.subject_name | eq | CyberArk Software Ltd. | excludes:process.code_signature.subject_name field:"process.code_signature.subject_name" value:"CyberArk Software Ltd." |
process.executable | eq | ?:\Windows\CAInvokerService.exe | excludes:process.executable field:"process.executable" value:"?:\Windows\CAInvokerService.exe" |
process.pe.original_file_name | eq | PSMWinAgentInvoker.exe | excludes:process.pe.original_file_name field:"process.pe.original_file_name" value:"PSMWinAgentInvoker.exe" |
process.code_signature.subject_name | eq | RAPIDFIRE TOOLS INC., Arcserve (USA) LLC, PDQ.COM CORPORATION, Veeam Software Group GmbH, Veeam Software AG, LANDesk Software, Inc., Cynet Security LTD, CyberArk Software Ltd., Barracuda Networks, Inc., AVG Technologies Canada, Inc., ConnectWise, Inc., Ivanti, Inc., FUJITSU LIMITED, Shavlik Technologies, Kaspersky Lab JSC, Netalytics Security Inc, Elasticsearch, Inc., Netwrix Corporation, Power Admin LLC, Notepad++, The Apache Software Foundation, HashInclude Computech Pvt. Ltd., DIGITAL DEFENSE, INC, Snow Software AB, GOVERLAN, LLC, Veritas Technologies LLC, Bitdefender SRL, Kaseya Corporation, Insecure.Com LLC, ZOHO Corporation Private Limited, VMware, Inc., Medical Information Technology, Inc., baramundi software AG, ServiceNow, Inc., Panda Security, S.L., CoSoSys SRL, N-ABLE TECHNOLOGIES LTD, CISCO SYSTEMS, INC., TeamViewer Germany GmbH, SysAid Technologies LTD, Sophos Ltd, Ericsson, Quest Software Inc., Commvault Systems, Inc., Red Gate Software Ltd, itelio GmbH, Cocobolo Software, LLC, Tenable Network Security Inc., CS.NIWC-ATLANTIC.001, Lansweeper, Lenovo, Acronis International GmbH, Cisco WebEx LLC, Helge Klein GmbH, FireEye, Inc., Oracle America, Inc., Chocolatey Software, Inc., Micro Focus Group Limited, Solarwinds Worldwide, LLC, Cyberark Software Ltd., AO Kaspersky Lab, Symantec Corporation, Hornetsecurity GmbH, KASEYA US LLC, ForeScout Technologies, Inc, KASEYA HOLDINGS INC., Kaseya Holdings Inc, ConnectSecure LLC, Red Gate Software Limited, Dell Inc., WatchGuard Technologies, Inc., EFOLDER, INC., Laserfiche | excludes:process.code_signature.subject_name |
process.code_signature.trusted | eq | true | excludes:process.code_signature.trusted field:"process.code_signature.trusted" value:"true" |
process.code_signature.subject_name | starts_with | Microsoft | excludes:process.code_signature.subject_name field:"process.code_signature.subject_name" value:"Microsoft " |
process.pe.original_file_name | wildcard | MOMAgentInstaller.exe, dotnet-hosting-*-win.exe, dpmac.exe, PushClient.exe, migrate.exe, Ms.Dsp.Do.Inc.Installer.exe, OpenHandleCollector.exe, VC_redist*.exe | excludes:process.pe.original_file_name |
process.code_signature.subject_name | starts_with | Microsoft | excludes:process.code_signature.subject_name field:"process.code_signature.subject_name" value:"Microsoft" |
process.pe.original_file_name | in | OneDriveSetup.exe, ccmsetup.exe | excludes:process.pe.original_file_name field:"process.pe.original_file_name" value:"OneDriveSetup.exe" field:"process.pe.original_file_name" value:"ccmsetup.exe" |
process.executable | starts_with | ?:\Program Files (x86)\, ?:\Program Files\ | excludes:process.executable field:"process.executable" value:"?:\Program Files (x86)\" field:"process.executable" value:"?:\Program Files\" |
process.parent.name | eq | powershell.exe | excludes:process.parent.name field:"process.parent.name" value:"powershell.exe" |
process.executable | wildcard | ?:\Program Files\BearingPoint\*\KRS.CorrespondenceJobService.exe | excludes:process.executable field:"process.executable" value:"?:\Program Files\BearingPoint\*\KRS.CorrespondenceJobService.exe" |
process.parent.name | eq | wsmprovhost.exe | excludes:process.parent.name field:"process.parent.name" value:"wsmprovhost.exe" |
process.hash.sha256 | in | 08d019e46a8755c33ad9ff9b96b5409a9005d87ba4e3cc58bdd8cf10eb0cd987, 0a765aa0610aba8d792b0153779a52a922ae5a5741af52373abb17e9e10c24ed, 10d422f089daeeff80644ff1e45ecfcf83a7501dd5edc22477f3717f36b321f6, 156f567b058b5e067a64f3d5736a78bbf9669c822fc5f95620a759c288e2224b, 18dc098895ccc8246d417445a36d933c5f8487419b848ebe651fd0e11cb22afa, 1c6af94b26f369e2c10819eefb869f873e5540e2c1b7bf4c7c632fc03d67368a, 39b3ae96186b7e62b9176e6d2ae27db3e164a7c8c52c094c811dd19d651577f2, 4208e349ff97a2dc6100ee9e5e61e23ab650b316e62dd4a25d1119a08a59f298, 52b196bbe9016488c735e7b41805b651261ffa5d7aa86eb6a1d0095be83687b2, 5485ca7e2be4afc76aadd97536192cf2850228fe338083d6bab4c981bd6ddf92, 5968e3951cb6bf4368b866597f06317e576e6efc14d360dfffc336f1213e3a08, 5e7785fede192d69e408c8c41ba14aead2f4b297c9faecc991e061b093b91f70, 5e81eaedc6bba9c9b475f990cdc31ee3c48962fffb63d65afc1447ea6b95f910, 68591e82d0091f12e15f3c21cbf643793bc2b5a14ef46408bb06f794669f7f0b, 6dfc3a0733f427779b250913811baa429002042cb8e7732ea7d334bf725b8bd0, 7f8e465edd27cdcd1d28292c35440d745b8bd528e21d6f56eb683b65d922eaed, 81e6e6feaac8b3267608af98667d3ccf78a15e540e6a5d18858d9147aacd1e16, 84633fd9a39188ca937188decdeb746a0be3476d68f7ccde4d742fa8ca5dc1f6, 85640066a45c1fd934f3faf2a8db926ed77b622be7cfcce15a25707abf604d55, 9e3cd4d957f1130e8308357b921d2475afd1519704f0a176a062d06d96199da2, a07b0b72bb00d9e9debd38c2b4bd770beb7d6cf6148d2f7fba50d7a7078deb04, ae0fb4bf4a6faa4b808794b6e6ccbdf9f10c1ce01a86ccece002ac63cf09ff29, b9fc7dea50ce1e0637a3628abc89f96d8cfaad1b7c6ad33dd8bb17028ed3eaee, bb53243baeb4e4cc204e5b9981cc0c671e0855f56293df5106b9b3beac30cc15, bc10fdc46d17765c619db70ef19cd3755a3270692481d8417bfff3fceb4eba10, bcf07679ea026f1dfba6f9ab63251e4834dc007bd2c5b9039deb9d900fe1c5e6, c5593f5d965994a50985b529e77b97c348c7af084dbbaba270d83b1b06302d2c, c6d195690a617791e7e9f483597cea1f68fbe59e3f9b1989a1d324f00e9d1c80, c9ef35bed70ffa0981bafd0071185b56fdad8f9c97f3582a4dae9b420959fb97, cb7f34839ce80b7aaef9f8d61bc61b1f471fdfc514c13a675350077bbf27b24c, cd5ff596b7bacb117f90893f94fd8c542b659cc58f90ed1fbd0471fe85148bff, e659b5a7045bd1820a0efd3e324ebd4a72ecebd0981deb6cbe1899c95351dc91, ea98309a35f92443b9c50736ce208656ec72af114ec8aceeb02dfa041ec2d6bc, ec7d2582c06d28191b2efaf6780cdfa5c1319f3081bd001d4572cbeea0068b48, ef7dbfe3a3910ddb93989f0d5d8f1fb4d39e0df7e53f55d042f4ccd80699c81f | excludes:process.hash.sha256 |
GKE Exposed Service Created With Type NodePort
#Detects creation or modification of a GKE Service with type NodePort. NodePort exposes a static port on every worker node that hosts matching pods, which widens the cluster's external attack surface and can bypass load-balancer and firewall controls. Attackers may create NodePort Services to intercept traffic or establish a direct path into the cluster.
Known False Positives
- Developers may legitimately use NodePort for frontends without cloud load balancers, or for nonstandard networking. system:addon-manager patch reconciliation of existing NodePort Services is excluded; create and update from addon-manager still alert.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Initial Access | |
| Persistence |
Telemetry Coverage
Rules Detecting the Same Action
These rules filter on the same operation.
- GCP K8S Service Type NodePort Deployed (Panther)
- Kubernetes Exposed Service Created With Type NodePort (Elastic)
- Kubernetes Node Port Creation (Splunk)
- Kubernetes NodePort Service Deployed (Panther)
- Kubernetes Service with Type Node Port Deployed (Panther)
- Kubernetes Service with Type Node Port Deployed (Panther)
Rule Body
[metadata]
creation_date = "2026/07/13"
integration = ["gcp"]
maturity = "production"
updated_date = "2026/07/13"
[rule]
author = ["Elastic"]
description = """
Detects creation or modification of a GKE Service with type NodePort. NodePort exposes a static port on every worker
node that hosts matching pods, which widens the cluster's external attack surface and can bypass load-balancer and
firewall controls. Attackers may create NodePort Services to intercept traffic or establish a direct path into the
cluster.
"""
false_positives = [
"""
Developers may legitimately use NodePort for frontends without cloud load balancers, or for nonstandard networking.
system:addon-manager patch reconciliation of existing NodePort Services is excluded; create and update from
addon-manager still alert.
""",
]
from = "now-6m"
index = ["logs-gcp.audit-*"]
language = "kuery"
license = "Elastic License v2"
name = "GKE Exposed Service Created With Type NodePort"
note = """## Triage and analysis
### Investigating GKE Exposed Service Created With Type NodePort
NodePort opens a port on each worker node hosting the service and forwards external traffic to labeled pods. Confirm
whether the exposure was approved and which workloads are reachable.
### Possible investigation steps
- Review `client.user.email`, `source.ip`, and `user_agent.original`.
- Inspect `gcp.audit.resource_name` and `gcp.audit.request` for the service name, namespace, selector, and port.
- Identify the backing pods and whether the NodePort is required for a legitimate external entrypoint.
- Correlate with recent Service or networking changes from the same actor.
### False positive analysis
- Approved NodePort Services for lab frontends or custom load balancing may match. Allowlist known automation or
namespaces after review.
- GKE addon reconciliation via `system:addon-manager` patch is excluded; unexpected create or update from that actor
should still be investigated.
### Response and remediation
- Remove or change unauthorized NodePort Services, revoke excess RBAC for Services writes, and review firewall exposure
for the opened node ports.
"""
setup = """
The GCP Fleet integration with GKE audit logs enabled is required. Request body capture for Service resources is
required so `gcp.audit.request.spec.type` is populated.
"""
references = [
"https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types",
"https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport",
"https://www.tigera.io/blog/new-vulnerability-exposes-kubernetes-to-man-in-the-middle-attacks-heres-how-to-mitigate/",
]
risk_score = 47
rule_id = "05ac190c-5d02-4b81-bb57-221d33479570"
severity = "medium"
tags = [
"Domain: Cloud",
"Domain: Kubernetes",
"Data Source: GCP",
"Data Source: Google Cloud Platform",
"Use Case: Threat Detection",
"Tactic: Persistence",
"Tactic: Initial Access",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "query"
query = '''
data_stream.dataset:gcp.audit and service.name:"k8s.io" and event.outcome:success and
event.action:(
"io.k8s.core.v1.services.create" or
"io.k8s.core.v1.services.update" or
"io.k8s.core.v1.services.patch"
) and gcp.audit.request.spec.type:"NodePort" and not (
client.user.email:"system:addon-manager" and
event.action:"io.k8s.core.v1.services.patch"
)
'''
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1133"
name = "External Remote Services"
reference = "https://attack.mitre.org/techniques/T1133/"
[rule.threat.tactic]
id = "TA0003"
name = "Persistence"
reference = "https://attack.mitre.org/tactics/TA0003/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1133"
name = "External Remote Services"
reference = "https://attack.mitre.org/techniques/T1133/"
[rule.threat.tactic]
id = "TA0001"
name = "Initial Access"
reference = "https://attack.mitre.org/tactics/TA0001/"
[rule.investigation_fields]
field_names = [
"@timestamp",
"client.user.email",
"source.ip",
"user_agent.original",
"event.action",
"event.outcome",
"gcp.audit.resource_name",
"gcp.audit.request.spec.type",
"gcp.audit.request",
"data_stream.namespace",
]
Stages and Predicates
Stage 1: query
data_stream.dataset:gcp.audit and service.name:"k8s.io" and event.outcome:success and
event.action:(
"io.k8s.core.v1.services.create" or
"io.k8s.core.v1.services.update" or
"io.k8s.core.v1.services.patch"
) and gcp.audit.request.spec.type:"NodePort" and not (
client.user.email:"system:addon-manager" and
event.action:"io.k8s.core.v1.services.patch"
)
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
data_stream.dataset | eq |
| field:"data_stream.dataset" kind:eq value:"gcp.audit" |
event.action | in |
| field:"EventType" kind:in |
event.outcome | eq |
| field:"event.outcome" kind:eq value:"success" |
gcp.audit.request.spec.type | eq |
| field:"gcp.audit.request.spec.type" kind:eq value:"NodePort" |
service.name | eq |
| field:"ServiceName" kind:eq value:"k8s.io" |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
client.user.email | eq | system:addon-manager | excludes:client.user.email field:"client.user.email" value:"system:addon-manager" |
event.action | eq | io.k8s.core.v1.services.patch | excludes:event.action field:"event.action" value:"io.k8s.core.v1.services.patch" |
Image Hollow from Unusual Stack
#Identifies attempt to modify the content of a loaded module and from a suspicious call stack. This may indicate an attempt to inject code using module stomping or DLL hollowing via overwriting the content of a legit DLL with malicious code.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Stealth |
Rule Body
[rule]
description = """
Identifies attempt to modify the content of a loaded module and from a suspicious call stack. This may indicate an
attempt to inject code using module stomping or DLL hollowing via overwriting the content of a legit DLL with malicious
code.
"""
id = "446e61bf-8370-45df-88ab-7b213ee653db"
license = "Elastic License v2"
name = "Image Hollow from Unusual Stack"
os_list = ["windows"]
version = "1.0.22"
query = '''
api where process.Ext.api.behaviors == "hollow_image" and
process.Ext.api.name == "VirtualProtect" and
process.Ext.api.parameters.size >= 10000 and process.executable != null and
process.thread.Ext.call_stack_summary in
("ntdll.dll|kernelbase.dll|Unbacked",
"ntdll.dll|kernelbase.dll|kernel32.dll|Unbacked",
"ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|kernelbase.dll|Unbacked",
"ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|kernelbase.dll|Unbacked|kernel32.dll|ntdll.dll") and
process.Ext.api.metadata.target_address_path like "c:\\windows\\sys?????\\*.dll" and
process.thread.Ext.call_stack_final_user_module.hash.sha256 != null and
not _arraysearch(process.thread.Ext.call_stack, $entry,
$entry.protection_provenance like ("Kernel*", "tcaddin.dll", "clr.dll", "appvisvsubsystems64.dll",
"appvisvsubsystems.dll", "softmon.exe|*", "appventsubsystems32.dll",
"appventsubsystems64.dll", "appventsubsystems.dll")) and
not (process.Ext.api.summary : ("*qipcap64.dll*", "*redemption64*", "*eowp.22.1.94.0.exe*", "*conemuhk64.dll*", "*xalan-c_1_10.dll*", "* av.dll*",
"*crpe32.dll*", "*_*.dll*", "*-*.dll*", "*sqlite?.dll*", "*appprofiler.x64.dll*", "*appprofiler.x86.dll*", "*qmgr.dll*", "*cxll*.llx*", "*.exe*") and
not process.Ext.api.summary : "*ws2_32*") and
not (process.parent.executable : "?:\\Program Files (x86)\\think-cell\\tcasr.exe" and
process.executable : "?:\\Program Files\\Microsoft Office\\root\\Office*\\EXCEL.EXE") and
not (process.code_signature.subject_name : ("Code Systems Corporation", "Essential Objects, Inc.", "JAM Software GmbH",
"IMSI Design, LLC", "Nuance Communications, Inc.", "Rocket Software, Inc.",
"Tracker Software Products (Canada) Ltd", "Sage Software, Inc.", "Azul Systems, Inc.",
"Essential Objects, Inc.") and
process.code_signature.trusted == true) and
not (process.parent.executable : ("?:\\Program Files (x86)\\Google\\Update\\GoogleUpdate.exe", "?:\\Program Files\\Google\\Update\\GoogleUpdate.exe") and
process.executable : ("?:\\Program Files (x86)\\Google\\Update\\*\\GoogleCrashHandler*.exe", "?:\\Program Files\\Google\\Update\\*\\GoogleCrashHandler*.exe")) and
not process.executable :
("?:\\Program Files\\*.exe",
"?:\\Program Files (x86)\\*.exe",
"?:\\Windows\\System32\\inetsrv\\w3wp.exe",
"?:\\Windows\\SysWOW64\\inetsrv\\w3wp.exe",
"?:\\Windows\\SystemApps\\*.exe",
"?:\\Windows\\System32\\taskhostw.exe") and
not (process.executable : "?:\\Windows\\Sys*\\msiexec.exe" and process.Ext.api.summary : "*msi*.tmp*") and
not (process.executable : "?:\\Windows\\Sys*\\rundll32.exe" and process.command_line : ("*--no-sandbox*", "*--eoim*")) and
not (process.executable : "?:\\Windows\\System32\\backgroundTaskHost.exe" and
process.parent.executable : "?:\\Windows\\System32\\svchost.exe") and
not process.parent.executable : ("?:\\Program Files (x86)\\Steam\\steam.exe", "?:\\Program Files\\Steam\\steam.exe") and
not (process.Ext.api.metadata.target_address_name : "cxll27*.llx" and process.parent.executable : "C:\\Program Files (x86)\\Citrix\\HDX\\bin\\WfShell.exe") and
not (process.Ext.api.metadata.target_address_name == "libcapki.dll" and process.parent.executable : "C:\\Program Files (x86)\\CA\\DSM\\Bin\\*.exe") and
not process.thread.Ext.call_stack_final_user_module.hash.sha256 in ("2ef1f7e839e332d97e32ee0213c92d0e74536fb3af04b6df1d335e2f101f968e",
"a20a14118c2f06a1cc502095a1f18b3cb34ad75f1684f7ec26e24a68d4e3114c", "da502d1a77883ab56d110889237ce7f18527a1d78e85078f40d269966059e267",
"2a2f9dc5f88e4596ade6a57ec2baa8586dbade44e6df9ecb32035cfd1d8bd85d", "c7d833a8fdfac8a79f9f861af7f6f476bb7b36c71c5fa60e668728008b16a43e") and
not _arraysearch(process.thread.Ext.call_stack_final_user_module.code_signature, $entry, $entry.trusted == true)
'''
min_endpoint_version = "8.10.0"
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
[[optional_actions]]
action = "rollback"
field = "process.entity_id"
state = 0
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1055"
name = "Process Injection"
reference = "https://attack.mitre.org/techniques/T1055/"
[threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
[internal]
min_endpoint_version = "8.10.0"
Stages and Predicates
Stage 1: api
api where process.Ext.api.behaviors == "hollow_image" and
process.Ext.api.name == "VirtualProtect" and
process.Ext.api.parameters.size >= 10000 and process.executable != null and
process.thread.Ext.call_stack_summary in
("ntdll.dll|kernelbase.dll|Unbacked",
"ntdll.dll|kernelbase.dll|kernel32.dll|Unbacked",
"ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|kernelbase.dll|Unbacked",
"ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|kernelbase.dll|Unbacked|kernel32.dll|ntdll.dll") and
process.Ext.api.metadata.target_address_path like "c:\\windows\\sys?????\\*.dll" and
process.thread.Ext.call_stack_final_user_module.hash.sha256 != null and
not _arraysearch(process.thread.Ext.call_stack, $entry,
$entry.protection_provenance like ("Kernel*", "tcaddin.dll", "clr.dll", "appvisvsubsystems64.dll",
"appvisvsubsystems.dll", "softmon.exe|*", "appventsubsystems32.dll",
"appventsubsystems64.dll", "appventsubsystems.dll")) and
not (process.Ext.api.summary : ("*qipcap64.dll*", "*redemption64*", "*eowp.22.1.94.0.exe*", "*conemuhk64.dll*", "*xalan-c_1_10.dll*", "* av.dll*",
"*crpe32.dll*", "*_*.dll*", "*-*.dll*", "*sqlite?.dll*", "*appprofiler.x64.dll*", "*appprofiler.x86.dll*", "*qmgr.dll*", "*cxll*.llx*", "*.exe*") and
not process.Ext.api.summary : "*ws2_32*") and
not (process.parent.executable : "?:\\Program Files (x86)\\think-cell\\tcasr.exe" and
process.executable : "?:\\Program Files\\Microsoft Office\\root\\Office*\\EXCEL.EXE") and
not (process.code_signature.subject_name : ("Code Systems Corporation", "Essential Objects, Inc.", "JAM Software GmbH",
"IMSI Design, LLC", "Nuance Communications, Inc.", "Rocket Software, Inc.",
"Tracker Software Products (Canada) Ltd", "Sage Software, Inc.", "Azul Systems, Inc.",
"Essential Objects, Inc.") and
process.code_signature.trusted == true) and
not (process.parent.executable : ("?:\\Program Files (x86)\\Google\\Update\\GoogleUpdate.exe", "?:\\Program Files\\Google\\Update\\GoogleUpdate.exe") and
process.executable : ("?:\\Program Files (x86)\\Google\\Update\\*\\GoogleCrashHandler*.exe", "?:\\Program Files\\Google\\Update\\*\\GoogleCrashHandler*.exe")) and
not process.executable :
("?:\\Program Files\\*.exe",
"?:\\Program Files (x86)\\*.exe",
"?:\\Windows\\System32\\inetsrv\\w3wp.exe",
"?:\\Windows\\SysWOW64\\inetsrv\\w3wp.exe",
"?:\\Windows\\SystemApps\\*.exe",
"?:\\Windows\\System32\\taskhostw.exe") and
not (process.executable : "?:\\Windows\\Sys*\\msiexec.exe" and process.Ext.api.summary : "*msi*.tmp*") and
not (process.executable : "?:\\Windows\\Sys*\\rundll32.exe" and process.command_line : ("*--no-sandbox*", "*--eoim*")) and
not (process.executable : "?:\\Windows\\System32\\backgroundTaskHost.exe" and
process.parent.executable : "?:\\Windows\\System32\\svchost.exe") and
not process.parent.executable : ("?:\\Program Files (x86)\\Steam\\steam.exe", "?:\\Program Files\\Steam\\steam.exe") and
not (process.Ext.api.metadata.target_address_name : "cxll27*.llx" and process.parent.executable : "C:\\Program Files (x86)\\Citrix\\HDX\\bin\\WfShell.exe") and
not (process.Ext.api.metadata.target_address_name == "libcapki.dll" and process.parent.executable : "C:\\Program Files (x86)\\CA\\DSM\\Bin\\*.exe") and
not process.thread.Ext.call_stack_final_user_module.hash.sha256 in ("2ef1f7e839e332d97e32ee0213c92d0e74536fb3af04b6df1d335e2f101f968e",
"a20a14118c2f06a1cc502095a1f18b3cb34ad75f1684f7ec26e24a68d4e3114c", "da502d1a77883ab56d110889237ce7f18527a1d78e85078f40d269966059e267",
"2a2f9dc5f88e4596ade6a57ec2baa8586dbade44e6df9ecb32035cfd1d8bd85d", "c7d833a8fdfac8a79f9f861af7f6f476bb7b36c71c5fa60e668728008b16a43e") and
not _arraysearch(process.thread.Ext.call_stack_final_user_module.code_signature, $entry, $entry.trusted == true)
Indicators
These rows show field, operator, and value matches.
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.Ext.api.summary | match | ws2_32 | excludes:process.Ext.api.summary field:"process.Ext.api.summary" value:"ws2_32" |
process.Ext.api.summary | wildcard | *qipcap64.dll*, *redemption64*, *eowp.22.1.94.0.exe*, *conemuhk64.dll*, *xalan-c_1_10.dll*, * av.dll*, *crpe32.dll*, *_*.dll*, *-*.dll*, *sqlite?.dll*, *appprofiler.x64.dll*, *appprofiler.x86.dll*, *qmgr.dll*, *cxll*.llx*, *.exe* | excludes:process.Ext.api.summary |
process.Ext.api.metadata.target_address_name | eq | libcapki.dll | excludes:process.Ext.api.metadata.target_address_name field:"process.Ext.api.metadata.target_address_name" value:"libcapki.dll" |
process.parent.executable | wildcard | C:\Program Files (x86)\CA\DSM\Bin\*.exe | excludes:process.parent.executable field:"process.parent.executable" value:"C:\Program Files (x86)\CA\DSM\Bin\*.exe" |
process.Ext.api.metadata.target_address_name | wildcard | cxll27*.llx | excludes:process.Ext.api.metadata.target_address_name field:"process.Ext.api.metadata.target_address_name" value:"cxll27*.llx" |
process.parent.executable | eq | C:\Program Files (x86)\Citrix\HDX\bin\WfShell.exe | excludes:process.parent.executable field:"process.parent.executable" value:"C:\Program Files (x86)\Citrix\HDX\bin\WfShell.exe" |
process.Ext.api.summary | wildcard | *msi*.tmp* | excludes:process.Ext.api.summary field:"process.Ext.api.summary" value:"*msi*.tmp*" |
process.executable | wildcard | ?:\Windows\Sys*\msiexec.exe | excludes:process.executable field:"process.executable" value:"?:\Windows\Sys*\msiexec.exe" |
process.code_signature.subject_name | eq | Code Systems Corporation, Essential Objects, Inc., JAM Software GmbH, IMSI Design, LLC, Nuance Communications, Inc., Rocket Software, Inc., Tracker Software Products (Canada) Ltd, Sage Software, Inc., Azul Systems, Inc., Essential Objects, Inc. | excludes:process.code_signature.subject_name |
process.code_signature.trusted | eq | true | excludes:process.code_signature.trusted field:"process.code_signature.trusted" value:"true" |
process.command_line | match | --no-sandbox, --eoim | excludes:process.command_line field:"process.command_line" value:"--no-sandbox" field:"process.command_line" value:"--eoim" |
process.executable | wildcard | ?:\Windows\Sys*\rundll32.exe | excludes:process.executable field:"process.executable" value:"?:\Windows\Sys*\rundll32.exe" |
process.executable | eq | ?:\Windows\System32\backgroundTaskHost.exe | excludes:process.executable field:"process.executable" value:"?:\Windows\System32\backgroundTaskHost.exe" |
process.parent.executable | eq | ?:\Windows\System32\svchost.exe | excludes:process.parent.executable field:"process.parent.executable" value:"?:\Windows\System32\svchost.exe" |
process.executable | wildcard | ?:\Program Files (x86)\Google\Update\*\GoogleCrashHandler*.exe, ?:\Program Files\Google\Update\*\GoogleCrashHandler*.exe | excludes:process.executable field:"process.executable" value:"?:\Program Files (x86)\Google\Update\*\GoogleCrashHandler*.exe" field:"process.executable" value:"?:\Program Files\Google\Update\*\GoogleCrashHandler*.exe" |
process.parent.executable | eq | ?:\Program Files (x86)\Google\Update\GoogleUpdate.exe, ?:\Program Files\Google\Update\GoogleUpdate.exe | excludes:process.parent.executable field:"process.parent.executable" value:"?:\Program Files (x86)\Google\Update\GoogleUpdate.exe" field:"process.parent.executable" value:"?:\Program Files\Google\Update\GoogleUpdate.exe" |
process.executable | wildcard | ?:\Program Files\Microsoft Office\root\Office*\EXCEL.EXE | excludes:process.executable field:"process.executable" value:"?:\Program Files\Microsoft Office\root\Office*\EXCEL.EXE" |
process.parent.executable | eq | ?:\Program Files (x86)\think-cell\tcasr.exe | excludes:process.parent.executable field:"process.parent.executable" value:"?:\Program Files (x86)\think-cell\tcasr.exe" |
process.thread.Ext.call_stack | array_any | excludes:process.thread.Ext.call_stack | |
process.thread.Ext.call_stack_final_user_module.code_signature | array_any | excludes:process.thread.Ext.call_stack_final_user_module.code_signature | |
process.executable | wildcard | ?:\Program Files\*.exe, ?:\Program Files (x86)\*.exe, ?:\Windows\System32\inetsrv\w3wp.exe, ?:\Windows\SysWOW64\inetsrv\w3wp.exe, ?:\Windows\SystemApps\*.exe, ?:\Windows\System32\taskhostw.exe | excludes:process.executable |
process.parent.executable | eq | ?:\Program Files (x86)\Steam\steam.exe, ?:\Program Files\Steam\steam.exe | excludes:process.parent.executable field:"process.parent.executable" value:"?:\Program Files (x86)\Steam\steam.exe" field:"process.parent.executable" value:"?:\Program Files\Steam\steam.exe" |
process.thread.Ext.call_stack_final_user_module.hash.sha256 | in | 2a2f9dc5f88e4596ade6a57ec2baa8586dbade44e6df9ecb32035cfd1d8bd85d, 2ef1f7e839e332d97e32ee0213c92d0e74536fb3af04b6df1d335e2f101f968e, a20a14118c2f06a1cc502095a1f18b3cb34ad75f1684f7ec26e24a68d4e3114c, c7d833a8fdfac8a79f9f861af7f6f476bb7b36c71c5fa60e668728008b16a43e, da502d1a77883ab56d110889237ce7f18527a1d78e85078f40d269966059e267 | excludes:process.thread.Ext.call_stack_final_user_module.hash.sha256 |
Potential Code Execution via Postgresql
#This rule monitors for suspicious activities that may indicate an attacker attempting to execute arbitrary code within a PostgreSQL environment. Attackers can execute code via PostgreSQL as a result of gaining unauthorized access to a public facing PostgreSQL database or exploiting vulnerabilities, such as remote command execution and SQL injection attacks, which can result in unauthorized access and malicious actions, and facilitate post-exploitation activities for unauthorized access and malicious actions.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Initial Access | |
| Execution |
Rule Body
[metadata]
creation_date = "2022/06/20"
integration = ["endpoint"]
maturity = "production"
updated_date = "2026/03/24"
[rule]
author = ["Elastic"]
description = """
This rule monitors for suspicious activities that may indicate an attacker attempting to execute arbitrary code within a
PostgreSQL environment. Attackers can execute code via PostgreSQL as a result of gaining unauthorized access to a public
facing PostgreSQL database or exploiting vulnerabilities, such as remote command execution and SQL injection attacks,
which can result in unauthorized access and malicious actions, and facilitate post-exploitation activities for
unauthorized access and malicious actions.
"""
from = "now-9m"
index = ["endgame-*", "logs-endpoint.events.process*"]
language = "eql"
license = "Elastic License v2"
name = "Potential Code Execution via Postgresql"
note = """## Triage and analysis
> **Disclaimer**:
> This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.
### Investigating Potential Code Execution via Postgresql
PostgreSQL, a robust open-source database system, can be exploited by attackers to execute arbitrary code if they gain unauthorized access or exploit vulnerabilities like SQL injection. Adversaries may leverage command execution capabilities to perform malicious actions. The detection rule identifies suspicious processes initiated by the PostgreSQL user, focusing on shell executions that resemble command injection patterns, while excluding legitimate operations, to flag potential threats.
### Possible investigation steps
- Review the process details to confirm the presence of suspicious shell executions by the PostgreSQL user, focusing on processes with arguments containing "*sh" and "echo*".
- Check the parent process information to determine if the process was initiated by a known legitimate service, such as "puppet", or if it includes "BECOME-SUCCESS-" in the command line, which are excluded from the rule.
- Investigate the source of the PostgreSQL access to identify if it originated from an unauthorized or unusual IP address or user account.
- Analyze the timeline of events leading up to and following the alert to identify any patterns or additional suspicious activities that may indicate a broader attack.
- Correlate the alert with other security events or logs from the same host or network segment to assess if there are related indicators of compromise or ongoing threats.
### False positive analysis
- Puppet processes may trigger false positives due to their legitimate use of shell commands. To mitigate this, ensure that puppet-related processes are excluded by verifying that process.parent.name is set to "puppet".
- Automation tools that use shell scripts for configuration management might be flagged. Review and exclude these by checking for specific command patterns that are known to be safe, such as those containing "BECOME-SUCCESS".
- Scheduled maintenance scripts executed by the postgres user could be misidentified as threats. Identify these scripts and add them to an exclusion list based on their command line patterns.
- Regular database backup operations that involve shell commands might be mistakenly flagged. Document these operations and exclude them by matching their specific command line arguments.
- Custom monitoring scripts that execute shell commands under the postgres user should be reviewed and excluded if they are verified as non-malicious.
### Response and remediation
- Immediately isolate the affected PostgreSQL server from the network to prevent further unauthorized access or malicious actions.
- Terminate any suspicious processes identified by the detection rule to halt potential malicious activities.
- Conduct a thorough review of the PostgreSQL server logs to identify any unauthorized access attempts or successful exploitations, focusing on the timeframes around the detected events.
- Reset credentials for the PostgreSQL user and any other potentially compromised accounts to prevent further unauthorized access.
- Apply the latest security patches and updates to the PostgreSQL server to mitigate known vulnerabilities that could be exploited.
- Implement network segmentation to limit access to the PostgreSQL server, ensuring only authorized systems and users can connect.
- Escalate the incident to the security operations team for further investigation and to assess the potential impact on other systems within the network."""
risk_score = 47
rule_id = "2a692072-d78d-42f3-a48a-775677d79c4e"
setup = """## Setup
This rule requires data coming in from Elastic Defend.
### Elastic Defend Integration Setup
Elastic Defend is integrated into the Elastic Agent using Fleet. Upon configuration, the integration allows the Elastic Agent to monitor events on your host and send data to the Elastic Security app.
#### Prerequisite Requirements:
- Fleet is required for Elastic Defend.
- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).
#### The following steps should be executed in order to add the Elastic Defend integration on a Linux System:
- Go to the Kibana home page and click "Add integrations".
- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.
- Click "Add Elastic Defend".
- Configure the integration name and optionally add a description.
- Select the type of environment you want to protect, either "Traditional Endpoints" or "Cloud Workloads".
- Select a configuration preset. Each preset comes with different default settings for Elastic Agent, you can further customize these later by configuring the Elastic Defend integration policy. [Helper guide](https://www.elastic.co/guide/en/security/current/configure-endpoint-integration-policy.html).
- We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"
- Enter a name for the agent policy in "New agent policy name". If other agent policies already exist, you can click the "Existing hosts" tab and select an existing policy instead.
For more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/8.10/agent-policy.html).
- Click "Save and Continue".
- To complete the integration, select "Add Elastic Agent to your hosts" and continue to the next section to install the Elastic Agent on your hosts.
For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
"""
severity = "medium"
tags = [
"Domain: Endpoint",
"OS: Linux",
"Use Case: Threat Detection",
"Tactic: Execution",
"Data Source: Elastic Endgame",
"Data Source: Elastic Defend",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
process where host.os.type == "linux" and event.type == "start" and
event.action in ("exec", "exec_event", "fork", "fork_event") and user.name == "postgres" and (
(process.parent.args : "*sh" and process.parent.args : "echo*") or
(process.args : "*sh" and process.args : "echo*")
) and not (
process.parent.name == "puppet" or
process.command_line like (
"*BECOME-SUCCESS-*", "bash -c while true; do sleep 1;*", "df -l", "sleep 1", "who", "head -v -n *", "tail -v -n *",
"/bin/sh -c echo BECOME-SUCCESS*", "/usr/bin/python3 /var/tmp/ansible-tmp*", "*chpasswd*"
) or
process.parent.command_line like ("*BECOME-SUCCESS-*", "-bash -c echo $HOME", "su - postgres -c echo $HOME") or
process.parent.executable in ("/usr/bin/watch", "/bin/diskmgr", "/usr/bin/diskmgr")
)
'''
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1059"
name = "Command and Scripting Interpreter"
reference = "https://attack.mitre.org/techniques/T1059/"
[[rule.threat.technique.subtechnique]]
id = "T1059.004"
name = "Unix Shell"
reference = "https://attack.mitre.org/techniques/T1059/004/"
[rule.threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1190"
name = "Exploit Public-Facing Application"
reference = "https://attack.mitre.org/techniques/T1190/"
[rule.threat.tactic]
id = "TA0001"
name = "Initial Access"
reference = "https://attack.mitre.org/tactics/TA0001/"
Stages and Predicates
Stage 1: process
process where host.os.type == "linux" and event.type == "start" and
event.action in ("exec", "exec_event", "fork", "fork_event") and user.name == "postgres" and (
(process.parent.args : "*sh" and process.parent.args : "echo*") or
(process.args : "*sh" and process.args : "echo*")
) and not (
process.parent.name == "puppet" or
process.command_line like (
"*BECOME-SUCCESS-*", "bash -c while true; do sleep 1;*", "df -l", "sleep 1", "who", "head -v -n *", "tail -v -n *",
"/bin/sh -c echo BECOME-SUCCESS*", "/usr/bin/python3 /var/tmp/ansible-tmp*", "*chpasswd*"
) or
process.parent.command_line like ("*BECOME-SUCCESS-*", "-bash -c echo $HOME", "su - postgres -c echo $HOME") or
process.parent.executable in ("/usr/bin/watch", "/bin/diskmgr", "/usr/bin/diskmgr")
)
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | in |
| field:"EventType" kind:in |
event.type | eq |
| field:"event.type" kind:eq value:"start" |
process.args | wildcard |
| field:"process.args" kind:wildcard |
process.parent.args | wildcard |
| field:"process.parent.args" kind:wildcard |
user.name | eq |
| field:"user" kind:eq value:"postgres" |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.command_line | wildcard | *BECOME-SUCCESS-*, bash -c while true; do sleep 1;*, df -l, sleep 1, who, head -v -n *, tail -v -n *, /bin/sh -c echo BECOME-SUCCESS*, /usr/bin/python3 /var/tmp/ansible-tmp*, *chpasswd* | excludes:process.command_line |
process.parent.command_line | wildcard | *BECOME-SUCCESS-*, -bash -c echo $HOME, su - postgres -c echo $HOME | excludes:process.parent.command_line field:"process.parent.command_line" value:"*BECOME-SUCCESS-*" field:"process.parent.command_line" value:"-bash -c echo $HOME" field:"process.parent.command_line" value:"su - postgres -c echo $HOME" |
process.parent.executable | in | /bin/diskmgr, /usr/bin/diskmgr, /usr/bin/watch | excludes:process.parent.executable field:"process.parent.executable" value:"/bin/diskmgr" field:"process.parent.executable" value:"/usr/bin/diskmgr" field:"process.parent.executable" value:"/usr/bin/watch" |
process.parent.name | eq | puppet | excludes:process.parent.name field:"process.parent.name" value:"puppet" |
Potential Credential Harvesting via Python
#Identifies Python interpreters started with -c (inline code) where the command line suggests looking up credentials from a browser's password store.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Execution | |
| Credential Access |
Telemetry Coverage
Rule Body
[rule]
description = """
Identifies Python interpreters started with -c (inline code) where the command line suggests looking up credentials from
a browser's password store.
"""
id = "d2f85eb5-4ea2-484e-82a1-98399a532f97"
license = "Elastic License v2"
name = "Potential Credential Harvesting via Python"
os_list = ["macos"]
reference = ["https://www.wiz.io/blog/threat-actors-target-crypto-orgs"]
version = "1.0.1"
query = '''
process where event.type == "start" and event.action in ("start", "exec") and
process.name like~ ("python*", "py.exe", "py", "pypy*") and process.args == "-c" and
process.command_line like~ "*Secret.password_lookup_sync*" and
process.command_line like~ ("*microsoft-edge*", "*brave*", "*chromium*", "*chrome*", "*vivaldi*", "*opera*")
'''
min_endpoint_version = "7.15.0"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
[[actions]]
action = "kill_process"
field = "process.parent.entity_id"
state = 0
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1059"
name = "Command and Scripting Interpreter"
reference = "https://attack.mitre.org/techniques/T1059/"
[[threat.technique.subtechnique]]
id = "T1059.006"
name = "Python"
reference = "https://attack.mitre.org/techniques/T1059/006/"
[threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1555"
name = "Credentials from Password Stores"
reference = "https://attack.mitre.org/techniques/T1555/"
[threat.tactic]
id = "TA0006"
name = "Credential Access"
reference = "https://attack.mitre.org/tactics/TA0006/"
[internal]
min_endpoint_version = "7.15.0"
Stages and Predicates
Stage 1: process
process where event.type == "start" and event.action in ("start", "exec") and
process.name like~ ("python*", "py.exe", "py", "pypy*") and process.args == "-c" and
process.command_line like~ "*Secret.password_lookup_sync*" and
process.command_line like~ ("*microsoft-edge*", "*brave*", "*chromium*", "*chrome*", "*vivaldi*", "*opera*")
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | in |
| field:"EventType" kind:in |
event.type | eq |
| field:"event.type" kind:eq value:"start" |
process.args | eq |
| field:"process.args" kind:eq value:"-c" |
process.command_line | wildcard |
| field:"CommandLine" kind:wildcard |
process.name | wildcard |
| field:"process_basename" kind:wildcard |
RDP (Remote Desktop Protocol) from the Internet
#This rule detects network events that may indicate the use of RDP traffic from the Internet. RDP is commonly used by system administrators to remotely control a system for maintenance or to use shared resources. It should almost never be directly exposed to the Internet, as it is frequently targeted and exploited by threat actors as an initial access or backdoor vector.
Known False Positives
- Some network security policies allow RDP directly from the Internet but usage that is unfamiliar to server or network owners can be unexpected and suspicious. RDP services may be exposed directly to the Internet in some networks such as cloud environments. In such cases, only RDP gateways, bastions or jump servers may be expected expose RDP directly to the Internet and can be exempted from this rule. RDP may be required by some work-flows such as remote access and support for specialized software products and servers. Such work-flows are usually known and not unexpected.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Initial Access | |
| Lateral Movement |
Rule Body
[metadata]
creation_date = "2020/02/18"
integration = ["network_traffic", "panw", "pfsense", "zeek", "corelight"]
maturity = "production"
updated_date = "2026/07/01"
[rule]
author = ["Elastic"]
description = """
This rule detects network events that may indicate the use of RDP traffic from the Internet. RDP is commonly used by
system administrators to remotely control a system for maintenance or to use shared resources. It should almost never be
directly exposed to the Internet, as it is frequently targeted and exploited by threat actors as an initial access or
backdoor vector.
"""
false_positives = [
"""
Some network security policies allow RDP directly from the Internet but usage that is unfamiliar to server or
network owners can be unexpected and suspicious. RDP services may be exposed directly to the Internet in some
networks such as cloud environments. In such cases, only RDP gateways, bastions or jump servers may be expected
expose RDP directly to the Internet and can be exempted from this rule. RDP may be required by some work-flows such
as remote access and support for specialized software products and servers. Such work-flows are usually known and
not unexpected.
""",
]
from = "now-9m"
index = ["logs-network_traffic.*", "logs-panw.panos*", "logs-pfsense.log-*", "logs-zeek.*", "logs-corelight.*"]
language = "kuery"
license = "Elastic License v2"
name = "RDP (Remote Desktop Protocol) from the Internet"
references = ["https://www.iana.org/assignments/iana-ipv4-special-registry/iana-ipv4-special-registry.xhtml"]
risk_score = 47
rule_id = "8c1bdde8-4204-45c0-9e0c-c85ca3902488"
severity = "medium"
tags = ["Tactic: Command and Control",
"Tactic: Lateral Movement",
"Tactic: Initial Access",
"Domain: Endpoint",
"Use Case: Threat Detection",
"Data Source: Corelight",
"Data Source: PAN-OS",
"Data Source: Network Traffic",
"Data Source: pfSense",
"Data Source: Zeek",
"Resources: Investigation Guide"
]
timeline_id = "300afc76-072d-4261-864d-4149714bf3f1"
timeline_title = "Comprehensive Network Timeline"
timestamp_override = "event.ingested"
type = "query"
query = '''
(data_stream.dataset: network_traffic.flow or (event.category: (network or network_traffic))) and
network.transport:tcp and (destination.port:3389 or data_stream.dataset:zeek.rdp) and
not source.ip:(
10.0.0.0/8 or
127.0.0.0/8 or
169.254.0.0/16 or
172.16.0.0/12 or
192.0.0.0/24 or
192.0.0.0/29 or
192.0.0.8/32 or
192.0.0.9/32 or
192.0.0.10/32 or
192.0.0.170/32 or
192.0.0.171/32 or
192.0.2.0/24 or
192.31.196.0/24 or
192.52.193.0/24 or
192.168.0.0/16 or
192.88.99.0/24 or
224.0.0.0/4 or
100.64.0.0/10 or
192.175.48.0/24 or
198.18.0.0/15 or
198.51.100.0/24 or
203.0.113.0/24 or
240.0.0.0/4 or
"::1" or
"FE80::/10" or
"FF00::/8"
) and
destination.ip:(
10.0.0.0/8 or
172.16.0.0/12 or
192.168.0.0/16
) and
not (
data_stream.dataset:"panw.panos" and (
event.action:("flow_dropped" or "flow_denied") or
network.application:("incomplete" or "insufficient-data" or "not-applicable")
)
)
'''
note = """## Triage and analysis
> **Disclaimer**:
> This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.
### Investigating RDP (Remote Desktop Protocol) from the Internet
RDP allows administrators to remotely manage systems, but exposing it to the internet poses security risks. Adversaries exploit RDP for unauthorized access, often using it as an entry point for attacks. The detection rule identifies suspicious RDP traffic by monitoring TCP connections on port 3389 from external IPs, flagging potential threats for further investigation.
### Possible investigation steps
- Review the source IP address flagged in the alert to determine if it is known or associated with any previous malicious activity. Check threat intelligence sources for any reported malicious behavior.
- Analyze the destination IP address to confirm it belongs to your internal network (10.0.0.0/8, 172.16.0.0/12, or 192.168.0.0/16) and identify the specific system targeted by the RDP connection.
- Examine network logs for any unusual or unexpected RDP traffic patterns from the source IP, such as repeated connection attempts or connections at odd hours, which may indicate brute force attempts or unauthorized access.
- Check for any recent changes or updates to firewall rules or security policies that might have inadvertently exposed RDP to the internet.
- Investigate the user accounts involved in the RDP session to ensure they are legitimate and have not been compromised. Look for any signs of unauthorized access or privilege escalation.
- Correlate the RDP traffic with other security events or alerts to identify any potential lateral movement or further malicious activity within the network.
### False positive analysis
- Internal testing or maintenance activities may trigger the rule if RDP is temporarily exposed to the internet. To manage this, create exceptions for known internal IP addresses or scheduled maintenance windows.
- Legitimate third-party vendors or partners accessing systems via RDP for support purposes can be mistaken for threats. Establish a list of trusted external IP addresses and exclude them from the rule.
- Misconfigured network devices or security tools might inadvertently expose RDP to the internet, leading to false positives. Regularly audit network configurations and update the rule to exclude known benign sources.
- Cloud-based services or remote work solutions that use RDP over the internet can be flagged. Identify and whitelist these services' IP ranges to prevent unnecessary alerts.
### Response and remediation
- Immediately block the external IP address identified in the alert from accessing the network to prevent further unauthorized RDP connections.
- Isolate the affected system from the network to contain any potential compromise and prevent lateral movement by the threat actor.
- Conduct a thorough review of the affected system for signs of compromise, such as unauthorized user accounts, changes in system configurations, or the presence of malware.
- Reset credentials for any accounts that were accessed or potentially compromised during the incident to prevent unauthorized access.
- Apply security patches and updates to the affected system and any other systems with RDP enabled to mitigate known vulnerabilities.
- Implement network segmentation to restrict RDP access to only trusted internal IP addresses and consider using a VPN for secure remote access.
- Escalate the incident to the security operations center (SOC) or incident response team for further analysis and to determine if additional systems are affected."""
[[rule.threat]]
framework = "MITRE ATT&CK"
[rule.threat.tactic]
id = "TA0011"
name = "Command and Control"
reference = "https://attack.mitre.org/tactics/TA0011/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1021"
name = "Remote Services"
reference = "https://attack.mitre.org/techniques/T1021/"
[[rule.threat.technique.subtechnique]]
id = "T1021.001"
name = "Remote Desktop Protocol"
reference = "https://attack.mitre.org/techniques/T1021/001/"
[rule.threat.tactic]
id = "TA0008"
name = "Lateral Movement"
reference = "https://attack.mitre.org/tactics/TA0008/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1133"
name = "External Remote Services"
reference = "https://attack.mitre.org/techniques/T1133/"
[[rule.threat.technique]]
id = "T1190"
name = "Exploit Public-Facing Application"
reference = "https://attack.mitre.org/techniques/T1190/"
[rule.threat.tactic]
id = "TA0001"
name = "Initial Access"
reference = "https://attack.mitre.org/tactics/TA0001/"
Stages and Predicates
Stage 1: query
(data_stream.dataset: network_traffic.flow or (event.category: (network or network_traffic))) and
network.transport:tcp and (destination.port:3389 or data_stream.dataset:zeek.rdp) and
not source.ip:(
10.0.0.0/8 or
127.0.0.0/8 or
169.254.0.0/16 or
172.16.0.0/12 or
192.0.0.0/24 or
192.0.0.0/29 or
192.0.0.8/32 or
192.0.0.9/32 or
192.0.0.10/32 or
192.0.0.170/32 or
192.0.0.171/32 or
192.0.2.0/24 or
192.31.196.0/24 or
192.52.193.0/24 or
192.168.0.0/16 or
192.88.99.0/24 or
224.0.0.0/4 or
100.64.0.0/10 or
192.175.48.0/24 or
198.18.0.0/15 or
198.51.100.0/24 or
203.0.113.0/24 or
240.0.0.0/4 or
"::1" or
"FE80::/10" or
"FF00::/8"
) and
destination.ip:(
10.0.0.0/8 or
172.16.0.0/12 or
192.168.0.0/16
) and
not (
data_stream.dataset:"panw.panos" and (
event.action:("flow_dropped" or "flow_denied") or
network.application:("incomplete" or "insufficient-data" or "not-applicable")
)
)
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
data_stream.dataset | eq |
| field:"data_stream.dataset" kind:eq |
destination.ip | in |
| field:"dest_ip" kind:in |
destination.port | eq |
| field:"DestinationPort" kind:eq value:"3389" |
event.category | in |
| field:"event.category" kind:in |
network.transport | eq |
| field:"Protocol" kind:eq value:"tcp" |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
event.action | in | flow_denied, flow_dropped | excludes:event.action field:"event.action" value:"flow_denied" field:"event.action" value:"flow_dropped" |
network.application | in | incomplete, insufficient-data, not-applicable | excludes:network.application field:"network.application" value:"incomplete" field:"network.application" value:"insufficient-data" field:"network.application" value:"not-applicable" |
data_stream.dataset | eq | panw.panos | excludes:data_stream.dataset field:"data_stream.dataset" value:"panw.panos" |
source.ip | in | 10.0.0.0/8, 100.64.0.0/10, 127.0.0.0/8, 169.254.0.0/16, 172.16.0.0/12, 192.0.0.0/24, 192.0.0.0/29, 192.0.0.10/32, 192.0.0.170/32, 192.0.0.171/32, 192.0.0.8/32, 192.0.0.9/32, 192.0.2.0/24, 192.168.0.0/16, 192.175.48.0/24, 192.31.196.0/24, 192.52.193.0/24, 192.88.99.0/24, 198.18.0.0/15, 198.51.100.0/24, 203.0.113.0/24, 224.0.0.0/4, 240.0.0.0/4, ::1, FE80::/10, FF00::/8 | excludes:source.ip |
Root Certificate Installation
#This rule detects the installation of root certificates on a Linux system. Adversaries may install a root certificate on a compromised system to avoid warnings when connecting to their command and control servers. Root certificates are used in public key cryptography to identify a root certificate authority (CA). When a root certificate is installed, the system or application will trust certificates in the root's chain of trust that have been signed by the root certificate.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Defense Impairment |
Rule Body
[metadata]
creation_date = "2024/08/28"
integration = ["endpoint", "sentinel_one_cloud_funnel"]
maturity = "production"
updated_date = "2025/12/18"
[rule]
author = ["Elastic"]
description = """
This rule detects the installation of root certificates on a Linux system. Adversaries may install a root certificate on
a compromised system to avoid warnings when connecting to their command and control servers. Root certificates are used
in public key cryptography to identify a root certificate authority (CA). When a root certificate is installed, the
system or application will trust certificates in the root's chain of trust that have been signed by the root
certificate.
"""
from = "now-9m"
index = ["logs-endpoint.events.process*", "logs-sentinel_one_cloud_funnel.*", "endgame-*"]
language = "eql"
license = "Elastic License v2"
name = "Root Certificate Installation"
note = """## Triage and analysis
> **Disclaimer**:
> This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.
### Investigating Root Certificate Installation
Root certificates are pivotal in establishing trust within public key infrastructures, enabling secure communications by verifying the authenticity of entities. Adversaries exploit this by installing rogue root certificates on compromised Linux systems, thus bypassing security warnings and facilitating undetected command and control communications. The detection rule identifies suspicious certificate installations by monitoring specific processes and excluding legitimate parent processes, thereby highlighting potential unauthorized activities.
### Possible investigation steps
- Review the process details to confirm the execution of "update-ca-trust" or "update-ca-certificates" on the Linux host, focusing on the event type "start" and action "exec" or "exec_event".
- Examine the parent process name and arguments to ensure they do not match any of the legitimate exclusions such as "ca-certificates.postinst", "pacman", or "/var/tmp/rpm*".
- Investigate the user account associated with the process to determine if it is a known or expected user for such operations.
- Check the system logs and recent changes to identify any unauthorized modifications or installations that coincide with the alert.
- Correlate the alert with other security events or logs to identify any potential command and control communications or other suspicious activities on the host.
- Assess the network connections from the host around the time of the alert to detect any unusual or unauthorized outbound traffic.
### False positive analysis
- Legitimate system updates or package installations may trigger the rule when processes like "update-ca-trust" or "update-ca-certificates" are executed by trusted package managers such as "pacman" or "pamac-daemon". To mitigate this, ensure these parent processes are included in the exclusion list.
- Automated scripts or system maintenance tasks that use shell scripts (e.g., "sh", "bash", "zsh") to update certificates might be flagged. If these scripts are verified as safe, consider adding specific script names or paths to the exclusion criteria.
- Custom applications or services that require certificate updates and are known to be safe can be excluded by adding their parent process names to the exclusion list, ensuring they do not trigger false alerts.
- Security tools or agents like "kesl" or "execd" that manage certificates as part of their operations may cause false positives. Verify their activities and include them in the exclusion list if they are part of legitimate security operations.
- Temporary files or scripts located in directories like "/var/tmp/rpm*" used during legitimate installations should be reviewed and excluded if they are part of routine system operations.
### Response and remediation
- Immediately isolate the affected Linux system from the network to prevent further unauthorized communications with potential command and control servers.
- Revoke any unauthorized root certificates installed on the system by removing them from the trusted certificate store to restore the integrity of the system's trust chain.
- Conduct a thorough review of system logs and process execution history to identify any additional unauthorized activities or changes made by the adversary.
- Restore the system from a known good backup if unauthorized changes or persistent threats are detected that cannot be easily remediated.
- Update and patch the system to the latest security standards to close any vulnerabilities that may have been exploited by the adversary.
- Implement enhanced monitoring and alerting for similar suspicious activities, focusing on process executions related to certificate management.
- Escalate the incident to the security operations center (SOC) or relevant incident response team for further investigation and to assess the potential impact on other systems within the network."""
references = [
"https://github.com/redcanaryco/atomic-red-team/blob/f339e7da7d05f6057fdfcdd3742bfcf365fee2a9/atomics/T1553.004/T1553.004.md",
]
risk_score = 47
rule_id = "6ded0996-7d4b-40f2-bf4a-6913e7591795"
setup = """## Setup
This rule requires data coming in from Elastic Defend.
### Elastic Defend Integration Setup
Elastic Defend is integrated into the Elastic Agent using Fleet. Upon configuration, the integration allows the Elastic Agent to monitor events on your host and send data to the Elastic Security app.
#### Prerequisite Requirements:
- Fleet is required for Elastic Defend.
- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).
#### The following steps should be executed in order to add the Elastic Defend integration on a Linux System:
- Go to the Kibana home page and click "Add integrations".
- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.
- Click "Add Elastic Defend".
- Configure the integration name and optionally add a description.
- Select the type of environment you want to protect, either "Traditional Endpoints" or "Cloud Workloads".
- Select a configuration preset. Each preset comes with different default settings for Elastic Agent, you can further customize these later by configuring the Elastic Defend integration policy. [Helper guide](https://www.elastic.co/guide/en/security/current/configure-endpoint-integration-policy.html).
- We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"
- Enter a name for the agent policy in "New agent policy name". If other agent policies already exist, you can click the "Existing hosts" tab and select an existing policy instead.
For more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/8.10/agent-policy.html).
- Click "Save and Continue".
- To complete the integration, select "Add Elastic Agent to your hosts" and continue to the next section to install the Elastic Agent on your hosts.
For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
"""
severity = "medium"
tags = [
"Domain: Endpoint",
"OS: Linux",
"Use Case: Threat Detection",
"Tactic: Defense Evasion",
"Data Source: Elastic Defend",
"Data Source: SentinelOne",
"Data Source: Elastic Endgame",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
process where host.os.type == "linux" and event.type == "start" and event.action in ("exec", "exec_event", "start") and
process.name in ("update-ca-trust", "update-ca-certificates") and not (
process.parent.name like (
"ca-certificates.postinst", "ca-certificates-*.trigger", "pacman", "pamac-daemon", "autofirma.postinst",
"ipa-client-install", "su", "platform-python", "python*", "kesl", "execd", "systemd", "flock"
) or
process.parent.args like "/var/tmp/rpm*" or
(process.parent.name in ("sh", "bash", "zsh") and process.args == "-e") or
process.parent.executable in (
"/app/update-cert-trust.sh", "/opt/puppetlabs/puppet/bin/puppet", "/opt/puppetlabs/puppet/bin/ruby",
"/start-haproxy", "/usr/bin/entrypoint.sh", "/usr/bin/crun"
) or
process.parent.args like (
"/entrypoint.sh", "/entrypoint", "./bootstrap-RHEL*", "lib/apk/exec/ca-certificates-*trigger"
) or
?process.working_directory == "/var/lib/rancher"
)
'''
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1553"
name = "Subvert Trust Controls"
reference = "https://attack.mitre.org/techniques/T1553/"
[[rule.threat.technique.subtechnique]]
id = "T1553.004"
name = "Install Root Certificate"
reference = "https://attack.mitre.org/techniques/T1553/004/"
[rule.threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
Stages and Predicates
Stage 1: process
process where host.os.type == "linux" and event.type == "start" and event.action in ("exec", "exec_event", "start") and
process.name in ("update-ca-trust", "update-ca-certificates") and not (
process.parent.name like (
"ca-certificates.postinst", "ca-certificates-*.trigger", "pacman", "pamac-daemon", "autofirma.postinst",
"ipa-client-install", "su", "platform-python", "python*", "kesl", "execd", "systemd", "flock"
) or
process.parent.args like "/var/tmp/rpm*" or
(process.parent.name in ("sh", "bash", "zsh") and process.args == "-e") or
process.parent.executable in (
"/app/update-cert-trust.sh", "/opt/puppetlabs/puppet/bin/puppet", "/opt/puppetlabs/puppet/bin/ruby",
"/start-haproxy", "/usr/bin/entrypoint.sh", "/usr/bin/crun"
) or
process.parent.args like (
"/entrypoint.sh", "/entrypoint", "./bootstrap-RHEL*", "lib/apk/exec/ca-certificates-*trigger"
) or
?process.working_directory == "/var/lib/rancher"
)
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | in |
| field:"EventType" kind:in |
event.type | eq |
| field:"event.type" kind:eq value:"start" |
process.name | in |
| field:"process_basename" kind:in |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.args | eq | -e | excludes:process.args field:"process.args" value:"-e" |
process.parent.name | in | bash, sh, zsh | excludes:process.parent.name field:"process.parent.name" value:"bash" field:"process.parent.name" value:"sh" field:"process.parent.name" value:"zsh" |
process.parent.args | starts_with | /var/tmp/rpm | excludes:process.parent.args field:"process.parent.args" value:"/var/tmp/rpm" |
process.parent.args | wildcard | /entrypoint.sh, /entrypoint, ./bootstrap-RHEL*, lib/apk/exec/ca-certificates-*trigger | excludes:process.parent.args |
process.parent.executable | in | /app/update-cert-trust.sh, /opt/puppetlabs/puppet/bin/puppet, /opt/puppetlabs/puppet/bin/ruby, /start-haproxy, /usr/bin/crun, /usr/bin/entrypoint.sh | excludes:process.parent.executable |
process.parent.name | wildcard | ca-certificates.postinst, ca-certificates-*.trigger, pacman, pamac-daemon, autofirma.postinst, ipa-client-install, su, platform-python, python*, kesl, execd, systemd, flock | excludes:process.parent.name |
process.working_directory | eq | /var/lib/rancher | excludes:process.working_directory field:"process.working_directory" value:"/var/lib/rancher" |
Script File Written by Microsoft Office Process
#Identifies the execution of a script file written by a Microsoft Office application (Word, PowerPoint, or Excel). Script interpreters are often launched during exploitation of Office applications or from documents containing malicious macros.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Initial Access | |
| Execution | |
| Stealth |
Rule Body
[rule]
description = """
Identifies the execution of a script file written by a Microsoft Office application (Word, PowerPoint, or Excel). Script
interpreters are often launched during exploitation of Office applications or from documents containing malicious
macros.
"""
id = "78e2e5e1-e727-4106-9206-8cf43b9f8919"
license = "Elastic License v2"
name = "Script File Written by Microsoft Office Process"
os_list = ["windows"]
reference = ["https://lolbas-project.github.io/"]
version = "1.0.30"
query = '''
sequence by user.id with maxspan=1m
[file where event.action != "deletion" and
/* script dropped by MS Office program */
file.extension : ("hta", "vbs", "js", "wsf", "vbe", "jse", "ps1", "bat", "cmd", "sct") and
process.name : ("winword.exe", "excel.exe", "outlook.exe", "powerpnt.exe", "eqnedt32.exe", "fltldr.exe", "mspub.exe", "msaccess.exe")]
[process where event.action == "start" and
process.name : ("cscript.exe", "wscript.exe", "mshta.exe", "powershell.exe", "cmd.exe", "regsvr32.exe", "cmstp.exe", "wmic.exe") and not
/* descendant of MS office but not a direct child - already covered by ruleId c34a9dca-66cf-4283-944d-1800b28ae690 */
process.parent.name : ("winword.exe", "excel.exe", "outlook.exe", "powerpnt.exe", "eqnedt32.exe", "fltldr.exe", "mspub.exe",
"msaccess.exe", "WmiPrvse.exe", "explorer.exe") and
descendant of [process where event.action == "start" and
process.name : ("winword.exe", "excel.exe", "outlook.exe", "powerpnt.exe", "eqnedt32.exe", "fltldr.exe", "mspub.exe", "msaccess.exe")] and
not (process.name : "cmd.exe" and process.parent.executable : "\\Device\\Mup\\*\\netlogon\\*") and
not (process.name : "cmd.exe" and process.parent.name : ("chrome.exe", "msedge.exe", "iexplore.exe", "opera.exe", "firefox.exe", "brave.exe")) and
not (process.command_line : "cmd.exe /c set" and process.parent.executable : "?:\\Program Files (x86)\\eparakstitajs?\\eparakstitajs?.exe") and
not (process.name : "regsvr32.exe" and process.args : "?:\\Program Files\\Mozilla Firefox\\Accessible*.dll") and
not process.parent.executable :
("?:\\Program Files\\HP\\Sure Click\\ApplicationSupport\\chrome\\*\\BrChrome.exe",
"?:\\Program Files (x86)\\HP\\Sure Click\\ApplicationSupport\\chrome\\*\\BrChrome.exe",
"?:\\Program Files (x86)\\Fuji Xerox\\DocuWorks\\bin\\dwviewer.exe",
"C:\\Program Files\\Druide\\*\\Connectix.exe",
"\\Device\\Mup\\*.exe") and
not (process.command_line : "cmd.exe /c start outlook" and
process.parent.executable : "?:\\Program Files\\WindowsApps\\Microsoft.OutlookForWindows_*\\olk.exe") and
not (process.name : "regsvr32.exe" and
process.command_line : "?:\\Windows\\sys*\\regsvr32.exe -s \"C:\\Users\\*\\G2MOutlookAddin64.dll\"" and
process.parent.executable : "?:\\Users\\*\\AppData\\Local\\GoToMeeting\\*\\g2mlauncher.exe")
]
'''
min_endpoint_version = "7.15.0"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 1
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1566"
name = "Phishing"
reference = "https://attack.mitre.org/techniques/T1566/"
[[threat.technique.subtechnique]]
id = "T1566.001"
name = "Spearphishing Attachment"
reference = "https://attack.mitre.org/techniques/T1566/001/"
[threat.tactic]
id = "TA0001"
name = "Initial Access"
reference = "https://attack.mitre.org/tactics/TA0001/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1059"
name = "Command and Scripting Interpreter"
reference = "https://attack.mitre.org/techniques/T1059/"
[[threat.technique.subtechnique]]
id = "T1059.001"
name = "PowerShell"
reference = "https://attack.mitre.org/techniques/T1059/001/"
[[threat.technique.subtechnique]]
id = "T1059.005"
name = "Visual Basic"
reference = "https://attack.mitre.org/techniques/T1059/005/"
[[threat.technique.subtechnique]]
id = "T1059.007"
name = "JavaScript"
reference = "https://attack.mitre.org/techniques/T1059/007/"
[threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1218"
name = "System Binary Proxy Execution"
reference = "https://attack.mitre.org/techniques/T1218/"
[[threat.technique.subtechnique]]
id = "T1218.005"
name = "Mshta"
reference = "https://attack.mitre.org/techniques/T1218/005/"
[threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
[internal]
min_endpoint_version = "7.15.0"
Stages and Predicates
Ordered sequence: each step below must occur in order within 1m, correlated by user.id.
Stage 1: file
[file where event.action != "deletion" and
file.extension : ("hta", "vbs", "js", "wsf", "vbe", "jse", "ps1", "bat", "cmd", "sct") and
process.name : ("winword.exe", "excel.exe", "outlook.exe", "powerpnt.exe", "eqnedt32.exe", "fltldr.exe", "mspub.exe", "msaccess.exe")]
Stage 2: process
[process where event.action == "start" and
process.name : ("cscript.exe", "wscript.exe", "mshta.exe", "powershell.exe", "cmd.exe", "regsvr32.exe", "cmstp.exe", "wmic.exe") and not
process.parent.name : ("winword.exe", "excel.exe", "outlook.exe", "powerpnt.exe", "eqnedt32.exe", "fltldr.exe", "mspub.exe",
"msaccess.exe", "WmiPrvse.exe", "explorer.exe") and
descendant of [process where event.action == "start" and
process.name : ("winword.exe", "excel.exe", "outlook.exe", "powerpnt.exe", "eqnedt32.exe", "fltldr.exe", "mspub.exe", "msaccess.exe")] and
not (process.name : "cmd.exe" and process.parent.executable : "\\Device\\Mup\\*\\netlogon\\*") and
not (process.name : "cmd.exe" and process.parent.name : ("chrome.exe", "msedge.exe", "iexplore.exe", "opera.exe", "firefox.exe", "brave.exe")) and
not (process.command_line : "cmd.exe /c set" and process.parent.executable : "?:\\Program Files (x86)\\eparakstitajs?\\eparakstitajs?.exe") and
not (process.name : "regsvr32.exe" and process.args : "?:\\Program Files\\Mozilla Firefox\\Accessible*.dll") and
not process.parent.executable :
("?:\\Program Files\\HP\\Sure Click\\ApplicationSupport\\chrome\\*\\BrChrome.exe",
"?:\\Program Files (x86)\\HP\\Sure Click\\ApplicationSupport\\chrome\\*\\BrChrome.exe",
"?:\\Program Files (x86)\\Fuji Xerox\\DocuWorks\\bin\\dwviewer.exe",
"C:\\Program Files\\Druide\\*\\Connectix.exe",
"\\Device\\Mup\\*.exe") and
not (process.command_line : "cmd.exe /c start outlook" and
process.parent.executable : "?:\\Program Files\\WindowsApps\\Microsoft.OutlookForWindows_*\\olk.exe") and
not (process.name : "regsvr32.exe" and
process.command_line : "?:\\Windows\\sys*\\regsvr32.exe -s \"C:\\Users\\*\\G2MOutlookAddin64.dll\"" and
process.parent.executable : "?:\\Users\\*\\AppData\\Local\\GoToMeeting\\*\\g2mlauncher.exe")
]
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | eq |
| field:"EventType" kind:eq value:"start" |
event.action | ne |
| field:"EventType" kind:ne value:"deletion" |
file.extension | wildcard |
| field:"file.extension" kind:wildcard |
process.name | wildcard |
| field:"process_basename" kind:wildcard |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.args | wildcard | ?:\Program Files\Mozilla Firefox\Accessible*.dll | excludes:process.args field:"process.args" value:"?:\Program Files\Mozilla Firefox\Accessible*.dll" |
process.name | eq | regsvr32.exe | excludes:process.name field:"process.name" value:"regsvr32.exe" |
process.command_line | eq | cmd.exe /c set | excludes:process.command_line field:"process.command_line" value:"cmd.exe /c set" |
process.parent.executable | eq | ?:\Program Files (x86)\eparakstitajs?\eparakstitajs?.exe | excludes:process.parent.executable field:"process.parent.executable" value:"?:\Program Files (x86)\eparakstitajs?\eparakstitajs?.exe" |
process.command_line | eq | cmd.exe /c start outlook | excludes:process.command_line field:"process.command_line" value:"cmd.exe /c start outlook" |
process.parent.executable | wildcard | ?:\Program Files\WindowsApps\Microsoft.OutlookForWindows_*\olk.exe | excludes:process.parent.executable field:"process.parent.executable" value:"?:\Program Files\WindowsApps\Microsoft.OutlookForWindows_*\olk.exe" |
process.command_line | wildcard | ?:\Windows\sys*\regsvr32.exe -s "C:\Users\*\G2MOutlookAddin64.dll" | excludes:process.command_line |
process.parent.executable | wildcard | ?:\Users\*\AppData\Local\GoToMeeting\*\g2mlauncher.exe | excludes:process.parent.executable field:"process.parent.executable" value:"?:\Users\*\AppData\Local\GoToMeeting\*\g2mlauncher.exe" |
process.name | eq | cmd.exe | excludes:process.name field:"process.name" value:"cmd.exe" |
process.parent.executable | wildcard | \Device\Mup\*\netlogon\* | excludes:process.parent.executable field:"process.parent.executable" value:"\Device\Mup\*\netlogon\*" |
process.parent.name | eq | chrome.exe, msedge.exe, iexplore.exe, opera.exe, firefox.exe, brave.exe | excludes:process.parent.name |
process.parent.executable | wildcard | ?:\Program Files\HP\Sure Click\ApplicationSupport\chrome\*\BrChrome.exe, ?:\Program Files (x86)\HP\Sure Click\ApplicationSupport\chrome\*\BrChrome.exe, ?:\Program Files (x86)\Fuji Xerox\DocuWorks\bin\dwviewer.exe, C:\Program Files\Druide\*\Connectix.exe, \Device\Mup\*.exe | excludes:process.parent.executable |
process.parent.name | eq | winword.exe, excel.exe, outlook.exe, powerpnt.exe, eqnedt32.exe, fltldr.exe, mspub.exe, msaccess.exe, WmiPrvse.exe, explorer.exe | excludes:process.parent.name |
Suspicious Kerberos Enumeration via LDAP Search
#Identifies a list of common LDAP search queries used for Kerberoasting and AS-REP Roasting reconnaissance to identify potential target accounts.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Discovery |
Rule Body
[rule]
description = """
Identifies a list of common LDAP search queries used for Kerberoasting and AS-REP Roasting reconnaissance to identify
potential target accounts.
"""
id = "7367213e-05e3-41a9-b298-20ad8ba23aa6"
license = "Elastic License v2"
name = "Suspicious Kerberos Enumeration via LDAP Search"
os_list = ["windows"]
reference = ["https://attack.mitre.org/techniques/T1558/003/", "https://attack.mitre.org/techniques/T1558/004/"]
version = "1.0.3"
query = '''
api where process.Ext.api.name == "ldap_search" and user.id != "S-1-5-18" and
not process.executable :
("?:\\Program Files\\Azure Advanced Threat Protection Sensor\\*\\Microsoft.Tri.Sensor.exe",
"?:\\Windows\\ADFS\\Microsoft.IdentityServer.ServiceHost.exe",
"?:\\Windows\\ADWS\\Microsoft.ActiveDirectory.WebServices.exe") and
process.Ext.api.parameters.search_filter : (
// Kerberoasting SPN enumeration
"(&(samAccountType=805306368)(servicePrincipalName=?))",
"(&(samAccountType=805306368)(servicePrincipalName=?)(!samAccountName=krbtgt))",
"(&(samAccountType=805306368)(servicePrincipalName=?)(!(UserAccountControl:1.2.840.113556.1.4.803:=2)))",
"(&(samAccountType=805306368)(servicePrincipalName=?)(!samAccountName=krbtgt)(!(UserAccountControl:1.2.840.113556.1.4.803:=2)))",
"(&(samAccountType=805306369)(servicePrincipalName=?))",
"(&(objectCategory=user)(!(samAccountName=krbtgt)(servicePrincipalName=?)))",
"(servicePrincipalName=?)",
// Delegation-related SPN enumeration
"(&(servicePrincipalName=?)(userAccountControl:1.2.840.113556.1.4.803:=524288))", // Trusted for delegation
"(&(userAccountControl:1.2.840.113556.1.4.803:=524288))", // Trusted for delegation
"(&(servicePrincipalName=?)(userAccountControl:1.2.840.113556.1.4.803:=16777216))", // Trusted to auth for delegation
"(&(servicePrincipalName=?)(userAccountControl:1.2.840.113556.1.4.803:=1048576))", // Account not delegated
// AS-REP Roasting enumeration
"(&(objectCategory=person)(objectClass=user)(userAccountControl:1.2.840.113556.1.4.803:=4194304))",
"(&(samAccountType=805306368)(userAccountControl:1.2.840.113556.1.4.803:=4194304))"
)
'''
min_endpoint_version = "9.1.0"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1087"
name = "Account Discovery"
reference = "https://attack.mitre.org/techniques/T1087/"
[[threat.technique.subtechnique]]
id = "T1087.002"
name = "Domain Account"
reference = "https://attack.mitre.org/techniques/T1087/002/"
[[threat.technique]]
id = "T1482"
name = "Domain Trust Discovery"
reference = "https://attack.mitre.org/techniques/T1482/"
[threat.tactic]
id = "TA0007"
name = "Discovery"
reference = "https://attack.mitre.org/tactics/TA0007/"
[internal]
min_endpoint_version = "9.1.0"
Stages and Predicates
Stage 1: api
api where process.Ext.api.name == "ldap_search" and user.id != "S-1-5-18" and
not process.executable :
("?:\\Program Files\\Azure Advanced Threat Protection Sensor\\*\\Microsoft.Tri.Sensor.exe",
"?:\\Windows\\ADFS\\Microsoft.IdentityServer.ServiceHost.exe",
"?:\\Windows\\ADWS\\Microsoft.ActiveDirectory.WebServices.exe") and
process.Ext.api.parameters.search_filter : (
"(&(samAccountType=805306368)(servicePrincipalName=?))",
"(&(samAccountType=805306368)(servicePrincipalName=?)(!samAccountName=krbtgt))",
"(&(samAccountType=805306368)(servicePrincipalName=?)(!(UserAccountControl:1.2.840.113556.1.4.803:=2)))",
"(&(samAccountType=805306368)(servicePrincipalName=?)(!samAccountName=krbtgt)(!(UserAccountControl:1.2.840.113556.1.4.803:=2)))",
"(&(samAccountType=805306369)(servicePrincipalName=?))",
"(&(objectCategory=user)(!(samAccountName=krbtgt)(servicePrincipalName=?)))",
"(servicePrincipalName=?)",
"(&(servicePrincipalName=?)(userAccountControl:1.2.840.113556.1.4.803:=524288))",
"(&(userAccountControl:1.2.840.113556.1.4.803:=524288))",
"(&(servicePrincipalName=?)(userAccountControl:1.2.840.113556.1.4.803:=16777216))",
"(&(servicePrincipalName=?)(userAccountControl:1.2.840.113556.1.4.803:=1048576))",
"(&(objectCategory=person)(objectClass=user)(userAccountControl:1.2.840.113556.1.4.803:=4194304))",
"(&(samAccountType=805306368)(userAccountControl:1.2.840.113556.1.4.803:=4194304))"
)
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
process.Ext.api.name | eq |
| field:"process.Ext.api.name" kind:eq value:"ldap_search" |
process.Ext.api.parameters.search_filter | wildcard |
| field:"process.Ext.api.parameters.search_filter" kind:wildcard |
user.id | ne |
| field:"user.id" kind:ne value:"S-1-5-18" |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.executable | wildcard | ?:\Program Files\Azure Advanced Threat Protection Sensor\*\Microsoft.Tri.Sensor.exe, ?:\Windows\ADFS\Microsoft.IdentityServer.ServiceHost.exe, ?:\Windows\ADWS\Microsoft.ActiveDirectory.WebServices.exe | excludes:process.executable field:"process.executable" value:"?:\Program Files\Azure Advanced Threat Protection Sensor\*\Microsoft.Tri.Sensor.exe" field:"process.executable" value:"?:\Windows\ADFS\Microsoft.IdentityServer.ServiceHost.exe" field:"process.executable" value:"?:\Windows\ADWS\Microsoft.ActiveDirectory.WebServices.exe" |
Suspicious Kernel Mode Address Manipulation
#Identifies attempt to call API to modify a kernel mode address from a user mode process. This may indicate a successful vulnerability exploitation for privilege escalation.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Privilege Escalation |
Rule Body
[rule]
description = """
Identifies attempt to call API to modify a kernel mode address from a user mode process. This may indicate a successful
vulnerability exploitation for privilege escalation.
"""
id = "10d1d07c-1301-4fed-b584-eb0878a74dc7"
license = "Elastic License v2"
name = "Suspicious Kernel Mode Address Manipulation"
os_list = ["windows"]
reference = ["https://www.elastic.co/security-labs/itw-windows-lpe-0days-insights-and-detection-strategies"]
version = "1.0.4"
query = '''
api where process.pid != 4 and process.executable != null and
/* kernel mode address range */
process.Ext.api.parameters.address > 281474976710655 and
process.Ext.api.name : ("WriteProcessMemory", "VirtualProtect*", "VirtualAlloc*", "NtQueueApcThread", "QueueUserAPC", "MapViewOfFile*") and
not (process.Ext.api.name : "VirtualProtect*" and user.id : "s-1-5-18" and
process.executable : ("?:\\ProgramData\\Microsoft\\Windows Defender\\Platform\\*\\MsMpEng.exe",
"?:\\Program Files\\Microsoft Security Client\\MsMpEng.exe",
"?:\\Program Files\\Windows Defender\\MsMpEng.exe"))
'''
min_endpoint_version = "8.8.0"
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
[[optional_actions]]
action = "rollback"
field = "process.entity_id"
state = 0
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1068"
name = "Exploitation for Privilege Escalation"
reference = "https://attack.mitre.org/techniques/T1068/"
[threat.tactic]
id = "TA0004"
name = "Privilege Escalation"
reference = "https://attack.mitre.org/tactics/TA0004/"
[internal]
min_endpoint_version = "8.8.0"
Stages and Predicates
Stage 1: api
api where process.pid != 4 and process.executable != null and
process.Ext.api.parameters.address > 281474976710655 and
process.Ext.api.name : ("WriteProcessMemory", "VirtualProtect*", "VirtualAlloc*", "NtQueueApcThread", "QueueUserAPC", "MapViewOfFile*") and
not (process.Ext.api.name : "VirtualProtect*" and user.id : "s-1-5-18" and
process.executable : ("?:\\ProgramData\\Microsoft\\Windows Defender\\Platform\\*\\MsMpEng.exe",
"?:\\Program Files\\Microsoft Security Client\\MsMpEng.exe",
"?:\\Program Files\\Windows Defender\\MsMpEng.exe"))
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
process.Ext.api.name | wildcard |
| field:"process.Ext.api.name" kind:wildcard |
process.Ext.api.parameters.address | gt |
| field:"process.Ext.api.parameters.address" kind:gt value:"281474976710655" |
process.executable | is_not_null | field:"Image" kind:is_not_null | |
process.pid | ne |
| field:"process_id" kind:ne value:"4" |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.Ext.api.name | starts_with | VirtualProtect | excludes:process.Ext.api.name field:"process.Ext.api.name" value:"VirtualProtect" |
process.executable | wildcard | ?:\ProgramData\Microsoft\Windows Defender\Platform\*\MsMpEng.exe, ?:\Program Files\Microsoft Security Client\MsMpEng.exe, ?:\Program Files\Windows Defender\MsMpEng.exe | excludes:process.executable field:"process.executable" value:"?:\ProgramData\Microsoft\Windows Defender\Platform\*\MsMpEng.exe" field:"process.executable" value:"?:\Program Files\Microsoft Security Client\MsMpEng.exe" field:"process.executable" value:"?:\Program Files\Windows Defender\MsMpEng.exe" |
user.id | eq | s-1-5-18 | excludes:user.id field:"user.id" value:"s-1-5-18" |
Suspicious Named Pipe Creation
#This rule detects the creation of unusually labeled named pipes (FIFOs) by the mkfifo command, which is often used by attackers to establish persistence on a target system or to execute commands in the background. Through the new_terms rule type, this rule can identify uncommon process command lines that may indicate the presence of a malicious named pipe.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Execution | |
| Command & Control |
Rule Body
[metadata]
creation_date = "2025/04/30"
integration = ["endpoint", "crowdstrike", "sentinel_one_cloud_funnel"]
maturity = "production"
updated_date = "2026/03/02"
[rule]
author = ["Elastic"]
description = """
This rule detects the creation of unusually labeled named pipes (FIFOs) by the mkfifo command, which is often used by
attackers to establish persistence on a target system or to execute commands in the background. Through the new_terms
rule type, this rule can identify uncommon process command lines that may indicate the presence of a malicious
named pipe.
"""
from = "now-9m"
index = [
"logs-endpoint.events.process*",
"logs-crowdstrike.fdr*",
"logs-sentinel_one_cloud_funnel.*",
]
language = "kuery"
license = "Elastic License v2"
name = "Suspicious Named Pipe Creation"
note = """ ## Triage and analysis
> **Disclaimer**:
> This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.
### Investigating Suspicious Named Pipe Creation
Named pipes, or FIFOs, are a form of inter-process communication in Linux environments, allowing data transfer between processes. Adversaries exploit this by creating named pipes in common directories like /tmp to stealthily execute commands or maintain persistence. The detection rule identifies unusual named pipe creation by monitoring the `mkfifo` command, especially when initiated by common shell processes, to flag potential malicious activity.
### Possible investigation steps
- Review the process command line arguments to identify the exact named pipe path and any associated commands or scripts that might have been executed using the named pipe.
- Investigate the parent process (bash, csh, dash, fish, ksh, sh, tcsh, or zsh) to determine the origin of the mkfifo command, checking for any unusual or unexpected scripts or commands that might have initiated it.
- Examine the user account associated with the mkfifo process to determine if it is a legitimate user or if the account might have been compromised.
- Check for any other suspicious activities or processes running under the same user account or originating from the same parent process to identify potential lateral movement or further malicious actions.
- Analyze the system logs around the time of the named pipe creation for any other indicators of compromise, such as unauthorized access attempts or unusual network connections.
- If possible, capture and review the contents of the named pipe to understand the data being transferred and assess whether it is part of a malicious operation.
### False positive analysis
- Named pipes created by legitimate applications for inter-process communication can trigger this rule. Users should identify and whitelist these applications by adding exceptions for specific process command lines that are known to be safe.
- System maintenance scripts or backup processes that use named pipes in directories like /tmp or /var/tmp may cause false positives. Review these scripts and exclude them from the rule if they are verified as non-malicious.
- Development environments or testing frameworks that frequently create and delete named pipes during their operations might be flagged. Users can mitigate this by excluding these environments from monitoring or by specifying exceptions for known development tools.
- Automated deployment tools that use named pipes for configuration management or orchestration tasks can also be a source of false positives. Ensure these tools are recognized and excluded from the rule to prevent unnecessary alerts.
### Response and remediation
- Immediately isolate the affected system from the network to prevent further malicious activity or lateral movement.
- Terminate any suspicious processes associated with the mkfifo command, especially those originating from common shell processes like bash or sh.
- Delete any named pipes created in directories such as /tmp, /dev/shm, or /var/tmp that do not follow expected naming conventions or are not part of legitimate applications.
- Conduct a thorough review of user accounts and permissions on the affected system to identify any unauthorized access or privilege escalation.
- Restore the system from a known good backup if any unauthorized changes or persistence mechanisms are detected.
- Implement additional monitoring on the affected system and network to detect any further attempts to create suspicious named pipes or execute unauthorized commands.
- Escalate the incident to the security operations team for further investigation and to determine if the threat is part of a larger attack campaign.
"""
risk_score = 73
rule_id = "8167c5ae-3310-439a-8a58-be60f55023d2"
setup = """## Setup
This rule requires data coming in from Elastic Defend.
### Elastic Defend Integration Setup
Elastic Defend is integrated into the Elastic Agent using Fleet. Upon configuration, the integration allows the Elastic Agent to monitor events on your host and send data to the Elastic Security app.
#### Prerequisite Requirements:
- Fleet is required for Elastic Defend.
- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).
#### The following steps should be executed in order to add the Elastic Defend integration on a Linux System:
- Go to the Kibana home page and click "Add integrations".
- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.
- Click "Add Elastic Defend".
- Configure the integration name and optionally add a description.
- Select the type of environment you want to protect, either "Traditional Endpoints" or "Cloud Workloads".
- Select a configuration preset. Each preset comes with different default settings for Elastic Agent, you can further customize these later by configuring the Elastic Defend integration policy. [Helper guide](https://www.elastic.co/guide/en/security/current/configure-endpoint-integration-policy.html).
- We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"
- Enter a name for the agent policy in "New agent policy name". If other agent policies already exist, you can click the "Existing hosts" tab and select an existing policy instead.
For more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/8.10/agent-policy.html).
- Click "Save and Continue".
- To complete the integration, select "Add Elastic Agent to your hosts" and continue to the next section to install the Elastic Agent on your hosts.
For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
"""
severity = "high"
tags = [
"Domain: Endpoint",
"OS: Linux",
"Use Case: Threat Detection",
"Tactic: Execution",
"Tactic: Command and Control",
"Data Source: Elastic Defend",
"Resources: Investigation Guide",
"Data Source: Crowdstrike",
"Data Source: SentinelOne",
]
timestamp_override = "event.ingested"
type = "new_terms"
query = '''
host.os.type:linux and event.category:process and event.type:start and event.action:(exec or ProcessRollup2 or start) and process.name:mkfifo and
process.parent.name:(bash or csh or dash or fish or ksh or sh or tcsh or zsh) and
process.args:((/dev/shm/* or /tmp/* or /var/tmp/*) and not (/*fifo* or /var/tmp/dracut* or /var/tmp/portage/* or /tmp/opencode_install*.trace))
'''
[[rule.threat]]
framework = "MITRE ATT&CK"
[rule.threat.tactic]
name = "Execution"
id = "TA0002"
reference = "https://attack.mitre.org/tactics/TA0002/"
[[rule.threat.technique]]
id = "T1059"
name = "Command and Scripting Interpreter"
reference = "https://attack.mitre.org/techniques/T1059/"
[[rule.threat.technique.subtechnique]]
id = "T1059.004"
name = "Unix Shell"
reference = "https://attack.mitre.org/techniques/T1059/004/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[rule.threat.tactic]
name = "Command and Control"
id = "TA0011"
reference = "https://attack.mitre.org/tactics/TA0011/"
[[rule.threat.technique]]
name = "Application Layer Protocol"
id = "T1071"
reference = "https://attack.mitre.org/techniques/T1071/"
[rule.new_terms]
field = "new_terms_fields"
value = ["host.id", "process.command_line"]
[[rule.new_terms.history_window_start]]
field = "history_window_start"
value = "now-5d"
Stages and Predicates
Stage 1: new_terms
host.os.type:linux and event.category:process and event.type:start and event.action:(exec or ProcessRollup2 or start) and process.name:mkfifo and
process.parent.name:(bash or csh or dash or fish or ksh or sh or tcsh or zsh) and
process.args:((/dev/shm/* or /tmp/* or /var/tmp/*) and not (/*fifo* or /var/tmp/dracut* or /var/tmp/portage/* or /tmp/opencode_install*.trace))
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | in |
| field:"EventType" kind:in |
event.category | eq |
| field:"event.category" kind:eq value:"process" |
event.type | eq |
| field:"event.type" kind:eq value:"start" |
process.args | wildcard |
| field:"process.args" kind:wildcard |
process.name | eq |
| field:"process_basename" kind:eq value:"mkfifo" |
process.parent.name | in |
| field:"parent_process_basename" kind:in |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.args | starts_with | /var/tmp/dracut | excludes:process.args field:"process.args" value:"/var/tmp/dracut" |
process.args | starts_with | /var/tmp/portage/ | excludes:process.args field:"process.args" value:"/var/tmp/portage/" |
process.args | wildcard | /*fifo* | excludes:process.args field:"process.args" value:"/*fifo*" |
process.args | wildcard | /tmp/opencode_install*.trace | excludes:process.args field:"process.args" value:"/tmp/opencode_install*.trace" |
Suspicious Python Encoded Payload Execution
#Identifies Python interpreters started with -c (inline code) where the command line suggests decoding obfuscated content (e.g. base64, binascii, codecs) and then executing it via exec, eval, compile, or dynamic import. Also identifies child processes spawned by a parent Python process whose command line matches the same suspicious python -c decode-and-exec pattern, when parent telemetry is present.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Execution | |
| Stealth |
Rule Body
[rule]
description = """
Identifies Python interpreters started with -c (inline code) where the command line suggests decoding obfuscated content
(e.g. base64, binascii, codecs) and then executing it via exec, eval, compile, or dynamic import. Also identifies child
processes spawned by a parent Python process whose command line matches the same suspicious python -c decode-and-exec
pattern, when parent telemetry is present.
"""
id = "2b5b095c-a432-4ca4-ac73-a245dbac9a95"
license = "Elastic License v2"
name = "Suspicious Python Encoded Payload Execution"
os_list = ["linux"]
reference = [
"https://futuresearch.ai/blog/litellm-pypi-supply-chain-attack/",
"https://www.virustotal.com/gui/file/71e35aef03099cd1f2d6446734273025a163597de93912df321ef118bf135238",
]
version = "1.0.6"
query = '''
process where event.type == "start" and event.action == "exec" and (
(
/* Inline malicious python -c one-liner on this process */
process.name like ("python*", "py", "pypy*") and
process.args == "-c" and
process.command_line like~ (
"*base64*", "*b64decode*", "*b32decode*", "*b85decode*", "*a85decode*", "*binascii*", "*codecs.decode*", "*fromhex*",
"*zlib.decompress*", "*marshal.loads*", "*pickle.loads*", "*cPickle.loads*"
) and
process.command_line like~ (
"*exec(*", "*eval(*", "*__import__*", "*compile(*", "*types.FunctionType*", "*runpy*", "*importlib.util*", "*importlib.import_module*"
)
) or
/* Child of a parent Python process running the same suspicious -c pattern (parent fields populated) */
(
process.parent.name like ("python*", "py", "pypy*") and
process.parent.command_line != null and
process.parent.args == "-c" and
process.parent.command_line like~ (
"*base64*", "*b64decode*", "*b32decode*", "*b85decode*", "*a85decode*", "*binascii*", "*codecs.decode*", "*fromhex*",
"*zlib.decompress*", "*marshal.loads*"
) and
process.parent.command_line like~ (
"*exec(*", "*eval(*", "*__import__*", "*compile(*", "*types.FunctionType*", "*runpy*",
"*importlib.util*", "*importlib.import_module*"
)
)
) and
not (
process.command_line like """*exec(zlib.decompress(base64.b64decode(b"eJxlU01v2zAMPUe/QvClEqYZTbCTAR1z6GFYD93JMwLXplsVtmRI9pyg6H8fKcVrmhz8IfLxkXwimRlG5yfuggonfObn0bsGAv6aF1v3KkAPzaTegrPs6eHn/tfvJ73d3TPWQscXEWTBNhiZh6l185Qv3kwgPIweXfwbz/7YTH5BdP0cXoVMBHCE5tAMbRD0Iq5RlxXbdM5zo9DGjeVg5wF8jbwraDP5E302VKz+LDp/dCNYgqmU7Yvv4XFPZvD+2sxlJMvrEcNbIYwiryQrHBsYJ76PH+MsrwOHmHshnNiquztk9QKkpAAP0+wtHxlbROahbk/Yf+OGobZtoN6Srnnd134QZ0Ulo4Z7Y4H6RQVRvaSYsTmRkEtlrbNAemL6lXEtme4n712NShIWK2HUQtAXCp9DsJyhPQz1qN8/WHfxF3SASaRakgJUTaTBjE6/Z6Y9ZoVRPCNjVtAbD0nqrCirdECBz4elNpOxL1mx+8A7jalKCjrPQqVduUZXNwCkWQHEiIBz3VcUt/YUSYQhn8eWJkdcxKgLHAm1vJoeOIKxS68O6qDT0OfpI9CjsJ2ykmkwuziVnoYA2UacMhfiLSEy75DLOiHV9n73gwbIdDyh4tCce+zaar255IwD2DiLcs3A8IA96bUvRLNN7MbD4P4C5pEJUv6XuPqutynbV3NxTRxXJmLiJRJzmOppDjrKQoFCptb0c5blb87Ejfq8qbgWuEQ33nhN5MXViDaal0qJxK9I+ii5jMtB04y78Q9tonhI")))""" or
process.parent.command_line like """*exec(zlib.decompress(base64.b64decode(b"eJxlU01v2zAMPUe/QvClEqYZTbCTAR1z6GFYD93JMwLXplsVtmRI9pyg6H8fKcVrmhz8IfLxkXwimRlG5yfuggonfObn0bsGAv6aF1v3KkAPzaTegrPs6eHn/tfvJ73d3TPWQscXEWTBNhiZh6l185Qv3kwgPIweXfwbz/7YTH5BdP0cXoVMBHCE5tAMbRD0Iq5RlxXbdM5zo9DGjeVg5wF8jbwraDP5E302VKz+LDp/dCNYgqmU7Yvv4XFPZvD+2sxlJMvrEcNbIYwiryQrHBsYJ76PH+MsrwOHmHshnNiquztk9QKkpAAP0+wtHxlbROahbk/Yf+OGobZtoN6Srnnd134QZ0Ulo4Z7Y4H6RQVRvaSYsTmRkEtlrbNAemL6lXEtme4n712NShIWK2HUQtAXCp9DsJyhPQz1qN8/WHfxF3SASaRakgJUTaTBjE6/Z6Y9ZoVRPCNjVtAbD0nqrCirdECBz4elNpOxL1mx+8A7jalKCjrPQqVduUZXNwCkWQHEiIBz3VcUt/YUSYQhn8eWJkdcxKgLHAm1vJoeOIKxS68O6qDT0OfpI9CjsJ2ykmkwuziVnoYA2UacMhfiLSEy75DLOiHV9n73gwbIdDyh4tCce+zaar255IwD2DiLcs3A8IA96bUvRLNN7MbD4P4C5pEJUv6XuPqutynbV3NxTRxXJmLiJRJzmOppDjrKQoFCptb0c5blb87Ejfq8qbgWuEQ33nhN5MXViDaal0qJxK9I+ii5jMtB04y78Q9tonhI")))""" or
process.parent.executable in (
"/usr/sbin/sshd", "/usr/bin/sudo", "/usr/lib/openssh/sshd-session", "/opt/teleport/system/bin/teleport",
"/usr/libexec/openssh/sshd-session", "/usr/bin/ansible-playbook", "/usr/bin/sort", "/usr/bin/du",
"/usr/sbin/ldconfig.real", "/usr/sbin/runuser"
) or
process.working_directory like ("/opt/zeek", "/var/lib/docker/overlay2/*/usr/local/zeek", "/usr/share/ansible") or
process.parent.args == "/usr/local/bin/ansible-playbook" or
process.parent.command_line like (
"*IyBweWxpbnQ6IGRpc2FibGU9cmVzb3VyY2UtbGVha2FnZQoiIiIKVGhpcyBpcyBhIHNoaW0gdGhh*",
"/usr/bin/python*-c import zlib,base64; exec(zlib.decompress(base64.b64decode(b*",
"*/usr/bin/python*-c import sys;sys.path=[p for p in sys.path if p];import binascii,os,zlib;exec(zlib.decompress(binascii.a2b_base64(*",
"*/.claude/*shell-snapshots/snapshot-*", "*source /tmp/hermes-snap-*"
) or
process.executable like (
"/home/*/.local/share/uv/python/cpython-*/bin/python*", "/home/*/miniconda3/envs/py312a/bin/python3*"
) or
process.parent.executable like (
"/home/*/.nvm/versions/node/*/lib/node_modules/@openai/codex/node_modules/@openai/codex-linux-x64/vendor/x86_64-unknown-linux-musl/bin/codex",
"/home/*/.vscode-server/extensions/*/bin/linux-x86_64/codex", "/home/*/miniconda3/envs/py312a/bin/python3*",
"/home/*/.local/share/uv/python/cpython-*/bin/python*", "*/.codex/packages/standalone/releases/*/bin/codex",
"*/.vscode-server/extensions/openai.chatgpt-*/bin/*/codex", "*/node_modules/opencode-ai/bin/opencode*"
) or
process.command_line like (
"*eNqVkl1PwjAUhu/5Fd61i2Os*",
"/usr/bin/python*-c import zlib,base64; exec(zlib.decompress(base64.b64decode(b*",
"*/usr/bin/python*-c import sys;sys.path=[p for p in sys.path if p];import binascii,os,zlib;exec(zlib.decompress(binascii.a2b_base64(*"
) or
(process.executable like "/mnt/apps/jenkins/.pyenv/versions/*/bin/python*" and process.command_line like "*eNqVkm1*") or
(process.parent.executable like "/mnt/apps/jenkins/.pyenv/versions/*/bin/python*" and process.command_line like "*binascii,os,select,zlib;exec(zlib.decompress(binascii.a2b_base64*")
)
'''
min_endpoint_version = "7.15.0"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
[[actions]]
action = "kill_process"
field = "process.parent.entity_id"
state = 0
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1059"
name = "Command and Scripting Interpreter"
reference = "https://attack.mitre.org/techniques/T1059/"
[[threat.technique.subtechnique]]
id = "T1059.006"
name = "Python"
reference = "https://attack.mitre.org/techniques/T1059/006/"
[threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1027"
name = "Obfuscated Files or Information"
reference = "https://attack.mitre.org/techniques/T1027/"
[threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
[internal]
min_endpoint_version = "7.15.0"
Stages and Predicates
Stage 1: process
process where event.type == "start" and event.action == "exec" and (
(
process.name like ("python*", "py", "pypy*") and
process.args == "-c" and
process.command_line like~ (
"*base64*", "*b64decode*", "*b32decode*", "*b85decode*", "*a85decode*", "*binascii*", "*codecs.decode*", "*fromhex*",
"*zlib.decompress*", "*marshal.loads*", "*pickle.loads*", "*cPickle.loads*"
) and
process.command_line like~ (
"*exec(*", "*eval(*", "*__import__*", "*compile(*", "*types.FunctionType*", "*runpy*", "*importlib.util*", "*importlib.import_module*"
)
) or
(
process.parent.name like ("python*", "py", "pypy*") and
process.parent.command_line != null and
process.parent.args == "-c" and
process.parent.command_line like~ (
"*base64*", "*b64decode*", "*b32decode*", "*b85decode*", "*a85decode*", "*binascii*", "*codecs.decode*", "*fromhex*",
"*zlib.decompress*", "*marshal.loads*"
) and
process.parent.command_line like~ (
"*exec(*", "*eval(*", "*__import__*", "*compile(*", "*types.FunctionType*", "*runpy*",
"*importlib.util*", "*importlib.import_module*"
)
)
) and
not (
process.command_line like """*exec(zlib.decompress(base64.b64decode(b"eJxlU01v2zAMPUe/QvClEqYZTbCTAR1z6GFYD93JMwLXplsVtmRI9pyg6H8fKcVrmhz8IfLxkXwimRlG5yfuggonfObn0bsGAv6aF1v3KkAPzaTegrPs6eHn/tfvJ73d3TPWQscXEWTBNhiZh6l185Qv3kwgPIweXfwbz/7YTH5BdP0cXoVMBHCE5tAMbRD0Iq5RlxXbdM5zo9DGjeVg5wF8jbwraDP5E302VKz+LDp/dCNYgqmU7Yvv4XFPZvD+2sxlJMvrEcNbIYwiryQrHBsYJ76PH+MsrwOHmHshnNiquztk9QKkpAAP0+wtHxlbROahbk/Yf+OGobZtoN6Srnnd134QZ0Ulo4Z7Y4H6RQVRvaSYsTmRkEtlrbNAemL6lXEtme4n712NShIWK2HUQtAXCp9DsJyhPQz1qN8/WHfxF3SASaRakgJUTaTBjE6/Z6Y9ZoVRPCNjVtAbD0nqrCirdECBz4elNpOxL1mx+8A7jalKCjrPQqVduUZXNwCkWQHEiIBz3VcUt/YUSYQhn8eWJkdcxKgLHAm1vJoeOIKxS68O6qDT0OfpI9CjsJ2ykmkwuziVnoYA2UacMhfiLSEy75DLOiHV9n73gwbIdDyh4tCce+zaar255IwD2DiLcs3A8IA96bUvRLNN7MbD4P4C5pEJUv6XuPqutynbV3NxTRxXJmLiJRJzmOppDjrKQoFCptb0c5blb87Ejfq8qbgWuEQ33nhN5MXViDaal0qJxK9I+ii5jMtB04y78Q9tonhI")))""" or
process.parent.command_line like """*exec(zlib.decompress(base64.b64decode(b"eJxlU01v2zAMPUe/QvClEqYZTbCTAR1z6GFYD93JMwLXplsVtmRI9pyg6H8fKcVrmhz8IfLxkXwimRlG5yfuggonfObn0bsGAv6aF1v3KkAPzaTegrPs6eHn/tfvJ73d3TPWQscXEWTBNhiZh6l185Qv3kwgPIweXfwbz/7YTH5BdP0cXoVMBHCE5tAMbRD0Iq5RlxXbdM5zo9DGjeVg5wF8jbwraDP5E302VKz+LDp/dCNYgqmU7Yvv4XFPZvD+2sxlJMvrEcNbIYwiryQrHBsYJ76PH+MsrwOHmHshnNiquztk9QKkpAAP0+wtHxlbROahbk/Yf+OGobZtoN6Srnnd134QZ0Ulo4Z7Y4H6RQVRvaSYsTmRkEtlrbNAemL6lXEtme4n712NShIWK2HUQtAXCp9DsJyhPQz1qN8/WHfxF3SASaRakgJUTaTBjE6/Z6Y9ZoVRPCNjVtAbD0nqrCirdECBz4elNpOxL1mx+8A7jalKCjrPQqVduUZXNwCkWQHEiIBz3VcUt/YUSYQhn8eWJkdcxKgLHAm1vJoeOIKxS68O6qDT0OfpI9CjsJ2ykmkwuziVnoYA2UacMhfiLSEy75DLOiHV9n73gwbIdDyh4tCce+zaar255IwD2DiLcs3A8IA96bUvRLNN7MbD4P4C5pEJUv6XuPqutynbV3NxTRxXJmLiJRJzmOppDjrKQoFCptb0c5blb87Ejfq8qbgWuEQ33nhN5MXViDaal0qJxK9I+ii5jMtB04y78Q9tonhI")))""" or
process.parent.executable in (
"/usr/sbin/sshd", "/usr/bin/sudo", "/usr/lib/openssh/sshd-session", "/opt/teleport/system/bin/teleport",
"/usr/libexec/openssh/sshd-session", "/usr/bin/ansible-playbook", "/usr/bin/sort", "/usr/bin/du",
"/usr/sbin/ldconfig.real", "/usr/sbin/runuser"
) or
process.working_directory like ("/opt/zeek", "/var/lib/docker/overlay2/*/usr/local/zeek", "/usr/share/ansible") or
process.parent.args == "/usr/local/bin/ansible-playbook" or
process.parent.command_line like (
"*IyBweWxpbnQ6IGRpc2FibGU9cmVzb3VyY2UtbGVha2FnZQoiIiIKVGhpcyBpcyBhIHNoaW0gdGhh*",
"/usr/bin/python*-c import zlib,base64; exec(zlib.decompress(base64.b64decode(b*",
"*/usr/bin/python*-c import sys;sys.path=[p for p in sys.path if p];import binascii,os,zlib;exec(zlib.decompress(binascii.a2b_base64(*",
"*/.claude/*shell-snapshots/snapshot-*", "*source /tmp/hermes-snap-*"
) or
process.executable like (
"/home/*/.local/share/uv/python/cpython-*/bin/python*", "/home/*/miniconda3/envs/py312a/bin/python3*"
) or
process.parent.executable like (
"/home/*/.nvm/versions/node/*/lib/node_modules/@openai/codex/node_modules/@openai/codex-linux-x64/vendor/x86_64-unknown-linux-musl/bin/codex",
"/home/*/.vscode-server/extensions/*/bin/linux-x86_64/codex", "/home/*/miniconda3/envs/py312a/bin/python3*",
"/home/*/.local/share/uv/python/cpython-*/bin/python*", "*/.codex/packages/standalone/releases/*/bin/codex",
"*/.vscode-server/extensions/openai.chatgpt-*/bin/*/codex", "*/node_modules/opencode-ai/bin/opencode*"
) or
process.command_line like (
"*eNqVkl1PwjAUhu/5Fd61i2Os*",
"/usr/bin/python*-c import zlib,base64; exec(zlib.decompress(base64.b64decode(b*",
"*/usr/bin/python*-c import sys;sys.path=[p for p in sys.path if p];import binascii,os,zlib;exec(zlib.decompress(binascii.a2b_base64(*"
) or
(process.executable like "/mnt/apps/jenkins/.pyenv/versions/*/bin/python*" and process.command_line like "*eNqVkm1*") or
(process.parent.executable like "/mnt/apps/jenkins/.pyenv/versions/*/bin/python*" and process.command_line like "*binascii,os,select,zlib;exec(zlib.decompress(binascii.a2b_base64*")
)
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | eq |
| field:"EventType" kind:eq value:"exec" |
event.type | eq |
| field:"event.type" kind:eq value:"start" |
process.args | eq |
| field:"process.args" kind:eq value:"-c" |
process.command_line | wildcard |
| field:"CommandLine" kind:wildcard |
process.name | wildcard |
| field:"process_basename" kind:wildcard |
process.parent.args | eq |
| field:"process.parent.args" kind:eq value:"-c" |
process.parent.command_line | is_not_null | field:"ParentCommandLine" kind:is_not_null | |
process.parent.command_line | wildcard |
| field:"ParentCommandLine" kind:wildcard |
process.parent.name | wildcard |
| field:"parent_process_basename" kind:wildcard |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.command_line | match | binascii,os,select,zlib;exec(zlib.decompress(binascii.a2b_base64 | excludes:process.command_line field:"process.command_line" value:"binascii,os,select,zlib;exec(zlib.decompress(binascii.a2b_base64" |
process.parent.executable | wildcard | /mnt/apps/jenkins/.pyenv/versions/*/bin/python* | excludes:process.parent.executable field:"process.parent.executable" value:"/mnt/apps/jenkins/.pyenv/versions/*/bin/python*" |
process.command_line | match | eNqVkm1 | excludes:process.command_line field:"process.command_line" value:"eNqVkm1" |
process.executable | wildcard | /mnt/apps/jenkins/.pyenv/versions/*/bin/python* | excludes:process.executable field:"process.executable" value:"/mnt/apps/jenkins/.pyenv/versions/*/bin/python*" |
process.command_line | ends_with | exec(zlib.decompress(base64.b64decode(b"eJxlU01v2zAMPUe/QvClEqYZTbCTAR1z6GFYD93JMwLXplsVtmRI9pyg6H8fKcVrmhz8IfLxkXwimRlG5yfuggonfObn0bsGAv6aF1v3KkAPzaTegrPs6eHn/tfvJ73d3TPWQscXEWTBNhiZh6l185Qv3kwgPIweXfwbz/7YTH5BdP0cXoVMBHCE5tAMbRD0Iq5RlxXbdM5zo9DGjeVg5wF8jbwraDP5E302VKz+LDp/dCNYgqmU7Yvv4XFPZvD+2sxlJMvrEcNbIYwiryQrHBsYJ76PH+MsrwOHmHshnNiquztk9QKkpAAP0+wtHxlbROahbk/Yf+OGobZtoN6Srnnd134QZ0Ulo4Z7Y4H6RQVRvaSYsTmRkEtlrbNAemL6lXEtme4n712NShIWK2HUQtAXCp9DsJyhPQz1qN8/WHfxF3SASaRakgJUTaTBjE6/Z6Y9ZoVRPCNjVtAbD0nqrCirdECBz4elNpOxL1mx+8A7jalKCjrPQqVduUZXNwCkWQHEiIBz3VcUt/YUSYQhn8eWJkdcxKgLHAm1vJoeOIKxS68O6qDT0OfpI9CjsJ2ykmkwuziVnoYA2UacMhfiLSEy75DLOiHV9n73gwbIdDyh4tCce+zaar255IwD2DiLcs3A8IA96bUvRLNN7MbD4P4C5pEJUv6XuPqutynbV3NxTRxXJmLiJRJzmOppDjrKQoFCptb0c5blb87Ejfq8qbgWuEQ33nhN5MXViDaal0qJxK9I+ii5jMtB04y78Q9tonhI"))) | excludes:process.command_line |
process.command_line | wildcard | *eNqVkl1PwjAUhu/5Fd61i2Os*, /usr/bin/python*-c import zlib,base64; exec(zlib.decompress(base64.b64decode(b*, */usr/bin/python*-c import sys;sys.path=[p for p in sys.path if p];import binascii,os,zlib;exec(zlib.decompress(binascii.a2b_base64(* | excludes:process.command_line field:"process.command_line" value:"*eNqVkl1PwjAUhu/5Fd61i2Os*" field:"process.command_line" value:"/usr/bin/python*-c import zlib,base64; exec(zlib.decompress(base64.b64decode(b*" field:"process.command_line" value:"*/usr/bin/python*-c import sys;sys.path=[p for p in sys.path if p];import binascii,os,zlib;exec(zlib.decompress(binascii.a2b_base64(*" |
process.executable | wildcard | /home/*/.local/share/uv/python/cpython-*/bin/python*, /home/*/miniconda3/envs/py312a/bin/python3* | excludes:process.executable field:"process.executable" value:"/home/*/.local/share/uv/python/cpython-*/bin/python*" field:"process.executable" value:"/home/*/miniconda3/envs/py312a/bin/python3*" |
process.parent.args | eq | /usr/local/bin/ansible-playbook | excludes:process.parent.args field:"process.parent.args" value:"/usr/local/bin/ansible-playbook" |
process.parent.command_line | ends_with | exec(zlib.decompress(base64.b64decode(b"eJxlU01v2zAMPUe/QvClEqYZTbCTAR1z6GFYD93JMwLXplsVtmRI9pyg6H8fKcVrmhz8IfLxkXwimRlG5yfuggonfObn0bsGAv6aF1v3KkAPzaTegrPs6eHn/tfvJ73d3TPWQscXEWTBNhiZh6l185Qv3kwgPIweXfwbz/7YTH5BdP0cXoVMBHCE5tAMbRD0Iq5RlxXbdM5zo9DGjeVg5wF8jbwraDP5E302VKz+LDp/dCNYgqmU7Yvv4XFPZvD+2sxlJMvrEcNbIYwiryQrHBsYJ76PH+MsrwOHmHshnNiquztk9QKkpAAP0+wtHxlbROahbk/Yf+OGobZtoN6Srnnd134QZ0Ulo4Z7Y4H6RQVRvaSYsTmRkEtlrbNAemL6lXEtme4n712NShIWK2HUQtAXCp9DsJyhPQz1qN8/WHfxF3SASaRakgJUTaTBjE6/Z6Y9ZoVRPCNjVtAbD0nqrCirdECBz4elNpOxL1mx+8A7jalKCjrPQqVduUZXNwCkWQHEiIBz3VcUt/YUSYQhn8eWJkdcxKgLHAm1vJoeOIKxS68O6qDT0OfpI9CjsJ2ykmkwuziVnoYA2UacMhfiLSEy75DLOiHV9n73gwbIdDyh4tCce+zaar255IwD2DiLcs3A8IA96bUvRLNN7MbD4P4C5pEJUv6XuPqutynbV3NxTRxXJmLiJRJzmOppDjrKQoFCptb0c5blb87Ejfq8qbgWuEQ33nhN5MXViDaal0qJxK9I+ii5jMtB04y78Q9tonhI"))) | excludes:process.parent.command_line |
process.parent.command_line | wildcard | *IyBweWxpbnQ6IGRpc2FibGU9cmVzb3VyY2UtbGVha2FnZQoiIiIKVGhpcyBpcyBhIHNoaW0gdGhh*, /usr/bin/python*-c import zlib,base64; exec(zlib.decompress(base64.b64decode(b*, */usr/bin/python*-c import sys;sys.path=[p for p in sys.path if p];import binascii,os,zlib;exec(zlib.decompress(binascii.a2b_base64(*, */.claude/*shell-snapshots/snapshot-*, *source /tmp/hermes-snap-* | excludes:process.parent.command_line |
process.parent.executable | in | /opt/teleport/system/bin/teleport, /usr/bin/ansible-playbook, /usr/bin/du, /usr/bin/sort, /usr/bin/sudo, /usr/lib/openssh/sshd-session, /usr/libexec/openssh/sshd-session, /usr/sbin/ldconfig.real, /usr/sbin/runuser, /usr/sbin/sshd | excludes:process.parent.executable |
process.parent.executable | wildcard | /home/*/.nvm/versions/node/*/lib/node_modules/@openai/codex/node_modules/@openai/codex-linux-x64/vendor/x86_64-unknown-linux-musl/bin/codex, /home/*/.vscode-server/extensions/*/bin/linux-x86_64/codex, /home/*/miniconda3/envs/py312a/bin/python3*, /home/*/.local/share/uv/python/cpython-*/bin/python*, */.codex/packages/standalone/releases/*/bin/codex, */.vscode-server/extensions/openai.chatgpt-*/bin/*/codex, */node_modules/opencode-ai/bin/opencode* | excludes:process.parent.executable |
process.working_directory | wildcard | /opt/zeek, /var/lib/docker/overlay2/*/usr/local/zeek, /usr/share/ansible | excludes:process.working_directory field:"process.working_directory" value:"/opt/zeek" field:"process.working_directory" value:"/var/lib/docker/overlay2/*/usr/local/zeek" field:"process.working_directory" value:"/usr/share/ansible" |
Unbacked Shellcode from Unsigned Module
#Identifies attempt to allocate or execute Shellcode from a module with low or unknown reputation.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Stealth |
Rule Body
[rule]
description = "Identifies attempt to allocate or execute Shellcode from a module with low or unknown reputation."
id = "99d3049e-f4af-46a7-9406-33482955bec9"
license = "Elastic License v2"
name = "Unbacked Shellcode from Unsigned Module"
os_list = ["windows"]
reference = [
"https://www.elastic.co/security-labs/pikabot-i-choose-you",
"https://www.elastic.co/security-labs/spring-cleaning-with-latrodectus",
]
version = "1.0.14"
query = '''
api where
process.Ext.api.behaviors in ("shellcode", "allocate_shellcode", "execute_shellcode") and
process.thread.Ext.call_stack_final_user_module.hash.sha256 != null and
process.thread.Ext.call_stack_final_user_module.name == "Unbacked" and
process.thread.Ext.call_stack_final_user_module.protection_provenance_path != null and
process.thread.Ext.call_stack_summary in
("ntdll.dll|Unbacked",
"ntdll.dll|kernelbase.dll|Unbacked",
"ntdll.dll|kernelbase.dll|kernel32.dll|Unbacked",
"ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|Unbacked",
"ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|kernelbase.dll|Unbacked",
"ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|kernelbase.dll|Unbacked|kernel32.dll|ntdll.dll") and
_arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info like "Unbacked*" and $entry.callsite_trailing_bytes like "?*") and
_arraysearch(process.thread.Ext.call_stack_final_user_module.code_signature, $entry, $entry.status == "errorBadDigest" or $entry.exists == false) and
not process.thread.Ext.call_stack_final_user_module.protection_provenance_path like
("c:\\windows\\microsoft.net\\framework*\\clr.dll",
"c:\\program files (x86)\\adobe\\acrobat*\\acrobat\\acrobat.dll") and
not process.thread.Ext.call_stack_final_user_module.hash.sha256 in
("a8d979460e970e84eacce36b8a68ae5f6b9cc0fe16e05a6209b4ead52b81b021",
"c434208894f07f604b852f29b8edc3a58c4de63de783373733e72b2b73f33be9",
"cb79e99da5b41d61302c941ed1dbe8c5d354dc789b10d9ec69892b27900b7279",
"fdad52e85048040319faaa2cd1546346957f86343c4b89d30153edb7a8fd0b90",
"69310b1df649a25d78941704536805393e6b17e011e763e0e80e023baaccccd6",
"b5480453a6e4cac87a9ac05459dfe57f0a72e591afc19c0b5686a2de02c7c346",
"5d20266760e95e56b12705e69e58d09625b9c5e2e94b2f706cebaa275598446a",
"ed3730a3436454022e8cf1a27569babef8c9c348ea875f1df80cba9b743365c9",
"4077289062777cf8e60bd81a2efe1350eeb60301679b3c236863cae7b4d8cc5a",
"616217f667bd2dc9e27d066239f83b3f5554b0ff10edc002ee63e3fcf62cc5d8",
"60ebc86c2dd03056ad48adc6d2468fd54c548a55d2d305577eb7e079d90ac13f",
"3cd00f456f51829eda119e0e133acc1e45a5930d61fc335a2e9aa688a836a24d",
"97d97c37d51be172951ed8a98f6fa0c2b7a2c9df14a44d0abf971d73e46e9373",
"891113b49c9876f9e46d445ff0534e48573e0e518d53b7161a381664df32ba77",
"a3b4a357f5b068add25ea0b2ed8e566ab2e6f4359df83b18f525b54490ec3f28",
"2ffc321b0cb1f6b89fe09c597c94cd30e82f405cb982234d6383061b8ea6b12e",
"93f53280052d0f700259b42a62f8658d9b2a741b54063f277e9b83264448fb21",
"bd0e0a6f9e5e73cbd5637c6efada0efcc030ebb86a3a00df9dd03db1e7a533b7",
"fc48fcbdb74be72b6222883f11b59ab9f2e6019a6c6565d7de183a08e77df47f",
"430cb452335968804d57225c0e887bd2194ee1c55d160a6df2f62d0c326b47ee",
"898e78d91da372f9f5039601581b3aadf9e62a06dd005a2851ce20275780e4b1",
"0f7c82d426b124fb9a21cda05184e0860bc400dc354f9aaafb1c9af84b7363e2",
"67445d47d7e70e7b0f94b752f027e04a5453b5b14ea56c433660b27d016a734d",
"fdf036edcd2fc6997a6eeaac4b58e4b533cd6abdf15d18a53621832bff038be0",
"e3868e9daf4d9e34bf5b2f48bf5cab45e9b88e39cea578edb01cd96607eecf09",
"c5473c258cc2619ff88c16c9062f7feb29e66b3ecf205cf640b5abcaf316a487",
"27bb524de82dbab7461e09329afebb0361127494abb3782bbafdb9d9986df9c2",
"8f63c4fee17990a9988a6fc0a32635095226588e79cfcbbcbcb89afc021b7f71",
"38d155e2cac8c63774e1706307b29b1058c2479871c9331157370d67c53f0cbb",
"0738dc614d751b3b08125c03a920fc243a3e5eea4f16d3374d8d94a6e2454477",
"86699ebbcdbee712a4b798391b178a19ec18e0631bbc74875eda70af21b1da7e",
"3b283e5b05e232abab6e8144e3eb58ad456ad496d284e88f749cb8d6df2c0f62",
"a0d9f666f5e253031b5364c955c120b6b917749645b9e97bd8cc324597d450d4",
"4fd048ceaf8dff00bfb27851ea00d31d713ae72367e91bbf95607fac82fb8b38",
"de38e935cf249af5669d57ef9670ba4b9f324774fae9fd9cceb37b238305a155",
"11a970455d4536e4c4cdd655b864f5b01e7e8421b329196e0d878be2430cd20d",
"1b5d9cec668335295c8e575bcedf4afcedbc445d8ccf8374c9380188965e78e3",
"9becd39f90077a5ab064681c0a1be139d15be9ce434bacd48cd1dc894d3911cb",
"5438c19007ad96da0a969c0c0caaf00aa06375f1a6e85073f91a1392af94d059",
"86ccc87140479b5631c2e9c66b54739db1761d82449eba225064d91e99dcab16",
"462ddeb363a05574fc5e670a5f6e040ecdf6eaf3de6f5b495b1e11e105b1913b",
"152f3801c03c08bdbad67bab16d14c0fb118bf335e1ba215b096cc75a299f84f",
"aba42c861e070696ee85392586e5d6d7d7abcf8bba798ee6a571cc49c22201b6",
"00fe581520c7a22a461b3ce78cd5e48bcf05e2bb1c60f4e9e2b4cd81d0e07760",
"288bd8098f36110c8cc10c1508f1f23e0916bd36fad592f74518b7f3b06f3788",
"de15024667157e9d84dda0785332c22d69a87199798373ec3c9c2d1f3df650f5",
"59cc348f9711525abd54e88df810150e3a9a20910387427e208e4d74d5362027",
"1d1cfd19249c06adefa0ff104d3f5db7f48568993c540576ef1930210793c975",
"812b8169afda1309e677e8f1f1a7cca6a6bc7dd498d92167e157fc989fecc94b",
"04ab613c895b35044af8a9a98a372a5769c80245cc9d6bf710a94c5bc42fa1b3",
"2071a9a74867609405b218e98de8c3a7286c43b059932301516515ce887f7e35",
"16073f3361e91126909aab4ba7c50443d7b8ef070f523b7af2901d6385e99438",
"61ebd26043bfb155950d0d4b829f34e1ad6151b51bf9581e42acf621da1c1d86",
"67766e574baa86eb8317623acc2957e8e28944bb801a8c10a0fa9d29fdb4cfd3",
"a088cda2df4f3cc371c5aaa5e40d5ce771b07e3e0b9c6fe51aa3af797dc7cddb",
"fc0ea005db332feec00e6c34e36de85469d24074c8af23cea84b72eb0fa7fb85",
"f079a18c0abc9569429d402357e2daa4fe2af4cdbe3c002a5f05a70d33e7bffb",
"3a4ea2314b41a7720de2343602ef6268fa6bb660f3ee3633adc284e69ff1d83a",
"64fe90e25526f5b819b170c9ddcc593a7e65950f8e37c7da45d265cced3f2e73",
"a932fdd6f3a209a64eed1fa14d7b183850125b4840c9c227df390f5947dbda71",
"5c2a95e195f77fe20eb57e0a117835ea378aa0da2f4b4cc7cd73fe2722d69c47",
"16264a04dae64a04df2c049193d6d1811377b30aa02de69e186a791039eac36d",
"b152de9afc373bba831dc9c1b137668462ae6d46ccd46815f2ffcc7f1bfc7056",
"a87b3f02042de4d655f72af65ed5242fae5c675bebd19e962978c13e6d99ba00",
"2ea11e8b009bed581a6502d64d4d1a67c6046806c6c79a5195fa2d337b0d96b0",
"690c0be983bf27eb62428c93a534b66f3d11a8d6b30cb629425bd5a6f7232762",
"7acaa0e07d37cdd814408145b1d0f2137eaf068ff716eee09f39c8e4625550fb",
"18d1bae077da62bb5cf5bfa6a6c5c38ac9ade57f098ea2b357fab477e85f1c25",
"9ac13f9bc5564fd8a1eab5f7c945dce1c27940dd63a913108eac64481ddde6af",
"965162abde211f72c80062b1799eb4385d3e9322c4b38b8da9dc718a769570b7",
"d355b62cc7dc5b8f3ee5e95a8ddddc818f6f84c5a16799d78b1cb3d786e2bb80",
"765bf93c500ca73d73a5ba790f7c1675ff6ffdc7c54ee03dafca69ee701f5cfe",
"eee4d4620d56c8c0212437b184444e1fe74e29d6d018d69750e52b27e9eba46b",
"f939f09133e4a6a050e085adcdebadc92a45bd8696d75895ea520cfbd0167ebe",
"9d0a822bf161b9b2daf06d515ec1bb202150e87f6d938510d2f4bfcf9d06e14f",
"aa0e85beff0697474d0419349e9c1afb3bf711ffcd26a696dd2a1d192a90da36",
"d2cd65a4e6eb99acaf2f168bd650e6b3c91144d08f01b0b772de13dce28c7ce9",
/* Benign self-modifying commercial software (self-provenance, telemetry FP triage) */
"996129f8229e532dcbb93fcd5a704b707e97796fd55ad6382306ee03f58c8f95",
"6f2ee6f8f3240112ff6a861657228ba29144be11a281ad0517eab0f2a421eeb3",
"4a632d7a938585502452bc3afd328a7d598934bd56dcb13042ecd76f10743510",
"04f967d77dba69d8369218a2ae316c210749f0b1279ac563d8d281dea7b8c6e4") and
not process.thread.Ext.call_stack_final_user_module.protection_provenance in ("isrt.dll", "issetup.dll", "dbexpida.dll", "cyinjct.dll", "_isres.dll", "bass.dll") and
not (process.executable : "C:\\Windows\\SysWOW64\\msiexec.exe" and process.thread.Ext.call_stack_final_user_module.protection_provenance like ("msi*.tmp", "_isres.dll", "itcombo6.ocx")) and
not process.thread.Ext.call_stack_final_user_module.protection_provenance_path like
("c:\\windows\\installer\\msi*.tmp",
"c:\\windows\\assembly\\*",
"c:\\windows\\systemtemp\\msi*.tmp",
"c:\\program files\\*",
"c:\\program files (x86)\\*",
"c:\\windows\\microsoft.net\\*.dll") and
not (process.parent.executable : "D:\\nvt\\NvtServ.exe" and process.thread.Ext.call_stack_final_user_module.protection_provenance_path : "d:\\nvc\\bin\\*") and
not _arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info : "Unbacked*" and
$entry.callsite_trailing_bytes like ("5a8bf850528b338b432003c28b08894b208b431c03c28b08894b1c03f28b4b0c03ca8d431c505756ffd15a580343088bf8528bf08b46fc83c0042bf08956088b",
"89035e5bc39068008000006a008b0050a1dc6*", "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"8985271f*56e85301000090909090909090908b4e3485c90f848900000003")) and
not (process.Ext.api.name == "VirtualProtect" and _arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info like "*kernelbase.dll!LoadLibraryA*")) and
not (process.Ext.api.name == "VirtualAlloc" and process.Ext.api.parameters.size < 30 and
process.thread.Ext.call_stack_summary == "ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|kernelbase.dll|Unbacked") and
not (process.thread.Ext.call_stack_summary == "ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|kernelbase.dll|Unbacked" and
_arraysearch(process.thread.Ext.call_stack, $entry, $entry.callsite_trailing_bytes like "8985*90909090909090908b4e3485c90f848900000003"))
'''
min_endpoint_version = "8.14.2"
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
tree = true
[[optional_actions]]
action = "rollback"
field = "process.entity_id"
state = 0
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1055"
name = "Process Injection"
reference = "https://attack.mitre.org/techniques/T1055/"
[threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
[internal]
min_endpoint_version = "8.14.2"
Stages and Predicates
Stage 1: api
api where
process.Ext.api.behaviors in ("shellcode", "allocate_shellcode", "execute_shellcode") and
process.thread.Ext.call_stack_final_user_module.hash.sha256 != null and
process.thread.Ext.call_stack_final_user_module.name == "Unbacked" and
process.thread.Ext.call_stack_final_user_module.protection_provenance_path != null and
process.thread.Ext.call_stack_summary in
("ntdll.dll|Unbacked",
"ntdll.dll|kernelbase.dll|Unbacked",
"ntdll.dll|kernelbase.dll|kernel32.dll|Unbacked",
"ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|Unbacked",
"ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|kernelbase.dll|Unbacked",
"ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|kernelbase.dll|Unbacked|kernel32.dll|ntdll.dll") and
_arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info like "Unbacked*" and $entry.callsite_trailing_bytes like "?*") and
_arraysearch(process.thread.Ext.call_stack_final_user_module.code_signature, $entry, $entry.status == "errorBadDigest" or $entry.exists == false) and
not process.thread.Ext.call_stack_final_user_module.protection_provenance_path like
("c:\\windows\\microsoft.net\\framework*\\clr.dll",
"c:\\program files (x86)\\adobe\\acrobat*\\acrobat\\acrobat.dll") and
not process.thread.Ext.call_stack_final_user_module.hash.sha256 in
("a8d979460e970e84eacce36b8a68ae5f6b9cc0fe16e05a6209b4ead52b81b021",
"c434208894f07f604b852f29b8edc3a58c4de63de783373733e72b2b73f33be9",
"cb79e99da5b41d61302c941ed1dbe8c5d354dc789b10d9ec69892b27900b7279",
"fdad52e85048040319faaa2cd1546346957f86343c4b89d30153edb7a8fd0b90",
"69310b1df649a25d78941704536805393e6b17e011e763e0e80e023baaccccd6",
"b5480453a6e4cac87a9ac05459dfe57f0a72e591afc19c0b5686a2de02c7c346",
"5d20266760e95e56b12705e69e58d09625b9c5e2e94b2f706cebaa275598446a",
"ed3730a3436454022e8cf1a27569babef8c9c348ea875f1df80cba9b743365c9",
"4077289062777cf8e60bd81a2efe1350eeb60301679b3c236863cae7b4d8cc5a",
"616217f667bd2dc9e27d066239f83b3f5554b0ff10edc002ee63e3fcf62cc5d8",
"60ebc86c2dd03056ad48adc6d2468fd54c548a55d2d305577eb7e079d90ac13f",
"3cd00f456f51829eda119e0e133acc1e45a5930d61fc335a2e9aa688a836a24d",
"97d97c37d51be172951ed8a98f6fa0c2b7a2c9df14a44d0abf971d73e46e9373",
"891113b49c9876f9e46d445ff0534e48573e0e518d53b7161a381664df32ba77",
"a3b4a357f5b068add25ea0b2ed8e566ab2e6f4359df83b18f525b54490ec3f28",
"2ffc321b0cb1f6b89fe09c597c94cd30e82f405cb982234d6383061b8ea6b12e",
"93f53280052d0f700259b42a62f8658d9b2a741b54063f277e9b83264448fb21",
"bd0e0a6f9e5e73cbd5637c6efada0efcc030ebb86a3a00df9dd03db1e7a533b7",
"fc48fcbdb74be72b6222883f11b59ab9f2e6019a6c6565d7de183a08e77df47f",
"430cb452335968804d57225c0e887bd2194ee1c55d160a6df2f62d0c326b47ee",
"898e78d91da372f9f5039601581b3aadf9e62a06dd005a2851ce20275780e4b1",
"0f7c82d426b124fb9a21cda05184e0860bc400dc354f9aaafb1c9af84b7363e2",
"67445d47d7e70e7b0f94b752f027e04a5453b5b14ea56c433660b27d016a734d",
"fdf036edcd2fc6997a6eeaac4b58e4b533cd6abdf15d18a53621832bff038be0",
"e3868e9daf4d9e34bf5b2f48bf5cab45e9b88e39cea578edb01cd96607eecf09",
"c5473c258cc2619ff88c16c9062f7feb29e66b3ecf205cf640b5abcaf316a487",
"27bb524de82dbab7461e09329afebb0361127494abb3782bbafdb9d9986df9c2",
"8f63c4fee17990a9988a6fc0a32635095226588e79cfcbbcbcb89afc021b7f71",
"38d155e2cac8c63774e1706307b29b1058c2479871c9331157370d67c53f0cbb",
"0738dc614d751b3b08125c03a920fc243a3e5eea4f16d3374d8d94a6e2454477",
"86699ebbcdbee712a4b798391b178a19ec18e0631bbc74875eda70af21b1da7e",
"3b283e5b05e232abab6e8144e3eb58ad456ad496d284e88f749cb8d6df2c0f62",
"a0d9f666f5e253031b5364c955c120b6b917749645b9e97bd8cc324597d450d4",
"4fd048ceaf8dff00bfb27851ea00d31d713ae72367e91bbf95607fac82fb8b38",
"de38e935cf249af5669d57ef9670ba4b9f324774fae9fd9cceb37b238305a155",
"11a970455d4536e4c4cdd655b864f5b01e7e8421b329196e0d878be2430cd20d",
"1b5d9cec668335295c8e575bcedf4afcedbc445d8ccf8374c9380188965e78e3",
"9becd39f90077a5ab064681c0a1be139d15be9ce434bacd48cd1dc894d3911cb",
"5438c19007ad96da0a969c0c0caaf00aa06375f1a6e85073f91a1392af94d059",
"86ccc87140479b5631c2e9c66b54739db1761d82449eba225064d91e99dcab16",
"462ddeb363a05574fc5e670a5f6e040ecdf6eaf3de6f5b495b1e11e105b1913b",
"152f3801c03c08bdbad67bab16d14c0fb118bf335e1ba215b096cc75a299f84f",
"aba42c861e070696ee85392586e5d6d7d7abcf8bba798ee6a571cc49c22201b6",
"00fe581520c7a22a461b3ce78cd5e48bcf05e2bb1c60f4e9e2b4cd81d0e07760",
"288bd8098f36110c8cc10c1508f1f23e0916bd36fad592f74518b7f3b06f3788",
"de15024667157e9d84dda0785332c22d69a87199798373ec3c9c2d1f3df650f5",
"59cc348f9711525abd54e88df810150e3a9a20910387427e208e4d74d5362027",
"1d1cfd19249c06adefa0ff104d3f5db7f48568993c540576ef1930210793c975",
"812b8169afda1309e677e8f1f1a7cca6a6bc7dd498d92167e157fc989fecc94b",
"04ab613c895b35044af8a9a98a372a5769c80245cc9d6bf710a94c5bc42fa1b3",
"2071a9a74867609405b218e98de8c3a7286c43b059932301516515ce887f7e35",
"16073f3361e91126909aab4ba7c50443d7b8ef070f523b7af2901d6385e99438",
"61ebd26043bfb155950d0d4b829f34e1ad6151b51bf9581e42acf621da1c1d86",
"67766e574baa86eb8317623acc2957e8e28944bb801a8c10a0fa9d29fdb4cfd3",
"a088cda2df4f3cc371c5aaa5e40d5ce771b07e3e0b9c6fe51aa3af797dc7cddb",
"fc0ea005db332feec00e6c34e36de85469d24074c8af23cea84b72eb0fa7fb85",
"f079a18c0abc9569429d402357e2daa4fe2af4cdbe3c002a5f05a70d33e7bffb",
"3a4ea2314b41a7720de2343602ef6268fa6bb660f3ee3633adc284e69ff1d83a",
"64fe90e25526f5b819b170c9ddcc593a7e65950f8e37c7da45d265cced3f2e73",
"a932fdd6f3a209a64eed1fa14d7b183850125b4840c9c227df390f5947dbda71",
"5c2a95e195f77fe20eb57e0a117835ea378aa0da2f4b4cc7cd73fe2722d69c47",
"16264a04dae64a04df2c049193d6d1811377b30aa02de69e186a791039eac36d",
"b152de9afc373bba831dc9c1b137668462ae6d46ccd46815f2ffcc7f1bfc7056",
"a87b3f02042de4d655f72af65ed5242fae5c675bebd19e962978c13e6d99ba00",
"2ea11e8b009bed581a6502d64d4d1a67c6046806c6c79a5195fa2d337b0d96b0",
"690c0be983bf27eb62428c93a534b66f3d11a8d6b30cb629425bd5a6f7232762",
"7acaa0e07d37cdd814408145b1d0f2137eaf068ff716eee09f39c8e4625550fb",
"18d1bae077da62bb5cf5bfa6a6c5c38ac9ade57f098ea2b357fab477e85f1c25",
"9ac13f9bc5564fd8a1eab5f7c945dce1c27940dd63a913108eac64481ddde6af",
"965162abde211f72c80062b1799eb4385d3e9322c4b38b8da9dc718a769570b7",
"d355b62cc7dc5b8f3ee5e95a8ddddc818f6f84c5a16799d78b1cb3d786e2bb80",
"765bf93c500ca73d73a5ba790f7c1675ff6ffdc7c54ee03dafca69ee701f5cfe",
"eee4d4620d56c8c0212437b184444e1fe74e29d6d018d69750e52b27e9eba46b",
"f939f09133e4a6a050e085adcdebadc92a45bd8696d75895ea520cfbd0167ebe",
"9d0a822bf161b9b2daf06d515ec1bb202150e87f6d938510d2f4bfcf9d06e14f",
"aa0e85beff0697474d0419349e9c1afb3bf711ffcd26a696dd2a1d192a90da36",
"d2cd65a4e6eb99acaf2f168bd650e6b3c91144d08f01b0b772de13dce28c7ce9",
"996129f8229e532dcbb93fcd5a704b707e97796fd55ad6382306ee03f58c8f95",
"6f2ee6f8f3240112ff6a861657228ba29144be11a281ad0517eab0f2a421eeb3",
"4a632d7a938585502452bc3afd328a7d598934bd56dcb13042ecd76f10743510",
"04f967d77dba69d8369218a2ae316c210749f0b1279ac563d8d281dea7b8c6e4") and
not process.thread.Ext.call_stack_final_user_module.protection_provenance in ("isrt.dll", "issetup.dll", "dbexpida.dll", "cyinjct.dll", "_isres.dll", "bass.dll") and
not (process.executable : "C:\\Windows\\SysWOW64\\msiexec.exe" and process.thread.Ext.call_stack_final_user_module.protection_provenance like ("msi*.tmp", "_isres.dll", "itcombo6.ocx")) and
not process.thread.Ext.call_stack_final_user_module.protection_provenance_path like
("c:\\windows\\installer\\msi*.tmp",
"c:\\windows\\assembly\\*",
"c:\\windows\\systemtemp\\msi*.tmp",
"c:\\program files\\*",
"c:\\program files (x86)\\*",
"c:\\windows\\microsoft.net\\*.dll") and
not (process.parent.executable : "D:\\nvt\\NvtServ.exe" and process.thread.Ext.call_stack_final_user_module.protection_provenance_path : "d:\\nvc\\bin\\*") and
not _arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info : "Unbacked*" and
$entry.callsite_trailing_bytes like ("5a8bf850528b338b432003c28b08894b208b431c03c28b08894b1c03f28b4b0c03ca8d431c505756ffd15a580343088bf8528bf08b46fc83c0042bf08956088b",
"89035e5bc39068008000006a008b0050a1dc6*", "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"8985271f*56e85301000090909090909090908b4e3485c90f848900000003")) and
not (process.Ext.api.name == "VirtualProtect" and _arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info like "*kernelbase.dll!LoadLibraryA*")) and
not (process.Ext.api.name == "VirtualAlloc" and process.Ext.api.parameters.size < 30 and
process.thread.Ext.call_stack_summary == "ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|kernelbase.dll|Unbacked") and
not (process.thread.Ext.call_stack_summary == "ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|kernelbase.dll|Unbacked" and
_arraysearch(process.thread.Ext.call_stack, $entry, $entry.callsite_trailing_bytes like "8985*90909090909090908b4e3485c90f848900000003"))
Indicators
These rows show field, operator, and value matches.
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.thread.Ext.call_stack | array_any | excludes:process.thread.Ext.call_stack | |
process.thread.Ext.call_stack_summary | eq | ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|kernelbase.dll|Unbacked | excludes:process.thread.Ext.call_stack_summary field:"process.thread.Ext.call_stack_summary" value:"ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|kernelbase.dll|Unbacked" |
process.Ext.api.name | eq | VirtualProtect | excludes:process.Ext.api.name field:"process.Ext.api.name" value:"VirtualProtect" |
process.Ext.api.name | eq | VirtualAlloc | excludes:process.Ext.api.name field:"process.Ext.api.name" value:"VirtualAlloc" |
process.Ext.api.parameters.size | lt | 30 | excludes:process.Ext.api.parameters.size field:"process.Ext.api.parameters.size" value:"30" |
process.executable | eq | C:\Windows\SysWOW64\msiexec.exe | excludes:process.executable field:"process.executable" value:"C:\Windows\SysWOW64\msiexec.exe" |
process.thread.Ext.call_stack_final_user_module.protection_provenance | wildcard | msi*.tmp, _isres.dll, itcombo6.ocx | excludes:process.thread.Ext.call_stack_final_user_module.protection_provenance field:"process.thread.Ext.call_stack_final_user_module.protection_provenance" value:"msi*.tmp" field:"process.thread.Ext.call_stack_final_user_module.protection_provenance" value:"_isres.dll" field:"process.thread.Ext.call_stack_final_user_module.protection_provenance" value:"itcombo6.ocx" |
process.parent.executable | eq | D:\nvt\NvtServ.exe | excludes:process.parent.executable field:"process.parent.executable" value:"D:\nvt\NvtServ.exe" |
process.thread.Ext.call_stack_final_user_module.protection_provenance_path | starts_with | d:\nvc\bin\ | excludes:process.thread.Ext.call_stack_final_user_module.protection_provenance_path field:"process.thread.Ext.call_stack_final_user_module.protection_provenance_path" value:"d:\nvc\bin\" |
process.thread.Ext.call_stack_final_user_module.hash.sha256 | in | 00fe581520c7a22a461b3ce78cd5e48bcf05e2bb1c60f4e9e2b4cd81d0e07760, 04ab613c895b35044af8a9a98a372a5769c80245cc9d6bf710a94c5bc42fa1b3, 04f967d77dba69d8369218a2ae316c210749f0b1279ac563d8d281dea7b8c6e4, 0738dc614d751b3b08125c03a920fc243a3e5eea4f16d3374d8d94a6e2454477, 0f7c82d426b124fb9a21cda05184e0860bc400dc354f9aaafb1c9af84b7363e2, 11a970455d4536e4c4cdd655b864f5b01e7e8421b329196e0d878be2430cd20d, 152f3801c03c08bdbad67bab16d14c0fb118bf335e1ba215b096cc75a299f84f, 16073f3361e91126909aab4ba7c50443d7b8ef070f523b7af2901d6385e99438, 16264a04dae64a04df2c049193d6d1811377b30aa02de69e186a791039eac36d, 18d1bae077da62bb5cf5bfa6a6c5c38ac9ade57f098ea2b357fab477e85f1c25, 1b5d9cec668335295c8e575bcedf4afcedbc445d8ccf8374c9380188965e78e3, 1d1cfd19249c06adefa0ff104d3f5db7f48568993c540576ef1930210793c975, 2071a9a74867609405b218e98de8c3a7286c43b059932301516515ce887f7e35, 27bb524de82dbab7461e09329afebb0361127494abb3782bbafdb9d9986df9c2, 288bd8098f36110c8cc10c1508f1f23e0916bd36fad592f74518b7f3b06f3788, 2ea11e8b009bed581a6502d64d4d1a67c6046806c6c79a5195fa2d337b0d96b0, 2ffc321b0cb1f6b89fe09c597c94cd30e82f405cb982234d6383061b8ea6b12e, 38d155e2cac8c63774e1706307b29b1058c2479871c9331157370d67c53f0cbb, 3a4ea2314b41a7720de2343602ef6268fa6bb660f3ee3633adc284e69ff1d83a, 3b283e5b05e232abab6e8144e3eb58ad456ad496d284e88f749cb8d6df2c0f62, 3cd00f456f51829eda119e0e133acc1e45a5930d61fc335a2e9aa688a836a24d, 4077289062777cf8e60bd81a2efe1350eeb60301679b3c236863cae7b4d8cc5a, 430cb452335968804d57225c0e887bd2194ee1c55d160a6df2f62d0c326b47ee, 462ddeb363a05574fc5e670a5f6e040ecdf6eaf3de6f5b495b1e11e105b1913b, 4a632d7a938585502452bc3afd328a7d598934bd56dcb13042ecd76f10743510, 4fd048ceaf8dff00bfb27851ea00d31d713ae72367e91bbf95607fac82fb8b38, 5438c19007ad96da0a969c0c0caaf00aa06375f1a6e85073f91a1392af94d059, 59cc348f9711525abd54e88df810150e3a9a20910387427e208e4d74d5362027, 5c2a95e195f77fe20eb57e0a117835ea378aa0da2f4b4cc7cd73fe2722d69c47, 5d20266760e95e56b12705e69e58d09625b9c5e2e94b2f706cebaa275598446a, 60ebc86c2dd03056ad48adc6d2468fd54c548a55d2d305577eb7e079d90ac13f, 616217f667bd2dc9e27d066239f83b3f5554b0ff10edc002ee63e3fcf62cc5d8, 61ebd26043bfb155950d0d4b829f34e1ad6151b51bf9581e42acf621da1c1d86, 64fe90e25526f5b819b170c9ddcc593a7e65950f8e37c7da45d265cced3f2e73, 67445d47d7e70e7b0f94b752f027e04a5453b5b14ea56c433660b27d016a734d, 67766e574baa86eb8317623acc2957e8e28944bb801a8c10a0fa9d29fdb4cfd3, 690c0be983bf27eb62428c93a534b66f3d11a8d6b30cb629425bd5a6f7232762, 69310b1df649a25d78941704536805393e6b17e011e763e0e80e023baaccccd6, 6f2ee6f8f3240112ff6a861657228ba29144be11a281ad0517eab0f2a421eeb3, 765bf93c500ca73d73a5ba790f7c1675ff6ffdc7c54ee03dafca69ee701f5cfe, 7acaa0e07d37cdd814408145b1d0f2137eaf068ff716eee09f39c8e4625550fb, 812b8169afda1309e677e8f1f1a7cca6a6bc7dd498d92167e157fc989fecc94b, 86699ebbcdbee712a4b798391b178a19ec18e0631bbc74875eda70af21b1da7e, 86ccc87140479b5631c2e9c66b54739db1761d82449eba225064d91e99dcab16, 891113b49c9876f9e46d445ff0534e48573e0e518d53b7161a381664df32ba77, 898e78d91da372f9f5039601581b3aadf9e62a06dd005a2851ce20275780e4b1, 8f63c4fee17990a9988a6fc0a32635095226588e79cfcbbcbcb89afc021b7f71, 93f53280052d0f700259b42a62f8658d9b2a741b54063f277e9b83264448fb21, 965162abde211f72c80062b1799eb4385d3e9322c4b38b8da9dc718a769570b7, 97d97c37d51be172951ed8a98f6fa0c2b7a2c9df14a44d0abf971d73e46e9373, 996129f8229e532dcbb93fcd5a704b707e97796fd55ad6382306ee03f58c8f95, 9ac13f9bc5564fd8a1eab5f7c945dce1c27940dd63a913108eac64481ddde6af, 9becd39f90077a5ab064681c0a1be139d15be9ce434bacd48cd1dc894d3911cb, 9d0a822bf161b9b2daf06d515ec1bb202150e87f6d938510d2f4bfcf9d06e14f, a088cda2df4f3cc371c5aaa5e40d5ce771b07e3e0b9c6fe51aa3af797dc7cddb, a0d9f666f5e253031b5364c955c120b6b917749645b9e97bd8cc324597d450d4, a3b4a357f5b068add25ea0b2ed8e566ab2e6f4359df83b18f525b54490ec3f28, a87b3f02042de4d655f72af65ed5242fae5c675bebd19e962978c13e6d99ba00, a8d979460e970e84eacce36b8a68ae5f6b9cc0fe16e05a6209b4ead52b81b021, a932fdd6f3a209a64eed1fa14d7b183850125b4840c9c227df390f5947dbda71, aa0e85beff0697474d0419349e9c1afb3bf711ffcd26a696dd2a1d192a90da36, aba42c861e070696ee85392586e5d6d7d7abcf8bba798ee6a571cc49c22201b6, b152de9afc373bba831dc9c1b137668462ae6d46ccd46815f2ffcc7f1bfc7056, b5480453a6e4cac87a9ac05459dfe57f0a72e591afc19c0b5686a2de02c7c346, bd0e0a6f9e5e73cbd5637c6efada0efcc030ebb86a3a00df9dd03db1e7a533b7, c434208894f07f604b852f29b8edc3a58c4de63de783373733e72b2b73f33be9, c5473c258cc2619ff88c16c9062f7feb29e66b3ecf205cf640b5abcaf316a487, cb79e99da5b41d61302c941ed1dbe8c5d354dc789b10d9ec69892b27900b7279, d2cd65a4e6eb99acaf2f168bd650e6b3c91144d08f01b0b772de13dce28c7ce9, d355b62cc7dc5b8f3ee5e95a8ddddc818f6f84c5a16799d78b1cb3d786e2bb80, de15024667157e9d84dda0785332c22d69a87199798373ec3c9c2d1f3df650f5, de38e935cf249af5669d57ef9670ba4b9f324774fae9fd9cceb37b238305a155, e3868e9daf4d9e34bf5b2f48bf5cab45e9b88e39cea578edb01cd96607eecf09, ed3730a3436454022e8cf1a27569babef8c9c348ea875f1df80cba9b743365c9, eee4d4620d56c8c0212437b184444e1fe74e29d6d018d69750e52b27e9eba46b, f079a18c0abc9569429d402357e2daa4fe2af4cdbe3c002a5f05a70d33e7bffb, f939f09133e4a6a050e085adcdebadc92a45bd8696d75895ea520cfbd0167ebe, fc0ea005db332feec00e6c34e36de85469d24074c8af23cea84b72eb0fa7fb85, fc48fcbdb74be72b6222883f11b59ab9f2e6019a6c6565d7de183a08e77df47f, fdad52e85048040319faaa2cd1546346957f86343c4b89d30153edb7a8fd0b90, fdf036edcd2fc6997a6eeaac4b58e4b533cd6abdf15d18a53621832bff038be0 | excludes:process.thread.Ext.call_stack_final_user_module.hash.sha256 |
process.thread.Ext.call_stack_final_user_module.protection_provenance | in | _isres.dll, bass.dll, cyinjct.dll, dbexpida.dll, isrt.dll, issetup.dll | excludes:process.thread.Ext.call_stack_final_user_module.protection_provenance |
process.thread.Ext.call_stack_final_user_module.protection_provenance_path | wildcard | c:\windows\installer\msi*.tmp, c:\windows\assembly\*, c:\windows\systemtemp\msi*.tmp, c:\program files\*, c:\program files (x86)\*, c:\windows\microsoft.net\*.dll | excludes:process.thread.Ext.call_stack_final_user_module.protection_provenance_path |
process.thread.Ext.call_stack_final_user_module.protection_provenance_path | wildcard | c:\windows\microsoft.net\framework*\clr.dll, c:\program files (x86)\adobe\acrobat*\acrobat\acrobat.dll | excludes:process.thread.Ext.call_stack_final_user_module.protection_provenance_path field:"process.thread.Ext.call_stack_final_user_module.protection_provenance_path" value:"c:\windows\microsoft.net\framework*\clr.dll" field:"process.thread.Ext.call_stack_final_user_module.protection_provenance_path" value:"c:\program files (x86)\adobe\acrobat*\acrobat\acrobat.dll" |