Detection rules › Elastic

Elastic rules: 2s

RuleSeverity
AWS IAM User Console Login Without MFAmedium
AWS Lambda Function Created or Updatedlow
Cloud Credential Files Accessed by Osascript
Creation of Hidden Launch Agent or Daemonmedium
Direct Kubernetes API Request Detected via Defend for Containerslow
Elastic Defend Alert Followed by Telemetry Losshigh
Elastic Endpoint Security Kernel Extension Unload
Entra ID OAuth Device Code Grant by Microsoft Authentication Brokermedium
Executable File Creation via Base64
GKE Secrets List from Unusual Source AS Organizationhigh
Inhibit System Recovery via Renamed Utilities
Java Drop followed by network activity
Less Pipe Backdoor Execution
Linux Reverse Shell
Malicious Reputation of Executable Download
Node.js execution followed by network activity
Potential Kerberos Attack via Bifrosthigh
Potential Privilege Escalation via SUID/SGID Proxy Execution
Potential Remote File Execution via MSIEXEClow
Potential Reverse Shell via Childhigh
Potential UAC Bypass via IElevatedFactoryServer
Process Injection - Prevented - Elastic Endgamemedium
Pseudoterminal (PTY) Creation from Suspicious Executable
Regsvr32 with Unusual Arguments
RunDLL32/Regsvr32 Loads a DLL Downloaded via BITS
Security File Access via Common Utilitieslow
Sensitive Audit Policy Sub-Category Disabledmedium
Shell Script Execution from abnormal Volume Mount Path
Suspected Lateral Movement from Compromised Hosthigh
Suspicious CronTab Creation or Modificationmedium
Suspicious Print Spooler File Deletionmedium
Suspicious Process from FortiClient VPN Trace Script
Suspicious Shell Extension Handler Registry Modification
Suspicious Write Attempt to AppArmor Policy Management Filesmedium

AWS IAM User Console Login Without MFA

#
Status
production
Severity
medium
Time window
6m
Group by
user.id
Author
Elastic
Source
github.com/elastic/detection-rules

Identifies the first observed occurrence, within the configured New Terms history window, of a regular IAM user successfully signing in to the AWS Management Console without multi-factor authentication. A password alone is a weaker control than password-plus-MFA, and an adversary who has phished, guessed, or otherwise obtained a user's password can sign in directly if MFA is not enforced for that user. This rule is scoped to standard IAM users only; it excludes the AWS root user (covered by a dedicated rule) and federated/SSO sign-ins (covered by a dedicated rule that also accounts for IdP-side MFA), since MFAUsed: No is expected in both of those cases for reasons unrelated to this gap.

Known False Positives

  • Environments that do not enforce MFA for all IAM users will see this regularly. This is a New Terms rule, so it only fires once per `user.id` within the configured history window (7d); use it to drive MFA enrollment and enforcement rather than treating every occurrence as an incident, unless MFA is a mandated control in your environment.

MITRE ATT&CK Coverage

TacticTechniques
Initial Access

Telemetry Coverage

Rules Detecting the Same Action

These rules filter on the same operation.

Rule Body

[metadata]
creation_date = "2026/07/13"
integration = ["aws"]
maturity = "production"
updated_date = "2026/07/13"

[rule]
author = ["Elastic"]
description = """
Identifies the first observed occurrence, within the configured New Terms history window, of a regular IAM user 
successfully signing in to the AWS Management Console without multi-factor authentication. A password alone is a 
weaker control than password-plus-MFA, and an adversary who has phished, guessed, or otherwise obtained a user's 
password can sign in directly if MFA is not enforced for that user. This rule is scoped to standard IAM users 
only; it excludes the AWS root user (covered by a dedicated rule) and federated/SSO sign-ins (covered by a dedicated 
rule that also accounts for IdP-side MFA), since MFAUsed: No is expected in both of those cases for reasons unrelated 
to this gap.
"""
false_positives = [
    """
    Environments that do not enforce MFA for all IAM users will see this regularly. This is a New Terms rule, so it only
    fires once per `user.id` within the configured history window (7d); use it to drive MFA enrollment and enforcement rather than treating every occurrence as an
    incident, unless MFA is a mandated control in your environment.
    """,
]
from = "now-6m"
index = ["logs-aws.cloudtrail-*"]
language = "kuery"
license = "Elastic License v2"
name = "AWS IAM User Console Login Without MFA"
note = """## Triage and analysis

### Investigating AWS IAM User Console Login Without MFA

This rule identifies a standard IAM user (not root, not a federated/SSO sign-in) successfully signing in to the AWS
Management Console where CloudTrail's `additionalEventData.MFAUsed` field is `No`. A username and password are
comparatively easy for an adversary to obtain through phishing, credential stuffing, or password reuse; MFA is the
control that prevents a stolen password alone from granting console access.

This is a [New Terms](https://www.elastic.co/guide/en/security/current/rules-ui-create.html#create-new-terms-rule)
rule and fires the first time each `user.id` is observed signing in without MFA within the configured history window (7d).

### Possible investigation steps

- **Confirm MFA enrollment status**: check whether the user has an MFA device registered at all. If not, this may
  simply reflect that MFA is not yet enforced for this user rather than an active compromise.
- **Review source context**: check `source.ip`, `source.geo`, and `user_agent.original` for anomalies relative to the
  user's normal sign-in pattern.
- **Correlate with recent credential exposure**: check for recent password resets, phishing reports, or leaked
  credential alerts involving this user.
- **Review post-login activity**: examine what the user did in the console session immediately following sign-in for
  any unusual or high-privilege actions.

### False positive analysis

- Environments without a blanket MFA enforcement policy will see this for every user's first sign-in. Use this rule
  to drive MFA adoption; if MFA is not currently mandated, treat repeated occurrences as a posture gap rather than an
  incident, and consider excluding known-legacy or service-adjacent IAM users that cannot use MFA.

### Response and remediation

- If this sign-in is unexpected or the source is anomalous, treat the user's credentials as potentially compromised:
  force a password reset and review recent console/API activity for the account.
- Enforce MFA for all IAM users capable of console access, via IAM policy conditions (`aws:MultiFactorAuthPresent`) or
  an SCP, and prioritize enrolling any user identified by this rule.
- Consider moving console access to federated/SSO sign-in with IdP-enforced MFA rather than IAM user passwords.

"""
references = [
    "https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_mfa.html",
    "https://stratus-red-team.cloud/attack-techniques/AWS/aws.initial-access.console-login-without-mfa/",
]
risk_score = 47
rule_id = "f5778acd-80e3-4ca0-a32a-6259386dfb20"
severity = "medium"
tags = [
    "Domain: Cloud",
    "Data Source: AWS",
    "Data Source: Amazon Web Services",
    "Data Source: AWS Sign-In",
    "Use Case: Identity and Access Audit",
    "Tactic: Initial Access",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "new_terms"

query = '''
data_stream.dataset: "aws.cloudtrail"
    and event.provider: "signin.amazonaws.com"
    and event.action: "ConsoleLogin"
    and event.outcome: "success"
    and aws.cloudtrail.user_identity.type: "IAMUser"
    and aws.cloudtrail.console_login.additional_eventdata.mfa_used: false
'''


[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1078"
name = "Valid Accounts"
reference = "https://attack.mitre.org/techniques/T1078/"
[[rule.threat.technique.subtechnique]]
id = "T1078.004"
name = "Cloud Accounts"
reference = "https://attack.mitre.org/techniques/T1078/004/"



[rule.threat.tactic]
id = "TA0001"
name = "Initial Access"
reference = "https://attack.mitre.org/tactics/TA0001/"

[rule.investigation_fields]
field_names = [
    "@timestamp",
    "user.name",
    "user_agent.original",
    "source.ip",
    "source.geo.country_name",
    "aws.cloudtrail.user_identity.arn",
    "aws.cloudtrail.user_identity.type",
    "event.action",
    "event.outcome",
    "aws.cloudtrail.console_login.additional_eventdata.mfa_used",
    "cloud.account.id",
    "cloud.region",
]

[rule.new_terms]
field = "new_terms_fields"
value = ["user.id"]
[[rule.new_terms.history_window_start]]
field = "history_window_start"
value = "now-7d"


Stages and Predicates

Stage 1: new_terms

data_stream.dataset: "aws.cloudtrail"
    and event.provider: "signin.amazonaws.com"
    and event.action: "ConsoleLogin"
    and event.outcome: "success"
    and aws.cloudtrail.user_identity.type: "IAMUser"
    and aws.cloudtrail.console_login.additional_eventdata.mfa_used: false

Indicators

These rows show field, operator, and value matches.

AWS Lambda Function Created or Updated

#
Status
production
Kind
building block (feeds higher-level correlation rules; not a standalone alert)
Severity
low
Time window
1h
Author
Elastic
Source
github.com/elastic/detection-rules

Identifies when an AWS Lambda function is created or updated. AWS Lambda lets you run code without provisioning or managing servers. Adversaries can create or update Lambda functions to execute malicious code, exfiltrate data, or escalate privileges. This is a building block rule that does not generate alerts, but signals when a Lambda function is created or updated that matches the rule's conditions. To generate alerts, create a rule that uses this signal as a building block.

Known False Positives

  • Legitimate changes to Lambda functions can trigger this signal. Ensure that the changes are authorized and align with your organization's policies.

MITRE ATT&CK Coverage

TacticTechniques
Execution

Telemetry Coverage

Rules Detecting the Same Action

These rules filter on the same operation.

Rule Body

[metadata]
bypass_bbr_timing = true
creation_date = "2024/04/20"
integration = ["aws"]
maturity = "production"
updated_date = "2026/08/05"

[rule]
author = ["Elastic"]
building_block_type = "default"
description = """
Identifies when an AWS Lambda function is created or updated. AWS Lambda lets you run code without provisioning or
managing servers. Adversaries can create or update Lambda functions to execute malicious code, exfiltrate data, or
escalate privileges. This is a [building block
rule](https://www.elastic.co/guide/en/security/current/building-block-rule.html) that does not generate alerts, but
signals when a Lambda function is created or updated that matches the rule's conditions. To generate alerts, create a
rule that uses this signal as a building block.
"""
false_positives = [
    """
    Legitimate changes to Lambda functions can trigger this signal. Ensure that the changes are authorized and align
    with your organization's policies.
    """,
]
from = "now-60m"
index = ["filebeat-*", "logs-aws.cloudtrail-*"]
interval = "10m"
language = "kuery"
license = "Elastic License v2"
name = "AWS Lambda Function Created or Updated"
references = [
    "https://mattslifebytes.com/2023/04/14/from-rebuilds-to-reloads-hacking-aws-lambda-to-enable-instant-code-updates/",
    "https://stratus-red-team.cloud/attack-techniques/AWS/aws.persistence.lambda-overwrite-code/",
    "https://docs.aws.amazon.com/lambda/latest/api/API_UpdateFunctionCode.html",
]
risk_score = 21
rule_id = "1251b98a-ff45-11ee-89a1-f661ea17fbce"
severity = "low"
tags = [
    "Domain: Cloud",
    "Platform: AWS",
    "Data Source: AWS CloudTrail",
    "Service: AWS Lambda",
    "Tactic: Execution",
    "Rule Type: BBR",
]
timestamp_override = "event.ingested"
type = "query"

query = '''
event.dataset: "aws.cloudtrail"
    and event.provider: "lambda.amazonaws.com"
    and event.outcome: "success"
    and event.action: (CreateFunction* or UpdateFunctionCode*)
    and not user_agent.original: (*Terraform* or *Pulumi*)
'''


[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1648"
name = "Serverless Execution"
reference = "https://attack.mitre.org/techniques/T1648/"


[rule.threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"

Stages and Predicates

Stage 1: query

event.dataset: "aws.cloudtrail"
    and event.provider: "lambda.amazonaws.com"
    and event.outcome: "success"
    and event.action: (CreateFunction* or UpdateFunctionCode*)
    and not user_agent.original: (*Terraform* or *Pulumi*)

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actionwildcard
  • CreateFunction*
  • UpdateFunctionCode*
field:"EventType" kind:wildcard
event.dataseteq
  • aws.cloudtrail corpus 14 (elastic 14)
field:"event.dataset" kind:eq value:"aws.cloudtrail"
event.outcomeeq
  • success corpus 306 (elastic 306)
field:"event.outcome" kind:eq value:"success"
event.providereq
  • lambda.amazonaws.com corpus 7 (elastic 7)
field:"Provider_Name" kind:eq value:"lambda.amazonaws.com"

Exclusions

The rule actively suppresses these predicates.

Cloud Credential Files Accessed by Osascript

#
Source
github.com/elastic/protections-artifacts

Identifies the Osascript process accessing cloud credential and configuration files. Adversaries may attempt to access these files in order to gain access to sensitive data, laterally move or gain initial access into a cloud environment.

MITRE ATT&CK Coverage

Telemetry Coverage

Rule Body

[rule]
description = """
Identifies the Osascript process accessing cloud credential and configuration files. Adversaries may attempt to access
these files in order to gain access to sensitive data, laterally move or gain initial access into a cloud environment.
"""
id = "a8b16aed-8ba0-45e7-8a73-088a3017de28"
license = "Elastic License v2"
name = "Cloud Credential Files Accessed by Osascript"
os_list = ["macos"]
version = "1.0.5"

query = '''
file where event.action == "open" and 
 file.path like~ ("/Users/*/.aws/*", "/Users/*/.config/gcloud/credentials.db", "/Users/*/.azure/*") and 
 process.name == "osascript"
'''

min_endpoint_version = "8.11.1"
optional_actions = []
[[actions]]
action = "kill_process"
field = "Effective_process.executable"
state = 0

[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1552"
name = "Unsecured Credentials"
reference = "https://attack.mitre.org/techniques/T1552/"
[[threat.technique.subtechnique]]
id = "T1552.001"
name = "Credentials In Files"
reference = "https://attack.mitre.org/techniques/T1552/001/"



[threat.tactic]
id = "TA0006"
name = "Credential Access"
reference = "https://attack.mitre.org/tactics/TA0006/"

[internal]
min_endpoint_version = "8.11.1"

Stages and Predicates

Stage 1: file

file where event.action == "open" and 
 file.path like~ ("/Users/*/.aws/*", "/Users/*/.config/gcloud/credentials.db", "/Users/*/.azure/*") and 
 process.name == "osascript"

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • open corpus 49 (elastic 49)
field:"EventType" kind:eq value:"open"
file.pathwildcard
  • /Users/*/.aws/* corpus 2 (elastic 2)
  • /Users/*/.azure/* corpus 2 (elastic 2)
  • /Users/*/.config/gcloud/credentials.db corpus 2 (elastic 2)
field:"TargetFilename" kind:wildcard
process.nameeq
  • osascript corpus 41 (elastic 41)
field:"process_basename" kind:eq value:"osascript"

Creation of Hidden Launch Agent or Daemon

#
Status
production
Severity
medium
Time window
9m
Author
Elastic
Source
github.com/elastic/detection-rules

Identifies the creation of a hidden launch agent or daemon. An adversary may establish persistence by installing a new launch agent or daemon which executes at login.

MITRE ATT&CK Coverage

Rule Body

[metadata]
creation_date = "2020/01/05"
integration = ["endpoint"]
maturity = "production"
updated_date = "2026/03/24"

[rule]
author = ["Elastic"]
description = """
Identifies the creation of a hidden launch agent or daemon. An adversary may establish persistence by installing a new
launch agent or daemon which executes at login.
"""
from = "now-9m"
index = ["logs-endpoint.events.file*"]
language = "eql"
license = "Elastic License v2"
name = "Creation of Hidden Launch Agent or Daemon"
references = [
    "https://developer.apple.com/library/archive/documentation/MacOSX/Conceptual/BPSystemStartup/Chapters/CreatingLaunchdJobs.html",
]
risk_score = 47
rule_id = "092b068f-84ac-485d-8a55-7dd9e006715f"
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 macOS 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, for MacOS it is recommended to select "Traditional Endpoints".
- 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/current/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: macOS",
    "Use Case: Threat Detection",
    "Tactic: Persistence",
    "Tactic: Defense Evasion",
    "Data Source: Elastic Defend",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"

query = '''
file where host.os.type == "macos" and event.action == "launch_daemon" and
  Persistence.name : ".*"
'''
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 Creation of Hidden Launch Agent or Daemon

Launch agents and daemons in macOS are background services that start at login or system boot, respectively, to perform various tasks. Adversaries exploit this by creating hidden agents or daemons to maintain persistence and evade defenses. The detection rule identifies suspicious creation of these services by monitoring specific system paths for new entries, alerting analysts to potential unauthorized persistence mechanisms.

### Possible investigation steps

- Review the file path of the newly created launch agent or daemon to determine if it matches any known legitimate software installations or updates.
- Check the file creation timestamp to correlate with any recent user activities or system changes that might explain the creation of the file.
- Investigate the contents of the .plist file to identify the program or script it is set to execute, and assess whether it is a known or potentially malicious application.
- Examine the user account associated with the file path, especially if it is located in a user's Library directory, to determine if the user has a history of installing unauthorized software.
- Cross-reference the file path and associated executable with threat intelligence sources to identify any known indicators of compromise or malicious behavior.
- Look for any other recent file modifications or creations in the same directory that might indicate additional persistence mechanisms or related malicious activity.

### False positive analysis

- System or application updates may create or modify launch agents or daemons as part of legitimate processes. Users can monitor update schedules and correlate alerts with known update activities to verify legitimacy.
- Some third-party applications install launch agents or daemons to provide background services or updates. Users should maintain an inventory of installed applications and their expected behaviors to identify benign entries.
- User-created scripts or automation tools might use launch agents or daemons for personal productivity tasks. Users can document and exclude these known scripts from monitoring to reduce noise.
- Administrative tools or security software might create temporary launch agents or daemons during scans or system maintenance. Users should verify the source and purpose of these entries and consider excluding them if they are part of routine operations.
- Regularly review and update exclusion lists to ensure they reflect current system configurations and software installations, minimizing the risk of overlooking new threats.

### Response and remediation

- Immediately isolate the affected macOS system from the network to prevent potential lateral movement or data exfiltration by the adversary.
- Identify and terminate any suspicious processes associated with the newly created launch agent or daemon using Activity Monitor or command-line tools like `launchctl`.
- Remove the unauthorized launch agent or daemon by deleting the corresponding `.plist` file from the identified path. Ensure the file is not recreated by monitoring the directory for changes.
- Conduct a thorough review of user accounts and permissions on the affected system to ensure no unauthorized accounts or privilege escalations have occurred.
- Restore the system from a known good backup if the integrity of the system is in question and further compromise is suspected.
- Escalate the incident to the security operations team for a deeper forensic analysis to determine the root cause and scope of the intrusion.
- Update and enhance endpoint detection and response (EDR) solutions to improve monitoring and alerting for similar persistence mechanisms in the future."""


[[rule.threat]]
framework = "MITRE ATT&CK"

[[rule.threat.technique]]
id = "T1543"
name = "Create or Modify System Process"
reference = "https://attack.mitre.org/techniques/T1543/"

[[rule.threat.technique.subtechnique]]
id = "T1543.001"
name = "Launch Agent"
reference = "https://attack.mitre.org/techniques/T1543/001/"

[[rule.threat.technique.subtechnique]]
id = "T1543.004"
name = "Launch Daemon"
reference = "https://attack.mitre.org/techniques/T1543/004/"

[rule.threat.tactic]
id = "TA0003"
name = "Persistence"
reference = "https://attack.mitre.org/tactics/TA0003/"

[[rule.threat]]
framework = "MITRE ATT&CK"

[[rule.threat.technique]]
id = "T1564"
name = "Hide Artifacts"
reference = "https://attack.mitre.org/techniques/T1564/"

[[rule.threat.technique.subtechnique]]
id = "T1564.001"
name = "Hidden Files and Directories"
reference = "https://attack.mitre.org/techniques/T1564/001/"

[rule.threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"

Stages and Predicates

Stage 1: file

file where host.os.type == "macos" and event.action == "launch_daemon" and
  Persistence.name : ".*"

Indicators

These rows show field, operator, and value matches.

Direct Kubernetes API Request Detected via Defend for Containers

#
Status
production
Severity
low
Time window
6m
Author
Elastic
Source
github.com/elastic/detection-rules

This rule detects the execution of direct Kubernetes API requests inside a container. An adversary may need to execute direct Kubernetes API requests to gain access to the Kubernetes API server or other resources within the cluster. These requests are often used to enumerate the Kubernetes API server or other resources within the cluster, and may indicate an attempt to move laterally within the cluster. Note that this rule may not trigger if the token is expanded within the process argument list, as the length of the "process.args" field may lead to the field being ignored.

Known False Positives

  • There is a potential for false positives if direct Kubernetes API requests are used for legitimate purposes, such as debugging or troubleshooting. It is important to investigate any alerts generated by this rule to determine if they are indicative of malicious activity or part of legitimate container activity.

MITRE ATT&CK Coverage

Rule Body

[metadata]
creation_date = "2026/01/21"
integration = ["cloud_defend"]
maturity = "production"
min_stack_comments = "Defend for Containers integration was re-introduced in 9.3.0"
min_stack_version = "9.3.0"
updated_date = "2026/07/29"

[rule]
author = ["Elastic"]
description = """
This rule detects the execution of direct Kubernetes API requests inside a container. An adversary may
need to execute direct Kubernetes API requests to gain access to the Kubernetes API server or other resources
within the cluster. These requests are often used to enumerate the Kubernetes API server or other resources within the
cluster, and may indicate an attempt to move laterally within the cluster. Note that this rule may not trigger if the
token is expanded within the process argument list, as the length of the "process.args" field may lead to the field being
ignored.
"""
false_positives = [
    """
    There is a potential for false positives if direct Kubernetes API requests are used for legitimate purposes,
    such as debugging or troubleshooting. It is important to investigate any alerts generated by this rule to determine
    if they are indicative of malicious activity or part of legitimate container activity.
    """,
]
from = "now-6m"
index = ["logs-cloud_defend.process*"]
interval = "5m"
language = "eql"
license = "Elastic License v2"
name = "Direct Kubernetes API Request Detected via Defend for Containers"
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 Direct Kubernetes API Request Detected via Defend for Containers

The rule flags use of curl, wget, openssl, busybox ssl_client, socat/ncat, or kubectl from inside a container to call the Kubernetes API with a bearer token, often with custom CA or insecure TLS options. An operator enumerates cluster resources and tests access with in-pod credentials, enabling lateral movement or privilege escalation; after landing in a pod, they read the service account token and query the API to list namespaces, pods, or secrets, or issue kubectl get/patch to probe or modify workloads.

### Possible investigation steps

- Map the container ID to its pod, namespace, node, image, and owning controller, and confirm whether this workload is expected to make direct Kubernetes API calls or allow interactive access.
- Determine how the interactive session was initiated and by whom by correlating with Kubernetes events and audit logs for exec/attach/ephemeral-container activity and runtime logs for TTY sessions, including the initiating principal and source IP.
- Correlate with API server audit logs to retrieve the exact requests (verbs, resources, namespaces), the authenticated subject (service account or user), and response codes to identify any successful access to sensitive resources like Secrets or workload-modifying actions.
- Inspect the pod for credential use and operator traces by checking recent process activity, shell history, environment variables, and access to service account token or kubeconfig files at expected mount paths.
- Assess scope and potential persistence by listing recent cluster objects created or modified by the same identity across namespaces (Pods, CronJobs, RoleBindings, Secrets) within the timeframe around the alert.

### False positive analysis

- An administrator used kubectl interactively within a maintenance container to run get/list/patch commands during routine operations such as inspecting pods or updating labels, which matches expected administrative behavior.
- A developer ran openssl s_client, socat with SSL, or ncat --ssl interactively from within the container to troubleshoot TLS connectivity to a service endpoint, not the Kubernetes API server, causing the rule to fire despite benign intent.

### Response and remediation

- Immediately delete the affected pod to terminate interactive access, and apply a temporary NetworkPolicy in its namespace that blocks egress to the default/kubernetes service (API server) while you patch its ServiceAccount to set automountServiceAccountToken: false.
- Use API server audit logs and kubectl to enumerate actions taken by the pod’s ServiceAccount and revert any unauthorized objects it created or modified (Pods, CronJobs, RoleBindings, Secrets), and remove any attached ephemeral containers across the namespace.
- Rotate credentials and restore workloads by deleting any legacy ServiceAccount token Secret, restarting pods to issue new bound tokens, rebuilding the image from a trusted base, and redeploying with read-only rootfs and minimal RBAC verified via kubectl auth can-i.
- Escalate to incident response if audit logs show Secrets access or create/patch/update on workloads, if the ServiceAccount holds cluster-admin, or if the observed commands used curl -k/--insecure, wget --no-check-certificate, or openssl/socat/ncat with SSL to the API server.
- Harden the cluster by enforcing admission controls that deny kubectl exec/attach for non-admins, requiring automountServiceAccountToken: false by default and short-lived bound tokens where needed, restricting NetworkPolicies so only designated controllers can reach the API server, and adopting distroless images that omit curl/wget/openssl/ncat.
"""
risk_score = 21
rule_id = "26a989d2-010e-4dae-b46b-689d03cc22b3"
severity = "low"
tags = [
    "Data Source: Elastic Defend for Containers",
    "Domain: Container",
    "OS: Linux",
    "Use Case: Threat Detection",
    "Tactic: Execution",
    "Tactic: Discovery",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
process where host.os.type == "linux" and event.type == "start" and event.action == "exec" and (
  (
    process.name == "curl" and
    process.args in ("-H", "--header") and
    process.args like "*Authorization: Bearer *" and
    (
      /* CA-specified */
      process.args in ("--cacert", "--capath") or
      /* insecure */
      process.args in ("-k", "--insecure")
    )
  ) or
  (
    process.name == "wget" and
    process.args like "--header*" and
    process.args like "*Authorization: Bearer *" and
    (
      /* CA-specified */
      process.args == "--ca-certificate" or
      /* insecure */
      process.args == "--no-check-certificate"
    )
  ) or
  (
    /* Account for tools that execute utilities as a subprocess, in this case the target utility name will appear as a process arg */
    process.name in ("bash", "dash", "sh", "tcsh", "csh", "zsh", "ksh", "fish", "busybox") and
    process.args in ("wget", "/bin/wget", "/usr/bin/wget", "/usr/local/bin/wget") and
    process.args like "--header*" and
    process.args like "*Authorization: Bearer*" and
    process.args == "--no-check-certificate"
  ) or
  (
    /* ssl_client is busybox-specific, so we need to handle it separately */
    process.name == "busybox" and
    process.args == "ssl_client" and
    process.args like "*Authorization: Bearer*"
  ) or
  (process.name == "openssl" and process.args == "s_client" and process.args == "-connect") or
  (process.name == "socat" and process.args like~ "*ssl*") or
  (process.name == "ncat" and process.args like "--ssl*") or
  (process.name == "kubectl" and process.args in ("get", "list", "watch", "create", "patch", "update"))
) and
container.id like "*"
'''

[[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.technique]]
id = "T1609"
name = "Container Administration Command"
reference = "https://attack.mitre.org/techniques/T1609/"

[rule.threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"

[[rule.threat]]
framework = "MITRE ATT&CK"

[[rule.threat.technique]]
id = "T1613"
name = "Container and Resource Discovery"
reference = "https://attack.mitre.org/techniques/T1613/"

[rule.threat.tactic]
id = "TA0007"
name = "Discovery"
reference = "https://attack.mitre.org/tactics/TA0007/"

[[rule.threat]]
framework = "MITRE ATT&CK"

[[rule.threat.technique]]
id = "T1550"
name = "Use Alternate Authentication Material"
reference = "https://attack.mitre.org/techniques/T1550/"

[[rule.threat.technique.subtechnique]]
id = "T1550.001"
name = "Application Access Token"
reference = "https://attack.mitre.org/techniques/T1550/001/"

[rule.threat.tactic]
id = "TA0008"
name = "Lateral Movement"
reference = "https://attack.mitre.org/tactics/TA0008/"

Stages and Predicates

Stage 1: process

process where host.os.type == "linux" and event.type == "start" and event.action == "exec" and (
  (
    process.name == "curl" and
    process.args in ("-H", "--header") and
    process.args like "*Authorization: Bearer *" and
    (
      process.args in ("--cacert", "--capath") or
      process.args in ("-k", "--insecure")
    )
  ) or
  (
    process.name == "wget" and
    process.args like "--header*" and
    process.args like "*Authorization: Bearer *" and
    (
      process.args == "--ca-certificate" or
      process.args == "--no-check-certificate"
    )
  ) or
  (
    process.name in ("bash", "dash", "sh", "tcsh", "csh", "zsh", "ksh", "fish", "busybox") and
    process.args in ("wget", "/bin/wget", "/usr/bin/wget", "/usr/local/bin/wget") and
    process.args like "--header*" and
    process.args like "*Authorization: Bearer*" and
    process.args == "--no-check-certificate"
  ) or
  (
    process.name == "busybox" and
    process.args == "ssl_client" and
    process.args like "*Authorization: Bearer*"
  ) or
  (process.name == "openssl" and process.args == "s_client" and process.args == "-connect") or
  (process.name == "socat" and process.args like~ "*ssl*") or
  (process.name == "ncat" and process.args like "--ssl*") or
  (process.name == "kubectl" and process.args in ("get", "list", "watch", "create", "patch", "update"))
) and
container.id like "*"

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
container.idwildcard
  • *
field:"container.id" kind:wildcard value:"*"
event.actioneq
  • exec
field:"EventType" kind:eq value:"exec"
event.typeeq
  • start
field:"event.type" kind:eq value:"start"
process.argseq
  • --ca-certificate
  • --no-check-certificate
  • -connect
  • s_client
  • ssl_client
field:"process.args" kind:eq
process.argsin
  • --cacert
  • --capath
  • --header
  • --insecure
  • -H
  • -k
  • /bin/wget
  • /usr/bin/wget
  • /usr/local/bin/wget
  • create
  • get
  • list
  • patch
  • update
  • watch
  • wget
field:"process.args" kind:in
process.argswildcard
  • *Authorization: Bearer *
  • *Authorization: Bearer*
  • *ssl*
  • --header*
  • --ssl*
field:"process.args" kind:wildcard
process.nameeq
  • busybox
  • curl
  • kubectl
  • ncat
  • openssl
  • socat
  • wget
field:"process_basename" kind:eq
process.namein
  • bash
  • busybox
  • csh
  • dash
  • fish
  • ksh
  • sh
  • tcsh
  • zsh
field:"process_basename" kind:in

Elastic Defend Alert Followed by Telemetry Loss

#
Status
production
Severity
high
Time window
10m
Sequence by
host.id
Author
Elastic
Source
github.com/elastic/detection-rules

Detects when an Elastic Defend endpoint alert is generated on a host and is not followed by any subsequent endpoint telemetry (process, network, registry, library, or DNS events) within a short time window. This behavior may indicate endpoint security evasion, agent tampering, sensor disablement, service termination, system crash, or malicious interference with telemetry collection following detection.

Known False Positives

  • Misconfiguration, system reboot, network issues or expected uninstall of the Elastic Defend agent.

MITRE ATT&CK Coverage

Rule Body

[metadata]
creation_date = "2026/02/10"
integration = ["endpoint"]
maturity = "production"
updated_date = "2026/08/27"

[rule]
author = ["Elastic"]
description = """
Detects when an Elastic Defend endpoint alert is generated on a host and is not followed by any subsequent endpoint
telemetry (process, network, registry, library, or DNS events) within a short time window. This behavior may indicate
endpoint security evasion, agent tampering, sensor disablement, service termination, system crash, or malicious
interference with telemetry collection following detection.
"""
false_positives = ["Misconfiguration, system reboot, network issues or expected uninstall of the Elastic Defend agent."]
from = "now-14m"
index = ["logs-endpoint.*"]
language = "eql"
license = "Elastic License v2"
name = "Elastic Defend Alert Followed by Telemetry Loss"
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 Elastic Defend Alert Followed by Telemetry Loss

This rule identifies situations where an Elastic Defend alert is generated on a host and is not followed by
any normal endpoint activity events within a short time window. This may indicate agent tampering, sensor
disablement, host shutdown, system crash, or defense evasion behavior.

### Possible investigation steps

- Review the original `endpoint.alert` event and identify the detection that triggered the alert.
- Check the host’s online status, uptime, and reboot history.
- Verify the health and status of the Elastic Defend agent and related services.
- Look for evidence of agent tampering, service stops, or security control modifications.
- Correlate with activity immediately preceding the alert for signs of exploitation or evasion.
- Determine if similar alert → silence patterns are occurring on other hosts.

### False positive analysis

- Legitimate system reboots or shutdowns
- Network connectivity loss
- Elastic Agent upgrades or restarts
- Endpoint service crashes
- Maintenance or IT operations

### Response and remediation

- Validate host and agent availability.
- Reconnect or re-enroll the agent if telemetry is missing.
- Isolate the host if malicious activity is suspected.
- Investigate for security control tampering.
- Perform broader environment hunting for similar patterns.
"""
references = ["https://attack.mitre.org/techniques/T1562/001/"]
risk_score = 73
rule_id = "fc552f49-8f1c-409b-90f8-6f5b9869b6c4"
severity = "high"
tags = [
    "Domain: Endpoint",
    "Data Source: Elastic Defend",
    "Use Case: Threat Detection",
    "Tactic: Defense Evasion",
    "Tactic: Execution",
    "Rule Type: Higher-Order Rule",
    "Resources: Investigation Guide",
]
type = "eql"

query = '''
sequence by host.id with maxspan=10m
 [any where data_stream.dataset == "endpoint.alerts"]
 ![any where event.category in ("process", "library", "registry", "network", "dns", "file")]
'''

[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1562"
name = "Impair Defenses"
reference = "https://attack.mitre.org/techniques/T1562/"
[[rule.threat.technique.subtechnique]]
id = "T1562.001"
name = "Disable or Modify Tools"
reference = "https://attack.mitre.org/techniques/T1562/001/"



[rule.threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"


[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1204"
name = "User Execution"
reference = "https://attack.mitre.org/techniques/T1204/"
[[rule.threat.technique.subtechnique]]
id = "T1204.002"
name = "Malicious File"
reference = "https://attack.mitre.org/techniques/T1204/002/"



[rule.threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"

Stages and Predicates

Ordered sequence: each step below must occur in order within 10m, correlated by host.id.

Stage 1: any

[any where data_stream.dataset == "endpoint.alerts"]

Stage 2: any (negated)

![any where event.category in ("process", "library", "registry", "network", "dns", "file")]

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
data_stream.dataseteq
  • endpoint.alerts corpus 6 (elastic 6)
field:"data_stream.dataset" kind:eq value:"endpoint.alerts"

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
event.categoryindns, file, library, network, process, registryexcludes:event.category

Elastic Endpoint Security Kernel Extension Unload

#
Source
github.com/elastic/protections-artifacts

Identifies attempts to unload the Elastic Endpoint Security kernel extension via the kextunload command.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = "Identifies attempts to unload the Elastic Endpoint Security kernel extension via the kextunload command."
id = "a412fd9b-2a06-49ff-a073-8eb313c2d930"
license = "Elastic License v2"
name = "Elastic Endpoint Security Kernel Extension Unload"
os_list = ["macos"]
version = "1.0.30"

query = '''
process where event.type == "start" and
 process.name == "kextunload" and process.args like~ ("*.EndpointSecurity", "EndpointSecurity.kext")
'''

min_endpoint_version = "8.10.2"
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 = "T1547"
name = "Boot or Logon Autostart Execution"
reference = "https://attack.mitre.org/techniques/T1547/"
[[threat.technique.subtechnique]]
id = "T1547.006"
name = "Kernel Modules and Extensions"
reference = "https://attack.mitre.org/techniques/T1547/006/"



[threat.tactic]
id = "TA0003"
name = "Persistence"
reference = "https://attack.mitre.org/tactics/TA0003/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1562"
name = "Impair Defenses"
reference = "https://attack.mitre.org/techniques/T1562/"
[[threat.technique.subtechnique]]
id = "T1562.001"
name = "Disable or Modify Tools"
reference = "https://attack.mitre.org/techniques/T1562/001/"



[threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"

[internal]
min_endpoint_version = "8.10.2"

Stages and Predicates

Stage 1: process

process where event.type == "start" and
 process.name == "kextunload" and process.args like~ ("*.EndpointSecurity", "EndpointSecurity.kext")

Indicators

These rows show field, operator, and value matches.

Entra ID OAuth Device Code Grant by Microsoft Authentication Broker

#
Status
production
Severity
medium
Time window
9m
Author
Elastic
Source
github.com/elastic/detection-rules

Identifies device code authentication with an Azure broker client for Entra ID. Adversaries abuse Primary Refresh Tokens (PRTs) to bypass multi-factor authentication (MFA) and gain unauthorized access to Azure resources. PRTs are used in Conditional Access policies to enforce device-based controls. Compromising PRTs allows attackers to bypass these policies and gain unauthorized access. This rule detects successful sign-ins using device code authentication with the Entra ID broker client application ID (29d9ed98-a469-4536-ade2-f981bc1d605e).

MITRE ATT&CK Coverage

Telemetry Coverage

Rule Body

[metadata]
creation_date = "2024/06/24"
integration = ["azure"]
maturity = "production"
updated_date = "2026/04/10"

[rule]
author = ["Elastic"]
description = """
Identifies device code authentication with an Azure broker client for Entra ID. Adversaries abuse Primary Refresh Tokens (PRTs) to bypass multi-factor authentication (MFA) and gain unauthorized access to Azure resources. PRTs are used in Conditional Access policies to enforce device-based controls. Compromising PRTs allows attackers to bypass these policies and gain unauthorized access. This rule detects successful sign-ins using device code authentication with the Entra ID broker client application ID (29d9ed98-a469-4536-ade2-f981bc1d605e).
"""
from = "now-9m"
index = ["filebeat-*", "logs-azure.signinlogs-*", "logs-azure.activitylogs-*"]
language = "kuery"
license = "Elastic License v2"
name = "Entra ID OAuth Device Code Grant by Microsoft Authentication Broker"
references =[
    "https://dirkjanm.io/assets/raw/Phishing%20the%20Phishing%20Resistant.pdf",
    "https://learn.microsoft.com/en-us/troubleshoot/azure/entra/entra-id/governance/verify-first-party-apps-sign-in",
    "https://learn.microsoft.com/en-us/azure/azure-monitor/reference/tables/signinlogs"
]
risk_score = 47
rule_id = "a83b3dac-325a-11ef-b3e6-f661ea17fbce"
setup = """
This rule optionally requires Azure Sign-In logs from the Azure integration. Ensure that the Azure integration is correctly set up and that the required data is being collected.
"""
severity = "medium"
tags = [
    "Domain: Cloud",
    "Data Source: Azure",
    "Data Source: Microsoft Entra ID",
    "Use Case: Identity and Access Audit",
    "Tactic: Initial Access",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "query"

query = '''
 data_stream.dataset:(azure.activitylogs or azure.signinlogs)
    and azure.signinlogs.properties.authentication_protocol:deviceCode
    and azure.signinlogs.properties.conditional_access_audiences.application_id:29d9ed98-a469-4536-ade2-f981bc1d605e
    and event.outcome:success or (
        azure.activitylogs.properties.appId:29d9ed98-a469-4536-ade2-f981bc1d605e
        and azure.activitylogs.properties.authentication_protocol:deviceCode)
'''
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 Entra ID OAuth Device Code Grant by Microsoft Authentication Broker

Entra ID Device Code Authentication allows users to authenticate devices using a code, facilitating seamless access to Azure resources. Adversaries exploit this by compromising Primary Refresh Tokens (PRTs) to bypass multi-factor authentication and Conditional Access policies. The detection rule identifies unauthorized access attempts by monitoring successful sign-ins using device code authentication linked to a specific broker client application ID, flagging potential misuse.

### Possible investigation steps

- Review the sign-in logs to confirm the use of device code authentication by checking the field azure.signinlogs.properties.authentication_protocol for the value deviceCode.
- Verify the application ID involved in the sign-in attempt by examining azure.signinlogs.properties.conditional_access_audiences.application_id and ensure it matches 29d9ed98-a469-4536-ade2-f981bc1d605e.
- Investigate the user account associated with the successful sign-in to determine if the activity aligns with expected behavior or if it appears suspicious.
- Check for any recent changes or anomalies in the user's account settings or permissions that could indicate compromise.
- Review the history of sign-ins for the user to identify any patterns or unusual access times that could suggest unauthorized access.
- Assess the device from which the sign-in was attempted to ensure it is a recognized and authorized device for the user.

### False positive analysis

- Legitimate device code authentication by trusted applications or users may trigger the rule. Review the application ID and user context to confirm legitimacy.
- Frequent access by automated scripts or services using device code authentication can be mistaken for unauthorized access. Identify and document these services, then create exceptions for known application IDs.
- Shared devices in environments with multiple users may cause false positives if device code authentication is used regularly. Implement user-specific logging to differentiate between legitimate and suspicious activities.
- Regular maintenance or updates by IT teams using device code authentication might be flagged. Coordinate with IT to schedule these activities and temporarily adjust monitoring rules if necessary.
- Ensure that any exceptions or exclusions are regularly reviewed and updated to reflect changes in the environment or application usage patterns.

### Response and remediation

- Immediately revoke the compromised Primary Refresh Tokens (PRTs) to prevent further unauthorized access. This can be done through the Azure portal by navigating to the user's account and invalidating all active sessions.
- Enforce a password reset for the affected user accounts to ensure that any credentials potentially compromised during the attack are no longer valid.
- Implement additional Conditional Access policies that require device compliance checks and restrict access to trusted locations or devices only, to mitigate the risk of future PRT abuse.
- Conduct a thorough review of the affected accounts' recent activity logs to identify any unauthorized actions or data access that may have occurred during the compromise.
- Escalate the incident to the security operations team for further investigation and to determine if there are any broader implications or additional compromised accounts.
- Enhance monitoring by configuring alerts for unusual sign-in patterns or device code authentication attempts from unexpected locations or devices, to improve early detection of similar threats.
- Coordinate with the incident response team to perform a post-incident analysis and update the incident response plan with lessons learned from this event."""


[[rule.threat]]
framework = "MITRE ATT&CK"

[[rule.threat.technique]]
id = "T1078"
name = "Valid Accounts"
reference = "https://attack.mitre.org/techniques/T1078/"

[[rule.threat.technique.subtechnique]]
id = "T1078.004"
name = "Cloud Accounts"
reference = "https://attack.mitre.org/techniques/T1078/004/"

[[rule.threat.technique]]
id = "T1566"
name = "Phishing"
reference = "https://attack.mitre.org/techniques/T1566/"

[[rule.threat.technique.subtechnique]]
id = "T1566.002"
name = "Spearphishing Link"
reference = "https://attack.mitre.org/techniques/T1566/002/"

[rule.threat.tactic]
id = "TA0001"
name = "Initial Access"
reference = "https://attack.mitre.org/tactics/TA0001/"

[[rule.threat]]
framework = "MITRE ATT&CK"

[[rule.threat.technique]]
id = "T1078"
name = "Valid Accounts"
reference = "https://attack.mitre.org/techniques/T1078/"

[[rule.threat.technique.subtechnique]]
id = "T1078.004"
name = "Cloud Accounts"
reference = "https://attack.mitre.org/techniques/T1078/004/"

[[rule.threat.technique]]
id = "T1550"
name = "Use Alternate Authentication Material"
reference = "https://attack.mitre.org/techniques/T1550/"

[[rule.threat.technique.subtechnique]]
id = "T1550.001"
name = "Application Access Token"
reference = "https://attack.mitre.org/techniques/T1550/001/"

[rule.threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"

Stages and Predicates

Stage 1: query

 data_stream.dataset:(azure.activitylogs or azure.signinlogs)
    and azure.signinlogs.properties.authentication_protocol:deviceCode
    and azure.signinlogs.properties.conditional_access_audiences.application_id:29d9ed98-a469-4536-ade2-f981bc1d605e
    and event.outcome:success or (
        azure.activitylogs.properties.appId:29d9ed98-a469-4536-ade2-f981bc1d605e
        and azure.activitylogs.properties.authentication_protocol:deviceCode)

Indicators

These rows show field, operator, and value matches.

Executable File Creation via Base64

#
Source
github.com/elastic/protections-artifacts

Detects when an executable file is created by the base64 system binary. Malware, specifically OceanLotus in this case, can bring along an embedded second stage payload that is base64 encoded. Upon execution the initial access payload decodes this second stage encoded payload and creates a new executable file. This activity is inherently malicious and should not occur normally under any circumstance.

MITRE ATT&CK Coverage

Telemetry Coverage

Rule Body

[rule]
description = """
Detects when an executable file is created by the base64 system binary. Malware, specifically OceanLotus in this case,
can bring along an embedded second stage payload that is base64 encoded. Upon execution the initial access payload
decodes this second stage encoded payload and creates a new executable file. This activity is inherently malicious and
should not occur normally under any circumstance.
"""
id = "9e393ee9-9ac6-4bcc-81ff-515bfd7f6479"
license = "Elastic License v2"
name = "Executable File Creation via Base64"
os_list = ["macos"]
reference = [
    "https://github.com/center-for-threat-informed-defense/adversary_emulation_library/tree/4a57b3dd5d28ad1bd79e927e04b20fd4d66934a0/ocean_lotus",
]
version = "1.0.5"

query = '''
file where event.action == "modification" and process.name == "base64" and file.Ext.header_bytes like~ ("cffaedfe*", "cafebabe*")
'''

min_endpoint_version = "8.11.0"
optional_actions = []
[[actions]]
action = "kill_process"
field = "Effective_process.entity_id"
state = 0

[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1027"
name = "Obfuscated Files or Information"
reference = "https://attack.mitre.org/techniques/T1027/"

[[threat.technique]]
id = "T1140"
name = "Deobfuscate/Decode Files or Information"
reference = "https://attack.mitre.org/techniques/T1140/"


[threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"

[internal]
min_endpoint_version = "8.11.0"

Stages and Predicates

Stage 1: file

file where event.action == "modification" and process.name == "base64" and file.Ext.header_bytes like~ ("cffaedfe*", "cafebabe*")

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • modification corpus 72 (elastic 72)
field:"EventType" kind:eq value:"modification"
file.Ext.header_byteswildcard
  • cafebabe* corpus 19 (elastic 19)
  • cffaedfe* corpus 19 (elastic 19)
field:"file.Ext.header_bytes" kind:wildcard
process.nameeq
  • base64 corpus 6 (elastic 6)
field:"process_basename" kind:eq value:"base64"

GKE Secrets List from Unusual Source AS Organization

#
Status
production
Severity
high
Time window
6m
Group by
source.as.number, user.email
Author
Elastic
Source
github.com/elastic/detection-rules

Detects the first time a human GKE caller lists secrets cluster-wide or in default or kube-system from a source autonomous system that is not attributed to common cloud provider organizations. This can indicate remote secret enumeration using stolen credentials from an unusual network.

Known False Positives

  • Engineers listing secrets from home ISP or corporate VPN AS names may match until baselined. GeoIP organization labels vary by vendor; tune exclusions after validation.

MITRE ATT&CK Coverage

Telemetry Coverage

PlatformRecord / event type
Kuberneteslist-secrets: list secrets

Rules Detecting the Same Action

These rules filter on the same operation.

Rule Body

[metadata]
creation_date = "2026/06/30"
integration = ["gcp"]
maturity = "production"
updated_date = "2026/06/30"

[rule]
author = ["Elastic"]
description = """
Detects the first time a human GKE caller lists secrets cluster-wide or in default or kube-system from a source
autonomous system that is not attributed to common cloud provider organizations. This can indicate remote secret
enumeration using stolen credentials from an unusual network.
"""
false_positives = [
    """
    Engineers listing secrets from home ISP or corporate VPN AS names may match until baselined. GeoIP organization
  labels vary by vendor; tune exclusions after validation.
    """,
]
from = "now-6m"
index = ["logs-gcp.audit-*"]
language = "kuery"
license = "Elastic License v2"
name = "GKE Secrets List from Unusual Source AS Organization"
note = """## Triage and analysis

### Investigating GKE Secrets List from Unusual Source AS Organization

New-terms rule on `user.email` and `source.as.number` for cluster-wide or sensitive namespace secret list operations.

### Investigation steps

- Confirm `gcp.audit.resource_name` and whether listing was authorized.
- Review `source.ip`, `source.as.organization.name`, and follow-on secret get or exec activity.

### False positives

- First-time legitimate admin access from a new office or VPN provider.

## Setup

The GCP Fleet integration with GKE audit logs enabled is required to be compatible with this rule."""
references = [
    "https://attack.mitre.org/techniques/T1552/007/",
]
risk_score = 73
rule_id = "4df2e3ae-3553-4194-b22e-3e5a6f71466e"
severity = "high"
tags = [
    "Domain: Cloud",
    "Domain: Kubernetes",
    "Data Source: GCP",
    "Data Source: Google Cloud Platform",
    "Use Case: Threat Detection",
    "Tactic: Credential Access",
    "Tactic: Discovery",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "new_terms"

query = '''
data_stream.dataset:gcp.audit and service.name:"k8s.io" and event.action:io.k8s.core.v1.secrets.list and gcp.audit.resource_name:(core/v1/namespaces/default/secrets or core/v1/namespaces/kube-system/secrets or core/v1/secrets) and user.email:*@* and source.as.organization.name:(* and not ("Google LLC" or "Microsoft Corporation")) and source.as.number:*
'''

[rule.new_terms]
field = "new_terms_fields"
value = ["user.email", "source.as.number"]

[[rule.new_terms.history_window_start]]
field = "history_window_start"
value = "now-7d"

[[rule.threat]]
framework = "MITRE ATT&CK"

[[rule.threat.technique]]
id = "T1552"
name = "Unsecured Credentials"
reference = "https://attack.mitre.org/techniques/T1552/"

[[rule.threat.technique.subtechnique]]
id = "T1552.007"
name = "Container API"
reference = "https://attack.mitre.org/techniques/T1552/007/"

[rule.threat.tactic]
id = "TA0006"
name = "Credential Access"
reference = "https://attack.mitre.org/tactics/TA0006/"

[[rule.threat]]
framework = "MITRE ATT&CK"

[[rule.threat.technique]]
id = "T1613"
name = "Container and Resource Discovery"
reference = "https://attack.mitre.org/techniques/T1613/"

[rule.threat.tactic]
id = "TA0007"
name = "Discovery"
reference = "https://attack.mitre.org/tactics/TA0007/"

Stages and Predicates

Stage 1: new_terms

data_stream.dataset:gcp.audit and service.name:"k8s.io" and event.action:io.k8s.core.v1.secrets.list and gcp.audit.resource_name:(core/v1/namespaces/default/secrets or core/v1/namespaces/kube-system/secrets or core/v1/secrets) and user.email:*@* and source.as.organization.name:(* and not ("Google LLC" or "Microsoft Corporation")) and source.as.number:*

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

Inhibit System Recovery via Renamed Utilities

#
Source
github.com/elastic/protections-artifacts

Identifies the execution of renamed Windows utilities to tamper with system recovery settings. Adversaries may delete or remove built-in operating system data and turn off services designed to aid in the recovery of a corrupted system to prevent recovery.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
Identifies the execution of renamed Windows utilities to tamper with system recovery settings. Adversaries may delete or
remove built-in operating system data and turn off services designed to aid in the recovery of a corrupted system to
prevent recovery.
"""
id = "153f52e2-2fe5-420b-8691-ddb8562b99d7"
license = "Elastic License v2"
name = "Inhibit System Recovery via Renamed Utilities"
os_list = ["windows"]
version = "1.0.32"

query = '''
process where event.action == "start" and
  (
    process.pe.original_file_name : "vssadmin.exe" and process.command_line : "*shadows*" and
    process.command_line : ("*delete*", "*resize*shadowstorage*") and not process.name : "vssadmin.exe" and
    not process.parent.executable : "C:\\Program Files (x86)\\Net Protector *\\NPDBKWTT.EXE"
  ) or
  (
    process.pe.original_file_name : "bcdedit.exe" and
    process.command_line : ("*bootstatuspolicy*", "*recoveryenabled*") and not process.name : "bcdedit.exe"
  ) or
  (
    process.pe.original_file_name : "wbadmin.exe" and process.command_line : ("*catalog*", "*systemstatebackup*") and
    process.command_line : "*delete*" and not process.name : "wbadmin.exe"
  )
'''

min_endpoint_version = "7.15.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 = "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 = "T1490"
name = "Inhibit System Recovery"
reference = "https://attack.mitre.org/techniques/T1490/"


[threat.tactic]
id = "TA0040"
name = "Impact"
reference = "https://attack.mitre.org/tactics/TA0040/"

[internal]
min_endpoint_version = "7.15.0"

Stages and Predicates

Stage 1: process

process where event.action == "start" and
  (
    process.pe.original_file_name : "vssadmin.exe" and process.command_line : "*shadows*" and
    process.command_line : ("*delete*", "*resize*shadowstorage*") and not process.name : "vssadmin.exe" and
    not process.parent.executable : "C:\\Program Files (x86)\\Net Protector *\\NPDBKWTT.EXE"
  ) or
  (
    process.pe.original_file_name : "bcdedit.exe" and
    process.command_line : ("*bootstatuspolicy*", "*recoveryenabled*") and not process.name : "bcdedit.exe"
  ) or
  (
    process.pe.original_file_name : "wbadmin.exe" and process.command_line : ("*catalog*", "*systemstatebackup*") and
    process.command_line : "*delete*" and not process.name : "wbadmin.exe"
  )

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • start corpus 388 (elastic 388)
field:"EventType" kind:eq value:"start"
process.command_linewildcard
  • *bootstatuspolicy* corpus 10 (elastic 8, sigma 1, splunk 1)
  • *catalog* corpus 12 (elastic 8, sigma 3, splunk 1)
  • *delete* corpus 3 (elastic 3)
  • *delete* corpus 30 (sigma 16, elastic 8, splunk 6)
  • *recoveryenabled* corpus 10 (elastic 8, sigma 1, splunk 1)
  • *resize*shadowstorage*
  • *shadows* corpus 11 (elastic 8, sigma 3)
  • *systemstatebackup* corpus 8 (elastic 8)
field:"CommandLine" kind:wildcard
process.pe.original_file_namewildcard
  • bcdedit.exe corpus 9 (elastic 7, sigma 2)
  • vssadmin.exe corpus 9 (elastic 6, sigma 3)
  • wbadmin.exe corpus 16 (elastic 8, sigma 6, splunk 2)
field:"OriginalFileName" kind:wildcard

Java Drop followed by network activity

#
Time window
1m
Sequence by
process.entity_id
Source
github.com/elastic/protections-artifacts

Identifies attempts to execute a JAVA application that was recently dropped followed by network connection. Adversaries may abuse this utility to execute malicious code.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
Identifies attempts to execute a JAVA application that was recently dropped followed by network connection. Adversaries
may abuse this utility to execute malicious code.
"""
id = "bb794072-bdcb-4877-bc81-06d2cdd9014b"
license = "Elastic License v2"
name = "Java Drop followed by network activity"
os_list = ["windows"]
version = "1.0.1"

query = '''
sequence by process.entity_id with maxspan=1m
 [process where event.action == "start" and
  (process.Ext.relative_file_creation_time <= 500 or process.Ext.relative_file_name_modify_time <= 500) and
  (process.name : "javaw.exe" or process.pe.original_file_name == "javaw.exe") and process.executable : ("?:\\Users\\*", "?:\\ProgramData\\*", "?:\\Windows\\Temp\\*") and user.id != "S-1-5-18" and
  (
   (process.args_count == 3 and process.args : "-jar") or
   (process.args_count == 4 and process.args : ("-cp", "-classpath") and process.command_line : " *.* ")
  )]
[dns where event.action == "lookup_requested" and dns.question.name like "*.*"]
'''

min_endpoint_version = "8.10.0"
[[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 = "T1059"
name = "Command and Scripting Interpreter"
reference = "https://attack.mitre.org/techniques/T1059/"


[threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"

[internal]
min_endpoint_version = "8.10.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.action == "start" and
  (process.Ext.relative_file_creation_time <= 500 or process.Ext.relative_file_name_modify_time <= 500) and
  (process.name : "javaw.exe" or process.pe.original_file_name == "javaw.exe") and process.executable : ("?:\\Users\\*", "?:\\ProgramData\\*", "?:\\Windows\\Temp\\*") and user.id != "S-1-5-18" and
  (
   (process.args_count == 3 and process.args : "-jar") or
   (process.args_count == 4 and process.args : ("-cp", "-classpath") and process.command_line : " *.* ")
  )]

Stage 2: dns

[dns where event.action == "lookup_requested" and dns.question.name like "*.*"]

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
dns.question.namewildcard
  • *.*
field:"QueryName" kind:wildcard value:"*.*"
event.actioneq
  • lookup_requested corpus 5 (elastic 5)
  • start corpus 388 (elastic 388)
field:"EventType" kind:eq
process.Ext.relative_file_creation_timele
  • 500 transforms: number corpus 28 (elastic 28)
field:"process.Ext.relative_file_creation_time" kind:le value:"500"
process.Ext.relative_file_name_modify_timele
  • 500 transforms: number corpus 21 (elastic 21)
field:"process.Ext.relative_file_name_modify_time" kind:le value:"500"
process.argswildcard
  • -classpath corpus 3 (elastic 3)
  • -cp corpus 3 (elastic 3)
  • -jar corpus 8 (elastic 8)
field:"process.args" kind:wildcard
process.args_counteq
  • 3 transforms: number corpus 22 (elastic 22)
  • 4 transforms: number corpus 6 (elastic 6)
field:"process.args_count" kind:eq
process.command_linewildcard
  • *.* corpus 3 (elastic 3)
field:"CommandLine" kind:wildcard value:" *.* "
process.executablewildcard
  • ?:\ProgramData\* corpus 17 (elastic 17)
  • ?:\Users\* corpus 17 (elastic 17)
  • ?:\Windows\Temp\* corpus 9 (elastic 9)
field:"Image" kind:wildcard
process.namewildcard
  • javaw.exe corpus 9 (elastic 9)
field:"process_basename" kind:wildcard value:"javaw.exe"
process.pe.original_file_nameeq
  • javaw.exe corpus 3 (elastic 3)
field:"OriginalFileName" kind:eq value:"javaw.exe"
user.idne
  • S-1-5-18 corpus 37 (elastic 37)
field:"user.id" kind:ne value:"S-1-5-18"

Less Pipe Backdoor Execution

#
Source
github.com/elastic/protections-artifacts

This rule detects the execution of a backdoor script or command via the less pipe. Less is a utility that is used to view text files. By creating a malicious less configuration file, threat actors can execute a backdoor script or command on the target system upon file viewing.

MITRE ATT&CK Coverage

TacticTechniques
Persistence

Rule Body

[rule]
description = """
This rule detects the execution of a backdoor script or command via the less pipe. Less is a utility that is used to
view text files. By creating a malicious less configuration file, threat actors can execute a backdoor script or command
on the target system upon file viewing.
"""
id = "9cbbcea4-7a2c-49f9-8537-20a495fd03c5"
license = "Elastic License v2"
name = "Less Pipe Backdoor Execution"
os_list = ["linux"]
version = "1.0.1"

query = '''
process where event.type == "start" and event.action == "exec" and (
  process.name in ("setsid", "nohup", "disown") or
  (process.name in ("bash", "dash", "sh", "tcsh", "csh", "zsh", "ksh", "fish", "mksh", "busybox") and process.args == "-c") or
  process.name like (".*", "python*", "perl*", "php*", "ruby*", "lua*", "node") or
  process.executable like (
    "./*", "/tmp/*", "/var/tmp/*", "/dev/shm/*", "/run/*", "/var/run/*", "/boot/*", "/sys/*",
    "/lost+found/*", "/proc/*", "/var/mail/*", "/var/www/*", "/root/*"
  )
) and
process.parent.name in ("bash", "dash", "sh", "tcsh", "csh", "zsh", "ksh", "fish", "mksh", "busybox") and
process.parent.command_line like "*lesspipe*" and not process.parent.args == "-c" and
not process.executable like "/nix/store/*"
'''

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 = "T1546"
name = "Event Triggered Execution"
reference = "https://attack.mitre.org/techniques/T1546/"


[threat.tactic]
id = "TA0003"
name = "Persistence"
reference = "https://attack.mitre.org/tactics/TA0003/"

[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 in ("setsid", "nohup", "disown") or
  (process.name in ("bash", "dash", "sh", "tcsh", "csh", "zsh", "ksh", "fish", "mksh", "busybox") and process.args == "-c") or
  process.name like (".*", "python*", "perl*", "php*", "ruby*", "lua*", "node") or
  process.executable like (
    "./*", "/tmp/*", "/var/tmp/*", "/dev/shm/*", "/run/*", "/var/run/*", "/boot/*", "/sys/*",
    "/lost+found/*", "/proc/*", "/var/mail/*", "/var/www/*", "/root/*"
  )
) and
process.parent.name in ("bash", "dash", "sh", "tcsh", "csh", "zsh", "ksh", "fish", "mksh", "busybox") and
process.parent.command_line like "*lesspipe*" and not process.parent.args == "-c" and
not process.executable like "/nix/store/*"

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • exec
field:"EventType" kind:eq value:"exec"
event.typeeq
  • start
field:"event.type" kind:eq value:"start"
process.argseq
  • -c
field:"process.args" kind:eq value:"-c"
process.executablewildcard
  • ./*
  • /boot/*
  • /dev/shm/*
  • /lost+found/*
  • /proc/*
  • /root/*
  • /run/*
  • /sys/*
  • /tmp/*
  • /var/mail/*
  • /var/run/*
  • /var/tmp/*
  • /var/www/*
field:"Image" kind:wildcard
process.namein
  • bash
  • busybox
  • csh
  • dash
  • disown
  • fish
  • ksh
  • mksh
  • nohup
  • setsid
  • sh
  • tcsh
  • zsh
field:"process_basename" kind:in
process.namewildcard
  • .*
  • lua*
  • node
  • perl*
  • php*
  • python*
  • ruby*
field:"process_basename" kind:wildcard
process.parent.command_linewildcard
  • *lesspipe*
field:"ParentCommandLine" kind:wildcard value:"*lesspipe*"
process.parent.namein
  • bash
  • busybox
  • csh
  • dash
  • fish
  • ksh
  • mksh
  • sh
  • tcsh
  • zsh
field:"parent_process_basename" kind:in

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.executablestarts_with/nix/store/excludes:process.executable field:"process.executable" value:"/nix/store/"
process.parent.argseq-cexcludes:process.parent.args field:"process.parent.args" value:"-c"

Linux Reverse Shell

#
Time window
5s
Sequence by
process.entity_id, process.parent.entity_id
Source
github.com/elastic/protections-artifacts

Detects the creation of a reverse shell through a suspicious parent child relationship spawned via a shell with suspicious command line arguments. Attackers may spawn reverse shells to establish persistence onto a target system.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
Detects the creation of a reverse shell through a suspicious parent child relationship spawned via a shell with
suspicious command line arguments. Attackers may spawn reverse shells to establish persistence onto a target system.
"""
id = "52206861-4570-4b8b-a73e-4ef0ea379a4c"
license = "Elastic License v2"
name = "Linux Reverse Shell"
os_list = ["linux"]
reference = ["https://www.elastic.co/security-labs/primer-on-persistence-mechanisms"]
version = "1.0.8"

query = '''
sequence with maxspan=5s
  [network where event.type == "start" and event.action in ("connection_attempted", "connection_accepted") and 
   process.name in ("bash", "dash", "sh", "tcsh", "csh", "zsh", "ksh", "fish", "socat") 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"
     )
   )] by process.entity_id
  [process where event.type == "start" and event.action in ("exec", "fork") and 
   process.name in ("bash", "dash", "sh", "tcsh", "csh", "zsh", "ksh", "fish") and (
     (process.args in ("-i", "-il", "-li")) or (process.parent.name == "socat" and process.parent.command_line like~ "*exec*")
   )] by process.parent.entity_id
'''

min_endpoint_version = "8.5.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.tactic]
id = "TA0011"
name = "Command and Control"
reference = "https://attack.mitre.org/tactics/TA0011/"

[internal]
min_endpoint_version = "8.5.0"

Stages and Predicates

Ordered sequence: each step below must occur in order within 5s, correlated by process.entity_id, process.parent.entity_id.

Stage 1: network

[network where event.type == "start" and event.action in ("connection_attempted", "connection_accepted") and 
   process.name in ("bash", "dash", "sh", "tcsh", "csh", "zsh", "ksh", "fish", "socat") 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"
     )
   )] by process.entity_id

Stage 2: process

[process where event.type == "start" and event.action in ("exec", "fork") and 
   process.name in ("bash", "dash", "sh", "tcsh", "csh", "zsh", "ksh", "fish") and (
     (process.args in ("-i", "-il", "-li")) or (process.parent.name == "socat" and process.parent.command_line like~ "*exec*")
   )] by process.parent.entity_id

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
destination.ipcidr_match10.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::/8excludes:destination.ip
destination.ipeq0.0.0.0excludes:destination.ip field:"destination.ip" value:"0.0.0.0"
destination.ipis_null(no value, null check)excludes:destination.ip

Malicious Reputation of Executable Download

#
Source
github.com/elastic/protections-artifacts

Identifies Windows executable files that have been recently downloaded and have a malicious reputation. Attackers may rely upon a user downloading and opening a file in order for their malicious code to execute and gain initial access to an endpoint. Users may be subjected to social engineering to get them to open a file that will lead to code execution.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
Identifies Windows executable files that have been recently downloaded and have a malicious reputation. Attackers may
rely upon a user downloading and opening a file in order for their malicious code to execute and gain initial access to
an endpoint. Users may be subjected to social engineering to get them to open a file that will lead to code execution.
"""
id = "4348dc5e-b7de-4aa5-b6f1-20496f72547b"
license = "Elastic License v2"
name = "Malicious Reputation of Executable Download"
os_list = ["windows"]
version = "1.0.7"

query = '''
process where event.action == "start" and
 (process.Ext.relative_file_creation_time <= 1800 or process.Ext.relative_file_name_modify_time <= 1800) and
 (process.code_signature.trusted == false or process.code_signature.exists == false) and
 not process.code_signature.status : ("errorExpired", "errorCode_endpoint*") and

  (process.executable : ("?:\\Users\\*\\Downloads\\*", "*\\AppData\\Local\\Temp\\*", "?:\\Users\\*\\Desktop\\*") and
  /* Direct Child */
   process.parent.name : ("explorer.exe", "chrome.exe", "msedge.exe", "firefox.exe", "7zFM.exe", "iexplore.exe", "winrar.exe"))
'''

min_endpoint_version = "8.10.0"
reputation = true
[[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 = "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/"

[internal]
min_endpoint_version = "8.10.0"

Stages and Predicates

Stage 1: process

process where event.action == "start" and
 (process.Ext.relative_file_creation_time <= 1800 or process.Ext.relative_file_name_modify_time <= 1800) and
 (process.code_signature.trusted == false or process.code_signature.exists == false) and
 not process.code_signature.status : ("errorExpired", "errorCode_endpoint*") and
  (process.executable : ("?:\\Users\\*\\Downloads\\*", "*\\AppData\\Local\\Temp\\*", "?:\\Users\\*\\Desktop\\*") and
   process.parent.name : ("explorer.exe", "chrome.exe", "msedge.exe", "firefox.exe", "7zFM.exe", "iexplore.exe", "winrar.exe"))

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • start corpus 388 (elastic 388)
field:"EventType" kind:eq value:"start"
process.Ext.relative_file_creation_timele
  • 1800 transforms: number corpus 6 (elastic 6)
field:"process.Ext.relative_file_creation_time" kind:le value:"1800"
process.Ext.relative_file_name_modify_timele
  • 1800 transforms: number corpus 6 (elastic 6)
field:"process.Ext.relative_file_name_modify_time" kind:le value:"1800"
process.code_signature.existseq
  • false transforms: boolean corpus 118 (elastic 118)
field:"process.code_signature.exists" kind:eq value:"false"
process.code_signature.trustedeq
  • false transforms: boolean corpus 114 (elastic 114)
field:"process.code_signature.trusted" kind:eq value:"false"
process.executablewildcard
  • *\AppData\Local\Temp\* corpus 3 (elastic 3)
  • ?:\Users\*\Desktop\* corpus 3 (elastic 3)
  • ?:\Users\*\Downloads\* corpus 12 (elastic 12)
field:"Image" kind:wildcard
process.parent.namewildcard
  • 7zFM.exe corpus 12 (elastic 12)
  • chrome.exe corpus 9 (elastic 9)
  • explorer.exe corpus 50 (elastic 50)
  • firefox.exe corpus 9 (elastic 9)
  • iexplore.exe corpus 8 (elastic 8)
  • msedge.exe corpus 7 (elastic 7)
  • winrar.exe corpus 15 (elastic 14, splunk 1)
field:"parent_process_basename" kind:wildcard

Exclusions

The rule actively suppresses these predicates.

Node.js execution followed by network activity

#
Time window
1m
Sequence by
process.entity_id
Source
github.com/elastic/protections-artifacts

Identifies attempts to execute JavaScript using the Node.js module followed by network connection. Adversaries may abuse this utility to execute malicious JavaScript.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
Identifies attempts to execute JavaScript using the Node.js module followed by network connection. Adversaries may abuse
this utility to execute malicious JavaScript.
"""
id = "e22838d1-b241-4d77-9a00-ca316531cc82"
license = "Elastic License v2"
name = "Node.js execution followed by network activity"
os_list = ["windows"]
reference = ["https://nodejs.org"]
version = "1.0.8"

query = '''
sequence by process.entity_id with maxspan=1m
[process where event.action == "start" and
 (process.Ext.relative_file_creation_time <= 500 or process.Ext.relative_file_name_modify_time <= 500) and
 process.parent.name : ("wscript.exe", "powershell.exe") and
 (process.name : "node.exe" or process.pe.original_file_name == "node.exe" or process.code_signature.subject_name == "OpenJS Foundation") and
 not process.args : ("install", "--prefer-offline", "run-driver") and not process.parent.name : "node.exe" and
 not process.executable :
            ("?:\\Program Files\\*.exe",
             "?:\\Program Files (x86)\\*.exe",
             "?:\\Windows\\Prey\\versions\\*\\bin\\node.exe") and
 not (process.code_signature.subject_name in ("Western Union Holdings Inc.", "Autodesk, Inc.", "Tobii AB") and process.code_signature.trusted == true) and
 not process.hash.sha256 in ("767c9498a55e9a093c75761c69996360b73b19a0d43b68f92a8eaccc6079f666", "80eafa18b85001b1773471414150c96ad52e0dd6985a4c25d7d5083fb04ae4fd")]
[dns where event.action == "lookup_requested" and
 not dns.question.name in ("nodejs.org", "localhost", "fonts.googleapis.com", "www.google-analytics.com", "api2.cursor.sh", "registry.npmjs.org", "api.anthropic.com", "versions-prod.lmstudio.ai") and
 not (process.executable : "D:\\Azure-BuildAgent*\\node.exe" and dns.question.name : "proxy4zscaler.*.ch")]
'''

min_endpoint_version = "8.10.0"
optional_actions = []
[[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.007"
name = "JavaScript"
reference = "https://attack.mitre.org/techniques/T1059/007/"



[threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"

[internal]
min_endpoint_version = "8.10.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.action == "start" and
 (process.Ext.relative_file_creation_time <= 500 or process.Ext.relative_file_name_modify_time <= 500) and
 process.parent.name : ("wscript.exe", "powershell.exe") and
 (process.name : "node.exe" or process.pe.original_file_name == "node.exe" or process.code_signature.subject_name == "OpenJS Foundation") and
 not process.args : ("install", "--prefer-offline", "run-driver") and not process.parent.name : "node.exe" and
 not process.executable :
            ("?:\\Program Files\\*.exe",
             "?:\\Program Files (x86)\\*.exe",
             "?:\\Windows\\Prey\\versions\\*\\bin\\node.exe") and
 not (process.code_signature.subject_name in ("Western Union Holdings Inc.", "Autodesk, Inc.", "Tobii AB") and process.code_signature.trusted == true) and
 not process.hash.sha256 in ("767c9498a55e9a093c75761c69996360b73b19a0d43b68f92a8eaccc6079f666", "80eafa18b85001b1773471414150c96ad52e0dd6985a4c25d7d5083fb04ae4fd")]

Stage 2: dns

[dns where event.action == "lookup_requested" and
 not dns.question.name in ("nodejs.org", "localhost", "fonts.googleapis.com", "www.google-analytics.com", "api2.cursor.sh", "registry.npmjs.org", "api.anthropic.com", "versions-prod.lmstudio.ai") and
 not (process.executable : "D:\\Azure-BuildAgent*\\node.exe" and dns.question.name : "proxy4zscaler.*.ch")]

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • lookup_requested corpus 5 (elastic 5)
  • start corpus 388 (elastic 388)
field:"EventType" kind:eq
process.Ext.relative_file_creation_timele
  • 500 transforms: number corpus 28 (elastic 28)
field:"process.Ext.relative_file_creation_time" kind:le value:"500"
process.Ext.relative_file_name_modify_timele
  • 500 transforms: number corpus 21 (elastic 21)
field:"process.Ext.relative_file_name_modify_time" kind:le value:"500"
process.code_signature.subject_nameeq
  • OpenJS Foundation corpus 3 (elastic 3)
field:"Signature" kind:eq value:"OpenJS Foundation"
process.namewildcard
  • node.exe corpus 6 (elastic 6)
field:"process_basename" kind:wildcard value:"node.exe"
process.parent.namewildcard
  • powershell.exe corpus 37 (elastic 35, splunk 1, kusto 1)
  • wscript.exe corpus 24 (elastic 23, splunk 1)
field:"parent_process_basename" kind:wildcard
process.pe.original_file_nameeq
  • node.exe corpus 3 (elastic 3)
field:"OriginalFileName" kind:eq value:"node.exe"

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.code_signature.subject_nameinAutodesk, Inc., Tobii AB, Western Union Holdings Inc.excludes:process.code_signature.subject_name field:"process.code_signature.subject_name" value:"Autodesk, Inc." field:"process.code_signature.subject_name" value:"Tobii AB" field:"process.code_signature.subject_name" value:"Western Union Holdings Inc."
process.code_signature.trustedeqtrueexcludes:process.code_signature.trusted field:"process.code_signature.trusted" value:"true"
process.argseqinstall, --prefer-offline, run-driverexcludes:process.args field:"process.args" value:"install" field:"process.args" value:"--prefer-offline" field:"process.args" value:"run-driver"
process.executablewildcard?:\Program Files\*.exe, ?:\Program Files (x86)\*.exe, ?:\Windows\Prey\versions\*\bin\node.exeexcludes:process.executable field:"process.executable" value:"?:\Program Files\*.exe" field:"process.executable" value:"?:\Program Files (x86)\*.exe" field:"process.executable" value:"?:\Windows\Prey\versions\*\bin\node.exe"
process.hash.sha256in767c9498a55e9a093c75761c69996360b73b19a0d43b68f92a8eaccc6079f666, 80eafa18b85001b1773471414150c96ad52e0dd6985a4c25d7d5083fb04ae4fdexcludes:process.hash.sha256 field:"process.hash.sha256" value:"767c9498a55e9a093c75761c69996360b73b19a0d43b68f92a8eaccc6079f666" field:"process.hash.sha256" value:"80eafa18b85001b1773471414150c96ad52e0dd6985a4c25d7d5083fb04ae4fd"
process.parent.nameeqnode.exeexcludes:process.parent.name field:"process.parent.name" value:"node.exe"
dns.question.namewildcardproxy4zscaler.*.chexcludes:dns.question.name field:"dns.question.name" value:"proxy4zscaler.*.ch"
process.executablewildcardD:\Azure-BuildAgent*\node.exeexcludes:process.executable field:"process.executable" value:"D:\Azure-BuildAgent*\node.exe"
dns.question.nameinapi.anthropic.com, api2.cursor.sh, fonts.googleapis.com, localhost, nodejs.org, registry.npmjs.org, versions-prod.lmstudio.ai, www.google-analytics.comexcludes:dns.question.name

Potential Kerberos Attack via Bifrost

#
Status
production
Severity
high
Time window
9m
Author
Elastic
Source
github.com/elastic/detection-rules

Identifies use of Bifrost, a known macOS Kerberos pentesting tool, which can be used to dump cached Kerberos tickets or attempt unauthorized authentication techniques such as pass-the-ticket/hash and kerberoasting.

MITRE ATT&CK Coverage

Rule Body

[metadata]
creation_date = "2020/01/12"
integration = ["endpoint"]
maturity = "production"
updated_date = "2026/03/24"

[rule]
author = ["Elastic"]
description = """
Identifies use of Bifrost, a known macOS Kerberos pentesting tool, which can be used to dump cached Kerberos tickets or
attempt unauthorized authentication techniques such as pass-the-ticket/hash and kerberoasting.
"""
from = "now-9m"
index = ["logs-endpoint.events.*"]
language = "eql"
license = "Elastic License v2"
name = "Potential Kerberos Attack via Bifrost"
references = ["https://github.com/its-a-feature/bifrost"]
risk_score = 73
rule_id = "16904215-2c95-4ac8-bf5c-12354e047192"
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 macOS 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, for MacOS it is recommended to select "Traditional Endpoints".
- 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/current/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: macOS",
    "Use Case: Threat Detection",
    "Tactic: Credential Access",
    "Tactic: Lateral Movement",
    "Data Source: Elastic Defend",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"

query = '''
process where host.os.type == "macos" and event.type in ("start", "process_started") and
 process.args like~ "-action" and
 (
  process.args like~ ("-kerberoast", "askhash", "asktgs", "asktgt", "s4u") or
  (process.args like~ "-ticket" and process.args like~ "ptt") or
  (process.args like~ "dump" and process.args in~ ("tickets", "keytab"))
 )
'''
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 Kerberos Attack via Bifrost

Kerberos is a network authentication protocol designed to provide secure identity verification for users and services. Adversaries exploit tools like Bifrost on macOS to extract Kerberos tickets or perform unauthorized authentications, such as pass-the-ticket attacks. The detection rule identifies suspicious process activities linked to Bifrost's known attack methods, focusing on specific command-line arguments indicative of credential access and lateral movement attempts.

### Possible investigation steps

- Review the process start event details to identify the specific command-line arguments used, focusing on those that match the suspicious patterns such as "-action", "-kerberoast", "askhash", "asktgs", "asktgt", "s4u", "-ticket ptt", or "dump tickets/keytab".
- Correlate the process execution with user activity logs to determine if the process was initiated by a legitimate user or an unauthorized account.
- Check for any recent changes in user permissions or group memberships that could indicate privilege escalation attempts.
- Investigate the source and destination of any network connections made by the process to identify potential lateral movement or data exfiltration.
- Analyze historical data for similar process executions or patterns to assess if this is an isolated incident or part of a broader attack campaign.
- Review endpoint security logs for any additional indicators of compromise or related suspicious activities around the time of the alert.

### False positive analysis

- Legitimate administrative tasks on macOS systems may trigger the rule if they involve Kerberos ticket management. To handle this, identify and document routine administrative processes that use similar command-line arguments and create exceptions for these specific activities.
- Security tools or scripts designed for Kerberos ticket management or testing may mimic Bifrost's behavior. Review and whitelist these tools if they are part of authorized security assessments or IT operations.
- Automated system processes that interact with Kerberos for legitimate authentication purposes might be flagged. Monitor these processes and exclude them from the rule if they are verified as non-threatening and essential for system operations.
- Developers or IT personnel testing Kerberos configurations in a controlled environment could inadvertently trigger the rule. Ensure that such environments are well-documented and excluded from monitoring to prevent false positives.

### Response and remediation

- Immediately isolate the affected macOS host from the network to prevent further unauthorized access or lateral movement.
- Terminate any suspicious processes identified by the detection rule, particularly those involving Bifrost command-line arguments.
- Conduct a thorough review of Kerberos ticket logs and authentication attempts to identify any unauthorized access or anomalies.
- Revoke and reissue Kerberos tickets for affected users and services to ensure no compromised tickets are in use.
- Update and patch the macOS system and any related software to mitigate vulnerabilities that may have been exploited.
- Implement enhanced monitoring for Kerberos-related activities, focusing on unusual patterns or command-line arguments similar to those used by Bifrost.
- Escalate the incident to the security operations center (SOC) or incident response team for further investigation and to determine if additional systems are compromised."""


[[rule.threat]]
framework = "MITRE ATT&CK"

[[rule.threat.technique]]
id = "T1550"
name = "Use Alternate Authentication Material"
reference = "https://attack.mitre.org/techniques/T1550/"

[[rule.threat.technique.subtechnique]]
id = "T1550.002"
name = "Pass the Hash"
reference = "https://attack.mitre.org/techniques/T1550/002/"

[[rule.threat.technique.subtechnique]]
id = "T1550.003"
name = "Pass the Ticket"
reference = "https://attack.mitre.org/techniques/T1550/003/"

[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 = "T1552"
name = "Unsecured Credentials"
reference = "https://attack.mitre.org/techniques/T1552/"

[[rule.threat.technique.subtechnique]]
id = "T1552.001"
name = "Credentials In Files"
reference = "https://attack.mitre.org/techniques/T1552/001/"

[[rule.threat.technique]]
id = "T1558"
name = "Steal or Forge Kerberos Tickets"
reference = "https://attack.mitre.org/techniques/T1558/"

[[rule.threat.technique.subtechnique]]
id = "T1558.003"
name = "Kerberoasting"
reference = "https://attack.mitre.org/techniques/T1558/003/"

[[rule.threat.technique.subtechnique]]
id = "T1558.005"
name = "Ccache Files"
reference = "https://attack.mitre.org/techniques/T1558/005/"

[rule.threat.tactic]
id = "TA0006"
name = "Credential Access"
reference = "https://attack.mitre.org/tactics/TA0006/"

[[rule.threat]]
framework = "MITRE ATT&CK"

[[rule.threat.technique]]
id = "T1550"
name = "Use Alternate Authentication Material"
reference = "https://attack.mitre.org/techniques/T1550/"

[[rule.threat.technique.subtechnique]]
id = "T1550.002"
name = "Pass the Hash"
reference = "https://attack.mitre.org/techniques/T1550/002/"

[[rule.threat.technique.subtechnique]]
id = "T1550.003"
name = "Pass the Ticket"
reference = "https://attack.mitre.org/techniques/T1550/003/"

[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 == "macos" and event.type in ("start", "process_started") and
 process.args like~ "-action" and
 (
  process.args like~ ("-kerberoast", "askhash", "asktgs", "asktgt", "s4u") or
  (process.args like~ "-ticket" and process.args like~ "ptt") or
  (process.args like~ "dump" and process.args in~ ("tickets", "keytab"))
 )

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.typein
  • process_started
  • start
field:"event.type" kind:in
process.argsin
  • keytab
  • tickets
field:"process.args" kind:in
process.argswildcard
  • -action
  • -kerberoast
  • -ticket
  • askhash
  • asktgs
  • asktgt
  • dump
  • ptt
  • s4u
field:"process.args" kind:wildcard

Potential Privilege Escalation via SUID/SGID Proxy Execution

#
Source
github.com/elastic/protections-artifacts

Detects potential privilege escalation via SUID/SGID proxy execution on Linux systems. Attackers may exploit binaries with the SUID/SGID bit set to execute commands with elevated privileges. This rule identifies instances where a process is executed with root privileges (user ID 0 or group ID 0) while the real user or group ID is non-root, indicating potential misuse of SUID/SGID binaries.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
Detects potential privilege escalation via SUID/SGID proxy execution on Linux systems. Attackers may exploit binaries
with the SUID/SGID bit set to execute commands with elevated privileges. This rule identifies instances where a process
is executed with root privileges (user ID 0 or group ID 0) while the real user or group ID is non-root, indicating
potential misuse of SUID/SGID binaries.
"""
id = "86ef3949-5a1e-4e71-93a8-8e0ee90a71af"
license = "Elastic License v2"
name = "Potential Privilege Escalation via SUID/SGID Proxy Execution"
os_list = ["linux"]
reference = [
    "https://dfir.ch/posts/today_i_learned_binfmt_misc/",
    "https://gtfobins.github.io/#+suid",
    "https://www.elastic.co/security-labs/primer-on-persistence-mechanisms",
]
version = "1.0.2"

query = '''
process where event.type == "start" and event.action == "exec" and
startswith~(process.command_line, process.executable) and process.parent.args_count == 1 and
(
  (process.user.id == 0 and process.real_user.id != 0) or
  (process.group.id == 0 and process.real_group.id != 0)
) and
process.args in (
  "/bin/su", "/usr/bin/su",
  "/bin/umount", "/usr/bin/umount",
  "/bin/chfn", "/usr/bin/chfn",
  "/bin/chsh", "/usr/bin/chsh",
  "/bin/gpasswd", "/usr/bin/gpasswd",
  "/bin/newgrp", "/usr/bin/newgrp",
  "/usr/bin/newuidmap", "/usr/bin/newgidmap",
  "/usr/lib/dbus-1.0/dbus-daemon-launch-helper", "/usr/libexec/dbus-daemon-launch-helper",
  "/usr/lib/openssh/ssh-keysign", "/usr/libexec/openssh/ssh-keysign",
  "/usr/bin/pkexec", "/usr/libexec/pkexec", "/usr/lib/polkit-1/pkexec",
  "/usr/lib/snapd/snap-confine"
) and
process.args_count <= 2 and
not process.parent.executable in ("/usr/bin/update-notifier", "/usr/lib/update-notifier/system-crash-notification")
/*
Need to exclude this in the future.
Leaving this in now because of the current CopyFail CVE-2026-24061, but it does not detect what this rule is supposed to detect.
and not process.name == "su" and process.args == "-"
*/
'''

min_endpoint_version = "8.6.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.tactic]
id = "TA0003"
name = "Persistence"
reference = "https://attack.mitre.org/tactics/TA0003/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1068"
name = "Exploitation for Privilege Escalation"
reference = "https://attack.mitre.org/techniques/T1068/"

[[threat.technique]]
id = "T1548"
name = "Abuse Elevation Control Mechanism"
reference = "https://attack.mitre.org/techniques/T1548/"
[[threat.technique.subtechnique]]
id = "T1548.001"
name = "Setuid and Setgid"
reference = "https://attack.mitre.org/techniques/T1548/001/"



[threat.tactic]
id = "TA0004"
name = "Privilege Escalation"
reference = "https://attack.mitre.org/tactics/TA0004/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1218"
name = "System Binary Proxy Execution"
reference = "https://attack.mitre.org/techniques/T1218/"

[[threat.technique]]
id = "T1548"
name = "Abuse Elevation Control Mechanism"
reference = "https://attack.mitre.org/techniques/T1548/"
[[threat.technique.subtechnique]]
id = "T1548.001"
name = "Setuid and Setgid"
reference = "https://attack.mitre.org/techniques/T1548/001/"



[threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"

[internal]
min_endpoint_version = "8.6.0"

Stages and Predicates

Stage 1: process

process where event.type == "start" and event.action == "exec" and
startswith~(process.command_line, process.executable) and process.parent.args_count == 1 and
(
  (process.user.id == 0 and process.real_user.id != 0) or
  (process.group.id == 0 and process.real_group.id != 0)
) and
process.args in (
  "/bin/su", "/usr/bin/su",
  "/bin/umount", "/usr/bin/umount",
  "/bin/chfn", "/usr/bin/chfn",
  "/bin/chsh", "/usr/bin/chsh",
  "/bin/gpasswd", "/usr/bin/gpasswd",
  "/bin/newgrp", "/usr/bin/newgrp",
  "/usr/bin/newuidmap", "/usr/bin/newgidmap",
  "/usr/lib/dbus-1.0/dbus-daemon-launch-helper", "/usr/libexec/dbus-daemon-launch-helper",
  "/usr/lib/openssh/ssh-keysign", "/usr/libexec/openssh/ssh-keysign",
  "/usr/bin/pkexec", "/usr/libexec/pkexec", "/usr/lib/polkit-1/pkexec",
  "/usr/lib/snapd/snap-confine"
) and
process.args_count <= 2 and
not process.parent.executable in ("/usr/bin/update-notifier", "/usr/lib/update-notifier/system-crash-notification")
/*
Need to exclude this in the future.
Leaving this in now because of the current CopyFail CVE-2026-24061, but it does not detect what this rule is supposed to detect.
and not process.name == "su" and process.args == "-"
*/

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • exec
field:"EventType" kind:eq value:"exec"
event.typeeq
  • start
field:"event.type" kind:eq value:"start"
process.argsin
  • /bin/chfn
  • /bin/chsh
  • /bin/gpasswd
  • /bin/newgrp
  • /bin/su
  • /bin/umount
  • /usr/bin/chfn
  • /usr/bin/chsh
  • /usr/bin/gpasswd
  • /usr/bin/newgidmap
  • /usr/bin/newgrp
  • /usr/bin/newuidmap
  • /usr/bin/pkexec
  • /usr/bin/su
  • /usr/bin/umount
  • /usr/lib/dbus-1.0/dbus-daemon-launch-helper
  • /usr/lib/openssh/ssh-keysign
  • /usr/lib/polkit-1/pkexec
  • /usr/lib/snapd/snap-confine
  • /usr/libexec/dbus-daemon-launch-helper
  • /usr/libexec/openssh/ssh-keysign
  • /usr/libexec/pkexec
field:"process.args" kind:in
process.args_countle
  • 2 transforms: number
field:"process.args_count" kind:le value:"2"
process.command_linestarts_with
  • process.executable (field reference)
field:"CommandLine" kind:starts_with value:"process.executable"
process.group.ideq
  • 0 transforms: number
field:"process.group.id" kind:eq value:"0"
process.parent.args_counteq
  • 1 transforms: number
field:"process.parent.args_count" kind:eq value:"1"
process.real_group.idne
  • 0 transforms: number
field:"process.real_group.id" kind:ne value:"0"
process.real_user.idne
  • 0 transforms: number
field:"process.real_user.id" kind:ne value:"0"
process.user.ideq
  • 0 transforms: number
field:"process.user.id" kind:eq value:"0"

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.parent.executablein/usr/bin/update-notifier, /usr/lib/update-notifier/system-crash-notificationexcludes:process.parent.executable field:"process.parent.executable" value:"/usr/bin/update-notifier" field:"process.parent.executable" value:"/usr/lib/update-notifier/system-crash-notification"

Potential Remote File Execution via MSIEXEC

#
Status
production
Severity
low
Time window
1m
Sequence by
process.entity_id, process.parent.entity_id
Author
Elastic
Source
github.com/elastic/detection-rules

Identifies the execution of the built-in Windows Installer, msiexec.exe, to install a remote package. Adversaries may abuse msiexec.exe to launch local or network accessible MSI files.

MITRE ATT&CK Coverage

Telemetry Coverage

Rule Body

[metadata]
creation_date = "2023/09/28"
integration = ["endpoint"]
maturity = "production"
updated_date = "2026/05/04"

[rule]
author = ["Elastic"]
description = """
Identifies the execution of the built-in Windows Installer, msiexec.exe, to install a remote package. Adversaries may
abuse msiexec.exe to launch local or network accessible MSI files.
"""
from = "now-9m"
index = ["logs-endpoint.events.process-*", "logs-endpoint.events.network-*"]
language = "eql"
license = "Elastic License v2"
name = "Potential Remote File Execution via MSIEXEC"
risk_score = 21
rule_id = "3e441bdb-596c-44fd-8628-2cfdf4516ada"
severity = "low"
tags = [
    "Domain: Endpoint",
    "OS: Windows",
    "Use Case: Threat Detection",
    "Tactic: Initial Access",
    "Tactic: Defense Evasion",
    "Data Source: Elastic Defend",
    "Resources: Investigation Guide",
]
type = "eql"

query = '''
sequence with maxspan=1m
 [process where host.os.type == "windows" and event.action == "start" and
    process.name : "msiexec.exe" and process.args : "/V"] by process.entity_id
 [network where host.os.type == "windows" and process.name : "msiexec.exe" and
    event.action == "connection_attempted"] by process.entity_id
 [process where host.os.type == "windows" and event.action == "start" and
  process.parent.name : "msiexec.exe" and user.id : ("S-1-5-21-*", "S-1-5-12-1-*") and
  not process.executable : ("?:\\Windows\\SysWOW64\\msiexec.exe",
                            "?:\\Windows\\System32\\msiexec.exe",
                            "?:\\Windows\\System32\\srtasks.exe",
                            "?:\\Windows\\SysWOW64\\srtasks.exe",
                            "?:\\Windows\\System32\\taskkill.exe",
                            "?:\\Windows\\Installer\\MSI*.tmp",
                            "?:\\Program Files\\*.exe",
                            "?:\\Program Files (x86)\\*.exe",
                            "?:\\Windows\\System32\\ie4uinit.exe",
                            "?:\\Windows\\SysWOW64\\ie4uinit.exe",
                            "?:\\Windows\\System32\\sc.exe",
                            "?:\\Windows\\system32\\Wbem\\mofcomp.exe",
                            "?:\\Windows\\twain_32\\fjscan32\\SOP\\crtdmprc.exe",
                            "?:\\Windows\\SysWOW64\\taskkill.exe",
                            "?:\\Windows\\SysWOW64\\schtasks.exe",
                            "?:\\Windows\\system32\\schtasks.exe",
                            "?:\\Windows\\System32\\sdbinst.exe") and
  not (process.code_signature.subject_name == "Citrix Systems, Inc." and process.code_signature.trusted == true) and
  not (process.name : ("regsvr32.exe", "powershell.exe", "rundll32.exe", "wscript.exe") and
       process.Ext.token.integrity_level_name == "high" and
       process.args : ("?:\\Program Files\\*", "?:\\Program Files (x86)\\*")) and
  not (process.executable : ("?:\\Program Files\\*.exe", "?:\\Program Files (x86)\\*.exe") and process.code_signature.trusted == true) and
  not (process.name : "rundll32.exe" and process.args : "printui.dll,PrintUIEntry")
  ] by process.parent.entity_id
'''

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
"""

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 Remote File Execution via MSIEXEC

MSIEXEC, the Windows Installer, facilitates software installation, modification, and removal. Adversaries exploit it to execute remote MSI files, bypassing security controls. The detection rule identifies suspicious MSIEXEC activity by monitoring process starts, network connections, and child processes, filtering out known benign signatures and paths, thus highlighting potential misuse for initial access or defense evasion.

### Possible investigation steps

- Review the process start event for msiexec.exe to identify the command-line arguments used, focusing on the presence of the "/V" flag, which indicates a remote installation attempt.
- Examine the network connection attempts associated with msiexec.exe to determine the remote IP addresses or domains being contacted, and assess their reputation or any known associations with malicious activity.
- Investigate the child processes spawned by msiexec.exe, especially those not matching known benign executables or paths, to identify any suspicious or unexpected activity.
- Check the user ID associated with the msiexec.exe process to verify if it aligns with expected user behavior or if it indicates potential compromise, especially focusing on user IDs like "S-1-5-21-*" or "S-1-5-12-1-*".
- Analyze the code signature of any child processes to ensure they are trusted and expected, paying particular attention to any unsigned or untrusted executables.
- Correlate the alert with any recent phishing attempts or suspicious emails received by the user, as the MITRE ATT&CK technique T1566 (Phishing) is associated with this rule.

### False positive analysis

- Legitimate software installations using msiexec.exe may trigger the rule. To manage this, create exceptions for known software update processes that use msiexec.exe with trusted code signatures.
- System maintenance tasks that involve msiexec.exe, such as Windows updates or system repairs, can be excluded by identifying and allowing specific system paths and executables involved in these processes.
- Enterprise software deployment tools that utilize msiexec.exe for remote installations might cause false positives. Exclude these by verifying the code signature and adding exceptions for trusted deployment tools.
- Administrative scripts or automation tools that invoke msiexec.exe for legitimate purposes should be reviewed and, if verified as safe, excluded based on their execution context and code signature.
- Network monitoring tools or security software that simulate msiexec.exe activity for testing or monitoring purposes can be excluded by identifying their specific signatures and paths.

### Response and remediation

- Isolate the affected system from the network to prevent further unauthorized access or data exfiltration. This can be done by disabling network interfaces or moving the system to a quarantine VLAN.
- Terminate the msiexec.exe process if it is still running to stop any ongoing malicious activity. Use task management tools or scripts to ensure the process is completely stopped.
- Conduct a thorough review of the system for any unauthorized changes or installations. Check for newly installed software or modifications to system files that could indicate further compromise.
- Restore the system from a known good backup if unauthorized changes are detected and cannot be easily reversed. Ensure the backup is clean and free from any malicious alterations.
- Update and patch the system to the latest security standards to close any vulnerabilities that may have been exploited. This includes applying all relevant Windows updates and security patches.
- Enhance monitoring and logging on the affected system and network to detect any similar future attempts. Ensure that all relevant security events are being captured and analyzed.
- Escalate the incident to the security operations center (SOC) or incident response team for further investigation and to determine if additional systems are affected. Provide them with all relevant logs and findings for a comprehensive analysis."""


[[rule.threat]]
framework = "MITRE ATT&CK"

[[rule.threat.technique]]
id = "T1566"
name = "Phishing"
reference = "https://attack.mitre.org/techniques/T1566/"

[[rule.threat.technique.subtechnique]]
id = "T1566.002"
name = "Spearphishing Link"
reference = "https://attack.mitre.org/techniques/T1566/002/"

[rule.threat.tactic]
id = "TA0001"
name = "Initial Access"
reference = "https://attack.mitre.org/tactics/TA0001/"

[[rule.threat]]
framework = "MITRE ATT&CK"

[[rule.threat.technique]]
id = "T1218"
name = "System Binary Proxy Execution"
reference = "https://attack.mitre.org/techniques/T1218/"

[[rule.threat.technique.subtechnique]]
id = "T1218.007"
name = "Msiexec"
reference = "https://attack.mitre.org/techniques/T1218/007/"

[rule.threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"

[[rule.threat]]
framework = "MITRE ATT&CK"

[[rule.threat.technique]]
id = "T1105"
name = "Ingress Tool Transfer"
reference = "https://attack.mitre.org/techniques/T1105/"

[rule.threat.tactic]
id = "TA0011"
name = "Command and Control"
reference = "https://attack.mitre.org/tactics/TA0011/"

Stages and Predicates

Ordered sequence: each step below must occur in order within 1m, correlated by process.entity_id, process.parent.entity_id.

Stage 1: process

[process where host.os.type == "windows" and event.action == "start" and
    process.name : "msiexec.exe" and process.args : "/V"] by process.entity_id

Stage 2: network

[network where host.os.type == "windows" and process.name : "msiexec.exe" and
    event.action == "connection_attempted"] by process.entity_id

Stage 3: process

[process where host.os.type == "windows" and event.action == "start" and
  process.parent.name : "msiexec.exe" and user.id : ("S-1-5-21-*", "S-1-5-12-1-*") and
  not process.executable : ("?:\\Windows\\SysWOW64\\msiexec.exe",
                            "?:\\Windows\\System32\\msiexec.exe",
                            "?:\\Windows\\System32\\srtasks.exe",
                            "?:\\Windows\\SysWOW64\\srtasks.exe",
                            "?:\\Windows\\System32\\taskkill.exe",
                            "?:\\Windows\\Installer\\MSI*.tmp",
                            "?:\\Program Files\\*.exe",
                            "?:\\Program Files (x86)\\*.exe",
                            "?:\\Windows\\System32\\ie4uinit.exe",
                            "?:\\Windows\\SysWOW64\\ie4uinit.exe",
                            "?:\\Windows\\System32\\sc.exe",
                            "?:\\Windows\\system32\\Wbem\\mofcomp.exe",
                            "?:\\Windows\\twain_32\\fjscan32\\SOP\\crtdmprc.exe",
                            "?:\\Windows\\SysWOW64\\taskkill.exe",
                            "?:\\Windows\\SysWOW64\\schtasks.exe",
                            "?:\\Windows\\system32\\schtasks.exe",
                            "?:\\Windows\\System32\\sdbinst.exe") and
  not (process.code_signature.subject_name == "Citrix Systems, Inc." and process.code_signature.trusted == true) and
  not (process.name : ("regsvr32.exe", "powershell.exe", "rundll32.exe", "wscript.exe") and
       process.Ext.token.integrity_level_name == "high" and
       process.args : ("?:\\Program Files\\*", "?:\\Program Files (x86)\\*")) and
  not (process.executable : ("?:\\Program Files\\*.exe", "?:\\Program Files (x86)\\*.exe") and process.code_signature.trusted == true) and
  not (process.name : "rundll32.exe" and process.args : "printui.dll,PrintUIEntry")
  ] by process.parent.entity_id

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • connection_attempted corpus 72 (elastic 72)
  • start corpus 388 (elastic 388)
field:"EventType" kind:eq
process.argswildcard
  • /V corpus 2 (elastic 2)
field:"process.args" kind:wildcard value:"/V"
process.namewildcard
  • msiexec.exe corpus 45 (elastic 40, splunk 5)
field:"process_basename" kind:wildcard value:"msiexec.exe"
process.parent.namewildcard
  • msiexec.exe corpus 18 (elastic 14, splunk 3, kusto 1)
field:"parent_process_basename" kind:wildcard value:"msiexec.exe"
user.idwildcard
  • S-1-5-12-1-*
  • S-1-5-21-* corpus 6 (elastic 6)
field:"user.id" kind:wildcard

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.Ext.token.integrity_level_nameeqhighexcludes:process.Ext.token.integrity_level_name field:"process.Ext.token.integrity_level_name" value:"high"
process.argsstarts_with?:\Program Files\, ?:\Program Files (x86)\excludes:process.args field:"process.args" value:"?:\Program Files\" field:"process.args" value:"?:\Program Files (x86)\"
process.nameeqregsvr32.exe, powershell.exe, rundll32.exe, wscript.exeexcludes:process.name
process.argseqprintui.dll,PrintUIEntryexcludes:process.args field:"process.args" value:"printui.dll,PrintUIEntry"
process.nameeqrundll32.exeexcludes:process.name field:"process.name" value:"rundll32.exe"
process.code_signature.subject_nameeqCitrix Systems, Inc.excludes:process.code_signature.subject_name field:"process.code_signature.subject_name" value:"Citrix Systems, Inc."
process.code_signature.trustedeqtrueexcludes:process.code_signature.trusted field:"process.code_signature.trusted" value:"true"
process.executablewildcard?:\Program Files\*.exe, ?:\Program Files (x86)\*.exeexcludes:process.executable field:"process.executable" value:"?:\Program Files\*.exe" field:"process.executable" value:"?:\Program Files (x86)\*.exe"
process.executablewildcard?:\Windows\SysWOW64\msiexec.exe, ?:\Windows\System32\msiexec.exe, ?:\Windows\System32\srtasks.exe, ?:\Windows\SysWOW64\srtasks.exe, ?:\Windows\System32\taskkill.exe, ?:\Windows\Installer\MSI*.tmp, ?:\Program Files\*.exe, ?:\Program Files (x86)\*.exe, ?:\Windows\System32\ie4uinit.exe, ?:\Windows\SysWOW64\ie4uinit.exe, ?:\Windows\System32\sc.exe, ?:\Windows\system32\Wbem\mofcomp.exe, ?:\Windows\twain_32\fjscan32\SOP\crtdmprc.exe, ?:\Windows\SysWOW64\taskkill.exe, ?:\Windows\SysWOW64\schtasks.exe, ?:\Windows\system32\schtasks.exe, ?:\Windows\System32\sdbinst.exeexcludes:process.executable

Potential Reverse Shell via Child

#
Status
production
Severity
high
Time window
5s
Sequence by
host.id, process.entity_id
Author
Elastic
Source
github.com/elastic/detection-rules

This detection rule identifies suspicious network traffic patterns associated with TCP reverse shell activity. This activity consists of a network event that is followed by the creation of a shell process with suspicious command line arguments. An attacker may establish a Linux TCP reverse shell to gain remote access to a target system.

MITRE ATT&CK Coverage

Rule Body

[metadata]
creation_date = "2023/11/02"
integration = ["endpoint"]
maturity = "production"
updated_date = "2026/03/24"

[rule]
author = ["Elastic"]
description = """
This detection rule identifies suspicious network traffic patterns associated with TCP reverse shell activity. This
activity consists of a network event that is followed by the creation of a shell process with suspicious command line
arguments. An attacker may establish a Linux TCP reverse shell to gain remote access to a target system.
"""
from = "now-9m"
index = ["logs-endpoint.events.network*", "logs-endpoint.events.process*"]
language = "eql"
license = "Elastic License v2"
name = "Potential Reverse Shell via Child"
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 Reverse Shell via Child

Reverse shells are a technique where attackers gain remote access to a system by initiating a connection from the target back to the attacker's machine. This is often achieved using shell processes like bash or socat. Adversaries exploit this by executing commands remotely, bypassing firewalls. The detection rule identifies such activity by monitoring for network events followed by suspicious shell process executions, focusing on unusual command-line arguments and parent-child process relationships.

### Possible investigation steps

- Review the network event details to identify the source and destination IP addresses involved in the connection attempt or acceptance. Pay special attention to any external IP addresses that are not part of the internal network.
- Examine the process execution details, focusing on the command-line arguments used by the shell process. Look for unusual or suspicious arguments such as "-i" or "-l" that may indicate interactive or login shells.
- Investigate the parent-child process relationship, especially if the parent process is "socat" with arguments containing "exec". This could suggest an attempt to execute a reverse shell.
- Check the timeline of events to determine if the network event and shell process execution occurred within a short time frame (maxspan=5s), which may indicate a coordinated attack.
- Correlate the alert with any other recent suspicious activities on the host, such as unauthorized access attempts or changes in system configurations, to assess the broader context of the potential threat.
- Verify the legitimacy of the involved processes and connections by consulting with system owners or reviewing system documentation to rule out any false positives due to legitimate administrative activities.

### False positive analysis

- Legitimate administrative scripts or tools that use shell processes with interactive flags may trigger the rule. To manage this, identify and document these scripts, then create exceptions for their specific command-line arguments or parent processes.
- Automated maintenance tasks or cron jobs that involve shell execution with similar command-line arguments can be mistaken for reverse shell activity. Review these tasks and exclude them by specifying their unique process names or arguments.
- Development or testing environments where developers frequently use shell processes for debugging or testing purposes might cause false positives. Consider excluding these environments by filtering based on host identifiers or specific user accounts.
- Network monitoring tools or legitimate applications that use socat for network connections may appear suspicious. Identify these applications and exclude their specific process names or parent-child relationships from the detection rule.
- Custom scripts or applications that mimic reverse shell behavior for legitimate purposes should be reviewed and excluded by adding their specific process names or command-line patterns to the exception list.

### Response and remediation

- Immediately isolate the affected host from the network to prevent further unauthorized access or data exfiltration.
- Terminate any suspicious shell processes identified by the detection rule, especially those initiated by or involving the listed shell programs (e.g., bash, socat).
- Conduct a forensic analysis of the affected system to identify any additional indicators of compromise, such as unauthorized user accounts or modified system files.
- Review and reset credentials for any accounts that may have been compromised, ensuring the use of strong, unique passwords.
- Apply relevant security patches and updates to the affected system to address any vulnerabilities that may have been exploited.
- Monitor network traffic for any further suspicious activity, particularly outgoing connections to unknown or suspicious IP addresses.
- Escalate the incident to the security operations center (SOC) or incident response team for further investigation and to determine if additional systems are affected."""
references = [
    "https://github.com/swisskyrepo/PayloadsAllTheThings/blob/master/Methodology%20and%20Resources/Reverse%20Shell%20Cheatsheet.md",
]
risk_score = 73
rule_id = "2138bb70-5a5e-42fd-be5e-b38edf6a6777"
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 to select "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",
    "Data Source: Elastic Defend",
    "Resources: Investigation Guide",
]
type = "eql"
query = '''
sequence by host.id, process.entity_id with maxspan=5s
  [network where event.type == "start" and host.os.type == "linux" and
     event.action in ("connection_attempted", "connection_accepted") and
     process.name : ("bash", "dash", "sh", "tcsh", "csh", "zsh", "ksh", "fish", "socat") and destination.ip != null and
     not cidrmatch(destination.ip, "127.0.0.0/8", "169.254.0.0/16", "224.0.0.0/4", "::1")]
  [process where event.type == "start" and host.os.type == "linux" and event.action == "exec" and
     process.name in ("bash", "dash", "sh", "tcsh", "csh", "zsh", "ksh", "fish") and (
       (process.args : ("-i", "-l")) or (process.parent.name == "socat" and process.parent.args : "*exec*")
   )]
'''

[[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 = "T1071"
name = "Application Layer Protocol"
reference = "https://attack.mitre.org/techniques/T1071/"

[[rule.threat.technique]]
id = "T1095"
name = "Non-Application Layer Protocol"
reference = "https://attack.mitre.org/techniques/T1095/"

[rule.threat.tactic]
id = "TA0011"
name = "Command and Control"
reference = "https://attack.mitre.org/tactics/TA0011/"

Stages and Predicates

Ordered sequence: each step below must occur in order within 5s, correlated by host.id, process.entity_id.

Stage 1: network

[network where event.type == "start" and host.os.type == "linux" and
     event.action in ("connection_attempted", "connection_accepted") and
     process.name : ("bash", "dash", "sh", "tcsh", "csh", "zsh", "ksh", "fish", "socat") and destination.ip != null and
     not cidrmatch(destination.ip, "127.0.0.0/8", "169.254.0.0/16", "224.0.0.0/4", "::1")]

Stage 2: process

[process where event.type == "start" and host.os.type == "linux" and event.action == "exec" and
     process.name in ("bash", "dash", "sh", "tcsh", "csh", "zsh", "ksh", "fish") and (
       (process.args : ("-i", "-l")) or (process.parent.name == "socat" and process.parent.args : "*exec*")
   )]

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
destination.ipcidr_match127.0.0.0/8, 169.254.0.0/16, 224.0.0.0/4, ::1excludes:destination.ip

Potential UAC Bypass via IElevatedFactoryServer

#
Time window
5m
Sequence by
Effective_process.entity_id, process.entity_id
Source
github.com/elastic/protections-artifacts

Identifies attempt to elevate privileges to bypass User Account Control via an elevated function ServerCreateElevatedObject exposed by the Virtual Factory for MaintenanceUI COM object. Attackers may attempt to instantiate other privileged COM objects by proxy such as the ITaskService to execute with elevated permissions.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
Identifies attempt to elevate privileges to bypass User Account Control via an elevated function
ServerCreateElevatedObject exposed by the Virtual Factory for MaintenanceUI COM object. Attackers may attempt to
instantiate other privileged COM objects by proxy such as the ITaskService to execute with elevated permissions.
"""
id = "99da9371-dca4-400c-8b62-3c222553d2d3"
license = "Elastic License v2"
name = "Potential UAC Bypass via IElevatedFactoryServer"
os_list = ["windows"]
reference = [
    "https://www.zcgonvh.com/post/Advanced_Windows_Task_Scheduler_Playbook-Part.2_from_COM_to_UAC_bypass_and_get_SYSTEM_dirtectly.html",
    "https://github.com/zcgonvh/TaskSchedulerMisc/blob/master/schuac.cs",
    "https://strontic.github.io/xcyclopedia/library/clsid_A6BFEA43-501F-456F-A845-983D3AD7B8F0.html",
    "https://www.trendmicro.com/en_us/research/23/e/attack-on-security-titans-earth-longzhi-returns-with-new-tricks.html",
]
version = "1.0.11"

query = '''
sequence with maxspan=5m
 [process where event.action == "start" and
  process.name : "dllhost.exe" and process.args : "/Processid:{A6BFEA43-501F-456F-A845-983D3AD7B8F0}"] by process.entity_id
 [file where file.path : "?:\\Windows\\System32\\Tasks\\*"] by Effective_process.entity_id
'''

actions = []
min_endpoint_version = "8.4.0"
[[optional_actions]]
action = "rollback"
field = "process.entity_id"
state = 1

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1053"
name = "Scheduled Task/Job"
reference = "https://attack.mitre.org/techniques/T1053/"
[[threat.technique.subtechnique]]
id = "T1053.005"
name = "Scheduled Task"
reference = "https://attack.mitre.org/techniques/T1053/005/"



[threat.tactic]
id = "TA0003"
name = "Persistence"
reference = "https://attack.mitre.org/tactics/TA0003/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1548"
name = "Abuse Elevation Control Mechanism"
reference = "https://attack.mitre.org/techniques/T1548/"
[[threat.technique.subtechnique]]
id = "T1548.002"
name = "Bypass User Account Control"
reference = "https://attack.mitre.org/techniques/T1548/002/"



[threat.tactic]
id = "TA0004"
name = "Privilege Escalation"
reference = "https://attack.mitre.org/tactics/TA0004/"

[internal]
min_endpoint_version = "8.4.0"

Stages and Predicates

Ordered sequence: each step below must occur in order within 5m, correlated by Effective_process.entity_id, process.entity_id.

Stage 1: process

[process where event.action == "start" and
  process.name : "dllhost.exe" and process.args : "/Processid:{A6BFEA43-501F-456F-A845-983D3AD7B8F0}"] by process.entity_id

Stage 2: file

[file where file.path : "?:\\Windows\\System32\\Tasks\\*"] by Effective_process.entity_id

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • start corpus 388 (elastic 388)
field:"EventType" kind:eq value:"start"
file.pathwildcard
  • ?:\Windows\System32\Tasks\* corpus 6 (elastic 6)
field:"TargetFilename" kind:wildcard value:"?:\Windows\System32\Tasks\*"
process.argswildcard
  • /Processid:{A6BFEA43-501F-456F-A845-983D3AD7B8F0}
field:"process.args" kind:wildcard value:"/Processid:{A6BFEA43-501F-456F-A845-983D3AD7B8F0}"
process.namewildcard
  • dllhost.exe corpus 19 (elastic 17, splunk 2)
field:"process_basename" kind:wildcard value:"dllhost.exe"

Process Injection - Prevented - Elastic Endgame

#
Status
production
Severity
medium
Time window
1m
Author
Elastic
Source
github.com/elastic/detection-rules

Elastic Endgame prevented Process Injection. Click the Elastic Endgame icon in the event.module column or the link in the rule.reference column for additional information.

MITRE ATT&CK Coverage

TacticTechniques
Privilege Escalation

Rule Body

[metadata]
creation_date = "2020/02/18"
maturity = "production"
promotion = true
updated_date = "2025/03/21"

[rule]
author = ["Elastic"]
description = """
Elastic Endgame prevented Process Injection. Click the Elastic Endgame icon in the event.module column or the link in
the rule.reference column for additional information.
"""
from = "now-1m"
index = ["endgame-*"]
interval = "2m"
language = "kuery"
license = "Elastic License v2"
max_signals = 1000
name = "Process Injection - Prevented - Elastic Endgame"
risk_score = 47
rule_id = "990838aa-a953-4f3e-b3cb-6ddf7584de9e"
setup = """## Setup

### Additional notes

For information on troubleshooting the maximum alerts warning please refer to this [guide](https://www.elastic.co/guide/en/security/current/alerts-ui-monitor.html#troubleshoot-max-alerts).
"""
severity = "medium"
tags = ["Data Source: Elastic Endgame", "Use Case: Threat Detection", "Tactic: Privilege Escalation", "Resources: Investigation Guide"]
timestamp_override = "event.ingested"
type = "query"

query = '''
event.kind:alert and event.module:endgame and endgame.metadata.type:prevention and (event.action:kernel_shellcode_event or endgame.event_subtype_full:kernel_shellcode_event)
'''
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 Process Injection - Prevented - Elastic Endgame

Elastic Endgame is a security solution that prevents malicious activities like process injection, a technique often used by adversaries to execute code within the address space of another process, enabling privilege escalation. This detection rule identifies attempts by monitoring alerts for specific kernel shellcode events, indicating potential injection attempts, and helps mitigate threats by leveraging prevention capabilities.

### Possible investigation steps

- Review the alert details to confirm the presence of event.kind:alert and event.module:endgame, ensuring the alert is related to Elastic Endgame's prevention capabilities.
- Examine the event.action and endgame.event_subtype_full fields for kernel_shellcode_event to identify the specific type of process injection attempt.
- Investigate the source process and target process involved in the injection attempt to understand the context and potential impact on the system.
- Check for any associated alerts or logs around the same timeframe to identify if this is part of a larger attack pattern or isolated incident.
- Assess the risk score and severity to prioritize the investigation and determine if immediate action is required to mitigate potential threats.
- Consult the MITRE ATT&CK framework for additional context on the T1055 Process Injection technique to understand common methods and potential mitigations.

### False positive analysis

- Legitimate software updates or installations may trigger kernel shellcode events. Users can create exceptions for known update processes by identifying their unique process identifiers or paths.
- Security tools or monitoring software that perform deep system scans might mimic process injection behavior. Exclude these tools by specifying their executable names or hashes in the exception list.
- Custom scripts or automation tools that interact with system processes could be flagged. Review these scripts and whitelist them if they are verified as safe and necessary for operations.
- Development environments or debugging tools that inject code for testing purposes may cause alerts. Establish exceptions for these environments by defining rules based on the development tools' signatures or process names.
- Virtualization software that uses process injection techniques for managing virtual machines can be mistakenly identified. Add these applications to the exclusion list by recognizing their specific process attributes.

### Response and remediation

- Immediately isolate the affected system from the network to prevent further malicious activity and lateral movement.
- Terminate any suspicious processes identified by the alert, particularly those associated with the kernel shellcode event, to halt ongoing malicious actions.
- Conduct a thorough analysis of the affected system to identify any additional indicators of compromise or secondary payloads that may have been deployed.
- Restore the affected system from a known good backup to ensure any injected code or malicious modifications are removed.
- Apply security patches and updates to the operating system and all installed software to close any vulnerabilities that may have been exploited.
- Monitor the network and systems for any signs of similar process injection attempts, using enhanced logging and alerting based on the identified threat indicators.
- Escalate the incident to the security operations center (SOC) or incident response team for further investigation and to determine if additional systems are affected."""


[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1055"
name = "Process Injection"
reference = "https://attack.mitre.org/techniques/T1055/"


[rule.threat.tactic]
id = "TA0004"
name = "Privilege Escalation"
reference = "https://attack.mitre.org/tactics/TA0004/"

Stages and Predicates

Stage 1: query

event.kind:alert and event.module:endgame and endgame.metadata.type:prevention and (event.action:kernel_shellcode_event or endgame.event_subtype_full:kernel_shellcode_event)

Indicators

These rows show field, operator, and value matches.

Pseudoterminal (PTY) Creation from Suspicious Executable

#
Time window
10s
Sequence by
process.entity_id
Source
github.com/elastic/protections-artifacts

This rule detects the creation of the /dev/ptmx pseudoterminal device by executables located in common temporary or shared memory directories such as /tmp/, /var/tmp/, or /dev/shm/. While pseudoterminal creation is legitimate for interactive terminal sessions, malware and post-exploitation tools frequently allocate PTYs to spawn interactive shells (e.g., reverse shells) or evade detection. The use of temporary directories for staging or executing payloads is a common tactic in Linux-based attacks, making this behavior highly suspicious.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
This rule detects the creation of the /dev/ptmx pseudoterminal device by executables located in common temporary or
shared memory directories such as /tmp/, /var/tmp/, or /dev/shm/. While pseudoterminal creation is legitimate for
interactive terminal sessions, malware and post-exploitation tools frequently allocate PTYs to spawn interactive shells
(e.g., reverse shells) or evade detection. The use of temporary directories for staging or executing payloads is a
common tactic in Linux-based attacks, making this behavior highly suspicious.
"""
id = "bc695d3c-1ae0-485f-8c65-d6adb4a2759b"
license = "Elastic License v2"
name = "Pseudoterminal (PTY) Creation from Suspicious Executable"
os_list = ["linux"]
version = "1.0.9"

query = '''
sequence by process.entity_id with maxspan=10s
  [process where event.type == "start" and event.action == "exec" and
   process.executable like ("/dev/shm/*", "/tmp/*", "/var/tmp/*") and not (
     process.executable like (
       "/tmp/ubuntu-release-upgrader-*/jammy", "/tmp/baum/easybuild/*", "/tmp/thangha/easybuild/LLVM/*/bin/*",
       "/tmp/thangha/easybuild/LLVM/*/tools/*", "/tmp/u.*/easybuild/LLVM/*", "/tmp/*-vscode/.vscode-server/bin/*/node",
       "/tmp/sshpass"
     ) or
     process.working_directory like (
       "/scratch/*", "/tmp/ubuntu-release-upgrader-*", "/tmp/newroot/*",
       "/tmp/vscode-cli-*", "/tmp/.mount_*", "/tmp/cmdickens/easybuild/*"
     ) or
     process.parent.executable like ("/tmp/*server/node", "/tmp/cursor-server-cache/bin/linux-x64/*/node", "/tmp/.tmp*/.vscode-server/bin/*/node")
   )]
  [file where event.type == "creation" and file.path == "/dev/ptmx"]
'''

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.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/"

[internal]
min_endpoint_version = "7.15.0"

Stages and Predicates

Ordered sequence: each step below must occur in order within 10s, correlated by process.entity_id.

Stage 1: process

[process where event.type == "start" and event.action == "exec" and
   process.executable like ("/dev/shm/*", "/tmp/*", "/var/tmp/*") and not (
     process.executable like (
       "/tmp/ubuntu-release-upgrader-*/jammy", "/tmp/baum/easybuild/*", "/tmp/thangha/easybuild/LLVM/*/bin/*",
       "/tmp/thangha/easybuild/LLVM/*/tools/*", "/tmp/u.*/easybuild/LLVM/*", "/tmp/*-vscode/.vscode-server/bin/*/node",
       "/tmp/sshpass"
     ) or
     process.working_directory like (
       "/scratch/*", "/tmp/ubuntu-release-upgrader-*", "/tmp/newroot/*",
       "/tmp/vscode-cli-*", "/tmp/.mount_*", "/tmp/cmdickens/easybuild/*"
     ) or
     process.parent.executable like ("/tmp/*server/node", "/tmp/cursor-server-cache/bin/linux-x64/*/node", "/tmp/.tmp*/.vscode-server/bin/*/node")
   )]

Stage 2: file

[file where event.type == "creation" and file.path == "/dev/ptmx"]

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.executablewildcard/tmp/ubuntu-release-upgrader-*/jammy, /tmp/baum/easybuild/*, /tmp/thangha/easybuild/LLVM/*/bin/*, /tmp/thangha/easybuild/LLVM/*/tools/*, /tmp/u.*/easybuild/LLVM/*, /tmp/*-vscode/.vscode-server/bin/*/node, /tmp/sshpassexcludes:process.executable
process.parent.executablewildcard/tmp/*server/node, /tmp/cursor-server-cache/bin/linux-x64/*/node, /tmp/.tmp*/.vscode-server/bin/*/nodeexcludes:process.parent.executable field:"process.parent.executable" value:"/tmp/*server/node" field:"process.parent.executable" value:"/tmp/cursor-server-cache/bin/linux-x64/*/node" field:"process.parent.executable" value:"/tmp/.tmp*/.vscode-server/bin/*/node"
process.working_directorystarts_with/scratch/, /tmp/ubuntu-release-upgrader-, /tmp/newroot/, /tmp/vscode-cli-, /tmp/.mount_, /tmp/cmdickens/easybuild/excludes:process.working_directory

Regsvr32 with Unusual Arguments

#
Source
github.com/elastic/protections-artifacts

Identifies unusual instances of Regsvr32 with suspicious keywords or paths in the process command line value. Adversaries may abuse regsvr32.exe to proxy execution of malicious code.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
Identifies unusual instances of Regsvr32 with suspicious keywords or paths in the process command line value.
Adversaries may abuse regsvr32.exe to proxy execution of malicious code.
"""
id = "5db08297-bf72-49f4-b426-f405c2b01326"
license = "Elastic License v2"
name = "Regsvr32 with Unusual Arguments"
os_list = ["windows"]
version = "1.0.39"

query = '''
process where event.action == "start" and process.name : "regsvr32.exe" and
 (
  (process.args_count == 2 and process.working_directory : "?:\\" and not process.working_directory : "C:\\") or
  process.command_line :
          ("*.jpg*",
           "*.png*",
           "*.gif*",
           "*.bmp*",
           "*.jpeg*",
           "*.TIFF*",
           "*.tmp*",
           "*.dat*",
           "*.pdf*",
           "*.doc*",
           "*.xls*",
           "*.ppt*",
           "*.txt*",
           "* ?:/*/*",
           "* ..\\*",
           "*DumpStack.log*",
           "*:\\Users\\Public\\*",
           "*:\\Users\\*\\Documents\\*",
           "*:\\Users\\*\\Pictures\\*",
           "*:\\Users\\*\\Music\\*",
           "*:\\Users\\*\\Pictures\\*",
           "*:\\Windows\\Tasks\\*",
           "*:\\Windows\\System32\\tasks\\*",
           "*\\DavWWWRoot\\*")
  ) and

 not process.args : ("?:\\Program Files (x86)\\*", "?:\\Program Files\\*") and

 /*  path traversal */
 not (process.command_line : "* ..\\*" and process.command_line :"* ..\\*\\*") and
 not process.parent.executable : "?:\\Program Files (x86)\\Tencent\\QQPCMgr\\*\\QQPCTray.exe" and
 not process.command_line :
             ("*\\Program Files (x86)\\Tencent\\QQPCMgr\\*.dat*",
              "*QQPCMgr*TSWebMon64.dat*",
              "*BarTender Suite\\Codejock.DockingPane.x64.v15.3.1.ocx*") and
 not process.parent.executable : "?:\\Eaglesoft\\Shared Files\\OcxReg.exe" and
 not process.args : ("?:\\windows\\system32\\ChartFX.ClientServer.Data.dll", "?:\\Windows\\SysWOW64\\ChartFX.ClientServer.Data.dll") and
 not (process.args : "?:\\Users\\*\\AppData\\Local\\Microsoft\\TeamsMeetingAddin\\*\\Microsoft.Teams.AddinLoader.dll" and process.args : "/i:user") and
 not (process.args : "..\\*.dll" and process.working_directory : "?:\\Program Files\\LANDesk\\ManagementSuite\\Install Only Files\\") and
 not (process.args : "..\\*.dll" and
      descendant of
       [process where event.action == "start" and
        process.executable : ("?:\\Program Files\\LANDesk\\ManagementSuite\\Install Only Files\\LaunchApp.exe",
                              "?:\\Program Files (x86)\\LANDesk\\ManagementSuite\\Install Only Files\\LaunchApp.exe")]) and
 not (process.parent.name : "msiexec.exe" and process.parent.args : "-Embedding") and
 not process.parent.executable : "C:\\Program Files\\LANDesk\\ManagementSuite\\Install Only Files\\LaunchApp.exe" and
 not (process.executable : "?:\\Users\\*\\AppData\\Local\\Temp\\SSM*.tmp\\REGSVR32.EXE" and process.args : "?:\\WINDOWS\\system32\\*.dll") and
 not process.args : ("?:\\Windows\\Microsoft.NET\\*",
                     "?:\\Windows\\assembly\\NativeImages*",
                     "?:\\Windows\\Installer\\MSI*",
                     "?:\\Windows\\system32\\Codejock.DockingPane.*.ocx",
                     "?:\\windows\\system32\\Msjet35.dll",
                     "?:\\windows\\system32\\Msrd2x35.dll",
                     "System.Data.dll", "Atalasoft.*.dll", "DTI.ImageMan.Codecs.Pdf.dll") and
 not (process.name : "regsvr32.exe" and process.parent.executable : "C:\\Windows\\SysWOW64\\cmd.exe" and
      process.args : ("C:\\Users\\*\\AppData\\Local\\Temp\\is-*.tmp\\QClickV?\\Driver\\QClickV?_x64.ocx",
                      "(x86)\\eClinicalWorks_Prod\\RegBlg.bat")) and
 process.command_line != "regsvr32  DevExpress.Data.v14.1.dll"
'''

min_endpoint_version = "7.15.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 = "T1218"
name = "System Binary Proxy Execution"
reference = "https://attack.mitre.org/techniques/T1218/"
[[threat.technique.subtechnique]]
id = "T1218.010"
name = "Regsvr32"
reference = "https://attack.mitre.org/techniques/T1218/010/"



[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.action == "start" and process.name : "regsvr32.exe" and
 (
  (process.args_count == 2 and process.working_directory : "?:\\" and not process.working_directory : "C:\\") or
  process.command_line :
          ("*.jpg*",
           "*.png*",
           "*.gif*",
           "*.bmp*",
           "*.jpeg*",
           "*.TIFF*",
           "*.tmp*",
           "*.dat*",
           "*.pdf*",
           "*.doc*",
           "*.xls*",
           "*.ppt*",
           "*.txt*",
           "* ?:/*/*",
           "* ..\\*",
           "*DumpStack.log*",
           "*:\\Users\\Public\\*",
           "*:\\Users\\*\\Documents\\*",
           "*:\\Users\\*\\Pictures\\*",
           "*:\\Users\\*\\Music\\*",
           "*:\\Users\\*\\Pictures\\*",
           "*:\\Windows\\Tasks\\*",
           "*:\\Windows\\System32\\tasks\\*",
           "*\\DavWWWRoot\\*")
  ) and
 not process.args : ("?:\\Program Files (x86)\\*", "?:\\Program Files\\*") and
 not (process.command_line : "* ..\\*" and process.command_line :"* ..\\*\\*") and
 not process.parent.executable : "?:\\Program Files (x86)\\Tencent\\QQPCMgr\\*\\QQPCTray.exe" and
 not process.command_line :
             ("*\\Program Files (x86)\\Tencent\\QQPCMgr\\*.dat*",
              "*QQPCMgr*TSWebMon64.dat*",
              "*BarTender Suite\\Codejock.DockingPane.x64.v15.3.1.ocx*") and
 not process.parent.executable : "?:\\Eaglesoft\\Shared Files\\OcxReg.exe" and
 not process.args : ("?:\\windows\\system32\\ChartFX.ClientServer.Data.dll", "?:\\Windows\\SysWOW64\\ChartFX.ClientServer.Data.dll") and
 not (process.args : "?:\\Users\\*\\AppData\\Local\\Microsoft\\TeamsMeetingAddin\\*\\Microsoft.Teams.AddinLoader.dll" and process.args : "/i:user") and
 not (process.args : "..\\*.dll" and process.working_directory : "?:\\Program Files\\LANDesk\\ManagementSuite\\Install Only Files\\") and
 not (process.args : "..\\*.dll" and
      descendant of
       [process where event.action == "start" and
        process.executable : ("?:\\Program Files\\LANDesk\\ManagementSuite\\Install Only Files\\LaunchApp.exe",
                              "?:\\Program Files (x86)\\LANDesk\\ManagementSuite\\Install Only Files\\LaunchApp.exe")]) and
 not (process.parent.name : "msiexec.exe" and process.parent.args : "-Embedding") and
 not process.parent.executable : "C:\\Program Files\\LANDesk\\ManagementSuite\\Install Only Files\\LaunchApp.exe" and
 not (process.executable : "?:\\Users\\*\\AppData\\Local\\Temp\\SSM*.tmp\\REGSVR32.EXE" and process.args : "?:\\WINDOWS\\system32\\*.dll") and
 not process.args : ("?:\\Windows\\Microsoft.NET\\*",
                     "?:\\Windows\\assembly\\NativeImages*",
                     "?:\\Windows\\Installer\\MSI*",
                     "?:\\Windows\\system32\\Codejock.DockingPane.*.ocx",
                     "?:\\windows\\system32\\Msjet35.dll",
                     "?:\\windows\\system32\\Msrd2x35.dll",
                     "System.Data.dll", "Atalasoft.*.dll", "DTI.ImageMan.Codecs.Pdf.dll") and
 not (process.name : "regsvr32.exe" and process.parent.executable : "C:\\Windows\\SysWOW64\\cmd.exe" and
      process.args : ("C:\\Users\\*\\AppData\\Local\\Temp\\is-*.tmp\\QClickV?\\Driver\\QClickV?_x64.ocx",
                      "(x86)\\eClinicalWorks_Prod\\RegBlg.bat")) and
 process.command_line != "regsvr32  DevExpress.Data.v14.1.dll"

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • start corpus 388 (elastic 388)
field:"EventType" kind:eq value:"start"
process.args_counteq
  • 2 transforms: number corpus 35 (elastic 35)
field:"process.args_count" kind:eq value:"2"
process.command_linene
  • regsvr32 DevExpress.Data.v14.1.dll
field:"CommandLine" kind:ne value:"regsvr32 DevExpress.Data.v14.1.dll"
process.command_linewildcard
  • * ..\* corpus 2 (elastic 2)
  • * ?:/*/* corpus 2 (elastic 2)
  • *.TIFF* corpus 2 (elastic 2)
  • *.bmp* corpus 2 (elastic 2)
  • *.dat*
  • *.doc*
  • *.gif* corpus 2 (elastic 2)
  • *.jpeg* corpus 2 (elastic 2)
  • *.jpg* corpus 2 (elastic 2)
  • *.pdf*
  • *.png* corpus 2 (elastic 2)
  • *.ppt*
  • *.tmp*
  • *.txt*
  • *.xls*
  • *:\Users\*\Documents\*
  • *:\Users\*\Music\*
  • *:\Users\*\Pictures\*
  • *:\Users\Public\* corpus 2 (elastic 2)
  • *:\Windows\System32\tasks\*
  • *:\Windows\Tasks\*
  • *DumpStack.log*
  • *\DavWWWRoot\* corpus 2 (elastic 2)
field:"CommandLine" kind:wildcard
process.namewildcard
  • regsvr32.exe corpus 74 (elastic 69, splunk 5)
field:"process_basename" kind:wildcard value:"regsvr32.exe"
process.working_directorywildcard
  • ?:\ corpus 8 (elastic 8)
field:"CurrentDirectory" kind:wildcard value:"?:\"

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.argseq/i:userexcludes:process.args field:"process.args" value:"/i:user"
process.argswildcard?:\Users\*\AppData\Local\Microsoft\TeamsMeetingAddin\*\Microsoft.Teams.AddinLoader.dllexcludes:process.args field:"process.args" value:"?:\Users\*\AppData\Local\Microsoft\TeamsMeetingAddin\*\Microsoft.Teams.AddinLoader.dll"
process.argswildcard..\*.dllexcludes:process.args field:"process.args" value:"..\*.dll"
process.working_directoryeq?:\Program Files\LANDesk\ManagementSuite\Install Only Files\excludes:process.working_directory field:"process.working_directory" value:"?:\Program Files\LANDesk\ManagementSuite\Install Only Files\"
process.argswildcard?:\WINDOWS\system32\*.dllexcludes:process.args field:"process.args" value:"?:\WINDOWS\system32\*.dll"
process.executablewildcard?:\Users\*\AppData\Local\Temp\SSM*.tmp\REGSVR32.EXEexcludes:process.executable field:"process.executable" value:"?:\Users\*\AppData\Local\Temp\SSM*.tmp\REGSVR32.EXE"
process.argswildcardC:\Users\*\AppData\Local\Temp\is-*.tmp\QClickV?\Driver\QClickV?_x64.ocx, (x86)\eClinicalWorks_Prod\RegBlg.batexcludes:process.args field:"process.args" value:"C:\Users\*\AppData\Local\Temp\is-*.tmp\QClickV?\Driver\QClickV?_x64.ocx" field:"process.args" value:"(x86)\eClinicalWorks_Prod\RegBlg.bat"
process.nameeqregsvr32.exeexcludes:process.name field:"process.name" value:"regsvr32.exe"
process.parent.executableeqC:\Windows\SysWOW64\cmd.exeexcludes:process.parent.executable field:"process.parent.executable" value:"C:\Windows\SysWOW64\cmd.exe"
process.command_linematch ..\excludes:process.command_line field:"process.command_line" value:" ..\"
process.command_linewildcard* ..\*\*excludes:process.command_line field:"process.command_line" value:"* ..\*\*"
process.parent.argseq-Embeddingexcludes:process.parent.args field:"process.parent.args" value:"-Embedding"
process.parent.nameeqmsiexec.exeexcludes:process.parent.name field:"process.parent.name" value:"msiexec.exe"
process.argseq?:\windows\system32\ChartFX.ClientServer.Data.dll, ?:\Windows\SysWOW64\ChartFX.ClientServer.Data.dllexcludes:process.args field:"process.args" value:"?:\windows\system32\ChartFX.ClientServer.Data.dll" field:"process.args" value:"?:\Windows\SysWOW64\ChartFX.ClientServer.Data.dll"
process.argsstarts_with?:\Program Files (x86)\, ?:\Program Files\excludes:process.args field:"process.args" value:"?:\Program Files (x86)\" field:"process.args" value:"?:\Program Files\"
process.argswildcard?:\Windows\Microsoft.NET\*, ?:\Windows\assembly\NativeImages*, ?:\Windows\Installer\MSI*, ?:\Windows\system32\Codejock.DockingPane.*.ocx, ?:\windows\system32\Msjet35.dll, ?:\windows\system32\Msrd2x35.dll, System.Data.dll, Atalasoft.*.dll, DTI.ImageMan.Codecs.Pdf.dllexcludes:process.args
process.command_linewildcard*\Program Files (x86)\Tencent\QQPCMgr\*.dat*, *QQPCMgr*TSWebMon64.dat*, *BarTender Suite\Codejock.DockingPane.x64.v15.3.1.ocx*excludes:process.command_line field:"process.command_line" value:"*\Program Files (x86)\Tencent\QQPCMgr\*.dat*" field:"process.command_line" value:"*QQPCMgr*TSWebMon64.dat*" field:"process.command_line" value:"*BarTender Suite\Codejock.DockingPane.x64.v15.3.1.ocx*"
process.parent.executableeq?:\Eaglesoft\Shared Files\OcxReg.exeexcludes:process.parent.executable field:"process.parent.executable" value:"?:\Eaglesoft\Shared Files\OcxReg.exe"
process.parent.executableeqC:\Program Files\LANDesk\ManagementSuite\Install Only Files\LaunchApp.exeexcludes:process.parent.executable field:"process.parent.executable" value:"C:\Program Files\LANDesk\ManagementSuite\Install Only Files\LaunchApp.exe"
process.parent.executablewildcard?:\Program Files (x86)\Tencent\QQPCMgr\*\QQPCTray.exeexcludes:process.parent.executable field:"process.parent.executable" value:"?:\Program Files (x86)\Tencent\QQPCMgr\*\QQPCTray.exe"

RunDLL32/Regsvr32 Loads a DLL Downloaded via BITS

#
Time window
5m
Sequence by
dll.path, file.path
Source
github.com/elastic/protections-artifacts

Identifies when RunDLL32 or Regsvr32 loads an executable downloaded via Microsoft BITS Jobs. An adversary may leverage this technique to avoid suspicious processes making network connections and executing a malicious DLL.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
Identifies when RunDLL32 or Regsvr32 loads an executable downloaded via Microsoft BITS Jobs. An adversary may leverage
this technique to avoid suspicious processes making network connections and executing a malicious DLL.
"""
id = "74c1fd79-5961-4f1d-8ff8-b810b7c88545"
license = "Elastic License v2"
name = "RunDLL32/Regsvr32 Loads a DLL Downloaded via BITS"
os_list = ["windows"]
reference = [
    "https://blog.menasec.net/2021/05/hunting-for-suspicious-usage-of.html",
    "https://www.elastic.co/blog/hunting-for-persistence-using-elastic-security-part-2",
    "https://www.elastic.co/security-labs/Hunting-for-Suspicious-Windows-Libraries-for-Execution-and-Evasion",
    "https://www.elastic.co/security-labs/dipping-into-danger",
]
version = "1.0.30"

query = '''
sequence with maxspan=5m
   [file where event.action : "rename" and
    /* Executable File downloaded via BITS */
    (file.extension : ("dll", "cpl", "ocx") or file.Ext.header_bytes : "4d5a*") and process.name : "svchost.exe" and
    file.Ext.original.name : "BIT*.tmp"] by file.path
   [library where process.name : ("rundll32.exe", "regsvr32.exe") and
    not dll.code_signature.trusted == true and not user.id : ("S-1-5-18", "S-1-5-19", "S-1-5-20") and
    not dll.path : ("?:\\Program Files (x86)\\*.dll", "?:\\Program Files\\*.dll")] by dll.path
'''

min_endpoint_version = "7.16.0"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 1

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1197"
name = "BITS Jobs"
reference = "https://attack.mitre.org/techniques/T1197/"

[[threat.technique]]
id = "T1218"
name = "System Binary Proxy Execution"
reference = "https://attack.mitre.org/techniques/T1218/"
[[threat.technique.subtechnique]]
id = "T1218.010"
name = "Regsvr32"
reference = "https://attack.mitre.org/techniques/T1218/010/"

[[threat.technique.subtechnique]]
id = "T1218.011"
name = "Rundll32"
reference = "https://attack.mitre.org/techniques/T1218/011/"



[threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"

[internal]
min_endpoint_version = "7.16.0"

Stages and Predicates

Ordered sequence: each step below must occur in order within 5m, correlated by dll.path, file.path.

Stage 1: file

[file where event.action : "rename" and
    (file.extension : ("dll", "cpl", "ocx") or file.Ext.header_bytes : "4d5a*") and process.name : "svchost.exe" and
    file.Ext.original.name : "BIT*.tmp"] by file.path

Stage 2: library

[library where process.name : ("rundll32.exe", "regsvr32.exe") and
    not dll.code_signature.trusted == true and not user.id : ("S-1-5-18", "S-1-5-19", "S-1-5-20") and
    not dll.path : ("?:\\Program Files (x86)\\*.dll", "?:\\Program Files\\*.dll")] by dll.path

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actionwildcard
  • rename corpus 10 (elastic 9, sigma 1)
field:"EventType" kind:wildcard value:"rename"
file.Ext.header_byteswildcard
  • 4d5a* corpus 45 (elastic 45)
field:"file.Ext.header_bytes" kind:wildcard value:"4d5a*"
file.Ext.original.namewildcard
  • BIT*.tmp corpus 2 (elastic 2)
field:"file.Ext.original.name" kind:wildcard value:"BIT*.tmp"
file.extensionwildcard
  • cpl corpus 19 (elastic 19)
  • dll corpus 32 (elastic 32)
  • ocx corpus 6 (elastic 6)
field:"file.extension" kind:wildcard
process.namewildcard
  • regsvr32.exe corpus 74 (elastic 69, splunk 5)
  • rundll32.exe corpus 123 (elastic 100, splunk 23)
  • svchost.exe corpus 21 (elastic 20, splunk 1)
field:"process_basename" kind:wildcard

Exclusions

The rule actively suppresses these predicates.

Security File Access via Common Utilities

#
Status
production
Severity
low
Time window
9m
Author
Elastic
Source
github.com/elastic/detection-rules

This rule detects sensitive security file access via common utilities on Linux systems. Adversaries may attempt to read from sensitive files using common utilities to gather information about the system and its security configuration.

MITRE ATT&CK Coverage

Rule Body

[metadata]
creation_date = "2024/11/04"
integration = ["endpoint", "crowdstrike", "sentinel_one_cloud_funnel"]
maturity = "production"
updated_date = "2026/06/18"

[rule]
author = ["Elastic"]
description = """
This rule detects sensitive security file access via common utilities on Linux systems. Adversaries may attempt to read
from sensitive files using common utilities to gather information about the system and its security configuration.
"""
from = "now-9m"
index = [
    "endgame-*",
    "logs-crowdstrike.fdr*",
    "logs-endpoint.events.process*",
    "logs-sentinel_one_cloud_funnel.*",
]
language = "eql"
license = "Elastic License v2"
name = "Security File Access via Common Utilities"
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 Security File Access via Common Utilities

In Linux environments, common utilities like `cat`, `grep`, and `less` are essential for file manipulation and viewing. Adversaries exploit these tools to access sensitive security files, aiming to gather system and security configuration data. The detection rule identifies suspicious use of these utilities by monitoring process execution patterns and arguments, flagging attempts to access critical security files, thus helping to thwart potential reconnaissance activities.

### Possible investigation steps

- Review the process execution details to identify the specific utility used (e.g., cat, grep, less) and the exact file path accessed, as indicated by the process.name and process.args fields.
- Check the user account associated with the process execution to determine if the access was performed by a legitimate user or a potentially compromised account.
- Investigate the timing and frequency of the access attempt to assess whether it aligns with normal user behavior or indicates suspicious activity.
- Correlate the alert with other security events or logs from the same host to identify any preceding or subsequent suspicious activities, such as unauthorized logins or privilege escalation attempts.
- Examine the host's recent changes or updates to security configurations or user permissions that might explain the access attempt.
- If possible, contact the user or system owner to verify whether the access was intentional and authorized, providing additional context for the investigation.

### False positive analysis

- System administrators or automated scripts may frequently access security files for legitimate maintenance or configuration purposes. To handle this, create exceptions for known administrative accounts or specific scripts that regularly perform these actions.
- Security monitoring tools or compliance checks might trigger the rule when scanning security files. Identify these tools and exclude their processes from the rule to prevent unnecessary alerts.
- Backup processes that involve copying or reading security files can be mistaken for suspicious activity. Exclude backup software processes or scheduled tasks that are known to perform these operations.
- Developers or DevOps personnel accessing configuration files for application deployment or troubleshooting might trigger the rule. Establish a list of trusted users or roles and exclude their access patterns from detection.
- Regular system updates or package management operations may involve accessing security-related files. Recognize these update processes and exclude them to avoid false positives during routine maintenance.

### Response and remediation

- Immediately isolate the affected system from the network to prevent further unauthorized access or data exfiltration.
- Terminate any suspicious processes identified by the detection rule to halt potential reconnaissance activities.
- Conduct a thorough review of the accessed files to determine if any sensitive information was exposed or altered.
- Change credentials and access tokens for any compromised accounts, especially those related to AWS, GCP, or Azure, to prevent unauthorized access.
- Implement stricter access controls and permissions on sensitive security files to limit exposure to only necessary users and processes.
- Escalate the incident to the security operations team for further investigation and to assess the potential impact on the broader network.
- Enhance monitoring and logging for similar activities to improve detection and response times for future incidents."""
risk_score = 21
rule_id = "7efca3ad-a348-43b2-b544-c93a78a0ef92"
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 = "low"
tags = [
    "Domain: Endpoint",
    "OS: Linux",
    "Use Case: Threat Detection",
    "Tactic: Discovery",
    "Data Source: Elastic Defend",
    "Data Source: Crowdstrike",
    "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", "ProcessRollup2") and
process.name in ("cat", "less", "more", "strings", "find", "xargs") and
process.parent.executable != null and 
process.args like (
  "/etc/security/*", "/etc/pam.d/*", "/etc/login.defs", "/lib/security/*", "/lib64/security/*",
  "/usr/lib/security/*", "/usr/lib64/security/*", "/usr/lib/x86_64-linux-gnu/security/*",
  "/home/*/.aws/credentials", "/home/*/.aws/config", "/home/*/.config/gcloud/*credentials.json",
  "/home/*/.config/gcloud/configurations/config_default", "/home/*/.azure/accessTokens.json",
  "/home/*/.azure/azureProfile.json"
) and not (
  process.parent.name in ("wazuh-modulesd", "lynis") or
  process.command_line in ("cat /etc/login.defs" , "cat /home/asterisk/.aws/credentials") or
  ?process.parent.command_line in (
    "/bin/sh /usr/sbin/lynis audit system --cronjob",
    "/usr/bin/find -L /etc/security/limits.conf /etc/security/limits.d -type f -exec /usr/bin/cat {} ;",
    "/usr/bin/find /etc/security/limits.conf /etc/security/limits.d -type f -exec /usr/bin/cat {} ;"
  ) or
  ?process.parent.args in ("/opt/imperva/ragent/bin/get_sys_resources.sh", "/usr/sbin/lynis", "./terra_linux.sh") or
  process.args == "/usr/bin/coreutils" or
  (process.parent.name == "pwsh" and process.parent.command_line like "*Evaluate-STIG*") or
  ?process.parent.executable like (
    "/usr/sap/audit_scripts/auto_audit_gral.sh", "/opt/saltstack/salt/bin/python3*", "/opt/puppetlabs/puppet/bin/ruby"
  ) or
  ?process.entry_leader.executable like (
    "/usr/sbin/ScanAssistant", "/opt/Tanium/TaniumClient/TaniumClient", "/tmp/CVU_*resource/exectask", "/opt/nessus/sbin/nessus-service"
  )
)
'''

[[rule.threat]]
framework = "MITRE ATT&CK"

[[rule.threat.technique]]
id = "T1083"
name = "File and Directory Discovery"
reference = "https://attack.mitre.org/techniques/T1083/"

[rule.threat.tactic]
id = "TA0007"
name = "Discovery"
reference = "https://attack.mitre.org/tactics/TA0007/"

[[rule.threat]]
framework = "MITRE ATT&CK"

[[rule.threat.technique]]
id = "T1552"
name = "Unsecured Credentials"
reference = "https://attack.mitre.org/techniques/T1552/"

[[rule.threat.technique.subtechnique]]
id = "T1552.001"
name = "Credentials In Files"
reference = "https://attack.mitre.org/techniques/T1552/001/"

[rule.threat.tactic]
id = "TA0006"
name = "Credential Access"
reference = "https://attack.mitre.org/tactics/TA0006/"

Stages and Predicates

Stage 1: process

process where host.os.type == "linux" and event.type == "start" and
event.action in ("exec", "exec_event", "start", "ProcessRollup2") and
process.name in ("cat", "less", "more", "strings", "find", "xargs") and
process.parent.executable != null and 
process.args like (
  "/etc/security/*", "/etc/pam.d/*", "/etc/login.defs", "/lib/security/*", "/lib64/security/*",
  "/usr/lib/security/*", "/usr/lib64/security/*", "/usr/lib/x86_64-linux-gnu/security/*",
  "/home/*/.aws/credentials", "/home/*/.aws/config", "/home/*/.config/gcloud/*credentials.json",
  "/home/*/.config/gcloud/configurations/config_default", "/home/*/.azure/accessTokens.json",
  "/home/*/.azure/azureProfile.json"
) and not (
  process.parent.name in ("wazuh-modulesd", "lynis") or
  process.command_line in ("cat /etc/login.defs" , "cat /home/asterisk/.aws/credentials") or
  ?process.parent.command_line in (
    "/bin/sh /usr/sbin/lynis audit system --cronjob",
    "/usr/bin/find -L /etc/security/limits.conf /etc/security/limits.d -type f -exec /usr/bin/cat {} ;",
    "/usr/bin/find /etc/security/limits.conf /etc/security/limits.d -type f -exec /usr/bin/cat {} ;"
  ) or
  ?process.parent.args in ("/opt/imperva/ragent/bin/get_sys_resources.sh", "/usr/sbin/lynis", "./terra_linux.sh") or
  process.args == "/usr/bin/coreutils" or
  (process.parent.name == "pwsh" and process.parent.command_line like "*Evaluate-STIG*") or
  ?process.parent.executable like (
    "/usr/sap/audit_scripts/auto_audit_gral.sh", "/opt/saltstack/salt/bin/python3*", "/opt/puppetlabs/puppet/bin/ruby"
  ) or
  ?process.entry_leader.executable like (
    "/usr/sbin/ScanAssistant", "/opt/Tanium/TaniumClient/TaniumClient", "/tmp/CVU_*resource/exectask", "/opt/nessus/sbin/nessus-service"
  )
)

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actionin
  • ProcessRollup2
  • exec
  • exec_event
  • start
field:"EventType" kind:in
event.typeeq
  • start
field:"event.type" kind:eq value:"start"
process.argswildcard
  • /etc/login.defs
  • /etc/pam.d/*
  • /etc/security/*
  • /home/*/.aws/config
  • /home/*/.aws/credentials
  • /home/*/.azure/accessTokens.json
  • /home/*/.azure/azureProfile.json
  • /home/*/.config/gcloud/*credentials.json
  • /home/*/.config/gcloud/configurations/config_default
  • /lib/security/*
  • /lib64/security/*
  • /usr/lib/security/*
  • /usr/lib/x86_64-linux-gnu/security/*
  • /usr/lib64/security/*
field:"process.args" kind:wildcard
process.namein
  • cat
  • find
  • less
  • more
  • strings
  • xargs
field:"process_basename" kind:in
process.parent.executableis_not_null
  • (no value, null check)
field:"ParentImage" kind:is_not_null

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.parent.command_linematchEvaluate-STIGexcludes:process.parent.command_line field:"process.parent.command_line" value:"Evaluate-STIG"
process.parent.nameeqpwshexcludes:process.parent.name field:"process.parent.name" value:"pwsh"
process.argseq/usr/bin/coreutilsexcludes:process.args field:"process.args" value:"/usr/bin/coreutils"
process.command_lineincat /etc/login.defs, cat /home/asterisk/.aws/credentialsexcludes:process.command_line field:"process.command_line" value:"cat /etc/login.defs" field:"process.command_line" value:"cat /home/asterisk/.aws/credentials"
process.entry_leader.executablewildcard/usr/sbin/ScanAssistant, /opt/Tanium/TaniumClient/TaniumClient, /tmp/CVU_*resource/exectask, /opt/nessus/sbin/nessus-serviceexcludes:process.entry_leader.executable
process.parent.argsin./terra_linux.sh, /opt/imperva/ragent/bin/get_sys_resources.sh, /usr/sbin/lynisexcludes:process.parent.args field:"process.parent.args" value:"./terra_linux.sh" field:"process.parent.args" value:"/opt/imperva/ragent/bin/get_sys_resources.sh" field:"process.parent.args" value:"/usr/sbin/lynis"
process.parent.command_linein/bin/sh /usr/sbin/lynis audit system --cronjob, /usr/bin/find -L /etc/security/limits.conf /etc/security/limits.d -type f -exec /usr/bin/cat {} ;, /usr/bin/find /etc/security/limits.conf /etc/security/limits.d -type f -exec /usr/bin/cat {} ;excludes:process.parent.command_line field:"process.parent.command_line" value:"/bin/sh /usr/sbin/lynis audit system --cronjob" field:"process.parent.command_line" value:"/usr/bin/find -L /etc/security/limits.conf /etc/security/limits.d -type f -exec /usr/bin/cat {} ;" field:"process.parent.command_line" value:"/usr/bin/find /etc/security/limits.conf /etc/security/limits.d -type f -exec /usr/bin/cat {} ;"
process.parent.executablewildcard/usr/sap/audit_scripts/auto_audit_gral.sh, /opt/saltstack/salt/bin/python3*, /opt/puppetlabs/puppet/bin/rubyexcludes:process.parent.executable field:"process.parent.executable" value:"/usr/sap/audit_scripts/auto_audit_gral.sh" field:"process.parent.executable" value:"/opt/saltstack/salt/bin/python3*" field:"process.parent.executable" value:"/opt/puppetlabs/puppet/bin/ruby"
process.parent.nameinlynis, wazuh-modulesdexcludes:process.parent.name field:"process.parent.name" value:"lynis" field:"process.parent.name" value:"wazuh-modulesd"

Sensitive Audit Policy Sub-Category Disabled

#
Status
production
Severity
medium
Time window
11m
Group by
Esql.time_window, host.id, winlog.event_data.SubCategory
Author
Elastic
Source
github.com/elastic/detection-rules

Identifies attempts to disable auditing for some security sensitive audit policy sub-categories. This is often done by attackers in an attempt to evade detection and forensics on a system.

MITRE ATT&CK Coverage

Telemetry Coverage

Rule Body

[metadata]
creation_date = "2025/01/14"
integration = ["windows", "system"]
maturity = "production"
min_stack_comments = "ES|QL inline stats became generally available in 9.3.0, MV_CONTAINS is in preview since 9.2."
min_stack_version = "9.3.0"
updated_date = "2026/05/04"

[rule]
author = ["Elastic"]
description = """
Identifies attempts to disable auditing for some security sensitive audit policy sub-categories. This is often done by
attackers in an attempt to evade detection and forensics on a system.
"""
from = "now-11m"
language = "esql"
license = "Elastic License v2"
name = "Sensitive Audit Policy Sub-Category Disabled"
note = """## Triage and analysis

### Investigating Sensitive Audit Policy Sub-Category Disabled

Windows event logs are a fundamental data source for security monitoring, forensics, and incident response. Adversaries can tamper, clear, and delete this data to break SIEM detections, cover their tracks, and slow down incident response.

This rule looks for attempts to disable security-sensitive audit policies.

#### Possible investigation steps

- Investigate the process execution chain (parent process tree) for unknown processes. Examine their executable files for prevalence, whether they are located in expected locations, and if they are signed with valid digital signatures.
- Identify the user account that performed the action and whether it should perform this kind of action.
- Contact the account owner and confirm whether they are aware of this activity.
- Investigate other alerts associated with the user/host during the past 48 hours.
  - Verify if any other anti-forensics behaviors were observed.
- Investigate the event logs prior to the action for suspicious behaviors that an attacker may be trying to cover up.

### False positive analysis

- This activity is unlikely to happen legitimately. Benign true positives (B-TPs) can be added as exceptions if necessary.

### Response and remediation

- Initiate the incident response process based on the outcome of the triage.
- Isolate the involved host to prevent further post-compromise behavior.
- Re-enable affected logging components, services, and security monitoring.
- Investigate credential exposure on systems compromised or used by the attacker to ensure all compromised accounts are identified. Reset passwords for these accounts and other potentially compromised credentials, such as email, business systems, and web services.
- Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
- Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
- Using the incident response data, update logging and audit policies to improve the mean time to detect (MTTD) and the mean time to respond (MTTR).
"""
references = [
    "https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-10/security/threat-protection/auditing/event-4719",
    "https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-gpac/77878370-0712-47cd-997d-b07053429f6d",
]
risk_score = 47
rule_id = "0ef5d3eb-67ef-43ab-93b7-305cfa5a21f6"
setup = """## Setup

Audit Policy Change must be enabled to generate the events used by this rule.
Setup instructions: https://ela.st/audit-policy-change
"""
severity = "medium"
tags = [
    "Domain: Endpoint",
    "OS: Windows",
    "Use Case: Threat Detection",
    "Tactic: Defense Evasion",
    "Resources: Investigation Guide",
    "Data Source: Windows Security Event Logs",
]
timestamp_override = "event.ingested"
type = "esql"

query = '''
from logs-windows.forwarded*, logs-system.security* metadata _id, _version, _index
| where host.os.type == "windows" and event.code == "4719" and
  winlog.event_data.AuditPolicyChangesDescription in ("Success removed", "Success Added") and
  winlog.event_data.SubCategory in (
    "Logon",
    "Audit Policy Change",
    "Process Creation",
    "Other System Events",
    "Security Group Management",
    "User Account Management"
  )
| eval Esql.time_window = DATE_TRUNC(5m, @timestamp)

// Aggregate policy changes within each 5m window per host and sub-category,
// then keep only removals that were not re-enabled in the same window
| inline stats
    Esql.winlog_AuditPolicyChangesDescription_values = VALUES(winlog.event_data.AuditPolicyChangesDescription)
  by host.id, winlog.event_data.SubCategory, Esql.time_window
| where winlog.event_data.AuditPolicyChangesDescription == "Success removed" and not MV_CONTAINS(Esql.winlog_AuditPolicyChangesDescription_values, "Success Added")

// Wait 5m for a potential "Success Added" to arrive before alerting
| where @timestamp < NOW() - 5m
| keep *
'''


[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1070"
name = "Indicator Removal"
reference = "https://attack.mitre.org/techniques/T1070/"
[[rule.threat.technique.subtechnique]]
id = "T1070.001"
name = "Clear Windows Event Logs"
reference = "https://attack.mitre.org/techniques/T1070/001/"


[[rule.threat.technique]]
id = "T1562"
name = "Impair Defenses"
reference = "https://attack.mitre.org/techniques/T1562/"
[[rule.threat.technique.subtechnique]]
id = "T1562.002"
name = "Disable Windows Event Logging"
reference = "https://attack.mitre.org/techniques/T1562/002/"

[[rule.threat.technique.subtechnique]]
id = "T1562.006"
name = "Indicator Blocking"
reference = "https://attack.mitre.org/techniques/T1562/006/"



[rule.threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"

Stages and Predicates

Stage 1: from

from logs-windows.forwarded*, logs-system.security* metadata _id, _version, _index

Stage 2: where

| where host.os.type == "windows" and event.code == "4719" and
  winlog.event_data.AuditPolicyChangesDescription in ("Success removed", "Success Added") and
  winlog.event_data.SubCategory in (
    "Logon",
    "Audit Policy Change",
    "Process Creation",
    "Other System Events",
    "Security Group Management",
    "User Account Management"
  )

Stage 3: eval

| eval Esql.time_window = DATE_TRUNC(5m, @timestamp)

Stage 4: inline_stats

| inline stats
    Esql.winlog_AuditPolicyChangesDescription_values = VALUES(winlog.event_data.AuditPolicyChangesDescription)
  by host.id, winlog.event_data.SubCategory, Esql.time_window

Stage 5: where

| where winlog.event_data.AuditPolicyChangesDescription == "Success removed" and not MV_CONTAINS(Esql.winlog_AuditPolicyChangesDescription_values, "Success Added")

Stage 6: where

| where @timestamp < NOW() - 5m

Stage 7: keep

| keep *

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
winlog.event_data.AuditPolicyChangesDescriptioneq
  • Success removed
field:"AuditPolicyChangesDescription" kind:eq value:"Success removed"
winlog.event_data.AuditPolicyChangesDescriptionin
  • Success Added
  • Success removed
field:"AuditPolicyChangesDescription" kind:in
winlog.event_data.SubCategoryin
  • Audit Policy Change
  • Logon
  • Other System Events
  • Process Creation
  • Security Group Management
  • User Account Management
field:"SubCategory" kind:in

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
Esql.winlog_AuditPolicyChangesDescription_valueseqSuccess Addedexcludes:Esql.winlog_AuditPolicyChangesDescription_values field:"Esql.winlog_AuditPolicyChangesDescription_values" value:"Success Added"

Output Fields

The rule emits every field available at its final step.

Shell Script Execution from abnormal Volume Mount Path

#
Source
github.com/elastic/protections-artifacts

Detects the suspicious execution of a shell script from a volume mount path and outside of the standard macOS binary execution path (/Volumes/name.app/Contents/MacOS/binary). This activity is highly abnormal and should indicate potentially malicious activity. Threat actors have used shell scripts like this in order to download additional tools/payloads and prepare the system for post-infection actions by establishing persistence, altering file attributes and creating necessary directories.

MITRE ATT&CK Coverage

Telemetry Coverage

Rule Body

[rule]
description = """
Detects the suspicious execution of a shell script from a volume mount path and outside of the standard macOS binary
execution path (/Volumes/name.app/Contents/MacOS/binary). This activity is highly abnormal and should indicate
potentially malicious activity. Threat actors have used shell scripts like this in order to download additional
tools/payloads and prepare the system for post-infection actions by establishing persistence, altering file attributes
and creating necessary directories.
"""
id = "87def154-004d-4d3a-8224-591e41804454"
license = "Elastic License v2"
name = "Shell Script Execution from abnormal Volume Mount Path"
os_list = ["macos"]
reference = ["https://objective-see.org/blog/blog_0x71.html"]
version = "1.0.22"

query = '''
process where event.type == "start" and event.action == "exec" and 
process.name like~ ("bash", "sh", "zsh", "tclsh*") and
process.args like~ "/Volumes/*/Contents/*" and 
process.args_count <= 3 and
process.parent.executable like~ "/Volumes/*" and not 
process.args like~ ("/Volumes/*/Contents/MacOS/*", "/Volumes/*/Contents/Eclipse/*") and not
process.Ext.effective_parent.executable like~ "/Volumes/*"
'''

min_endpoint_version = "8.5.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.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/"

[internal]
min_endpoint_version = "8.5.0"

Stages and Predicates

Stage 1: process

process where event.type == "start" and event.action == "exec" and 
process.name like~ ("bash", "sh", "zsh", "tclsh*") and
process.args like~ "/Volumes/*/Contents/*" and 
process.args_count <= 3 and
process.parent.executable like~ "/Volumes/*" and not 
process.args like~ ("/Volumes/*/Contents/MacOS/*", "/Volumes/*/Contents/Eclipse/*") and not
process.Ext.effective_parent.executable like~ "/Volumes/*"

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • exec corpus 547 (elastic 547)
field:"EventType" kind:eq value:"exec"
event.typeeq
  • start corpus 1036 (elastic 1036)
field:"event.type" kind:eq value:"start"
process.argswildcard
  • /Volumes/*/Contents/*
field:"process.args" kind:wildcard value:"/Volumes/*/Contents/*"
process.args_countle
  • 3 transforms: number corpus 9 (elastic 9)
field:"process.args_count" kind:le value:"3"
process.namewildcard
  • bash corpus 33 (elastic 33)
  • sh corpus 33 (elastic 33)
  • tclsh* corpus 10 (elastic 10)
  • zsh corpus 31 (elastic 31)
field:"process_basename" kind:wildcard
process.parent.executablewildcard
  • /Volumes/* corpus 3 (elastic 3)
field:"ParentImage" kind:wildcard value:"/Volumes/*"

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.Ext.effective_parent.executablestarts_with/Volumes/excludes:process.Ext.effective_parent.executable field:"process.Ext.effective_parent.executable" value:"/Volumes/"
process.argswildcard/Volumes/*/Contents/MacOS/*, /Volumes/*/Contents/Eclipse/*excludes:process.args field:"process.args" value:"/Volumes/*/Contents/MacOS/*" field:"process.args" value:"/Volumes/*/Contents/Eclipse/*"

Suspected Lateral Movement from Compromised Host

#
Status
production
Severity
high
Time window
30m
Group by
Esql.source_ip
Author
Elastic
Source
github.com/elastic/detection-rules

Detects potential lateral movement or post-compromise activity by correlating alerts where the host.ip of one alert matches the source.ip of a subsequent alert. This behavior may indicate a compromised host being used to authenticate to another system or resource, including cloud services.

Rule Body

[metadata]
creation_date = "2025/12/31"
maturity = "production"
updated_date = "2026/02/16"


[rule]
author = ["Elastic"]
description = """
Detects potential lateral movement or post-compromise activity by correlating alerts where the host.ip of one alert matches
the source.ip of a subsequent alert. This behavior may indicate a compromised host being used to authenticate to another system
or resource, including cloud services.
"""
from = "now-30m"
interval = "29m"
language = "esql"
license = "Elastic License v2"
name = "Suspected Lateral Movement from Compromised Host"
risk_score = 73
rule_id = "171a4981-9c1a-4a03-9028-21cff4b27b38"
setup = """## Setup

This rule requires the `host.ip` field to be populated.
For **Elastic Defend** events on versions **8.18 and above**, this field is **disabled by default**.

If you are using **Elastic Defend**, ensure host IP collection is enabled by following the configuration steps in the
[helper guide](https://www.elastic.co/docs/solutions/security/configure-elastic-defend/configure-data-volume-for-elastic-endpoint#host-fields).
"""
severity = "high"
tags = ["Use Case: Threat Detection", "Rule Type: Higher-Order Rule", "Resources: Investigation Guide"]
timestamp_override = "event.ingested"
type = "esql"

query = '''
from .alerts-security.*

// any alerts excluding deprecated, low severity and threat_match rules
| where kibana.alert.rule.name is not null and kibana.alert.risk_score > 21 and
        kibana.alert.rule.type != "threat_match" and
        not kibana.alert.rule.name like "Deprecated - *" and
        not KQL("""kibana.alert.rule.tags : "Rule Type: Higher-Order Rule" """) and
        not kibana.alert.rule.name in ("Abnormally Large DNS Response", "Web Application Suspicious Activity: No User Agent")

// alerts with existing source.ip or host.ip
| eval alert_source_ip = CASE(source.ip is not null, source.ip, null),
       alert_host_ip = CASE(host.ip is not null and source.ip is null, host.ip, null)

| eval Esql.source_ip = COALESCE(alert_source_ip, alert_host_ip)
| where Esql.source_ip is not null and Esql.source_ip != "127.0.0.1" and Esql.source_ip != "::1"

| stats Esql.alerts_count = COUNT(*),
        Esql.event_module_distinct_count = COUNT_DISTINCT(event.module),
        Esql.host_id_distinct_count = COUNT_DISTINCT(host.id),
        Esql.rule_name_distinct_count = COUNT_DISTINCT(kibana.alert.rule.name),
        Esql.event_module_values = VALUES(event.module),
        Esql.message_values = VALUES(message),
        Esql.rule_name = VALUES(kibana.alert.rule.name),
        Esql.event_action_values = VALUES(event.action),
        Esql.event_category_values = VALUES(event.category),
        Esql.process_executable_values = VALUES(process.executable),
        Esql.process_cmdline_values = VALUES(process.command_line),
        Esql.file_path_values = VALUES(file.path),
        Esql.host_id_values = VALUES(host.id),
        Esql.host_ip_values = VALUES(host.ip),
        Esql.destination_ip_values = VALUES(destination.ip),
        Esql.user_name_values = VALUES(user.name),
        SRC_IP = VALUES(source.ip)
        by Esql.source_ip

// filter for different alerts from multiple hosts and where the host.ip of one alert matches the source.ip of the other alert
| eval concat_ip_values = MV_CONCAT(TO_STRING(Esql.host_ip_values), ",")
| eval host_ip_equal_to_source_ip =LOCATE(concat_ip_values, TO_STRING(Esql.source_ip))
| where Esql.rule_name_distinct_count >= 2 and Esql.host_id_distinct_count >= 2 and host_ip_equal_to_source_ip > 0 and SRC_IP is not null and Esql.alerts_count <= 100

// Move single values to their corresponding ECS fields for alerts exclusion
| eval source.ip = mv_min(Esql.source_ip),
       host.id = mv_min(Esql.host_id_values)
| KEEP Esql.*, source.ip, host.id
'''
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 Suspected Lateral Movement from Compromised Host

The detection rule uses alert data to determine when multiple alerts from different integrations involving the same user.name are triggered.

### Possible investigation steps

- Review the alert details to identify the specific host involved and the different modules and rules that triggered the alert.
- Examine the timeline of the alerts to understand the sequence of events and determine if there is a pattern or progression in the tactics used.
- Correlate the alert data with other logs and telemetry from the host, such as process creation, network connections, and file modifications, to gather additional context.
- Investigate any known vulnerabilities or misconfigurations on the host that could have been exploited by the adversary.
- Check for any indicators of compromise (IOCs) associated with the alerts, such as suspicious IP addresses, domains, or file hashes, and search for these across the network.
- Assess the impact and scope of the potential compromise by determining if other hosts or systems have similar alerts or related activity.

### False positive analysis

- Vulnerability scanners.
- Jump hosts, NAT gateways and proxies.

### Response and remediation

- Isolate the affected host from the network immediately to prevent further lateral movement by the adversary.
- Conduct a thorough forensic analysis of the host to identify the specific vulnerabilities exploited and gather evidence of the attack phases involved.
- Remove any identified malicious software or unauthorized access tools from the host, ensuring all persistence mechanisms are eradicated.
- Apply security patches and updates to the host to address any exploited vulnerabilities and prevent similar attacks.
- Restore the host from a known good backup if necessary, ensuring that the backup is free from compromise.
- Monitor the host and network for any signs of re-infection or further suspicious activity, using enhanced logging and alerting based on the identified attack patterns.
- Escalate the incident to the appropriate internal or external cybersecurity teams for further investigation and potential legal action if the attack is part of a larger campaign."""


Stages and Predicates

Stage 1: from

from .alerts-security.*

Stage 2: where

| where kibana.alert.rule.name is not null and kibana.alert.risk_score > 21 and
        kibana.alert.rule.type != "threat_match" and
        not kibana.alert.rule.name like "Deprecated - *" and
        not KQL("""kibana.alert.rule.tags : "Rule Type: Higher-Order Rule" """) and
        not kibana.alert.rule.name in ("Abnormally Large DNS Response", "Web Application Suspicious Activity: No User Agent")

Stage 3: eval

| eval alert_source_ip = CASE(source.ip is not null, source.ip, null),
       alert_host_ip = CASE(host.ip is not null and source.ip is null, host.ip, null)
alert_host_ip =
ifhost.ip is not null and source.ip is nullhost.ip
elsenull
alert_source_ip =
ifsource.ip is not nullsource.ip
elsenull

Stage 4: eval

| eval Esql.source_ip = COALESCE(alert_source_ip, alert_host_ip)

Stage 5: where

| where Esql.source_ip is not null and Esql.source_ip != "127.0.0.1" and Esql.source_ip != "::1"

Stage 6: stats

| stats Esql.alerts_count = COUNT(*),
        Esql.event_module_distinct_count = COUNT_DISTINCT(event.module),
        Esql.host_id_distinct_count = COUNT_DISTINCT(host.id),
        Esql.rule_name_distinct_count = COUNT_DISTINCT(kibana.alert.rule.name),
        Esql.event_module_values = VALUES(event.module),
        Esql.message_values = VALUES(message),
        Esql.rule_name = VALUES(kibana.alert.rule.name),
        Esql.event_action_values = VALUES(event.action),
        Esql.event_category_values = VALUES(event.category),
        Esql.process_executable_values = VALUES(process.executable),
        Esql.process_cmdline_values = VALUES(process.command_line),
        Esql.file_path_values = VALUES(file.path),
        Esql.host_id_values = VALUES(host.id),
        Esql.host_ip_values = VALUES(host.ip),
        Esql.destination_ip_values = VALUES(destination.ip),
        Esql.user_name_values = VALUES(user.name),
        SRC_IP = VALUES(source.ip)
        by Esql.source_ip

Stage 7: eval

| eval concat_ip_values = MV_CONCAT(TO_STRING(Esql.host_ip_values), ",")

Stage 8: eval

| eval host_ip_equal_to_source_ip =LOCATE(concat_ip_values, TO_STRING(Esql.source_ip))

Stage 9: where

| where Esql.rule_name_distinct_count >= 2 and Esql.host_id_distinct_count >= 2 and host_ip_equal_to_source_ip > 0 and SRC_IP is not null and Esql.alerts_count <= 100

Stage 10: eval

| eval source.ip = mv_min(Esql.source_ip),
       host.id = mv_min(Esql.host_id_values)

Stage 11: keep

| KEEP Esql.*, source.ip, host.id

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

Output Fields

These fields are emitted when the rule matches.

FieldSource
Esql.*KEEP Esql.*
source.ipKEEP source.ip
host.idKEEP host.id

Suspicious CronTab Creation or Modification

#
Status
production
Severity
medium
Time window
9m
Author
Elastic
Source
github.com/elastic/detection-rules

Identifies attempts to create or modify a crontab via a process that is not crontab (i.e python, osascript, etc.). This activity should not be highly prevalent and could indicate the use of cron as a persistence mechanism by a threat actor.

MITRE ATT&CK Coverage

Rule Body

[metadata]
creation_date = "2022/04/25"
integration = ["endpoint"]
maturity = "production"
updated_date = "2026/03/24"

[rule]
author = ["Elastic"]
description = """
Identifies attempts to create or modify a crontab via a process that is not crontab (i.e python, osascript, etc.). This
activity should not be highly prevalent and could indicate the use of cron as a persistence mechanism by a threat actor.
"""
from = "now-9m"
index = ["logs-endpoint.events.file*"]
language = "eql"
license = "Elastic License v2"
name = "Suspicious CronTab Creation or Modification"
references = [
    "https://taomm.org/PDFs/vol1/CH%200x02%20Persistence.pdf",
    "https://theevilbit.github.io/beyond/beyond_0004/",
]
risk_score = 47
rule_id = "530178da-92ea-43ce-94c2-8877a826783d"
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 macOS 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, for MacOS it is recommended to select "Traditional Endpoints".
- 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/current/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: macOS",
    "Use Case: Threat Detection",
    "Tactic: Persistence",
    "Data Source: Elastic Defend",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"

query = '''
file where host.os.type == "macos" and event.type != "deletion" and process.name != null and
  file.path like "/private/var/at/tabs/*" and not process.executable == "/usr/bin/crontab"
'''
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 CronTab Creation or Modification

Cron is a time-based job scheduler in Unix-like operating systems, including macOS, used to automate repetitive tasks. Adversaries may exploit cron to maintain persistence by scheduling malicious scripts or commands. The detection rule identifies unusual crontab modifications by non-standard processes, flagging potential misuse by threat actors seeking to establish persistence.

### Possible investigation steps

- Review the process name and executable path that triggered the alert to determine if it is a known legitimate application or a potentially malicious one.
- Examine the file path "/private/var/at/tabs/*" to identify any recent changes or additions to crontab entries that could indicate unauthorized scheduling of tasks.
- Investigate the user account associated with the process to determine if it has a history of legitimate crontab modifications or if it might be compromised.
- Check for any related alerts or logs around the same timeframe that might indicate additional suspicious activity or corroborate the use of cron for persistence.
- Analyze the command or script scheduled in the crontab entry to assess its purpose and potential impact on the system, looking for signs of malicious intent.

### False positive analysis

- System maintenance scripts or legitimate administrative tools may modify crontabs using non-standard processes. Review the process name and executable path to determine if the activity is part of routine maintenance.
- Development or testing environments might use scripts or automation tools that modify crontabs for legitimate purposes. Identify and document these processes to create exceptions in the detection rule.
- Some third-party applications may use cron jobs for updates or scheduled tasks. Verify the legitimacy of these applications and consider excluding their processes if they are known and trusted.
- User-initiated scripts that automate personal tasks could trigger this rule. Educate users on the implications of using cron for personal automation and establish a process for approving such scripts.
- Regularly review and update the list of excluded processes to ensure that only verified and non-threatening activities are exempt from detection.

### Response and remediation

- Immediately isolate the affected macOS system from the network to prevent potential lateral movement or further execution of malicious tasks.
- Terminate any suspicious processes identified as modifying the crontab, especially those not typically associated with crontab modifications, such as python or osascript.
- Review and remove any unauthorized or suspicious entries in the crontab file located at /private/var/at/tabs/* to eliminate persistence mechanisms established by the threat actor.
- Conduct a thorough scan of the system using updated antivirus or endpoint detection and response (EDR) tools to identify and remove any additional malware or malicious scripts.
- Restore the system from a known good backup if the integrity of the system is in question and ensure all security patches and updates are applied.
- Escalate the incident to the security operations center (SOC) or incident response team for further analysis and to determine if additional systems are affected.
- Implement enhanced monitoring and logging for crontab modifications and related processes to detect and respond to similar threats in the future."""


[[rule.threat]]
framework = "MITRE ATT&CK"

[[rule.threat.technique]]
id = "T1053"
name = "Scheduled Task/Job"
reference = "https://attack.mitre.org/techniques/T1053/"

[[rule.threat.technique.subtechnique]]
id = "T1053.003"
name = "Cron"
reference = "https://attack.mitre.org/techniques/T1053/003/"

[rule.threat.tactic]
id = "TA0003"
name = "Persistence"
reference = "https://attack.mitre.org/tactics/TA0003/"

[[rule.threat]]
framework = "MITRE ATT&CK"

[[rule.threat.technique]]
id = "T1053"
name = "Scheduled Task/Job"
reference = "https://attack.mitre.org/techniques/T1053/"

[[rule.threat.technique.subtechnique]]
id = "T1053.003"
name = "Cron"
reference = "https://attack.mitre.org/techniques/T1053/003/"

[rule.threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"

Stages and Predicates

Stage 1: file

file where host.os.type == "macos" and event.type != "deletion" and process.name != null and
  file.path like "/private/var/at/tabs/*" and not process.executable == "/usr/bin/crontab"

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.executableeq/usr/bin/crontabexcludes:process.executable field:"process.executable" value:"/usr/bin/crontab"

Suspicious Print Spooler File Deletion

#
Status
production
Severity
medium
Time window
9m
Author
Elastic
Source
github.com/elastic/detection-rules

Detects deletion of print driver files by an unusual process. This may indicate a clean up attempt post successful privilege escalation via Print Spooler service related vulnerabilities.

Known False Positives

  • Uninstall or manual deletion of a legitimate printing driver files. Verify the printer file metadata such as manufacturer and signature information.

MITRE ATT&CK Coverage

Telemetry Coverage

Rule Body

[metadata]
creation_date = "2021/07/06"
integration = ["endpoint", "windows", "m365_defender", "sentinel_one_cloud_funnel"]
maturity = "production"
updated_date = "2026/05/04"

[rule]
author = ["Elastic"]
description = """
Detects deletion of print driver files by an unusual process. This may indicate a clean up attempt post successful
privilege escalation via Print Spooler service related vulnerabilities.
"""
false_positives = [
    """
    Uninstall or manual deletion of a legitimate printing driver files. Verify the printer file metadata such as
    manufacturer and signature information.
    """,
]
from = "now-9m"
index = [
    "winlogbeat-*",
    "logs-endpoint.events.file-*",
    "logs-windows.sysmon_operational-*",
    "endgame-*",
    "logs-m365_defender.event-*",
    "logs-sentinel_one_cloud_funnel.*",
]
language = "eql"
license = "Elastic License v2"
name = "Suspicious Print Spooler File Deletion"
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 Print Spooler File Deletion

The Print Spooler service in Windows manages print jobs and interactions with printers. Adversaries exploit vulnerabilities in this service to escalate privileges, often deleting print driver files to cover their tracks. The detection rule identifies unusual deletions of these files by processes other than legitimate ones, signaling potential misuse and aiding in early threat detection.

### Possible investigation steps

- Review the alert details to identify the specific file path and name of the deleted DLL file within "C:\\Windows\\System32\\spool\\drivers\\x64\\3\\".
- Examine the process responsible for the deletion by checking the process name and its parent process to determine if it is a known legitimate process or a potentially malicious one.
- Investigate the timeline of events around the deletion to identify any preceding or subsequent suspicious activities, such as privilege escalation attempts or unauthorized access.
- Check for any recent vulnerabilities or exploits related to the Print Spooler service that might have been leveraged in this context.
- Correlate the event with other security logs and alerts from data sources like Sysmon, Microsoft Defender XDR, or SentinelOne to gather additional context and confirm the presence of malicious activity.
- Assess the affected system for any signs of compromise or persistence mechanisms that may have been established following the deletion event.

### False positive analysis

- System maintenance or updates may trigger legitimate deletions of print driver files. Monitor scheduled maintenance activities and correlate them with detected events to confirm legitimacy.
- Third-party printer management software might delete or update driver files as part of its normal operation. Identify and whitelist these processes if they are verified as non-threatening.
- Custom scripts or administrative tools used by IT staff for printer management could inadvertently match the rule's criteria. Review and document these tools, then create exceptions for known safe operations.
- Automated deployment tools that update or clean up printer drivers across the network might cause false positives. Ensure these tools are recognized and excluded from the detection rule if they are part of routine operations.

### Response and remediation

- Immediately isolate the affected system from the network to prevent further unauthorized access or lateral movement.
- Terminate any suspicious processes identified as responsible for the deletion of print driver files, ensuring they are not legitimate system processes.
- Restore the deleted print driver files from a known good backup to ensure the Print Spooler service functions correctly.
- Conduct a thorough review of user accounts and privileges on the affected system to identify and revoke any unauthorized privilege escalations.
- Apply the latest security patches and updates to the Print Spooler service and related components to mitigate known vulnerabilities.
- Monitor the affected system and network for any signs of further suspicious activity, focusing on similar file deletion patterns or privilege escalation attempts.
- Escalate the incident to the security operations center (SOC) or relevant IT security team for further investigation and to assess the need for broader organizational response measures."""
references = ["https://msrc.microsoft.com/update-guide/vulnerability/CVE-2021-34527"]
risk_score = 47
rule_id = "c4818812-d44f-47be-aaef-4cfb2f9cc799"
severity = "medium"
tags = [
    "Domain: Endpoint",
    "OS: Windows",
    "Use Case: Threat Detection",
    "Tactic: Privilege Escalation",
    "Data Source: Elastic Endgame",
    "Use Case: Vulnerability",
    "Data Source: Elastic Defend",
    "Data Source: Sysmon",
    "Data Source: Microsoft Defender XDR",
    "Data Source: SentinelOne",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"

query = '''
file where host.os.type == "windows" and event.type == "deletion" and
  file.extension : "dll" and file.path : "?:\\Windows\\System32\\spool\\drivers\\x64\\3\\*.dll" and
  not process.name : ("spoolsv.exe", "dllhost.exe", "explorer.exe")
'''

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:

- [Microsoft Defender XDR](https://ela.st/m365-defender)
- [SentinelOne Cloud Funnel](https://ela.st/sentinel-one-cloud-funnel)
- [Sysmon Event ID 23 - File Delete](https://ela.st/sysmon-event-23-setup)
"""


[[rule.threat]]
framework = "MITRE ATT&CK"

[[rule.threat.technique]]
id = "T1068"
name = "Exploitation for Privilege Escalation"
reference = "https://attack.mitre.org/techniques/T1068/"

[rule.threat.tactic]
id = "TA0004"
name = "Privilege Escalation"
reference = "https://attack.mitre.org/tactics/TA0004/"

[[rule.threat]]
framework = "MITRE ATT&CK"

[[rule.threat.technique]]
id = "T1070"
name = "Indicator Removal"
reference = "https://attack.mitre.org/techniques/T1070/"

[[rule.threat.technique.subtechnique]]
id = "T1070.004"
name = "File Deletion"
reference = "https://attack.mitre.org/techniques/T1070/004/"

[rule.threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"

Stages and Predicates

Stage 1: file

file where host.os.type == "windows" and event.type == "deletion" and
  file.extension : "dll" and file.path : "?:\\Windows\\System32\\spool\\drivers\\x64\\3\\*.dll" and
  not process.name : ("spoolsv.exe", "dllhost.exe", "explorer.exe")

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

Suspicious Process from FortiClient VPN Trace Script

#
Source
github.com/elastic/protections-artifacts

Identifies LOLBAS or download utilities spawned by cmd.exe after execution of a script from the FortiClient VPN trace scripts directory. This may indicate CVE-2026-35616 exploitation against FortiClient EMS where adversaries pushed malicious on_connect scripts to managed endpoints.

MITRE ATT&CK Coverage

TacticTechniques
Initial Access

Rule Body

[rule]
description = """
Identifies LOLBAS or download utilities spawned by cmd.exe after execution of a script from the FortiClient VPN trace
scripts directory. This may indicate CVE-2026-35616 exploitation against FortiClient EMS where adversaries pushed
malicious on_connect scripts to managed endpoints.
"""
id = "1b054bc6-d0e1-40bd-aed8-91c4b455cbc4"
license = "Elastic License v2"
name = "Suspicious Process from FortiClient VPN Trace Script"
os_list = ["windows"]
reference = [
    "https://arcticwolf.com/resources/blog/forticlient-ems-exploited-via-cve-2026-35616-to-deliver-ekz-infostealer-disguised-as-a-fortinet-patch/",
]
version = "1.0.1"

query = '''
process where event.type == "start" and event.action == "start" and
  process.parent.name : "cmd.exe" and
  process.name : (
    "rundll32.exe", "mshta.exe", "msiexec.exe", "powershell.exe", "bitsadmin.exe", "curl.exe", "regsvr32.exe",
    "certutil.exe", "msbuild.exe", "certreq.exe", "cmd.exe", "wmic.exe", "schtasks.exe", "sc.exe", "wscript.exe", 
    "cscript.exe"
  ) and 
  process.parent.command_line : "*C:\\Program Files\\Fortinet\\FortiClient\\logs\\Trace\\scripts\\*" and 
  not process.args :("c:\\Program Files\\Fortinet\\VPNDisconnect.ps1", "c:\\Program Files\\Fortinet\\VPNConnect.ps1", "\\\\*\\NETLOGON\\VPNConnectScript.VBS")
'''

min_endpoint_version = "7.15.0"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1190"
name = "Exploit Public-Facing Application"
reference = "https://attack.mitre.org/techniques/T1190/"


[threat.tactic]
id = "TA0001"
name = "Initial Access"
reference = "https://attack.mitre.org/tactics/TA0001/"

[internal]
min_endpoint_version = "7.15.0"

Stages and Predicates

Stage 1: process

process where event.type == "start" and event.action == "start" and
  process.parent.name : "cmd.exe" and
  process.name : (
    "rundll32.exe", "mshta.exe", "msiexec.exe", "powershell.exe", "bitsadmin.exe", "curl.exe", "regsvr32.exe",
    "certutil.exe", "msbuild.exe", "certreq.exe", "cmd.exe", "wmic.exe", "schtasks.exe", "sc.exe", "wscript.exe", 
    "cscript.exe"
  ) and 
  process.parent.command_line : "*C:\\Program Files\\Fortinet\\FortiClient\\logs\\Trace\\scripts\\*" and 
  not process.args :("c:\\Program Files\\Fortinet\\VPNDisconnect.ps1", "c:\\Program Files\\Fortinet\\VPNConnect.ps1", "\\\\*\\NETLOGON\\VPNConnectScript.VBS")

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • start corpus 388 (elastic 388)
field:"EventType" kind:eq value:"start"
event.typeeq
  • start corpus 1036 (elastic 1036)
field:"event.type" kind:eq value:"start"
process.namewildcard
  • bitsadmin.exe corpus 25 (elastic 22, splunk 2, kusto 1)
  • certreq.exe corpus 20 (elastic 20)
  • certutil.exe corpus 45 (elastic 39, splunk 6)
  • cmd.exe corpus 122 (elastic 93, splunk 29)
  • cscript.exe corpus 68 (elastic 66, splunk 2)
  • curl.exe corpus 34 (elastic 32, splunk 2)
  • msbuild.exe corpus 39 (elastic 36, splunk 3)
  • mshta.exe corpus 84 (elastic 80, splunk 4)
  • msiexec.exe corpus 45 (elastic 40, splunk 5)
  • powershell.exe corpus 187 (elastic 140, splunk 44, kusto 3)
  • regsvr32.exe corpus 74 (elastic 69, splunk 5)
  • rundll32.exe corpus 123 (elastic 100, splunk 23)
  • sc.exe corpus 32 (elastic 17, splunk 15)
  • schtasks.exe corpus 30 (elastic 19, splunk 11)
  • wmic.exe corpus 66 (elastic 39, splunk 27)
  • wscript.exe corpus 84 (elastic 82, splunk 1, kusto 1)
field:"process_basename" kind:wildcard
process.parent.command_linewildcard
  • *C:\Program Files\Fortinet\FortiClient\logs\Trace\scripts\*
field:"ParentCommandLine" kind:wildcard value:"*C:\Program Files\Fortinet\FortiClient\logs\Trace\scripts\*"
process.parent.namewildcard
  • cmd.exe corpus 37 (elastic 32, splunk 4, kusto 1)
field:"parent_process_basename" kind:wildcard value:"cmd.exe"

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.argswildcardc:\Program Files\Fortinet\VPNDisconnect.ps1, c:\Program Files\Fortinet\VPNConnect.ps1, \\*\NETLOGON\VPNConnectScript.VBSexcludes:process.args field:"process.args" value:"c:\Program Files\Fortinet\VPNDisconnect.ps1" field:"process.args" value:"c:\Program Files\Fortinet\VPNConnect.ps1" field:"process.args" value:"\\*\NETLOGON\VPNConnectScript.VBS"

Suspicious Shell Extension Handler Registry Modification

#
Time window
1m
Sequence by
process.entity_id
Source
github.com/elastic/protections-artifacts

Identifies registry modification consistent with the SolarMarker Backdoor installer that registers a rogue custom shell extension handler which runs a PowerShell command when a file with a matching extension is opened.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
Identifies registry modification consistent with the SolarMarker Backdoor installer that registers a rogue custom shell
extension handler which runs a PowerShell command when a file with a matching extension is opened.
"""
id = "f7e6d239-9af5-42e3-8d23-91e7188a5cb0"
license = "Elastic License v2"
name = "Suspicious Shell Extension Handler Registry Modification"
os_list = ["windows"]
reference = [
    "https://blog.morphisec.com/new-jupyter-evasive-delivery-through-msi-installer",
    "https://www.ired.team/offensive-security/persistence/hijacking-default-file-extension",
    "https://www.binarydefense.com/mars-deimos-solarmarker-jupyter-infostealer-part-1/",
]
version = "1.0.30"

query = '''
sequence by process.entity_id with maxspan=1m
 [process where event.action == "start" and 
   (
    process.name : ("reg.exe", "powershell.exe", "msiexec.exe", "rundll32.exe", "regsvr32.exe") or
    (process.Ext.device.product_id : ("Virtual DVD-ROM", "Virtual Disk") and not process.executable : "C:\\*") or
    (process.Ext.relative_file_creation_time <= 300 or process.Ext.relative_file_name_modify_time <= 300)
    )]
 [registry where
  registry.path : ("HKEY_USERS\\S-1-5-21-*Classes\\*\\shell\\open\\command*", "HKEY_USERS\\S-1-12-1-*Classes\\*\\shell\\open\\command*") and

  /* Command value contains PowerShell and its length is greater or equal than 200 chars */
  registry.data.strings : ("*PowerShell*", "*SyncAppvPublishingServer*", "*cmd.exe *", "*FromBase64String*") and length(registry.data.strings) >= 200]
'''

min_endpoint_version = "8.4.0"
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0

[[actions]]
action = "kill_process"
field = "process.parent.entity_id"
state = 0

[[optional_actions]]
action = "rollback"
field = "process.entity_id"
state = 0

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1546"
name = "Event Triggered Execution"
reference = "https://attack.mitre.org/techniques/T1546/"
[[threat.technique.subtechnique]]
id = "T1546.001"
name = "Change Default File Association"
reference = "https://attack.mitre.org/techniques/T1546/001/"



[threat.tactic]
id = "TA0003"
name = "Persistence"
reference = "https://attack.mitre.org/tactics/TA0003/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1112"
name = "Modify Registry"
reference = "https://attack.mitre.org/techniques/T1112/"


[threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"

[internal]
min_endpoint_version = "8.4.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.action == "start" and 
   (
    process.name : ("reg.exe", "powershell.exe", "msiexec.exe", "rundll32.exe", "regsvr32.exe") or
    (process.Ext.device.product_id : ("Virtual DVD-ROM", "Virtual Disk") and not process.executable : "C:\\*") or
    (process.Ext.relative_file_creation_time <= 300 or process.Ext.relative_file_name_modify_time <= 300)
    )]

Stage 2: registry

[registry where
  registry.path : ("HKEY_USERS\\S-1-5-21-*Classes\\*\\shell\\open\\command*", "HKEY_USERS\\S-1-12-1-*Classes\\*\\shell\\open\\command*") and
  registry.data.strings : ("*PowerShell*", "*SyncAppvPublishingServer*", "*cmd.exe *", "*FromBase64String*") and length(registry.data.strings) >= 200]

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • start corpus 388 (elastic 388)
field:"EventType" kind:eq value:"start"
process.Ext.device.product_idwildcard
  • Virtual DVD-ROM corpus 13 (elastic 13)
  • Virtual Disk corpus 13 (elastic 13)
field:"process.Ext.device.product_id" kind:wildcard
process.Ext.relative_file_creation_timele
  • 300 transforms: number corpus 11 (elastic 11)
field:"process.Ext.relative_file_creation_time" kind:le value:"300"
process.Ext.relative_file_name_modify_timele
  • 300 transforms: number corpus 9 (elastic 9)
field:"process.Ext.relative_file_name_modify_time" kind:le value:"300"
process.namewildcard
  • msiexec.exe corpus 45 (elastic 40, splunk 5)
  • powershell.exe corpus 187 (elastic 140, splunk 44, kusto 3)
  • reg.exe corpus 28 (elastic 18, splunk 9, kusto 1)
  • regsvr32.exe corpus 74 (elastic 69, splunk 5)
  • rundll32.exe corpus 123 (elastic 100, splunk 23)
field:"process_basename" kind:wildcard
registry.data.stringswildcard
  • *FromBase64String* corpus 2 (sigma 1, elastic 1)
  • *PowerShell* corpus 10 (sigma 9, elastic 1)
  • *SyncAppvPublishingServer*
  • *cmd.exe *
field:"Details" kind:wildcard
registry.pathwildcard
  • HKEY_USERS\S-1-12-1-*Classes\*\shell\open\command*
  • HKEY_USERS\S-1-5-21-*Classes\*\shell\open\command*
field:"TargetObject" kind:wildcard

Suspicious Write Attempt to AppArmor Policy Management Files

#
Status
production
Severity
medium
Time window
9m
Author
Elastic
Source
github.com/elastic/detection-rules

Detects processes attempting to write to AppArmor policy management pseudo-files located under "/sys/kernel/security/apparmor/". These special kernel interfaces are used to load, replace, or remove AppArmor profiles (".load", ".replace", ".remove"). In normal environments, AppArmor policy management is typically performed by administrative tools such as "apparmor_parser" during system initialization or package installation. Direct interaction with these pseudo-files from shell utilities, interpreters, or scripting environments is uncommon and may indicate attempts to modify security policy at runtime. Adversaries may abuse these interfaces to weaken or disable AppArmor protections, introduce malicious profiles, or exploit vulnerabilities in the AppArmor policy parser as part of local privilege escalation chains.

MITRE ATT&CK Coverage

TacticTechniques
Defense Impairment

Rule Body

[metadata]
creation_date = "2026/03/17"
integration = ["endpoint", "crowdstrike", "sentinel_one_cloud_funnel"]
maturity = "production"
updated_date = "2026/03/17"

[rule]
author = ["Elastic"]
description = """
Detects processes attempting to write to AppArmor policy management pseudo-files located
under "/sys/kernel/security/apparmor/". These special kernel interfaces are used to load,
replace, or remove AppArmor profiles (".load", ".replace", ".remove"). In normal environments,
AppArmor policy management is typically performed by administrative tools such as "apparmor_parser"
during system initialization or package installation. Direct interaction with these pseudo-files
from shell utilities, interpreters, or scripting environments is uncommon and may indicate attempts
to modify security policy at runtime. Adversaries may abuse these interfaces to weaken or disable
AppArmor protections, introduce malicious profiles, or exploit vulnerabilities in the AppArmor policy
parser as part of local privilege escalation chains.
"""
from = "now-9m"
index = [
    "logs-endpoint.events.process*",
    "endgame-*",
    "logs-crowdstrike.fdr*",
    "logs-sentinel_one_cloud_funnel.*",
]
language = "eql"
license = "Elastic License v2"
name = "Suspicious Write Attempt to AppArmor Policy Management Files"
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 Write Attempt to AppArmor Policy Management Files

This rule flags shells, scripting runtimes, and basic file utilities trying to write directly to AppArmor’s policy control files, an unusual action that can change or remove enforcement while the system is running. An attacker with local code execution may echo a crafted profile into `.replace` or write to `.remove` from a shell script to weaken confinement before dumping credentials or launching a privilege-escalation chain.

### Possible investigation steps

- Determine whether the activity aligns with authorized package installation, configuration management, or AppArmor maintenance by correlating the timestamp with change tickets, software updates, and administrator sessions.
- Reconstruct the full parent-child execution chain and user context to identify how the write was initiated, whether it came from an interactive shell, script, container entrypoint, or remotely spawned session, and whether elevated privileges were obtained just beforehand.
- Capture the exact payload or referenced file used in the write attempt and compare it to approved AppArmor profiles to determine whether the action was loading a new profile, weakening an existing one, or removing confinement entirely.
- Verify the system’s current AppArmor state immediately after the event, including enforcement mode, recently modified or unloaded profiles, and any audit or kernel messages indicating parser errors, profile replacement, or successful policy removal.
- Investigate adjacent activity from the same user, session, and host for signs of defense evasion or privilege escalation, such as sudo abuse, exploitation traces, disabling other security controls, credential access, or rapid execution of binaries that would normally be confined.

### False positive analysis

- A legitimate system initialization or package maintenance script may use `echo`, `tee`, `cat`, or a shell redirection to load or replace an approved AppArmor profile, so verify the parent process and event timing align with boot activity or an authorized update and that the profile content matches a known file under `/etc/apparmor.d/`.
- An administrator or deployment script may temporarily reload or remove a profile during sanctioned application troubleshooting, so confirm the executing user or service account, the script location and change record, and that the expected AppArmor profile was restored or reloaded immediately afterward.

### Response and remediation

- Isolate the affected Linux host from the network and suspend interactive access while preserving the shell history, the script or payload used to write to `/sys/kernel/security/apparmor/.load`, `.replace`, or `.remove`, and any related dropped files for forensic review.
- Re-enable AppArmor enforcement from trusted administration tooling, compare currently loaded profiles with the approved baseline under `/etc/apparmor.d/`, and remove any unauthorized profile loads, replacements, or profile removals introduced by the attacker.
- Hunt for and delete persistence established around the same activity, including new or modified `systemd` services, cron jobs, startup scripts, SSH `authorized_keys` entries, `sudoers` changes, and binaries or scripts placed in writable directories.
- Escalate immediately to incident response if AppArmor protections were successfully weakened or removed, a privileged service profile was altered, root access is suspected, or similar write attempts appear on additional Linux systems.
- Restore the host to a known-good state from a trusted image or approved configuration backup when system integrity is uncertain, then rotate credentials used on the host and harden access so only authorized administrators and deployment tooling can modify AppArmor policies.
"""
references = [
    "https://cdn2.qualys.com/advisory/2026/03/10/crack-armor.txt",
    "https://blog.qualys.com/vulnerabilities-threat-research/2026/03/12/crackarmor-critical-apparmor-flaws-enable-local-privilege-escalation-to-root",
]
risk_score = 47
rule_id = "8293bf1f-8dd0-434e-b52a-1aa6ec101777"
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: Elastic Endgame",
    "Data Source: Crowdstrike",
    "Data Source: SentinelOne",
    "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", "ProcessRollup2") and
( 
  process.name in (
    "cat", "echo", "tee", "dd", "truncate", "bash", "dash", "sh", "tcsh", "csh", "zsh", "ksh", "fish",
    "busybox", "awk", "sed", "xargs", "find", "grep", "node", "timeout", "env"
  ) or
  process.name like (".*", "python*", "perl*", "ruby*", "lua*", "php*")
) and
process.command_line like (
  "*/sys/kernel/security/apparmor/.load*",
  "*/sys/kernel/security/apparmor/.replace*",
  "*/sys/kernel/security/apparmor/.remove*"
)
'''

[[rule.threat]]
framework = "MITRE ATT&CK"

[[rule.threat.technique]]
id = "T1562"
name = "Impair Defenses"
reference = "https://attack.mitre.org/techniques/T1562/"

[[rule.threat.technique.subtechnique]]
id = "T1562.001"
name = "Disable or Modify Tools"
reference = "https://attack.mitre.org/techniques/T1562/001/"

[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", "ProcessRollup2") and
( 
  process.name in (
    "cat", "echo", "tee", "dd", "truncate", "bash", "dash", "sh", "tcsh", "csh", "zsh", "ksh", "fish",
    "busybox", "awk", "sed", "xargs", "find", "grep", "node", "timeout", "env"
  ) or
  process.name like (".*", "python*", "perl*", "ruby*", "lua*", "php*")
) and
process.command_line like (
  "*/sys/kernel/security/apparmor/.load*",
  "*/sys/kernel/security/apparmor/.replace*",
  "*/sys/kernel/security/apparmor/.remove*"
)

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actionin
  • ProcessRollup2
  • exec
  • exec_event
  • start
field:"EventType" kind:in
event.typeeq
  • start
field:"event.type" kind:eq value:"start"
process.command_linewildcard
  • */sys/kernel/security/apparmor/.load*
  • */sys/kernel/security/apparmor/.remove*
  • */sys/kernel/security/apparmor/.replace*
field:"CommandLine" kind:wildcard
process.namein
  • awk
  • bash
  • busybox
  • cat
  • csh
  • dash
  • dd
  • echo
  • env
  • find
  • fish
  • grep
  • ksh
  • node
  • sed
  • sh
  • tcsh
  • tee
  • timeout
  • truncate
  • xargs
  • zsh
field:"process_basename" kind:in
process.namewildcard
  • .*
  • lua*
  • perl*
  • php*
  • python*
  • ruby*
field:"process_basename" kind:wildcard

Back to all Elastic rules