Detection rules › Elastic

Elastic rules: 18

Apple Scripting Execution with Administrator Privileges

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

Identifies execution of the Apple script interpreter (osascript) without a password prompt and with administrator privileges.

MITRE ATT&CK Coverage

Rule Body

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

[rule]
author = ["Elastic"]
description = """
Identifies execution of the Apple script interpreter (osascript) without a password prompt and with administrator
privileges.
"""
from = "now-9m"
index = ["logs-endpoint.events.process*"]
language = "eql"
license = "Elastic License v2"
name = "Apple Scripting Execution with Administrator Privileges"
references = ["https://discussions.apple.com/thread/2266150"]
risk_score = 47
rule_id = "827f8d8f-4117-4ae4-b551-f56d54b9da6b"
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: Execution",
    "Tactic: Privilege Escalation",
    "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.name == "osascript" and
 process.command_line : "osascript*with administrator privileges" and
 ((process.parent.code_signature.trusted == false or process.parent.code_signature.exists == false) or process.Ext.effective_parent.executable like ("/tmp/*", "/private/tmp/*", "/Users/Shared/*"))
'''
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 Apple Scripting Execution with Administrator Privileges

AppleScript, a scripting language for macOS, automates tasks by controlling applications and system functions. Adversaries may exploit it to execute scripts with elevated privileges, bypassing password prompts, to gain unauthorized access or escalate privileges. The detection rule identifies such misuse by monitoring the execution of AppleScript with admin rights, excluding benign parent processes like Electron, to flag potential threats.

### Possible investigation steps

- Review the process details to confirm the execution of 'osascript' with administrator privileges, focusing on the command line arguments to understand the script's intent.
- Investigate the parent process of 'osascript' to determine if it is a known and trusted application, ensuring it is not 'Electron' or any other excluded parent processes.
- Check the user account associated with the 'osascript' execution to verify if it is a legitimate account and assess if there are any signs of compromise or unauthorized access.
- Analyze recent system logs and user activity to identify any unusual behavior or patterns that coincide with the time of the alert.
- Correlate this event with other security alerts or incidents to determine if it is part of a broader attack or isolated incident.

### False positive analysis

- Known false positives may arise from legitimate applications that use AppleScript with administrator privileges for valid operations, such as software installers or system management tools.
- Exclude processes with benign parent applications like Electron, as specified in the rule, to reduce false positives from common development environments.
- Consider adding exceptions for other trusted applications that frequently use AppleScript with elevated privileges, ensuring they are verified and necessary for business operations.
- Regularly review and update the list of excluded applications to adapt to changes in software usage and maintain effective threat detection.
- Monitor the frequency and context of alerts to identify patterns that may indicate false positives, adjusting the detection rule as needed to minimize unnecessary alerts.

### Response and remediation

- Immediately isolate the affected macOS system from the network to prevent further unauthorized access or lateral movement.
- Terminate any suspicious osascript processes running with administrator privileges that were not initiated by known, legitimate applications.
- Review system logs and process execution history to identify any unauthorized changes or access that occurred during the incident.
- Revoke any compromised credentials or accounts that may have been used to execute the AppleScript with elevated privileges.
- Restore the system to a known good state from a backup taken before the unauthorized script execution, if necessary.
- Implement application whitelisting to prevent unauthorized scripts from executing with elevated privileges in the future.
- Escalate the incident to the security operations team for further investigation and to assess the need for additional security controls or monitoring enhancements."""


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

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

[[rule.threat.technique]]
id = "T1548"
name = "Abuse Elevation Control Mechanism"
reference = "https://attack.mitre.org/techniques/T1548/"

[[rule.threat.technique.subtechnique]]
id = "T1548.004"
name = "Elevated Execution with Prompt"
reference = "https://attack.mitre.org/techniques/T1548/004/"

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

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

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

Stages and Predicates

Stage 1: process

process where host.os.type == "macos" and event.type in ("start", "process_started") and process.name == "osascript" and
 process.command_line : "osascript*with administrator privileges" and
 ((process.parent.code_signature.trusted == false or process.parent.code_signature.exists == false) or process.Ext.effective_parent.executable like ("/tmp/*", "/private/tmp/*", "/Users/Shared/*"))

Indicators

These rows show field, operator, and value matches.

AWS Bedrock Model Invocation Logging Disabled or Modified

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

Detects when an AWS Bedrock model invocation logging configuration is deleted or overwritten via the DeleteModelInvocationLoggingConfiguration or PutModelInvocationLoggingConfiguration API calls. Model invocation logging is the source that feeds the logs-aws_bedrock.invocation-* dataset relied upon by all data-plane Bedrock detections. An adversary who has gained access to a Bedrock environment can blind defenders by deleting this configuration, or by using the Put API to redirect logs to an attacker-controlled or non-monitored S3 bucket or CloudWatch log group. Because this single control-plane action can neutralize the entire data-plane detection stack, it is a high-value evasion technique that should be validated against expected administrative change activity.

Known False Positives

  • Cloud or security administrators may legitimately delete or reconfigure Bedrock model invocation logging during onboarding, log destination migrations, or compliance changes. Verify whether the user identity, user agent, and source IP are expected to make this change. For PutModelInvocationLoggingConfiguration, confirm that the destination S3 bucket or CloudWatch log group remains owned and monitored by your organization. Known, planned changes can be exempted from this rule.

MITRE ATT&CK Coverage

Telemetry Coverage

Rules Detecting the Same Action

These rules filter on the same operation.

Rule Body

[metadata]
creation_date = "2026/06/04"
integration = ["aws"]
maturity = "production"
updated_date = "2026/06/04"

[rule]
author = ["Elastic"]
description = """
Detects when an AWS Bedrock model invocation logging configuration is deleted or overwritten via the
DeleteModelInvocationLoggingConfiguration or PutModelInvocationLoggingConfiguration API calls. Model invocation logging
is the source that feeds the logs-aws_bedrock.invocation-* dataset relied upon by all data-plane Bedrock detections. An
adversary who has gained access to a Bedrock environment can blind defenders by deleting this configuration, or by using
the Put API to redirect logs to an attacker-controlled or non-monitored S3 bucket or CloudWatch log group. Because this
single control-plane action can neutralize the entire data-plane detection stack, it is a high-value evasion technique
that should be validated against expected administrative change activity.
"""
false_positives = [
    """
    Cloud or security administrators may legitimately delete or reconfigure Bedrock model invocation logging during
    onboarding, log destination migrations, or compliance changes. Verify whether the user identity, user agent, and
    source IP are expected to make this change. For PutModelInvocationLoggingConfiguration, confirm that the destination
    S3 bucket or CloudWatch log group remains owned and monitored by your organization. Known, planned changes can be
    exempted from this rule.
    """,
]
from = "now-6m"
index = ["logs-aws.cloudtrail-*"]
language = "kuery"
license = "Elastic License v2"
name = "AWS Bedrock Model Invocation Logging Disabled or Modified"
note = """## Triage and analysis

### Investigating AWS Bedrock Model Invocation Logging Disabled or Modified

AWS Bedrock model invocation logging captures the prompts and responses processed by foundation models and delivers them
to an S3 bucket or CloudWatch log group. This data feeds the `logs-aws_bedrock.invocation-*` dataset that all data-plane
Bedrock detections depend on. Deleting the configuration stops this telemetry entirely, while overwriting it with `Put`
can silently redirect logs to a destination the defender does not monitor. Either action effectively blinds the
data-plane detection stack, making this a high-priority defense-evasion event.

#### Possible investigation steps

- **Identify the actor and context**
  - Review `aws.cloudtrail.user_identity.arn`, `aws.cloudtrail.user_identity.type`, `aws.cloudtrail.user_identity.access_key_id`, `user_agent.original`, and `source.ip`.
  - Determine whether the identity is an approved Bedrock administrator and whether a change request exists.
- **Determine the exact action**
  - For `DeleteModelInvocationLoggingConfiguration`, logging is being turned off entirely — confirm this is intentional.
  - For `PutModelInvocationLoggingConfiguration`, inspect `aws.cloudtrail.flattened.request_parameters` for the new
    `s3Config` bucket name / key prefix and `cloudWatchConfig` log group, and verify they are owned and monitored by your org.
- **Correlate surrounding activity**
  - Pivot on the same identity, `source.ip`, and `cloud.account.id` for prior enumeration
    (`GetModelInvocationLoggingConfiguration`) or follow-on Bedrock data-plane activity (model invocations) that would now
    be unlogged.
  - Check for parallel logging-tampering against CloudTrail, Config, or GuardDuty.

### False positive analysis

- **Planned changes**: Logging migrations or compliance updates may legitimately reconfigure or remove the
  configuration. Validate against change tickets and infrastructure-as-code pipelines.

### Response and remediation

- If unauthorized, restore model invocation logging to the approved destination and verify log delivery resumes into
  `logs-aws_bedrock.invocation-*`.
- Review and secure any attacker-specified S3 bucket or CloudWatch log group, and treat data sent there as exposed.
- Audit the actor's recent Bedrock and IAM activity and rotate credentials if compromise is suspected.
- Restrict `bedrock:DeleteModelInvocationLoggingConfiguration` and `bedrock:PutModelInvocationLoggingConfiguration` to a
  small set of administrative roles and alert on changes.
"""
references = [
    "https://docs.aws.amazon.com/bedrock/latest/APIReference/API_DeleteModelInvocationLoggingConfiguration.html",
    "https://docs.aws.amazon.com/bedrock/latest/APIReference/API_PutModelInvocationLoggingConfiguration.html",
    "https://docs.aws.amazon.com/bedrock/latest/userguide/model-invocation-logging.html"
]
risk_score = 73
rule_id = "fa830742-fd41-4b12-a287-2c57bdf079ef"
severity = "high"
tags = [
    "Domain: Cloud",
    "Domain: LLM",
    "Data Source: AWS",
    "Data Source: AWS CloudTrail",
    "Data Source: Amazon Web Services",
    "Data Source: Amazon Bedrock",
    "Use Case: Log Auditing",
    "Use Case: Threat Detection",
    "Resources: Investigation Guide",
    "Tactic: Defense Evasion",
]
timestamp_override = "event.ingested"
type = "query"

query = '''
data_stream.dataset: "aws.cloudtrail" and
    event.provider: "bedrock.amazonaws.com" and
    event.action: ("DeleteModelInvocationLoggingConfiguration" or "PutModelInvocationLoggingConfiguration") and 
    event.outcome: "success"
'''


[[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.008"
name = "Disable or Modify Cloud Logs"
reference = "https://attack.mitre.org/techniques/T1562/008/"

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

[rule.investigation_fields]
field_names = [
    "@timestamp",
    "user.name",
    "user_agent.original",
    "source.ip",
    "source.as.number",
    "aws.cloudtrail.user_identity.arn",
    "aws.cloudtrail.user_identity.type",
    "aws.cloudtrail.user_identity.access_key_id",
    "event.action",
    "event.provider",
    "event.outcome",
    "cloud.account.id",
    "cloud.region",
    "aws.cloudtrail.flattened.request_parameters",
    "aws.cloudtrail.response_elements",
]

Stages and Predicates

Stage 1: query

data_stream.dataset: "aws.cloudtrail" and
    event.provider: "bedrock.amazonaws.com" and
    event.action: ("DeleteModelInvocationLoggingConfiguration" or "PutModelInvocationLoggingConfiguration") and 
    event.outcome: "success"

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
data_stream.dataseteq
  • aws.cloudtrail corpus 143 (elastic 143)
field:"data_stream.dataset" kind:eq value:"aws.cloudtrail"
event.actionin
  • DeleteModelInvocationLoggingConfiguration
  • PutModelInvocationLoggingConfiguration
field:"EventType" kind:in
event.outcomeeq
  • success corpus 306 (elastic 306)
field:"event.outcome" kind:eq value:"success"
event.providereq
  • bedrock.amazonaws.com corpus 13 (elastic 13)
field:"Provider_Name" kind:eq value:"bedrock.amazonaws.com"

AWS EKS Access Entry Modified

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

Detects successful Amazon EKS Access Entries API operations that create, update, attach, detach, or delete authentication mappings between IAM principals and the cluster. Changes to access entries alter who can authenticate to Kubernetes and what Kubernetes-level permissions they receive, without requiring edits to in-cluster RBAC objects. Unexpected callers or timing may indicate persistence or privilege abuse. Common automation identities (service-linked roles, eksctl, Terraform, CloudFormation role patterns) are excluded to reduce noise; tune further for your deployment pipelines.

Known False Positives

  • Cluster provisioning, GitOps, or approved platform automation may perform these APIs under IAM principals whose ARNs do not match the exclusion patterns. Baseline expected roles and expand exclusions if needed.

MITRE ATT&CK Coverage

Telemetry Coverage

Rules Detecting the Same Action

These rules filter on the same operation.

Rule Body

[metadata]
creation_date = "2026/05/06"
integration = ["aws"]
maturity = "production"
updated_date = "2026/05/06"

[rule]
author = ["Elastic"]
description = """
Detects successful Amazon EKS Access Entries API operations that create, update, attach, detach, or delete authentication
mappings between IAM principals and the cluster. Changes to access entries alter who can authenticate to Kubernetes and
what Kubernetes-level permissions they receive, without requiring edits to in-cluster RBAC objects. Unexpected callers
or timing may indicate persistence or privilege abuse. Common automation identities (service-linked roles, eksctl,
Terraform, CloudFormation role patterns) are excluded to reduce noise; tune further for your deployment pipelines.
"""
false_positives = [
    """
    Cluster provisioning, GitOps, or approved platform automation may perform these APIs under IAM principals whose ARNs do
    not match the exclusion patterns. Baseline expected roles and expand exclusions if needed.
    """,
]
from = "now-6m"
index = ["filebeat-*", "logs-aws.cloudtrail-*"]
language = "kuery"
license = "Elastic License v2"
name = "AWS EKS Access Entry Modified"
note = """## Triage and analysis

### Investigating AWS EKS Access Entry Modified

Review aws.cloudtrail.user_identity (ARN, type), user.name, source.ip, user_agent.original, cloud.account.id, and
cloud.region. Map event.action to intent: new principal (CreateAccessEntry), policy binding changes (AssociateAccessPolicy,
DisassociateAccessPolicy), metadata updates (UpdateAccessEntry), or removal (DeleteAccessEntry).

### Possible investigation steps

- Inspect aws.cloudtrail.request_parameters and response_elements for cluster name, principal ARN, and policy ARNs.
- Compare against change management and infrastructure-as-code deploy windows.
- Correlate with Kubernetes audit logs for subsequent API activity from identities tied to the affected access entry.
- Pair with the higher-fidelity rule EKS Access Entry Granted Cluster Admin Policy when AssociateAccessPolicy fires.

### Response and remediation

- If unauthorized, revert access entry changes via AWS APIs or console; restrict eks:* permissions and review SCPs.
- Rotate credentials for compromised IAM principals as appropriate.

### Additional information

- [Amazon EKS access entries](https://docs.aws.amazon.com/eks/latest/userguide/access-entries.html)
"""
references = [
    "https://docs.aws.amazon.com/eks/latest/userguide/access-entries.html",
]
risk_score = 47
rule_id = "90c0ce77-3fb4-484f-a8ad-4648e12b35b1"
severity = "medium"
tags = [
    "Domain: Cloud",
    "Domain: Kubernetes",
    "Data Source: AWS",
    "Data Source: Amazon Web Services",
    "Data Source: AWS CloudTrail",
    "Use Case: Threat Detection",
    "Tactic: Persistence",
    "Tactic: Privilege Escalation",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "query"
query = '''
data_stream.dataset:"aws.cloudtrail" and event.provider:"eks.amazonaws.com" and
event.action:("CreateAccessEntry" or "AssociateAccessPolicy" or "UpdateAccessEntry" or "DisassociateAccessPolicy" or "DeleteAccessEntry") and
event.outcome:"success" and
not aws.cloudtrail.user_identity.arn:(*AWSServiceRoleForAmazonEKS* or *eksctl* or *terraform* or *AWSCloudFormation*)
'''

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

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

[[rule.threat.technique]]
id = "T1098"
name = "Account Manipulation"
reference = "https://attack.mitre.org/techniques/T1098/"

[[rule.threat.technique.subtechnique]]
id = "T1098.006"
name = "Additional Container Cluster Roles"
reference = "https://attack.mitre.org/techniques/T1098/006/"

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

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

[[rule.threat.technique]]
id = "T1098"
name = "Account Manipulation"
reference = "https://attack.mitre.org/techniques/T1098/"

[[rule.threat.technique.subtechnique]]
id = "T1098.006"
name = "Additional Container Cluster Roles"
reference = "https://attack.mitre.org/techniques/T1098/006/"

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

Stages and Predicates

Stage 1: query

data_stream.dataset:"aws.cloudtrail" and event.provider:"eks.amazonaws.com" and
event.action:("CreateAccessEntry" or "AssociateAccessPolicy" or "UpdateAccessEntry" or "DisassociateAccessPolicy" or "DeleteAccessEntry") and
event.outcome:"success" and
not aws.cloudtrail.user_identity.arn:(*AWSServiceRoleForAmazonEKS* or *eksctl* or *terraform* or *AWSCloudFormation*)

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
data_stream.dataseteq
  • aws.cloudtrail corpus 143 (elastic 143)
field:"data_stream.dataset" kind:eq value:"aws.cloudtrail"
event.actionin
  • AssociateAccessPolicy
  • CreateAccessEntry
  • DeleteAccessEntry
  • DisassociateAccessPolicy
  • UpdateAccessEntry
field:"EventType" kind:in
event.outcomeeq
  • success corpus 306 (elastic 306)
field:"event.outcome" kind:eq value:"success"
event.providereq
  • eks.amazonaws.com corpus 3 (elastic 3)
field:"Provider_Name" kind:eq value:"eks.amazonaws.com"

Exclusions

The rule actively suppresses these predicates.

AWS IAM Long-Term Access Key First Seen from Source IP

#
Status
production
Severity
medium
Time window
6m
Group by
aws.cloudtrail.user_identity.access_key_id, source.ip
Author
Elastic
Source
github.com/elastic/detection-rules

Identifies the first time, within the configured history window, that a long-term IAM access key ID (prefix AKIA) is used successfully from a given source.ip in AWS CloudTrail. Long-term access keys belong to IAM users or the account root user. They are a common target after credential theft or leakage, including supply-chain and exposed-key scenarios. Temporary security credentials (prefix ASIA) and console sessions are excluded so the signal emphasizes programmatic access patterns.

Known False Positives

  • Legitimate users may travel, rotate through VPN egress IPs, or run automation from new build hosts, producing a first-seen IP for an existing access key. Baseline the principal, confirm with the key owner, and extend the history window or add exceptions for known automation networks if needed.

MITRE ATT&CK Coverage

TacticTechniques
Initial Access
Credential Access

Rule Body

[metadata]
creation_date = "2026/04/06"
integration = ["aws"]
maturity = "production"
updated_date = "2026/04/10"

[rule]
author = ["Elastic"]
description = """
Identifies the first time, within the configured history window, that a long-term IAM access key ID (prefix AKIA) is
used successfully from a given source.ip in AWS CloudTrail. Long-term access keys belong to IAM users or the account
root user. They are a common target after credential theft or leakage, including supply-chain and exposed-key scenarios.
Temporary security credentials (prefix ASIA) and console sessions are excluded so the signal emphasizes programmatic
access patterns.
"""
false_positives = [
    """
    Legitimate users may travel, rotate through VPN egress IPs, or run automation from new build hosts, producing a
    first-seen IP for an existing access key. Baseline the principal, confirm with the key owner, and extend the history
    window or add exceptions for known automation networks if needed.
    """,
]
from = "now-6m"
index = ["logs-aws.cloudtrail-*"]
language = "kuery"
license = "Elastic License v2"
name = "AWS IAM Long-Term Access Key First Seen from Source IP"
note = """## Triage and analysis

### Investigating AWS IAM Long-Term Access Key First Seen from Source IP

This rule is a [New Terms](https://www.elastic.co/guide/en/security/current/rules-ui-create.html#create-new-terms-rule) detection on CloudTrail. It fires when a successful API call uses a long-term IAM access key (`AKIA*`) from a `source.ip` that has not appeared with that key in the rule history window.

Long-term keys are high-value targets. Unlike session credentials (`ASIA*`), they do not expire until rotated or deleted. Threat reporting on cloud compromises often highlights abuse of leaked or stolen `AKIA` keys.

### Possible investigation steps

**Confirm the key and principal**
- Identify the IAM user or root context implied by `aws.cloudtrail.user_identity.arn` or `user.name`.
- **`aws.cloudtrail.user_identity.type`**: Distinguish `IAMUser`, `Root`, or other types; root long-term keys warrant extra scrutiny.

**Assess the new source**
- **`source.ip`** and **`source.geo`**: Compare to normal geography, corporate egress, and known cloud provider ranges.
- **`user_agent.original`**: Identify AWS CLI, SDKs, custom tooling, or unusual agents.

**Correlate activity**
- Search CloudTrail for the same access key and IP over the following hours for sensitive APIs (IAM changes, STS, S3 data access, Secrets Manager, role assumption).
- Review IAM last-used metadata for the key in the AWS console or API (`GetAccessKeyLastUsed`).

### False positive analysis

- Travel and VP* for human IAM users.
- New CI runners, ephemeral build agents, or re-IP'd NAT gateways for automation keys.
- Partner or MSP access from new networks if keys are shared (discouraged practice).

### Response and remediation

- If unexpected, deactivate or delete the access key, rotate credentials, and review policies attached to the user.
- Enable or enforce MFA for console users; prefer roles and temporary credentials over long-term keys for workloads.
- Document approved networks or principals and tune history or exceptions accordingly.

### Additional information

- [AWS Security Incident Response Guide](https://docs.aws.amazon.com/whitepapers/latest/aws-security-incident-response-guide/aws-security-incident-response-guide.pdf)

"""
references = [
    "https://kudelskisecurity.com/research/investigating-two-variants-of-the-trivy-supply-chain-compromise",
]
risk_score = 47
rule_id = "9f8e3c5e-f72e-4e91-93f6-e98a4fae3e4f"
severity = "medium"
tags = [
    "Domain: Cloud",
    "Data Source: AWS",
    "Data Source: Amazon Web Services",
    "Data Source: AWS CloudTrail",
    "Data Source: AWS IAM",
    "Use Case: Threat Detection",
    "Tactic: Credential Access",
    "Tactic: Initial Access",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "new_terms"

query = '''
data_stream.dataset: "aws.cloudtrail"
    and event.outcome: "success"
    and source.ip:*
    and aws.cloudtrail.user_identity.access_key_id: AKIA*
'''


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


[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 = "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.city_name",
    "source.geo.country_iso_code",
    "source.as.organization.name",
    "aws.cloudtrail.user_identity.arn",
    "aws.cloudtrail.user_identity.type",
    "aws.cloudtrail.user_identity.access_key_id",
    "event.action",
    "event.outcome",
    "cloud.account.id",
    "cloud.region",
]

[rule.new_terms]
field = "new_terms_fields"
value = ["aws.cloudtrail.user_identity.access_key_id", "source.ip"]
[[rule.new_terms.history_window_start]]
field = "history_window_start"
value = "now-10d"


Stages and Predicates

Stage 1: new_terms

data_stream.dataset: "aws.cloudtrail"
    and event.outcome: "success"
    and source.ip:*
    and aws.cloudtrail.user_identity.access_key_id: AKIA*

Indicators

These rows show field, operator, and value matches.

AzCopy or Azure Storage Explorer Usage on Unusual Host

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

Identifies the first time, in a historical window, a host runs AzCopy copy or sync to Azure Blob, Data Lake, or File storage, or starts Azure Storage Explorer. These Microsoft utilities are legitimate data-transfer tools; ransomware and cloud-ransomware operators drop portable copies and use SAS-authenticated jobs to pull data from victim storage and push it to attacker-controlled accounts.

Known False Positives

  • IT or DevOps using AzCopy for authorized migrations on a host that has not used it in the history window.
  • Users launching Azure Storage Explorer (including the installer) for the first time on a host.

MITRE ATT&CK Coverage

Rule Body

[metadata]
creation_date = "2026/09/09"
integration = ["endpoint", "windows", "m365_defender", "crowdstrike"]
maturity = "production"
updated_date = "2026/09/09"

[rule]
author = ["Elastic"]
description = """
Identifies the first time, in a historical window, a host runs AzCopy copy or sync to Azure Blob, Data Lake, or File
storage, or starts Azure Storage Explorer. These Microsoft utilities are legitimate data-transfer tools; ransomware and
cloud-ransomware operators drop portable copies and use SAS-authenticated jobs to pull data from victim storage and push
it to attacker-controlled accounts.
"""
false_positives = [
    "IT or DevOps using AzCopy for authorized migrations on a host that has not used it in the history window.",
    "Users launching Azure Storage Explorer (including the installer) for the first time on a host.",
]
from = "now-9m"
index = [
    "logs-crowdstrike.fdr*",
    "logs-endpoint.events.process-*",
    "logs-m365_defender.event-*",
    "logs-windows.sysmon_operational-*",
]
language = "kuery"
license = "Elastic License v2"
name = "AzCopy or Azure Storage Explorer Usage on Unusual Host"
note = """## Triage and analysis

### Investigating AzCopy or Azure Storage Explorer Usage on Unusual Host

AzCopy and Azure Storage Explorer are Microsoft utilities for moving data to and from Azure Storage. Threat actors abuse them as living-off-the-land binaries: they run `azcopy copy` with SAS URLs against `*.blob.core.windows.net` (GetBlob from a victim account, PutBlob to an attacker account, or Blob-to-Blob between them) and launch Storage Explorer to browse or move the same data. CISA's Rhysida advisory is one example of that tradecraft.

This is a new-terms rule: it alerts the first time a `host.id` matches in the history window (7 days). AzCopy `copy`/`sync` whose command line includes an Azure Storage hostname, or Storage Explorer (`StorageExplorer.exe`, `StorageExplorer-windows-x64.exe`, `StorageExplorer-windows-arm64.exe`, `StorageExplorer-windowsx64.exe`), fires once per host. Recurring use on the same host will not re-alert until the history window expires.

### Possible investigation steps

- Confirm which utility fired the alert. For AzCopy, inspect `process.command_line` for `copy` vs `sync`, `--from-to` (`BlobLocal`, `LocalBlob`, `BlobBlob`), and the SAS URL host, container, and `sp`/`se` parameters. For Storage Explorer, note the installer vs application name and silent-install flags such as `/VERYSILENT`.
- Identify source and destination. AzCopy command lines often contain a local path and one or two `https://<account>.blob.core.windows.net/...` URLs. Treat Blob-to-Blob copies as direct tenant-to-attacker movement even when no files touch disk.
- Check `process.executable` and `process.parent.executable`. A copy from a user-writable or staging path, especially spawned by PowerShell or a scripting host, is more suspicious than a packaged install.
- Compare `process.name` with `process.pe.original_file_name` and `process.code_signature.subject_name`. A Microsoft-signed binary from an unusual path is still the Rhysida/Storm-0501 tradecraft; a renamed unsigned copy is additional evasion.
- Pivot to Azure Storage diagnostic logs for the same window: GetBlob, PutBlob, and BlobBlob with user agent `AzCopy*` or `Microsoft Azure Storage Explorer*` and SAS authentication. Correlate with the SIEM rule "Azure Storage Blob Retrieval via AzCopy".
- Review network telemetry from the same `process.entity_id` to `*.blob.core.windows.net` or `*.dfs.core.windows.net` and estimate volume.
- Hunt sibling activity on the host: other Azure LOLBINs, rclone, or bulk archive creation preceding the copy.

### False positive analysis

- Authorized AzCopy migrations and first-time Storage Explorer use on a host will match. This rule alerts only the first time a given `host.id` matches within 7 days; allowlist by host, user, or approved destination if that first alert is expected.
- Do not treat a trusted Microsoft signature as benign by itself; CISA's Rhysida advisory describes the official AzCopy and Storage Explorer binaries.

### Response and remediation

- If exfiltration is confirmed, isolate the host, stop AzCopy and Storage Explorer processes, and preserve the command line (SAS URLs are credentials).
- Revoke the SAS tokens and account keys that appear in the command line; rotate storage account keys and any related Entra ID credentials.
- Identify which blobs were read or written (GetBlob/PutBlob/ListBlobs for the same account and time window) and assess data exposure.
- Remove staged binaries under unusual paths and investigate how they were delivered.
- Hunt for additional AzCopy, Storage Explorer, or rclone activity on other hosts in the same window.

### Related rules

- Azure Storage Blob Retrieval via AzCopy: cloud-side GetBlob with AzCopy user agent and SAS authentication.
- Potential Data Exfiltration via Rclone: similar endpoint abuse of a different cloud-sync utility.
"""
references = [
    "https://www.cisa.gov/news-events/cybersecurity-advisories/aa23-319a",
    "https://www.cisa.gov/sites/default/files/2025-04/aa23-319a-stopransomware-rhysida-ransomware_2.pdf",
    "https://learn.microsoft.com/en-us/azure/storage/common/storage-use-azcopy-v10",
    "https://learn.microsoft.com/en-us/azure/storage/storage-explorer/vs-azure-tools-storage-explorer-blobs",
    "https://www.microsoft.com/en-us/security/blog/2025/08/27/storm-0501s-evolving-techniques-lead-to-cloud-based-ransomware/",
]
risk_score = 47
rule_id = "7265f4fa-4839-4399-924c-a91f1e45d76c"
setup = """## Setup

This rule is designed for data generated by [Elastic Defend](https://www.elastic.co/security/endpoint-security), which provides native endpoint detection and response, along with event enrichments designed to work with our detection rules.

Setup instructions: https://ela.st/install-elastic-defend

### Additional data sources

This rule also supports the following third-party data sources. For setup instructions, refer to the links below:

- [CrowdStrike](https://ela.st/crowdstrike-integration)
- [Microsoft Defender XDR](https://ela.st/m365-defender)
- [Sysmon Event ID 1 - Process Creation](https://ela.st/sysmon-event-1-setup)
"""
severity = "medium"
tags = [
    "Domain: Endpoint",
    "OS: Windows",
    "Platform: Windows",
    "Use Case: Threat Detection",
    "Tactic: Exfiltration",
    "Tactic: Collection",
    "Tactic: Execution",
    "Rule Type: New Terms",
    "Threat: Rhysida",
    "Use Case: Ransomware",
    "Resources: Investigation Guide",
    "Data Source: Elastic Defend",
    "Data Source: Sysmon",
    "Data Source: Microsoft Defender XDR",
    "Data Source: Crowdstrike",
]
timestamp_override = "event.ingested"
type = "new_terms"

query = '''
host.os.type:windows and event.category:process and event.type:start and
(
  (
    (process.name:"azcopy.exe" or process.pe.original_file_name:"azcopy.exe") and
    process.args:("copy" or "sync") and
    process.command_line:(*blob.core.windows.net* or *dfs.core.windows.net* or *file.core.windows.net* or *blob.storage.azure.net*)
  ) or
  process.name:("StorageExplorer.exe" or "StorageExplorer-windows-x64.exe" or "StorageExplorer-windows-arm64.exe" or "StorageExplorer-windowsx64.exe")
)
'''


[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1567"
name = "Exfiltration Over Web Service"
reference = "https://attack.mitre.org/techniques/T1567/"
[[rule.threat.technique.subtechnique]]
id = "T1567.002"
name = "Exfiltration to Cloud Storage"
reference = "https://attack.mitre.org/techniques/T1567/002/"



[rule.threat.tactic]
id = "TA0010"
name = "Exfiltration"
reference = "https://attack.mitre.org/tactics/TA0010/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1530"
name = "Data from Cloud Storage"
reference = "https://attack.mitre.org/techniques/T1530/"


[rule.threat.tactic]
id = "TA0009"
name = "Collection"
reference = "https://attack.mitre.org/tactics/TA0009/"
[[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.009"
name = "Cloud API"
reference = "https://attack.mitre.org/techniques/T1059/009/"



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

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


Stages and Predicates

Stage 1: new_terms

host.os.type:windows and event.category:process and event.type:start and
(
  (
    (process.name:"azcopy.exe" or process.pe.original_file_name:"azcopy.exe") and
    process.args:("copy" or "sync") and
    process.command_line:(*blob.core.windows.net* or *dfs.core.windows.net* or *file.core.windows.net* or *blob.storage.azure.net*)
  ) or
  process.name:("StorageExplorer.exe" or "StorageExplorer-windows-x64.exe" or "StorageExplorer-windows-arm64.exe" or "StorageExplorer-windowsx64.exe")
)

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.categoryeq
  • process corpus 105 (elastic 105)
field:"event.category" kind:eq value:"process"
event.typeeq
  • start corpus 67 (elastic 67)
field:"event.type" kind:eq value:"start"
process.argsin
  • copy
  • sync
field:"process.args" kind:in
process.command_linewildcard
  • *blob.core.windows.net*
  • *blob.storage.azure.net*
  • *dfs.core.windows.net*
  • *file.core.windows.net*
field:"CommandLine" kind:wildcard
process.nameeq
  • azcopy.exe
field:"process_basename" kind:eq value:"azcopy.exe"
process.namein
  • StorageExplorer-windows-arm64.exe
  • StorageExplorer-windows-x64.exe
  • StorageExplorer-windowsx64.exe
  • StorageExplorer.exe corpus 2 (elastic 1, splunk 1)
field:"process_basename" kind:in
process.pe.original_file_nameeq
  • azcopy.exe
field:"OriginalFileName" kind:eq value:"azcopy.exe"

Azure AKS Attempted User Exec into Pod

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

Detects an AKS (Azure Kubernetes Service) identity establishing an exec session into a pod. Interactive command execution inside a workload via kubectl exec is a common post-compromise technique used to access secrets, run tooling, and expand access from a foothold container. Node, control-plane, and kube-system service account identities are excluded, so workload service accounts and users, the identities an adversary is most likely to abuse, remain in scope.

Known False Positives

  • Administrators routinely exec into pods for troubleshooting. Baseline expected users and target pods, then exclude known break-glass or operator identities after review.

MITRE ATT&CK Coverage

Telemetry Coverage

Rules Detecting the Same Action

These rules filter on the same operation.

Rule Body

[metadata]
creation_date = "2026/07/09"
integration = ["azure"]
maturity = "production"
updated_date = "2026/07/09"

[rule]
author = ["Elastic"]
description = """
Detects an AKS (Azure Kubernetes Service) identity establishing an exec session into a pod. Interactive command
execution inside a workload via kubectl exec is a common post-compromise technique used to access secrets, run tooling,
and expand access from a foothold container. Node, control-plane, and kube-system service account identities are
excluded, so workload service accounts and users, the identities an adversary is most likely to abuse, remain in scope.
"""
false_positives = [
    """
    Administrators routinely exec into pods for troubleshooting. Baseline expected users and target pods, then exclude
    known break-glass or operator identities after review.
    """,
]
from = "now-9m"
index = ["logs-azure.platformlogs-*"]
language = "kuery"
license = "Elastic License v2"
name = "Azure AKS Attempted User Exec into Pod"
note = """## Triage and analysis

### Investigating Azure AKS Attempted User Exec into Pod

AKS kube-audit events are carried under the flattened `azure.platformlogs.properties.log.*` subtree and share the ARM
operation `event.action: Microsoft.ContainerService/managedClusters/diagnosticLogs/Read`. This rule alerts on a
`pods/exec` request by an identity that is not node, control-plane, or kube-system infrastructure. Exec into a pod grants
an interactive shell inside the workload, which adversaries use to read mounted secrets, pivot, and stage tooling.

### Possible investigation steps

- Review the acting identity in `azure.platformlogs.properties.log.user.username` and its groups in
  `azure.platformlogs.properties.log.user.groups`, and the target pod in
  `azure.platformlogs.properties.log.objectRef.name` / `azure.platformlogs.properties.log.objectRef.namespace`.
- Determine whether the target pod holds sensitive data, cluster credentials, or a mounted service account token.
- Inspect the exec request path and command context in `azure.platformlogs.properties.log.requestURI` and the client in
  `azure.platformlogs.properties.log.userAgent` (interactive `kubectl` vs a scripted client).
- Evaluate the source in `azure.platformlogs.properties.log.sourceIPs`. Pivot on it for related API activity, secret
  reads, or RBAC changes from the same identity.

### False positive analysis

- Approved admin debugging; exclude stable operator or break-glass identities after review.
- CI/CD or platform tooling that execs into workloads may match; exclude verified service accounts and namespaces.

### Response and remediation

- If unauthorized, revoke the identity's tokens and kubeconfig and terminate the exec session.
- Inspect the target pod for tampering, dropped tooling, or accessed secrets, and rotate any credentials it exposed.
- Collect kube-audit and identity artifacts per incident response procedures.
"""
references = [
    "https://kubernetes.io/docs/tasks/debug/debug-application/get-shell-running-container/",
    "https://microsoft.github.io/Threat-Matrix-for-Kubernetes/",
    "https://unit42.paloaltonetworks.com/hildegard-malware-teamtnt/",
]
risk_score = 47
rule_id = "8f131efa-0284-465f-a360-da23e5562dd1"
setup = "The Azure Fleet integration collecting AKS diagnostic logs with the `kube-audit` category forwarded through Event Hub into the `azure.platformlogs` data stream is required for this rule."
severity = "medium"
tags = [
    "Domain: Cloud",
    "Domain: Kubernetes",
    "Data Source: Azure",
    "Data Source: Azure Platform Logs",
    "Data Source: Kubernetes",
    "Use Case: Threat Detection",
    "Tactic: Execution",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "query"

query = '''
data_stream.dataset:azure.platformlogs and
  event.action:"Microsoft.ContainerService/managedClusters/diagnosticLogs/Read" and
  azure.platformlogs.category:"kube-audit" and
  azure.platformlogs.properties.log.objectRef.resource:"pods" and azure.platformlogs.properties.log.objectRef.subresource:"exec" and
  azure.platformlogs.properties.log.verb:("create" or "get") and
  not azure.platformlogs.properties.log.user.username:(
    system\:node\:* or "aksService" or "hcpService" or "readinessChecker" or
    system\:serviceaccount\:kube-system\:*
  )
'''


[[rule.threat]]
framework = "MITRE ATT&CK"
[[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.investigation_fields]
field_names = [
    "@timestamp",
    "event.action",
    "azure.platformlogs.category",
    "azure.platformlogs.properties.log.verb",
    "azure.platformlogs.properties.log.user.username",
    "azure.platformlogs.properties.log.sourceIPs",
    "azure.platformlogs.properties.log.objectRef.resource",
    "azure.platformlogs.properties.log.objectRef.subresource",
    "azure.platformlogs.properties.log.objectRef.namespace",
    "azure.platformlogs.properties.log.objectRef.name"
]


Stages and Predicates

Stage 1: query

data_stream.dataset:azure.platformlogs and
  event.action:"Microsoft.ContainerService/managedClusters/diagnosticLogs/Read" and
  azure.platformlogs.category:"kube-audit" and
  azure.platformlogs.properties.log.objectRef.resource:"pods" and azure.platformlogs.properties.log.objectRef.subresource:"exec" and
  azure.platformlogs.properties.log.verb:("create" or "get") and
  not azure.platformlogs.properties.log.user.username:(
    system\:node\:* or "aksService" or "hcpService" or "readinessChecker" or
    system\:serviceaccount\:kube-system\:*
  )

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

Failed Attempts to Access Sensitive Files

#
Source
github.com/elastic/protections-artifacts

Identifies failed attempts to access common sensitive files and registries. Adversaries may search local file systems and remote file shares for files containing insecurely stored credentials.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
Identifies failed attempts to access common sensitive files and registries. Adversaries may search local file systems
and remote file shares for files containing insecurely stored credentials.
"""
id = "3163dd96-c677-4f1f-98bf-c8f3c81b197b"
license = "Elastic License v2"
name = "Failed Attempts to Access Sensitive Files"
os_list = ["windows"]
reference = ["https://github.com/GhostPack/Seatbelt", "https://github.com/AlessandroZ/LaZagne"]
version = "1.0.31"

query = '''
any where event.category in ("registry", "file") and
   event.action in ("query", "open") and event.outcome == "failure" and process.pid != 4 and
   process.executable != null and
   (
    (file.path : "?:\\*" and
     file.path :
	     (
		  "?:\\Users\\*\\AppData\\Local\\*\\Remote Desktop Connection Manager\\RDCMan.settings",
		  "?:\\Users\\*\\AppData\\*\\NordVPN\\NordVPN.exe*\\user.config",
		  "?:\\Users\\*\\AppData\\*\\FileZilla\\recentservers.xml",
		  "?:\\Users\\*\\AppData\\*\\FileZilla\\sitemanager.xml") and
	 not process.executable :
	          ("?:\\Program Files\\*",
	           "?:\\Program Files (x86)\\*",
	           "?:\\Windows\\System32\\SearchProtocolHost.exe",
	           "?:\\Windows\\System32\\svchost.exe",
	           "?:\\Windows\\System32\\OpenSSH\\ssh.exe", 
	           "?:\\Windows\\System32\\OpenSSH\\ssh-keygen.exe",
	           "?:\\Windows\\System32\\OpenWith.exe", 
	           "\\Device\\Mup*",
	           "?:\\Windows\\explorer.exe",
	           "?:\\Windows\\eMweb\\certutil.exe") and
	 not (process.code_signature.subject_name :
	          ("Rapid7 LLC", "Mozilla Corporation", "Commvault Systems, Inc.", "Google LLC", "Bitdefender SRL",
	           "McAfee, Inc.", "Serengeti Systems Incorporated", "nordvpn s.a.", "Kaspersky Lab", "JetBrains s.r.o.", 
	           "Illusive Networks LTD", "Ghisler Software GmbH", "Keeper Security Inc.", "Eric R. Zimmerman", 
	           "Galactic Advisors, Inc.", "Johannes Schindelin", "Mobatek", "Shift Technologies Inc.",
	           "Viber Media S.a r.l.", "ONELAUNCH TECHNOLOGIES INC.", "SAP SE") and
         process.code_signature.trusted == true) and
     not (process.executable : ("?:\\Program Files\\*.exe", "?:\\Program Files (x86)\\*.exe") and
         user.id == "S-1-5-18" and process.code_signature.trusted == true) and
     not (file.name : "RDCMan.settings" and process.name : ("RDCMan.exe", "RDCMan-x86.exe"))
     ) or

	(registry.path :
         ("HKEY_USERS\\S-1-5-21*\\SOFTWARE\\WOW6432Node\\TeamViewer\\ProxyPassword", 
	  "HKEY_USERS\\S-1-5-21*\\Software\\OpenVPN-GUI\\Configs\\*auth-data*") and

	not (process.code_signature.trusted == true and
	     process.code_signature.subject_name :
	        ("Simon Tatham", "Tim Kosse", "David Sparer", "Martin Prikryl", "Open Source Developer, Sven Strickroth",
	         "Astrospark Technologies, LLC", "Solarwinds Worldwide, LLC", "NETSUPPORT LTD.", "Bitdefender SRL",
	         "Ivanti, Inc.", "Fortinet Technologies*", "Ivanti, Inc.")) and
	not process.executable : "?:\\$WINDOWS.~BT\\Sources\\SetupHost.exe")
    )
'''

min_endpoint_version = "8.6.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 = "T1539"
name = "Steal Web Session Cookie"
reference = "https://attack.mitre.org/techniques/T1539/"

[[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.technique]]
id = "T1555"
name = "Credentials from Password Stores"
reference = "https://attack.mitre.org/techniques/T1555/"
[[threat.technique.subtechnique]]
id = "T1555.003"
name = "Credentials from Web Browsers"
reference = "https://attack.mitre.org/techniques/T1555/003/"



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

[internal]
min_endpoint_version = "8.6.0"

Stages and Predicates

Stage 1: any

any where event.category in ("registry", "file") and
   event.action in ("query", "open") and event.outcome == "failure" and process.pid != 4 and
   process.executable != null and
   (
    (file.path : "?:\\*" and
     file.path :
	     (
		  "?:\\Users\\*\\AppData\\Local\\*\\Remote Desktop Connection Manager\\RDCMan.settings",
		  "?:\\Users\\*\\AppData\\*\\NordVPN\\NordVPN.exe*\\user.config",
		  "?:\\Users\\*\\AppData\\*\\FileZilla\\recentservers.xml",
		  "?:\\Users\\*\\AppData\\*\\FileZilla\\sitemanager.xml") and
	 not process.executable :
	          ("?:\\Program Files\\*",
	           "?:\\Program Files (x86)\\*",
	           "?:\\Windows\\System32\\SearchProtocolHost.exe",
	           "?:\\Windows\\System32\\svchost.exe",
	           "?:\\Windows\\System32\\OpenSSH\\ssh.exe", 
	           "?:\\Windows\\System32\\OpenSSH\\ssh-keygen.exe",
	           "?:\\Windows\\System32\\OpenWith.exe", 
	           "\\Device\\Mup*",
	           "?:\\Windows\\explorer.exe",
	           "?:\\Windows\\eMweb\\certutil.exe") and
	 not (process.code_signature.subject_name :
	          ("Rapid7 LLC", "Mozilla Corporation", "Commvault Systems, Inc.", "Google LLC", "Bitdefender SRL",
	           "McAfee, Inc.", "Serengeti Systems Incorporated", "nordvpn s.a.", "Kaspersky Lab", "JetBrains s.r.o.", 
	           "Illusive Networks LTD", "Ghisler Software GmbH", "Keeper Security Inc.", "Eric R. Zimmerman", 
	           "Galactic Advisors, Inc.", "Johannes Schindelin", "Mobatek", "Shift Technologies Inc.",
	           "Viber Media S.a r.l.", "ONELAUNCH TECHNOLOGIES INC.", "SAP SE") and
         process.code_signature.trusted == true) and
     not (process.executable : ("?:\\Program Files\\*.exe", "?:\\Program Files (x86)\\*.exe") and
         user.id == "S-1-5-18" and process.code_signature.trusted == true) and
     not (file.name : "RDCMan.settings" and process.name : ("RDCMan.exe", "RDCMan-x86.exe"))
     ) or

	(registry.path :
         ("HKEY_USERS\\S-1-5-21*\\SOFTWARE\\WOW6432Node\\TeamViewer\\ProxyPassword", 
	  "HKEY_USERS\\S-1-5-21*\\Software\\OpenVPN-GUI\\Configs\\*auth-data*") and

	not (process.code_signature.trusted == true and
	     process.code_signature.subject_name :
	        ("Simon Tatham", "Tim Kosse", "David Sparer", "Martin Prikryl", "Open Source Developer, Sven Strickroth",
	         "Astrospark Technologies, LLC", "Solarwinds Worldwide, LLC", "NETSUPPORT LTD.", "Bitdefender SRL",
	         "Ivanti, Inc.", "Fortinet Technologies*", "Ivanti, Inc.")) and
	not process.executable : "?:\\$WINDOWS.~BT\\Sources\\SetupHost.exe")
    )

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actionin
  • open corpus 7 (elastic 7)
  • query corpus 3 (elastic 3)
field:"EventType" kind:in
event.categoryin
  • file corpus 15 (elastic 15)
  • registry corpus 10 (elastic 10)
field:"event.category" kind:in
event.outcomeeq
  • failure corpus 10 (elastic 10)
field:"event.outcome" kind:eq value:"failure"
file.pathwildcard
  • ?:\*
  • ?:\Users\*\AppData\*\FileZilla\recentservers.xml corpus 2 (elastic 2)
  • ?:\Users\*\AppData\*\FileZilla\sitemanager.xml corpus 2 (elastic 2)
  • ?:\Users\*\AppData\*\NordVPN\NordVPN.exe*\user.config corpus 2 (elastic 2)
  • ?:\Users\*\AppData\Local\*\Remote Desktop Connection Manager\RDCMan.settings corpus 2 (elastic 2)
field:"TargetFilename" kind:wildcard
process.executableis_not_null
  • (no value, null check)
field:"Image" kind:is_not_null
process.pidne
  • 4 transforms: number corpus 44 (elastic 44)
field:"process_id" kind:ne value:"4"
registry.pathwildcard
  • HKEY_USERS\S-1-5-21*\SOFTWARE\WOW6432Node\TeamViewer\ProxyPassword corpus 2 (elastic 2)
  • HKEY_USERS\S-1-5-21*\Software\OpenVPN-GUI\Configs\*auth-data* corpus 2 (elastic 2)
field:"TargetObject" kind:wildcard

Group and Privileged Accounts Discovery via LDAP

#
Source
github.com/elastic/protections-artifacts

Identifies a list of LDAP queries often used to perform Active Directory groups and privileges reconnaissance.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = "Identifies a list of LDAP queries often used to perform Active Directory groups and privileges reconnaissance."
id = "447b004a-ac74-4ba4-8131-44efc25fdd47"
license = "Elastic License v2"
name = "Group and Privileged Accounts Discovery via LDAP"
os_list = ["windows"]
reference = ["https://attack.mitre.org/techniques/T1069/002/"]
version = "1.0.5"

query = '''
api where process.Ext.api.name == "ldap_search" and user.id != "S-1-5-18" and
 not process.executable :
             ("?:\\Program Files\\Azure Advanced Threat Protection Sensor\\*\\Microsoft.Tri.Sensor.exe",
              "?:\\Windows\\System32\\lsass.exe",
              "?:\\Windows\\ADFS\\Microsoft.IdentityServer.ServiceHost.exe",
              "?:\\Windows\\ADWS\\Microsoft.ActiveDirectory.WebServices.exe",
              "\\Device\\Mup\\*\\VMedView.exe") and
 process.Ext.api.parameters.search_filter : (
  "(&(objectClass=group))",
  "(&(objectClass=group)(managedBy=?))",
  "(&(objectClass=group)(managedBy=?)(groupType:1.2.840.113556.1.4.803:=2147483648))",
  "(&(objectCategory=group)(name=Domain Admins))",
  "*(adminCount=1)*"
 ) and
 not (process.code_signature.subject_name in ("Netwrix Corporation", "Kaseya Holdings Inc", "VEPRO AG", "Recast Software Inc.", "Azul Systems, Inc.", "SEMPERIS INC.") and process.code_signature.trusted == true) and
 not (process.executable : "C:\\Windows\\System32\\inetsrv\\w3wp.exe" and process.Ext.api.parameters.search_filter : "(&(objectClass=group))") and
 not process.executable : ("C:\\Program Files\\IIS Express\\iisexpress.exe",
                           "C:\\Windows\\ADWS\\Microsoft.ActiveDirectory.WebServices.exe",
                           "C:\\Program Files (x86)\\ISDecisions\\FileAudit\\FileAuditService.exe",
                           "C:\\Program Files (x86)\\baramundi\\Management Server\\bServer.exe",
                           "C:\\Program Files (x86)\\OpenDNS\\OpenDNS Connector\\v*\\CiscoAuditClient.exe",
                           "C:\\Program Files (x86)\\Cisco\\CiscoADConnector\\v*\\CiscoAuditClient.exe")
'''

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

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1069"
name = "Permission Groups Discovery"
reference = "https://attack.mitre.org/techniques/T1069/"
[[threat.technique.subtechnique]]
id = "T1069.002"
name = "Domain Groups"
reference = "https://attack.mitre.org/techniques/T1069/002/"


[[threat.technique]]
id = "T1087"
name = "Account Discovery"
reference = "https://attack.mitre.org/techniques/T1087/"
[[threat.technique.subtechnique]]
id = "T1087.002"
name = "Domain Account"
reference = "https://attack.mitre.org/techniques/T1087/002/"


[[threat.technique]]
id = "T1482"
name = "Domain Trust Discovery"
reference = "https://attack.mitre.org/techniques/T1482/"


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

[internal]
min_endpoint_version = "9.1.0"

Stages and Predicates

Stage 1: api

api where process.Ext.api.name == "ldap_search" and user.id != "S-1-5-18" and
 not process.executable :
             ("?:\\Program Files\\Azure Advanced Threat Protection Sensor\\*\\Microsoft.Tri.Sensor.exe",
              "?:\\Windows\\System32\\lsass.exe",
              "?:\\Windows\\ADFS\\Microsoft.IdentityServer.ServiceHost.exe",
              "?:\\Windows\\ADWS\\Microsoft.ActiveDirectory.WebServices.exe",
              "\\Device\\Mup\\*\\VMedView.exe") and
 process.Ext.api.parameters.search_filter : (
  "(&(objectClass=group))",
  "(&(objectClass=group)(managedBy=?))",
  "(&(objectClass=group)(managedBy=?)(groupType:1.2.840.113556.1.4.803:=2147483648))",
  "(&(objectCategory=group)(name=Domain Admins))",
  "*(adminCount=1)*"
 ) and
 not (process.code_signature.subject_name in ("Netwrix Corporation", "Kaseya Holdings Inc", "VEPRO AG", "Recast Software Inc.", "Azul Systems, Inc.", "SEMPERIS INC.") and process.code_signature.trusted == true) and
 not (process.executable : "C:\\Windows\\System32\\inetsrv\\w3wp.exe" and process.Ext.api.parameters.search_filter : "(&(objectClass=group))") and
 not process.executable : ("C:\\Program Files\\IIS Express\\iisexpress.exe",
                           "C:\\Windows\\ADWS\\Microsoft.ActiveDirectory.WebServices.exe",
                           "C:\\Program Files (x86)\\ISDecisions\\FileAudit\\FileAuditService.exe",
                           "C:\\Program Files (x86)\\baramundi\\Management Server\\bServer.exe",
                           "C:\\Program Files (x86)\\OpenDNS\\OpenDNS Connector\\v*\\CiscoAuditClient.exe",
                           "C:\\Program Files (x86)\\Cisco\\CiscoADConnector\\v*\\CiscoAuditClient.exe")

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
process.Ext.api.nameeq
  • ldap_search corpus 14 (elastic 14)
field:"process.Ext.api.name" kind:eq value:"ldap_search"
process.Ext.api.parameters.search_filterwildcard
  • (&(objectCategory=group)(name=Domain Admins))
  • (&(objectClass=group)(managedBy=?)(groupType:1.2.840.113556.1.4.803:=2147483648))
  • (&(objectClass=group)(managedBy=?))
  • (&(objectClass=group))
  • *(adminCount=1)*
field:"process.Ext.api.parameters.search_filter" kind:wildcard
user.idne
  • S-1-5-18 corpus 37 (elastic 37)
field:"user.id" kind:ne value:"S-1-5-18"

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.Ext.api.parameters.search_filtereq(&(objectClass=group))excludes:process.Ext.api.parameters.search_filter field:"process.Ext.api.parameters.search_filter" value:"(&(objectClass=group))"
process.executableeqC:\Windows\System32\inetsrv\w3wp.exeexcludes:process.executable field:"process.executable" value:"C:\Windows\System32\inetsrv\w3wp.exe"
process.code_signature.subject_nameinAzul Systems, Inc., Kaseya Holdings Inc, Netwrix Corporation, Recast Software Inc., SEMPERIS INC., VEPRO AGexcludes:process.code_signature.subject_name
process.code_signature.trustedeqtrueexcludes:process.code_signature.trusted field:"process.code_signature.trusted" value:"true"
process.executablewildcard?:\Program Files\Azure Advanced Threat Protection Sensor\*\Microsoft.Tri.Sensor.exe, ?:\Windows\System32\lsass.exe, ?:\Windows\ADFS\Microsoft.IdentityServer.ServiceHost.exe, ?:\Windows\ADWS\Microsoft.ActiveDirectory.WebServices.exe, \Device\Mup\*\VMedView.exeexcludes:process.executable
process.executablewildcardC:\Program Files\IIS Express\iisexpress.exe, C:\Windows\ADWS\Microsoft.ActiveDirectory.WebServices.exe, C:\Program Files (x86)\ISDecisions\FileAudit\FileAuditService.exe, C:\Program Files (x86)\baramundi\Management Server\bServer.exe, C:\Program Files (x86)\OpenDNS\OpenDNS Connector\v*\CiscoAuditClient.exe, C:\Program Files (x86)\Cisco\CiscoADConnector\v*\CiscoAuditClient.exeexcludes:process.executable

Kubectl Configuration Discovery

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

This rule detects the execution of kubectl commands that are commonly used for configuration discovery in Kubernetes environments. It looks for process events where kubectl is executed with arguments that query configuration information, such as configmaps. In environments where kubectl is not expected to be used, this could indicate potential reconnaissance activity by an adversary.

MITRE ATT&CK Coverage

Rule Body

[metadata]
creation_date = "2025/06/19"
integration = ["endpoint", "auditd_manager", "crowdstrike", "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/02/05"

[rule]
author = ["Elastic"]
building_block_type = "default"
description = """
This rule detects the execution of kubectl commands that are commonly used for configuration discovery in Kubernetes
environments. It looks for process events where kubectl is executed with arguments that query configuration information,
such as configmaps. In environments where kubectl is not expected to be used, this could indicate potential reconnaissance
activity by an adversary.
"""
from = "now-119m"
index = [
    "logs-endpoint.events.*",
    "endgame-*",
    "auditbeat-*",
    "logs-auditd_manager.auditd-*",
    "logs-crowdstrike.fdr*",
    "logs-cloud_defend.process*",
]
interval = "60m"
language = "eql"
license = "Elastic License v2"
name = "Kubectl Configuration Discovery"
risk_score = 21
rule_id = "98ac2919-f8b3-4d2d-b85b-e1c13ac0c68b"
severity = "low"
tags = [
  "Domain: Container",
  "Domain: Endpoint",
  "Domain: Kubernetes",
  "OS: Linux",
  "Use Case: Threat Detection",
  "Tactic: Discovery",
  "Rule Type: BBR",
  "Data Source: Elastic Defend",
  "Data Source: Elastic Endgame",
  "Data Source: Auditd Manager",
  "Data Source: Crowdstrike",
  "Data Source: Elastic Defend for Containers",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
process where host.os.type == "linux" and event.type == "start" and
event.action in ("exec", "exec_event", "executed", "process_started", "ProcessRollup2") and
process.name == "kubectl" and process.args in ("get", "describe") and process.args in ("configmap", "configmaps") and
not ?process.parent.args in (
  "/hooks/schedule_sync_configmap.sh", "/service-fabric/generate-support-bundle.sh", "/hooks/onstartup_sync_configmap.sh"
)
'''

[[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: process

process where host.os.type == "linux" and event.type == "start" and
event.action in ("exec", "exec_event", "executed", "process_started", "ProcessRollup2") and
process.name == "kubectl" and process.args in ("get", "describe") and process.args in ("configmap", "configmaps") and
not ?process.parent.args in (
  "/hooks/schedule_sync_configmap.sh", "/service-fabric/generate-support-bundle.sh", "/hooks/onstartup_sync_configmap.sh"
)

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.parent.argsin/hooks/onstartup_sync_configmap.sh, /hooks/schedule_sync_configmap.sh, /service-fabric/generate-support-bundle.shexcludes:process.parent.args field:"process.parent.args" value:"/hooks/onstartup_sync_configmap.sh" field:"process.parent.args" value:"/hooks/schedule_sync_configmap.sh" field:"process.parent.args" value:"/service-fabric/generate-support-bundle.sh"

M365 Exchange Malware Filter Rule Modified

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

Identifies when a malware filter rule has been deleted or disabled in Microsoft 365. An adversary or insider threat may want to modify a malware filter rule to evade detection.

Known False Positives

  • A malware filter rule may be deleted by a system or network administrator. Verify that the configuration change was expected. Exceptions can be added to this rule to filter expected behavior.

MITRE ATT&CK Coverage

Telemetry Coverage

Rule Body

[metadata]
creation_date = "2020/11/19"
integration = ["o365"]
maturity = "production"
updated_date = "2026/04/10"

[rule]
author = ["Elastic"]
description = """
Identifies when a malware filter rule has been deleted or disabled in Microsoft 365. An adversary or insider threat may
want to modify a malware filter rule to evade detection.
"""
false_positives = [
    """
    A malware filter rule may be deleted by a system or network administrator. Verify that the configuration change was
    expected. Exceptions can be added to this rule to filter expected behavior.
    """,
]
from = "now-9m"
index = ["logs-o365.audit-*", "filebeat-*"]
language = "kuery"
license = "Elastic License v2"
name = "M365 Exchange Malware Filter Rule Modified"
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 M365 Exchange Malware Filter Rule Modified

Microsoft 365 Exchange uses malware filter rules to protect email systems by identifying and blocking malicious content. Adversaries may attempt to disable or remove these rules to bypass security measures and facilitate attacks. The detection rule monitors audit logs for successful actions that alter these rules, signaling potential defense evasion tactics. This helps security analysts quickly identify and respond to unauthorized modifications.

### Possible investigation steps

- Review the audit logs for the specific event.dataset:o365.audit entries with event.provider:Exchange to confirm the occurrence of the rule modification.
- Identify the user account associated with the event.action:("Remove-MalwareFilterRule" or "Disable-MalwareFilterRule") and verify if the action was authorized or expected.
- Check the event.category:web logs for any related activities around the same timeframe to identify potential patterns or additional suspicious actions.
- Investigate the event.outcome:success to ensure that the modification was indeed successful and assess the impact on the organization's security posture.
- Correlate the identified actions with any recent security incidents or alerts to determine if this modification is part of a larger attack or threat campaign.
- Review the user's recent activity and access logs to identify any other unusual or unauthorized actions that may indicate compromised credentials or insider threat behavior.

### False positive analysis

- Routine administrative changes to malware filter rules by authorized IT personnel can trigger alerts. To manage this, maintain a list of authorized users and their expected activities, and create exceptions for these users in the monitoring system.
- Scheduled maintenance or updates to Microsoft 365 configurations might involve temporary disabling of certain rules. Document these activities and adjust the monitoring system to recognize these as non-threatening.
- Automated scripts or third-party tools used for system management may perform actions that resemble rule modifications. Ensure these tools are properly documented and their actions are whitelisted if verified as safe.
- Changes made during incident response or troubleshooting can appear as rule modifications. Coordinate with the incident response team to log these activities and exclude them from triggering alerts.

### Response and remediation

- Immediately isolate the affected user accounts and systems to prevent further unauthorized modifications to the malware filter rules.
- Re-enable or recreate the disabled or removed malware filter rules to restore the intended security posture of the Microsoft 365 environment.
- Conduct a thorough review of recent email traffic and logs to identify any potential malicious content that may have bypassed the filters during the period of rule modification.
- Escalate the incident to the security operations center (SOC) or incident response team for further investigation and to determine if additional systems or accounts have been compromised.
- Implement enhanced monitoring and alerting for any future attempts to modify malware filter rules, ensuring rapid detection and response.
- Review and update access controls and permissions for administrative actions within Microsoft 365 to limit the ability to modify security configurations to only essential personnel.
- Document the incident, including actions taken and lessons learned, to improve future response efforts and update incident response plans accordingly.

## Setup

The Office 365 Logs Fleet integration, Filebeat module, or similarly structured data is required to be compatible with this rule."""
references = [
    "https://docs.microsoft.com/en-us/powershell/module/exchange/remove-malwarefilterrule?view=exchange-ps",
    "https://docs.microsoft.com/en-us/powershell/module/exchange/disable-malwarefilterrule?view=exchange-ps",
]
risk_score = 47
rule_id = "ca79768e-40e1-4e45-a097-0e5fbc876ac2"
severity = "medium"
tags = [
    "Domain: Cloud",
    "Data Source: Microsoft 365",
    "Use Case: Configuration Audit",
    "Tactic: Defense Evasion",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "query"

query = '''
data_stream.dataset:o365.audit and event.provider:Exchange and event.category:web and event.action:("Remove-MalwareFilterRule" or "Disable-MalwareFilterRule") and event.outcome:success
'''


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

[[rule.threat.technique]]
id = "T1484"
name = "Domain or Tenant Policy Modification"
reference = "https://attack.mitre.org/techniques/T1484/"

[[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: query

data_stream.dataset:o365.audit and event.provider:Exchange and event.category:web and event.action:("Remove-MalwareFilterRule" or "Disable-MalwareFilterRule") and event.outcome:success

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
data_stream.dataseteq
  • o365.audit corpus 38 (elastic 38)
field:"data_stream.dataset" kind:eq value:"o365.audit"
event.actionin
  • Disable-MalwareFilterRule
  • Remove-MalwareFilterRule
field:"EventType" kind:in
event.categoryeq
  • web corpus 20 (elastic 20)
field:"event.category" kind:eq value:"web"
event.outcomeeq
  • success corpus 306 (elastic 306)
field:"event.outcome" kind:eq value:"success"
event.providereq
  • Exchange corpus 16 (elastic 16)
field:"Provider_Name" kind:eq value:"Exchange"

Potential DNS Tunneling via Long and Unique Subdomains

#
Status
production
Severity
medium
Time window
9m
Group by
Esql.client_ip, Esql.dns_registered_domain, Esql.time_window
Author
Elastic
Source
github.com/elastic/detection-rules

Identifies a client generating many unique, unusually long DNS query names to the same registered domain within a five-minute window. Malware DNS tunnels and DNS command-and-control commonly encode data in lengthy subdomain portions under one apex domain.

Known False Positives

  • CDN, cloud load-balancer, software-update, and telemetry hostnames can be long and change often. Recursive resolvers, forwarders, NAT gateways, and localhost DNS listeners can also combine queries from many endpoints under one client address. Validate the apex domain and whether the source is an endpoint before treating the activity as tunneling.

MITRE ATT&CK Coverage

Rule Body

[metadata]
creation_date = "2026/08/20"
integration = ["network_traffic", "fortinet_fortigate", "zeek"]
maturity = "production"
updated_date = "2026/08/26"

[rule]
author = ["Elastic"]
description = """
Identifies a client generating many unique, unusually long DNS query names to the same registered domain within a
five-minute window. Malware DNS tunnels and DNS command-and-control commonly encode data in lengthy subdomain portions
under one apex domain.
"""
false_positives = [
    """
    CDN, cloud load-balancer, software-update, and telemetry hostnames can be long and change often. Recursive
    resolvers, forwarders, NAT gateways, and localhost DNS listeners can also combine queries from many endpoints under
    one client address. Validate the apex domain and whether the source is an endpoint before treating the activity as
    tunneling.
    """,
]
from = "now-9m"
language = "esql"
license = "Elastic License v2"
name = "Potential DNS Tunneling via Long and Unique Subdomains"
note = """## Triage and analysis

### Investigating Potential DNS Tunneling via Long and Unique Subdomains

DNS tunneling encodes data in query labels and often produces many unique, unusually long subdomains under a single apex
domain. This rule aggregates network DNS telemetry for that behavioral pattern without relying on threat intelligence
feeds or machine learning jobs.

Compare overlapping apex domains against the machine learning **DNS Tunneling** rule when that job is enabled.

### Possible investigation steps

- Review `Esql.dns_registered_domain`, `Esql.count_distinct_names`, `Esql.unique_name_ratio`,
  `Esql.max_subdomain_length`, and sample values in `Esql.sample_names`.
- Inspect `Esql.dns_question_type_values`. TXT, NULL, CNAME, or MX bursts increase confidence; A/AAAA-only activity can
  still be tunneling and should not be dismissed on type alone.
- Use `Esql.first_seen`, `Esql.last_seen`, `Esql.dataset_values`, and `Esql.observer_name_values` to establish the event
  span and identify the integrations and sensors that contributed to the alert.
- Confirm whether `Esql.client_ip` is a workstation, server, recursive resolver, forwarder, NAT address, or localhost
  DNS service. Resolver and localhost sources merge many clients and are a common false-positive pattern.
- Review `Esql.destination_ip_values` to identify the resolver or authoritative destination observed by the sensor.
- Pivot on the same client and apex domain in raw DNS events and look for follow-on process, file, or additional C2
  activity.

### False positive analysis

- CDN, cloud load-balancer, certificate, and software-update services often create long hostnames. Confirm the apex
  domain reputation and whether the requesting host role normally uses that provider.
- Security or network appliances performing DNS-based reachability or reputation checks can resemble tunneling. Exclude
  confirmed appliance addresses after validation.
- Do not create a global resolver exception until the originating endpoint is known; a shared `Esql.client_ip` can hide
  a single infected host behind legitimate bulk lookups.

### Response and remediation

- Block the apex domain or forwarding from the affected host at recursive resolvers if malicious activity is confirmed.
- Isolate the source host and inspect for tunneling tools or malware initiating the queries.
- Add temporary blocks for the apex domain while scoping additional hosts querying the same name.
"""
references = [
    "https://unit42.paloaltonetworks.com/dns-tunneling-how-dns-can-be-abused-by-malicious-actors/",
]
risk_score = 47
rule_id = "89ed957d-609b-4b00-b8c6-a5cbd187632c"
setup = """## Setup

This rule requires DNS transaction events from one of the following sources:

- Elastic Network Packet Capture (`network_traffic.dns`) in `logs-network_traffic.dns-*`
- Fortinet FortiGate DNS logs (`fortinet_fortigate.log`) in `logs-fortinet_fortigate.log-*`
- Elastic Zeek (`zeek.dns`) in `logs-zeek.dns-*`
- Legacy Packetbeat DNS events in `packetbeat-*` with `event.dataset` set to `dns`

Place the sensor where it observes endpoint-to-resolver DNS traffic. If the sensor is upstream of a recursive resolver,
or if the captured client is a localhost listener such as `127.0.0.1`, `Esql.client_ip` may identify shared DNS
infrastructure instead of the originating endpoint.

DNS-over-HTTPS (DoH), DNS-over-TLS (DoT), and other encrypted DNS traffic are not visible to packet capture unless the
sensor receives decrypted DNS telemetry or equivalent resolver logs mapped to ECS.
"""
severity = "medium"
tags = [
    "Domain: Network",
    "Use Case: Threat Detection",
    "Use Case: Network Security Monitoring",
    "Rule Type: ESQL",
    "Tactic: Command and Control",
    "Tactic: Exfiltration",
    "Data Source: Network Packet Capture",
    "Data Source: Fortinet",
    "Data Source: Network Traffic",
    "Data Source: Zeek",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "esql"

query = '''
from logs-network_traffic.dns-*, logs-fortinet_fortigate.log-*, logs-zeek.dns-*, packetbeat-*
| where
    (
      data_stream.dataset in ("network_traffic.dns", "fortinet_fortigate.log", "zeek.dns")
      or event.dataset == "dns"
    )
    and dns.question.name is not null
    and dns.question.registered_domain is not null
| eval
    Esql.client_ip = COALESCE(client.ip, source.ip),
    Esql.dataset = COALESCE(data_stream.dataset, event.dataset),
    Esql.dns_question_name = TO_LOWER(dns.question.name),
    Esql.dns_registered_domain = TO_LOWER(dns.question.registered_domain),
    Esql.dns_question_type = TO_LOWER(dns.question.type),
    Esql.subdomain_length = LENGTH(Esql.dns_question_name) - LENGTH(Esql.dns_registered_domain) - 1
| where
    Esql.client_ip is not null
    and Esql.subdomain_length >= 50
    and (Esql.dns_question_type is null or Esql.dns_question_type != "ptr")
    and not ENDS_WITH(Esql.dns_question_name, ".arpa")
| eval Esql.time_window = DATE_TRUNC(5 minutes, @timestamp)
| stats
    Esql.count_queries = COUNT(*),
    Esql.count_distinct_names = COUNT_DISTINCT(Esql.dns_question_name),
    Esql.max_subdomain_length = MAX(Esql.subdomain_length),
    Esql.avg_subdomain_length = AVG(Esql.subdomain_length),
    Esql.dns_question_type_values = MV_SLICE(VALUES(Esql.dns_question_type), 0, 9),
    Esql.destination_ip_values = MV_SLICE(VALUES(destination.ip), 0, 4),
    Esql.sample_names = MV_SLICE(VALUES(Esql.dns_question_name), 0, 4),
    Esql.dataset_values = MV_SLICE(VALUES(Esql.dataset), 0, 9),
    Esql.observer_name_values = MV_SLICE(VALUES(observer.name), 0, 19),
    Esql.first_seen = MIN(@timestamp),
    Esql.last_seen = MAX(@timestamp)
  by Esql.time_window, Esql.client_ip, Esql.dns_registered_domain
| where Esql.count_queries >= 25 and Esql.count_distinct_names >= 15
| eval Esql.unique_name_ratio = TO_DOUBLE(Esql.count_distinct_names) / Esql.count_queries
| keep Esql.*
'''


[[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.subtechnique]]
id = "T1071.004"
name = "DNS"
reference = "https://attack.mitre.org/techniques/T1071/004/"


[[rule.threat.technique]]
id = "T1572"
name = "Protocol Tunneling"
reference = "https://attack.mitre.org/techniques/T1572/"


[rule.threat.tactic]
id = "TA0011"
name = "Command and Control"
reference = "https://attack.mitre.org/tactics/TA0011/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1048"
name = "Exfiltration Over Alternative Protocol"
reference = "https://attack.mitre.org/techniques/T1048/"
[[rule.threat.technique.subtechnique]]
id = "T1048.003"
name = "Exfiltration Over Unencrypted Non-C2 Protocol"
reference = "https://attack.mitre.org/techniques/T1048/003/"



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

[rule.investigation_fields]
field_names = [
    "Esql.client_ip",
    "Esql.dns_registered_domain",
    "Esql.time_window",
    "Esql.count_queries",
    "Esql.count_distinct_names",
    "Esql.unique_name_ratio",
    "Esql.max_subdomain_length",
    "Esql.avg_subdomain_length",
    "Esql.dns_question_type_values",
    "Esql.destination_ip_values",
    "Esql.sample_names",
    "Esql.dataset_values",
    "Esql.observer_name_values",
    "Esql.first_seen",
    "Esql.last_seen",
]

Stages and Predicates

Stage 1: from

from logs-network_traffic.dns-*, logs-fortinet_fortigate.log-*, logs-zeek.dns-*, packetbeat-*

Stage 2: where

| where
    (
      data_stream.dataset in ("network_traffic.dns", "fortinet_fortigate.log", "zeek.dns")
      or event.dataset == "dns"
    )
    and dns.question.name is not null
    and dns.question.registered_domain is not null

Stage 3: eval

| eval
    Esql.client_ip = COALESCE(client.ip, source.ip),
    Esql.dataset = COALESCE(data_stream.dataset, event.dataset),
    Esql.dns_question_name = TO_LOWER(dns.question.name),
    Esql.dns_registered_domain = TO_LOWER(dns.question.registered_domain),
    Esql.dns_question_type = TO_LOWER(dns.question.type),
    Esql.subdomain_length = LENGTH(Esql.dns_question_name) - LENGTH(Esql.dns_registered_domain) - 1

Stage 4: where

| where
    Esql.client_ip is not null
    and Esql.subdomain_length >= 50
    and (Esql.dns_question_type is null or Esql.dns_question_type != "ptr")
    and not ENDS_WITH(Esql.dns_question_name, ".arpa")

Stage 5: eval

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

Stage 6: stats

| stats
    Esql.count_queries = COUNT(*),
    Esql.count_distinct_names = COUNT_DISTINCT(Esql.dns_question_name),
    Esql.max_subdomain_length = MAX(Esql.subdomain_length),
    Esql.avg_subdomain_length = AVG(Esql.subdomain_length),
    Esql.dns_question_type_values = MV_SLICE(VALUES(Esql.dns_question_type), 0, 9),
    Esql.destination_ip_values = MV_SLICE(VALUES(destination.ip), 0, 4),
    Esql.sample_names = MV_SLICE(VALUES(Esql.dns_question_name), 0, 4),
    Esql.dataset_values = MV_SLICE(VALUES(Esql.dataset), 0, 9),
    Esql.observer_name_values = MV_SLICE(VALUES(observer.name), 0, 19),
    Esql.first_seen = MIN(@timestamp),
    Esql.last_seen = MAX(@timestamp)
  by Esql.time_window, Esql.client_ip, Esql.dns_registered_domain

Stage 7: where

| where Esql.count_queries >= 25 and Esql.count_distinct_names >= 15

Stage 8: eval

| eval Esql.unique_name_ratio = TO_DOUBLE(Esql.count_distinct_names) / Esql.count_queries

Stage 9: keep

| keep Esql.*

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
Esql.dns_question_nameends_with.arpaexcludes:Esql.dns_question_name field:"Esql.dns_question_name" value:".arpa"

Output Fields

These fields are emitted when the rule matches.

FieldSource
Esql.*KEEP Esql.*

Potential Escalation via Vulnerable MSI Repair

#

Potential Image Load via Transactional NTFS

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

Identifies attempts to load a library from a potentially transacted file. This is a technique that exploits Transactional NTFS to execute arbitrary code in the address space of a separate running process, without committing the code to disk.

MITRE ATT&CK Coverage

TacticTechniques
Stealth

Rule Body

[rule]
description = """
Identifies attempts to load a library from a potentially transacted file. This is a technique that exploits
Transactional NTFS to execute arbitrary code in the address space of a separate running process, without committing the
code to disk.
"""
id = "edc23204-fd97-4c0f-8a2a-bb769370a7e3"
license = "Elastic License v2"
name = "Potential Image Load via Transactional NTFS"
os_list = ["windows"]
reference = ["https://www.elastic.co/blog/process-ghosting-a-new-executable-image-tampering-attack"]
version = "1.0.5"

query = '''
sequence with maxspan=1m
[library where event.action == "load" and process.pid != 4 and
  dll.Ext.defense_evasions : "Process Tampering: Image is writable" and
  dll.Ext.defense_evasions : "Process Tampering: Image has been accessed before mapping"] by process.entity_id as event0
[api where
  process.Ext.api.name in ("SetThreadContext", "Wow64SetThreadContext") and
  process.executable != null and process.Ext.api.behaviors == "cross-process" and
  stringcontains~(process.Ext.api.summary, event0.dll.name) and
  process.thread.Ext.call_stack_final_user_module.name != null and
  process.thread.Ext.call_stack_final_user_module.name != "Kernel"] by Target.process.entity_id
'''

min_endpoint_version = "8.12.0"
[[actions]]
action = "kill_process"
field = "Target.process.entity_id"
state = 0
tree = true

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

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

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


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

[internal]
min_endpoint_version = "8.12.0"

Stages and Predicates

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

Stage 1: library

[library where event.action == "load" and process.pid != 4 and
  dll.Ext.defense_evasions : "Process Tampering: Image is writable" and
  dll.Ext.defense_evasions : "Process Tampering: Image has been accessed before mapping"] by process.entity_id as event0

Stage 2: api

[api where
  process.Ext.api.name in ("SetThreadContext", "Wow64SetThreadContext") and
  process.executable != null and process.Ext.api.behaviors == "cross-process" and
  stringcontains~(process.Ext.api.summary, event0.dll.name) and
  process.thread.Ext.call_stack_final_user_module.name != null and
  process.thread.Ext.call_stack_final_user_module.name != "Kernel"] by Target.process.entity_id

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
dll.Ext.defense_evasionswildcard
  • Process Tampering: Image has been accessed before mapping corpus 2 (elastic 2)
  • Process Tampering: Image is writable corpus 2 (elastic 2)
field:"dll.Ext.defense_evasions" kind:wildcard
event.actioneq
  • load corpus 23 (elastic 23)
field:"EventType" kind:eq value:"load"
process.Ext.api.behaviorseq
  • cross-process corpus 18 (elastic 18)
field:"process.Ext.api.behaviors" kind:eq value:"cross-process"
process.Ext.api.namein
  • SetThreadContext corpus 14 (elastic 14)
  • Wow64SetThreadContext corpus 2 (elastic 2)
field:"process.Ext.api.name" kind:in
process.Ext.api.summarycontains
  • event0.dll.name (field reference)
field:"process.Ext.api.summary" kind:contains value:"event0.dll.name"
process.executableis_not_null
  • (no value, null check)
field:"Image" kind:is_not_null
process.pidne
  • 4 transforms: number corpus 44 (elastic 44)
field:"process_id" kind:ne value:"4"
process.thread.Ext.call_stack_final_user_module.nameis_not_null
  • (no value, null check)
field:"process.thread.Ext.call_stack_final_user_module.name" kind:is_not_null
process.thread.Ext.call_stack_final_user_module.namene
  • Kernel corpus 6 (elastic 6)
field:"process.thread.Ext.call_stack_final_user_module.name" kind:ne value:"Kernel"

Potential Protocol Tunneling via EarthWorm

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

Identifies the execution of the EarthWorm tunneler. Adversaries may tunnel network communications to and from a victim system within a separate protocol to avoid detection and network filtering, or to enable access to otherwise unreachable systems.

MITRE ATT&CK Coverage

TacticTechniques
Command & Control

Rule Body

[metadata]
creation_date = "2021/04/12"
integration = ["endpoint", "crowdstrike", "sentinel_one_cloud_funnel", "auditd_manager"]
maturity = "production"
updated_date = "2026/03/24"

[transform]
[[transform.osquery]]
label = "Osquery - Retrieve Listening Ports"
query = "SELECT pid, address, port, socket, protocol, path FROM listening_ports"

[[transform.osquery]]
label = "Osquery - Retrieve Open Sockets"
query = "SELECT pid, family, remote_address, remote_port, socket, state FROM process_open_sockets"

[[transform.osquery]]
label = "Osquery - Retrieve Information for a Specific User"
query = "SELECT * FROM users WHERE username = {{user.name}}"

[[transform.osquery]]
label = "Osquery - Investigate the Account Authentication Status"
query = "SELECT * FROM logged_in_users WHERE user = {{user.name}}"

[[transform.osquery]]
label = "Osquery - Retrieve Running Processes by User"
query = "SELECT pid, username, name FROM processes p JOIN users u ON u.uid = p.uid ORDER BY username"

[[transform.osquery]]
label = "Osquery - Retrieve Process Info"
query = "SELECT name, cmdline, parent, path, uid FROM processes"

[rule]
author = ["Elastic"]
description = """
Identifies the execution of the EarthWorm tunneler. Adversaries may tunnel network communications to and from a victim
system within a separate protocol to avoid detection and network filtering, or to enable access to otherwise unreachable
systems.
"""
from = "now-9m"
index = [
    "auditbeat-*",
    "endgame-*",
    "logs-auditd_manager.auditd-*",
    "logs-crowdstrike.fdr*",
    "logs-endpoint.events.process*",
    "logs-sentinel_one_cloud_funnel.*",
]
language = "eql"
license = "Elastic License v2"
name = "Potential Protocol Tunneling via EarthWorm"
note = """## Triage and analysis

### Investigating Potential Protocol Tunneling via EarthWorm

Attackers can leverage `earthworm` to clandestinely tunnel network communications and evade security measures, potentially gaining unauthorized access to sensitive systems.

This rule looks for several command line arguments that are consistent with `earthworm` tunneling behavior. 

> **Note**:
> This investigation guide uses the [Osquery Markdown Plugin](https://www.elastic.co/guide/en/security/current/invest-guide-run-osquery.html) introduced in Elastic Stack version 8.5.0. Older Elastic Stack versions will display unrendered Markdown in this guide.
> This investigation guide uses [placeholder fields](https://www.elastic.co/guide/en/security/current/osquery-placeholder-fields.html) to dynamically pass alert data into Osquery queries. Placeholder fields were introduced in Elastic Stack version 8.7.0. If you're using Elastic Stack version 8.6.0 or earlier, you'll need to manually adjust this investigation guide's queries to ensure they properly run.

#### Possible investigation steps

- Identify any signs of suspicious network activity or anomalies that may indicate protocol tunneling. This could include unexpected traffic patterns or unusual network behavior.
  - Investigate listening ports and open sockets to look for potential protocol tunneling, reverse shells, or data exfiltration.
    - $osquery_0
    - $osquery_1
- Identify the user account that performed the action, analyze it, and check whether it should perform this kind of action.
  - $osquery_2
- Investigate whether the user is currently logged in and active.
  - $osquery_3
- Investigate the script execution chain (parent process tree) for unknown processes. Examine their executable files for prevalence and whether they are located in expected locations.
  - $osquery_4
  - $osquery_5
- Investigate other alerts associated with the user/host during the past 48 hours.
  - If scripts or executables were dropped, retrieve the files and determine if they are malicious:
    - Use a private sandboxed malware analysis system to perform analysis.
      - Observe and collect information about the following activities:
        - Attempts to contact external domains and addresses.
          - Check if the domain is newly registered or unexpected.
          - Check the reputation of the domain or IP address.
        - File access, modification, and creation activities.

### Related rules

- Potential Protocol Tunneling via Chisel Client - 3f12325a-4cc6-410b-8d4c-9fbbeb744cfd
- Potential Protocol Tunneling via Chisel Server - ac8805f6-1e08-406c-962e-3937057fa86f
- Potential Linux Tunneling and/or Port Forwarding - 6ee947e9-de7e-4281-a55d-09289bdf947e

### False positive analysis

- If this activity is related to new benign software installation activity, consider adding exceptions — preferably with a combination of user and command line conditions.
- If this activity is related to a system administrator or developer who uses port tunneling for benign purposes, consider adding exceptions for specific user accounts or hosts. 
- Try to understand the context of the execution by thinking about the user, machine, or business purpose. A small number of endpoints, such as servers with unique software, might appear unusual but satisfy a specific business need.

### Response and remediation

- Initiate the incident response process based on the outcome of the triage.
- Isolate the involved host to prevent further post-compromise behavior.
- If the triage identified malware, search the environment for additional compromised hosts.
  - Implement temporary network rules, procedures, and segmentation to contain the malware.
  - Stop suspicious processes.
  - Immediately block the identified indicators of compromise (IoCs).
  - Inspect the affected systems for additional malware backdoors, such as reverse shells, reverse proxies, or droppers, that attackers could use to reinfect the system.
- Remove and block malicious artifacts identified during triage.
- 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.
- Leverage the incident response data and logging to improve the mean time to detect (MTTD) and the mean time to respond (MTTR).
"""
references = [
    "http://rootkiter.com/EarthWorm/",
    "https://decoded.avast.io/luigicamastra/apt-group-targeting-governmental-agencies-in-east-asia/",
]
risk_score = 73
rule_id = "9f1c4ca3-44b5-481d-ba42-32dc215a2769"
setup = """## Setup

This rule requires data coming in either from Elastic Defend, or Auditbeat integration.

### 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).

### Auditbeat Setup
Auditbeat is a lightweight shipper that you can install on your servers to audit the activities of users and processes on your systems. For example, you can use Auditbeat to collect and centralize audit events from the Linux Audit Framework. You can also use Auditbeat to detect changes to critical files, like binaries and configuration files, and identify potential security policy violations.

#### The following steps should be executed in order to add the Auditbeat on a Linux System:
- Elastic provides repositories available for APT and YUM-based distributions. Note that we provide binary packages, but no source packages.
- To install the APT and YUM repositories follow the setup instructions in this [helper guide](https://www.elastic.co/guide/en/beats/auditbeat/current/setup-repositories.html).
- To run Auditbeat on Docker follow the setup instructions in the [helper guide](https://www.elastic.co/guide/en/beats/auditbeat/current/running-on-docker.html).
- To run Auditbeat on Kubernetes follow the setup instructions in the [helper guide](https://www.elastic.co/guide/en/beats/auditbeat/current/running-on-kubernetes.html).
- For complete “Setup and Run Auditbeat” information refer to the [helper guide](https://www.elastic.co/guide/en/beats/auditbeat/current/setting-up-and-running.html).

#### Custom Ingest Pipeline
For versions <8.2, you need to add a custom ingest pipeline to populate `event.ingested` with @timestamp for non-elastic-agent indexes, like auditbeats/filebeat/winlogbeat etc. For more details to add a custom ingest pipeline refer to the [guide](https://www.elastic.co/guide/en/fleet/current/data-streams-pipeline-tutorial.html).
"""
severity = "high"
tags = [
    "Domain: Endpoint",
    "OS: Linux",
    "Use Case: Threat Detection",
    "Tactic: Command and Control",
    "Data Source: Elastic Endgame",
    "Data Source: Elastic Defend",
    "Data Source: Crowdstrike",
    "Data Source: SentinelOne",
    "Data Source: Auditd Manager",
    "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", "start", "exec_event", "ProcessRollup2", "executed", "exec_event", "process_started") and
process.args : "-s" and process.args : "-d" and process.args : "rssocks"
'''

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

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

[[rule.threat.technique]]
id = "T1572"
name = "Protocol Tunneling"
reference = "https://attack.mitre.org/techniques/T1572/"

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

Stages and Predicates

Stage 1: process

process where host.os.type == "linux" and event.type == "start" and
event.action in ("exec", "start", "exec_event", "ProcessRollup2", "executed", "exec_event", "process_started") and
process.args : "-s" and process.args : "-d" and process.args : "rssocks"

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actionin
  • ProcessRollup2
  • exec
  • exec_event
  • executed
  • process_started
  • start
field:"EventType" kind:in
event.typeeq
  • start
field:"event.type" kind:eq value:"start"
process.argswildcard
  • -d
  • -s
  • rssocks
field:"process.args" kind:wildcard

Private Key Searching Activity

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

This rule detects private key searching activity on Linux systems. Searching for private keys can be an indication of an attacker attempting to escalate privileges or exfiltrate sensitive information.

MITRE ATT&CK Coverage

Rule Body

[metadata]
creation_date = "2024/11/04"
integration = ["endpoint", "crowdstrike", "sentinel_one_cloud_funnel", "auditd_manager"]
maturity = "production"
updated_date = "2026/03/24"

[rule]
author = ["Elastic"]
description = """
This rule detects private key searching activity on Linux systems. Searching for private keys can be an indication of an
attacker attempting to escalate privileges or exfiltrate sensitive information.
"""
from = "now-9m"
index = [
    "auditbeat-*",
    "endgame-*",
    "logs-crowdstrike.fdr*",
    "logs-endpoint.events.process*",
    "logs-sentinel_one_cloud_funnel.*",
    "logs-auditd_manager.auditd-*",
]
language = "eql"
license = "Elastic License v2"
name = "Private Key Searching Activity"
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 Private Key Searching Activity

In Linux environments, private keys are crucial for secure communications and authentication. Adversaries may exploit this by searching for private keys to gain unauthorized access or escalate privileges. The detection rule identifies suspicious use of the 'find' command targeting key files in sensitive directories, signaling potential malicious intent. This proactive monitoring helps mitigate risks associated with unauthorized key access.

### Possible investigation steps

- Review the process details to confirm the 'find' command was executed with parameters targeting private key files, as indicated by the command line containing patterns like "*id_dsa*", "*id_rsa*", etc., and directories such as "/home/", "/etc/ssh", or "/root/".
- Identify the user account associated with the process to determine if the activity aligns with expected behavior for that user or if it suggests potential compromise.
- Check the process's parent process to understand the context in which the 'find' command was executed, which may provide insights into whether this was part of a legitimate script or an unauthorized action.
- Investigate any recent login activity or changes in user privileges for the account involved to assess if there has been any unauthorized access or privilege escalation.
- Examine system logs and other security alerts around the time of the event to identify any correlated suspicious activities or anomalies that might indicate a broader attack campaign.

### False positive analysis

- System administrators or automated scripts may use the 'find' command to locate private keys for legitimate maintenance tasks. To handle this, create exceptions for known administrative accounts or scripts that regularly perform these actions.
- Backup processes might search for private keys as part of routine data protection activities. Identify and exclude these processes by specifying their unique command-line patterns or process IDs.
- Security audits or compliance checks often involve scanning for private keys to ensure proper security measures are in place. Exclude these activities by recognizing the specific tools or scripts used during audits.
- Developers or DevOps teams may search for private keys during application deployment or configuration. Establish a list of trusted users or processes involved in these operations and exclude them from triggering alerts.
- Automated configuration management tools like Ansible or Puppet might search for keys as part of their operations. Identify these tools and exclude their specific command-line patterns to prevent false positives.

### 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, particularly those involving the 'find' command searching for private keys.
- Conduct a thorough review of access logs and process execution history to identify any unauthorized access or privilege escalation attempts.
- Change all potentially compromised private keys and associated credentials, ensuring new keys are securely generated and stored.
- Implement stricter access controls and permissions on directories containing private keys to limit exposure to unauthorized users.
- Escalate the incident to the security operations team for further investigation and to determine if additional systems are affected.
- Enhance monitoring and alerting for similar activities by ensuring that detection rules are tuned to capture variations of the 'find' command targeting sensitive files."""
risk_score = 73
rule_id = "627374ab-7080-4e4d-8316-bef1122444af"
setup = """## Setup

This rule requires data coming in from Elastic Defend.

### Elastic Defend Integration Setup
Elastic Defend is integrated into the Elastic Agent using Fleet. Upon configuration, the integration allows the Elastic Agent to monitor events on your host and send data to the Elastic Security app.

#### Prerequisite Requirements:
- Fleet is required for Elastic Defend.
- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).

#### The following steps should be executed in order to add the Elastic Defend integration on a Linux System:
- Go to the Kibana home page and click "Add integrations".
- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.
- Click "Add Elastic Defend".
- Configure the integration name and optionally add a description.
- Select the type of environment you want to protect, either "Traditional Endpoints" or "Cloud Workloads".
- Select a configuration preset. Each preset comes with different default settings for Elastic Agent, you can further customize these later by configuring the Elastic Defend integration policy. [Helper guide](https://www.elastic.co/guide/en/security/current/configure-endpoint-integration-policy.html).
- We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"
- Enter a name for the agent policy in "New agent policy name". If other agent policies already exist, you can click the "Existing hosts" tab and select an existing policy instead.
For more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/8.10/agent-policy.html).
- Click "Save and Continue".
- To complete the integration, select "Add Elastic Agent to your hosts" and continue to the next section to install the Elastic Agent on your hosts.
For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
"""
severity = "high"
tags = [
    "Domain: Endpoint",
    "OS: Linux",
    "Use Case: Threat Detection",
    "Tactic: Discovery",
    "Tactic: Credential Access",
    "Data Source: Auditd Manager",
    "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", "process_started", "executed") and
process.name == "find" and
process.command_line like ("*id_dsa*", "*id_rsa*", "*id_ed*", "*id_ecdsa*", "*id_xmss*", "*id_dh*") and
process.command_line like ("*/home/*", "*/etc/ssh*", "*/root/*", "/")
'''

[[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.technique.subtechnique]]
id = "T1552.004"
name = "Private Keys"
reference = "https://attack.mitre.org/techniques/T1552/004/"

[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", "process_started", "executed") and
process.name == "find" and
process.command_line like ("*id_dsa*", "*id_rsa*", "*id_ed*", "*id_ecdsa*", "*id_xmss*", "*id_dh*") and
process.command_line like ("*/home/*", "*/etc/ssh*", "*/root/*", "/")

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actionin
  • ProcessRollup2
  • exec
  • exec_event
  • executed
  • process_started
  • start
field:"EventType" kind:in
event.typeeq
  • start
field:"event.type" kind:eq value:"start"
process.command_linewildcard
  • */etc/ssh*
  • */home/*
  • */root/*
  • *id_dh*
  • *id_dsa*
  • *id_ecdsa*
  • *id_ed*
  • *id_rsa*
  • *id_xmss*
  • /
field:"CommandLine" kind:wildcard
process.nameeq
  • find
field:"process_basename" kind:eq value:"find"

Prompt for Credentials with Osascript

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

Identifies the use of osascript to execute scripts via standard input that may prompt a user with a rogue dialog for credentials.

MITRE ATT&CK Coverage

Telemetry Coverage

Rule Body

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

[rule]
author = ["Elastic"]
description = """
Identifies the use of osascript to execute scripts via standard input that may prompt a user with a rogue dialog for
credentials.
"""
from = "now-9m"
index = ["logs-endpoint.events.process*"]
language = "eql"
license = "Elastic License v2"
name = "Prompt for Credentials with Osascript"
references = [
    "https://github.com/EmpireProject/EmPyre/blob/master/lib/modules/collection/osx/prompt.py",
    "https://ss64.com/osx/osascript.html",
]
risk_score = 73
rule_id = "38948d29-3d5d-42e3-8aec-be832aaaf8eb"
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",
    "Data Source: Elastic Defend",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"

query = '''
process where event.action == "exec" and host.os.type == "macos" and
 process.name == "osascript" and process.args == "-e" and process.command_line like~ ("*osascript*display*dialog*password*", "*osascript*display*dialog*passphrase*", "*osascript*display*dialog*authenticate*", "*pass*display*dialog*") and
 not (process.parent.executable == "/usr/bin/sudo" and process.command_line like~ "*Encryption Key Escrow*") and
 not (process.command_line like~ "*-e with timeout of 3600 seconds*" and user.id like "0" and process.parent.executable == "/bin/bash") and
 not process.parent.command_line like "sudo*" and
 not process.Ext.effective_parent.executable like~
                                               ("/usr/local/jamf/*",
                                                "/Library/Intune/Microsoft Intune Agent.app/Contents/MacOS/IntuneMdmDaemon",
                                                "/Library/Application Support/Mosyle/MosyleMDM.app/Contents/MacOS/MosyleMDM",
                                                "/Applications/NinjaRMMAgent/programfiles/ninjarmm-macagent",
                                                "/Applications/Karabiner-Elements.app/Contents/MacOS/Karabiner-Elements",
                                                "/Library/Application Support/JAMF/Jamf.app/Contents/MacOS/JamfDaemon.app/Contents/MacOS/JamfDaemon",
                                                "/Library/Application Support/JAMF/Jamf.app/Contents/MacOS/JamfManagementService.app/Contents/MacOS/JamfManagementService")
'''
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 Prompt for Credentials with OSASCRIPT

OSASCRIPT is a macOS utility that allows the execution of AppleScript and other OSA language scripts. Adversaries may exploit it to display deceptive dialogs prompting users for credentials, mimicking legitimate requests. The detection rule identifies suspicious OSASCRIPT usage by monitoring specific command patterns and excluding known legitimate processes, thereby flagging potential credential theft attempts.

### Possible investigation steps

- Review the process command line to confirm if the osascript command includes suspicious patterns like "display dialog" with "password" or "passphrase" to determine if it is attempting to prompt for credentials.
- Check the parent process executable to see if it matches any known legitimate applications or services, such as those listed in the exclusion criteria, to rule out false positives.
- Investigate the user account associated with the process to determine if it is a privileged account or if there is any unusual activity associated with it.
- Examine the process execution context, including the effective parent executable, to identify if the osascript was executed by a legitimate management tool or script.
- Look for any other related alerts or logs around the same timeframe to identify if this is part of a broader attack or isolated incident.
- Assess the risk and impact by determining if any credentials were potentially compromised and if further containment or remediation actions are necessary.

### False positive analysis

- Legitimate administrative scripts using osascript may trigger alerts if they include dialog prompts for passwords or passphrases. To manage this, identify and exclude these scripts by adding their specific command lines or parent executables to the exception list.
- Processes initiated by trusted applications like JAMF or Karabiner-Elements can be mistakenly flagged. Ensure these applications are included in the exclusion list to prevent unnecessary alerts.
- Scheduled maintenance tasks that use osascript for legitimate purposes might be misidentified. Review and exclude these tasks by specifying their user IDs or command line patterns in the detection rule exceptions.
- Custom scripts executed by system administrators for routine operations may appear suspicious. Document these scripts and add them to the exclusion criteria to avoid false positives.
- Terminal-based automation tools that interact with osascript could be incorrectly flagged. Verify these tools and include their paths in the exclusion list to reduce false alerts.

### Response and remediation

- Immediately isolate the affected macOS device from the network to prevent further unauthorized access or data exfiltration.
- Terminate the suspicious osascript process identified by the alert to stop any ongoing credential theft attempts.
- Conduct a thorough review of the affected system's recent activity logs to identify any unauthorized access or changes made during the incident.
- Reset credentials for any accounts that may have been compromised, ensuring that new passwords are strong and unique.
- Escalate the incident to the security operations team for further investigation and to determine if additional systems may be affected.
- Implement additional monitoring on the affected system and similar endpoints to detect any recurrence of the threat.
- Review and update endpoint security configurations to block unauthorized script execution and enhance detection capabilities for similar threats in the future."""


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

[[rule.threat.technique]]
id = "T1056"
name = "Input Capture"
reference = "https://attack.mitre.org/techniques/T1056/"

[[rule.threat.technique.subtechnique]]
id = "T1056.002"
name = "GUI Input Capture"
reference = "https://attack.mitre.org/techniques/T1056/002/"

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

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

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

Stages and Predicates

Stage 1: process

process where event.action == "exec" and host.os.type == "macos" and
 process.name == "osascript" and process.args == "-e" and process.command_line like~ ("*osascript*display*dialog*password*", "*osascript*display*dialog*passphrase*", "*osascript*display*dialog*authenticate*", "*pass*display*dialog*") and
 not (process.parent.executable == "/usr/bin/sudo" and process.command_line like~ "*Encryption Key Escrow*") and
 not (process.command_line like~ "*-e with timeout of 3600 seconds*" and user.id like "0" and process.parent.executable == "/bin/bash") and
 not process.parent.command_line like "sudo*" and
 not process.Ext.effective_parent.executable like~
                                               ("/usr/local/jamf/*",
                                                "/Library/Intune/Microsoft Intune Agent.app/Contents/MacOS/IntuneMdmDaemon",
                                                "/Library/Application Support/Mosyle/MosyleMDM.app/Contents/MacOS/MosyleMDM",
                                                "/Applications/NinjaRMMAgent/programfiles/ninjarmm-macagent",
                                                "/Applications/Karabiner-Elements.app/Contents/MacOS/Karabiner-Elements",
                                                "/Library/Application Support/JAMF/Jamf.app/Contents/MacOS/JamfDaemon.app/Contents/MacOS/JamfDaemon",
                                                "/Library/Application Support/JAMF/Jamf.app/Contents/MacOS/JamfManagementService.app/Contents/MacOS/JamfManagementService")

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • exec corpus 547 (elastic 547)
field:"EventType" kind:eq value:"exec"
process.argseq
  • -e corpus 42 (elastic 42)
field:"process.args" kind:eq value:"-e"
process.command_linewildcard
  • *osascript*display*dialog*authenticate* corpus 2 (elastic 2)
  • *osascript*display*dialog*passphrase* corpus 2 (elastic 2)
  • *osascript*display*dialog*password* corpus 2 (elastic 2)
  • *pass*display*dialog* corpus 2 (elastic 2)
field:"CommandLine" kind:wildcard
process.nameeq
  • osascript corpus 41 (elastic 41)
field:"process_basename" kind:eq value:"osascript"

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.command_linematch-e with timeout of 3600 secondsexcludes:process.command_line field:"process.command_line" value:"-e with timeout of 3600 seconds"
process.parent.executableeq/bin/bashexcludes:process.parent.executable field:"process.parent.executable" value:"/bin/bash"
user.ideq0excludes:user.id field:"user.id" value:"0"
process.command_linematchEncryption Key Escrowexcludes:process.command_line field:"process.command_line" value:"Encryption Key Escrow"
process.parent.executableeq/usr/bin/sudoexcludes:process.parent.executable field:"process.parent.executable" value:"/usr/bin/sudo"
process.Ext.effective_parent.executablewildcard/usr/local/jamf/*, /Library/Intune/Microsoft Intune Agent.app/Contents/MacOS/IntuneMdmDaemon, /Library/Application Support/Mosyle/MosyleMDM.app/Contents/MacOS/MosyleMDM, /Applications/NinjaRMMAgent/programfiles/ninjarmm-macagent, /Applications/Karabiner-Elements.app/Contents/MacOS/Karabiner-Elements, /Library/Application Support/JAMF/Jamf.app/Contents/MacOS/JamfDaemon.app/Contents/MacOS/JamfDaemon, /Library/Application Support/JAMF/Jamf.app/Contents/MacOS/JamfManagementService.app/Contents/MacOS/JamfManagementServiceexcludes:process.Ext.effective_parent.executable
process.parent.command_linestarts_withsudoexcludes:process.parent.command_line field:"process.parent.command_line" value:"sudo"

Query Registry using Built-in Tools

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

This rule identifies the execution of commands that can be used to query the Windows Registry. Adversaries may query the registry to gain situational awareness about the host, like installed security software, programs and settings.

MITRE ATT&CK Coverage

TacticTechniques
Discovery

Rule Body

[metadata]
bypass_bbr_timing = true
creation_date = "2023/07/13"
integration = ["endpoint"]
maturity = "production"
updated_date = "2024/12/19"

[rule]
author = ["Elastic"]
building_block_type = "default"
description = """
This rule identifies the execution of commands that can be used to query the Windows Registry. Adversaries may query the
registry to gain situational awareness about the host, like installed security software, programs and settings.
"""
from = "now-24h"
index = ["logs-endpoint.events.process-*"]
interval = "12h"
language = "kuery"
license = "Elastic License v2"
name = "Query Registry using Built-in Tools"
risk_score = 21
rule_id = "ded09d02-0137-4ccc-8005-c45e617e8d4c"
severity = "low"
tags = [
    "Domain: Endpoint",
    "OS: Windows",
    "Use Case: Threat Detection",
    "Tactic: Discovery",
    "Rule Type: BBR",
    "Data Source: Elastic Defend",
]
timestamp_override = "event.ingested"
type = "new_terms"

query = '''
host.os.type:windows and event.category:process and event.type:start and
  (
    (process.name.caseless:"reg.exe" and process.args:"query") or
    (process.name.caseless:("powershell.exe" or "powershell_ise.exe" or "pwsh.exe") and
     process.args:(
       ("get-childitem" or "Get-ChildItem" or "gci" or "dir" or "ls" or
        "get-item" or "Get-Item" or "gi" or
        "get-itemproperty" or "Get-ItemProperty" or "gp") and
       ("hkcu" or "HKCU" or "hkey_current_user" or "HKEY_CURRENT_USER" or
        "hkey_local_machine" or "HKEY_LOCAL_MACHINE" or
        "hklm" or "HKLM" or registry\:\:*)
      )
    )
  ) and
  not process.command_line : (
    "C:\\Windows\\system32\\reg.exe  query hklm\\software\\microsoft\\windows\\softwareinventorylogging /v collectionstate /reg:64" or
    "reg  query \"HKLM\\Software\\WOW6432Node\\Npcap\" /ve  "
  )
'''


[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1012"
name = "Query Registry"
reference = "https://attack.mitre.org/techniques/T1012/"


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

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


Stages and Predicates

Stage 1: new_terms

host.os.type:windows and event.category:process and event.type:start and
  (
    (process.name.caseless:"reg.exe" and process.args:"query") or
    (process.name.caseless:("powershell.exe" or "powershell_ise.exe" or "pwsh.exe") and
     process.args:(
       ("get-childitem" or "Get-ChildItem" or "gci" or "dir" or "ls" or
        "get-item" or "Get-Item" or "gi" or
        "get-itemproperty" or "Get-ItemProperty" or "gp") and
       ("hkcu" or "HKCU" or "hkey_current_user" or "HKEY_CURRENT_USER" or
        "hkey_local_machine" or "HKEY_LOCAL_MACHINE" or
        "hklm" or "HKLM" or registry\:\:*)
      )
    )
  ) and
  not process.command_line : (
    "C:\\Windows\\system32\\reg.exe  query hklm\\software\\microsoft\\windows\\softwareinventorylogging /v collectionstate /reg:64" or
    "reg  query \"HKLM\\Software\\WOW6432Node\\Npcap\" /ve  "
  )

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.categoryeq
  • process corpus 105 (elastic 105)
field:"event.category" kind:eq value:"process"
event.typeeq
  • start corpus 67 (elastic 67)
field:"event.type" kind:eq value:"start"
process.argseq
  • HKCU
  • HKEY_CURRENT_USER
  • HKEY_LOCAL_MACHINE
  • HKLM
  • hkcu
  • hkey_current_user
  • hkey_local_machine
  • hklm
  • query
field:"process.args" kind:eq
process.argsin
  • Get-ChildItem
  • Get-Item
  • Get-ItemProperty
  • dir
  • gci
  • get-childitem
  • get-item
  • get-itemproperty
  • gi
  • gp
  • ls corpus 2 (elastic 2)
field:"process.args" kind:in
process.argswildcard
  • registry::*
field:"process.args" kind:wildcard value:"registry::*"
process.name.caselesseq
  • reg.exe
field:"process.name.caseless" kind:eq value:"reg.exe"
process.name.caselessin
  • powershell.exe corpus 2 (elastic 2)
  • powershell_ise.exe corpus 2 (elastic 2)
  • pwsh.exe corpus 2 (elastic 2)
field:"process.name.caseless" kind:in

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.command_lineinC:\Windows\system32\reg.exe query hklm\software\microsoft\windows\softwareinventorylogging /v collectionstate /reg:64, reg query "HKLM\Software\WOW6432Node\Npcap" /ve excludes:process.command_line

Script Interpreter Connection to Non-Standard Port

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

Detects the execution of a script interpreter followed by an outbound network connection to a raw IP address on a non-standard port. Many initial access scripts and malware implants connect directly to C2 or payload servers using non-standard ports to avoid detection.

MITRE ATT&CK Coverage

Telemetry Coverage

Rule Body

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

[rule]
author = ["Elastic"]
description = """
Detects the execution of a script interpreter followed by an outbound network connection to a raw IP address 
on a non-standard port. Many initial access scripts and malware implants connect directly to C2 or payload 
servers using non-standard ports to avoid detection.
"""
from = "now-9m"
index = ["logs-endpoint.events.process-*", "logs-endpoint.events.network-*"]
language = "eql"
license = "Elastic License v2"
name = "Script Interpreter Connection to Non-Standard Port"
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 Script Interpreter Connection to Non-Standard Port

This rule detects a macOS script interpreter launch (Python, Node, or Ruby) quickly followed by an outbound connection to a raw IP address over a non-standard port. It matters because implants and initial access scripts often bypass domain-based controls and blend into developer tooling while using unusual ports for C2. A common pattern is a one-liner Python or Node stager that beacons directly to an external IP on a high-but-not-ephemeral port (e.g., 4444/8081) to fetch or execute a second stage.

### Possible investigation steps

- Review the interpreter’s full command line, parent/ancestry, execution path, and working directory to determine whether this was an interactive developer action, a scheduled task, or a hidden launcher.  
- Identify the script/module being executed (including any temp paths or inline code), collect it for analysis, and check for obfuscation, encoded payloads, or remote-fetch logic.  
- Pivot on the destination IP and port to assess reputation, hosting/ASN, geolocation, and whether the host has contacted the same endpoint before or other endpoints on the same unusual port.  
- Correlate around the event time for follow-on activity such as file downloads, new processes, credential access attempts, persistence creation (LaunchAgents/LaunchDaemons), or security tool tampering.  
- Validate the initiating user context and host posture (new user/login, recent software installs, unsigned binaries, quarantine attributes, or MDM exceptions) to decide on containment and scoping to peer endpoints.

### False positive analysis

- A developer runs a short Python/Node/Ruby script with a single argument to test a service by connecting directly to a public IP on an application-specific port (e.g., staging APIs, custom web services, or test listeners), resulting in a raw-IP outbound connection outside common ports.  
- An administrative or diagnostic script (e.g., a quick health check or connectivity probe) executed via an interpreter uses an IP literal for reliability and targets a non-standard port for internal tooling exposed to the internet, producing the same interpreter-to-raw-IP network pattern without malicious intent.

### Response and remediation

- Isolate the affected macOS host from the network (or block only the observed destination IP:port at the firewall) and terminate the Python/Node/Ruby process that initiated the outbound raw-IP connection.  
- Acquire volatile and on-disk artifacts including the interpreter command line, referenced script file, current working directory contents, recent downloads, and any temporary directories used at execution time, then submit the script and any fetched payloads for malware analysis.  
- Hunt for persistence and re-infection by checking for new or modified LaunchAgents/LaunchDaemons, cron entries, login items, and recently added executable files, and remove/rollback any items tied to the interpreter or the suspicious IP:port.  
- Reset potentially impacted credentials and revoke active tokens for the initiating user if the script accessed keychain material, SSH keys, browser sessions, or cloud CLIs near the event time.  
- Restore the endpoint from a known-good snapshot or reimage if the script/payload cannot be confidently eradicated, then validate recovery by confirming no further connections to the same IP:port and no recurrence of the interpreter one-liner.  
- Escalate to IR leadership and initiate broader scoping if multiple hosts contact the same external IP:port, the destination is confirmed malicious, or persistence/credential theft is detected, and harden by restricting script interpreter execution via MDM, enforcing full disk access controls, and adding egress allow-listing for non-standard ports.
"""
references = [
    "https://github.com/blackorbird/APT_REPORT/blob/master/lazarus/2024-10-14%20Lazarus%20InvisibleFerret.pdf"
]
risk_score = 47
rule_id = "aa1e007a-2997-4247-b048-dd9344742560"
severity = "medium"
tags = [
    "Domain: Endpoint",
    "OS: macOS",
    "Use Case: Threat Detection",
    "Tactic: Command and Control",
    "Tactic: Execution",
    "Data Source: Elastic Defend",
    "Resources: Investigation Guide",
]
type = "eql"
query = '''
sequence by process.entity_id with maxspan=1m
  [process where host.os.type == "macos" and event.type == "start" and event.action == "exec" and 
    (process.name like~ "python*" or process.name in ("node", "ruby")) and 
    process.args_count == 2]
  [network where host.os.type == "macos" and event.type == "start" and 
    (process.name like~ "python*" or process.name in ("node", "ruby")) and 
    destination.domain == null and 
    not destination.port in (443, 80, 53, 22, 25, 587, 465, 8080, 8089, 8200, 9200) and 
    destination.port < 49152 and
    not cidrmatch(destination.ip, "240.0.0.0/4", "233.252.0.0/24", "224.0.0.0/4", "198.19.0.0/16", 
                  "192.18.0.0/15", "192.0.0.0/24", "10.0.0.0/8", "127.0.0.0/8", "169.254.0.0/16", 
                  "172.16.0.0/12", "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", "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", "::1", "FE80::/10", "FF00::/8")]
'''

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

[[rule.threat.technique]]
id = "T1571"
name = "Non-Standard Port"
reference = "https://attack.mitre.org/techniques/T1571/"

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

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

[[rule.threat.technique]]
id = "T1059"
name = "Command and Scripting Interpreter"
reference = "https://attack.mitre.org/techniques/T1059/"

[[rule.threat.technique.subtechnique]]
id = "T1059.005"
name = "Visual Basic"
reference = "https://attack.mitre.org/techniques/T1059/005/"

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

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

[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 1m, correlated by process.entity_id.

Stage 1: process

[process where host.os.type == "macos" and event.type == "start" and event.action == "exec" and 
    (process.name like~ "python*" or process.name in ("node", "ruby")) and 
    process.args_count == 2]

Stage 2: network

[network where host.os.type == "macos" and event.type == "start" and 
    (process.name like~ "python*" or process.name in ("node", "ruby")) and 
    destination.domain == null and 
    not destination.port in (443, 80, 53, 22, 25, 587, 465, 8080, 8089, 8200, 9200) and 
    destination.port < 49152 and
    not cidrmatch(destination.ip, "240.0.0.0/4", "233.252.0.0/24", "224.0.0.0/4", "198.19.0.0/16", 
                  "192.18.0.0/15", "192.0.0.0/24", "10.0.0.0/8", "127.0.0.0/8", "169.254.0.0/16", 
                  "172.16.0.0/12", "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", "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", "::1", "FE80::/10", "FF00::/8")]

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
destination.domainis_null
  • (no value, null check)
field:"DestinationHostname" kind:is_null
destination.portlt
  • 49152 transforms: number corpus 3 (elastic 3)
field:"DestinationPort" kind:lt value:"49152"
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.args_counteq
  • 2 transforms: number corpus 35 (elastic 35)
field:"process.args_count" kind:eq value:"2"
process.namein
  • node corpus 25 (elastic 25)
  • ruby corpus 4 (elastic 4)
field:"process_basename" kind:in
process.namewildcard
  • python* corpus 55 (elastic 55)
field:"process_basename" kind:wildcard value:"python*"

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
destination.ipcidr_match240.0.0.0/4, 233.252.0.0/24, 224.0.0.0/4, 198.19.0.0/16, 192.18.0.0/15, 192.0.0.0/24, 10.0.0.0/8, 127.0.0.0/8, 169.254.0.0/16, 172.16.0.0/12, 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, 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, ::1, FE80::/10, FF00::/8excludes:destination.ip
destination.portin22, 25, 443, 465, 53, 587, 80, 8080, 8089, 8200, 9200excludes:destination.port

Shellcode Allocation from Free Memory

#
Source
github.com/elastic/protections-artifacts

Identifies when a process attempts to allocate shellcode from a memory region marked as free.

MITRE ATT&CK Coverage

TacticTechniques
Stealth

Rule Body

[rule]
description = "Identifies when a process attempts to allocate shellcode from a memory region marked as free."
id = "ea26cec9-aa4f-422e-b6e6-f75901c05e21"
license = "Elastic License v2"
name = "Shellcode Allocation from Free Memory"
os_list = ["windows"]
version = "1.0.3"

query = '''
api where process.Ext.api.behaviors == "allocate_shellcode" and
 process.thread.Ext.call_stack_final_user_module.name == "Unbacked" and
 process.thread.Ext.call_stack_summary in
                                ("ntdll.dll|kernelbase.dll|Unbacked",
                                 "ntdll.dll|Unbacked",
                                 "ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|kernelbase.dll|Unbacked",
                                 "ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|Unbacked") and
 _arraysearch(process.thread.Ext.call_stack, $entry, $entry.callsite_trailing_bytes like "FREE___*" and not $entry.protection_provenance like ("Kernel", "Kernel|*")) and
 not _arraysearch(process.thread.Ext.call_stack_final_user_module.code_signature, $entry, $entry.trusted == true) and
 not (process.executable : "C:\\Windows\\SysWOW64\\msiexec.exe" and process.thread.Ext.call_stack_final_user_module.protection_provenance_path like "c:\\windows\\installer\\msi*.tmp")
'''

min_endpoint_version = "8.18.0"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
tree = true

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


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

[internal]
min_endpoint_version = "8.18.0"

Stages and Predicates

Stage 1: api

api where process.Ext.api.behaviors == "allocate_shellcode" and
 process.thread.Ext.call_stack_final_user_module.name == "Unbacked" and
 process.thread.Ext.call_stack_summary in
                                ("ntdll.dll|kernelbase.dll|Unbacked",
                                 "ntdll.dll|Unbacked",
                                 "ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|kernelbase.dll|Unbacked",
                                 "ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|Unbacked") and
 _arraysearch(process.thread.Ext.call_stack, $entry, $entry.callsite_trailing_bytes like "FREE___*" and not $entry.protection_provenance like ("Kernel", "Kernel|*")) and
 not _arraysearch(process.thread.Ext.call_stack_final_user_module.code_signature, $entry, $entry.trusted == true) and
 not (process.executable : "C:\\Windows\\SysWOW64\\msiexec.exe" and process.thread.Ext.call_stack_final_user_module.protection_provenance_path like "c:\\windows\\installer\\msi*.tmp")

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
process.Ext.api.behaviorseq
  • allocate_shellcode corpus 8 (elastic 8)
field:"process.Ext.api.behaviors" kind:eq value:"allocate_shellcode"
process.thread.Ext.call_stack_final_user_module.nameeq
  • Unbacked corpus 21 (elastic 21)
field:"process.thread.Ext.call_stack_final_user_module.name" kind:eq value:"Unbacked"
process.thread.Ext.call_stack_summaryin
  • ntdll.dll|Unbacked corpus 8 (elastic 8)
  • ntdll.dll|kernelbase.dll|Unbacked corpus 11 (elastic 11)
  • ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|Unbacked corpus 5 (elastic 5)
  • ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|kernelbase.dll|Unbacked corpus 6 (elastic 6)
field:"process.thread.Ext.call_stack_summary" kind:in

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.executableeqC:\Windows\SysWOW64\msiexec.exeexcludes:process.executable field:"process.executable" value:"C:\Windows\SysWOW64\msiexec.exe"
process.thread.Ext.call_stack_final_user_module.protection_provenance_pathwildcardc:\windows\installer\msi*.tmpexcludes:process.thread.Ext.call_stack_final_user_module.protection_provenance_path field:"process.thread.Ext.call_stack_final_user_module.protection_provenance_path" value:"c:\windows\installer\msi*.tmp"
process.thread.Ext.call_stack_final_user_module.code_signaturearray_any(no value, null check)excludes:process.thread.Ext.call_stack_final_user_module.code_signature

Suspicious File Memory Mapping via Managed .NET

#
Source
github.com/elastic/protections-artifacts

Identifies attempts to map the content of a file in a memory region with RWX permissions from a Managed .NET application.

MITRE ATT&CK Coverage

TacticTechniques
Stealth

Rule Body

[rule]
description = """
Identifies attempts to map the content of a file in a memory region with RWX permissions from a Managed .NET
application.
"""
id = "6bd0cf1f-e3b9-4c09-884e-1a722f10326b"
license = "Elastic License v2"
name = "Suspicious File Memory Mapping via Managed .NET"
os_list = ["windows"]
reference = [
    "https://learn.microsoft.com/en-us/windows/win32/api/memoryapi/nf-memoryapi-mapviewoffile2",
    "https://www.elastic.co/security-labs/dissecting-remcos-rat-part-four",
    "https://www.elastic.co/security-labs/doubling-down-etw-callstacks",
]
version = "1.0.3"

query = '''
api where process.Ext.api.name == "MapViewOfFile" and process.Ext.api.parameters.protection == "RWX" and
 process.Ext.api.parameters.size >= 100000 and process.Ext.api.metadata.target_address_name == "Unbacked" and
 process.thread.Ext.call_stack_final_user_module.name == "system.core.ni.dll" and
 not _arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info :"c:\\windows\\sys?????\\kernelbase.dll!LoadLibrary*")
'''

min_endpoint_version = "8.10.0"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
tree = true

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


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

[internal]
min_endpoint_version = "8.10.0"

Stages and Predicates

Stage 1: api

api where process.Ext.api.name == "MapViewOfFile" and process.Ext.api.parameters.protection == "RWX" and
 process.Ext.api.parameters.size >= 100000 and process.Ext.api.metadata.target_address_name == "Unbacked" and
 process.thread.Ext.call_stack_final_user_module.name == "system.core.ni.dll" and
 not _arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info :"c:\\windows\\sys?????\\kernelbase.dll!LoadLibrary*")

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.thread.Ext.call_stackarray_any(no value, null check)excludes:process.thread.Ext.call_stack

Suspicious Image Load via LdrLoadDLL

#
Source
github.com/elastic/protections-artifacts

Identifies the load of a library by calling directly the LdrLoadDLL windows API and from a memory allocation with suspicious properties. This could be the result of a process code injection.

MITRE ATT&CK Coverage

TacticTechniques
Stealth

Rule Body

[rule]
description = """
Identifies the load of a library by calling directly the LdrLoadDLL windows API and from a memory allocation with
suspicious properties. This could be the result of a process code injection.
"""
id = "2c4f5a78-a64f-4fcf-ac52-bf91fd9b82c8"
license = "Elastic License v2"
name = "Suspicious Image Load via LdrLoadDLL"
os_list = ["windows"]
reference = [
    "https://www.elastic.co/security-labs/upping-the-ante-detecting-in-memory-threats-with-kernel-call-stacks",
]
version = "1.0.25"

query = '''
library where

   _arraysearch(process.thread.Ext.call_stack, $entry,
                $entry.symbol_info : "*LdrLoadDLL*" and ($entry.protection : "RWX" or $entry.allocation_private_bytes >= 100000)) and

   (process.thread.Ext.call_stack_summary : "ntdll.dll|Unbacked" or
    startswith~(process.thread.Ext.call_stack_summary, concat("ntdll.dll|", process.name))) and

   (dll.name : ("ws2_32.dll", "dnsapi.dll", "wininet.dll", "psapi.dll", "vaultcli.dll") or
    dll.code_signature.trusted == false or dll.code_signature.exists == false) and

   not _arraysearch(process.thread.Ext.call_stack, $entry,
                                                   $entry.symbol_info : ("*LoadLibrary*",
                                                                         "*LdrResolveDelayLoadedAPI*",
                                                                         "*hmpalert.dll!CVCCP*",
                                                                         "*LdrGetProcedureAddressEx*",
                                                                         "?:\\Program Files (x86)\\*.dll*",
                                                                         "?:\\Program Files\\*.dll*",
                                                                         "*KernelBase.dll!CreateProcess*")) and
   /* Managed Code, Cynet MemScanner, xSecuritas, Mcafee */
   not _arraysearch(process.thread.Ext.call_stack, $entry,
                    $entry.callsite_trailing_bytes :
                         ("*8945b4488bcce82c000000908b45b4488b55a8c6420c01488b55a8488b*",
                          "4883c428c3cccccccc800000003c003e00000000004400*",
                          "ff35cbffffffff25020000000f0b000*",
                          "48898424e80300004883bc24e803000000750eff94247e030000898424f0030000eb30488d8c2430010000ff94248e03000048898424e80300004883bc24e803",
                          "8bd885db751eff55c88945f8eb168d8592fdffff50ff55d08bd885db7506ff55c88945f856ff55bc85db0f847601000080bd82fcffff0074508b45fc05a00000",
                          "488b55a8c6420c01833d8bbeb25f007406ff1593c7b25f8945b4488bcce82c000000908b45b4488b55a8c6420c01488b55a8488b8d70ffffff48894a10488d65", 
                          "2048894538488b4d1048c1e103488b7d38488b7550f3a44c8b4d284d8b49484c8b45284d8b4040488b5528488b5220488b4d28488b8988000000ff95a0000000",
                          "83c4209d61c38b1890906683fb1875158b580485db740e8b5b0c81fb33003200750331dbc331db4bc30000000000000000000000000000000000000000000000",
                          "48c78424b000000000000000488b4424680fb7804805000066898424a0000000488b4424680fb7804805000066898424a2000000488b44246848054804000048",
                          "48894568488b4d28488b456848894110488b4540ff50408bd0488b45288910488b8590000000488b40304889455848837d5800745b8b4d30ff5500488bd04883")) and
   not dll.path : ("?:\\Program Files\\*.dll", "?:\\Program Files (x86)\\*.dll",  "?:\\Windows\\assembly\\NativeImages_*.dll") and
   not process.code_signature.subject_name : ("ZOHO Corporation Private Limited", "Sophos Ltd", "Electronic Arts, Inc.", "Epic Games Inc.")
'''

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

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


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

[internal]
min_endpoint_version = "8.8.0"

Stages and Predicates

Stage 1: library

library where
   _arraysearch(process.thread.Ext.call_stack, $entry,
                $entry.symbol_info : "*LdrLoadDLL*" and ($entry.protection : "RWX" or $entry.allocation_private_bytes >= 100000)) and
   (process.thread.Ext.call_stack_summary : "ntdll.dll|Unbacked" or
    startswith~(process.thread.Ext.call_stack_summary, concat("ntdll.dll|", process.name))) and
   (dll.name : ("ws2_32.dll", "dnsapi.dll", "wininet.dll", "psapi.dll", "vaultcli.dll") or
    dll.code_signature.trusted == false or dll.code_signature.exists == false) and
   not _arraysearch(process.thread.Ext.call_stack, $entry,
                                                   $entry.symbol_info : ("*LoadLibrary*",
                                                                         "*LdrResolveDelayLoadedAPI*",
                                                                         "*hmpalert.dll!CVCCP*",
                                                                         "*LdrGetProcedureAddressEx*",
                                                                         "?:\\Program Files (x86)\\*.dll*",
                                                                         "?:\\Program Files\\*.dll*",
                                                                         "*KernelBase.dll!CreateProcess*")) and
   not _arraysearch(process.thread.Ext.call_stack, $entry,
                    $entry.callsite_trailing_bytes :
                         ("*8945b4488bcce82c000000908b45b4488b55a8c6420c01488b55a8488b*",
                          "4883c428c3cccccccc800000003c003e00000000004400*",
                          "ff35cbffffffff25020000000f0b000*",
                          "48898424e80300004883bc24e803000000750eff94247e030000898424f0030000eb30488d8c2430010000ff94248e03000048898424e80300004883bc24e803",
                          "8bd885db751eff55c88945f8eb168d8592fdffff50ff55d08bd885db7506ff55c88945f856ff55bc85db0f847601000080bd82fcffff0074508b45fc05a00000",
                          "488b55a8c6420c01833d8bbeb25f007406ff1593c7b25f8945b4488bcce82c000000908b45b4488b55a8c6420c01488b55a8488b8d70ffffff48894a10488d65",
                          "2048894538488b4d1048c1e103488b7d38488b7550f3a44c8b4d284d8b49484c8b45284d8b4040488b5528488b5220488b4d28488b8988000000ff95a0000000",
                          "83c4209d61c38b1890906683fb1875158b580485db740e8b5b0c81fb33003200750331dbc331db4bc30000000000000000000000000000000000000000000000",
                          "48c78424b000000000000000488b4424680fb7804805000066898424a0000000488b4424680fb7804805000066898424a2000000488b44246848054804000048",
                          "48894568488b4d28488b456848894110488b4540ff50408bd0488b45288910488b8590000000488b40304889455848837d5800745b8b4d30ff5500488bd04883")) and
   not dll.path : ("?:\\Program Files\\*.dll", "?:\\Program Files (x86)\\*.dll",  "?:\\Windows\\assembly\\NativeImages_*.dll") and
   not process.code_signature.subject_name : ("ZOHO Corporation Private Limited", "Sophos Ltd", "Electronic Arts, Inc.", "Epic Games Inc.")

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
dll.code_signature.existseq
  • false transforms: boolean corpus 22 (elastic 22)
field:"dll.code_signature.exists" kind:eq value:"false"
dll.code_signature.trustedeq
  • false transforms: boolean corpus 21 (elastic 21)
field:"dll.code_signature.trusted" kind:eq value:"false"
dll.namewildcard
  • dnsapi.dll corpus 7 (elastic 7)
  • psapi.dll corpus 7 (elastic 7)
  • vaultcli.dll corpus 8 (elastic 8)
  • wininet.dll corpus 18 (elastic 18)
  • ws2_32.dll corpus 19 (elastic 19)
field:"dll.name" kind:wildcard
process.thread.Ext.call_stack_summarystarts_with
  • concat("ntdll.dll|", process.name) (expression)
field:"process.thread.Ext.call_stack_summary" kind:starts_with
process.thread.Ext.call_stack_summarywildcard
  • ntdll.dll|Unbacked corpus 6 (elastic 6)
field:"process.thread.Ext.call_stack_summary" kind:wildcard value:"ntdll.dll|Unbacked"

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.thread.Ext.call_stackarray_any(no value, null check)excludes:process.thread.Ext.call_stack
dll.pathwildcard?:\Program Files\*.dll, ?:\Program Files (x86)\*.dll, ?:\Windows\assembly\NativeImages_*.dllexcludes:dll.path field:"dll.path" value:"?:\Program Files\*.dll" field:"dll.path" value:"?:\Program Files (x86)\*.dll" field:"dll.path" value:"?:\Windows\assembly\NativeImages_*.dll"
process.code_signature.subject_nameeqZOHO Corporation Private Limited, Sophos Ltd, Electronic Arts, Inc., Epic Games Inc.excludes:process.code_signature.subject_name

Suspicious Mining Process Events

#
Source
github.com/elastic/protections-artifacts

Identifies attempts to disable common mining services by name, which is a common pattern adopted by some mining malware droppers to remove competitors during installation time.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
Identifies attempts to disable common mining services by name, which is a common pattern adopted by some mining malware
droppers to remove competitors during installation time.
"""
id = "fbf9342e-3d1e-4fba-a828-92fa0fb4d21b"
license = "Elastic License v2"
name = "Suspicious Mining Process Events"
os_list = ["linux"]
version = "1.0.26"

query = '''
process where event.type == "start" and event.action == "exec" and (
  (process.name == "service" and process.args == "stop") or
  (process.name == "chkconfig" and process.args == "off") or
  (process.name == "systemctl" and process.args in ("disable", "stop", "kill", "start", "reload", "restart"))
) and
process.args in ("moneroocean_miner.service", "c3pool_miner.service", "pnsd.service", "apache4.service", "pastebin.service", "xvf.service") and
not (
  process.parent.command_line in ("bash", "-bash", "sh") or
  process.parent.executable like "/usr/local/share/aliyun-assist/*/update_install" or
  process.parent.args like "/usr/local/share/aliyun-assist/*"
)
'''

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

Stage 1: process

process where event.type == "start" and event.action == "exec" and (
  (process.name == "service" and process.args == "stop") or
  (process.name == "chkconfig" and process.args == "off") or
  (process.name == "systemctl" and process.args in ("disable", "stop", "kill", "start", "reload", "restart"))
) and
process.args in ("moneroocean_miner.service", "c3pool_miner.service", "pnsd.service", "apache4.service", "pastebin.service", "xvf.service") and
not (
  process.parent.command_line in ("bash", "-bash", "sh") or
  process.parent.executable like "/usr/local/share/aliyun-assist/*/update_install" or
  process.parent.args like "/usr/local/share/aliyun-assist/*"
)

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
  • off
  • stop
field:"process.args" kind:eq
process.argsin
  • apache4.service
  • c3pool_miner.service
  • disable
  • kill
  • moneroocean_miner.service
  • pastebin.service
  • pnsd.service
  • reload
  • restart
  • start
  • stop
  • xvf.service
field:"process.args" kind:in
process.nameeq
  • chkconfig
  • service
  • systemctl
field:"process_basename" kind:eq

Exclusions

The rule actively suppresses these predicates.

Suspicious Thread Context Manipulation

#
Source
github.com/elastic/protections-artifacts

Identifies local thread context manipulation using SetThreadContext API. This may indicate an attempt to hijack process thread execution.

MITRE ATT&CK Coverage

TacticTechniques
Stealth

Rule Body

[rule]
description = """
Identifies local thread context manipulation using SetThreadContext API. This may indicate an attempt to hijack process
thread execution.
"""
id = "71f908de-8f53-4cb4-8f3a-6fa473fe9488"
license = "Elastic License v2"
name = "Suspicious Thread Context Manipulation"
os_list = ["windows"]
reference = ["https://www.elastic.co/security-labs/doubling-down-etw-callstacks"]
version = "1.0.5"

query = '''
api where
  process.Ext.api.name == "SetThreadContext" and process.Ext.api.behaviors != "cross-process" and process.executable != null and
  (
   process.thread.Ext.call_stack_summary in ("ntdll.dll|kernelbase.dll|Unbacked", "ntdll.dll|Unbacked") or
   process.Ext.api.behaviors in ("proxy_call", "native_api")
   ) and
 not process.thread.Ext.call_stack_final_user_module.name in ("Kernel", "Unknown", "Undetermined") and
 not process.thread.Ext.call_stack_final_user_module.protection_provenance in ("Kernel", "Unknown") and
 not _arraysearch(process.thread.Ext.call_stack_final_user_module.code_signature, $entry, $entry.trusted == true) and
 not (process.Ext.api.behaviors == "native_api" and
      process.executable : ("C:\\Program Files (x86)\\Adobe\\Acrobat Reader DC\\Reader\\acrocef_?\\RdrCEF.exe",
                            "C:\\Program Files (x86)\\Adobe\\Acrobat *\\Acrobat\\AcroCEF\\AcroCEF.exe",
                            "C:\\Program Files (x86)\\Adobe\\Acrobat Reader DC\\Reader\\AcroRd32.exe",
                            "C:\\Program Files (x86)\\Adobe\\Acrobat *\\Acrobat\\AcroRd32.exe",
                            "C:\\Program Files (x86)\\Adobe\\Acrobat Reader DC\\Reader\\AcroCEF\\RdrCEF.exe",
                            "C:\\Windows\\ADWS\\Microsoft.ActiveDirectory.WebServices.exe")) and
 not process.thread.Ext.call_stack_final_user_module.hash.sha256 in
                                    ("732cce11d43ca62b49f816b8742ed2269e7b9817078fc35e1b275ee75ccc3ae0",
                                     "fc5f3e6ffbe1fad672368245b3e31c1cdd75fe069f560ad3252d5ae756d91860",
                                     "24781435da6510e1996ed7cd0d58b218a5b8dd65d2afe24ff9f570fe727540c9",
                                     "dc905c5802a2d5e0d307ac6fabe117184f1b05288641ee68f051c061a2a0bd90",
                                     "c7430d4f0f46d787d3c1f21375c69d7266e9c37b709b978f8e8e488c10dec49e",
                                     "ad374dd246c4ef3262e0cfb964acaea19f133c40d8e0b7057a20a06472a88026",
                                     "64e288dd3c1a21dca1c9e43a50fe9e9dc5023f6ce3e8b919cdca1fc9b1dd6b60",
                                     "18a5f38f87e38e906f9d5f6e965cb5d16cfa570cb52b977fc1cd50df48265abe",
                                     "0d02ae1920ed421b0b65a9267c1d42bfbd9e9bc83bc28715910b00b25fdf5f93",
                                     "a52418bbb36e76beb042b2ee1201057b4740232c619fa477bd6922f69677fc18") and
 not (process.thread.Ext.call_stack_final_user_module.name == "Unbacked" and process.Ext.api.behaviors == "native_api") and
 not process.thread.Ext.call_stack_final_user_module.path like ("c:\\windows\\system32\\umppc*.dll",
                                                                "c:\\windows\\ccm\\ccmwmiproviderbase.dll",
                                                                "c:\\windows\\system32\\appxsip.dll",
                                                                "c:\\windows\\winsxs\\temp\\pendingdeletes\\$$deletemekernelbase.dll*",
                                                                "c:\\windows\\winsxs\\amd64_microsoft.*\\msvcp*.dll") and
 not process.thread.Ext.call_stack_final_hook_module.path in ("c:\\program files\\cisco\\amp\\exprev\\protector64.dll", "c:\\windows\\system32\\microsoftaccounttokenprovider.dll", "c:\\windows\\system32\\webservices.dll") and
 not (process.Ext.api.behaviors in ("native_api", "image_indirect_call") and process.thread.Ext.call_stack_final_user_module.path like ("c:\\program files (x86)\\*", "c:\\program files\\*")) and
 not (process.Ext.api.behaviors == "native_api" and process.thread.Ext.call_stack_final_user_module.protection_provenance == "Undetermined") and
 not (process.Ext.api.behaviors == "proxy_call" and process.thread.Ext.call_stack_summary == "ntdll.dll|kernelbase.dll|dbgeng.dll|kernel32.dll|ntdll.dll" and
      process.executable : "C:\\ProgramData\\Microsoft\\Windows Defender Advanced Threat Protection\\DataCollection\\*\\OpenHandleCollector.exe") and
 not process.thread.Ext.call_stack_final_user_module.protection_provenance_path like "c:\\windows\\system32\\csxumd64_*.dll"
'''

min_endpoint_version = "8.16.0"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
tree = true

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


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

[internal]
min_endpoint_version = "8.16.0"

Stages and Predicates

Stage 1: api

api where
  process.Ext.api.name == "SetThreadContext" and process.Ext.api.behaviors != "cross-process" and process.executable != null and
  (
   process.thread.Ext.call_stack_summary in ("ntdll.dll|kernelbase.dll|Unbacked", "ntdll.dll|Unbacked") or
   process.Ext.api.behaviors in ("proxy_call", "native_api")
   ) and
 not process.thread.Ext.call_stack_final_user_module.name in ("Kernel", "Unknown", "Undetermined") and
 not process.thread.Ext.call_stack_final_user_module.protection_provenance in ("Kernel", "Unknown") and
 not _arraysearch(process.thread.Ext.call_stack_final_user_module.code_signature, $entry, $entry.trusted == true) and
 not (process.Ext.api.behaviors == "native_api" and
      process.executable : ("C:\\Program Files (x86)\\Adobe\\Acrobat Reader DC\\Reader\\acrocef_?\\RdrCEF.exe",
                            "C:\\Program Files (x86)\\Adobe\\Acrobat *\\Acrobat\\AcroCEF\\AcroCEF.exe",
                            "C:\\Program Files (x86)\\Adobe\\Acrobat Reader DC\\Reader\\AcroRd32.exe",
                            "C:\\Program Files (x86)\\Adobe\\Acrobat *\\Acrobat\\AcroRd32.exe",
                            "C:\\Program Files (x86)\\Adobe\\Acrobat Reader DC\\Reader\\AcroCEF\\RdrCEF.exe",
                            "C:\\Windows\\ADWS\\Microsoft.ActiveDirectory.WebServices.exe")) and
 not process.thread.Ext.call_stack_final_user_module.hash.sha256 in
                                    ("732cce11d43ca62b49f816b8742ed2269e7b9817078fc35e1b275ee75ccc3ae0",
                                     "fc5f3e6ffbe1fad672368245b3e31c1cdd75fe069f560ad3252d5ae756d91860",
                                     "24781435da6510e1996ed7cd0d58b218a5b8dd65d2afe24ff9f570fe727540c9",
                                     "dc905c5802a2d5e0d307ac6fabe117184f1b05288641ee68f051c061a2a0bd90",
                                     "c7430d4f0f46d787d3c1f21375c69d7266e9c37b709b978f8e8e488c10dec49e",
                                     "ad374dd246c4ef3262e0cfb964acaea19f133c40d8e0b7057a20a06472a88026",
                                     "64e288dd3c1a21dca1c9e43a50fe9e9dc5023f6ce3e8b919cdca1fc9b1dd6b60",
                                     "18a5f38f87e38e906f9d5f6e965cb5d16cfa570cb52b977fc1cd50df48265abe",
                                     "0d02ae1920ed421b0b65a9267c1d42bfbd9e9bc83bc28715910b00b25fdf5f93",
                                     "a52418bbb36e76beb042b2ee1201057b4740232c619fa477bd6922f69677fc18") and
 not (process.thread.Ext.call_stack_final_user_module.name == "Unbacked" and process.Ext.api.behaviors == "native_api") and
 not process.thread.Ext.call_stack_final_user_module.path like ("c:\\windows\\system32\\umppc*.dll",
                                                                "c:\\windows\\ccm\\ccmwmiproviderbase.dll",
                                                                "c:\\windows\\system32\\appxsip.dll",
                                                                "c:\\windows\\winsxs\\temp\\pendingdeletes\\$$deletemekernelbase.dll*",
                                                                "c:\\windows\\winsxs\\amd64_microsoft.*\\msvcp*.dll") and
 not process.thread.Ext.call_stack_final_hook_module.path in ("c:\\program files\\cisco\\amp\\exprev\\protector64.dll", "c:\\windows\\system32\\microsoftaccounttokenprovider.dll", "c:\\windows\\system32\\webservices.dll") and
 not (process.Ext.api.behaviors in ("native_api", "image_indirect_call") and process.thread.Ext.call_stack_final_user_module.path like ("c:\\program files (x86)\\*", "c:\\program files\\*")) and
 not (process.Ext.api.behaviors == "native_api" and process.thread.Ext.call_stack_final_user_module.protection_provenance == "Undetermined") and
 not (process.Ext.api.behaviors == "proxy_call" and process.thread.Ext.call_stack_summary == "ntdll.dll|kernelbase.dll|dbgeng.dll|kernel32.dll|ntdll.dll" and
      process.executable : "C:\\ProgramData\\Microsoft\\Windows Defender Advanced Threat Protection\\DataCollection\\*\\OpenHandleCollector.exe") and
 not process.thread.Ext.call_stack_final_user_module.protection_provenance_path like "c:\\windows\\system32\\csxumd64_*.dll"

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.Ext.api.behaviorseqnative_apiexcludes:process.Ext.api.behaviors field:"process.Ext.api.behaviors" value:"native_api"
process.executablewildcardC:\Program Files (x86)\Adobe\Acrobat Reader DC\Reader\acrocef_?\RdrCEF.exe, C:\Program Files (x86)\Adobe\Acrobat *\Acrobat\AcroCEF\AcroCEF.exe, C:\Program Files (x86)\Adobe\Acrobat Reader DC\Reader\AcroRd32.exe, C:\Program Files (x86)\Adobe\Acrobat *\Acrobat\AcroRd32.exe, C:\Program Files (x86)\Adobe\Acrobat Reader DC\Reader\AcroCEF\RdrCEF.exe, C:\Windows\ADWS\Microsoft.ActiveDirectory.WebServices.exeexcludes:process.executable
process.thread.Ext.call_stack_final_user_module.nameeqUnbackedexcludes:process.thread.Ext.call_stack_final_user_module.name field:"process.thread.Ext.call_stack_final_user_module.name" value:"Unbacked"
process.thread.Ext.call_stack_final_user_module.protection_provenanceeqUndeterminedexcludes:process.thread.Ext.call_stack_final_user_module.protection_provenance field:"process.thread.Ext.call_stack_final_user_module.protection_provenance" value:"Undetermined"
process.Ext.api.behaviorseqproxy_callexcludes:process.Ext.api.behaviors field:"process.Ext.api.behaviors" value:"proxy_call"
process.executablewildcardC:\ProgramData\Microsoft\Windows Defender Advanced Threat Protection\DataCollection\*\OpenHandleCollector.exeexcludes:process.executable field:"process.executable" value:"C:\ProgramData\Microsoft\Windows Defender Advanced Threat Protection\DataCollection\*\OpenHandleCollector.exe"
process.thread.Ext.call_stack_summaryeqntdll.dll|kernelbase.dll|dbgeng.dll|kernel32.dll|ntdll.dllexcludes:process.thread.Ext.call_stack_summary field:"process.thread.Ext.call_stack_summary" value:"ntdll.dll|kernelbase.dll|dbgeng.dll|kernel32.dll|ntdll.dll"
process.Ext.api.behaviorsinimage_indirect_call, native_apiexcludes:process.Ext.api.behaviors field:"process.Ext.api.behaviors" value:"image_indirect_call" field:"process.Ext.api.behaviors" value:"native_api"
process.thread.Ext.call_stack_final_user_module.pathstarts_withc:\program files (x86)\, c:\program files\excludes:process.thread.Ext.call_stack_final_user_module.path field:"process.thread.Ext.call_stack_final_user_module.path" value:"c:\program files (x86)\" field:"process.thread.Ext.call_stack_final_user_module.path" value:"c:\program files\"
process.thread.Ext.call_stack_final_user_module.code_signaturearray_any(no value, null check)excludes:process.thread.Ext.call_stack_final_user_module.code_signature
process.thread.Ext.call_stack_final_hook_module.pathinc:\program files\cisco\amp\exprev\protector64.dll, c:\windows\system32\microsoftaccounttokenprovider.dll, c:\windows\system32\webservices.dllexcludes:process.thread.Ext.call_stack_final_hook_module.path field:"process.thread.Ext.call_stack_final_hook_module.path" value:"c:\program files\cisco\amp\exprev\protector64.dll" field:"process.thread.Ext.call_stack_final_hook_module.path" value:"c:\windows\system32\microsoftaccounttokenprovider.dll" field:"process.thread.Ext.call_stack_final_hook_module.path" value:"c:\windows\system32\webservices.dll"
process.thread.Ext.call_stack_final_user_module.hash.sha256in0d02ae1920ed421b0b65a9267c1d42bfbd9e9bc83bc28715910b00b25fdf5f93, 18a5f38f87e38e906f9d5f6e965cb5d16cfa570cb52b977fc1cd50df48265abe, 24781435da6510e1996ed7cd0d58b218a5b8dd65d2afe24ff9f570fe727540c9, 64e288dd3c1a21dca1c9e43a50fe9e9dc5023f6ce3e8b919cdca1fc9b1dd6b60, 732cce11d43ca62b49f816b8742ed2269e7b9817078fc35e1b275ee75ccc3ae0, a52418bbb36e76beb042b2ee1201057b4740232c619fa477bd6922f69677fc18, ad374dd246c4ef3262e0cfb964acaea19f133c40d8e0b7057a20a06472a88026, c7430d4f0f46d787d3c1f21375c69d7266e9c37b709b978f8e8e488c10dec49e, dc905c5802a2d5e0d307ac6fabe117184f1b05288641ee68f051c061a2a0bd90, fc5f3e6ffbe1fad672368245b3e31c1cdd75fe069f560ad3252d5ae756d91860excludes:process.thread.Ext.call_stack_final_user_module.hash.sha256
process.thread.Ext.call_stack_final_user_module.nameinKernel, Undetermined, Unknownexcludes:process.thread.Ext.call_stack_final_user_module.name field:"process.thread.Ext.call_stack_final_user_module.name" value:"Kernel" field:"process.thread.Ext.call_stack_final_user_module.name" value:"Undetermined" field:"process.thread.Ext.call_stack_final_user_module.name" value:"Unknown"
process.thread.Ext.call_stack_final_user_module.pathwildcardc:\windows\system32\umppc*.dll, c:\windows\ccm\ccmwmiproviderbase.dll, c:\windows\system32\appxsip.dll, c:\windows\winsxs\temp\pendingdeletes\$$deletemekernelbase.dll*, c:\windows\winsxs\amd64_microsoft.*\msvcp*.dllexcludes:process.thread.Ext.call_stack_final_user_module.path
process.thread.Ext.call_stack_final_user_module.protection_provenanceinKernel, Unknownexcludes:process.thread.Ext.call_stack_final_user_module.protection_provenance field:"process.thread.Ext.call_stack_final_user_module.protection_provenance" value:"Kernel" field:"process.thread.Ext.call_stack_final_user_module.protection_provenance" value:"Unknown"
process.thread.Ext.call_stack_final_user_module.protection_provenance_pathwildcardc:\windows\system32\csxumd64_*.dllexcludes:process.thread.Ext.call_stack_final_user_module.protection_provenance_path field:"process.thread.Ext.call_stack_final_user_module.protection_provenance_path" value:"c:\windows\system32\csxumd64_*.dll"

Suspicious Web Server Child Process

#
Source
github.com/elastic/protections-artifacts

This rule detects when a web server spawns a suspicious child process. Attackers may exploit RCE or file upload vulnerabilities to spawn suspicious child processes on web servers to gain/maintain access and to establish a command and control channel.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
This rule detects when a web server spawns a suspicious child process. Attackers may exploit RCE or file upload
vulnerabilities to spawn suspicious child processes on web servers to gain/maintain access and to establish a command
and control channel.
"""
id = "b4fff9bb-6095-4282-9084-217fced11ce7"
license = "Elastic License v2"
name = "Suspicious Web Server Child Process"
os_list = ["linux"]
version = "1.0.10"

query = '''
process where event.type == "start" and event.action == "exec" and (
  process.parent.name in (
    "nginx", "apache2", "httpd", "caddy", "mongrel_rails", "uwsgi", "daphne", "httpd.worker", "flask",
    "php-cgi", "php-fcgi", "php-cgi.cagefs", "lswsctrl", "varnishd", "uvicorn", "waitress-serve", "starman",
    "frankenphp", "asterisk", "sw-engine-fpm"
  ) or
  process.parent.name like ("php-fpm*", "gunicorn*", "*.cgi", "*.fcgi") or
  (process.parent.name like "ruby*" and process.parent.command_line like~ ("*puma*", "*rails*", "*passenger*")) or
  (process.parent.name like "python*" and process.parent.command_line like~ (
    "*hypercorn*", "*flask*", "*uvicorn*", "*django*", "*app.py*", "*server.py*", "*wsgi.py*", "*asgi.py*"
  )) or
  (process.parent.name like "perl*" and process.parent.command_line like~ "*plackup*") or
  (process.parent.name == "node" and process.parent.command_line like~ (
    "*next start*", "*--port*", "*PORT=*", "*HOST=*", "*0.0.0.0*", "*/dist/*.js*", "*/build/*.js*", "*/server/*.js*",
    "*/app/*.js*", "*/apps/*/*.js*", "*/index.js*", "*/main.js*", "*/srv/*", "*/opt/*", "*/var/www/*", "*n8n*"
    ) and
    not process.parent.args like (
      "/opt/cursor-agent/*", "/home/*/*", "/root/*", "/opt/vscode-server/*", "/usr/lib/node_modules/openclaw/dist/index.js",
      "/opt/yarn-*/bin/yarn.js"
    ) 
  ) or
  (process.parent.name == "java" and process.parent.args like~ (
    /* Tomcat */
    "org.apache.catalina.startup.Bootstrap", "-Dcatalina.base=*",

    /* Jetty */
    "org.eclipse.jetty.start.Main", "-Djetty.home=*",

    /* WildFly / JBoss */
    "org.jboss.modules.Main", "-Djboss.home.dir=*",

    /* WebLogic */
    "weblogic.Server", "-Dweblogic.Name=*", "*weblogic-launcher.jar*",

    /* WebSphere traditional + Liberty */
    "com.ibm.ws.runtime.WsServer", "com.ibm.ws.kernel.boot.cmdline.Bootstrap",

    /* GlassFish */
    "com.sun.enterprise.glassfish.bootstrap.ASMain",

    /* Resin */
    "com.caucho.server.resin.Resin",

    /* Spring Boot */
    "org.springframework.boot.loader.*",

    /* Quarkus */
    "*quarkus-run.jar*", "io.quarkus.runner.GeneratedMain",

    /* Micronaut */
    "io.micronaut.runtime.Micronaut",

    /* Dropwizard */
    "io.dropwizard.cli.ServerCommand",

    /* Play */
    "play.core.server.ProdServerStart",

    /* Helidon */
    "io.helidon.microprofile.server.Main", "io.helidon.webserver*",

    /* Vert.x */
    "io.vertx.core.Launcher",

    /* Keycloak */
    "org.keycloak*",

    /* Apereo CAS */
    "org.apereo.cas*",

    /* Elasticsearch */
    "org.elasticsearch.bootstrap.Elasticsearch",

    /* Atlassian / Gerrit */
    "com.atlassian.jira.startup.Launcher", "*BitbucketServerLauncher*", "com.google.gerrit.pgm.Daemon",

    /* Solr */
    "*-Dsolr.solr.home=*",

    /* Jenkins */
    "*jenkins.war*"
    )
  )
) and (
  (
    process.name like ("*.sh", "*.py", "*.lua", "*.pl", "*.rb", "*.bin") and
    process.executable like ("/dev/shm/*", "/tmp/*", "/var/tmp/*")
  ) or
  process.executable like ("/dev/shm/*", "/tmp/*", "/var/tmp/*", "./*") or
  process.name like (".*", "chpasswd") or
  (
    process.name in ("whoami", "id", "hostname", "uname", "ps", "netstat", "ss", "ip", "ifconfig") and
    process.interactive == true and process.parent.interactive == false
  ) or
  (
    process.name in ("nc", "ncat", "netcat", "netcat.openbsd", "netcat.traditional", "nc.openbsd", "nc.traditional") and (
      process.command_line regex ".*[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}.*" or
      process.command_line like "*http*"
    ) and
    not process.args in ("localhost", "127.0.0.1", "-z", "-zv", "-vz") 
  ) or
  (
    process.name == "socat" and
    process.command_line like~ ("*exec*", "*tty*", "*fork*", "*file*", "*open*") and
    process.command_line like~ ("*tcp*", "*udp*", "*openssl*")
  ) or
  (
    process.name == "openssl" and (
      process.command_line like ("*s_server*", "*s_client*") or
      (process.args == "enc" and process.args in ("-d", "-base64", "-a", "-A"))
    )
  ) or
  (
    process.name in ("wget", "curl") and
    (
      process.command_line regex ".*[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}(:[0-9]{1,5})?/.*" or
      process.command_line like ("*http*", "*ftp*")
    ) and
    (
      process.command_line regex~ """.*curl.* \-[a-zA-Z]*[oO]( .+|\-.*)?""" or
      process.command_line like~ ("*curl* --output*", "*curl* --remote-name*") or
      process.command_line regex~ """.*wget.* \-[a-zA-Z]*O.*""" or
      process.command_line like~ "*wget* --output-document*" or
      process.command_line like ("*|*sh*", "*|*python*", "*|*php*", "*|*perl*", "*|*ruby*", "*|*node*", "*|*lua*", "*|*busybox*") or
      process.command_line like ("*curl *>> /*", "*curl *>>/*", "*curl *> /*", "*curl *>/*", "*wget *>> /*", "*wget *>>/*", "*wget *> /*", "*wget *>/*")
    ) and
    not process.args == "/dev/null"
  ) or
  (
    process.name in ("base64", "basez", "base64plain", "base64url", "base64mime", "base64pem", "basenc", "base32", "base16") and
    process.args like~ "-*d*"
  ) or
  (
    process.name == "xxd" and process.args like~ ("-*r*", "-*p*")
  ) or
  (process.name == "sudo" and process.args == "-l") or
  (
    process.executable like ("/bin/chmod", "/usr/bin/chmod", "/usr/local/bin/chmod") and
    process.args like ("+x", "a+x", "0777", "755", "777", "0755", "700", "0700", "+s", "u+s", "g+s") and (
      process.args like ("/tmp/*", "/var/tmp/*", "/dev/shm/*", "/var/www/*", "~/*", "/home/*", "/run/*", "/var/run/*") or
      stringcontains(process.args, process.working_directory)
    )
  ) or
  (
    process.executable like ("/bin/cat", "/usr/bin/cat", "/usr/local/bin/cat") and (
      process.args like (
        "/etc/passwd", "/etc/shadow", "/etc/hostname", "/etc/hosts", "*ssh*", "/proc/self/environ",
        "*.env*", "*../../../*", "*/secrets/kubernetes.io/serviceaccount/*", "*/.docker/config.json*",
        "*/.npmrc*", "*.aws/credentials*", "*/.aws/config*"
      )
    )
  )
)
and not (
  process.parent.executable like "/tmp/*/.vscode-server/bin/*/node" or
  stringcontains(process.parent.executable, process.executable) or
  stringcontains(process.parent.args, process.executable) or
  (process.name == "echo" and process.parent.args in ("/usr/share/passenger/helper-scripts/rack-preloader.rb", "/etc/init.d/apache2")) or
  (process.parent.name == "ruby" and process.executable == "/etc/puppet/node.rb") or
  process.args like "/tmp/yarn*" or
  (process.name == "node" and process.parent.name == "ruby" and process.args like "/tmp/execjs*") or
  (process.parent.name == "httpd" and process.name == "perl" and process.args in ("/var/www/cgi-bin/metrics.cgi", "edittag.cgi", "plans.cgi")) or
  (process.parent.name == "apache2" and process.name == "perl" and process.args in ("/usr/lib/cgi-bin/LeaderBoardExtra.pl", "/usr/lib/cgi-bin/bibl/index_s.pl")) or
  (process.parent.name == "apache2" and process.name like "python*" and process.args in ("/opt/omnimesh/apache/cgi-bin/all-events-api-adaptor.cgi", "/usr/lib/cgi-bin/render/user-data.py")) or
  process.executable like ("/opt/iParapheur/common/bin/.convert.bin", "/tmp/.*/.vscode-server/bin/*/node_modules/@vscode/vsce-sign/bin/vsce-sign") or
  process.command_line in ("runc init", "ps h -eo pid,args") or
  (
    process.parent.name == "node" and 
    process.executable like ("./bin/dhcpd-pools", "/tmp/*/smoke-module/node_modules/@esbuild/linux-x64/bin/esbuild", "/tmp/.*/.cursor-server/*", "/var/tmp/buildah*")
  ) or
  (process.parent.executable == "/etc/zabbix/script/php-fpm/php-fpm-check.sh" and process.command_line like "*127.0.0.1:10061/php-fpm_status*") or 
  process.executable like (
    "/tmp/plz_sandbox/*", "/tmp/exiftool*", "/tmp/renovate/*", "/tmp/xfs*/yarn", "/tmp/newroot/usr/bin/ansible",
    "/tmp/chromedriver/*/chromedriver-linux64/chromedriver", "/tmp/temporal-sdk-typescript-*", "/tmp/newroot/var/snap/docker/common/var-lib-docker/rootfs/overlayfs/*/usr/local/bin/npm",
    "/tmp/newroot/*", "/tmp/temporal-test-server-sdk-typescript-*", "/tmp/.*/.vscode-server/cli/servers/Stable-*/server/node_modules/@vscode/vsce-sign/bin/vsce-sign",
    "/tmp/compiler-explorer-compiler*/output.s", "./Merge_DAT_files.sh", "./bin/pg_isready", "/usr/local/share/npm-global/lib/node_modules/opencode-ai/bin/.opencode",
    "/tmp/.npm-cache/_npx/*/node_modules/@esbuild/linux-x64/bin/esbuild", "/tmp/async-profiler/bin/asprof", "/tmp/snap.rootfs*", "/nix/store/*/bin/.wine",
    "/tmp/par-*/cache-exiftool-*/exiftool-*", "/tmp/vscode-komo/Stable-*/server/node_modules/@vscode/vsce-sign/bin/vsce-sign",
    "/tmp/*/node_modules/.pnpm/@esbuild*/node_modules/@esbuild/linux-x64/bin/esbuild",
    "/tmp/*/.pixi/envs/*/bin/*"
  ) or
  (
    process.parent.executable like ("/usr/local/openresty/nginx/sbin/nginx", "/u02/informatica/powercenter/*/java/bin/java") and
    process.name == "chmod" and
    process.args == "777"
  ) or
  (
    process.parent.executable like "/sashome/SASPrivateJavaRuntimeEnvironment/*/jre/bin/java" and
    process.args like (
      "/sasconfig/Lev1/Web/SASEnvironmentManager/server-*/hq-engine/hq-server/temp/pdknull/work/lib/sas-gridsgmg/*.jar",
      "/sasconfig/Lev1/Web/SASEnvironmentManager/server-*/hq-engine/hq-server/temp/pdknull/work/lib/*.jar"
    )
  ) or
  (
    process.parent.executable like ("/usr/lib/jvm/java-*-openjdk-amd64/bin/java", "/dm/sebsw/Java/jdk-*/bin/java", "/dm/sebsw/jdk*/bin/java") and
    process.args like ("http://*:48080/*/getfile/cy/out/*.gz", "https://ebookstore.*/getfile/cy/out/*.gz", "https://ebookstore.*/getfile/cy/out/*.uni")
  ) or
  (process.parent.name in ("httpd", "apache2") and process.command_line == "/bin/sh .php-fcgi-starter") or
  (process.parent.executable == "/usr/lib/jvm/default-java/bin/java" and process.command_line like "chmod 755 /tmp/tomcat8-tomcat8-tmp/sqlite-*-libsqlitejdbc.so") or
  (process.parent.executable like "/sashome/SASPrivateJavaRuntimeEnvironment/*/jre/bin/java" and process.name == "chmod" and process.args like "/sasconfig/Lev1/Web/SASEnvironmentManager/*") or
  (process.parent.executable like "/data/sashome/SASPrivateJavaRuntimeEnvironment/*/jre/bin/java" and process.args like "/data/sasconfig/Lev1/Web/SASEnvironmentManager/*/hq-engine/hq-server/temp/pdknull/work/lib/*.jar") or
  (process.parent.name == "node" and process.command_line == "sudo dpkg -l gzvaupdater") or
  (process.name == "chmod" and process.args like ("/opt/sas/config/*", "/data/sasconfig/*", "/usd/sas/soft/sas/config/*") and process.parent.name == "java") or 
  (process.parent.name == "node" and process.name == "chmod" and process.args like "/tmp/github-runner*") or
  (process.executable like "/tmp/passenger-install.*/PassengerAgent" and process.parent.name like "ruby*") or
  (process.parent.args == "/venv/bin/gunicorn" and process.executable like "./merged/var/lib/containers/storage/overlay/*/merged/*") or
  (process.parent.executable like "/usr/lib/jvm/java-*-temurin-jdk/bin/java" and process.name == "chmod" and process.args like "/data/tomcat*/webapps/GeneiousServer/*") or
  (
    process.executable == "/opt/alfresco-community/common/bin/.convert.bin" and
    process.parent.executable == "/opt/alfresco-community/java/bin/java"
  ) or
  (
    process.parent.executable like "*/.vscode-server/bin/*/node" and
    process.executable like "*/.vscode-server/bin/*/node_modules/@vscode/vsce-sign/bin/vsce-sign"
  )
)
'''

min_endpoint_version = "8.2.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/"
[[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 = "T1505"
name = "Server Software Component"
reference = "https://attack.mitre.org/techniques/T1505/"
[[threat.technique.subtechnique]]
id = "T1505.003"
name = "Web Shell"
reference = "https://attack.mitre.org/techniques/T1505/003/"



[threat.tactic]
id = "TA0003"
name = "Persistence"
reference = "https://attack.mitre.org/tactics/TA0003/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1210"
name = "Exploitation of Remote Services"
reference = "https://attack.mitre.org/techniques/T1210/"


[threat.tactic]
id = "TA0008"
name = "Lateral Movement"
reference = "https://attack.mitre.org/tactics/TA0008/"
[[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.2.0"

Stages and Predicates

Stage 1: process

process where event.type == "start" and event.action == "exec" and (
  process.parent.name in (
    "nginx", "apache2", "httpd", "caddy", "mongrel_rails", "uwsgi", "daphne", "httpd.worker", "flask",
    "php-cgi", "php-fcgi", "php-cgi.cagefs", "lswsctrl", "varnishd", "uvicorn", "waitress-serve", "starman",
    "frankenphp", "asterisk", "sw-engine-fpm"
  ) or
  process.parent.name like ("php-fpm*", "gunicorn*", "*.cgi", "*.fcgi") or
  (process.parent.name like "ruby*" and process.parent.command_line like~ ("*puma*", "*rails*", "*passenger*")) or
  (process.parent.name like "python*" and process.parent.command_line like~ (
    "*hypercorn*", "*flask*", "*uvicorn*", "*django*", "*app.py*", "*server.py*", "*wsgi.py*", "*asgi.py*"
  )) or
  (process.parent.name like "perl*" and process.parent.command_line like~ "*plackup*") or
  (process.parent.name == "node" and process.parent.command_line like~ (
    "*next start*", "*--port*", "*PORT=*", "*HOST=*", "*0.0.0.0*", "*/dist/*.js*", "*/build/*.js*", "*/server/*.js*",
    "*/app/*.js*", "*/apps/*/*.js*", "*/index.js*", "*/main.js*", "*/srv/*", "*/opt/*", "*/var/www/*", "*n8n*"
    ) and
    not process.parent.args like (
      "/opt/cursor-agent/*", "/home/*/*", "/root/*", "/opt/vscode-server/*", "/usr/lib/node_modules/openclaw/dist/index.js",
      "/opt/yarn-*/bin/yarn.js"
    )
  ) or
  (process.parent.name == "java" and process.parent.args like~ (
    "org.apache.catalina.startup.Bootstrap", "-Dcatalina.base=*",
    "org.eclipse.jetty.start.Main", "-Djetty.home=*",
    "org.jboss.modules.Main", "-Djboss.home.dir=*",
    "weblogic.Server", "-Dweblogic.Name=*", "*weblogic-launcher.jar*",
    "com.ibm.ws.runtime.WsServer", "com.ibm.ws.kernel.boot.cmdline.Bootstrap",
    "com.sun.enterprise.glassfish.bootstrap.ASMain",
    "com.caucho.server.resin.Resin",
    "org.springframework.boot.loader.*",
    "*quarkus-run.jar*", "io.quarkus.runner.GeneratedMain",
    "io.micronaut.runtime.Micronaut",
    "io.dropwizard.cli.ServerCommand",
    "play.core.server.ProdServerStart",
    "io.helidon.microprofile.server.Main", "io.helidon.webserver*",
    "io.vertx.core.Launcher",
    "org.keycloak*",
    "org.apereo.cas*",
    "org.elasticsearch.bootstrap.Elasticsearch",
    "com.atlassian.jira.startup.Launcher", "*BitbucketServerLauncher*", "com.google.gerrit.pgm.Daemon",
    "*-Dsolr.solr.home=*",
    "*jenkins.war*"
    )
  )
) and (
  (
    process.name like ("*.sh", "*.py", "*.lua", "*.pl", "*.rb", "*.bin") and
    process.executable like ("/dev/shm/*", "/tmp/*", "/var/tmp/*")
  ) or
  process.executable like ("/dev/shm/*", "/tmp/*", "/var/tmp/*", "./*") or
  process.name like (".*", "chpasswd") or
  (
    process.name in ("whoami", "id", "hostname", "uname", "ps", "netstat", "ss", "ip", "ifconfig") and
    process.interactive == true and process.parent.interactive == false
  ) or
  (
    process.name in ("nc", "ncat", "netcat", "netcat.openbsd", "netcat.traditional", "nc.openbsd", "nc.traditional") and (
      process.command_line regex ".*[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}.*" or
      process.command_line like "*http*"
    ) and
    not process.args in ("localhost", "127.0.0.1", "-z", "-zv", "-vz")
  ) or
  (
    process.name == "socat" and
    process.command_line like~ ("*exec*", "*tty*", "*fork*", "*file*", "*open*") and
    process.command_line like~ ("*tcp*", "*udp*", "*openssl*")
  ) or
  (
    process.name == "openssl" and (
      process.command_line like ("*s_server*", "*s_client*") or
      (process.args == "enc" and process.args in ("-d", "-base64", "-a", "-A"))
    )
  ) or
  (
    process.name in ("wget", "curl") and
    (
      process.command_line regex ".*[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}(:[0-9]{1,5})?/.*" or
      process.command_line like ("*http*", "*ftp*")
    ) and
    (
      process.command_line regex~ """.*curl.* \-[a-zA-Z]*[oO]( .+|\-.*)?""" or
      process.command_line like~ ("*curl* --output*", "*curl* --remote-name*") or
      process.command_line regex~ """.*wget.* \-[a-zA-Z]*O.*""" or
      process.command_line like~ "*wget* --output-document*" or
      process.command_line like ("*|*sh*", "*|*python*", "*|*php*", "*|*perl*", "*|*ruby*", "*|*node*", "*|*lua*", "*|*busybox*") or
      process.command_line like ("*curl *>> /*", "*curl *>>/*", "*curl *> /*", "*curl *>/*", "*wget *>> /*", "*wget *>>/*", "*wget *> /*", "*wget *>/*")
    ) and
    not process.args == "/dev/null"
  ) or
  (
    process.name in ("base64", "basez", "base64plain", "base64url", "base64mime", "base64pem", "basenc", "base32", "base16") and
    process.args like~ "-*d*"
  ) or
  (
    process.name == "xxd" and process.args like~ ("-*r*", "-*p*")
  ) or
  (process.name == "sudo" and process.args == "-l") or
  (
    process.executable like ("/bin/chmod", "/usr/bin/chmod", "/usr/local/bin/chmod") and
    process.args like ("+x", "a+x", "0777", "755", "777", "0755", "700", "0700", "+s", "u+s", "g+s") and (
      process.args like ("/tmp/*", "/var/tmp/*", "/dev/shm/*", "/var/www/*", "~/*", "/home/*", "/run/*", "/var/run/*") or
      stringcontains(process.args, process.working_directory)
    )
  ) or
  (
    process.executable like ("/bin/cat", "/usr/bin/cat", "/usr/local/bin/cat") and (
      process.args like (
        "/etc/passwd", "/etc/shadow", "/etc/hostname", "/etc/hosts", "*ssh*", "/proc/self/environ",
        "*.env*", "*../../../*", "*/secrets/kubernetes.io/serviceaccount/*", "*/.docker/config.json*",
        "*/.npmrc*", "*.aws/credentials*", "*/.aws/config*"
      )
    )
  )
)
and not (
  process.parent.executable like "/tmp/*/.vscode-server/bin/*/node" or
  stringcontains(process.parent.executable, process.executable) or
  stringcontains(process.parent.args, process.executable) or
  (process.name == "echo" and process.parent.args in ("/usr/share/passenger/helper-scripts/rack-preloader.rb", "/etc/init.d/apache2")) or
  (process.parent.name == "ruby" and process.executable == "/etc/puppet/node.rb") or
  process.args like "/tmp/yarn*" or
  (process.name == "node" and process.parent.name == "ruby" and process.args like "/tmp/execjs*") or
  (process.parent.name == "httpd" and process.name == "perl" and process.args in ("/var/www/cgi-bin/metrics.cgi", "edittag.cgi", "plans.cgi")) or
  (process.parent.name == "apache2" and process.name == "perl" and process.args in ("/usr/lib/cgi-bin/LeaderBoardExtra.pl", "/usr/lib/cgi-bin/bibl/index_s.pl")) or
  (process.parent.name == "apache2" and process.name like "python*" and process.args in ("/opt/omnimesh/apache/cgi-bin/all-events-api-adaptor.cgi", "/usr/lib/cgi-bin/render/user-data.py")) or
  process.executable like ("/opt/iParapheur/common/bin/.convert.bin", "/tmp/.*/.vscode-server/bin/*/node_modules/@vscode/vsce-sign/bin/vsce-sign") or
  process.command_line in ("runc init", "ps h -eo pid,args") or
  (
    process.parent.name == "node" and
    process.executable like ("./bin/dhcpd-pools", "/tmp/*/smoke-module/node_modules/@esbuild/linux-x64/bin/esbuild", "/tmp/.*/.cursor-server/*", "/var/tmp/buildah*")
  ) or
  (process.parent.executable == "/etc/zabbix/script/php-fpm/php-fpm-check.sh" and process.command_line like "*127.0.0.1:10061/php-fpm_status*") or
  process.executable like (
    "/tmp/plz_sandbox/*", "/tmp/exiftool*", "/tmp/renovate/*", "/tmp/xfs*/yarn", "/tmp/newroot/usr/bin/ansible",
    "/tmp/chromedriver/*/chromedriver-linux64/chromedriver", "/tmp/temporal-sdk-typescript-*", "/tmp/newroot/var/snap/docker/common/var-lib-docker/rootfs/overlayfs/*/usr/local/bin/npm",
    "/tmp/newroot/*", "/tmp/temporal-test-server-sdk-typescript-*", "/tmp/.*/.vscode-server/cli/servers/Stable-*/server/node_modules/@vscode/vsce-sign/bin/vsce-sign",
    "/tmp/compiler-explorer-compiler*/output.s", "./Merge_DAT_files.sh", "./bin/pg_isready", "/usr/local/share/npm-global/lib/node_modules/opencode-ai/bin/.opencode",
    "/tmp/.npm-cache/_npx/*/node_modules/@esbuild/linux-x64/bin/esbuild", "/tmp/async-profiler/bin/asprof", "/tmp/snap.rootfs*", "/nix/store/*/bin/.wine",
    "/tmp/par-*/cache-exiftool-*/exiftool-*", "/tmp/vscode-komo/Stable-*/server/node_modules/@vscode/vsce-sign/bin/vsce-sign",
    "/tmp/*/node_modules/.pnpm/@esbuild*/node_modules/@esbuild/linux-x64/bin/esbuild",
    "/tmp/*/.pixi/envs/*/bin/*"
  ) or
  (
    process.parent.executable like ("/usr/local/openresty/nginx/sbin/nginx", "/u02/informatica/powercenter/*/java/bin/java") and
    process.name == "chmod" and
    process.args == "777"
  ) or
  (
    process.parent.executable like "/sashome/SASPrivateJavaRuntimeEnvironment/*/jre/bin/java" and
    process.args like (
      "/sasconfig/Lev1/Web/SASEnvironmentManager/server-*/hq-engine/hq-server/temp/pdknull/work/lib/sas-gridsgmg/*.jar",
      "/sasconfig/Lev1/Web/SASEnvironmentManager/server-*/hq-engine/hq-server/temp/pdknull/work/lib/*.jar"
    )
  ) or
  (
    process.parent.executable like ("/usr/lib/jvm/java-*-openjdk-amd64/bin/java", "/dm/sebsw/Java/jdk-*/bin/java", "/dm/sebsw/jdk*/bin/java") and
    process.args like ("http://*:48080/*/getfile/cy/out/*.gz", "https://ebookstore.*/getfile/cy/out/*.gz", "https://ebookstore.*/getfile/cy/out/*.uni")
  ) or
  (process.parent.name in ("httpd", "apache2") and process.command_line == "/bin/sh .php-fcgi-starter") or
  (process.parent.executable == "/usr/lib/jvm/default-java/bin/java" and process.command_line like "chmod 755 /tmp/tomcat8-tomcat8-tmp/sqlite-*-libsqlitejdbc.so") or
  (process.parent.executable like "/sashome/SASPrivateJavaRuntimeEnvironment/*/jre/bin/java" and process.name == "chmod" and process.args like "/sasconfig/Lev1/Web/SASEnvironmentManager/*") or
  (process.parent.executable like "/data/sashome/SASPrivateJavaRuntimeEnvironment/*/jre/bin/java" and process.args like "/data/sasconfig/Lev1/Web/SASEnvironmentManager/*/hq-engine/hq-server/temp/pdknull/work/lib/*.jar") or
  (process.parent.name == "node" and process.command_line == "sudo dpkg -l gzvaupdater") or
  (process.name == "chmod" and process.args like ("/opt/sas/config/*", "/data/sasconfig/*", "/usd/sas/soft/sas/config/*") and process.parent.name == "java") or
  (process.parent.name == "node" and process.name == "chmod" and process.args like "/tmp/github-runner*") or
  (process.executable like "/tmp/passenger-install.*/PassengerAgent" and process.parent.name like "ruby*") or
  (process.parent.args == "/venv/bin/gunicorn" and process.executable like "./merged/var/lib/containers/storage/overlay/*/merged/*") or
  (process.parent.executable like "/usr/lib/jvm/java-*-temurin-jdk/bin/java" and process.name == "chmod" and process.args like "/data/tomcat*/webapps/GeneiousServer/*") or
  (
    process.executable == "/opt/alfresco-community/common/bin/.convert.bin" and
    process.parent.executable == "/opt/alfresco-community/java/bin/java"
  ) or
  (
    process.parent.executable like "*/.vscode-server/bin/*/node" and
    process.executable like "*/.vscode-server/bin/*/node_modules/@vscode/vsce-sign/bin/vsce-sign"
  )
)

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.argscontains
  • process.working_directory (field reference)
field:"process.args" kind:contains value:"process.working_directory"
process.argseq
  • -l
  • enc
field:"process.args" kind:eq
process.argsin
  • -A
  • -a
  • -base64
  • -d
field:"process.args" kind:in
process.argswildcard
  • *../../../*
  • *.aws/credentials*
  • *.env*
  • */.aws/config*
  • */.docker/config.json*
  • */.npmrc*
  • */secrets/kubernetes.io/serviceaccount/*
  • *ssh*
  • +s
  • +x
  • -*d*
  • -*p*
  • -*r*
  • /dev/shm/*
  • /etc/hostname
  • /etc/hosts
  • /etc/passwd
  • /etc/shadow
  • /home/*
  • /proc/self/environ
  • /run/*
  • /tmp/*
  • /var/run/*
  • /var/tmp/*
  • /var/www/*
  • 0700
  • 0755
  • 0777
  • 700
  • 755
  • 777
  • a+x
  • g+s
  • u+s
  • ~/*
field:"process.args" kind:wildcard
process.command_lineregex_match
  • .*[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}(:[0-9]{1,5})?/.*
  • .*[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.*
  • .*curl.* \-[a-zA-Z]*[oO]( .+|\-.*)?
  • .*wget.* \-[a-zA-Z]*O.*
field:"CommandLine" kind:regex_match
process.command_linewildcard
  • *curl *> /*
  • *curl *>/*
  • *curl *>> /*
  • *curl *>>/*
  • *curl* --output*
  • *curl* --remote-name*
  • *exec*
  • *file*
  • *fork*
  • *ftp*
  • *http*
  • *open*
  • *openssl*
  • *s_client*
  • *s_server*
  • *tcp*
  • *tty*
  • *udp*
  • *wget *> /*
  • *wget *>/*
  • *wget *>> /*
  • *wget *>>/*
  • *wget* --output-document*
  • *|*busybox*
  • *|*lua*
  • *|*node*
  • *|*perl*
  • *|*php*
  • *|*python*
  • *|*ruby*
  • *|*sh*
field:"CommandLine" kind:wildcard
process.executablewildcard
  • ./*
  • /bin/cat
  • /bin/chmod
  • /dev/shm/*
  • /tmp/*
  • /usr/bin/cat
  • /usr/bin/chmod
  • /usr/local/bin/cat
  • /usr/local/bin/chmod
  • /var/tmp/*
field:"Image" kind:wildcard
process.interactiveeq
  • true transforms: boolean
field:"process.interactive" kind:eq value:"true"
process.nameeq
  • openssl
  • socat
  • sudo
  • xxd
field:"process_basename" kind:eq
process.namein
  • base16
  • base32
  • base64
  • base64mime
  • base64pem
  • base64plain
  • base64url
  • basenc
  • basez
  • curl
  • hostname
  • id
  • ifconfig
  • ip
  • nc
  • nc.openbsd
  • nc.traditional
  • ncat
  • netcat
  • netcat.openbsd
  • netcat.traditional
  • netstat
  • ps
  • ss
  • uname
  • wget
  • whoami
field:"process_basename" kind:in
process.namewildcard
  • *.bin
  • *.lua
  • *.pl
  • *.py
  • *.rb
  • *.sh
  • .*
  • chpasswd
field:"process_basename" kind:wildcard
process.parent.argswildcard
  • *-Dsolr.solr.home=*
  • *BitbucketServerLauncher*
  • *jenkins.war*
  • *quarkus-run.jar*
  • *weblogic-launcher.jar*
  • -Dcatalina.base=*
  • -Djboss.home.dir=*
  • -Djetty.home=*
  • -Dweblogic.Name=*
  • com.atlassian.jira.startup.Launcher
  • com.caucho.server.resin.Resin
  • com.google.gerrit.pgm.Daemon
  • com.ibm.ws.kernel.boot.cmdline.Bootstrap
  • com.ibm.ws.runtime.WsServer
  • com.sun.enterprise.glassfish.bootstrap.ASMain
  • io.dropwizard.cli.ServerCommand
  • io.helidon.microprofile.server.Main
  • io.helidon.webserver*
  • io.micronaut.runtime.Micronaut
  • io.quarkus.runner.GeneratedMain
  • io.vertx.core.Launcher
  • org.apache.catalina.startup.Bootstrap
  • org.apereo.cas*
  • org.eclipse.jetty.start.Main
  • org.elasticsearch.bootstrap.Elasticsearch
  • org.jboss.modules.Main
  • org.keycloak*
  • org.springframework.boot.loader.*
  • play.core.server.ProdServerStart
  • weblogic.Server
field:"process.parent.args" kind:wildcard
process.parent.command_linewildcard
  • *--port*
  • */app/*.js*
  • */apps/*/*.js*
  • */build/*.js*
  • */dist/*.js*
  • */index.js*
  • */main.js*
  • */opt/*
  • */server/*.js*
  • */srv/*
  • */var/www/*
  • *0.0.0.0*
  • *HOST=*
  • *PORT=*
  • *app.py*
  • *asgi.py*
  • *django*
  • *flask*
  • *hypercorn*
  • *n8n*
  • *next start*
  • *passenger*
  • *plackup*
  • *puma*
  • *rails*
  • *server.py*
  • *uvicorn*
  • *wsgi.py*
field:"ParentCommandLine" kind:wildcard
process.parent.interactiveeq
  • false transforms: boolean
field:"process.parent.interactive" kind:eq value:"false"
process.parent.nameeq
  • java
  • node
field:"parent_process_basename" kind:eq
process.parent.namein
  • apache2
  • asterisk
  • caddy
  • daphne
  • flask
  • frankenphp
  • httpd
  • httpd.worker
  • lswsctrl
  • mongrel_rails
  • nginx
  • php-cgi
  • php-cgi.cagefs
  • php-fcgi
  • starman
  • sw-engine-fpm
  • uvicorn
  • uwsgi
  • varnishd
  • waitress-serve
field:"parent_process_basename" kind:in
process.parent.namewildcard
  • *.cgi
  • *.fcgi
  • gunicorn*
  • perl*
  • php-fpm*
  • python*
  • ruby*
field:"parent_process_basename" kind:wildcard

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.argseq777excludes:process.args field:"process.args" value:"777"
process.nameeqchmodexcludes:process.name field:"process.name" value:"chmod"
process.parent.executablewildcard/usr/local/openresty/nginx/sbin/nginx, /u02/informatica/powercenter/*/java/bin/javaexcludes:process.parent.executable field:"process.parent.executable" value:"/usr/local/openresty/nginx/sbin/nginx" field:"process.parent.executable" value:"/u02/informatica/powercenter/*/java/bin/java"
process.argsin/opt/omnimesh/apache/cgi-bin/all-events-api-adaptor.cgi, /usr/lib/cgi-bin/render/user-data.pyexcludes:process.args field:"process.args" value:"/opt/omnimesh/apache/cgi-bin/all-events-api-adaptor.cgi" field:"process.args" value:"/usr/lib/cgi-bin/render/user-data.py"
process.namestarts_withpythonexcludes:process.name field:"process.name" value:"python"
process.parent.nameeqapache2excludes:process.parent.name field:"process.parent.name" value:"apache2"
process.argsin/usr/lib/cgi-bin/LeaderBoardExtra.pl, /usr/lib/cgi-bin/bibl/index_s.plexcludes:process.args field:"process.args" value:"/usr/lib/cgi-bin/LeaderBoardExtra.pl" field:"process.args" value:"/usr/lib/cgi-bin/bibl/index_s.pl"
process.nameeqperlexcludes:process.name field:"process.name" value:"perl"
process.argsin/var/www/cgi-bin/metrics.cgi, edittag.cgi, plans.cgiexcludes:process.args field:"process.args" value:"/var/www/cgi-bin/metrics.cgi" field:"process.args" value:"edittag.cgi" field:"process.args" value:"plans.cgi"
process.parent.nameeqhttpdexcludes:process.parent.name field:"process.parent.name" value:"httpd"
process.argsstarts_with/opt/sas/config/, /data/sasconfig/, /usd/sas/soft/sas/config/excludes:process.args field:"process.args" value:"/opt/sas/config/" field:"process.args" value:"/data/sasconfig/" field:"process.args" value:"/usd/sas/soft/sas/config/"
process.parent.nameeqjavaexcludes:process.parent.name field:"process.parent.name" value:"java"
process.argsstarts_with/sasconfig/Lev1/Web/SASEnvironmentManager/excludes:process.args field:"process.args" value:"/sasconfig/Lev1/Web/SASEnvironmentManager/"
process.parent.executablewildcard/sashome/SASPrivateJavaRuntimeEnvironment/*/jre/bin/javaexcludes:process.parent.executable field:"process.parent.executable" value:"/sashome/SASPrivateJavaRuntimeEnvironment/*/jre/bin/java"
process.argsstarts_with/tmp/execjsexcludes:process.args field:"process.args" value:"/tmp/execjs"
process.nameeqnodeexcludes:process.name field:"process.name" value:"node"
process.parent.nameeqrubyexcludes:process.parent.name field:"process.parent.name" value:"ruby"
process.argsstarts_with/tmp/github-runnerexcludes:process.args field:"process.args" value:"/tmp/github-runner"
process.parent.nameeqnodeexcludes:process.parent.name field:"process.parent.name" value:"node"
process.argswildcard/data/sasconfig/Lev1/Web/SASEnvironmentManager/*/hq-engine/hq-server/temp/pdknull/work/lib/*.jarexcludes:process.args field:"process.args" value:"/data/sasconfig/Lev1/Web/SASEnvironmentManager/*/hq-engine/hq-server/temp/pdknull/work/lib/*.jar"
process.parent.executablewildcard/data/sashome/SASPrivateJavaRuntimeEnvironment/*/jre/bin/javaexcludes:process.parent.executable field:"process.parent.executable" value:"/data/sashome/SASPrivateJavaRuntimeEnvironment/*/jre/bin/java"
process.argswildcard/data/tomcat*/webapps/GeneiousServer/*excludes:process.args field:"process.args" value:"/data/tomcat*/webapps/GeneiousServer/*"
process.parent.executablewildcard/usr/lib/jvm/java-*-temurin-jdk/bin/javaexcludes:process.parent.executable field:"process.parent.executable" value:"/usr/lib/jvm/java-*-temurin-jdk/bin/java"
process.argswildcard/sasconfig/Lev1/Web/SASEnvironmentManager/server-*/hq-engine/hq-server/temp/pdknull/work/lib/sas-gridsgmg/*.jar, /sasconfig/Lev1/Web/SASEnvironmentManager/server-*/hq-engine/hq-server/temp/pdknull/work/lib/*.jarexcludes:process.args field:"process.args" value:"/sasconfig/Lev1/Web/SASEnvironmentManager/server-*/hq-engine/hq-server/temp/pdknull/work/lib/sas-gridsgmg/*.jar" field:"process.args" value:"/sasconfig/Lev1/Web/SASEnvironmentManager/server-*/hq-engine/hq-server/temp/pdknull/work/lib/*.jar"
process.argswildcardhttp://*:48080/*/getfile/cy/out/*.gz, https://ebookstore.*/getfile/cy/out/*.gz, https://ebookstore.*/getfile/cy/out/*.uniexcludes:process.args field:"process.args" value:"http://*:48080/*/getfile/cy/out/*.gz" field:"process.args" value:"https://ebookstore.*/getfile/cy/out/*.gz" field:"process.args" value:"https://ebookstore.*/getfile/cy/out/*.uni"
process.parent.executablewildcard/usr/lib/jvm/java-*-openjdk-amd64/bin/java, /dm/sebsw/Java/jdk-*/bin/java, /dm/sebsw/jdk*/bin/javaexcludes:process.parent.executable field:"process.parent.executable" value:"/usr/lib/jvm/java-*-openjdk-amd64/bin/java" field:"process.parent.executable" value:"/dm/sebsw/Java/jdk-*/bin/java" field:"process.parent.executable" value:"/dm/sebsw/jdk*/bin/java"
process.command_lineeq/bin/sh .php-fcgi-starterexcludes:process.command_line field:"process.command_line" value:"/bin/sh .php-fcgi-starter"
process.parent.nameinapache2, httpdexcludes:process.parent.name field:"process.parent.name" value:"apache2" field:"process.parent.name" value:"httpd"
process.command_lineeqsudo dpkg -l gzvaupdaterexcludes:process.command_line field:"process.command_line" value:"sudo dpkg -l gzvaupdater"
process.command_linematch127.0.0.1:10061/php-fpm_statusexcludes:process.command_line field:"process.command_line" value:"127.0.0.1:10061/php-fpm_status"
process.parent.executableeq/etc/zabbix/script/php-fpm/php-fpm-check.shexcludes:process.parent.executable field:"process.parent.executable" value:"/etc/zabbix/script/php-fpm/php-fpm-check.sh"
process.command_linewildcardchmod 755 /tmp/tomcat8-tomcat8-tmp/sqlite-*-libsqlitejdbc.soexcludes:process.command_line field:"process.command_line" value:"chmod 755 /tmp/tomcat8-tomcat8-tmp/sqlite-*-libsqlitejdbc.so"
process.parent.executableeq/usr/lib/jvm/default-java/bin/javaexcludes:process.parent.executable field:"process.parent.executable" value:"/usr/lib/jvm/default-java/bin/java"
process.executableeq/etc/puppet/node.rbexcludes:process.executable field:"process.executable" value:"/etc/puppet/node.rb"
process.executableeq/opt/alfresco-community/common/bin/.convert.binexcludes:process.executable field:"process.executable" value:"/opt/alfresco-community/common/bin/.convert.bin"
process.parent.executableeq/opt/alfresco-community/java/bin/javaexcludes:process.parent.executable field:"process.parent.executable" value:"/opt/alfresco-community/java/bin/java"
process.executablewildcard*/.vscode-server/bin/*/node_modules/@vscode/vsce-sign/bin/vsce-signexcludes:process.executable field:"process.executable" value:"*/.vscode-server/bin/*/node_modules/@vscode/vsce-sign/bin/vsce-sign"
process.parent.executablewildcard*/.vscode-server/bin/*/nodeexcludes:process.parent.executable field:"process.parent.executable" value:"*/.vscode-server/bin/*/node"
process.executablewildcard./bin/dhcpd-pools, /tmp/*/smoke-module/node_modules/@esbuild/linux-x64/bin/esbuild, /tmp/.*/.cursor-server/*, /var/tmp/buildah*excludes:process.executable
process.executablewildcard./merged/var/lib/containers/storage/overlay/*/merged/*excludes:process.executable field:"process.executable" value:"./merged/var/lib/containers/storage/overlay/*/merged/*"
process.parent.argseq/venv/bin/gunicornexcludes:process.parent.args field:"process.parent.args" value:"/venv/bin/gunicorn"
process.executablewildcard/tmp/passenger-install.*/PassengerAgentexcludes:process.executable field:"process.executable" value:"/tmp/passenger-install.*/PassengerAgent"
process.parent.namestarts_withrubyexcludes:process.parent.name field:"process.parent.name" value:"ruby"
process.nameeqechoexcludes:process.name field:"process.name" value:"echo"
process.parent.argsin/etc/init.d/apache2, /usr/share/passenger/helper-scripts/rack-preloader.rbexcludes:process.parent.args field:"process.parent.args" value:"/etc/init.d/apache2" field:"process.parent.args" value:"/usr/share/passenger/helper-scripts/rack-preloader.rb"
process.argsstarts_with/tmp/yarnexcludes:process.args field:"process.args" value:"/tmp/yarn"
process.command_lineinps h -eo pid,args, runc initexcludes:process.command_line field:"process.command_line" value:"ps h -eo pid,args" field:"process.command_line" value:"runc init"
process.executablewildcard/opt/iParapheur/common/bin/.convert.bin, /tmp/.*/.vscode-server/bin/*/node_modules/@vscode/vsce-sign/bin/vsce-signexcludes:process.executable field:"process.executable" value:"/opt/iParapheur/common/bin/.convert.bin" field:"process.executable" value:"/tmp/.*/.vscode-server/bin/*/node_modules/@vscode/vsce-sign/bin/vsce-sign"
process.executablewildcard/tmp/plz_sandbox/*, /tmp/exiftool*, /tmp/renovate/*, /tmp/xfs*/yarn, /tmp/newroot/usr/bin/ansible, /tmp/chromedriver/*/chromedriver-linux64/chromedriver, /tmp/temporal-sdk-typescript-*, /tmp/newroot/var/snap/docker/common/var-lib-docker/rootfs/overlayfs/*/usr/local/bin/npm, /tmp/newroot/*, /tmp/temporal-test-server-sdk-typescript-*, /tmp/.*/.vscode-server/cli/servers/Stable-*/server/node_modules/@vscode/vsce-sign/bin/vsce-sign, /tmp/compiler-explorer-compiler*/output.s, ./Merge_DAT_files.sh, ./bin/pg_isready, /usr/local/share/npm-global/lib/node_modules/opencode-ai/bin/.opencode, /tmp/.npm-cache/_npx/*/node_modules/@esbuild/linux-x64/bin/esbuild, /tmp/async-profiler/bin/asprof, /tmp/snap.rootfs*, /nix/store/*/bin/.wine, /tmp/par-*/cache-exiftool-*/exiftool-*, /tmp/vscode-komo/Stable-*/server/node_modules/@vscode/vsce-sign/bin/vsce-sign, /tmp/*/node_modules/.pnpm/@esbuild*/node_modules/@esbuild/linux-x64/bin/esbuild, /tmp/*/.pixi/envs/*/bin/*excludes:process.executable
process.parent.argscontainsprocess.executableexcludes:process.parent.args field:"process.parent.args" value:"process.executable"
process.parent.executablecontainsprocess.executableexcludes:process.parent.executable field:"process.parent.executable" value:"process.executable"
process.parent.executablewildcard/tmp/*/.vscode-server/bin/*/nodeexcludes:process.parent.executable field:"process.parent.executable" value:"/tmp/*/.vscode-server/bin/*/node"

Suspicious Windows Script Process Execution

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

Identifies the execution of a Windows scripting interpreter with suspicious process arguments such as unusual script engine or unusual process working directory.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
Identifies the execution of a Windows scripting interpreter with suspicious process arguments such as unusual script
engine or unusual process working directory.
"""
id = "ffbab5db-73ae-42fd-a33f-36bf649f41cc"
license = "Elastic License v2"
name = "Suspicious Windows Script Process Execution"
os_list = ["windows"]
version = "1.0.35"

query = '''
sequence by process.entity_id with maxspan=3m
[process where event.action == "start" and
 (process.name == "wscript.exe" or process.pe.original_file_name == "wscript.exe") and
 not process.Ext.token.integrity_level_name == "system" and
 process.working_directory != null and 
  (
    /* execution from a RA or ZIP file */
    process.working_directory :
          ("?:\\Users\\*\\AppData\\Local\\Temp\\Temp?_*",
           "?:\\Users\\*\\AppData\\Local\\Temp\\7z*",
           "?:\\Users\\*\\AppData\\Local\\Temp\\Rar$*",
           "?:\\Users\\*\\AppData\\Local\\Temp\\BNZ.*") or
    process.command_line :
          (
            /* JScript9 */
           "*{16d51579-a30b-4c8b-a276-0ff4dc41e755}*",

            /* JScript or VBScript Language Encoding */
           "*{F414C262-6AC0-11CF-B6D1-00AA00BBBB58}*",
           "*{B54F3743-5B07-11cf-A4B0-00AA004A55E8}*",

           /* chakra */
           "*{1b7cd997-e5ff-4932-a7a6-2a9e636da385}*",
           
           /* appdata folder */
           "*\\AppData\\Local\\Temp\\*",
           "*\\AppData\\Roaming\\*"
           ) or
    (
     process.command_line : "*\\Users\\*\\AppData\\Local\\Temp\\Temp?_*" and
     process.args_count == 2
    )
  ) and

  /* most legit executions from temp come from System32 working dir */
  not (process.command_line : ("*\\AppData\\Local\\Temp\\*", "*\\AppData\\Roaming\\*") and
       process.working_directory : "?:\\Windows\\system32\\" and not process.parent.name : "explorer.exe") and
  not process.parent.executable : ("?:\\Program Files\\Adobe\\Adobe After Effects *\\Support Files\\AfterFX.exe",
                                   "?:\\Program Files (x86)\\Microsoft Dynamics NAV\\*\\Classic\\finsql.exe",
                                   "?:\\Program Files (x86)\\Epson Software\\Download Navigator\\EPSDNRUD.EXE",
                                   "?:\\Program Files (x86)\\BizTalkHealthMonitor\\BHMCOLLECT.EXE",
                                   "?:\\Program Files (x86)\\WINDEV\\AD_Voyager\\AD_voyager.exe",
                                   "?:\\Program Files\\Windev\\AD_Voyager\\AD_voyager.exe",
                                   "?:\\Program Files (x86)\\Kovai Ltd\\BizTalk360\\Service\\BHMCollect.exe") and
  not process.working_directory : ("?:\\Windows\\system32\\spool\\DRIVERS\\*", "?:\\windows\\system32\\driverstore\\filerepository\\*") and
  not process.command_line : "*AppData\\Roaming\\Nextech\\NxTSAddin\\ContingencyUninstallNXTSForCurrentUser.vbs*" and 
  not (process.parent.args : "%TEMP%\\Spiceworks\\spiceworks_upload.vbs" and process.working_directory : "?:\\Program Files (x86)\\Spiceworks\\") and
  not (process.name : "cscript.exe" and process.args : "D:\\Production Mid Server ??\\agent\\scripts\\WMI\\WMIRunner.js") and
  not (process.name : "cscript.exe" and process.parent.name : "cmd.exe" and process.parent.args : "cscript //Nologo //T:?00 D:\\Production")
  ]
 [network where event.action == "connection_attempted"]
'''

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 = "T1059"
name = "Command and Scripting Interpreter"
reference = "https://attack.mitre.org/techniques/T1059/"
[[threat.technique.subtechnique]]
id = "T1059.005"
name = "Visual Basic"
reference = "https://attack.mitre.org/techniques/T1059/005/"

[[threat.technique.subtechnique]]
id = "T1059.007"
name = "JavaScript"
reference = "https://attack.mitre.org/techniques/T1059/007/"



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

[internal]
min_endpoint_version = "7.15.0"

Stages and Predicates

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

Stage 1: process

[process where event.action == "start" and
 (process.name == "wscript.exe" or process.pe.original_file_name == "wscript.exe") and
 not process.Ext.token.integrity_level_name == "system" and
 process.working_directory != null and
  (
    process.working_directory :
          ("?:\\Users\\*\\AppData\\Local\\Temp\\Temp?_*",
           "?:\\Users\\*\\AppData\\Local\\Temp\\7z*",
           "?:\\Users\\*\\AppData\\Local\\Temp\\Rar$*",
           "?:\\Users\\*\\AppData\\Local\\Temp\\BNZ.*") or
    process.command_line :
          (
           "*{16d51579-a30b-4c8b-a276-0ff4dc41e755}*",
           "*{F414C262-6AC0-11CF-B6D1-00AA00BBBB58}*",
           "*{B54F3743-5B07-11cf-A4B0-00AA004A55E8}*",
           "*{1b7cd997-e5ff-4932-a7a6-2a9e636da385}*",
           "*\\AppData\\Local\\Temp\\*",
           "*\\AppData\\Roaming\\*"
           ) or
    (
     process.command_line : "*\\Users\\*\\AppData\\Local\\Temp\\Temp?_*" and
     process.args_count == 2
    )
  ) and
  not (process.command_line : ("*\\AppData\\Local\\Temp\\*", "*\\AppData\\Roaming\\*") and
       process.working_directory : "?:\\Windows\\system32\\" and not process.parent.name : "explorer.exe") and
  not process.parent.executable : ("?:\\Program Files\\Adobe\\Adobe After Effects *\\Support Files\\AfterFX.exe",
                                   "?:\\Program Files (x86)\\Microsoft Dynamics NAV\\*\\Classic\\finsql.exe",
                                   "?:\\Program Files (x86)\\Epson Software\\Download Navigator\\EPSDNRUD.EXE",
                                   "?:\\Program Files (x86)\\BizTalkHealthMonitor\\BHMCOLLECT.EXE",
                                   "?:\\Program Files (x86)\\WINDEV\\AD_Voyager\\AD_voyager.exe",
                                   "?:\\Program Files\\Windev\\AD_Voyager\\AD_voyager.exe",
                                   "?:\\Program Files (x86)\\Kovai Ltd\\BizTalk360\\Service\\BHMCollect.exe") and
  not process.working_directory : ("?:\\Windows\\system32\\spool\\DRIVERS\\*", "?:\\windows\\system32\\driverstore\\filerepository\\*") and
  not process.command_line : "*AppData\\Roaming\\Nextech\\NxTSAddin\\ContingencyUninstallNXTSForCurrentUser.vbs*" and
  not (process.parent.args : "%TEMP%\\Spiceworks\\spiceworks_upload.vbs" and process.working_directory : "?:\\Program Files (x86)\\Spiceworks\\") and
  not (process.name : "cscript.exe" and process.args : "D:\\Production Mid Server ??\\agent\\scripts\\WMI\\WMIRunner.js") and
  not (process.name : "cscript.exe" and process.parent.name : "cmd.exe" and process.parent.args : "cscript //Nologo //T:?00 D:\\Production")
  ]

Stage 2: network

[network where event.action == "connection_attempted"]

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.args_counteq
  • 2 transforms: number corpus 35 (elastic 35)
field:"process.args_count" kind:eq value:"2"
process.command_linewildcard
  • *\AppData\Local\Temp\* corpus 28 (sigma 26, elastic 2)
  • *\AppData\Roaming\* corpus 17 (sigma 16, elastic 1)
  • *\Users\*\AppData\Local\Temp\Temp?_*
  • *{16d51579-a30b-4c8b-a276-0ff4dc41e755}*
  • *{1b7cd997-e5ff-4932-a7a6-2a9e636da385}*
  • *{B54F3743-5B07-11cf-A4B0-00AA004A55E8}*
  • *{F414C262-6AC0-11CF-B6D1-00AA00BBBB58}*
field:"CommandLine" kind:wildcard
process.nameeq
  • wscript.exe
field:"process_basename" kind:eq value:"wscript.exe"
process.parent.namewildcard
  • explorer.exe corpus 50 (elastic 50)
field:"parent_process_basename" kind:wildcard value:"explorer.exe"
process.pe.original_file_nameeq
  • wscript.exe corpus 2 (elastic 2)
field:"OriginalFileName" kind:eq value:"wscript.exe"
process.working_directoryis_not_null
  • (no value, null check)
field:"CurrentDirectory" kind:is_not_null
process.working_directorywildcard
  • ?:\Users\*\AppData\Local\Temp\7z* corpus 2 (elastic 2)
  • ?:\Users\*\AppData\Local\Temp\BNZ.*
  • ?:\Users\*\AppData\Local\Temp\Rar$*
  • ?:\Users\*\AppData\Local\Temp\Temp?_* corpus 2 (elastic 2)
field:"CurrentDirectory" kind:wildcard

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.parent.nameeqexplorer.exeexcludes:process.parent.name field:"process.parent.name" value:"explorer.exe"
process.command_linematch\AppData\Local\Temp\, \AppData\Roaming\excludes:process.command_line field:"process.command_line" value:"\AppData\Local\Temp\" field:"process.command_line" value:"\AppData\Roaming\"
process.working_directoryeq?:\Windows\system32\excludes:process.working_directory field:"process.working_directory" value:"?:\Windows\system32\"
process.argseqD:\Production Mid Server ??\agent\scripts\WMI\WMIRunner.jsexcludes:process.args field:"process.args" value:"D:\Production Mid Server ??\agent\scripts\WMI\WMIRunner.js"
process.nameeqcscript.exeexcludes:process.name field:"process.name" value:"cscript.exe"
process.parent.argseqcscript //Nologo //T:?00 D:\Productionexcludes:process.parent.args field:"process.parent.args" value:"cscript //Nologo //T:?00 D:\Production"
process.parent.nameeqcmd.exeexcludes:process.parent.name field:"process.parent.name" value:"cmd.exe"
process.parent.argseq%TEMP%\Spiceworks\spiceworks_upload.vbsexcludes:process.parent.args field:"process.parent.args" value:"%TEMP%\Spiceworks\spiceworks_upload.vbs"
process.working_directoryeq?:\Program Files (x86)\Spiceworks\excludes:process.working_directory field:"process.working_directory" value:"?:\Program Files (x86)\Spiceworks\"
process.Ext.token.integrity_level_nameeqsystemexcludes:process.Ext.token.integrity_level_name field:"process.Ext.token.integrity_level_name" value:"system"
process.command_linematchAppData\Roaming\Nextech\NxTSAddin\ContingencyUninstallNXTSForCurrentUser.vbsexcludes:process.command_line field:"process.command_line" value:"AppData\Roaming\Nextech\NxTSAddin\ContingencyUninstallNXTSForCurrentUser.vbs"
process.parent.executablewildcard?:\Program Files\Adobe\Adobe After Effects *\Support Files\AfterFX.exe, ?:\Program Files (x86)\Microsoft Dynamics NAV\*\Classic\finsql.exe, ?:\Program Files (x86)\Epson Software\Download Navigator\EPSDNRUD.EXE, ?:\Program Files (x86)\BizTalkHealthMonitor\BHMCOLLECT.EXE, ?:\Program Files (x86)\WINDEV\AD_Voyager\AD_voyager.exe, ?:\Program Files\Windev\AD_Voyager\AD_voyager.exe, ?:\Program Files (x86)\Kovai Ltd\BizTalk360\Service\BHMCollect.exeexcludes:process.parent.executable
process.working_directorystarts_with?:\Windows\system32\spool\DRIVERS\, ?:\windows\system32\driverstore\filerepository\excludes:process.working_directory field:"process.working_directory" value:"?:\Windows\system32\spool\DRIVERS\" field:"process.working_directory" value:"?:\windows\system32\driverstore\filerepository\"

Unusual Kill Signal

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

This rule detects the use of unusual kill signals, specifically kill signals in the range of 32-64, which are not commonly used in standard operations. Rootkits may leverage these signals to conduct certain actions, such as manipulating processes in unexpected ways, potentially escalating privileges or evading detection.

MITRE ATT&CK Coverage

TacticTechniques
Stealth

Rule Body

[metadata]
creation_date = "2025/07/16"
integration = ["auditd_manager"]
maturity = "production"
updated_date = "2025/12/18"

[rule]
author = ["Elastic"]
description = """
This rule detects the use of unusual kill signals, specifically kill signals in the range of 32-64, which
are not commonly used in standard operations. Rootkits may leverage these signals to conduct certain actions,
such as manipulating processes in unexpected ways, potentially escalating privileges or evading detection. 
"""
from = "now-9m"
index = ["auditbeat-*", "logs-auditd_manager.auditd-*"]
language = "eql"
license = "Elastic License v2"
name = "Unusual Kill Signal"
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 Unusual Kill Signal

In Linux environments, kill signals are used to manage process lifecycles. Signals in the range of 32-64 are less common and can be exploited by adversaries, such as rootkits, to manipulate processes stealthily, potentially leading to privilege escalation or evasion of security measures. The 'Unusual Kill Signal' detection rule identifies these rare signals, flagging potential misuse by monitoring specific syscall activities, thus aiding in early threat detection.

### Possible investigation steps

- Review the process details associated with the alert, focusing on the process name, PID, and parent process to understand the context of the kill signal usage.
- Examine the user account under which the process was executed to determine if it aligns with expected behavior or if it indicates potential unauthorized access.
- Investigate the command line arguments and environment variables of the process to identify any suspicious or unusual commands that may suggest malicious activity.
- Check the system logs around the time of the alert for any related events or anomalies that could provide additional context or indicate a broader attack pattern.
- Correlate the alert with other security events or alerts from the same host to identify if this is part of a larger attack or if there are other indicators of compromise.
- Assess the network activity of the host to identify any unusual outbound connections that could suggest data exfiltration or communication with a command and control server.

### False positive analysis

- Legitimate applications or services may use signals in the 32-64 range for custom inter-process communication, leading to false positives. Identify these applications and create exceptions for their specific processes.
- Some system monitoring or management tools might utilize these signals for legitimate process management tasks. Review the tools in use and whitelist their activities if they are verified as non-threatening.
- Development environments or testing frameworks might employ unusual signals for debugging or testing purposes. Ensure these environments are properly isolated and exclude their activities from triggering alerts.
- Custom scripts or automation tasks could be configured to use these signals for specific operations. Audit these scripts and, if deemed safe, add them to an exception list to prevent unnecessary alerts.

### Response and remediation

- Immediately isolate the affected system from the network to prevent potential lateral movement by the adversary.
- Terminate any suspicious processes identified with unusual kill signals in the range of 32-64 to halt any ongoing malicious activity.
- Conduct a thorough forensic analysis of the affected system to identify any rootkits or malicious software that may have been installed, focusing on the processes and files associated with the unusual kill signals.
- Restore the system from a known good backup if rootkit presence is confirmed, ensuring that the backup is free from any compromise.
- Update and patch the system to the latest security standards to close any vulnerabilities that may have been exploited.
- Implement enhanced monitoring and logging for unusual kill signals and related activities to detect any future attempts at similar attacks.
- Escalate the incident to the security operations center (SOC) or relevant cybersecurity team for further investigation and to assess the need for broader organizational response measures.
"""
references = [
    "https://github.com/m0nad/Diamorphine/blob/master/diamorphine.c#L302",
    "https://www.elastic.co/security-labs/linux-detection-engineering-with-auditd",
]
risk_score = 73
rule_id = "cf307a5a-d503-44a4-8158-db196d99c9df"
setup = """## Setup

This rule requires the use of the `auditd_manager` integration. `Auditd_manager` is a tool designed to simplify and enhance the management of the audit subsystem in Linux systems. It provides a user-friendly interface and automation capabilities for configuring and monitoring system auditing through the auditd daemon. With `auditd_manager`, administrators can easily define audit rules, track system events, and generate comprehensive audit reports, improving overall security and compliance in the system. The following steps should be executed in order to install and deploy `auditd_manager` on a Linux system.
```
Kibana -->
Management -->
Integrations -->
Auditd Manager -->
Add Auditd Manager
```
`Auditd_manager` subscribes to the kernel and receives events as they occur without any additional configuration. However, if more advanced configuration is required to detect specific behavior, audit rules can be added to the integration in either the "audit rules" configuration box or the "auditd rule files" box by specifying a file to read the audit rules from.
For this detection rule to trigger, the following additional audit rules are required to be added to the integration:
```
-a always,exit -F arch=b64 -S kill
```
Add the newly installed `auditd manager` to an agent policy, and deploy the agent on a Linux system from which auditd log files are desirable.
"""
severity = "high"
tags = [
    "Domain: Endpoint",
    "OS: Linux",
    "Use Case: Threat Detection",
    "Tactic: Defense Evasion",
    "Data Source: Auditd Manager",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
process where host.os.type == "linux" and event.action == "killed-pid" and auditd.data.syscall == "kill" and
auditd.data.a1 in (
  "21", "22", "23", "24", "25", "26", "27", "28", "29", "2a", "2b", "2c", "2d", "2e", "2f", "30",
  "31", "32", "33", "34", "35", "36", "37", "38", "39", "3a", "3b", "3c", "3d", "3e", "3f", "40",
  "41", "42", "43", "44", "45", "46", "47"
)
'''

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

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

[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.action == "killed-pid" and auditd.data.syscall == "kill" and
auditd.data.a1 in (
  "21", "22", "23", "24", "25", "26", "27", "28", "29", "2a", "2b", "2c", "2d", "2e", "2f", "30",
  "31", "32", "33", "34", "35", "36", "37", "38", "39", "3a", "3b", "3c", "3d", "3e", "3f", "40",
  "41", "42", "43", "44", "45", "46", "47"
)

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
auditd.data.a1in
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 2a
  • 2b
  • 2c
  • 2d
  • 2e
  • 2f
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 3a
  • 3b
  • 3c
  • 3d
  • 3e
  • 3f
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
field:"auditd.data.a1" kind:in
auditd.data.syscalleq
  • kill
field:"auditd.data.syscall" kind:eq value:"kill"
event.actioneq
  • killed-pid
field:"EventType" kind:eq value:"killed-pid"

Unusual Library Load via Python

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

Detects when a Python process loads an unusual library from within the user's home directory where the file is not a standard .so or .dylib file. This technique has been observed in APT campaigns by the Lazarus Group and Slow Pisces to load malicious payloads.

MITRE ATT&CK Coverage

Rule Body

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

[rule]
author = ["Elastic"]
description = """
Detects when a Python process loads an unusual library from within the user's home directory where the file 
is not a standard .so or .dylib file. This technique has been observed in APT campaigns by the Lazarus Group 
and Slow Pisces to load malicious payloads.
"""
from = "now-9m"
index = ["logs-endpoint.events.library-*"]
language = "eql"
license = "Elastic License v2"
name = "Unusual Library Load via Python"
references = [
    "https://unit42.paloaltonetworks.com/slow-pisces-new-custom-malware/",
    "https://slowmist.medium.com/cryptocurrency-apt-intelligence-unveiling-lazarus-groups-intrusion-techniques-a1a6efda7d34"
]
risk_score = 73
rule_id = "ab9a334a-f2c3-4f49-879f-480de71020d3"
severity = "high"
tags = [
    "Domain: Endpoint",
    "OS: macOS",
    "Use Case: Threat Detection",
    "Tactic: Execution",
    "Data Source: Elastic Defend",
    "Resources: Investigation Guide"
]
timestamp_override = "event.ingested"
type = "eql"
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 Unusual Library Load via Python

Python's dynamic library loading capabilities allow code to import and execute shared libraries at runtime. Sophisticated threat actors, including APT groups like Lazarus and Slow Pisces, abuse this functionality to load malicious payloads disguised as Python modules from user directories. This detection rule identifies when Python loads libraries from user home directories that don't follow standard naming conventions (.so or .dylib), indicating potential malicious module loading.

### Possible investigation steps

- Examine the dll.path field to identify the full path of the library being loaded and determine if it is in an expected location for legitimate Python packages.
- Analyze the dll.name to assess whether the file extension matches known malicious patterns or unusual naming conventions not typical for Python modules.
- Calculate the hash of the loaded library file and search threat intelligence databases for known malicious indicators associated with Lazarus or Slow Pisces campaigns.
- Review the process.executable and process.command_line to understand which Python script or application initiated the library load.
- Examine the parent process hierarchy using process.parent.executable to trace back to the initial execution vector that launched the Python process.
- Check for other files in the same directory as the loaded library that may be additional malware components or supporting payloads.
- Review file creation timestamps to determine when the suspicious library was placed on the system and correlate with other security events.

### False positive analysis

- Some Python applications dynamically extract or compile extension modules during runtime, particularly scientific computing packages. Verify if the application is known to exhibit this behavior.
- Development environments and IDEs may use unconventional library paths during testing and debugging. Confirm with development teams if such activities are expected.
- PyQt and similar UI frameworks may load additional framework files from user directories. These are partially excluded in the query but may require additional tuning.
- Pyenv and virtual environment setups may have libraries in non-standard locations. Review the paths against known virtual environment structures.

### Response and remediation

- Immediately terminate the Python process if the loaded library is confirmed or suspected to be malicious.
- Quarantine the suspicious library file for forensic analysis and malware reverse engineering.
- Scan the system for additional indicators of compromise associated with the identified threat actor campaign.
- Review the Python script or application that loaded the library and assess whether it has been modified or replaced.
- Check for persistence mechanisms that may reload the malicious library on system restart or user login.
- Search for similar library loading patterns across other systems in the environment to identify potential lateral movement.
- Reset any credentials or tokens that may have been exposed through the compromised Python process.
- Escalate to the incident response team if APT-level compromise is suspected.
"""
query = '''
library where host.os.type == "macos" and event.action == "load" and
  dll.path like "/Users/*" and
  process.name like "python*" and
  not dll.name like ("*.so", "*.dylib", "Python", "*.*_extension", "*.dylib.*") and
  not dll.path like ("*/site-packages/*/Qt*/lib/Qt*.framework/Versions/*/Qt*",
                     "/Users/*/.pyenv/versions/*/lib/python*/site-packages/*")
'''

[[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.006"
name = "Python"
reference = "https://attack.mitre.org/techniques/T1059/006/"

[[rule.threat.technique]]
id = "T1129"
name = "Shared Modules"
reference = "https://attack.mitre.org/techniques/T1129/"

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

Stages and Predicates

Stage 1: library

library where host.os.type == "macos" and event.action == "load" and
  dll.path like "/Users/*" and
  process.name like "python*" and
  not dll.name like ("*.so", "*.dylib", "Python", "*.*_extension", "*.dylib.*") and
  not dll.path like ("*/site-packages/*/Qt*/lib/Qt*.framework/Versions/*/Qt*",
                     "/Users/*/.pyenv/versions/*/lib/python*/site-packages/*")

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
dll.namewildcard*.so, *.dylib, Python, *.*_extension, *.dylib.*excludes:dll.name
dll.pathwildcard*/site-packages/*/Qt*/lib/Qt*.framework/Versions/*/Qt*, /Users/*/.pyenv/versions/*/lib/python*/site-packages/*excludes:dll.path field:"dll.path" value:"*/site-packages/*/Qt*/lib/Qt*.framework/Versions/*/Qt*" field:"dll.path" value:"/Users/*/.pyenv/versions/*/lib/python*/site-packages/*"

Unusual Scheduled Task Update

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

Identifies first-time modifications to scheduled tasks by user accounts, excluding system activity and machine accounts.

Known False Positives

  • Legitimate scheduled tasks may be created during installation of new software.

MITRE ATT&CK Coverage

Telemetry Coverage

Rule Body

[metadata]
creation_date = "2022/08/29"
integration = ["system", "windows"]
maturity = "production"
updated_date = "2026/05/04"

[rule]
author = ["Elastic"]
description = """
Identifies first-time modifications to scheduled tasks by user accounts, excluding system activity and machine accounts.
"""
false_positives = ["Legitimate scheduled tasks may be created during installation of new software."]
from = "now-9m"
index = ["logs-system.security*", "logs-windows.forwarded*", "winlogbeat-*"]
language = "kuery"
license = "Elastic License v2"
name = "Unusual Scheduled Task Update"
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 Unusual Scheduled Task Update

Scheduled tasks in Windows environments automate routine tasks, but adversaries can exploit them for persistence by modifying tasks to execute malicious code. The detection rule identifies first-time task modifications by non-system users, flagging potential unauthorized changes. By excluding known system accounts, it focuses on suspicious user activity, aiding in early threat detection.

### Possible investigation steps

- Review the event logs for event code 4702 to identify the specific scheduled task that was modified and the user account responsible for the change.
- Investigate the user account involved in the modification to determine if it is a legitimate user or potentially compromised. Check for any recent unusual activity associated with this account.
- Examine the details of the modified scheduled task, including the command or script it is set to execute, to assess if it is potentially malicious or unauthorized.
- Cross-reference the scheduled task's modification time with other security events or logs to identify any correlated suspicious activities or anomalies.
- Check the history of the scheduled task to determine if this is the first modification or if there have been previous changes that might indicate a pattern of unauthorized access.

### False positive analysis

- Scheduled task modifications by IT administrators performing routine maintenance can trigger alerts. To manage this, create exceptions for known administrator accounts that regularly update tasks.
- Software updates or installations by trusted applications may modify scheduled tasks. Identify these applications and exclude their associated user accounts or processes from the rule.
- Automated scripts or management tools that modify tasks as part of their normal operation can be mistaken for suspicious activity. Document these tools and exclude their activity from detection.
- Temporary user accounts used for specific projects or tasks might modify scheduled tasks. If these accounts are verified and trusted, consider excluding them from the rule during their active period.

### Response and remediation

- Immediately isolate the affected system from the network to prevent further unauthorized scheduled task modifications or potential lateral movement by the adversary.
- Terminate any suspicious processes associated with the modified scheduled task to halt any ongoing malicious activity.
- Review the modified scheduled task details, including the command or script being executed, and remove or disable any malicious components identified.
- Reset the credentials of the user account involved in the modification to prevent further unauthorized access, and investigate for any signs of credential compromise.
- Conduct a thorough scan of the affected system using updated antivirus or endpoint detection and response (EDR) tools to identify and remove any additional malware or persistence mechanisms.
- Escalate the incident to the security operations center (SOC) or incident response team for further investigation and to determine if the threat has spread to other systems.
- Implement additional monitoring and alerting for scheduled task modifications across the environment to enhance detection of similar threats in the future.
"""

setup = """## Setup

Audit Other Object Access Events must be enabled to generate the events used by this rule.
Setup instructions: https://ela.st/audit-other-object-access-events
"""

references = ["https://docs.microsoft.com/en-us/windows/security/threat-protection/auditing/event-4698"]
risk_score = 21
rule_id = "a02cb68e-7c93-48d1-93b2-2c39023308eb"
severity = "low"
tags = [
    "Domain: Endpoint",
    "OS: Windows",
    "Use Case: Threat Detection",
    "Tactic: Persistence",
    "Data Source: Windows Security Event Logs",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "new_terms"

query = '''
event.category: "iam" and host.os.type:"windows" and event.code: "4702" and
  not winlog.event_data.SubjectUserSid : ("S-1-5-18" or "S-1-5-19" or "S-1-5-20") and
  not user.name : *$
'''


[[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.005"
name = "Scheduled Task"
reference = "https://attack.mitre.org/techniques/T1053/005/"



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

[rule.new_terms]
field = "new_terms_fields"
value = ["winlog.event_data.TaskName"]

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

Stages and Predicates

Stage 1: new_terms

event.category: "iam" and host.os.type:"windows" and event.code: "4702" and
  not winlog.event_data.SubjectUserSid : ("S-1-5-18" or "S-1-5-19" or "S-1-5-20") and
  not user.name : *$

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.categoryeq
  • iam corpus 4 (elastic 4)
field:"event.category" kind:eq value:"iam"

Exclusions

The rule actively suppresses these predicates.

Back to all Elastic rules