Detection rules › Elastic

Elastic rules: 1i

AWS Lateral Movement from Kubernetes SA via AssumeRoleWithWebIdentity

#
Status
production
Severity
high
Time window
1d
Group by
access_key
Author
Elastic
Source
github.com/elastic/detection-rules

Detects when credentials issued through AssumeRoleWithWebIdentity for a Kubernetes service account identity are later used for several distinct AWS control-plane actions on the same session access key. Workloads that use EKS IAM Roles for Service Accounts routinely exchange a projected service-account token for short-lived IAM credentials; this rule highlights sessions where that exchange is followed by a spread of sensitive APIs—reconnaissance, secrets and parameter access, IAM changes, or compute creation—beyond what routine pod traffic usually shows. High-volume S3 object reads and writes are excluded from the correlation set to reduce noise from normal data-plane work.

Known False Positives

  • In-cluster automation may produce the same pattern: validate `Esql.user_name_values`, workload ownership, and whether `Esql.source_ip_values` / `Esql.source_asn_names` match expected egress before tuning or allowlisting.

MITRE ATT&CK Coverage

Rules Detecting the Same Action

These rules filter on the same operation.

Rule Body

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

[rule]
author = ["Elastic"]
description = """
Detects when credentials issued through `AssumeRoleWithWebIdentity` for a Kubernetes service account identity are later
used for several distinct AWS control-plane actions on the same session access key. Workloads that use EKS IAM Roles
for Service Accounts routinely exchange a projected service-account token for short-lived IAM credentials; this rule
highlights sessions where that exchange is followed by a spread of sensitive APIs—reconnaissance, secrets and parameter
access, IAM changes, or compute creation—beyond what routine pod traffic usually shows. High-volume S3 object reads and
writes are excluded from the correlation set to reduce noise from normal data-plane work.
"""
false_positives = [
    """
    In-cluster automation may produce the same pattern: validate `Esql.user_name_values`, workload ownership, and
    whether `Esql.source_ip_values` / `Esql.source_asn_names` match expected egress before tuning or allowlisting.
    """,
]
from = "now-24h"
interval = "1h"
language = "esql"
license = "Elastic License v2"
name = "AWS Lateral Movement from Kubernetes SA via AssumeRoleWithWebIdentity"
note = """## Triage and analysis

### Investigating AWS Lateral Movement from Kubernetes SA via AssumeRoleWithWebIdentity

The rule output is already aggregated per session key. Start from **`aws.cloudtrail.user_identity.access_key_id`**, then
use the bundled fields to scope time, identity, and network context before drilling into raw CloudTrail.

**What to review first**

- **`Esql.first_seen` / `Esql.last_seen`**: time window for the whole session; pull raw CloudTrail for this key between
  those timestamps and confirm ordering (assume before follow-ons).
- **`Esql.assume_count`**: should be at least 1; verify the assume row is `AssumeRoleWithWebIdentity` with a Kubernetes
  service account in **`Esql.user_name_values`** (`system:serviceaccount:*`).
- **`Esql.post_exploit_count`**, **`Esql.event_action_values`**, **`Esql.attack_phases`**: which distinct APIs fired on the
  same key; flag unexpected IAM, secrets, or `RunInstances` alongside recon.
- **`Esql.total_calls`**: volume beyond “three distinct actions”—helps separate quick probes from sustained abuse.
- **`Esql.source_ip_values`**, **`Esql.source_asn_names`**, **`Esql.user_agent_values`**: compare to known cluster egress,
  NAT, or approved automation; divergent ASNs or clients can indicate token use off-cluster.

**Next pivots**

- In CloudTrail assume events for this key: role ARN, OIDC provider, and `sub` / `aud` in `request_parameters` and
  `resources`.
- In Kubernetes: map `Esql.user_name_values` to namespace and workload; check audit logs around `Esql.first_seen` for
  `exec`, secret reads, or new RBAC.

### False positive analysis

- In-cluster operators (GitOps, scanners, backups) can still satisfy the distinct-action bar; validate workload image,
  schedule, and approved IRSA role scope.
- Sessions that barely exceed the distinct-action threshold: use **`Esql.total_calls`** and IAM impact of
  **`Esql.event_action_values`** to decide urgency.

### Response and remediation

- Revoke or constrain the IAM role session; tighten OIDC trust conditions; rotate or patch the affected workload; reduce
  service account permissions and egress where abuse is confirmed.

### Additional information

- [IAM OIDC identity provider](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_create_oidc.html)
- [EKS IAM roles for service accounts](https://docs.aws.amazon.com/eks/latest/userguide/iam-roles-for-service-accounts.html)
- [AssumeRoleWithWebIdentity](https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRoleWithWebIdentity.html)
"""
references = [
    "https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRoleWithWebIdentity.html",
    "https://docs.aws.amazon.com/eks/latest/userguide/iam-roles-for-service-accounts.html",
]
risk_score = 73
rule_id = "a1b2c3d4-e5f6-4789-a0b1-c2d3e4f5a6b7"
severity = "high"
tags = [
    "Domain: Cloud",
    "Data Source: AWS",
    "Data Source: Amazon Web Services",
    "Data Source: AWS CloudTrail",
    "Data Source: AWS IAM",
    "Data Source: AWS STS",
    "Use Case: Threat Detection",
    "Tactic: Lateral Movement",
    "Tactic: Discovery",
    "Tactic: Credential Access",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "esql"

query = '''
FROM logs-aws.cloudtrail-*
| WHERE (event.action == "AssumeRoleWithWebIdentity" AND user.name like "system:serviceaccount:*")
  // S3 PutObject/GetObject is too  common in legit pod SA behavior 
  OR (event.action IN ("ListBuckets", "DescribeInstances", "GetCallerIdentity",
    "ListUsers", "ListRoles", "ListAttachedRolePolicies", "GetRolePolicy",
    "GetSecretValue", "ListSecrets",
    "GetParameters", "DescribeParameters", "ListKeys", "Decrypt",
    "ListFunctions", "GetAuthorizationToken",
    "SendCommand", "StartSession",
    "CreateUser", "CreateAccessKey", "AttachRolePolicy", "CreateRole",
    "PutRolePolicy", "UpdateAssumeRolePolicy",
    "UpdateFunctionCode", "UpdateFunctionConfiguration", "ModifyInstanceAttribute",
    "StopLogging", "DeleteTrail")
    AND aws.cloudtrail.user_identity.type == "AssumedRole")
| GROK aws.cloudtrail.response_elements "accessKeyId=%{NOTSPACE:issued_key_id},"
| EVAL access_key = COALESCE(issued_key_id, aws.cloudtrail.user_identity.access_key_id)
| EVAL is_assume = CASE(event.action == "AssumeRoleWithWebIdentity", 1, 0)
| EVAL is_post_exploit = CASE(event.action != "AssumeRoleWithWebIdentity", 1, 0)
| EVAL phase = CASE(
    event.action == "AssumeRoleWithWebIdentity", "initial_access",
    event.action IN ("ListBuckets", "DescribeInstances", "ListUsers", "ListRoles",
      "GetCallerIdentity", "ListAttachedRolePolicies", "GetRolePolicy",
      "ListFunctions"), "recon",
    event.action IN ("GetSecretValue", "ListSecrets", "GetParameters",
      "GetAuthorizationToken", "Decrypt"), "credential_access",
    event.action IN ("SendCommand", "StartSession"), "lateral_movement",
    event.action IN ("CreateUser", "CreateAccessKey", "AttachRolePolicy",
      "CreateRole", "PutRolePolicy", "UpdateAssumeRolePolicy",
      "UpdateFunctionCode", "UpdateFunctionConfiguration",
      "ModifyInstanceAttribute"), "persistence",
    event.action IN ("StopLogging", "DeleteTrail"), "defense_evasion"
  )
| STATS 
    Esql.assume_count = SUM(is_assume),
    Esql.post_exploit_count = COUNT_DISTINCT(event.action),
    Esql.attack_phases = VALUES(phase),
    Esql.event_action_values = VALUES(event.action),
    Esql.source_ip_values = VALUES(source.ip),
    Esql.source_as_organization_name_values = VALUES(source.as.organization.name),
    Esql.user_name_values = VALUES(user.name),
    Esql.user_agent_original_values = VALUES(user_agent.original),
    Esql.cloud_account_id_values = VALUES(cloud.account.id),
    Esql.data_stream_namespace_values = VALUES(data_stream.namespace),
    Esql.first_seen = MIN(@timestamp),
    Esql.last_seen = MAX(@timestamp),
    Esql.total_calls = COUNT(*)
  BY access_key
| WHERE access_key is not null and Esql.assume_count >= 1 AND Esql.post_exploit_count >= 3
| EVAL aws.cloudtrail.user_identity.access_key_id = MV_FIRST(access_key)
| KEEP aws.cloudtrail.user_identity.access_key_id, Esql.*
'''

[rule.investigation_fields]
field_names = [
    "aws.cloudtrail.user_identity.access_key_id",
    "Esql.assume_count",
    "Esql.post_exploit_count",
    "Esql.attack_phases",
    "Esql.event_action_values",
    "Esql.source_ip_values",
    "Esql.source_as_organization_name_values",
    "Esql.user_name_values",
    "Esql.user_agent_original_values",
    "Esql.first_seen",
    "Esql.last_seen",
    "Esql.total_calls",
]

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

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

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

[[rule.threat.technique]]
id = "T1021"
name = "Remote Services"
reference = "https://attack.mitre.org/techniques/T1021/"

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

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

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

[[rule.threat.technique]]
id = "T1526"
name = "Cloud Service Discovery"
reference = "https://attack.mitre.org/techniques/T1526/"

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

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

[[rule.threat.technique]]
id = "T1555"
name = "Credentials from Password Stores"
reference = "https://attack.mitre.org/techniques/T1555/"

[[rule.threat.technique.subtechnique]]
id = "T1555.006"
name = "Cloud Secrets Management Stores"
reference = "https://attack.mitre.org/techniques/T1555/006/"

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

Stages and Predicates

Stage 1: from

FROM logs-aws.cloudtrail-*

Stage 2: where

| WHERE (event.action == "AssumeRoleWithWebIdentity" AND user.name like "system:serviceaccount:*")
  OR (event.action IN ("ListBuckets", "DescribeInstances", "GetCallerIdentity",
    "ListUsers", "ListRoles", "ListAttachedRolePolicies", "GetRolePolicy",
    "GetSecretValue", "ListSecrets",
    "GetParameters", "DescribeParameters", "ListKeys", "Decrypt",
    "ListFunctions", "GetAuthorizationToken",
    "SendCommand", "StartSession",
    "CreateUser", "CreateAccessKey", "AttachRolePolicy", "CreateRole",
    "PutRolePolicy", "UpdateAssumeRolePolicy",
    "UpdateFunctionCode", "UpdateFunctionConfiguration", "ModifyInstanceAttribute",
    "StopLogging", "DeleteTrail")
    AND aws.cloudtrail.user_identity.type == "AssumedRole")

Stage 3: grok

| GROK aws.cloudtrail.response_elements "accessKeyId=%{NOTSPACE:issued_key_id},"

Stage 4: eval

| EVAL access_key = COALESCE(issued_key_id, aws.cloudtrail.user_identity.access_key_id)

Stage 5: eval

| EVAL is_assume = CASE(event.action == "AssumeRoleWithWebIdentity", 1, 0)
is_assume =
ifevent.action == "AssumeRoleWithWebIdentity"1
else0

Stage 6: eval

| EVAL is_post_exploit = CASE(event.action != "AssumeRoleWithWebIdentity", 1, 0)
is_post_exploit =
ifevent.action != "AssumeRoleWithWebIdentity"1
else0

Stage 7: eval

| EVAL phase = CASE(
    event.action == "AssumeRoleWithWebIdentity", "initial_access",
    event.action IN ("ListBuckets", "DescribeInstances", "ListUsers", "ListRoles",
      "GetCallerIdentity", "ListAttachedRolePolicies", "GetRolePolicy",
      "ListFunctions"), "recon",
    event.action IN ("GetSecretValue", "ListSecrets", "GetParameters",
      "GetAuthorizationToken", "Decrypt"), "credential_access",
    event.action IN ("SendCommand", "StartSession"), "lateral_movement",
    event.action IN ("CreateUser", "CreateAccessKey", "AttachRolePolicy",
      "CreateRole", "PutRolePolicy", "UpdateAssumeRolePolicy",
      "UpdateFunctionCode", "UpdateFunctionConfiguration",
      "ModifyInstanceAttribute"), "persistence",
    event.action IN ("StopLogging", "DeleteTrail"), "defense_evasion"
  )
phase =
ifevent.action == "AssumeRoleWithWebIdentity""initial_access"
elifevent.action IN ("ListBuckets", "DescribeInstances", "ListUsers", "ListRoles", "GetCallerIdentity", "ListAttachedRolePolicies", "GetRolePolicy", "ListFunctions")"recon"
elifevent.action IN ("GetSecretValue", "ListSecrets", "GetParameters", "GetAuthorizationToken", "Decrypt")"credential_access"
elifevent.action IN ("SendCommand", "StartSession")"lateral_movement"
elifevent.action IN ("CreateUser", "CreateAccessKey", "AttachRolePolicy", "CreateRole", "PutRolePolicy", "UpdateAssumeRolePolicy", "UpdateFunctionCode", "UpdateFunctionConfiguration", "ModifyInstanceAttribute")"persistence"
else"defense_evasion"

Stage 8: stats

| STATS 
    Esql.assume_count = SUM(is_assume),
    Esql.post_exploit_count = COUNT_DISTINCT(event.action),
    Esql.attack_phases = VALUES(phase),
    Esql.event_action_values = VALUES(event.action),
    Esql.source_ip_values = VALUES(source.ip),
    Esql.source_as_organization_name_values = VALUES(source.as.organization.name),
    Esql.user_name_values = VALUES(user.name),
    Esql.user_agent_original_values = VALUES(user_agent.original),
    Esql.cloud_account_id_values = VALUES(cloud.account.id),
    Esql.data_stream_namespace_values = VALUES(data_stream.namespace),
    Esql.first_seen = MIN(@timestamp),
    Esql.last_seen = MAX(@timestamp),
    Esql.total_calls = COUNT(*)
  BY access_key

Stage 9: where

| WHERE access_key is not null and Esql.assume_count >= 1 AND Esql.post_exploit_count >= 3

Stage 10: eval

| EVAL aws.cloudtrail.user_identity.access_key_id = MV_FIRST(access_key)

Stage 11: keep

| KEEP aws.cloudtrail.user_identity.access_key_id, Esql.*

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
Esql.assume_countge
  • 1
field:"Esql.assume_count" kind:ge value:"1"
Esql.post_exploit_countge
  • 3
field:"Esql.post_exploit_count" kind:ge value:"3"
access_keyis_not_null
  • (no value, null check)
field:"access_key" kind:is_not_null
aws.cloudtrail.user_identity.typeeq
  • AssumedRole
field:"aws::userIdentity.type" kind:eq value:"AssumedRole"
event.actioneq
  • AssumeRoleWithWebIdentity
field:"EventType" kind:eq value:"AssumeRoleWithWebIdentity"
event.actionin
  • AttachRolePolicy
  • CreateAccessKey
  • CreateRole
  • CreateUser
  • Decrypt
  • DeleteTrail
  • DescribeInstances
  • DescribeParameters
  • GetAuthorizationToken
  • GetCallerIdentity
  • GetParameters
  • GetRolePolicy
  • GetSecretValue
  • ListAttachedRolePolicies
  • ListBuckets
  • ListFunctions
  • ListKeys
  • ListRoles
  • ListSecrets
  • ListUsers
  • ModifyInstanceAttribute
  • PutRolePolicy
  • SendCommand
  • StartSession
  • StopLogging
  • UpdateAssumeRolePolicy
  • UpdateFunctionCode
  • UpdateFunctionConfiguration
field:"EventType" kind:in
user.namewildcard
  • system:serviceaccount:*
field:"user" kind:wildcard value:"system:serviceaccount:*"

Output Fields

These fields are emitted when the rule matches.

FieldSource
aws.cloudtrail.user_identity.access_key_idKEEP aws.cloudtrail.user_identity.access_key_id
Esql.*KEEP Esql.*

Base64 Decoded Payload Piped to Interpreter

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

This rule detects when a base64 decoded payload is piped to an interpreter on Linux systems. Adversaries may use base64 encoding to obfuscate data and pipe it to an interpreter to execute malicious code. This technique may be used to evade detection by host- or network-based security controls.

MITRE ATT&CK Coverage

Rule Body

[metadata]
creation_date = "2025/02/21"
integration = ["endpoint", "crowdstrike"]
maturity = "production"
updated_date = "2026/07/02"

[rule]
author = ["Elastic"]
description = """
This rule detects when a base64 decoded payload is piped to an interpreter on Linux systems. Adversaries may use
base64 encoding to obfuscate data and pipe it to an interpreter to execute malicious code. This technique may
be used to evade detection by host- or network-based security controls.
"""
from = "now-9m"
index = ["logs-endpoint.events.process*", "logs-crowdstrike.fdr*"]
language = "eql"
license = "Elastic License v2"
name = "Base64 Decoded Payload Piped to Interpreter"
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 Base64 Decoded Payload Piped to Interpreter

Base64 encoding is a method to encode binary data into ASCII text, often used for data obfuscation. Adversaries exploit this by encoding malicious payloads and decoding them on a target system, piping the output to interpreters like bash or python for execution. The detection rule identifies such activities by monitoring for processes that decode Base64 and subsequently execute scripts, indicating potential malicious behavior.

### Possible investigation steps

- Review the process command line arguments to identify the specific Base64 decoding activity, focusing on the presence of flags like `-d` or `-a` in conjunction with tools such as `base64`, `openssl`, or scripting languages like `python`, `perl`, or `ruby`.
- Examine the parent process entity ID and command line to understand the context in which the Base64 decoding was initiated, identifying any potentially suspicious parent processes.
- Investigate the subsequent interpreter process that was executed, such as `bash`, `python`, or `ruby`, to determine the nature of the script or command being run, looking for any signs of malicious activity.
- Check the timing and sequence of the processes involved to confirm if the Base64 decoding and interpreter execution occurred within the specified maxspan of 3 seconds, indicating a likely automated or scripted action.
- Analyze the host ID and any associated user accounts to determine if the activity aligns with expected behavior for that system or user, or if it suggests unauthorized access or compromise.
- Correlate the alert with other security events or logs from the same host or user to identify any additional indicators of compromise or related suspicious activities.

### False positive analysis

- Legitimate administrative scripts may use Base64 encoding to handle data securely. Review the context of the script execution and consider excluding specific scripts or directories from monitoring if they are verified as safe.
- Automated backup or data transfer processes might use Base64 encoding for data integrity. Identify these processes and create exceptions for known, trusted applications or scripts.
- Development environments often use Base64 encoding for testing purposes. If a development tool or script is frequently triggering alerts, consider excluding the specific development environment or user accounts from this rule.
- Security tools or monitoring solutions may use Base64 encoding as part of their normal operations. Verify the source of the alert and exclude known security tools from triggering this rule.
- System updates or package installations might involve Base64 operations. Monitor the timing and context of these alerts and exclude specific update processes if they are consistently identified as false positives.

### Response and remediation

- Isolate the affected system from the network to prevent further execution of potentially malicious code and lateral movement.
- Terminate any suspicious processes identified by the detection rule, particularly those involving base64 decoding and piping to interpreters.
- Conduct a forensic analysis of the affected system to identify any additional indicators of compromise, such as unauthorized file modifications or network connections.
- Restore the system from a known good backup if malicious activity is confirmed and the integrity of the system is compromised.
- Update and patch all software and systems to mitigate vulnerabilities that could be exploited by similar techniques.
- Implement enhanced monitoring and logging for base64 decoding activities and interpreter executions to detect similar threats in the future.
- Escalate the incident to the security operations center (SOC) or incident response team for further investigation and to determine if broader organizational impacts exist.
"""
risk_score = 73
rule_id = "5bdad1d5-5001-4a13-ae99-fa8619500f1a"
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: Defense Evasion",
  "Tactic: Execution",
  "Data Source: Elastic Defend",
  "Resources: Investigation Guide",
  "Data Source: Crowdstrike",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
sequence by host.id, process.parent.entity_id with maxspan=3s
  [process where host.os.type == "linux" and event.type == "start" and event.action in ("exec", "ProcessRollup2") and (
    (process.name in ("base64", "base64plain", "base64url", "base64mime", "base64pem", "base32", "base16") and process.command_line like~ "*-*d*") or
    (process.name == "openssl" and process.args == "enc" and process.args in ("-d", "-base64", "-a")) or
    (process.name like "python*" and
    (process.args == "base64" and process.args in ("-d", "-u", "-t")) or
    (process.args == "-c" and process.args like "*base64*" and process.command_line like~ "*b64decode*")
    ) or
    (process.name like "perl*" and process.command_line like~ "*decode_base64*") or
    (process.name like "ruby*" and process.args == "-e" and process.command_line like~ "*Base64.decode64*")
  )]
 [process where host.os.type == "linux" and event.type == "start" and event.action in ("exec", "ProcessRollup2") and process.name like~ (
    "bash", "dash", "sh", "tcsh", "csh", "zsh", "ksh", "fish", "python*", "perl*", "ruby*", "lua*", "php*"
  ) and
  not (
    ?process.parent.command_line in (
      "bash ./run_tests.sh unit-integration",
      "/bin/sh /var/lib/dpkg/info/nmap-common.postinst configure",
      "bash -c base64 -d <<< Zm9yIHN2YyBpbiBxZW11LWt2bSBvdnMtdnN3aXRjaGQgbGlidmlydGQgdmlydGxvY2tkIHBhY2VtYWtlciBwY3NkOyBkbyBzeXN0ZW1jdGwgaXMtYWN0aXZlICRzdmM7IGRvbmU= | bash -l"
    ) or
    process.command_line == "/usr/bin/perl /usr/bin/shasum -a 256" or
    ?process.working_directory like (
      "/usr/local/zeek", "/opt/zeek", "/var/lib/docker/overlay2/*/opt/zeek", "/usr/local/zeek_old_install",
      "/var/lib/docker/overlay2/*/usr/local/zeek", "/proc/self/fd/*/usr/local/zeek"
    ) or
    (?process.parent.name == "zsh" and ?process.parent.command_line like "*extendedglob*") or
    (process.name like "python*" and ?process.parent.name == "python*") or
    process.args like "/tmp/apt-key-gpghome*" or
    ?process.parent.executable like ("/home/*/.aimee-code/bin/claude", "/home/*/.aimee-code/bin/opencode") or
    ?process.parent.command_line like "*/home/*/.claude/shell-snapshots/snapshot-*"
  )]
'''
[[rule.threat]]
framework = "MITRE ATT&CK"

[[rule.threat.technique]]
id = "T1027"
name = "Obfuscated Files or Information"
reference = "https://attack.mitre.org/techniques/T1027/"

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

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

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

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

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

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

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

[[rule.threat.technique]]
id = "T1204"
name = "User Execution"
reference = "https://attack.mitre.org/techniques/T1204/"

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

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

Stages and Predicates

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

Stage 1: process

[process where host.os.type == "linux" and event.type == "start" and event.action in ("exec", "ProcessRollup2") and (
    (process.name in ("base64", "base64plain", "base64url", "base64mime", "base64pem", "base32", "base16") and process.command_line like~ "*-*d*") or
    (process.name == "openssl" and process.args == "enc" and process.args in ("-d", "-base64", "-a")) or
    (process.name like "python*" and
    (process.args == "base64" and process.args in ("-d", "-u", "-t")) or
    (process.args == "-c" and process.args like "*base64*" and process.command_line like~ "*b64decode*")
    ) or
    (process.name like "perl*" and process.command_line like~ "*decode_base64*") or
    (process.name like "ruby*" and process.args == "-e" and process.command_line like~ "*Base64.decode64*")
  )]

Stage 2: process

[process where host.os.type == "linux" and event.type == "start" and event.action in ("exec", "ProcessRollup2") and process.name like~ (
    "bash", "dash", "sh", "tcsh", "csh", "zsh", "ksh", "fish", "python*", "perl*", "ruby*", "lua*", "php*"
  ) and
  not (
    ?process.parent.command_line in (
      "bash ./run_tests.sh unit-integration",
      "/bin/sh /var/lib/dpkg/info/nmap-common.postinst configure",
      "bash -c base64 -d <<< Zm9yIHN2YyBpbiBxZW11LWt2bSBvdnMtdnN3aXRjaGQgbGlidmlydGQgdmlydGxvY2tkIHBhY2VtYWtlciBwY3NkOyBkbyBzeXN0ZW1jdGwgaXMtYWN0aXZlICRzdmM7IGRvbmU= | bash -l"
    ) or
    process.command_line == "/usr/bin/perl /usr/bin/shasum -a 256" or
    ?process.working_directory like (
      "/usr/local/zeek", "/opt/zeek", "/var/lib/docker/overlay2/*/opt/zeek", "/usr/local/zeek_old_install",
      "/var/lib/docker/overlay2/*/usr/local/zeek", "/proc/self/fd/*/usr/local/zeek"
    ) or
    (?process.parent.name == "zsh" and ?process.parent.command_line like "*extendedglob*") or
    (process.name like "python*" and ?process.parent.name == "python*") or
    process.args like "/tmp/apt-key-gpghome*" or
    ?process.parent.executable like ("/home/*/.aimee-code/bin/claude", "/home/*/.aimee-code/bin/opencode") or
    ?process.parent.command_line like "*/home/*/.claude/shell-snapshots/snapshot-*"
  )]

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actionin
  • ProcessRollup2
  • exec
field:"EventType" kind:in
event.typeeq
  • start
field:"event.type" kind:eq value:"start"
process.argseq
  • -c
  • -e
  • base64
  • enc
field:"process.args" kind:eq
process.argsin
  • -a
  • -base64
  • -d
  • -t
  • -u
field:"process.args" kind:in
process.argswildcard
  • *base64*
field:"process.args" kind:wildcard value:"*base64*"
process.command_linewildcard
  • *-*d*
  • *Base64.decode64*
  • *b64decode*
  • *decode_base64*
field:"CommandLine" kind:wildcard
process.nameeq
  • openssl
field:"process_basename" kind:eq value:"openssl"
process.namein
  • base16
  • base32
  • base64
  • base64mime
  • base64pem
  • base64plain
  • base64url
field:"process_basename" kind:in
process.namewildcard
  • bash
  • csh
  • dash
  • fish
  • ksh
  • lua*
  • perl*
  • perl*
  • php*
  • python*
  • python*
  • ruby*
  • ruby*
  • sh
  • tcsh
  • zsh
field:"process_basename" kind:wildcard

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.namestarts_withpythonexcludes:process.name field:"process.name" value:"python"
process.parent.nameeqpython*excludes:process.parent.name field:"process.parent.name" value:"python*"
process.parent.command_linematchextendedglobexcludes:process.parent.command_line field:"process.parent.command_line" value:"extendedglob"
process.parent.nameeqzshexcludes:process.parent.name field:"process.parent.name" value:"zsh"
process.argsstarts_with/tmp/apt-key-gpghomeexcludes:process.args field:"process.args" value:"/tmp/apt-key-gpghome"
process.command_lineeq/usr/bin/perl /usr/bin/shasum -a 256excludes:process.command_line field:"process.command_line" value:"/usr/bin/perl /usr/bin/shasum -a 256"
process.parent.command_linein/bin/sh /var/lib/dpkg/info/nmap-common.postinst configure, bash -c base64 -d <<< Zm9yIHN2YyBpbiBxZW11LWt2bSBvdnMtdnN3aXRjaGQgbGlidmlydGQgdmlydGxvY2tkIHBhY2VtYWtlciBwY3NkOyBkbyBzeXN0ZW1jdGwgaXMtYWN0aXZlICRzdmM7IGRvbmU= | bash -l, bash ./run_tests.sh unit-integrationexcludes:process.parent.command_line field:"process.parent.command_line" value:"/bin/sh /var/lib/dpkg/info/nmap-common.postinst configure" field:"process.parent.command_line" value:"bash -c base64 -d <<< Zm9yIHN2YyBpbiBxZW11LWt2bSBvdnMtdnN3aXRjaGQgbGlidmlydGQgdmlydGxvY2tkIHBhY2VtYWtlciBwY3NkOyBkbyBzeXN0ZW1jdGwgaXMtYWN0aXZlICRzdmM7IGRvbmU= | bash -l" field:"process.parent.command_line" value:"bash ./run_tests.sh unit-integration"
process.parent.command_linewildcard*/home/*/.claude/shell-snapshots/snapshot-*excludes:process.parent.command_line field:"process.parent.command_line" value:"*/home/*/.claude/shell-snapshots/snapshot-*"
process.parent.executablewildcard/home/*/.aimee-code/bin/claude, /home/*/.aimee-code/bin/opencodeexcludes:process.parent.executable field:"process.parent.executable" value:"/home/*/.aimee-code/bin/claude" field:"process.parent.executable" value:"/home/*/.aimee-code/bin/opencode"
process.working_directorywildcard/usr/local/zeek, /opt/zeek, /var/lib/docker/overlay2/*/opt/zeek, /usr/local/zeek_old_install, /var/lib/docker/overlay2/*/usr/local/zeek, /proc/self/fd/*/usr/local/zeekexcludes:process.working_directory

First Time AWS CloudFormation Stack Creation

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

This rule detects the first time a principal calls AWS CloudFormation CreateStack, CreateStackSet or CreateStackInstances API. CloudFormation is used to create a collection of cloud resources called a stack, via a defined template file. An attacker with the appropriate privileges could leverage CloudFormation to create specific resources needed to further exploit the environment. This is a new terms rule that looks for the first instance of this behavior for a role or IAM user within a particular account.

Known False Positives

  • Verify whether the user identity should be using the triggered API. If known behavior is causing false positives, it can be exempted from the rule. The "history_window_start" value can be modified to reflect the expected frequency of known activity within a particular environment.

MITRE ATT&CK Coverage

Telemetry Coverage

Rule Body

[metadata]
creation_date = "2024/07/25"
integration = ["aws"]
maturity = "production"
updated_date = "2026/08/05"

[rule]
author = ["Elastic"]
description = """
This rule detects the first time a principal calls AWS CloudFormation CreateStack, CreateStackSet or CreateStackInstances API. CloudFormation is used to create a collection of cloud resources called a stack, via a defined template file. An attacker with the appropriate privileges could leverage CloudFormation to create specific resources needed to further exploit the environment. This is a new terms rule that looks for the first instance of this behavior for a role or IAM user within a particular account.
"""
false_positives = [
    """
    Verify whether the user identity should be using the triggered API. If known behavior is
    causing false positives, it can be exempted from the rule. The "history_window_start" value can be modified to
    reflect the expected frequency of known activity within a particular environment.
    """,
]
from = "now-6m"
index = ["filebeat-*", "logs-aws.cloudtrail-*"]
language = "kuery"
license = "Elastic License v2"
name = "First Time AWS CloudFormation Stack Creation"
references = [
    "https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-concepts.html",
    "https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_CreateStack.html",
]
risk_score = 47
rule_id = "0415258b-a7b2-48a6-891a-3367cd9d4d31"
severity = "medium"
tags = [
    "Domain: Cloud",
    "Platform: AWS",
    "Data Source: AWS CloudTrail",
    "Service: AWS CloudFormation",
    "Tactic: Execution",
    "Rule Type: New Terms",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "new_terms"

query = '''
data_stream.dataset:aws.cloudtrail and event.provider:cloudformation.amazonaws.com and
    event.action: (CreateStack or CreateStackInstances) 
    and event.outcome:success
    and not user_agent.original: (*Terraform* or *Pulumi*)
'''
note = """## Triage and analysis

### Investigating First Time AWS CloudFormation Stack Creation

AWS CloudFormation automates the setup of cloud resources using templates, streamlining infrastructure management. Adversaries with access can exploit this to deploy malicious resources, escalating their control. The detection rule identifies unusual activity by flagging the initial use of stack creation APIs by a user or role, helping to spot potential unauthorized actions early.

### Possible investigation steps

- Review `aws.cloudtrail.user_identity.arn` to identify the user or role that initiated the `CreateStack` or `CreateStackInstances` action.
- Verify the IAM permissions of the user or role involved in the event to ensure they have the appropriate level of access and determine if the action aligns with their typical responsibilities.
- Examine the stack template used to identify any unusual or unauthorized resources being provisioned.
- Investigate any related resources that were deployed as part of the stack.
- Correlate the timing of the stack creation with other logs or alerts to identify any suspicious activity or patterns that might indicate malicious intent.
- Investigate the account's recent activity history to determine if there have been any other first-time or unusual actions by the same user or role.

### False positive analysis

- Routine infrastructure updates by authorized users may trigger the rule. To manage this, maintain a list of users or roles that regularly perform these updates and create exceptions for them.
- Automated deployment tools or scripts that use CloudFormation for legitimate purposes can cause false positives. Identify these tools and exclude their associated IAM roles or users from the rule.
- New team members or roles onboarding into cloud management tasks might be flagged. Implement a process to review and whitelist these users after verifying their activities.
- Scheduled or periodic stack creations for testing or development environments can be mistaken for suspicious activity. Document these schedules and exclude the relevant users or roles from the rule.
- Third-party services or integrations that require stack creation permissions could be misidentified. Ensure these services are documented and their actions are excluded from triggering the rule.

### Response and remediation

- Immediately isolate the IAM user or role that initiated the stack creation to prevent further unauthorized actions. This can be done by revoking permissions with a [DenyAll](https://docs.aws.amazon.com/aws-managed-policy/latest/reference/AWSDenyAll.html) permissions policy or disabling the account temporarily.
- Review the created stack for any unauthorized or suspicious resources. Identify and terminate any resources that are not part of the expected infrastructure.
- Conduct a thorough audit of recent IAM activity to identify any other unusual or unauthorized actions that may indicate further compromise.
- If malicious activity is confirmed, escalate the incident to the security operations team for a full investigation and potential involvement of incident response teams.
- Implement additional monitoring and alerting for the affected account to detect any further unauthorized attempts to use CloudFormation or other critical AWS services.
- Review and tighten IAM policies and permissions to ensure that only necessary privileges are granted, reducing the risk of exploitation by adversaries."""

[rule.investigation_fields]
field_names = [
    "@timestamp",
    "user.name",
    "user_agent.original",
    "source.ip",
    "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",
    "aws.cloudtrail.request_parameters",
    "aws.cloudtrail.response_elements"
]

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

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

[[rule.threat.technique]]
id = "T1651"
name = "Cloud Administration Command"
reference = "https://attack.mitre.org/techniques/T1651/"

[rule.threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
[rule.new_terms]
field = "new_terms_fields"
value = ["cloud.account.id", "user.name"]
[[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.provider:cloudformation.amazonaws.com and
    event.action: (CreateStack or CreateStackInstances) 
    and event.outcome:success
    and not user_agent.original: (*Terraform* or *Pulumi*)

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

GKE API Server Proxying Request to Kubelet

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

Detects non-system identities using the GKE nodes/proxy API to reach a node's Kubelet through the API server. The nodes/proxy subresource allows any principal with this permission to call the Kubelet API without direct node network access or Kubelet TLS certificates. Through this path an attacker can list pod specs (including environment secrets), read Kubelet configuration, retrieve container logs, and access running pod metadata on the target node. Monitoring endpoints such as metrics, healthz, and stats/summary are excluded to reduce noise from observability tooling.

Known False Positives

  • Legitimate kubelet debugging, node troubleshooting, or security tooling that uses the node proxy outside the excluded metrics paths may match. Baseline approved operators and automation 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/13"
integration = ["gcp"]
maturity = "production"
updated_date = "2026/07/13"

[rule]
author = ["Elastic"]
description = """
Detects non-system identities using the GKE nodes/proxy API to reach a node's Kubelet through the API server. The
nodes/proxy subresource allows any principal with this permission to call the Kubelet API without direct node network
access or Kubelet TLS certificates. Through this path an attacker can list pod specs (including environment secrets),
read Kubelet configuration, retrieve container logs, and access running pod metadata on the target node. Monitoring
endpoints such as metrics, healthz, and stats/summary are excluded to reduce noise from observability tooling.
"""
false_positives = [
    """
    Legitimate kubelet debugging, node troubleshooting, or security tooling that uses the node proxy outside the
    excluded metrics paths may match. Baseline approved operators and automation identities after review.
    """,
]
from = "now-6m"
index = ["logs-gcp.audit-*"]
language = "kuery"
license = "Elastic License v2"
name = "GKE API Server Proxying Request to Kubelet"
note = """## Triage and analysis

### Investigating GKE API Server Proxying Request to Kubelet

Review `client.user.email`, `source.ip`, and `user_agent.original` to determine who initiated the proxy request.
Examine `gcp.audit.resource_name` and `event.action` to identify which Kubelet path was accessed after `/proxy/`.

### Possible investigation steps

- Check the proxied Kubelet path for attacker intent:
  - `/proxy/pods` — pod spec enumeration, including environment variable secrets
  - `/proxy/exec` or `/proxy/run` — command execution inside containers on that node
  - `/proxy/configz` — Kubelet configuration and authentication settings
  - `/proxy/runningpods` — active workload enumeration
  - `/proxy/containerLogs` — log harvesting for leaked credentials
- Identify how the principal obtained `nodes/proxy` permission by reviewing RBAC bindings.
- Correlate with TokenRequest activity from the same actor shortly before the proxy call.
- Review whether the same principal proxied multiple nodes in a short window.

### False positive analysis

- Monitoring agents that scrape paths other than the excluded metrics/health endpoints may match. Add approved paths
  or identities after baselining.
- Cluster admin tools that inspect node health via the proxy API can match during maintenance windows.

### Response and remediation

- Review and remove unauthorized RBAC granting `nodes/proxy`.
- If `/proxy/pods` was accessed, rotate secrets and credentials that may have been exposed via environment variables
  on that node.
- If `/proxy/exec` or `/proxy/run` was accessed, treat the node as compromised and isolate it.
- Restrict `nodes/proxy` to infrastructure automation only.

"""
setup = """
The GCP Fleet integration with GKE audit logs enabled is required.
"""
references = [
    "https://kubernetes.io/docs/concepts/cluster-administration/proxies/",
    "https://stratus-red-team.cloud/attack-techniques/kubernetes/k8s.privilege-escalation.nodes-proxy/",
]
risk_score = 47
rule_id = "a4fa2bf0-1cf9-4803-bed0-1f9c6e57af3c"
severity = "medium"
tags = [
    "Domain: Cloud",
    "Domain: Kubernetes",
    "Data Source: GCP",
    "Data Source: Google Cloud Platform",
    "Use Case: Threat Detection",
    "Tactic: Privilege Escalation",
    "Tactic: Lateral Movement",
    "Tactic: Discovery",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "query"

query = '''
data_stream.dataset:gcp.audit and service.name:"k8s.io" and event.outcome:success and
event.action:(
  "io.k8s.core.v1.nodes.proxy.get" or
  "io.k8s.core.v1.nodes.proxy.create"
) and
not gcp.audit.resource_name:(*metrics* or *healthz* or *stats/summary* or *elastic-agent* or *configz*) and
not client.user.email:(
  "system:kube-controller-manager" or
  "system:kube-scheduler" or
  system\:serviceaccount\:kube-system\:* or
  system\:node\:*
)
'''

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

[[rule.threat.technique]]
id = "T1611"
name = "Escape to Host"
reference = "https://attack.mitre.org/techniques/T1611/"

[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 = "T1550"
name = "Use Alternate Authentication Material"
reference = "https://attack.mitre.org/techniques/T1550/"

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

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

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

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

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

[rule.investigation_fields]
field_names = [
    "@timestamp",
    "client.user.email",
    "source.ip",
    "user_agent.original",
    "event.action",
    "event.outcome",
    "gcp.audit.resource_name",
    "data_stream.namespace",
]

Stages and Predicates

Stage 1: query

data_stream.dataset:gcp.audit and service.name:"k8s.io" and event.outcome:success and
event.action:(
  "io.k8s.core.v1.nodes.proxy.get" or
  "io.k8s.core.v1.nodes.proxy.create"
) and
not gcp.audit.resource_name:(*metrics* or *healthz* or *stats/summary* or *elastic-agent* or *configz*) and
not client.user.email:(
  "system:kube-controller-manager" or
  "system:kube-scheduler" or
  system\:serviceaccount\:kube-system\:* or
  system\:node\:*
)

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
data_stream.dataseteq
  • gcp.audit corpus 60 (elastic 60)
field:"data_stream.dataset" kind:eq value:"gcp.audit"
event.actionin
  • io.k8s.core.v1.nodes.proxy.create
  • io.k8s.core.v1.nodes.proxy.get
field:"EventType" kind:in
event.outcomeeq
  • success corpus 306 (elastic 306)
field:"event.outcome" kind:eq value:"success"
service.nameeq
  • k8s.io corpus 28 (elastic 28)
field:"ServiceName" kind:eq value:"k8s.io"

Exclusions

The rule actively suppresses these predicates.

GKE Forbidden Creation Request

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

Detects denied GKE API create requests from non-control-plane identities. Failed creates can indicate RBAC probing, stolen credentials with insufficient privileges, or attempts to deploy unauthorized workloads.

Known False Positives

  • Developers or CI jobs with incomplete RBAC can generate denied creates. Tune after validating expected identities and namespaces. GKE control-plane and bootstrap identities are excluded.

MITRE ATT&CK Coverage

TacticTechniques
ExecutionNo specific technique

Rule Body

[metadata]
creation_date = "2026/07/16"
integration = ["gcp"]
maturity = "production"
updated_date = "2026/07/16"

[rule]
author = ["Elastic"]
description = """
Detects denied GKE API create requests from non-control-plane identities. Failed creates can indicate RBAC probing,
stolen credentials with insufficient privileges, or attempts to deploy unauthorized workloads.
"""
false_positives = [
    """
    Developers or CI jobs with incomplete RBAC can generate denied creates. Tune after validating expected identities
    and namespaces. GKE control-plane and bootstrap identities are excluded.
    """,
]
from = "now-6m"
index = ["logs-gcp.audit-*"]
language = "kuery"
license = "Elastic License v2"
name = "GKE Forbidden Creation Request"
note = """## Triage and analysis

### Investigating GKE Forbidden Creation Request

Denied creates outside GKE system identities often reflect reconnaissance or misconfigured automation with stolen tokens.

### Investigation steps

- Review `client.user.email`, `event.action`, `gcp.audit.resource_name`, `source.ip`, `user_agent.original`, and `gcp.audit.status.message`.
- Determine whether the identity should exist and whether the target resource is sensitive (pods, secrets, RBAC).
- Correlate with later successful creates or RBAC changes from the same actor.

### False positives

- New deployments where RoleBindings lag the workload; exclude approved CI service accounts after review.

"""
references = [
    "https://kubernetes.io/docs/reference/access-authn-authz/rbac/",
    "https://cloud.google.com/kubernetes-engine/docs/how-to/audit-logging",
]
risk_score = 47
rule_id = "a76f049d-97fb-4058-9379-1bd985d523c2"
severity = "medium"
tags = [
    "Domain: Cloud",
    "Domain: Kubernetes",
    "Data Source: GCP",
    "Data Source: Google Cloud Platform",
    "Use Case: Threat Detection",
    "Tactic: Execution",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "query"
setup = "The GCP Fleet integration with GKE audit logs enabled is required to be compatible with this rule."

query = '''
data_stream.dataset:gcp.audit and service.name:k8s.io and event.outcome:failure and
event.action:*.create and
gcp.audit.status.message:(*forbidden* or *Unauthorized*) and
not client.user.email:(
  "system:apiserver" or system\:kube-* or "system:cloud-controller-manager" or system\:gke-* or
  system\:node\:* or system\:serviceaccount\:kube-system\:* or system\:serviceaccount\:gke-managed* or
  "kubelet-bootstrap" or "kubelet-nodepool-bootstrap" or "gcp:kube-bootstrap"
) and
not user_agent.original:(*kubernetes/$Format)
'''

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

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

[rule.investigation_fields]
field_names = [
    "@timestamp",
    "client.user.email",
    "source.ip",
    "user_agent.original",
    "event.action",
    "event.outcome",
    "gcp.audit.status.message",
    "gcp.audit.resource_name",
    "orchestrator.resource.name",
    "orchestrator.namespace",
]

Stages and Predicates

Stage 1: query

data_stream.dataset:gcp.audit and service.name:k8s.io and event.outcome:failure and
event.action:*.create and
gcp.audit.status.message:(*forbidden* or *Unauthorized*) and
not client.user.email:(
  "system:apiserver" or system\:kube-* or "system:cloud-controller-manager" or system\:gke-* or
  system\:node\:* or system\:serviceaccount\:kube-system\:* or system\:serviceaccount\:gke-managed* or
  "kubelet-bootstrap" or "kubelet-nodepool-bootstrap" or "gcp:kube-bootstrap"
) and
not user_agent.original:(*kubernetes/$Format)

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

LSA Dump via Windows Error Reporting

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

Identifies the creation of LSASS memory crash dump via an unusual parent process. Adversaries may abuse the Windows Error Reporting service to proxy LSASS dumping as a preparation for credential access.

MITRE ATT&CK Coverage

TacticTechniques
Credential Access

Rule Body

[rule]
description = """
Identifies the creation of LSASS memory crash dump via an unusual parent process. Adversaries may abuse the Windows
Error Reporting service to proxy LSASS dumping as a preparation for credential access.
"""
id = "19cd9212-034a-4835-a0a9-617299b94060"
license = "Elastic License v2"
name = "LSA Dump via Windows Error Reporting"
os_list = ["windows"]
reference = ["https://github.com/deepinstinct/Lsass-Shtinkering"]
version = "1.0.23"

query = '''
sequence by process.entity_id with maxspan=1m
 [process where event.action == "start" and process.name : ("WerFaultSecure.exe", "WerFault.exe") and
  not process.parent.executable : "?:\\Windows\\System32\\lsass.exe" and process.parent.executable != null]
 [file where event.action == "creation" and file.name : "lsass*.dmp"]
'''

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

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

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1003"
name = "OS Credential Dumping"
reference = "https://attack.mitre.org/techniques/T1003/"
[[threat.technique.subtechnique]]
id = "T1003.001"
name = "LSASS Memory"
reference = "https://attack.mitre.org/techniques/T1003/001/"



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

[internal]
min_endpoint_version = "7.15.0"

Stages and Predicates

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

Stage 1: process

[process where event.action == "start" and process.name : ("WerFaultSecure.exe", "WerFault.exe") and
  not process.parent.executable : "?:\\Windows\\System32\\lsass.exe" and process.parent.executable != null]

Stage 2: file

[file where event.action == "creation" and file.name : "lsass*.dmp"]

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • creation corpus 50 (elastic 50)
  • start corpus 388 (elastic 388)
field:"EventType" kind:eq
file.namewildcard
  • lsass*.dmp corpus 2 (elastic 2)
field:"file.name" kind:wildcard value:"lsass*.dmp"
process.namewildcard
  • WerFault.exe corpus 7 (elastic 7)
  • WerFaultSecure.exe corpus 4 (elastic 4)
field:"process_basename" kind:wildcard
process.parent.executableis_not_null
  • (no value, null check)
field:"ParentImage" kind:is_not_null

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.parent.executableeq?:\Windows\System32\lsass.exeexcludes:process.parent.executable field:"process.parent.executable" value:"?:\Windows\System32\lsass.exe"

Potential Active Directory Replication Account Backdoor

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

Identifies the modification of the nTSecurityDescriptor attribute in a domain object with rights related to DCSync to a user/computer account. Attackers can use this backdoor to re-obtain access to hashes of any user/computer.

MITRE ATT&CK Coverage

TacticTechniques
Persistence
Credential Access

Telemetry Coverage

Rule Body

[metadata]
creation_date = "2024/07/10"
integration = ["system", "windows"]
maturity = "production"
updated_date = "2026/05/04"

[rule]
author = ["Elastic"]
description = """
Identifies the modification of the nTSecurityDescriptor attribute in a domain object with rights related to DCSync to a
user/computer account. Attackers can use this backdoor to re-obtain access to hashes of any user/computer.
"""
from = "now-9m"
index = ["winlogbeat-*", "logs-system.security*", "logs-windows.forwarded*"]
language = "kuery"
license = "Elastic License v2"
name = "Potential Active Directory Replication Account Backdoor"
note = """## Triage and analysis

> **Disclaimer**:
> This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.

### Investigating Potential Active Directory Replication Account Backdoor

Active Directory (AD) is a critical component in many enterprise environments, managing user and computer accounts. Adversaries may exploit AD by modifying security descriptors to gain replication rights, allowing them to extract sensitive credential data. The detection rule identifies suspicious changes to security descriptors, specifically targeting attributes that grant replication capabilities, which could indicate an attempt to establish a backdoor for credential access.

### Possible investigation steps

- Review the event logs for the specific event code 5136 to identify the exact changes made to the nTSecurityDescriptor attribute and the account involved.
- Examine the winlog.event_data.AttributeValue to determine if the changes include the specific GUIDs (*1131f6ad-9c07-11d1-f79f-00c04fc2dcd2, *1131f6aa-9c07-11d1-f79f-00c04fc2dcd2, *89e95b76-444d-4c62-991a-0facbeda640c) that indicate replication rights were granted.
- Identify the user or computer account (S-1-5-21-*) that was granted these rights and assess whether this account should have such permissions.
- Check the account's recent activity and login history to identify any unusual or unauthorized access patterns.
- Investigate any recent changes or anomalies in the directory service that could correlate with the suspicious modification event.
- Consult with the Active Directory administrators to verify if the changes were authorized and part of any legitimate administrative tasks.

### False positive analysis

- Changes made by authorized administrators during legitimate security audits or system maintenance can trigger the rule. To manage this, create exceptions for known administrative accounts performing regular audits.
- Automated scripts or tools used for Active Directory management might modify security descriptors as part of their normal operation. Identify these scripts and exclude their associated accounts from triggering alerts.
- Scheduled tasks or system processes that require replication rights for synchronization purposes may also cause false positives. Review and whitelist these processes if they are verified as non-threatening.
- Third-party applications with legitimate replication needs might alter security descriptors. Ensure these applications are documented and their actions are excluded from the rule.
- Temporary changes during system migrations or upgrades can be mistaken for suspicious activity. Monitor these events closely and apply temporary exceptions as needed.

### Response and remediation

- Immediately isolate the affected user or computer account from the network to prevent further unauthorized access or data exfiltration.
- Revoke any unauthorized permissions or changes made to the nTSecurityDescriptor attribute for the affected account to remove replication rights.
- Conduct a thorough review of recent changes to the AD environment, focusing on accounts with elevated privileges, to identify any other unauthorized modifications.
- Reset passwords for all accounts that may have been compromised, prioritizing those with administrative or sensitive access.
- Implement additional monitoring on the affected account and related systems to detect any further suspicious activity.
- Escalate the incident to the security operations center (SOC) or incident response team for a comprehensive investigation and to determine the full scope of the breach.
- Review and update access control policies and security descriptors in Active Directory to prevent similar unauthorized changes in the future.
"""

setup = """## Setup

Audit Directory Service Changes must be enabled to generate the events used by this rule.
Setup instructions: https://ela.st/audit-directory-service-changes
"""

references = [
    "https://twitter.com/menasec1/status/1111556090137903104",
    "https://www.specterops.io/assets/resources/an_ace_up_the_sleeve.pdf",
    "https://github.com/SigmaHQ/sigma/blob/master/rules/windows/builtin/security/win_security_account_backdoor_dcsync_rights.yml",
    "https://learn.microsoft.com/en-us/windows/win32/adschema/r-ds-replication-get-changes-all",
    "https://learn.microsoft.com/en-us/windows/win32/adschema/r-ds-replication-get-changes",
    "https://learn.microsoft.com/en-us/windows/win32/adschema/r-ds-replication-get-changes-in-filtered-set",
]
risk_score = 47
rule_id = "f8822053-a5d2-46db-8c96-d460b12c36ac"
severity = "medium"
tags = [
    "Domain: Endpoint",
    "OS: Windows",
    "Use Case: Threat Detection",
    "Tactic: Credential Access",
    "Data Source: Active Directory",
    "Use Case: Active Directory Monitoring",
    "Data Source: Windows Security Event Logs",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "query"

query = '''
event.code:"5136" and host.os.type:"windows" and
  winlog.event_data.AttributeLDAPDisplayName:"nTSecurityDescriptor" and
  winlog.event_data.AttributeValue : (
    (
      *1131f6ad-9c07-11d1-f79f-00c04fc2dcd2;;S-1-5-21-* and
      *1131f6aa-9c07-11d1-f79f-00c04fc2dcd2;;S-1-5-21-* and
      *89e95b76-444d-4c62-991a-0facbeda640c;;S-1-5-21-*
    )
  )
'''


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

[[rule.threat.technique]]
id = "T1003"
name = "OS Credential Dumping"
reference = "https://attack.mitre.org/techniques/T1003/"

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

[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 = "T1098"
name = "Account Manipulation"
reference = "https://attack.mitre.org/techniques/T1098/"

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

Stages and Predicates

Stage 1: query

event.code:"5136" and host.os.type:"windows" and
  winlog.event_data.AttributeLDAPDisplayName:"nTSecurityDescriptor" and
  winlog.event_data.AttributeValue : (
    (
      *1131f6ad-9c07-11d1-f79f-00c04fc2dcd2;;S-1-5-21-* and
      *1131f6aa-9c07-11d1-f79f-00c04fc2dcd2;;S-1-5-21-* and
      *89e95b76-444d-4c62-991a-0facbeda640c;;S-1-5-21-*
    )
  )

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
winlog.event_data.AttributeLDAPDisplayNameeq
  • nTSecurityDescriptor corpus 7 (sigma 6, elastic 1)
field:"AttributeLDAPDisplayName" kind:eq value:"nTSecurityDescriptor"
winlog.event_data.AttributeValuewildcard
  • *1131f6aa-9c07-11d1-f79f-00c04fc2dcd2;;S-1-5-21-*
  • *1131f6ad-9c07-11d1-f79f-00c04fc2dcd2;;S-1-5-21-*
  • *89e95b76-444d-4c62-991a-0facbeda640c;;S-1-5-21-*
field:"AttributeValue" kind:wildcard

Potential Credential Harvesting via Python

#
Source
github.com/elastic/protections-artifacts

Identifies Python interpreters started with -c (inline code) where the command line suggests looking up credentials from a browser's password store.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
Identifies Python interpreters started with -c (inline code) where the command line suggests looking up credentials from
a browser's password store.
"""
id = "d2f85eb5-4ea2-484e-82a1-98399a532f97"
license = "Elastic License v2"
name = "Potential Credential Harvesting via Python"
os_list = ["linux", "windows"]
reference = ["https://www.wiz.io/blog/threat-actors-target-crypto-orgs"]
version = "1.0.1"

query = '''
process where event.type == "start" and event.action in ("start", "exec") and
process.name like~ ("python*", "py.exe", "py", "pypy*") and process.args == "-c" and
process.command_line like~ "*Secret.password_lookup_sync*" and
process.command_line like~ ("*microsoft-edge*", "*brave*", "*chromium*", "*chrome*", "*vivaldi*", "*opera*")
'''

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

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

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1059"
name = "Command and Scripting Interpreter"
reference = "https://attack.mitre.org/techniques/T1059/"
[[threat.technique.subtechnique]]
id = "T1059.006"
name = "Python"
reference = "https://attack.mitre.org/techniques/T1059/006/"



[threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1555"
name = "Credentials from Password Stores"
reference = "https://attack.mitre.org/techniques/T1555/"


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

[internal]
min_endpoint_version = "7.15.0"

Stages and Predicates

Stage 1: process

process where event.type == "start" and event.action in ("start", "exec") and
process.name like~ ("python*", "py.exe", "py", "pypy*") and process.args == "-c" and
process.command_line like~ "*Secret.password_lookup_sync*" and
process.command_line like~ ("*microsoft-edge*", "*brave*", "*chromium*", "*chrome*", "*vivaldi*", "*opera*")

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actionin
  • exec corpus 180 (elastic 180)
  • start corpus 157 (elastic 157)
field:"EventType" kind:in
event.typeeq
  • start corpus 1036 (elastic 1036)
field:"event.type" kind:eq value:"start"
process.argseq
  • -c corpus 91 (elastic 91)
field:"process.args" kind:eq value:"-c"
process.command_linewildcard
  • *Secret.password_lookup_sync* corpus 2 (elastic 2)
  • *brave* corpus 4 (elastic 4)
  • *chrome* corpus 4 (elastic 4)
  • *chromium* corpus 4 (elastic 4)
  • *microsoft-edge* corpus 2 (elastic 2)
  • *opera* corpus 4 (elastic 4)
  • *vivaldi* corpus 2 (elastic 2)
field:"CommandLine" kind:wildcard
process.namewildcard
  • py corpus 3 (elastic 3)
  • py.exe corpus 3 (elastic 3)
  • pypy* corpus 3 (elastic 3)
  • python* corpus 51 (elastic 51)
field:"process_basename" kind:wildcard

Potential Fake CAPTCHA Phishing Attack

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

Identifies potential fake CAPTCHA phishing attacks based on PowerShell, Cmd, or Mshta command-line values. Adversaries employ this technique via compromised websites with browser injects, posing either as fake CAPTCHAs to access the site or as a page loading error requiring a fix to display the page. The victim is instructed to copy and paste a malicious command to the Windows Run dialog box.

MITRE ATT&CK Coverage

Telemetry Coverage

Rule Body

[metadata]
creation_date = "2025/08/19"
integration = ["endpoint", "windows", "system", "sentinel_one_cloud_funnel", "m365_defender", "crowdstrike"]
maturity = "production"
updated_date = "2026/05/03"

[rule]
author = ["Elastic"]
description = """
Identifies potential fake CAPTCHA phishing attacks based on PowerShell, Cmd, or Mshta command-line values. Adversaries employ this
technique via compromised websites with browser injects, posing either as fake CAPTCHAs to access the site or as a page
loading error requiring a fix to display the page. The victim is instructed to copy and paste a malicious command to
the Windows Run dialog box.
"""
from = "now-9m"
index = [
    "logs-endpoint.events.process-*",
    "logs-crowdstrike.fdr*",
    "logs-m365_defender.event-*",
    "logs-sentinel_one_cloud_funnel.*",
    "logs-system.security*",
    "logs-windows.forwarded*",
    "logs-windows.sysmon_operational-*",
    "winlogbeat-*",
]
language = "eql"
license = "Elastic License v2"
name = "Potential Fake CAPTCHA Phishing Attack"
risk_score = 73
rule_id = "fbad57ec-4442-48db-a34f-5ee907b44a22"
severity = "high"
tags = [
    "Domain: Endpoint",
    "OS: Windows",
    "Use Case: Threat Detection",
    "Tactic: Execution",
    "Data Source: Windows Security Event Logs",
    "Data Source: Elastic Defend",
    "Data Source: Sysmon",
    "Data Source: SentinelOne",
    "Data Source: Microsoft Defender XDR",
    "Data Source: Crowdstrike",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"

query = '''
process where host.os.type == "windows" and event.type == "start" and
 process.name : ("powershell.exe", "cmd.exe", "mshta.exe") and process.parent.name : "explorer.exe" and
 process.command_line : ("*recaptcha *", "*CAPTCHA Verif*", "*complete verification*", "*Verification ID*", "*Verification Code*", "*Verification UID*",
                         "*hυmаn vаlіdаtiοn*", "*human ID*", "*Action Identificator*", "*not a robot*", "*Click OK to*", "*anti-robot test*",
                         "*Cloudflare ID*")
'''

note = """## Triage and analysis

### Investigating Potential Fake CAPTCHA Phishing Attack
#### Possible investigation steps

- What does the pasted command do after the CAPTCHA or verification text?
  - Why: lure text is the wrapper; payload behavior separates clickfix execution from testing or inert copy text.
  - Focus: `process.name`, `process.command_line`, `process.parent.name`, and `process.parent.command_line` for URLs, encoded content, inline script, archive handling, or handoff to "mshta.exe", "cmd.exe", or "powershell.exe".
  - Hint: fake-update or page-fix wording is the same abuse path when the command downloads, decodes, or hands execution to another utility.
  - Implication: escalate when the command downloads content, rebuilds a payload, invokes another script host, or hides work after CAPTCHA wording; lower suspicion only for a bounded authorized simulation or lab command with no second-stage behavior.

- Is the shell or proxy binary and launch context consistent with paste-and-run clickfix?
  - Focus: `process.executable`, `process.parent.executable`, `process.parent.command_line`, and `user.id`.
  - Implication: escalate faster when the binary is renamed, user-writable, or launched from an unusual parent context for the user; a native shell path confirms identity but does not clear suspicious command content.

- Do children from the alerting instance show payload execution or follow-on tooling?
  - Focus: child starts where `process.parent.entity_id` maps to `process.entity_id`, reviewing child `process.executable` and `process.command_line`. $investigate_2
  - Hint: if `process.entity_id` is absent, recover children with `host.id` + `process.pid` in a tight alert-time window and treat the match as weaker.
  - Implication: escalate when the same shell or "mshta.exe" starts installers, script hosts, archive tools, credential tooling, or more shells; no children reduce scope only if command intent and artifact/destination evidence also stay bounded.

- If file telemetry is available, did the process stage scripts, HTAs, archives, or payloads?
  - Focus: process-scoped file events using `host.id` + `process.entity_id`, or `host.id` + `process.pid` as fallback, reviewing `file.path`, `file.origin_url`, and `file.Ext.windows.zone_identifier`. $investigate_4
  - Implication: escalate when artifacts land in temp, downloads, desktop, public, startup, or other user-writable paths, carry internet provenance, or later execute; missing file telemetry is unresolved, not benign.

- If network telemetry is available, did the process retrieve payloads or contact callbacks?
  - Focus: process-scoped network events using `host.id` + `process.entity_id`, separating DNS `dns.question.name` from connection `destination.ip` / `destination.port`. $investigate_3
  - Hint: if `process.entity_id` is absent, use `host.id` + `process.pid` and a tight alert-time window. Missing network telemetry is unresolved, not benign.
  - Implication: escalate when the same process reaches rare public domains, direct IPs, paste/file hosts, or service ports fitting retrieval or callback behavior; lower suspicion only when destinations belong to the same authorized simulation or lab workflow.

- Do surrounding process events explain the lure path into "explorer.exe"?
  - Focus: same `host.id` and `user.id` process timeline, especially browser, chat, mail, archive, or download-manager starts in `process.name`, `process.parent.executable`, and `process.parent.command_line`. $investigate_5
  - Implication: escalate when a browser/chat/download chain immediately precedes the paste-run shell or no controlled source explains the lure; lower suspicion when the sequence matches a planned awareness platform or lab harness and the command remains bounded.

- If local findings stay suspicious or unresolved, do related alerts change scope?
  - Focus: recent alerts for the same `host.id`, then `user.id`, emphasizing reuse of the command fragment, shell/proxy binary, recovered artifact, destination, or persistence chain. $investigate_0
  - Hint: use the user view after the host view, or when a shared host needs actor scoping for the command or lure pattern. $investigate_1
  - Implication: broaden response when related alerts show the same lure-driven execution pattern on this host or user; quiet alert history does not close the case without a telemetry-backed benign workflow.

- Escalate on clickfix command intent plus suspicious children, staged artifacts, process-scoped destinations, delivery context, or related alerts; close only when alert-local evidence and recovery bind one authorized simulation or lab workflow with no contradiction; if evidence is mixed or visibility incomplete, preserve evidence and escalate.

### False positive analysis

- Security-awareness, phishing-simulation, red-team, malware-analysis, browser-security, and QA labs can intentionally execute fake CAPTCHA samples. Confirm one exact workflow: stable `process.command_line` fragment, expected `process.executable` and `process.parent.name`, bounded `user.id` / `host.id`, and recovered children, artifacts, and destinations that stay inside the exercise or lab set.
- Without exercise or lab records, close only when telemetry proves the same command fragment, parent context, `user.id`, `host.id`, and recovered evidence stayed bounded across prior alerts from this rule. Do not close when child execution, artifact staging, destination activity, or related alerts contradict the expected workflow.
- Build exceptions only from the minimum confirmed workflow: command fragment, process identity, parent context, `user.id`, `host.id`, and any recovered artifact or destination pattern. Avoid exceptions on lure text, "explorer.exe", `process.name`, or a user alone.

### Response and remediation

- If confirmed benign, reverse temporary containment and record the command, process identity, parent context, `user.id`, `host.id`, and recovered supporting evidence that proved the authorized simulation or lab workflow. Create an exception only when that exact workflow recurs.
- If suspicious but unconfirmed, export the alert, process tree, `process.entity_id`, `process.command_line`, child command lines, volatile state, and any recovered artifact paths, domains, IPs, or ports before containment. Apply reversible controls first, such as temporary destination blocks, browser-session reset, heightened monitoring, or endpoint isolation when retrieval, staging, or second-stage execution makes continued connectivity risky.
- If confirmed malicious, isolate the host when command intent plus child, artifact, or destination evidence establishes compromise. Terminate the malicious shell, "mshta.exe", or follow-on children only after evidence is recorded, then block confirmed domains, IPs, hashes, or URLs and reset credentials only if the investigation shows account misuse.
- Eradicate only the staged scripts, HTAs, archives, payloads, or persistence artifacts found during the investigation, then remediate the web, chat, mail, or download path that led the user to run the lure.
- Post-incident hardening: retain process, file, and network telemetry needed for future clickfix triage; review browser protections, clipboard/paste execution controls, and user-awareness coverage; record the confirmed lure wording and paste-run chain in the case notes.
"""

setup = """## Setup

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

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

### Additional data sources

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

- [CrowdStrike](https://ela.st/crowdstrike-integration)
- [Microsoft Defender XDR](https://ela.st/m365-defender)
- [SentinelOne Cloud Funnel](https://ela.st/sentinel-one-cloud-funnel)
- [Sysmon Event ID 1 - Process Creation](https://ela.st/sysmon-event-1-setup)
- [Windows Process Creation Logs](https://ela.st/audit-process-creation)
"""

[rule.investigation_fields]
field_names = [
    "@timestamp",
    "host.name",
    "host.id",
    "user.id",
    "process.name",
    "process.executable",
    "process.command_line",
    "process.pid",
    "process.entity_id",
    "process.parent.name",
    "process.parent.executable",
    "process.parent.command_line",
]

[transform]

[[transform.investigate]]
label = "Alerts associated with the host"
description = ""
providers = [
  [
    { excluded = false, field = "event.kind", queryType = "phrase", value = "signal", valueType = "string" },
    { excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" }
  ]
]
relativeFrom = "now-48h/h"
relativeTo = "now"

[[transform.investigate]]
label = "Alerts associated with the user"
description = ""
providers = [
  [
    { excluded = false, field = "event.kind", queryType = "phrase", value = "signal", valueType = "string" },
    { excluded = false, field = "user.id", queryType = "phrase", value = "{{user.id}}", valueType = "string" }
  ]
]
relativeFrom = "now-48h/h"
relativeTo = "now"

[[transform.investigate]]
label = "Child process starts from the same alerting instance"
description = ""
providers = [
  [
    { excluded = false, field = "event.category", queryType = "phrase", value = "process", valueType = "string" },
    { excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" },
    { excluded = false, field = "process.parent.entity_id", queryType = "phrase", value = "{{process.entity_id}}", valueType = "string" }
  ]
]
relativeFrom = "now-1h"
relativeTo = "now"

[[transform.investigate]]
label = "Network activity for the alerting instance"
description = ""
providers = [
  [
    { excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" },
    { excluded = false, field = "process.entity_id", queryType = "phrase", value = "{{process.entity_id}}", valueType = "string" },
    { excluded = false, field = "event.category", queryType = "phrase", value = "network", valueType = "string" }
  ]
]
relativeFrom = "now-1h"
relativeTo = "now"

[[transform.investigate]]
label = "File activity for the alerting instance"
description = ""
providers = [
  [
    { excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" },
    { excluded = false, field = "process.entity_id", queryType = "phrase", value = "{{process.entity_id}}", valueType = "string" },
    { excluded = false, field = "event.category", queryType = "phrase", value = "file", valueType = "string" }
  ]
]
relativeFrom = "now-1h"
relativeTo = "now"

[[transform.investigate]]
label = "Process timeline for the host and user"
description = ""
providers = [
  [
    { excluded = false, field = "event.category", queryType = "phrase", value = "process", valueType = "string" },
    { excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" },
    { excluded = false, field = "user.id", queryType = "phrase", value = "{{user.id}}", valueType = "string" }
  ]
]
relativeFrom = "now-1h"
relativeTo = "now"

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

[[rule.threat.technique.subtechnique]]
id = "T1059.003"
name = "Windows Command Shell"
reference = "https://attack.mitre.org/techniques/T1059/003/"

[[rule.threat.technique]]
id = "T1204"
name = "User Execution"
reference = "https://attack.mitre.org/techniques/T1204/"

[[rule.threat.technique.subtechnique]]
id = "T1204.004"
name = "Malicious Copy and Paste"
reference = "https://attack.mitre.org/techniques/T1204/004/"

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

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

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

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

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

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

[[rule.threat.technique]]
id = "T1189"
name = "Drive-by Compromise"
reference = "https://attack.mitre.org/techniques/T1189/"

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

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

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

Stages and Predicates

Stage 1: process

process where host.os.type == "windows" and event.type == "start" and
 process.name : ("powershell.exe", "cmd.exe", "mshta.exe") and process.parent.name : "explorer.exe" and
 process.command_line : ("*recaptcha *", "*CAPTCHA Verif*", "*complete verification*", "*Verification ID*", "*Verification Code*", "*Verification UID*",
                         "*hυmаn vаlіdаtiοn*", "*human ID*", "*Action Identificator*", "*not a robot*", "*Click OK to*", "*anti-robot test*",
                         "*Cloudflare ID*")

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.typeeq
  • start corpus 1036 (elastic 1036)
field:"event.type" kind:eq value:"start"
process.command_linewildcard
  • *Action Identificator*
  • *CAPTCHA Verif*
  • *Click OK to*
  • *Cloudflare ID*
  • *Verification Code*
  • *Verification ID*
  • *Verification UID*
  • *anti-robot test*
  • *complete verification*
  • *human ID*
  • *hυmаn vаlіdаtiοn*
  • *not a robot*
  • *recaptcha *
field:"CommandLine" kind:wildcard
process.namewildcard
  • cmd.exe corpus 122 (elastic 93, splunk 29)
  • mshta.exe corpus 84 (elastic 80, splunk 4)
  • powershell.exe corpus 187 (elastic 140, splunk 44, kusto 3)
field:"process_basename" kind:wildcard
process.parent.namewildcard
  • explorer.exe corpus 50 (elastic 50)
field:"parent_process_basename" kind:wildcard value:"explorer.exe"

Potential Privilege Escalation via a Known SUID/SGID Binary

#
Source
github.com/elastic/protections-artifacts

This rule detects potential local privilege escalation attempts via known, pre-installed SUID/SGID binaries. Attackers may abuse SUID/SGID binaries to escalate their privileges to root, using exploits or misconfigurations.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
This rule detects potential local privilege escalation attempts via known, pre-installed SUID/SGID binaries. Attackers
may abuse SUID/SGID binaries to escalate their privileges to root, using exploits or misconfigurations.
"""
id = "b1d415dc-796a-48f1-944f-4bb6037b2450"
license = "Elastic License v2"
name = "Potential Privilege Escalation via a Known SUID/SGID Binary"
os_list = ["linux"]
version = "1.0.3"

query = '''
process where event.type == "start" and event.action == "exec" and (
  (process.user.id == 0 and process.real_user.id != 0 and process.parent.user.id != 0) or
  (process.group.id == 0 and process.real_group.id != 0 and process.parent.group.id != 0)
) and
(
  (process.name == "unix_chkpwd" and process.args_count <= 2) or
  (
    process.name in ("fusermount", "fusermount3", "umount", "newgrp", "chsh") and
    process.args_count == 1
  ) or
  process.name in (
    "sudoedit", "gpasswd", "chfn", "polkit-agent-helper-1", "dbus-daemon-launch-helper", "ssh-keysign",
    "pam_extrausers_chkpwd", "expiry", "chage", "wall", "bsd-write", "ssh-agent",
    "ping6", "traceroute", "mtr", "ntfs-3g", "chrome-sandbox"
  )
) and
(
  process.parent.name like (".*", "python*", "perl*", "ruby*", "lua*", "php*", "node", "deno", "bun", "java") or
  process.parent.executable like ("./*", "/tmp/*", "/var/tmp/*", "/dev/shm/*", "/run/user/*", "/var/run/user/*", "/home/*/*") or
  (
    process.parent.name in ("bash", "dash", "sh", "tcsh", "csh", "zsh", "ksh", "fish", "mksh") and
    process.parent.args in ("-c", "-cl", "-lc", "--command", "-ic", "-ci", "-bash", "-sh", "-zsh", "-dash", "-fish", "-ksh", "-mksh") and
    process.parent.args_count <= 4
  )
) and
not (
  (process.name == "chage" and process.args == "-l" and process.args_count == 3) or
  (
    process.name == "sudoedit" and (
      (process.args == "-s" and process.args == "/") or
      process.args in ("--help", "-h") or
      process.args like "AAAAAA*"
    )
  ) or
  (process.name == "traceroute" and process.args_count == 2) or
  (process.executable == "/usr/bin/umount" and process.command_line == "umount") or
  process.executable like ("/tmp/newroot/*/chrome-sandbox", "/home/*/chrome-sandbox", "/tmp/newroot/usr/lib/polkit-1/polkit-agent-helper-1", "/opt/brave.com/brave/chrome-sandbox")
)
'''

min_endpoint_version = "8.2.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 = "T1068"
name = "Exploitation for Privilege Escalation"
reference = "https://attack.mitre.org/techniques/T1068/"

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

[[threat.technique.subtechnique]]
id = "T1548.003"
name = "Sudo and Sudo Caching"
reference = "https://attack.mitre.org/techniques/T1548/003/"



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

[internal]
min_endpoint_version = "8.2.0"

Stages and Predicates

Stage 1: process

process where event.type == "start" and event.action == "exec" and (
  (process.user.id == 0 and process.real_user.id != 0 and process.parent.user.id != 0) or
  (process.group.id == 0 and process.real_group.id != 0 and process.parent.group.id != 0)
) and
(
  (process.name == "unix_chkpwd" and process.args_count <= 2) or
  (
    process.name in ("fusermount", "fusermount3", "umount", "newgrp", "chsh") and
    process.args_count == 1
  ) or
  process.name in (
    "sudoedit", "gpasswd", "chfn", "polkit-agent-helper-1", "dbus-daemon-launch-helper", "ssh-keysign",
    "pam_extrausers_chkpwd", "expiry", "chage", "wall", "bsd-write", "ssh-agent",
    "ping6", "traceroute", "mtr", "ntfs-3g", "chrome-sandbox"
  )
) and
(
  process.parent.name like (".*", "python*", "perl*", "ruby*", "lua*", "php*", "node", "deno", "bun", "java") or
  process.parent.executable like ("./*", "/tmp/*", "/var/tmp/*", "/dev/shm/*", "/run/user/*", "/var/run/user/*", "/home/*/*") or
  (
    process.parent.name in ("bash", "dash", "sh", "tcsh", "csh", "zsh", "ksh", "fish", "mksh") and
    process.parent.args in ("-c", "-cl", "-lc", "--command", "-ic", "-ci", "-bash", "-sh", "-zsh", "-dash", "-fish", "-ksh", "-mksh") and
    process.parent.args_count <= 4
  )
) and
not (
  (process.name == "chage" and process.args == "-l" and process.args_count == 3) or
  (
    process.name == "sudoedit" and (
      (process.args == "-s" and process.args == "/") or
      process.args in ("--help", "-h") or
      process.args like "AAAAAA*"
    )
  ) or
  (process.name == "traceroute" and process.args_count == 2) or
  (process.executable == "/usr/bin/umount" and process.command_line == "umount") or
  process.executable like ("/tmp/newroot/*/chrome-sandbox", "/home/*/chrome-sandbox", "/tmp/newroot/usr/lib/polkit-1/polkit-agent-helper-1", "/opt/brave.com/brave/chrome-sandbox")
)

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.args_counteq
  • 1 transforms: number
field:"process.args_count" kind:eq value:"1"
process.args_countle
  • 2 transforms: number
field:"process.args_count" kind:le value:"2"
process.group.ideq
  • 0 transforms: number
field:"process.group.id" kind:eq value:"0"
process.nameeq
  • unix_chkpwd
field:"process_basename" kind:eq value:"unix_chkpwd"
process.namein
  • bsd-write
  • chage
  • chfn
  • chrome-sandbox
  • chsh
  • dbus-daemon-launch-helper
  • expiry
  • fusermount
  • fusermount3
  • gpasswd
  • mtr
  • newgrp
  • ntfs-3g
  • pam_extrausers_chkpwd
  • ping6
  • polkit-agent-helper-1
  • ssh-agent
  • ssh-keysign
  • sudoedit
  • traceroute
  • umount
  • wall
field:"process_basename" kind:in
process.parent.argsin
  • --command
  • -bash
  • -c
  • -ci
  • -cl
  • -dash
  • -fish
  • -ic
  • -ksh
  • -lc
  • -mksh
  • -sh
  • -zsh
field:"process.parent.args" kind:in
process.parent.args_countle
  • 4 transforms: number
field:"process.parent.args_count" kind:le value:"4"
process.parent.executablewildcard
  • ./*
  • /dev/shm/*
  • /home/*/*
  • /run/user/*
  • /tmp/*
  • /var/run/user/*
  • /var/tmp/*
field:"ParentImage" kind:wildcard
process.parent.group.idne
  • 0 transforms: number
field:"process.parent.group.id" kind:ne value:"0"
process.parent.namein
  • bash
  • csh
  • dash
  • fish
  • ksh
  • mksh
  • sh
  • tcsh
  • zsh
field:"parent_process_basename" kind:in
process.parent.namewildcard
  • .*
  • bun
  • deno
  • java
  • lua*
  • node
  • perl*
  • php*
  • python*
  • ruby*
field:"parent_process_basename" kind:wildcard
process.parent.user.idne
  • 0 transforms: number
field:"process.parent.user.id" kind:ne value:"0"
process.real_group.idne
  • 0 transforms: number
field:"process.real_group.id" kind:ne value:"0"
process.real_user.idne
  • 0 transforms: number
field:"process.real_user.id" kind:ne value:"0"
process.user.ideq
  • 0 transforms: number
field:"process.user.id" kind:eq value:"0"

Exclusions

The rule actively suppresses these predicates.

Potential WPAD Spoofing via DNS Record Creation

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

Identifies the creation of a DNS record that is potentially meant to enable WPAD spoofing. Attackers can disable the Global Query Block List (GQBL) and create a "wpad" record to exploit hosts running WPAD with default settings for privilege escalation and lateral movement.

MITRE ATT&CK Coverage

TacticTechniques
Credential Access

Telemetry Coverage

Rule Body

[metadata]
creation_date = "2024/06/03"
integration = ["system", "windows"]
maturity = "production"
updated_date = "2026/05/04"

[rule]
author = ["Elastic"]
description = """
Identifies the creation of a DNS record that is potentially meant to enable WPAD spoofing. Attackers can disable the
Global Query Block List (GQBL) and create a "wpad" record to exploit hosts running WPAD with default settings for
privilege escalation and lateral movement.
"""
from = "now-9m"
index = ["logs-system.security*", "logs-windows.forwarded*", "winlogbeat-*"]
language = "eql"
license = "Elastic License v2"
name = "Potential WPAD Spoofing via DNS Record Creation"
note = """## Triage and analysis

> **Disclaimer**:
> This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.

### Investigating Potential WPAD Spoofing via DNS Record Creation

Web Proxy Auto-Discovery (WPAD) helps devices automatically detect proxy settings, crucial for network efficiency. However, attackers can exploit WPAD by creating malicious DNS records, tricking systems into using rogue proxies for data interception. The detection rule identifies suspicious DNS record changes, specifically targeting WPAD entries, to flag potential spoofing attempts, aiding in early threat detection and mitigation.

### Possible investigation steps

- Review the event logs for the specific event code "5137" to identify the creation or modification of the "wpad" DNS record. Focus on the details provided in the winlog.event_data.ObjectDN field to confirm the presence of "DC=wpad,*".
- Check the Active Directory change history to determine who made the changes to the DNS records and whether these changes were authorized.
- Investigate the user account associated with the directory service change event to assess if it has been compromised or if there are any signs of unauthorized access.
- Analyze network traffic to and from the "wpad" DNS record to identify any suspicious activity or connections to rogue proxy servers.
- Verify the configuration of the Global Query Block List (GQBL) to ensure it has not been disabled or altered, which could allow unauthorized WPAD entries.
- Cross-reference the alert with other security logs and alerts to identify any related suspicious activities or patterns that could indicate a broader attack campaign.

### False positive analysis

- Legitimate network changes may trigger alerts if a new WPAD DNS record is created intentionally for network configuration. Verify with network administrators if such changes were planned.
- Automated scripts or software updates that modify DNS records can cause false positives. Review the source of the change and consider excluding known benign scripts or update processes.
- Test environments often simulate DNS changes, including WPAD entries, for development purposes. Exclude these environments from monitoring if they are known to generate non-threatening alerts.
- Some organizations may have legacy systems that rely on WPAD configurations. Document these systems and create exceptions for their DNS changes to avoid unnecessary alerts.
- Regular audits of the Global Query Block List settings can help identify and exclude expected changes, reducing false positives related to WPAD record creation.

### Response and remediation

- Immediately isolate the affected system from the network to prevent further data interception or lateral movement by the rogue proxy.
- Verify and restore the integrity of the DNS records by removing any unauthorized "wpad" entries and re-enabling the Global Query Block List (GQBL) if it was disabled.
- Conduct a thorough review of Active Directory logs to identify any unauthorized changes or suspicious activities related to directory service modifications.
- Reset credentials for any accounts that may have been compromised or accessed during the incident to prevent unauthorized access.
- Implement network segmentation to limit the exposure of critical systems to potential WPAD spoofing attacks.
- Escalate the incident to the security operations center (SOC) for further investigation and to determine if additional systems or data were affected.
- Update and enhance monitoring rules to detect similar WPAD spoofing attempts in the future, ensuring timely alerts and responses."""
references = [
    "https://www.thehacker.recipes/ad/movement/mitm-and-coerced-authentications/wpad-spoofing#through-adidns-spoofing",
    "https://cube0x0.github.io/Pocing-Beyond-DA/",
]
risk_score = 47
rule_id = "894326d2-56c0-4342-b553-4abfaf421b5b"
setup = """## Setup

Audit Directory Service Changes must be enabled to generate the events used by this rule.
Setup instructions: https://ela.st/audit-directory-service-changes
"""
severity = "medium"
tags = [
    "Domain: Endpoint",
    "OS: Windows",
    "Use Case: Threat Detection",
    "Tactic: Credential Access",
    "Data Source: Active Directory",
    "Use Case: Active Directory Monitoring",
    "Data Source: Windows Security Event Logs",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"

query = '''
any where host.os.type == "windows" and event.code == "5137" and winlog.event_data.ObjectDN : "DC=wpad,*"
'''


[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1557"
name = "Adversary-in-the-Middle"
reference = "https://attack.mitre.org/techniques/T1557/"


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

Stages and Predicates

Stage 1: any

any where host.os.type == "windows" and event.code == "5137" and winlog.event_data.ObjectDN : "DC=wpad,*"

Indicators

These rows show field, operator, and value matches.

Remote File Copy via TeamViewer

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

Identifies an executable or script file remotely downloaded via a TeamViewer transfer session.

MITRE ATT&CK Coverage

Telemetry Coverage

ProviderRecord / event type
SysmonEvent ID 11: FileCreate

Rule Body

[metadata]
creation_date = "2020/09/02"
integration = ["endpoint", "sentinel_one_cloud_funnel"]
maturity = "production"
updated_date = "2026/05/04"

[transform]
[[transform.osquery]]
label = "Osquery - Retrieve DNS Cache"
query = "SELECT * FROM dns_cache"

[[transform.osquery]]
label = "Osquery - Retrieve All Services"
query = "SELECT description, display_name, name, path, pid, service_type, start_type, status, user_account FROM services"

[[transform.osquery]]
label = "Osquery - Retrieve Services Running on User Accounts"
query = """
SELECT description, display_name, name, path, pid, service_type, start_type, status, user_account FROM services WHERE
NOT (user_account LIKE '%LocalSystem' OR user_account LIKE '%LocalService' OR user_account LIKE '%NetworkService' OR
user_account == null)
"""

[[transform.osquery]]
label = "Osquery - Retrieve Service Unsigned Executables with Virustotal Link"
query = """
SELECT concat('https://www.virustotal.com/gui/file/', sha1) AS VtLink, name, description, start_type, status, pid,
services.path FROM services JOIN authenticode ON services.path = authenticode.path OR services.module_path =
authenticode.path JOIN hash ON services.path = hash.path WHERE authenticode.result != 'trusted'
"""


[rule]
author = ["Elastic"]
description = "Identifies an executable or script file remotely downloaded via a TeamViewer transfer session."
from = "now-9m"
index = ["logs-endpoint.events.file-*", "logs-sentinel_one_cloud_funnel.*"]
language = "eql"
license = "Elastic License v2"
name = "Remote File Copy via TeamViewer"
note = """## Triage and analysis

### Investigating Remote File Copy via TeamViewer

Attackers commonly transfer tooling or malware from external systems into a compromised environment using the command and control channel. However, they can also abuse legitimate utilities to drop these files.

TeamViewer is a remote access and remote control tool used by helpdesks and system administrators to perform various support activities. It is also frequently used by attackers and scammers to deploy malware interactively and other malicious activities. This rule looks for the TeamViewer process creating files with suspicious extensions.

> **Note**:
> This investigation guide uses the [Osquery Markdown Plugin](https://www.elastic.co/guide/en/security/current/invest-guide-run-osquery.html) introduced in Elastic Stack version 8.5.0. Older Elastic Stack versions will display unrendered Markdown in this guide.

#### Possible investigation steps

- Investigate the process execution chain (parent process tree) for unknown processes. Examine their executable files for prevalence, whether they are located in expected locations, and if they are signed with valid digital signatures.
- Contact the user to gather information about who and why was conducting the remote access.
- Investigate other alerts associated with the user/host during the past 48 hours.
- Check whether the company uses TeamViewer for the support activities and if there is a support ticket related to this access.
- Examine the host for derived artifacts that indicate suspicious activities:
  - Analyze the file using a private sandboxed analysis system.
  - Observe and collect information about the following activities in both the sandbox and the alert subject host:
    - Attempts to contact external domains and addresses.
      - Use the Elastic Defend network events to determine domains and addresses contacted by the subject process by filtering by the process' `process.entity_id`.
      - Examine the DNS cache for suspicious or anomalous entries.
        - $osquery_0
    - Use the Elastic Defend registry events to examine registry keys accessed, modified, or created by the related processes in the process tree.
    - Examine the host services for suspicious or anomalous entries.
      - $osquery_1
      - $osquery_2
      - $osquery_3
  - Retrieve the files' SHA-256 hash values using the PowerShell `Get-FileHash` cmdlet and search for the existence and reputation of the hashes in resources like VirusTotal, Hybrid-Analysis, CISCO Talos, Any.run, etc.
- Investigate potentially compromised accounts. Analysts can do this by searching for login events (for example, 4624) to the target host after the registry modification.

### False positive analysis

- This mechanism can be used legitimately. Analysts can dismiss the alert if the company relies on TeamViewer to conduct remote access and the triage has not identified suspicious or malicious files.

### Response and remediation

- Initiate the incident response process based on the outcome of the triage.
- Isolate the involved host to prevent further post-compromise behavior.
- If the triage identified malware, search the environment for additional compromised hosts.
  - Implement temporary network rules, procedures, and segmentation to contain the malware.
  - Stop suspicious processes.
  - Immediately block the identified indicators of compromise (IoCs).
  - Inspect the affected systems for additional malware backdoors like reverse shells, reverse proxies, or droppers that attackers could use to reinfect the system.
- Remove and block malicious artifacts identified during triage.
- Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
- Investigate credential exposure on systems compromised or used by the attacker to ensure all compromised accounts are identified. Reset passwords for these accounts and other potentially compromised credentials, such as email, business systems, and web services.
- Using the incident response data, update logging and audit policies to improve the mean time to detect (MTTD) and the mean time to respond (MTTR).
"""

setup = """## Setup

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

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

### Additional data sources

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

- [SentinelOne Cloud Funnel](https://ela.st/sentinel-one-cloud-funnel)
"""

references = [
    "http://web.archive.org/web/20230329160957/https://blog.menasec.net/2019/11/hunting-for-suspicious-use-of.html",
]
risk_score = 47
rule_id = "b25a7df2-120a-4db2-bd3f-3e4b86b24bee"
severity = "medium"
tags = [
    "Domain: Endpoint",
    "OS: Windows",
    "Use Case: Threat Detection",
    "Tactic: Command and Control",
    "Resources: Investigation Guide",
    "Data Source: Elastic Defend",
    "Data Source: SentinelOne",
]
timestamp_override = "event.ingested"
type = "eql"

query = '''
file where host.os.type == "windows" and event.type == "creation" and process.name : "TeamViewer.exe" and
  file.extension : ("exe", "dll", "scr", "com", "bat", "cmd", "ps1", "vbs", "vbe", "js", "jse", "wsh", "wsf", "sct", "hta") and
  not 
  (
    file.path : (
      "?:\\Users\\*\\AppData\\Local\\Microsoft\\Windows\\INetCache\\*.js",
      "?:\\Users\\*\\AppData\\Local\\Temp\\TeamViewer\\update.exe",
      "?:\\Users\\*\\AppData\\Local\\Temp\\?\\TeamViewer\\update.exe",
      "?:\\Users\\*\\AppData\\Local\\TeamViewer\\CustomConfigs\\???????\\TeamViewer_Resource_??.dll",
      "?:\\Users\\*\\AppData\\Local\\TeamViewer\\CustomConfigs\\???????\\TeamViewer*.exe"
    ) and process.code_signature.trusted == true
  )
'''


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

[[rule.threat.technique]]
id = "T1219"
name = "Remote Access Tools"
reference = "https://attack.mitre.org/techniques/T1219/"


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

Stages and Predicates

Stage 1: file

file where host.os.type == "windows" and event.type == "creation" and process.name : "TeamViewer.exe" and
  file.extension : ("exe", "dll", "scr", "com", "bat", "cmd", "ps1", "vbs", "vbe", "js", "jse", "wsh", "wsf", "sct", "hta") and
  not 
  (
    file.path : (
      "?:\\Users\\*\\AppData\\Local\\Microsoft\\Windows\\INetCache\\*.js",
      "?:\\Users\\*\\AppData\\Local\\Temp\\TeamViewer\\update.exe",
      "?:\\Users\\*\\AppData\\Local\\Temp\\?\\TeamViewer\\update.exe",
      "?:\\Users\\*\\AppData\\Local\\TeamViewer\\CustomConfigs\\???????\\TeamViewer_Resource_??.dll",
      "?:\\Users\\*\\AppData\\Local\\TeamViewer\\CustomConfigs\\???????\\TeamViewer*.exe"
    ) and process.code_signature.trusted == true
  )

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.typeeq
  • creation corpus 48 (elastic 48)
field:"event.type" kind:eq value:"creation"
file.extensionwildcard
  • bat corpus 13 (elastic 13)
  • cmd corpus 15 (elastic 15)
  • com corpus 16 (elastic 16)
  • dll corpus 32 (elastic 32)
  • exe corpus 32 (elastic 32)
  • hta corpus 20 (elastic 20)
  • js corpus 22 (elastic 22)
  • jse corpus 18 (elastic 18)
  • ps1 corpus 9 (elastic 9)
  • scr corpus 17 (elastic 17)
  • sct corpus 7 (elastic 7)
  • vbe corpus 18 (elastic 18)
  • vbs corpus 19 (elastic 19)
  • wsf corpus 10 (elastic 10)
  • wsh corpus 16 (elastic 16)
field:"file.extension" kind:wildcard
process.namewildcard
  • TeamViewer.exe
field:"process_basename" kind:wildcard value:"TeamViewer.exe"

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
file.pathwildcard?:\Users\*\AppData\Local\Microsoft\Windows\INetCache\*.js, ?:\Users\*\AppData\Local\Temp\TeamViewer\update.exe, ?:\Users\*\AppData\Local\Temp\?\TeamViewer\update.exe, ?:\Users\*\AppData\Local\TeamViewer\CustomConfigs\???????\TeamViewer_Resource_??.dll, ?:\Users\*\AppData\Local\TeamViewer\CustomConfigs\???????\TeamViewer*.exeexcludes:file.path
process.code_signature.trustedeqtrueexcludes:process.code_signature.trusted field:"process.code_signature.trusted" value:"true"

Remote System Discovery Commands

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

Discovery of remote system information using built-in commands, which may be used to move laterally.

MITRE ATT&CK Coverage

Telemetry Coverage

Rule Body

[metadata]
bypass_bbr_timing = true
creation_date = "2020/12/04"
integration = ["endpoint", "windows"]
maturity = "production"
updated_date = "2026/03/24"

[rule]
author = ["Elastic"]
building_block_type = "default"
description = "Discovery of remote system information using built-in commands, which may be used to move laterally."
from = "now-9m"
index = ["logs-endpoint.events.process-*", "winlogbeat-*", "logs-windows.*", "endgame-*"]
language = "eql"
license = "Elastic License v2"
name = "Remote System Discovery Commands"
note = """## Triage and analysis

### Investigating Remote System Discovery Commands

After successfully compromising an environment, attackers may try to gain situational awareness to plan their next steps. This can happen by running commands to enumerate network resources, users, connections, files, and installed security software.

This rule looks for the execution of the `arp` or `nbstat` utilities to enumerate remote systems in the environment, which is useful for attackers to identify lateral movement targets.

#### Possible investigation steps

- Investigate the process execution chain (parent process tree) for unknown processes. Examine their executable files for prevalence, whether they are located in expected locations, and if they are signed with valid digital signatures.
- Identify the user account that performed the action and whether it should perform this kind of action.
- Investigate other alerts associated with the user/host during the past 48 hours.
- Investigate any abnormal account behavior, such as command executions, file creations or modifications, and network connections.

### False positive analysis

- Discovery activities are not inherently malicious if they occur in isolation. As long as the analyst did not identify suspicious activity related to the user or host, such alerts can be dismissed.

### Response and remediation

- Initiate the incident response process based on the outcome of the triage.
- Isolate the involved hosts to prevent further post-compromise behavior.
- Investigate credential exposure on systems compromised or used by the attacker to ensure all compromised accounts are identified. Reset passwords for these accounts and other potentially compromised credentials, such as email, business systems, and web services.
- Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
- Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
- Using the incident response data, update logging and audit policies to improve the mean time to detect (MTTD) and the mean time to respond (MTTR).
"""
risk_score = 21
rule_id = "0635c542-1b96-4335-9b47-126582d2c19a"
setup = """## Setup

If enabling an EQL rule on a non-elastic-agent index (such as beats) for versions <8.2,
events will not define `event.ingested` and default fallback for EQL rules was not added until version 8.2.
Hence for this rule to work effectively, users will need to add a custom ingest pipeline to populate
`event.ingested` to @timestamp.
For more details on adding a custom ingest pipeline refer - https://www.elastic.co/guide/en/fleet/current/data-streams-pipeline-tutorial.html
"""
severity = "low"
tags = [
    "Domain: Endpoint",
    "OS: Windows",
    "Use Case: Threat Detection",
    "Tactic: Discovery",
    "Resources: Investigation Guide",
    "Data Source: Elastic Defend",
    "Data Source: Elastic Endgame",
    "Rule Type: BBR",
]
timestamp_override = "event.ingested"
type = "eql"

query = '''
process where host.os.type == "windows" and event.type == "start" and
  ((process.name : "nbtstat.exe" and process.args : ("-n", "-s")) or
  (process.name : "arp.exe" and process.args : "-a") or
  (process.name : "nltest.exe" and process.args : ("/dclist", "/dsgetdc")) or
  (process.name : "nslookup.exe" and process.args : "*_ldap._tcp.dc.*") or
  (process.name: ("dsquery.exe", "dsget.exe") and process.args: "subnet") or
  ((((process.name : "net.exe" or process.pe.original_file_name == "net.exe") or
    ((process.name : "net1.exe" or process.pe.original_file_name == "net1.exe") and not 
       process.parent.name : "net.exe")) and 
       process.args : "group" and process.args : "/domain" and not process.args : "/add"))) and
  not
  (
    (
      process.name : "arp.exe" and
      process.parent.executable : (
        "?:\\ProgramData\\CentraStage\\AEMAgent\\AEMAgent.exe",
        "?:\\Program Files (x86)\\Citrix\\Workspace Environment Management Agent\\Citrix.Wem.Agent.Service.exe",
        "?:\\Program Files (x86)\\Lansweeper\\Service\\LansweeperService.exe"
      )
    )
  )
'''


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

[[rule.threat.technique]]
id = "T1016"
name = "System Network Configuration Discovery"
reference = "https://attack.mitre.org/techniques/T1016/"

[[rule.threat.technique]]
id = "T1018"
name = "Remote System Discovery"
reference = "https://attack.mitre.org/techniques/T1018/"

[[rule.threat.technique]]
id = "T1069"
name = "Permission Groups Discovery"
reference = "https://attack.mitre.org/techniques/T1069/"

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

[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 == "windows" and event.type == "start" and
  ((process.name : "nbtstat.exe" and process.args : ("-n", "-s")) or
  (process.name : "arp.exe" and process.args : "-a") or
  (process.name : "nltest.exe" and process.args : ("/dclist", "/dsgetdc")) or
  (process.name : "nslookup.exe" and process.args : "*_ldap._tcp.dc.*") or
  (process.name: ("dsquery.exe", "dsget.exe") and process.args: "subnet") or
  ((((process.name : "net.exe" or process.pe.original_file_name == "net.exe") or
    ((process.name : "net1.exe" or process.pe.original_file_name == "net1.exe") and not 
       process.parent.name : "net.exe")) and 
       process.args : "group" and process.args : "/domain" and not process.args : "/add"))) and
  not
  (
    (
      process.name : "arp.exe" and
      process.parent.executable : (
        "?:\\ProgramData\\CentraStage\\AEMAgent\\AEMAgent.exe",
        "?:\\Program Files (x86)\\Citrix\\Workspace Environment Management Agent\\Citrix.Wem.Agent.Service.exe",
        "?:\\Program Files (x86)\\Lansweeper\\Service\\LansweeperService.exe"
      )
    )
  )

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.typeeq
  • start corpus 1036 (elastic 1036)
field:"event.type" kind:eq value:"start"
process.argswildcard
  • *_ldap._tcp.dc.*
  • -a corpus 5 (elastic 5)
  • -n corpus 2 (elastic 2)
  • -s corpus 3 (elastic 3)
  • /dclist
  • /domain
  • /dsgetdc
  • group corpus 3 (elastic 3)
  • subnet
field:"process.args" kind:wildcard
process.namewildcard
  • arp.exe corpus 10 (elastic 8, splunk 1, kusto 1)
  • dsget.exe corpus 8 (elastic 8)
  • dsquery.exe corpus 12 (elastic 8, splunk 4)
  • nbtstat.exe corpus 9 (elastic 9)
  • net.exe corpus 30 (elastic 27, splunk 2, kusto 1)
  • net1.exe corpus 40 (elastic 21, splunk 19)
  • nltest.exe corpus 12 (elastic 10, splunk 2)
  • nslookup.exe corpus 7 (elastic 3, splunk 3, kusto 1)
field:"process_basename" kind:wildcard
process.pe.original_file_nameeq
  • net.exe corpus 7 (elastic 7)
  • net1.exe corpus 6 (elastic 6)
field:"OriginalFileName" kind:eq

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.nameeqarp.exeexcludes:process.name field:"process.name" value:"arp.exe"
process.parent.executableeq?:\ProgramData\CentraStage\AEMAgent\AEMAgent.exe, ?:\Program Files (x86)\Citrix\Workspace Environment Management Agent\Citrix.Wem.Agent.Service.exe, ?:\Program Files (x86)\Lansweeper\Service\LansweeperService.exeexcludes:process.parent.executable field:"process.parent.executable" value:"?:\ProgramData\CentraStage\AEMAgent\AEMAgent.exe" field:"process.parent.executable" value:"?:\Program Files (x86)\Citrix\Workspace Environment Management Agent\Citrix.Wem.Agent.Service.exe" field:"process.parent.executable" value:"?:\Program Files (x86)\Lansweeper\Service\LansweeperService.exe"

Shellcode API behavior from a signed module

#
Source
github.com/elastic/protections-artifacts

Identifies shellcode API behavior from a signed final user module. This may indicate an attempt to perform code injection abusing a valid code signing certificate to avoid suspicion.

MITRE ATT&CK Coverage

TacticTechniques
Stealth

Rule Body

[rule]
description = """
Identifies shellcode API behavior from a signed final user module. This may indicate an attempt to perform code
injection abusing a valid code signing certificate to avoid suspicion.
"""
id = "947ad28a-98de-49cc-988b-fef69785585a"
license = "Elastic License v2"
name = "Shellcode API behavior from a signed module"
os_list = ["windows"]
version = "1.0.10"

query = '''
api where process.Ext.api.name in ("VirtualAlloc", "VirtualProtect") and
 process.Ext.api.behaviors in ("shellcode", "allocate_shellcode") and process.Ext.api.metadata.target_address_name == "Unbacked" and
 process.thread.Ext.call_stack_final_user_module.name == "Unbacked" and
 process.thread.Ext.call_stack_summary like
                           ("ntdll.dll|Unbacked",
                            "ntdll.dll|kernelbase.dll|Unbacked",
                            "ntdll.dll|kernelbase.dll|kernel32.dll|Unbacked",
                            "ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|kernelbase.dll|Unbacked|*") and
 process.thread.Ext.call_stack_final_user_module.protection_provenance != null and
 process.thread.Ext.call_stack_final_user_module.hash.sha256 != null and
 process.thread.Ext.call_stack_final_user_module.code_signature != null and
 _arraysearch(process.thread.Ext.call_stack_final_user_module.code_signature, $entry, $entry.trusted == true) and 
 
 not process.thread.Ext.call_stack_final_user_module.protection_provenance_path : ("c:\\program files\\*", "c:\\program files (x86)\\*") and 
 not process.thread.Ext.call_stack_final_user_module.protection_provenance : ("wrusr.dll") and
 not (process.Ext.api.name == "VirtualProtect" and
      _arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info like ("c:\\windows\\sys?????\\ntdll.dll!LdrLoadDll*", "c:\\windows\\sys?????\\kernelbase.dll!LoadLibrary*"))) and
 not _arraysearch(process.thread.Ext.call_stack, $entry, $entry.callsite_trailing_bytes like
                  ("00000000000000f6375c5b2e8900000000000000ff0000ffeeffee0000000000001000000000000020000000000000000100000000000000100000000000003f",
                   "8985271*085c00f859400000056e84003000056e85502000056e85301000090909090909090908b4e3485c90f848900000003")) and
 not process.thread.Ext.call_stack_final_user_module.hash.sha256 in
                        ("eff52743773eb550fcc6ce3efc37c85724502233b6b002a35496d828bd7b280a",
                         "fc450380eaa226b351c919e87df61dd869f02b6ab47beedf8f940618a65761b0",
                         "b982741576a050860c3f3608c7b269dbd35ab296429192b8afa53f1f190069c0",
                         "68fba9dd89bfad35f8fd657b9af22a8aebda31bffda35058a7f5ae376136e89b",
                         "f60dd9f2fcbd495674dfc1555effb710eb081fc7d4cae5fa58c438ab50405081",
                         "19ebeeb8eb10548abceb31b2a86c05aaf1e9a0c88e15595534d7722c128b1642",
                         "cc4c335cf61bffdb26957645e8b1cb385e9b8a460b40d66a5af6bacc8570e5c8",
                         "d30993b4cdce19b2d798ca51a5331dd45b894adcd1763df4ff8371d53f582cd3",
                         "ee143a8ed6392faaf0bb4e4f793c733a3ca6e555da343a0728254189955a4d8e") and
 not _arraysearch(process.thread.Ext.call_stack_final_user_module.code_signature, $entry, $entry.trusted == true and
    $entry.subject_name : (
      "Microsoft Corporation",
      "Microsoft Windows",
      "Microsoft Windows Publisher",
      ".NET",
      "Microsoft Windows Hardware Compatibility Publisher",
      "Microsoft Windows Software Compatibility Publisher",
      "Avast Software s.r.o.",
      "AVG Technologies USA, LLC",
      "BeyondTrust Corporation",
      "Bitdefender SRL",
      "Carbon Black, Inc.",
      "Check Point Software Technologies Ltd.",
      "Cisco Systems, Inc.",
      "ESET, spol. s r.o.",
      "FireEye, Inc.",
      "Malwarebytes Inc",
      "Kaspersky Lab",
      "Kaspersky Lab JSC",
      "AO Kaspersky Lab",
      "McAfee, Inc.",
      "Tanium Inc.",
      "Mozilla Corporation",
      "Micro Systemation AB (publ)",
      "Brave Software, Inc.",
      "Google LLC",
      "Opera Norway AS",
      "Palo Alto Networks",
      "Palo Alto Networks (Netherlands) B.V.",
      "SentinelOne Inc.",
      "Sophos Limited",
      "NortonLifeLock Inc.",
      "Symantec Corporation",
      "Sentinel Labs, Inc.",
      "Reason Cybersecurity Inc.",
      "Tencent Technology(Shenzhen) Company Limited",
      "Fortinet Technologies (Canada) ULC",
      "Bromium UK Limited",
      "Panda Security S.L.",
      "Beijing Qihu Technology Co., Ltd.",
      "Tencent Technology (Shenzhen) Company Limited",
      "Trend Micro, Inc.",
      "Trend",
      "VMware, Inc.",
      "WithSecure Oyj",
      "Cylance, Inc.",
      "Bromium, Inc.",
      "Broadcom Inc",
      "Safetica a.s.",
      "Apple Inc.",
      "Webroot",
      "Tonalio GmbH",
      "Adobe Inc.",
      "Adobe Systems, Incorporated",
      "Adobe Systems Incorporated",
      "Codejock Technologies, LLC",
      "Intel Corporation",
      "Intel(R) Software Development Products",
      "Johannes Schindelin",
      "Mozilla Corporation",
      "Vivaldi Technologies AS",
      "Dropbox, Inc",
      "SAP SE",
      "VisualSVN Software Ltd.",
      "think-cell Operations GmbH",
      "MUSARUBRA US LLC",
      "Malwarebytes Inc.",
      "Flexera Software LLC",
      "Maksim Moisiuk",
      "Addin Technology Inc.",
      "Seclore Technology Private Limited",
      "Activision Publishing Inc",
      "HP Inc.",
      "Duncan Ogilvie",
      "Riot Games, Inc.",
      "Unity Technologies SF",
      "Arcadia Laboratories Inc.",
      "Incredibuild Software Ltd.",
      "Wellbia.com Co., Ltd.",
      "Macrovision Corporation",
      "Unity Technologies ApS",
      "ONELAUNCH TECHNOLOGIES INC.",
      "Python Software Foundation",
      "W/E adviseurs duurzaam bouwen",
      "FireDaemon Technologies Limited",
      "Skype Software Sarl",
      "Essential Objects, Inc",
      "Essential Objects, Inc.",
      "DameWare Development, LLC.",
      "PIRIFORM SOFTWARE LIMITED",
      "Famatech Corp.",
      "Sky International AG",
      "Hewlett-Packard Company",
      "Lingwen Global Software Co., Ltd.",
      "SentryBay Limited",
      "ACEVILLE PTE LTD",
      "EVC electronic GmbH",
      "Electronic Arts, Inc.",
      "Pharos Systems International",
      "AB Team d. o. o.",
      "GN AUDIO A/S",
      "JumpCloud Inc",
      "Pearl abyss Corp",
      "NetEase (Hangzhou) Network Co., Ltd",
      "Push Play Labs Inc",
      "March Networks Corporation",
      "TEAMDEV LTD.",
      "InfoCert S.p.A.",
      "Spotify AB",
      "Perspective Software",
      "Roblox Corporation",
      "Beijing Qihu Technology Co., Ltd.",
      "Promon AS",
      "ZKTECO CO.,LTD.",
      "Citrix Systems, Inc.",
      "Riot Games, Inc.",
      "GMC Systems - Gesellschaft für medizinische Computersysteme mbH",
      "Slack Technologies, LLC",
      "Cisco WebEx LLC",
      "Logitech Inc",
      "Beijing Huorong Network Technology Co., Ltd.",
      "Intel(R) MSDK Software Development Products",
      "Quest Software, Inc.",
      "Blizzard Entertainment, Inc.",
      "BERGER LEVRAULT SA",
      "Open Source Developer, Duncan Ogilvie",
      "VMware, Inc.",
      "Beijing Qihu Technology Co., Ltd.",
      "TechPowerUp Ltd",
      "Deskshare, Inc",
      "F005DA31-7CE1-4D3E-ABEE-08A4AFF4F592",
      "Finansiell ID-Teknik BID AB",
      "Perspective Software",
      "Catalyst Development Corporation",
      "TechPowerUp Ltd",
      "E-ImageData Corp.",
      "CADzation LLC",
      "Safetica Technologies s.r.o.",
      "Speckled Jay LLC",
      "Bizet Inc",
      "Micro Focus Group Limited",
      "SteelSeries ApS",
      "Universal Laser Systems, Inc.",
      "Smilegate Entertainment, Inc.",
      "Cyberdigm. Corp.",
      "Zhuhai Kingsoft Office Software Co., Ltd.",
      "CyberArk Software Ltd.",
      "Comodo Security Solutions, Inc.",
      "MarkAny Inc.",
      "Sophos Ltd",
      "Thycotic Software, LLC",
      "Admin By Request ApS",
      "CRYPTO-PRO LLC",
      "Delinea Inc.",
      "Environmental Systems Research Institute, Inc.",
      "Hewlett Packard",
      "McAfee, LLC", "Code Systems Corporation",
      "Asesoria Informatica Gallega SL",
      "EasyAntiCheat Oy",
      "TeamDev Management *",
      "Fiserv, Inc.",
      "COREL CORPORATION",
      "Webroot Inc.", "Corel Corporation",
      "SEIKO EPSON CORPORATION",
      "Aviata, Inc.", "GE Healthcare Inc.",
      "DEEZER SA", "AXON ENTERPRISE, INC.",
      "TEKLYNX INTERNATIONAL SASU", "Fiserv",
      "ASUSTeK COMPUTER INC.", "FLEXTECH INC.",
      "MV INFORMATICA NORDESTE LTDA",
      "Samsung Electronics Co., Ltd.",
      "Genetec Inc.", "YANDEX LLC",
      "VNG CORPORATION",
      "COC COC COMPANY LIMITED",
      "HOLA VPN LTD", "Keeper Security Inc.",
      "Panterra Networks, Inc.", "Frontline Systems, Inc.",
      "Siemens AG", "Lisam Systems SA", "Avant Force",
      "Brother Industries, Ltd.", "KRAFTON, Inc.", "EPOS Group A/S", "IDrive, Inc.",
      "TENAXSOFT SRL", "Disashop, S.L.", "London Jamocha Community CIC", "Hewlett Packard Enterprise Company",
      "The TWAIN Working Group",  "COC COC COMPANY LIMITED", "London Jamocha Community CIC", "Embark Studios AB",
      "HOLA VPN LTD", "Keeper Security Inc.", "Panterra Networks, Inc.", "Frontline Systems, Inc.", "TENAXSOFT SRL",
      "Siemens AG", "Lisam Systems SA", "Avant Force", "KRAFTON, Inc.", "Pro Softnet Corporation",
      "EPOS Group A/S", "Dynatrace LLC", "Internet Testing Systems, LLC", "AIRTAME ApS", "DVDFab Software Inc.",
      "netSkope Inc", "The Qt Company Oy", "FOXIT SOFTWARE INC.", "Oracle America, Inc.", "Anatomage, Inc.",
      "FenixSim Limited", "Brooks Internet Software, Inc.", "CAPCOM CO., LTD.", "Facepunch Studios Ltd", "Manthe Industries, LLC",
      "AVS-N LLC", "A-Volute SAS", "ООО Научно-Производственное Предприятие АВС-Н", "Lexmark Enterprise Software", "AVS-N, OOO",
      "KOBIL GmbH", "Threatstar B.V.", "NCSOFT Corporation", "Blueridge Software", "Code Systems Corpration", "TEKLYNX CORPORATION SAS",
      "ORIGIN ONLINE MMORPG LTD", "IDEA INFORMATICA SRL", "NetEye Informática Ltda", "OCBASE", "PACSGEAR", "Hyland Software Inc.",
      "Zoom Video Communications, Inc.", "MAGNET FORENSICS INC.", "Inspect Element Ltd", "APL2000 (APLNow, LLC)"
    ))
'''

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

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

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1620"
name = "Reflective Code Loading"
reference = "https://attack.mitre.org/techniques/T1620/"


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

[internal]
min_endpoint_version = "8.14.2"

Stages and Predicates

Stage 1: api

api where process.Ext.api.name in ("VirtualAlloc", "VirtualProtect") and
 process.Ext.api.behaviors in ("shellcode", "allocate_shellcode") and process.Ext.api.metadata.target_address_name == "Unbacked" and
 process.thread.Ext.call_stack_final_user_module.name == "Unbacked" and
 process.thread.Ext.call_stack_summary like
                           ("ntdll.dll|Unbacked",
                            "ntdll.dll|kernelbase.dll|Unbacked",
                            "ntdll.dll|kernelbase.dll|kernel32.dll|Unbacked",
                            "ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|kernelbase.dll|Unbacked|*") and
 process.thread.Ext.call_stack_final_user_module.protection_provenance != null and
 process.thread.Ext.call_stack_final_user_module.hash.sha256 != null and
 process.thread.Ext.call_stack_final_user_module.code_signature != null and
 _arraysearch(process.thread.Ext.call_stack_final_user_module.code_signature, $entry, $entry.trusted == true) and 
 
 not process.thread.Ext.call_stack_final_user_module.protection_provenance_path : ("c:\\program files\\*", "c:\\program files (x86)\\*") and 
 not process.thread.Ext.call_stack_final_user_module.protection_provenance : ("wrusr.dll") and
 not (process.Ext.api.name == "VirtualProtect" and
      _arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info like ("c:\\windows\\sys?????\\ntdll.dll!LdrLoadDll*", "c:\\windows\\sys?????\\kernelbase.dll!LoadLibrary*"))) and
 not _arraysearch(process.thread.Ext.call_stack, $entry, $entry.callsite_trailing_bytes like
                  ("00000000000000f6375c5b2e8900000000000000ff0000ffeeffee0000000000001000000000000020000000000000000100000000000000100000000000003f",
                   "8985271*085c00f859400000056e84003000056e85502000056e85301000090909090909090908b4e3485c90f848900000003")) and
 not process.thread.Ext.call_stack_final_user_module.hash.sha256 in
                        ("eff52743773eb550fcc6ce3efc37c85724502233b6b002a35496d828bd7b280a",
                         "fc450380eaa226b351c919e87df61dd869f02b6ab47beedf8f940618a65761b0",
                         "b982741576a050860c3f3608c7b269dbd35ab296429192b8afa53f1f190069c0",
                         "68fba9dd89bfad35f8fd657b9af22a8aebda31bffda35058a7f5ae376136e89b",
                         "f60dd9f2fcbd495674dfc1555effb710eb081fc7d4cae5fa58c438ab50405081",
                         "19ebeeb8eb10548abceb31b2a86c05aaf1e9a0c88e15595534d7722c128b1642",
                         "cc4c335cf61bffdb26957645e8b1cb385e9b8a460b40d66a5af6bacc8570e5c8",
                         "d30993b4cdce19b2d798ca51a5331dd45b894adcd1763df4ff8371d53f582cd3",
                         "ee143a8ed6392faaf0bb4e4f793c733a3ca6e555da343a0728254189955a4d8e") and
 not _arraysearch(process.thread.Ext.call_stack_final_user_module.code_signature, $entry, $entry.trusted == true and
    $entry.subject_name : (
      "Microsoft Corporation",
      "Microsoft Windows",
      "Microsoft Windows Publisher",
      ".NET",
      "Microsoft Windows Hardware Compatibility Publisher",
      "Microsoft Windows Software Compatibility Publisher",
      "Avast Software s.r.o.",
      "AVG Technologies USA, LLC",
      "BeyondTrust Corporation",
      "Bitdefender SRL",
      "Carbon Black, Inc.",
      "Check Point Software Technologies Ltd.",
      "Cisco Systems, Inc.",
      "ESET, spol. s r.o.",
      "FireEye, Inc.",
      "Malwarebytes Inc",
      "Kaspersky Lab",
      "Kaspersky Lab JSC",
      "AO Kaspersky Lab",
      "McAfee, Inc.",
      "Tanium Inc.",
      "Mozilla Corporation",
      "Micro Systemation AB (publ)",
      "Brave Software, Inc.",
      "Google LLC",
      "Opera Norway AS",
      "Palo Alto Networks",
      "Palo Alto Networks (Netherlands) B.V.",
      "SentinelOne Inc.",
      "Sophos Limited",
      "NortonLifeLock Inc.",
      "Symantec Corporation",
      "Sentinel Labs, Inc.",
      "Reason Cybersecurity Inc.",
      "Tencent Technology(Shenzhen) Company Limited",
      "Fortinet Technologies (Canada) ULC",
      "Bromium UK Limited",
      "Panda Security S.L.",
      "Beijing Qihu Technology Co., Ltd.",
      "Tencent Technology (Shenzhen) Company Limited",
      "Trend Micro, Inc.",
      "Trend",
      "VMware, Inc.",
      "WithSecure Oyj",
      "Cylance, Inc.",
      "Bromium, Inc.",
      "Broadcom Inc",
      "Safetica a.s.",
      "Apple Inc.",
      "Webroot",
      "Tonalio GmbH",
      "Adobe Inc.",
      "Adobe Systems, Incorporated",
      "Adobe Systems Incorporated",
      "Codejock Technologies, LLC",
      "Intel Corporation",
      "Intel(R) Software Development Products",
      "Johannes Schindelin",
      "Mozilla Corporation",
      "Vivaldi Technologies AS",
      "Dropbox, Inc",
      "SAP SE",
      "VisualSVN Software Ltd.",
      "think-cell Operations GmbH",
      "MUSARUBRA US LLC",
      "Malwarebytes Inc.",
      "Flexera Software LLC",
      "Maksim Moisiuk",
      "Addin Technology Inc.",
      "Seclore Technology Private Limited",
      "Activision Publishing Inc",
      "HP Inc.",
      "Duncan Ogilvie",
      "Riot Games, Inc.",
      "Unity Technologies SF",
      "Arcadia Laboratories Inc.",
      "Incredibuild Software Ltd.",
      "Wellbia.com Co., Ltd.",
      "Macrovision Corporation",
      "Unity Technologies ApS",
      "ONELAUNCH TECHNOLOGIES INC.",
      "Python Software Foundation",
      "W/E adviseurs duurzaam bouwen",
      "FireDaemon Technologies Limited",
      "Skype Software Sarl",
      "Essential Objects, Inc",
      "Essential Objects, Inc.",
      "DameWare Development, LLC.",
      "PIRIFORM SOFTWARE LIMITED",
      "Famatech Corp.",
      "Sky International AG",
      "Hewlett-Packard Company",
      "Lingwen Global Software Co., Ltd.",
      "SentryBay Limited",
      "ACEVILLE PTE LTD",
      "EVC electronic GmbH",
      "Electronic Arts, Inc.",
      "Pharos Systems International",
      "AB Team d. o. o.",
      "GN AUDIO A/S",
      "JumpCloud Inc",
      "Pearl abyss Corp",
      "NetEase (Hangzhou) Network Co., Ltd",
      "Push Play Labs Inc",
      "March Networks Corporation",
      "TEAMDEV LTD.",
      "InfoCert S.p.A.",
      "Spotify AB",
      "Perspective Software",
      "Roblox Corporation",
      "Beijing Qihu Technology Co., Ltd.",
      "Promon AS",
      "ZKTECO CO.,LTD.",
      "Citrix Systems, Inc.",
      "Riot Games, Inc.",
      "GMC Systems - Gesellschaft für medizinische Computersysteme mbH",
      "Slack Technologies, LLC",
      "Cisco WebEx LLC",
      "Logitech Inc",
      "Beijing Huorong Network Technology Co., Ltd.",
      "Intel(R) MSDK Software Development Products",
      "Quest Software, Inc.",
      "Blizzard Entertainment, Inc.",
      "BERGER LEVRAULT SA",
      "Open Source Developer, Duncan Ogilvie",
      "VMware, Inc.",
      "Beijing Qihu Technology Co., Ltd.",
      "TechPowerUp Ltd",
      "Deskshare, Inc",
      "F005DA31-7CE1-4D3E-ABEE-08A4AFF4F592",
      "Finansiell ID-Teknik BID AB",
      "Perspective Software",
      "Catalyst Development Corporation",
      "TechPowerUp Ltd",
      "E-ImageData Corp.",
      "CADzation LLC",
      "Safetica Technologies s.r.o.",
      "Speckled Jay LLC",
      "Bizet Inc",
      "Micro Focus Group Limited",
      "SteelSeries ApS",
      "Universal Laser Systems, Inc.",
      "Smilegate Entertainment, Inc.",
      "Cyberdigm. Corp.",
      "Zhuhai Kingsoft Office Software Co., Ltd.",
      "CyberArk Software Ltd.",
      "Comodo Security Solutions, Inc.",
      "MarkAny Inc.",
      "Sophos Ltd",
      "Thycotic Software, LLC",
      "Admin By Request ApS",
      "CRYPTO-PRO LLC",
      "Delinea Inc.",
      "Environmental Systems Research Institute, Inc.",
      "Hewlett Packard",
      "McAfee, LLC", "Code Systems Corporation",
      "Asesoria Informatica Gallega SL",
      "EasyAntiCheat Oy",
      "TeamDev Management *",
      "Fiserv, Inc.",
      "COREL CORPORATION",
      "Webroot Inc.", "Corel Corporation",
      "SEIKO EPSON CORPORATION",
      "Aviata, Inc.", "GE Healthcare Inc.",
      "DEEZER SA", "AXON ENTERPRISE, INC.",
      "TEKLYNX INTERNATIONAL SASU", "Fiserv",
      "ASUSTeK COMPUTER INC.", "FLEXTECH INC.",
      "MV INFORMATICA NORDESTE LTDA",
      "Samsung Electronics Co., Ltd.",
      "Genetec Inc.", "YANDEX LLC",
      "VNG CORPORATION",
      "COC COC COMPANY LIMITED",
      "HOLA VPN LTD", "Keeper Security Inc.",
      "Panterra Networks, Inc.", "Frontline Systems, Inc.",
      "Siemens AG", "Lisam Systems SA", "Avant Force",
      "Brother Industries, Ltd.", "KRAFTON, Inc.", "EPOS Group A/S", "IDrive, Inc.",
      "TENAXSOFT SRL", "Disashop, S.L.", "London Jamocha Community CIC", "Hewlett Packard Enterprise Company",
      "The TWAIN Working Group",  "COC COC COMPANY LIMITED", "London Jamocha Community CIC", "Embark Studios AB",
      "HOLA VPN LTD", "Keeper Security Inc.", "Panterra Networks, Inc.", "Frontline Systems, Inc.", "TENAXSOFT SRL",
      "Siemens AG", "Lisam Systems SA", "Avant Force", "KRAFTON, Inc.", "Pro Softnet Corporation",
      "EPOS Group A/S", "Dynatrace LLC", "Internet Testing Systems, LLC", "AIRTAME ApS", "DVDFab Software Inc.",
      "netSkope Inc", "The Qt Company Oy", "FOXIT SOFTWARE INC.", "Oracle America, Inc.", "Anatomage, Inc.",
      "FenixSim Limited", "Brooks Internet Software, Inc.", "CAPCOM CO., LTD.", "Facepunch Studios Ltd", "Manthe Industries, LLC",
      "AVS-N LLC", "A-Volute SAS", "ООО Научно-Производственное Предприятие АВС-Н", "Lexmark Enterprise Software", "AVS-N, OOO",
      "KOBIL GmbH", "Threatstar B.V.", "NCSOFT Corporation", "Blueridge Software", "Code Systems Corpration", "TEKLYNX CORPORATION SAS",
      "ORIGIN ONLINE MMORPG LTD", "IDEA INFORMATICA SRL", "NetEye Informática Ltda", "OCBASE", "PACSGEAR", "Hyland Software Inc.",
      "Zoom Video Communications, Inc.", "MAGNET FORENSICS INC.", "Inspect Element Ltd", "APL2000 (APLNow, LLC)"
    ))

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
process.Ext.api.nameeqVirtualProtectexcludes:process.Ext.api.name field:"process.Ext.api.name" value:"VirtualProtect"
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_user_module.hash.sha256in19ebeeb8eb10548abceb31b2a86c05aaf1e9a0c88e15595534d7722c128b1642, 68fba9dd89bfad35f8fd657b9af22a8aebda31bffda35058a7f5ae376136e89b, b982741576a050860c3f3608c7b269dbd35ab296429192b8afa53f1f190069c0, cc4c335cf61bffdb26957645e8b1cb385e9b8a460b40d66a5af6bacc8570e5c8, d30993b4cdce19b2d798ca51a5331dd45b894adcd1763df4ff8371d53f582cd3, ee143a8ed6392faaf0bb4e4f793c733a3ca6e555da343a0728254189955a4d8e, eff52743773eb550fcc6ce3efc37c85724502233b6b002a35496d828bd7b280a, f60dd9f2fcbd495674dfc1555effb710eb081fc7d4cae5fa58c438ab50405081, fc450380eaa226b351c919e87df61dd869f02b6ab47beedf8f940618a65761b0excludes:process.thread.Ext.call_stack_final_user_module.hash.sha256
process.thread.Ext.call_stack_final_user_module.protection_provenanceeqwrusr.dllexcludes:process.thread.Ext.call_stack_final_user_module.protection_provenance field:"process.thread.Ext.call_stack_final_user_module.protection_provenance" value:"wrusr.dll"
process.thread.Ext.call_stack_final_user_module.protection_provenance_pathstarts_withc:\program files\, c:\program files (x86)\excludes:process.thread.Ext.call_stack_final_user_module.protection_provenance_path field:"process.thread.Ext.call_stack_final_user_module.protection_provenance_path" value:"c:\program files\" field:"process.thread.Ext.call_stack_final_user_module.protection_provenance_path" value:"c:\program files (x86)\"

Suspicious Calendar File Modification

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

Identifies suspicious modifications of the calendar file by an unusual process. Adversaries may create a custom calendar notification procedure to execute a malicious program at a recurring interval to establish persistence.

Known False Positives

  • Trusted applications for managing calendars and reminders.

MITRE ATT&CK Coverage

TacticTechniques
Persistence

Telemetry Coverage

Rule Body

[metadata]
creation_date = "2021/01/19"
integration = ["endpoint"]
maturity = "production"
updated_date = "2025/03/18"

[rule]
author = ["Elastic"]
description = """
Identifies suspicious modifications of the calendar file by an unusual process. Adversaries may create a custom calendar
notification procedure to execute a malicious program at a recurring interval to establish persistence.
"""
false_positives = ["Trusted applications for managing calendars and reminders."]
from = "now-9m"
index = ["logs-endpoint.events.*"]
language = "eql"
license = "Elastic License v2"
name = "Suspicious Calendar File Modification"
references = [
    "https://labs.f-secure.com/blog/operationalising-calendar-alerts-persistence-on-macos",
    "https://github.com/FSecureLABS/CalendarPersist",
    "https://github.com/D00MFist/PersistentJXA/blob/master/CalendarPersist.js",
]
risk_score = 47
rule_id = "cb71aa62-55c8-42f0-b0dd-afb0bb0b1f51"
setup = """## Setup

This rule requires data coming in from Elastic Defend.

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

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

#### The following steps should be executed in order to add the Elastic Defend integration on a macOS System:
- Go to the Kibana home page and click "Add integrations".
- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.
- Click "Add Elastic Defend".
- Configure the integration name and optionally add a description.
- Select the type of environment you want to protect, for MacOS it is recommended to select "Traditional Endpoints".
- Select a configuration preset. Each preset comes with different default settings for Elastic Agent, you can further customize these later by configuring the Elastic Defend integration policy. [Helper guide](https://www.elastic.co/guide/en/security/current/configure-endpoint-integration-policy.html).
- We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"
- Enter a name for the agent policy in "New agent policy name". If other agent policies already exist, you can click the "Existing hosts" tab and select an existing policy instead.
For more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/current/agent-policy.html).
- Click "Save and Continue".
- To complete the integration, select "Add Elastic Agent to your hosts" and continue to the next section to install the Elastic Agent on your hosts.
For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
"""
severity = "medium"
tags = [
    "Domain: Endpoint",
    "OS: macOS",
    "Use Case: Threat Detection",
    "Tactic: Persistence",
    "Data Source: Elastic Defend",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"

query = '''
file where host.os.type == "macos" and event.action == "modification" and
  file.path like~ "/Users/*/Library/Calendars/*.calendar/Events/*.ics" and
  not process.executable like ("/System/Library/*", "/System/Applications/Calendar.app/Contents/MacOS/*", 
                               "/System/Applications/Mail.app/Contents/MacOS/Mail", "/usr/libexec/xpcproxy",
                               "/sbin/launchd", "/Applications/*")
'''
note = """## Triage and analysis

> **Disclaimer**:
> This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.

### Investigating Suspicious Calendar File Modification

Calendar files on macOS can be manipulated to trigger events, potentially allowing adversaries to execute malicious programs at set intervals, thus achieving persistence. This detection rule identifies unusual processes modifying calendar files, excluding known legitimate applications. By focusing on unexpected executables altering these files, it helps uncover potential threats exploiting calendar notifications for malicious purposes.

### Possible investigation steps

- Review the process executable path that triggered the alert to determine if it is a known or unknown application, focusing on paths not excluded by the rule.
- Examine the modification timestamp of the calendar file to correlate with any known user activity or scheduled tasks that might explain the change.
- Check the user account associated with the file modification to assess if the activity aligns with typical user behavior or if it suggests unauthorized access.
- Investigate any recent installations or updates of applications on the system that might have introduced new or unexpected executables.
- Look for additional indicators of compromise on the host, such as unusual network connections or other file modifications, to assess if the calendar file change is part of a broader attack.

### False positive analysis

- Legitimate third-party calendar applications may modify calendar files as part of their normal operation. Users can create exceptions for these known applications by adding their executable paths to the exclusion list.
- Automated backup or synchronization tools might access and modify calendar files. Identify these tools and exclude their processes to prevent false alerts.
- User scripts or automation workflows that interact with calendar files for personal productivity purposes can trigger this rule. Review and whitelist these scripts if they are verified as non-malicious.
- System updates or maintenance tasks occasionally modify calendar files. Monitor the timing of such events and correlate them with known update schedules to differentiate between legitimate and suspicious activities.

### Response and remediation

- Immediately isolate the affected macOS system from the network to prevent potential lateral movement or further execution of malicious programs.
- Terminate any suspicious processes identified as modifying calendar files that are not part of the known legitimate applications list.
- Restore the calendar files from a known good backup to ensure no malicious events are scheduled.
- Conduct a thorough scan of the system using updated antivirus or endpoint detection and response (EDR) tools to identify and remove any additional malicious software.
- Review and audit user accounts and permissions on the affected system to ensure no unauthorized access or privilege escalation has occurred.
- Escalate the incident to the security operations center (SOC) or incident response team for further investigation and to determine if other systems may be affected.
- Implement additional monitoring and alerting for unusual calendar file modifications across the network to enhance detection of similar threats in the future."""


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


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

Stages and Predicates

Stage 1: file

file where host.os.type == "macos" and event.action == "modification" and
  file.path like~ "/Users/*/Library/Calendars/*.calendar/Events/*.ics" and
  not process.executable like ("/System/Library/*", "/System/Applications/Calendar.app/Contents/MacOS/*", 
                               "/System/Applications/Mail.app/Contents/MacOS/Mail", "/usr/libexec/xpcproxy",
                               "/sbin/launchd", "/Applications/*")

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • modification corpus 72 (elastic 72)
field:"EventType" kind:eq value:"modification"
file.pathwildcard
  • /Users/*/Library/Calendars/*.calendar/Events/*.ics
field:"TargetFilename" kind:wildcard value:"/Users/*/Library/Calendars/*.calendar/Events/*.ics"

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.executablewildcard/System/Library/*, /System/Applications/Calendar.app/Contents/MacOS/*, /System/Applications/Mail.app/Contents/MacOS/Mail, /usr/libexec/xpcproxy, /sbin/launchd, /Applications/*excludes:process.executable

Suspicious Child Process of PaperCut Server Component

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

Detects suspicious child process execution originating from PaperCut server components, including the PaperCut NG/MF Application Server (pc-app.exe) and PaperCut Hive print job spooler (pc-printjob-spooler.exe). Active exploitation of CVE-2026-82078 and CVE-2026-81578 abuses unsafe dynamic class loading and an authentication bypass to achieve pre-authenticated remote code execution under pc-app.exe. Similar suspicious shell spawning has also been observed from PaperCut Hive's pc-printjob-spooler.exe (for example cmd.exe executing echo/test-style commands). Observed NG/MF in-the-wild activity includes discovery utilities such as whoami and tasklist; proof-of-concept exploitation has spawned unexpected Windows utilities such as charmap.exe as SYSTEM.

MITRE ATT&CK Coverage

Telemetry Coverage

Rule Body

[metadata]
creation_date = "2026/08/28"
integration = ["endpoint", "windows", "system", "m365_defender", "sentinel_one_cloud_funnel", "crowdstrike"]
maturity = "production"
updated_date = "2026/08/28"

[rule]
author = ["Elastic"]
description = """
Detects suspicious child process execution originating from PaperCut server components, including the PaperCut NG/MF
Application Server (pc-app.exe) and PaperCut Hive print job spooler (pc-printjob-spooler.exe). Active exploitation of
CVE-2026-82078 and CVE-2026-81578 abuses unsafe dynamic class loading and an authentication bypass to achieve
pre-authenticated remote code execution under pc-app.exe. Similar suspicious shell spawning has also been observed from
PaperCut Hive's pc-printjob-spooler.exe (for example cmd.exe executing echo/test-style commands). Observed NG/MF
in-the-wild activity includes discovery utilities such as whoami and tasklist; proof-of-concept exploitation has spawned
unexpected Windows utilities such as charmap.exe as SYSTEM.
"""
from = "now-9m"
index = [
    "logs-endpoint.events.process-*",
    "winlogbeat-*",
    "logs-windows.sysmon_operational-*",
    "logs-windows.forwarded*",
    "logs-system.security*",
    "endgame-*",
    "logs-m365_defender.event-*",
    "logs-sentinel_one_cloud_funnel.*",
    "logs-crowdstrike.fdr*",
]
language = "eql"
license = "Elastic License v2"
name = "Suspicious Child Process of PaperCut Server Component"
note = """## Triage and analysis

### Investigating Suspicious Child Process of PaperCut Server Component

PaperCut NG/MF Application Server (`pc-app.exe`) and PaperCut Hive components such as `pc-printjob-spooler.exe` should
not routinely spawn interactive shells, download utilities, or discovery tools. CVE-2026-81578 (authentication bypass)
chained with CVE-2026-82078 (unsafe dynamic class loading) enables pre-authentication remote code execution under
`pc-app.exe`. Huntress observed short exploitation windows with base64-encoded commands such as `whoami & ver` and
`whoami & ver & tasklist`, and reproduced RCE that spawned `charmap.exe` as SYSTEM under `pc-app.exe`. Separate telemetry
has also shown `pc-printjob-spooler.exe` under `Program Files\\PaperCut Hive\\` launching `cmd.exe` with attacker- or
test-controlled command lines.

#### Possible investigation steps

- Review the parent-child chain: `process.parent.name`/`process.parent.executable` (for example `pc-app.exe` or
  `pc-printjob-spooler.exe` under `PaperCut*` install paths); inspect child `process.name`, `process.executable`, and
  `process.command_line` for shells, LOLBins, discovery tools, or trivial probing commands such as `echo test`.
- Confirm PaperCut product (NG/MF vs Hive), version, and internet exposure of management or print-related services.
  Unpatched or publicly reachable servers are high priority.
- For NG/MF parents, search the same `host.id` for `.class` file creation under `server\\lib` (for example `Udydn.class`,
  `Moo97.class`) and related artifacts under `server\\data\\content` (`*.cmd`, `*.out`).
- Inspect PaperCut logs for hex-encoded payloads, base64 command strings, Derby boot messages referencing
  `memory:...\\pwn`, `jdbc:derby:memory:pwn`, `ERROR No suitable driver found for jdbc:no:x`, or truncated/deleted logs.
- Correlate with inbound web or print-service requests around `@timestamp` (proxy, WAF, firewall).
- Pivot on `user.id` and `host.id` for follow-on credential access, persistence, or lateral movement within 48 hours.

### False positive analysis

- PaperCut upgrades, support tooling, or rare admin scripts might spawn expected helpers. Validate change windows,
  signed binaries, and command lines before exceptioning.
- Do not exclude on `pc-app.exe` or `pc-printjob-spooler.exe` alone; require a stable benign child path and command pattern.

### Response and remediation

- Isolate or restrict network access to the implicated PaperCut service immediately if public-facing.
- Preserve PaperCut logs, configuration, process trees from the parent binary, and any `.class`/`.cmd`/`.out` artifacts
  before upgrade or reboot.
- Apply PaperCut Emergency Patch Release 2 (or newer fixed builds) for NG/MF, including site/secondary servers; validate
  Hive component versions and vendor guidance for Hive-specific hosts.
- Hunt estate-wide for the same child-process and `.class` drop patterns; rotate credentials if compromise is confirmed.
"""

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:

- [Sysmon Event ID 1 - Process Creation](https://ela.st/sysmon-event-1-setup)
- [Windows Process Creation Logs](https://ela.st/audit-process-creation)
- [Microsoft Defender XDR](https://ela.st/m365-defender)
- [SentinelOne Cloud Funnel](https://ela.st/sentinel-one-cloud-funnel)
- [CrowdStrike](https://ela.st/crowdstrike-integration)
"""

references = [
    "https://www.papercut.com/kb/Main/security-bulletin-27-aug-2026-urgent-security-advisory/",
    "https://www.huntress.com/blog/papercut-actively-exploited",
]
risk_score = 73
rule_id = "1d0cf8ae-ed2c-4c74-bc01-462cfd928b64"
severity = "high"
tags = [
    "Domain: Endpoint",
    "OS: Windows",
    "Use Case: Threat Detection",
    "Use Case: Vulnerability",
    "Tactic: Initial Access",
    "Tactic: Execution",
    "Data Source: Elastic Defend",
    "Data Source: Elastic Endgame",
    "Data Source: Sysmon",
    "Data Source: Windows Security Event Logs",
    "Data Source: Microsoft Defender XDR",
    "Data Source: SentinelOne",
    "Data Source: Crowdstrike",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"

query = '''
process where host.os.type == "windows" and event.type == "start" and
  process.parent.name : ("pc-app.exe", "pc-printjob-spooler.exe") and
  (
    process.name : (
      "cmd.exe",
      "powershell.exe",
      "pwsh.exe",
      "powershell_ise.exe",
      "wscript.exe",
      "cscript.exe",
      "mshta.exe",
      "rundll32.exe",
      "regsvr32.exe",
      "bitsadmin.exe",
      "certutil.exe",
      "curl.exe",
      "wget.exe",
      "net.exe",
      "net1.exe",
      "whoami.exe",
      "tasklist.exe",
      "ipconfig.exe",
      "nltest.exe",
      "systeminfo.exe",
      "charmap.exe",
      "calc.exe",
      "mspaint.exe"
    ) or
    ?process.pe.original_file_name : (
      "Cmd.Exe",
      "PowerShell.EXE",
      "pwsh.dll",
      "powershell_ise.EXE",
      "wscript.exe",
      "cscript.exe",
      "MSHTA.EXE",
      "RUNDLL32.EXE",
      "REGSVR32.EXE",
      "bitsadmin.exe",
      "CertUtil.exe",
      "curl.exe",
      "wget.exe",
      "net.exe",
      "net1.exe",
      "whoami.exe",
      "tasklist.exe",
      "ipconfig.exe",
      "nltest.exe",
      "systeminfo.exe",
      "charmap.exe",
      "CALC.EXE",
      "mspaint.exe"
    )
  )
'''

[rule.investigation_fields]
field_names = [
    "@timestamp",
    "host.id",
    "host.name",
    "user.id",
    "user.name",
    "process.entity_id",
    "process.pid",
    "process.name",
    "process.executable",
    "process.command_line",
    "process.pe.original_file_name",
    "process.parent.name",
    "process.parent.executable",
    "process.parent.command_line",
]

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

[[rule.threat.technique]]
id = "T1190"
name = "Exploit Public-Facing Application"
reference = "https://attack.mitre.org/techniques/T1190/"

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

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

[[rule.threat.technique.subtechnique]]
id = "T1059.003"
name = "Windows Command Shell"
reference = "https://attack.mitre.org/techniques/T1059/003/"

[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 == "windows" and event.type == "start" and
  process.parent.name : ("pc-app.exe", "pc-printjob-spooler.exe") and
  (
    process.name : (
      "cmd.exe",
      "powershell.exe",
      "pwsh.exe",
      "powershell_ise.exe",
      "wscript.exe",
      "cscript.exe",
      "mshta.exe",
      "rundll32.exe",
      "regsvr32.exe",
      "bitsadmin.exe",
      "certutil.exe",
      "curl.exe",
      "wget.exe",
      "net.exe",
      "net1.exe",
      "whoami.exe",
      "tasklist.exe",
      "ipconfig.exe",
      "nltest.exe",
      "systeminfo.exe",
      "charmap.exe",
      "calc.exe",
      "mspaint.exe"
    ) or
    ?process.pe.original_file_name : (
      "Cmd.Exe",
      "PowerShell.EXE",
      "pwsh.dll",
      "powershell_ise.EXE",
      "wscript.exe",
      "cscript.exe",
      "MSHTA.EXE",
      "RUNDLL32.EXE",
      "REGSVR32.EXE",
      "bitsadmin.exe",
      "CertUtil.exe",
      "curl.exe",
      "wget.exe",
      "net.exe",
      "net1.exe",
      "whoami.exe",
      "tasklist.exe",
      "ipconfig.exe",
      "nltest.exe",
      "systeminfo.exe",
      "charmap.exe",
      "CALC.EXE",
      "mspaint.exe"
    )
  )

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.typeeq
  • start corpus 1036 (elastic 1036)
field:"event.type" kind:eq value:"start"
process.namewildcard
  • bitsadmin.exe corpus 25 (elastic 22, splunk 2, kusto 1)
  • calc.exe corpus 2 (elastic 2)
  • certutil.exe corpus 45 (elastic 39, splunk 6)
  • charmap.exe corpus 2 (elastic 2)
  • cmd.exe corpus 122 (elastic 93, splunk 29)
  • cscript.exe corpus 68 (elastic 66, splunk 2)
  • curl.exe corpus 34 (elastic 32, splunk 2)
  • ipconfig.exe corpus 11 (elastic 10, splunk 1)
  • mshta.exe corpus 84 (elastic 80, splunk 4)
  • mspaint.exe corpus 2 (elastic 2)
  • net.exe corpus 30 (elastic 27, splunk 2, kusto 1)
  • net1.exe corpus 40 (elastic 21, splunk 19)
  • nltest.exe corpus 12 (elastic 10, splunk 2)
  • powershell.exe corpus 187 (elastic 140, splunk 44, kusto 3)
  • powershell_ise.exe corpus 53 (splunk 29, elastic 24)
  • pwsh.exe corpus 78 (elastic 49, splunk 29)
  • regsvr32.exe corpus 74 (elastic 69, splunk 5)
  • rundll32.exe corpus 123 (elastic 100, splunk 23)
  • systeminfo.exe corpus 10 (elastic 10)
  • tasklist.exe corpus 11 (elastic 11)
  • wget.exe corpus 7 (elastic 7)
  • whoami.exe corpus 14 (elastic 11, splunk 2, kusto 1)
  • wscript.exe corpus 84 (elastic 82, splunk 1, kusto 1)
field:"process_basename" kind:wildcard
process.parent.namewildcard
  • pc-app.exe corpus 2 (elastic 1, splunk 1)
  • pc-printjob-spooler.exe
field:"parent_process_basename" kind:wildcard
process.pe.original_file_namewildcard
  • CALC.EXE corpus 3 (elastic 2, sigma 1)
  • CertUtil.exe corpus 26 (sigma 14, elastic 6, splunk 6)
  • Cmd.Exe corpus 75 (sigma 43, splunk 17, elastic 15)
  • MSHTA.EXE corpus 40 (elastic 21, sigma 13, splunk 6)
  • PowerShell.EXE corpus 134 (sigma 86, splunk 30, elastic 18)
  • REGSVR32.EXE corpus 37 (sigma 17, elastic 15, splunk 5)
  • RUNDLL32.EXE corpus 72 (sigma 35, splunk 21, elastic 16)
  • bitsadmin.exe corpus 19 (sigma 9, elastic 8, splunk 2)
  • charmap.exe
  • cscript.exe corpus 32 (sigma 17, elastic 15)
  • curl.exe corpus 22 (sigma 13, elastic 6, splunk 3)
  • ipconfig.exe corpus 3 (sigma 1, elastic 1, splunk 1)
  • mspaint.exe
  • net.exe corpus 25 (sigma 19, elastic 4, splunk 2)
  • net1.exe corpus 39 (sigma 19, splunk 19, elastic 1)
  • nltest.exe
  • powershell_ise.EXE corpus 52 (splunk 30, sigma 18, elastic 4)
  • pwsh.dll corpus 115 (sigma 81, splunk 30, elastic 4)
  • systeminfo.exe
  • tasklist.exe corpus 4 (sigma 3, elastic 1)
  • wget.exe corpus 4 (sigma 3, elastic 1)
  • whoami.exe corpus 11 (sigma 9, elastic 1, splunk 1)
  • wscript.exe corpus 37 (elastic 20, sigma 17)
field:"OriginalFileName" kind:wildcard

Suspicious Execution via ShellBrowserWindow/ShellWindow COM

#
Time window
5s
Sequence by
user.id
Source
github.com/elastic/protections-artifacts

Identifies suspicious access to the ShellBrowserWindow or ShellWindow COM objects by a Microsoft Office process followed by the execution of commonly abused signed proxy binary. This may indicate an attempt to avoid triggering a suspicious process tree using malicious phishing documents.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
Identifies suspicious access to the ShellBrowserWindow or ShellWindow COM objects by a Microsoft Office process followed
by the execution of commonly abused signed proxy binary. This may indicate an attempt to avoid triggering a suspicious
process tree using malicious phishing documents.
"""
id = "cbbb130f-d9d3-459d-a796-c61ee27f9f70"
license = "Elastic License v2"
name = "Suspicious Execution via ShellBrowserWindow/ShellWindow COM"
os_list = ["windows"]
reference = ["https://blog.f-secure.com/dechaining-macros-and-evading-edr/"]
version = "1.0.30"

query = '''
sequence by user.id with maxspan=5s
  [registry where event.action == "query" and
    process.name : ("WINWORD.EXE", "EXCEL.EXE", "POWERPNT.EXE", "MSACCESS.EXE", "wscript.exe", "mshta.exe", "cscript.exe", "hh.exe") and
    /* COM - ShellWindows and ShellBrowserWindows can be used to exec a
     process via Explorer and avoid susp process tree */
    registry.key :
      (
      "SOFTWARE\\Classes\\CLSID\\{9BA05972-F6A8-11CF-A442-00A0C90A8F39}*",
      "SOFTWARE\\Classes\\CLSID\\{c08afd90-f2a1-11d1-8455-00a0c91f3880}*")]
   [process where event.action == "start" and
     process.args_count >= 2 and
     (process.parent.executable : "?:\\Windows\\explorer.exe" and process.parent.args_count == 1) and
     /* for now limited to common lolbas + combined to maxspan set to 5s to avoid any unexpected high peak in FPs*/
     process.name :
              ("rundll32.exe",
               "powershell.exe",
               "mshta.exe",
               "msbuild.exe",
               "certutil.exe",
               "regsvr32.exe",
               "cscript.exe",
               "wscript.exe",
               "wmic.exe",
               "msxsl.exe",
               "Microsoft.Workflow.Compiler.exe",
               "ieexec.exe",
               "iexpress.exe",
               "installutil.exe",
               "RegSvcs.exe",
               "RegAsm.exe",
               "AddInProcess.exe") and

     not (process.name : "wscript.exe" and process.args :  "\\\\DC\\netlogon\\*.vbs") and
     not (process.name : "rundll32.exe" and process.command_line : "C:\\Windows\\system32\\Rundll32.exe Prnntfy.dll,AsyncUILoaderEntry Local*")]
'''

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

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

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1566"
name = "Phishing"
reference = "https://attack.mitre.org/techniques/T1566/"
[[threat.technique.subtechnique]]
id = "T1566.001"
name = "Spearphishing Attachment"
reference = "https://attack.mitre.org/techniques/T1566/001/"



[threat.tactic]
id = "TA0001"
name = "Initial Access"
reference = "https://attack.mitre.org/tactics/TA0001/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1059"
name = "Command and Scripting Interpreter"
reference = "https://attack.mitre.org/techniques/T1059/"
[[threat.technique.subtechnique]]
id = "T1059.001"
name = "PowerShell"
reference = "https://attack.mitre.org/techniques/T1059/001/"

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



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

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

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



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

[internal]
min_endpoint_version = "7.15.0"

Stages and Predicates

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

Stage 1: registry

[registry where event.action == "query" and
    process.name : ("WINWORD.EXE", "EXCEL.EXE", "POWERPNT.EXE", "MSACCESS.EXE", "wscript.exe", "mshta.exe", "cscript.exe", "hh.exe") and
    /* COM - ShellWindows and ShellBrowserWindows can be used to exec a
     process via Explorer and avoid susp process tree */
    registry.key :
      (
      "SOFTWARE\\Classes\\CLSID\\{9BA05972-F6A8-11CF-A442-00A0C90A8F39}*",
      "SOFTWARE\\Classes\\CLSID\\{c08afd90-f2a1-11d1-8455-00a0c91f3880}*")]

Stage 2: process

[process where event.action == "start" and
     process.args_count >= 2 and
     (process.parent.executable : "?:\\Windows\\explorer.exe" and process.parent.args_count == 1) and
     process.name :
              ("rundll32.exe",
               "powershell.exe",
               "mshta.exe",
               "msbuild.exe",
               "certutil.exe",
               "regsvr32.exe",
               "cscript.exe",
               "wscript.exe",
               "wmic.exe",
               "msxsl.exe",
               "Microsoft.Workflow.Compiler.exe",
               "ieexec.exe",
               "iexpress.exe",
               "installutil.exe",
               "RegSvcs.exe",
               "RegAsm.exe",
               "AddInProcess.exe") and
     not (process.name : "wscript.exe" and process.args :  "\\\\DC\\netlogon\\*.vbs") and
     not (process.name : "rundll32.exe" and process.command_line : "C:\\Windows\\system32\\Rundll32.exe Prnntfy.dll,AsyncUILoaderEntry Local*")]

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • query corpus 6 (elastic 6)
  • start corpus 388 (elastic 388)
field:"EventType" kind:eq
process.args_countge
  • 2 transforms: number corpus 18 (elastic 18)
field:"process.args_count" kind:ge value:"2"
process.namewildcard
  • AddInProcess.exe corpus 4 (elastic 4)
  • EXCEL.EXE corpus 34 (elastic 34)
  • MSACCESS.EXE corpus 19 (elastic 19)
  • Microsoft.Workflow.Compiler.exe corpus 12 (elastic 11, splunk 1)
  • POWERPNT.EXE corpus 31 (elastic 31)
  • RegAsm.exe corpus 25 (elastic 24, splunk 1)
  • RegSvcs.exe corpus 22 (elastic 21, splunk 1)
  • WINWORD.EXE corpus 35 (elastic 35)
  • certutil.exe corpus 45 (elastic 39, splunk 6)
  • cscript.exe corpus 68 (elastic 66, splunk 2)
  • hh.exe corpus 8 (elastic 5, splunk 3)
  • ieexec.exe corpus 10 (elastic 10)
  • iexpress.exe corpus 9 (elastic 9)
  • installutil.exe corpus 36 (elastic 32, splunk 4)
  • msbuild.exe corpus 39 (elastic 36, splunk 3)
  • mshta.exe corpus 84 (elastic 80, splunk 4)
  • msxsl.exe corpus 22 (elastic 22)
  • powershell.exe corpus 187 (elastic 140, splunk 44, kusto 3)
  • regsvr32.exe corpus 74 (elastic 69, splunk 5)
  • rundll32.exe corpus 123 (elastic 100, splunk 23)
  • wmic.exe corpus 66 (elastic 39, splunk 27)
  • wscript.exe corpus 84 (elastic 82, splunk 1, kusto 1)
field:"process_basename" kind:wildcard
process.parent.args_counteq
  • 1 transforms: number corpus 5 (elastic 5)
field:"process.parent.args_count" kind:eq value:"1"
process.parent.executablewildcard
  • ?:\Windows\explorer.exe corpus 5 (elastic 5)
field:"ParentImage" kind:wildcard value:"?:\Windows\explorer.exe"
registry.keywildcard
  • SOFTWARE\Classes\CLSID\{9BA05972-F6A8-11CF-A442-00A0C90A8F39}*
  • SOFTWARE\Classes\CLSID\{c08afd90-f2a1-11d1-8455-00a0c91f3880}*
field:"TargetObject" kind:wildcard

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.argswildcard\\DC\netlogon\*.vbsexcludes:process.args field:"process.args" value:"\\DC\netlogon\*.vbs"
process.nameeqwscript.exeexcludes:process.name field:"process.name" value:"wscript.exe"
process.command_linestarts_withC:\Windows\system32\Rundll32.exe Prnntfy.dll,AsyncUILoaderEntry Localexcludes:process.command_line field:"process.command_line" value:"C:\Windows\system32\Rundll32.exe Prnntfy.dll,AsyncUILoaderEntry Local"
process.nameeqrundll32.exeexcludes:process.name field:"process.name" value:"rundll32.exe"

Suspicious Interactive Shell Execution

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

Detects the suspicious use of the -i shell option indicating an interactive session via an abnormal parent process. Threat actors have been observed using this technique to gain interactive command line access via their payloads in order to maintain access and conduct post-exploitation actions on the objective.

MITRE ATT&CK Coverage

Telemetry Coverage

Rule Body

[rule]
description = """
Detects the suspicious use of the -i shell option indicating an interactive session via an abnormal parent process.
Threat actors have been observed using this technique to gain interactive command line access via their payloads in
order to maintain access and conduct post-exploitation actions on the objective.
"""
id = "71c3d317-7c92-4bd7-bbb1-b6ff62f94ebe"
license = "Elastic License v2"
name = "Suspicious Interactive Shell Execution"
os_list = ["macos"]
version = "1.0.10"

query = '''
sequence with maxspan=30s
[network where event.type == "start" and event.action == "connection_attempted" and 
  process.name like~ (".*", "osascript", "ruby*", "python*")] by process.entity_id
[process where event.type == "start" and event.action == "exec" and 
  (process.name in ("bash", "sh", "zsh", "dash", "csh", "tcsh", "ksh", "tclsh", "fish") or process.name like "tclsh*") and
  (process.args in ("/bin/bash", "/usr/bin/bash", "/bin/sh", "/usr/bin/sh", "/bin/zsh", "/usr/bin/zsh", "/bin/dash", "/usr/bin/dash", "/bin/csh", "/usr/bin/csh", "/bin/tcsh", "/usr/bin/tcsh", "/bin/ksh", "/usr/bin/ksh", "/bin/tclsh", "/usr/bin/tclsh", "/bin/fish", "/usr/bin/fish", "/usr/local/bin/fish", "/opt/homebrew/bin/fish") or process.args like "*/bin/tclsh*") and
  process.args == "-i" and process.args_count == 2 and
  process.parent.name like~ (".*", "osascript", "ruby*", "python*")] by process.parent.entity_id
'''

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

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

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1059"
name = "Command and Scripting Interpreter"
reference = "https://attack.mitre.org/techniques/T1059/"
[[threat.technique.subtechnique]]
id = "T1059.004"
name = "Unix Shell"
reference = "https://attack.mitre.org/techniques/T1059/004/"



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

[internal]
min_endpoint_version = "8.16.0"

Stages and Predicates

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

Stage 1: network

[network where event.type == "start" and event.action == "connection_attempted" and 
  process.name like~ (".*", "osascript", "ruby*", "python*")] by process.entity_id

Stage 2: process

[process where event.type == "start" and event.action == "exec" and 
  (process.name in ("bash", "sh", "zsh", "dash", "csh", "tcsh", "ksh", "tclsh", "fish") or process.name like "tclsh*") and
  (process.args in ("/bin/bash", "/usr/bin/bash", "/bin/sh", "/usr/bin/sh", "/bin/zsh", "/usr/bin/zsh", "/bin/dash", "/usr/bin/dash", "/bin/csh", "/usr/bin/csh", "/bin/tcsh", "/usr/bin/tcsh", "/bin/ksh", "/usr/bin/ksh", "/bin/tclsh", "/usr/bin/tclsh", "/bin/fish", "/usr/bin/fish", "/usr/local/bin/fish", "/opt/homebrew/bin/fish") or process.args like "*/bin/tclsh*") and
  process.args == "-i" and process.args_count == 2 and
  process.parent.name like~ (".*", "osascript", "ruby*", "python*")] by process.parent.entity_id

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • connection_attempted corpus 72 (elastic 72)
  • exec corpus 547 (elastic 547)
field:"EventType" kind:eq
event.typeeq
  • start corpus 1036 (elastic 1036)
field:"event.type" kind:eq value:"start"
process.argseq
  • -i corpus 6 (elastic 6)
field:"process.args" kind:eq value:"-i"
process.argsin
  • /bin/bash corpus 10 (elastic 10)
  • /bin/csh corpus 5 (elastic 5)
  • /bin/dash corpus 9 (elastic 9)
  • /bin/fish corpus 6 (elastic 6)
  • /bin/ksh corpus 6 (elastic 6)
  • /bin/sh corpus 10 (elastic 10)
  • /bin/tclsh
  • /bin/tcsh corpus 5 (elastic 5)
  • /bin/zsh corpus 10 (elastic 10)
  • /opt/homebrew/bin/fish
  • /usr/bin/bash corpus 10 (elastic 10)
  • /usr/bin/csh corpus 5 (elastic 5)
  • /usr/bin/dash corpus 9 (elastic 9)
  • /usr/bin/fish corpus 6 (elastic 6)
  • /usr/bin/ksh corpus 6 (elastic 6)
  • /usr/bin/sh corpus 10 (elastic 10)
  • /usr/bin/tclsh
  • /usr/bin/tcsh corpus 5 (elastic 5)
  • /usr/bin/zsh corpus 10 (elastic 10)
  • /usr/local/bin/fish corpus 4 (elastic 4)
field:"process.args" kind:in
process.argswildcard
  • */bin/tclsh*
field:"process.args" kind:wildcard value:"*/bin/tclsh*"
process.args_counteq
  • 2 transforms: number corpus 35 (elastic 35)
field:"process.args_count" kind:eq value:"2"
process.namein
  • bash corpus 181 (elastic 181)
  • csh corpus 148 (elastic 148)
  • dash corpus 150 (elastic 150)
  • fish corpus 151 (elastic 151)
  • ksh corpus 149 (elastic 149)
  • sh corpus 180 (elastic 180)
  • tclsh corpus 28 (elastic 28)
  • tcsh corpus 145 (elastic 145)
  • zsh corpus 180 (elastic 180)
field:"process_basename" kind:in
process.namewildcard
  • .* corpus 8 (elastic 8)
  • osascript corpus 31 (elastic 31)
  • python* corpus 51 (elastic 51)
  • ruby* corpus 19 (elastic 19)
  • tclsh* corpus 23 (elastic 23)
field:"process_basename" kind:wildcard
process.parent.namewildcard
  • .* corpus 7 (elastic 7)
  • osascript corpus 12 (elastic 12)
  • python* corpus 20 (elastic 20)
  • ruby* corpus 3 (elastic 3)
field:"parent_process_basename" kind:wildcard

Suspicious ScreenConnect Client Child Process

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

Identifies suspicious processes being spawned by the ScreenConnect client processes. This activity may indicate execution abusing unauthorized access to the ScreenConnect remote access software.

MITRE ATT&CK Coverage

Telemetry Coverage

Rule Body

[metadata]
creation_date = "2024/03/27"
integration = ["endpoint", "windows", "sentinel_one_cloud_funnel", "m365_defender", "system", "crowdstrike"]
maturity = "production"
updated_date = "2026/07/02"

[rule]
author = ["Elastic"]
description = """
Identifies suspicious processes being spawned by the ScreenConnect client processes. This activity may indicate
execution abusing unauthorized access to the ScreenConnect remote access software.
"""
from = "now-9m"
index = [
    "endgame-*",
    "logs-crowdstrike.fdr*",
    "logs-endpoint.events.process-*",
    "logs-m365_defender.event-*",
    "logs-sentinel_one_cloud_funnel.*",
    "logs-system.security*",
    "logs-windows.sysmon_operational-*",
    "winlogbeat-*",
]
language = "eql"
license = "Elastic License v2"
name = "Suspicious ScreenConnect Client Child Process"
note = """## Triage and analysis

> **Disclaimer**:
> This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.

### Investigating Suspicious ScreenConnect Client Child Process

ScreenConnect, a remote access tool, facilitates legitimate remote support but can be exploited by adversaries to execute unauthorized commands. Malicious actors may spawn processes like PowerShell or cmd.exe via ScreenConnect to perform harmful activities. The detection rule identifies such suspicious child processes, focusing on unusual arguments and process names, indicating potential abuse of remote access capabilities.

### Possible investigation steps

- Review the parent process name to confirm it is one of the ScreenConnect client processes listed in the query, such as ScreenConnect.ClientService.exe or ScreenConnect.WindowsClient.exe, to verify the source of the suspicious activity.
- Examine the child process name and arguments, such as powershell.exe with encoded commands or cmd.exe with /c, to identify potentially malicious actions or commands being executed.
- Check the network activity associated with the suspicious process, especially if the process arguments include network-related terms like *http* or *downloadstring*, to determine if there is any unauthorized data exfiltration or command and control communication.
- Investigate the user account under which the suspicious process was executed to assess if the account has been compromised or is being misused.
- Correlate the event with other security alerts or logs from data sources like Elastic Defend or Microsoft Defender XDR to gather additional context and identify any related malicious activities.
- Review the system's recent activity and changes, such as new scheduled tasks or services created by schtasks.exe or sc.exe, to identify any persistence mechanisms that may have been established by the attacker.

### False positive analysis

- Legitimate IT support activities using ScreenConnect may trigger the rule when executing scripts or commands for maintenance. To manage this, identify and whitelist specific IT support accounts or IP addresses that regularly perform these actions.
- Automated scripts or scheduled tasks that use ScreenConnect for routine operations might be flagged. Review and document these scripts, then create exceptions for known benign processes and arguments.
- Software updates or installations initiated through ScreenConnect can appear suspicious. Maintain a list of approved software and update processes, and exclude these from the rule.
- Internal security tools or monitoring solutions that leverage ScreenConnect for legitimate purposes may be detected. Verify these tools and add them to an exclusion list to prevent false positives.
- Training sessions or demonstrations using ScreenConnect to showcase command-line tools could be misinterpreted as threats. Ensure these sessions are logged and recognized as non-threatening, and adjust the rule to accommodate these scenarios.

### Response and remediation

- Immediately isolate the affected system from the network to prevent further unauthorized access or lateral movement by the attacker.
- Terminate any suspicious processes identified in the alert, such as PowerShell, cmd.exe, or other flagged executables, to halt any ongoing malicious activity.
- Review and revoke any unauthorized user accounts or privileges that may have been created or modified using tools like net.exe or schtasks.exe.
- Conduct a thorough scan of the affected system using endpoint protection tools to identify and remove any malware or unauthorized software installed by the attacker.
- Restore the system from a known good backup if any critical system files or configurations have been altered or compromised.
- Escalate the incident to the security operations center (SOC) or incident response team for further investigation and to determine if additional systems are affected.
- Implement enhanced monitoring and logging for ScreenConnect and other remote access tools to detect similar activities in the future, ensuring that alerts are promptly reviewed and acted upon."""
references = [
    "https://www.huntress.com/blog/slashandgrab-screen-connect-post-exploitation-in-the-wild-cve-2024-1709-cve-2024-1708",
]
risk_score = 47
rule_id = "78de1aeb-5225-4067-b8cc-f4a1de8a8546"
severity = "medium"
tags = [
    "Domain: Endpoint",
    "OS: Windows",
    "Use Case: Threat Detection",
    "Tactic: Command and Control",
    "Resources: Investigation Guide",
    "Data Source: Elastic Endgame",
    "Data Source: Elastic Defend",
    "Data Source: Sysmon",
    "Data Source: SentinelOne",
    "Data Source: Microsoft Defender XDR",
    "Data Source: Windows Security Event Logs",
    "Data Source: Crowdstrike",
]
timestamp_override = "event.ingested"
type = "eql"

query = '''
process where host.os.type == "windows" and event.type == "start" and
  process.parent.name :
                ("ScreenConnect.ClientService.exe",
                 "ScreenConnect.WindowsClient.exe",
                 "ScreenConnect.WindowsBackstageShell.exe",
                 "ScreenConnect.WindowsFileManager.exe") and
  (
   (process.name : "powershell.exe" and
    process.args : ("-enc", "-ec", "-e", "*downloadstring*", "*Reflection.Assembly*", "*http*")) or
   (process.name : "cmd.exe" and process.args : "/c") or
   (process.name : "net.exe" and process.args : "/add") or
   (process.name : "schtasks.exe" and process.args : ("/create", "-create")) or
   (process.name : "sc.exe" and process.args : "create") or
   (process.name : "rundll32.exe" and not process.args : "url.dll,FileProtocolHandler") or
   (process.name : "msiexec.exe" and process.args : ("/i", "-i") and
    process.args : ("/q", "/quiet", "/qn", "-q", "-quiet", "-qn", "-Q+")) or
   process.name : ("mshta.exe", "certutil.exe", "bitsadmin.exe", "certreq.exe", "wscript.exe", "cscript.exe", "curl.exe",
                   "ssh.exe", "scp.exe", "wevtutil.exe", "wget.exe", "wmic.exe")
   )
'''

setup = """## Setup

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

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

### Additional data sources

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

- [CrowdStrike](https://ela.st/crowdstrike-integration)
- [Microsoft Defender XDR](https://ela.st/m365-defender)
- [SentinelOne Cloud Funnel](https://ela.st/sentinel-one-cloud-funnel)
- [Sysmon Event ID 1 - Process Creation](https://ela.st/sysmon-event-1-setup)
- [Windows Process Creation Logs](https://ela.st/audit-process-creation)
"""


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

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

[[rule.threat.technique]]
id = "T1219"
name = "Remote Access Tools"
reference = "https://attack.mitre.org/techniques/T1219/"

[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 = "T1218"
name = "System Binary Proxy Execution"
reference = "https://attack.mitre.org/techniques/T1218/"

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

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

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

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

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

[[rule.threat.technique]]
id = "T1047"
name = "Windows Management Instrumentation"
reference = "https://attack.mitre.org/techniques/T1047/"

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

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

[[rule.threat.technique.subtechnique]]
id = "T1059.003"
name = "Windows Command Shell"
reference = "https://attack.mitre.org/techniques/T1059/003/"

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

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

[[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.technique]]
id = "T1543"
name = "Create or Modify System Process"
reference = "https://attack.mitre.org/techniques/T1543/"

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

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

Stages and Predicates

Stage 1: process

process where host.os.type == "windows" and event.type == "start" and
  process.parent.name :
                ("ScreenConnect.ClientService.exe",
                 "ScreenConnect.WindowsClient.exe",
                 "ScreenConnect.WindowsBackstageShell.exe",
                 "ScreenConnect.WindowsFileManager.exe") and
  (
   (process.name : "powershell.exe" and
    process.args : ("-enc", "-ec", "-e", "*downloadstring*", "*Reflection.Assembly*", "*http*")) or
   (process.name : "cmd.exe" and process.args : "/c") or
   (process.name : "net.exe" and process.args : "/add") or
   (process.name : "schtasks.exe" and process.args : ("/create", "-create")) or
   (process.name : "sc.exe" and process.args : "create") or
   (process.name : "rundll32.exe" and not process.args : "url.dll,FileProtocolHandler") or
   (process.name : "msiexec.exe" and process.args : ("/i", "-i") and
    process.args : ("/q", "/quiet", "/qn", "-q", "-quiet", "-qn", "-Q+")) or
   process.name : ("mshta.exe", "certutil.exe", "bitsadmin.exe", "certreq.exe", "wscript.exe", "cscript.exe", "curl.exe",
                   "ssh.exe", "scp.exe", "wevtutil.exe", "wget.exe", "wmic.exe")
   )

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.typeeq
  • start corpus 1036 (elastic 1036)
field:"event.type" kind:eq value:"start"
process.argswildcard
  • *Reflection.Assembly* corpus 3 (elastic 3)
  • *downloadstring* corpus 3 (elastic 3)
  • *http* corpus 2 (elastic 2)
  • -Q+ corpus 2 (elastic 2)
  • -create corpus 6 (elastic 6)
  • -e corpus 5 (elastic 5)
  • -ec corpus 3 (elastic 3)
  • -enc corpus 4 (elastic 4)
  • -i corpus 8 (elastic 8)
  • -q corpus 4 (elastic 4)
  • -qn corpus 4 (elastic 4)
  • -quiet corpus 2 (elastic 2)
  • /add corpus 2 (elastic 2)
  • /c corpus 7 (elastic 7)
  • /create corpus 7 (elastic 7)
  • /i corpus 4 (elastic 4)
  • /q corpus 7 (elastic 7)
  • /qn corpus 4 (elastic 4)
  • /quiet corpus 5 (elastic 5)
  • create corpus 5 (elastic 5)
field:"process.args" kind:wildcard
process.namewildcard
  • bitsadmin.exe corpus 25 (elastic 22, splunk 2, kusto 1)
  • certreq.exe corpus 20 (elastic 20)
  • certutil.exe corpus 45 (elastic 39, splunk 6)
  • cmd.exe corpus 122 (elastic 93, splunk 29)
  • cscript.exe corpus 68 (elastic 66, splunk 2)
  • curl.exe corpus 34 (elastic 32, splunk 2)
  • mshta.exe corpus 84 (elastic 80, splunk 4)
  • msiexec.exe corpus 45 (elastic 40, splunk 5)
  • net.exe corpus 30 (elastic 27, splunk 2, kusto 1)
  • powershell.exe corpus 187 (elastic 140, splunk 44, kusto 3)
  • rundll32.exe corpus 123 (elastic 100, splunk 23)
  • sc.exe corpus 32 (elastic 17, splunk 15)
  • schtasks.exe corpus 30 (elastic 19, splunk 11)
  • scp.exe corpus 5 (elastic 5)
  • ssh.exe corpus 8 (elastic 8)
  • wevtutil.exe corpus 10 (elastic 6, splunk 4)
  • wget.exe corpus 7 (elastic 7)
  • wmic.exe corpus 66 (elastic 39, splunk 27)
  • wscript.exe corpus 84 (elastic 82, splunk 1, kusto 1)
field:"process_basename" kind:wildcard
process.parent.namewildcard
  • ScreenConnect.ClientService.exe
  • ScreenConnect.WindowsBackstageShell.exe
  • ScreenConnect.WindowsClient.exe
  • ScreenConnect.WindowsFileManager.exe
field:"parent_process_basename" kind:wildcard

System Public IP Discovery via DNS Query

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

Identifies DNS queries to known public IP address lookup web services from suspicious Windows processes, which can reveal external IP or internet-connectivity discovery before follow-on activity.

MITRE ATT&CK Coverage

Telemetry Coverage

ProviderRecord / event type
SysmonEvent ID 3: Network connection

Rule Body

[metadata]
creation_date = "2025/08/20"
integration = ["endpoint", "windows", "sentinel_one_cloud_funnel", "crowdstrike"]
maturity = "production"
updated_date = "2026/07/28"

[rule]
author = ["Elastic"]
description = """
Identifies DNS queries to known public IP address lookup web services from suspicious Windows processes, which
can reveal external IP or internet-connectivity discovery before follow-on activity.
"""
from = "now-9m"
index = [
    "endgame-*",
    "logs-endpoint.events.network-*",
    "logs-sentinel_one_cloud_funnel.*",
    "logs-crowdstrike.fdr*",
    "logs-windows.forwarded*",
    "logs-windows.sysmon_operational-*",
    "winlogbeat-*"
]
language = "eql"
license = "Elastic License v2"
name = "System Public IP Discovery via DNS Query"
references = ["https://attack.mitre.org/techniques/T1016/"]
risk_score = 73
rule_id = "642ce354-4252-4d43-80c9-6603f16571c1"
severity = "high"
tags = [
    "Domain: Endpoint",
    "OS: Windows",
    "Use Case: Threat Detection",
    "Tactic: Discovery",
    "Tactic: Command and Control",
    "Resources: Investigation Guide",
    "Data Source: Elastic Endgame",
    "Data Source: Elastic Defend",
    "Data Source: SentinelOne",
    "Data Source: Crowdstrike",
    "Data Source: Sysmon",
]
timestamp_override = "event.ingested"
type = "eql"

query = '''
network where host.os.type == "windows" and dns.question.name != null and process.name != null and
(
  process.name : ("MSBuild.exe", "mshta.exe", "wscript.exe", "powershell.exe", "pwsh.exe", "msiexec.exe", "rundll32.exe",
  "bitsadmin.exe", "InstallUtil.exe", "RegAsm.exe", "vbc.exe", "RegSvcs.exe", "python.exe", "regsvr32.exe", "dllhost.exe",
  "node.exe", "javaw.exe", "java.exe", "*.pif", "*.com", "curl.exe", "bun.exe") or

  (?process.code_signature.trusted == false or ?process.code_signature.exists == false) or

  ?process.code_signature.subject_name : ("AutoIt Consulting Ltd", "OpenJS Foundation", "Python Software Foundation") or

  ?process.executable : (
    "?:\\Users\\Public\\*.exe", "?:\\ProgramData\\*.exe", "?:\\Users\\*\\Downloads\\*.exe",
    "\\Device\\HarddiskVolume*\\Users\\Public\\*.exe", "\\Device\\HarddiskVolume*\\ProgramData\\*.exe", "\\Device\\HarddiskVolume*\\Users\\*\\Downloads\\*.exe"
  )
 ) and
 dns.question.name :
         (
          "ip-api.com",
          "checkip.dyndns.org",
          "api.ipify.org",
          "api.ipify.com",
          "whatismyip.akamai.com",
          "bot.whatismyipaddress.com",
          "ifcfg.me",
          "ident.me",
          "ipof.in",
          "ip.tyk.nu",
          "icanhazip.com",
          "curlmyip.com",
          "wgetip.com",
          "eth0.me",
          "ipecho.net",
          "ip.appspot.com",
          "api.myip.com",
          "geoiptool.com",
          "api.2ip.ua",
          "api.ip.sb",
          "ipinfo.io",
          "checkip.amazonaws.com",
          "wtfismyip.com",
          "iplogger.*",
          "freegeoip.net",
          "freegeoip.app",
          "geoplugin.net",
          "myip.dnsomatic.com",
          "www.geoplugin.net",
          "api64.ipify.org",
          "ip4.seeip.org",
          "*.geojs.io",
          "*portmap.io",
          "api.db-ip.com",
          "geolocation-db.com",
          "httpbin.org",
          "myip.opendns.com"
         ) and
not (
  process.executable : (
    "?:\\ProgramData\\Microsoft\\Windows Defender\\platform\\*\\*.exe",
    "\\Device\\HarddiskVolume*\\ProgramData\\Microsoft\\Windows Defender\\platform\\*\\*.exe"
  ) and user.id in ("S-1-5-18", "S-1-5-19")
)
'''

note = """## Triage and analysis

### Investigating System Public IP Discovery via DNS Query

#### Possible investigation steps

- Does the alert-local DNS event show request-only, successful resolution, or lookup failure for a public-IP service?
  - Why: request events show intent to resolve the service; result events plus `dns.resolved_ip` show resolver response, not a connection.
  - Focus: `dns.question.name`, `event.action`, `dns.resolved_ip`, `dns.Ext.status`, and `@timestamp`.
  - Implication: escalate faster when a suspicious process resolves a service that reports public egress IP; lower concern only when the lookup failed or stayed request-only and identity, lineage, and network checks all fit the same recognized connectivity test.

- Is the alerting binary a recognized tool or a suspicious LOLBin/script host in this context?
  - Focus: alert or recovered process identity: `process.name`, `process.executable`, `process.hash.sha256`, `process.code_signature.subject_name`, and `process.code_signature.trusted`.
  - Implication: escalate when the lookup comes from a LOLBin, scripting runtime, unsigned binary, user-writable path, or signer mismatch; lower concern when a stable signed updater, endpoint-management, or managed connectivity-check component owns the exact binary. Identity alone does not close the alert.

- Does the launch chain explain why this process needed external-IP discovery?
  - Focus: recovered process start and parent context on `host.id` and `process.entity_id`: `process.command_line`, `process.parent.executable`, `process.parent.command_line`, `user.id`, and `process.Ext.session_info.logon_type`. $investigate_2
  - Implication: escalate when Office, a browser child, a script host, a service session, or an unexpected remote session launched the lookup; lower concern when parent, command line, user, and session all match one recognized troubleshooting, updater, endpoint-management, or managed connectivity-check workflow.

- Did the process connect to the resolved public-IP service or pivot to other external infrastructure?
  - Focus: same-process network events on `host.id` and `process.entity_id`, separating DNS results from connections and correlating `dns.resolved_ip` to `destination.ip`, `destination.port`, and `destination.as.organization.name`. $investigate_3
  - Hint: Missing network telemetry is unresolved, not benign. When present, treat `dns.question.name` as DNS evidence and `destination.ip` as connection evidence, including direct public-IP connections that bypass DNS.
  - Implication: escalate when the process reaches the resolved service, contacts unrelated public infrastructure, or later connects directly to public IPs without DNS; lower concern only when connection telemetry shows no related external connection or an environment-confirmed proxy path aligned with the same workflow.

- Did the same process launch follow-on commands that turn the lookup into staging, discovery, or C2 preparation?
  - Focus: child process starts where `process.parent.entity_id` matches `process.entity_id`: `process.name`, `process.command_line`, `process.executable`, and `process.code_signature.subject_name`. $investigate_4
  - Implication: escalate when shells, downloaders, installers, reconnaissance commands, or persistence tooling follow the lookup; lower concern when no child activity appears and earlier identity and lineage support one recognized connectivity check.

- If local evidence stays suspicious or unresolved, do related alerts show the same binary-and-domain tuple around this user or host?
  - Focus: related alert history for `user.id` and `host.id`: `dns.question.name`, `process.hash.sha256`, `process.code_signature.subject_name`, and recovered `process.parent.executable`. Review user and host alerts only after local DNS result, lineage, and follow-on network checks stay suspicious or unresolved.
    - $investigate_0
    - $investigate_1
  - Implication: broaden the case when the same hash, signer, parent, and public-IP service recur across other hosts for the same user or other users on the same host; keep response local when related alerts remain limited to one confirmed maintenance cohort.

- Based on DNS outcome, binary identity, launch chain, same-process network behavior, child processes, and scope, what disposition is supported?
  - Implication: escalate on unauthorized public-IP discovery plus suspicious lineage, external egress, child commands, or spread; close only when DNS outcome, binary identity, parent chain, user/session context, connection behavior, child activity, and scope bind one recognized workflow with no contradictions; preserve mixed or incomplete cases and escalate.

### False positive analysis

- Administrative troubleshooting, software updater, endpoint-management, and managed connectivity-check workflows may query public-IP services to confirm egress or NAT behavior. Confirm that identity (`process.executable`, `process.hash.sha256`, `process.code_signature.subject_name`), lineage (`process.parent.executable`, `process.parent.command_line`), user/session context, DNS evidence (`dns.question.name`, `dns.resolved_ip`), and any connection evidence converge on the same exact workflow. Without organizational confirmation, close only when telemetry proves the exact component and workflow; otherwise treat the pattern as candidate exception evidence.
- Before creating an exception, require a stable `process.hash.sha256` or `process.code_signature.subject_name`, `process.parent.executable`, the specific `dns.question.name`, and scope anchor (`host.id`, `host.name`, or `user.id`). Avoid exceptions on `dns.question.name` alone, `process.name` alone, or the full public-IP service list because benign tooling and malware use the same services.

### Response and remediation

- If confirmed benign, document the exact evidence that proved the workflow: binary identity, parent chain, user/session context, DNS result, connection behavior, and recurrence scope. Then reverse any temporary containment and build a narrow exception only for that confirmed workflow.
- If suspicious but unconfirmed, preserve the alert, process start, DNS result, same-process connection events, child process starts, and related alert history before containment. Apply reversible containment such as temporary domain or DNS blocking, outbound restrictions for the affected process or host, or heightened monitoring on the affected `host.id` or `user.id`; escalate to host isolation only if follow-on child processes, suspicious external egress, or broader spread appears and host criticality allows it.
- If confirmed malicious, isolate the host or restrict egress when binary identity, lineage, DNS, connection, or child-process evidence shows unauthorized internet discovery or pre-C2 activity. Block confirmed malicious `dns.question.name`, `dns.resolved_ip`, `destination.ip`, `process.hash.sha256`, and related domains, then scope other hosts and users for the same indicators before terminating processes or deleting artifacts.
- Eradicate only the scripts, binaries, scheduled tasks, run keys, or configuration changes identified during the investigation after scoping related hosts and users. Remediate the launcher, user context, or deployment path that introduced the public-IP lookup.
- Post-incident hardening: restrict unsigned or user-writable scripting and LOLBin execution where feasible, keep endpoint DNS and network telemetry enabled, and document any connectivity-check pattern or visibility gap for future triage.
"""

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)
- [SentinelOne Cloud Funnel](https://ela.st/sentinel-one-cloud-funnel)
- [Sysmon Event ID 22 - DNS Query](https://ela.st/sysmon-event-22-setup)
"""

[rule.investigation_fields]
field_names = [
    "@timestamp",
    "host.id",
    "user.id",
    "process.entity_id",
    "process.executable",
    "process.command_line",
    "process.parent.executable",
    "process.parent.command_line",
    "process.code_signature.trusted",
    "process.code_signature.subject_name",
    "dns.question.name",
    "dns.Ext.status",
    "dns.resolved_ip",
    "destination.ip",
    "event.action",
]

[transform]

[[transform.investigate]]
label = "Alerts associated with the user"
description = ""
providers = [
  [
    { excluded = false, field = "event.kind", queryType = "phrase", value = "signal", valueType = "string" },
    { excluded = false, field = "user.id", queryType = "phrase", value = "{{user.id}}", valueType = "string" }
  ]
]
relativeFrom = "now-48h/h"
relativeTo = "now"

[[transform.investigate]]
label = "Alerts associated with the host"
description = ""
providers = [
  [
    { excluded = false, field = "event.kind", queryType = "phrase", value = "signal", valueType = "string" },
    { excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" }
  ]
]
relativeFrom = "now-48h/h"
relativeTo = "now"

[[transform.investigate]]
label = "Process events for the DNS-querying process"
description = ""
providers = [
  [
    { excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" },
    { excluded = false, field = "process.entity_id", queryType = "phrase", value = "{{process.entity_id}}", valueType = "string" },
    { excluded = false, field = "event.category", queryType = "phrase", value = "process", valueType = "string" }
  ]
]
relativeFrom = "now-1h"
relativeTo = "now"

[[transform.investigate]]
label = "Network events for the DNS-querying process"
description = ""
providers = [
  [
    { excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" },
    { excluded = false, field = "process.entity_id", queryType = "phrase", value = "{{process.entity_id}}", valueType = "string" },
    { excluded = false, field = "event.category", queryType = "phrase", value = "network", valueType = "string" }
  ]
]
relativeFrom = "now-1h"
relativeTo = "now"

[[transform.investigate]]
label = "Child processes spawned by the DNS-querying process"
description = ""
providers = [
  [
    { excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" },
    { excluded = false, field = "process.parent.entity_id", queryType = "phrase", value = "{{process.entity_id}}", valueType = "string" },
    { excluded = false, field = "event.category", queryType = "phrase", value = "process", valueType = "string" }
  ]
]
relativeFrom = "now-1h"
relativeTo = "now"

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

[[rule.threat.technique]]
id = "T1016"
name = "System Network Configuration Discovery"
reference = "https://attack.mitre.org/techniques/T1016/"

[[rule.threat.technique.subtechnique]]
id = "T1016.001"
name = "Internet Connection Discovery"
reference = "https://attack.mitre.org/techniques/T1016/001/"

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

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

Stages and Predicates

Stage 1: network

network where host.os.type == "windows" and dns.question.name != null and process.name != null and
(
  process.name : ("MSBuild.exe", "mshta.exe", "wscript.exe", "powershell.exe", "pwsh.exe", "msiexec.exe", "rundll32.exe",
  "bitsadmin.exe", "InstallUtil.exe", "RegAsm.exe", "vbc.exe", "RegSvcs.exe", "python.exe", "regsvr32.exe", "dllhost.exe",
  "node.exe", "javaw.exe", "java.exe", "*.pif", "*.com", "curl.exe", "bun.exe") or

  (?process.code_signature.trusted == false or ?process.code_signature.exists == false) or

  ?process.code_signature.subject_name : ("AutoIt Consulting Ltd", "OpenJS Foundation", "Python Software Foundation") or

  ?process.executable : (
    "?:\\Users\\Public\\*.exe", "?:\\ProgramData\\*.exe", "?:\\Users\\*\\Downloads\\*.exe",
    "\\Device\\HarddiskVolume*\\Users\\Public\\*.exe", "\\Device\\HarddiskVolume*\\ProgramData\\*.exe", "\\Device\\HarddiskVolume*\\Users\\*\\Downloads\\*.exe"
  )
 ) and
 dns.question.name :
         (
          "ip-api.com",
          "checkip.dyndns.org",
          "api.ipify.org",
          "api.ipify.com",
          "whatismyip.akamai.com",
          "bot.whatismyipaddress.com",
          "ifcfg.me",
          "ident.me",
          "ipof.in",
          "ip.tyk.nu",
          "icanhazip.com",
          "curlmyip.com",
          "wgetip.com",
          "eth0.me",
          "ipecho.net",
          "ip.appspot.com",
          "api.myip.com",
          "geoiptool.com",
          "api.2ip.ua",
          "api.ip.sb",
          "ipinfo.io",
          "checkip.amazonaws.com",
          "wtfismyip.com",
          "iplogger.*",
          "freegeoip.net",
          "freegeoip.app",
          "geoplugin.net",
          "myip.dnsomatic.com",
          "www.geoplugin.net",
          "api64.ipify.org",
          "ip4.seeip.org",
          "*.geojs.io",
          "*portmap.io",
          "api.db-ip.com",
          "geolocation-db.com",
          "httpbin.org",
          "myip.opendns.com"
         ) and
not (
  process.executable : (
    "?:\\ProgramData\\Microsoft\\Windows Defender\\platform\\*\\*.exe",
    "\\Device\\HarddiskVolume*\\ProgramData\\Microsoft\\Windows Defender\\platform\\*\\*.exe"
  ) and user.id in ("S-1-5-18", "S-1-5-19")
)

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
dns.question.nameis_not_null
  • (no value, null check)
field:"QueryName" kind:is_not_null
dns.question.namewildcard
  • *.geojs.io corpus 7 (elastic 7)
  • *portmap.io corpus 7 (elastic 7)
  • api.2ip.ua corpus 5 (elastic 5)
  • api.db-ip.com corpus 5 (elastic 5)
  • api.ip.sb corpus 5 (elastic 5)
  • api.ipify.com corpus 2 (elastic 2)
  • api.ipify.org corpus 5 (elastic 5)
  • api.myip.com corpus 5 (elastic 5)
  • api64.ipify.org corpus 5 (elastic 5)
  • bot.whatismyipaddress.com corpus 5 (elastic 5)
  • checkip.amazonaws.com corpus 5 (elastic 5)
  • checkip.dyndns.org corpus 5 (elastic 5)
  • curlmyip.com corpus 5 (elastic 5)
  • eth0.me corpus 5 (elastic 5)
  • freegeoip.app corpus 5 (elastic 5)
  • freegeoip.net corpus 5 (elastic 5)
  • geoiptool.com corpus 5 (elastic 5)
  • geolocation-db.com corpus 5 (elastic 5)
  • geoplugin.net corpus 5 (elastic 5)
  • httpbin.org corpus 5 (elastic 5)
  • icanhazip.com corpus 5 (elastic 5)
  • ident.me corpus 5 (elastic 5)
  • ifcfg.me corpus 5 (elastic 5)
  • ip-api.com corpus 5 (elastic 5)
  • ip.appspot.com corpus 5 (elastic 5)
  • ip.tyk.nu corpus 5 (elastic 5)
  • ip4.seeip.org corpus 5 (elastic 5)
  • ipecho.net corpus 5 (elastic 5)
  • ipinfo.io corpus 5 (elastic 5)
  • iplogger.* corpus 5 (elastic 5)
  • ipof.in corpus 5 (elastic 5)
  • myip.dnsomatic.com corpus 5 (elastic 5)
  • myip.opendns.com corpus 4 (elastic 4)
  • wgetip.com corpus 5 (elastic 5)
  • whatismyip.akamai.com corpus 5 (elastic 5)
  • wtfismyip.com corpus 5 (elastic 5)
  • www.geoplugin.net corpus 5 (elastic 5)
field:"QueryName" kind:wildcard
process.code_signature.existseq
  • false transforms: boolean corpus 118 (elastic 118)
field:"process.code_signature.exists" kind:eq value:"false"
process.code_signature.subject_namewildcard
  • AutoIt Consulting Ltd corpus 5 (elastic 5)
  • OpenJS Foundation corpus 6 (elastic 6)
  • Python Software Foundation corpus 6 (elastic 6)
field:"Signature" kind:wildcard
process.code_signature.trustedeq
  • false transforms: boolean corpus 114 (elastic 114)
field:"process.code_signature.trusted" kind:eq value:"false"
process.executablewildcard
  • ?:\ProgramData\*.exe corpus 9 (elastic 9)
  • ?:\Users\*\Downloads\*.exe corpus 2 (elastic 2)
  • ?:\Users\Public\*.exe corpus 3 (elastic 3)
  • \Device\HarddiskVolume*\ProgramData\*.exe corpus 4 (elastic 4)
  • \Device\HarddiskVolume*\Users\*\Downloads\*.exe corpus 2 (elastic 2)
  • \Device\HarddiskVolume*\Users\Public\*.exe corpus 2 (elastic 2)
field:"Image" kind:wildcard
process.nameis_not_null
  • (no value, null check)
field:"process_basename" kind:is_not_null
process.namewildcard
  • *.com corpus 3 (elastic 3)
  • *.pif corpus 3 (elastic 3)
  • InstallUtil.exe corpus 3 (elastic 3)
  • MSBuild.exe corpus 4 (elastic 4)
  • RegAsm.exe corpus 2 (elastic 2)
  • RegSvcs.exe corpus 2 (elastic 2)
  • bitsadmin.exe corpus 3 (elastic 3)
  • bun.exe corpus 3 (elastic 3)
  • curl.exe corpus 7 (elastic 7)
  • dllhost.exe corpus 3 (elastic 3)
  • java.exe corpus 3 (elastic 3)
  • javaw.exe corpus 4 (elastic 4)
  • mshta.exe corpus 6 (elastic 6)
  • msiexec.exe corpus 4 (elastic 4)
  • node.exe corpus 8 (elastic 8)
  • powershell.exe corpus 12 (elastic 12)
  • pwsh.exe corpus 6 (elastic 6)
  • python.exe corpus 2 (elastic 2)
  • regsvr32.exe corpus 4 (elastic 4)
  • rundll32.exe corpus 8 (elastic 8)
  • vbc.exe corpus 2 (elastic 2)
  • wscript.exe corpus 9 (elastic 9)
field:"process_basename" kind:wildcard

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.executablewildcard?:\ProgramData\Microsoft\Windows Defender\platform\*\*.exe, \Device\HarddiskVolume*\ProgramData\Microsoft\Windows Defender\platform\*\*.exeexcludes:process.executable field:"process.executable" value:"?:\ProgramData\Microsoft\Windows Defender\platform\*\*.exe" field:"process.executable" value:"\Device\HarddiskVolume*\ProgramData\Microsoft\Windows Defender\platform\*\*.exe"
user.idinS-1-5-18, S-1-5-19excludes:user.id field:"user.id" value:"S-1-5-18" field:"user.id" value:"S-1-5-19"

Unsigned or Untrusted Binary Execution via Zshrc

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

Detects the execution of an unsigned or untrusted binary via the Zsh shell startup file .zshrc. Threat actors can modify the .zshrc file with the path to their payload in order to persist on a victims system. When the host reboots the payload will be executed and this is the activity you will see. A recent DPRK payload, ThiefBucket, implements this persistence mechanism.

MITRE ATT&CK Coverage

Telemetry Coverage

Rule Body

[rule]
description = """
Detects the execution of an unsigned or untrusted binary via the Zsh shell startup file .zshrc. Threat actors can modify
the .zshrc file with the path to their payload in order to persist on a victims system. When the host reboots the
payload will be executed and this is the activity you will see. A recent DPRK payload, ThiefBucket, implements this
persistence mechanism.
"""
id = "89a79178-978a-4043-956e-bf5b41c4ec46"
license = "Elastic License v2"
name = "Unsigned or Untrusted Binary Execution via Zshrc"
os_list = ["macos"]
reference = [
    "https://www.jamf.com/blog/jamf-threat-labs-observes-targeted-attacks-amid-fbi-warnings/",
    "https://theevilbit.github.io/beyond/beyond_0001/",
]
version = "1.0.7"

query = '''
sequence with maxspan=15s
[process where event.type == "start" and event.action == "exec" and process.name == "zsh" and process.args like~ "-zsh" and 
  process.parent.name == "login"] by process.entity_id
[process where event.type == "start" and event.action == "exec" and process.parent.name == "zsh" and 
  process.executable like "/Users/*" and (process.code_signature.trusted == false or process.code_signature.exists == false) and 
  process.args_count == 1] by process.parent.entity_id
[network where event.type == "start" 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")] by process.parent.entity_id
'''

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

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1546"
name = "Event Triggered Execution"
reference = "https://attack.mitre.org/techniques/T1546/"
[[threat.technique.subtechnique]]
id = "T1546.004"
name = "Unix Shell Configuration Modification"
reference = "https://attack.mitre.org/techniques/T1546/004/"



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

[internal]
min_endpoint_version = "8.16.0"

Stages and Predicates

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

Stage 1: process

[process where event.type == "start" and event.action == "exec" and process.name == "zsh" and process.args like~ "-zsh" and 
  process.parent.name == "login"] by process.entity_id

Stage 2: process

[process where event.type == "start" and event.action == "exec" and process.parent.name == "zsh" and 
  process.executable like "/Users/*" and (process.code_signature.trusted == false or process.code_signature.exists == false) and 
  process.args_count == 1] by process.parent.entity_id

Stage 3: network

[network where event.type == "start" 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")] by process.parent.entity_id

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
destination.ipcidr_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

Unusual Process For MSSQL Service Accounts

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

Identifies unusual process executions using MSSQL Service accounts, which can indicate the exploitation/compromise of SQL instances. Attackers may exploit exposed MSSQL instances for initial access or lateral movement.

MITRE ATT&CK Coverage

Telemetry Coverage

Rule Body

[metadata]
bypass_bbr_timing = true
creation_date = "2023/08/25"
integration = ["endpoint"]
maturity = "production"
updated_date = "2026/03/24"

[rule]
author = ["Elastic"]
building_block_type = "default"
description = """
Identifies unusual process executions using MSSQL Service accounts, which can indicate the exploitation/compromise of
SQL instances. Attackers may exploit exposed MSSQL instances for initial access or lateral movement.
"""
from = "now-9m"
index = ["logs-endpoint.events.process-*"]
language = "eql"
license = "Elastic License v2"
name = "Unusual Process For MSSQL Service Accounts"
references = [
    "https://www.microsoft.com/en-us/security/blog/2023/08/24/flax-typhoon-using-legitimate-software-to-quietly-access-taiwanese-organizations/",
    "https://learn.microsoft.com/en-us/sql/database-engine/configure-windows/configure-windows-service-accounts-and-permissions?view=sql-server-ver16",
]
risk_score = 21
rule_id = "e74d645b-fec6-431e-bf93-ca64a538e0de"
severity = "low"
tags = [
    "Domain: Endpoint",
    "OS: Windows",
    "Use Case: Threat Detection",
    "Tactic: Lateral Movement",
    "Tactic: Persistence",
    "Data Source: Elastic Defend",
    "Rule Type: BBR",
]
timestamp_override = "event.ingested"
type = "eql"

query = '''
process where event.type == "start" and host.os.type == "windows" and
  user.name : (
    "SQLSERVERAGENT", "SQLAGENT$*",
    "MSSQLSERVER", "MSSQL$*",
    "MSSQLServerOLAPService",
    "ReportServer*", "MsDtsServer150",
    "MSSQLFDLauncher*",
    "SQLServer2005SQLBrowserUser$*",
    "SQLWriter", "winmgmt"
  ) and user.domain : "NT SERVICE" and
  not (
    (
      process.name : (
        "sqlceip.exe", "sqlservr.exe", "sqlagent.exe",
        "msmdsrv.exe", "ReportingServicesService.exe",
        "MsDtsSrvr.exe", "sqlbrowser.exe", "DTExec.exe",
        "SQLPS.exe", "fdhost.exe", "fdlauncher.exe",
        "SqlDumper.exe", "sqlsqm.exe", "DatabaseMail.exe",
        "ISServerExec.exe", "Microsoft.ReportingServices.Portal.WebHost.exe",
        "bcp.exe", "SQLCMD.exe", "DatabaseMail.exe"
      ) or
      process.executable : (
        "?:\\Windows\\System32\\wermgr.exe",
        "?:\\Windows\\System32\\conhost.exe",
        "?:\\Windows\\System32\\WerFault.exe"
      )
    ) and
    (
      process.code_signature.subject_name : ("Microsoft Corporation", "Microsoft Windows") and
      process.code_signature.trusted == true
    )
  ) and
  not (
    (process.name : "cmd.exe" and process.parent.name : "sqlservr.exe") or
    (process.name : "cmd.exe" and process.parent.name : "forfiles.exe" and process.command_line : "/c echo *")
  )
'''


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

[[rule.threat.technique]]
id = "T1210"
name = "Exploitation of Remote Services"
reference = "https://attack.mitre.org/techniques/T1210/"

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

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

[[rule.threat.technique]]
id = "T1505"
name = "Server Software Component"
reference = "https://attack.mitre.org/techniques/T1505/"

[[rule.threat.technique.subtechnique]]
id = "T1505.001"
name = "SQL Stored Procedures"
reference = "https://attack.mitre.org/techniques/T1505/001/"

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

[[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.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"

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

[[rule.threat.technique]]
id = "T1190"
name = "Exploit Public-Facing Application"
reference = "https://attack.mitre.org/techniques/T1190/"

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

Stages and Predicates

Stage 1: process

process where event.type == "start" and host.os.type == "windows" and
  user.name : (
    "SQLSERVERAGENT", "SQLAGENT$*",
    "MSSQLSERVER", "MSSQL$*",
    "MSSQLServerOLAPService",
    "ReportServer*", "MsDtsServer150",
    "MSSQLFDLauncher*",
    "SQLServer2005SQLBrowserUser$*",
    "SQLWriter", "winmgmt"
  ) and user.domain : "NT SERVICE" and
  not (
    (
      process.name : (
        "sqlceip.exe", "sqlservr.exe", "sqlagent.exe",
        "msmdsrv.exe", "ReportingServicesService.exe",
        "MsDtsSrvr.exe", "sqlbrowser.exe", "DTExec.exe",
        "SQLPS.exe", "fdhost.exe", "fdlauncher.exe",
        "SqlDumper.exe", "sqlsqm.exe", "DatabaseMail.exe",
        "ISServerExec.exe", "Microsoft.ReportingServices.Portal.WebHost.exe",
        "bcp.exe", "SQLCMD.exe", "DatabaseMail.exe"
      ) or
      process.executable : (
        "?:\\Windows\\System32\\wermgr.exe",
        "?:\\Windows\\System32\\conhost.exe",
        "?:\\Windows\\System32\\WerFault.exe"
      )
    ) and
    (
      process.code_signature.subject_name : ("Microsoft Corporation", "Microsoft Windows") and
      process.code_signature.trusted == true
    )
  ) and
  not (
    (process.name : "cmd.exe" and process.parent.name : "sqlservr.exe") or
    (process.name : "cmd.exe" and process.parent.name : "forfiles.exe" and process.command_line : "/c echo *")
  )

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.typeeq
  • start corpus 1036 (elastic 1036)
field:"event.type" kind:eq value:"start"
user.domainwildcard
  • NT SERVICE
field:"TargetDomainName" kind:wildcard value:"NT SERVICE"
user.namewildcard
  • MSSQL$*
  • MSSQLFDLauncher*
  • MSSQLSERVER
  • MSSQLServerOLAPService
  • MsDtsServer150
  • ReportServer*
  • SQLAGENT$*
  • SQLSERVERAGENT
  • SQLServer2005SQLBrowserUser$*
  • SQLWriter
  • winmgmt
field:"user" kind:wildcard

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.command_linestarts_with/c echo excludes:process.command_line field:"process.command_line" value:"/c echo "
process.nameeqcmd.exeexcludes:process.name field:"process.name" value:"cmd.exe"
process.parent.nameeqforfiles.exeexcludes:process.parent.name field:"process.parent.name" value:"forfiles.exe"
process.parent.nameeqsqlservr.exeexcludes:process.parent.name field:"process.parent.name" value:"sqlservr.exe"
process.executableeq?:\Windows\System32\wermgr.exe, ?:\Windows\System32\conhost.exe, ?:\Windows\System32\WerFault.exeexcludes:process.executable field:"process.executable" value:"?:\Windows\System32\wermgr.exe" field:"process.executable" value:"?:\Windows\System32\conhost.exe" field:"process.executable" value:"?:\Windows\System32\WerFault.exe"
process.nameeqsqlceip.exe, sqlservr.exe, sqlagent.exe, msmdsrv.exe, ReportingServicesService.exe, MsDtsSrvr.exe, sqlbrowser.exe, DTExec.exe, SQLPS.exe, fdhost.exe, fdlauncher.exe, SqlDumper.exe, sqlsqm.exe, DatabaseMail.exe, ISServerExec.exe, Microsoft.ReportingServices.Portal.WebHost.exe, bcp.exe, SQLCMD.exe, DatabaseMail.exeexcludes:process.name
process.code_signature.subject_nameeqMicrosoft Corporation, Microsoft Windowsexcludes:process.code_signature.subject_name field:"process.code_signature.subject_name" value:"Microsoft Corporation" field:"process.code_signature.subject_name" value:"Microsoft Windows"
process.code_signature.trustedeqtrueexcludes:process.code_signature.trusted field:"process.code_signature.trusted" value:"true"

Unusual Windows Service

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

A machine learning job detected an unusual Windows service, This can indicate execution of unauthorized services, malware, or persistence mechanisms. In corporate Windows environments, hosts do not generally run many rare or unique services. This job helps detect malware and persistence mechanisms that have been installed and run as a service.

Known False Positives

  • A newly installed program or one that runs rarely as part of a monthly or quarterly workflow could trigger this alert.

MITRE ATT&CK Coverage

Rule Body

[metadata]
creation_date = "2020/03/25"
integration = ["endpoint", "windows"]
maturity = "production"
min_stack_version = "9.4.0"
min_stack_comments = "Use EA (Entity Analytics) fields"
updated_date = "2026/07/27"

[rule]
anomaly_threshold = 50
author = ["Elastic"]
description = """
A machine learning job detected an unusual Windows service, This can indicate execution of unauthorized services,
malware, or persistence mechanisms. In corporate Windows environments, hosts do not generally run many rare or unique
services. This job helps detect malware and persistence mechanisms that have been installed and run as a service.
"""
false_positives = [
    """
    A newly installed program or one that runs rarely as part of a monthly or quarterly workflow could trigger this
    alert.
    """,
]
from = "now-45m"
interval = "15m"
license = "Elastic License v2"
machine_learning_job_id = ["v3_windows_anomalous_service_ea"]
name = "Unusual Windows Service"
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 Windows Service

Windows services are crucial for running background processes and applications. Adversaries exploit this by creating or modifying services to maintain persistence or execute unauthorized actions. The 'Unusual Windows Service' detection rule leverages machine learning to identify atypical services, flagging potential threats by comparing against known service patterns, thus aiding in early threat detection and response.

### Possible investigation steps

- Review the details of the detected unusual Windows service, including the service name, path, and any associated executables, to determine if it aligns with known legitimate services or appears suspicious.
- Check the creation and modification timestamps of the service to identify if it was recently added or altered, which could indicate unauthorized activity.
- Investigate the user account under which the service is running to assess if it has the necessary permissions and if the account has been compromised or misused.
- Cross-reference the service with known threat intelligence databases to see if it matches any known malware or persistence mechanisms.
- Analyze the network activity and connections associated with the service to identify any unusual or unauthorized communication patterns.
- Examine the host's event logs for any related entries that could provide additional context or evidence of malicious activity, such as failed login attempts or privilege escalation events.

### False positive analysis

- Legitimate software installations or updates may create new services that are flagged as unusual. Users should verify the source and purpose of the service before excluding it.
- Custom in-house applications often run unique services that can trigger alerts. Document these services and create exceptions to prevent future false positives.
- IT administrative tools might install services for management purposes. Confirm these tools are authorized and add them to an exception list if they are frequently flagged.
- Temporary services used for troubleshooting or testing can be mistaken for threats. Ensure these are removed after use or excluded if they are part of regular operations.
- Scheduled tasks that create services for specific operations might be flagged. Review these tasks and exclude them if they are part of normal business processes.

### Response and remediation

- Immediately isolate the affected host from the network to prevent potential lateral movement or data exfiltration by the unauthorized service.
- Terminate the unusual Windows service identified by the alert to stop any ongoing malicious activity.
- Conduct a thorough analysis of the service's executable and associated files to determine if they are malicious. Use endpoint detection and response (EDR) tools to assist in this analysis.
- Remove any malicious files or executables associated with the service from the system to ensure complete eradication of the threat.
- Restore the affected system from a known good backup if the service has caused significant changes or damage to the system.
- Monitor the system and network for any signs of re-infection or similar unusual service activity, using enhanced logging and alerting mechanisms.
- Escalate the incident to the security operations center (SOC) or incident response team for further investigation and to assess the need for broader organizational response measures."""
references = ["https://www.elastic.co/guide/en/security/current/prebuilt-ml-jobs.html"]
risk_score = 21
rule_id = "1781d055-5c66-4adf-9c71-fc0fa58338c7"
setup = """## Setup

This rule requires the installation of associated Machine Learning jobs, as well as data coming in from one of the following integrations:
- Elastic Defend
- Windows

### Anomaly Detection Setup

Once the rule is enabled, the associated Machine Learning job will start automatically. You can view the Machine Learning job linked under the "Definition" panel of the detection rule. If the job does not start due to an error, the issue must be resolved for the job to commence successfully. For more details on setting up anomaly detection jobs, refer to the [helper guide](https://www.elastic.co/guide/en/kibana/current/xpack-ml-anomalies.html).

### 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 to your 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/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).

### Windows Integration Setup
The Windows integration allows you to monitor the Windows OS, services, applications, and more.

#### The following steps should be executed in order to add the Elastic Agent System integration "windows" to your system:
- Go to the Kibana home page and click “Add integrations”.
- In the query bar, search for “Windows” and select the integration to see more details about it.
- Click “Add Windows”.
- Configure the integration name and optionally add a description.
- Review optional and advanced settings accordingly.
- Add the newly installed “windows” to an existing or a new agent policy, and deploy the agent on your system from which windows log files are desirable.
- Click “Save and Continue”.
- For more details on the integration refer to the [helper guide](https://docs.elastic.co/integrations/windows).
"""
severity = "low"
tags = [
    "Domain: Endpoint",
    "OS: Windows",
    "Data Source: Elastic Defend",
    "Data Source: Windows Security Event Logs",
    "Use Case: Threat Detection",
    "Rule Type: ML",
    "Rule Type: Machine Learning",
    "Tactic: Persistence",
    "Resources: Investigation Guide",
]
type = "machine_learning"
[[rule.threat]]
framework = "MITRE ATT&CK"

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

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

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

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

[[rule.threat.technique]]
id = "T1569"
name = "System Services"
reference = "https://attack.mitre.org/techniques/T1569/"

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

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

Back to all Elastic rules