Detection rules › Elastic

Elastic rules: 31

AppleScript Decoded via Base64

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

Detects when AppleScript is executed followed by the execution of the Base64 binary with the decode option set. Several malware samples have been observed executing base64 encoded AppleScript in order to avoid detection.

MITRE ATT&CK Coverage

Telemetry Coverage

Rule Body

[rule]
description = """
Detects when AppleScript is executed followed by the execution of the Base64 binary with the decode option set. Several
malware samples have been observed executing base64 encoded AppleScript in order to avoid detection.
"""
id = "9602ed93-b5cf-4397-ba37-6e752082847c"
license = "Elastic License v2"
name = "AppleScript Decoded via Base64"
os_list = ["macos"]
version = "1.0.8"

query = '''
sequence with maxspan=10s
[process where event.type == "start" and event.action == "exec" and process.parent.name == "osascript" and 
  (process.name in ("bash", "zsh", "sh", "dash", "csh", "tcsh", "ksh", "tclsh", "fish") or process.name like "tclsh*") and process.args == "-c"] by process.entity_id
[process where event.type == "start" and event.action == "exec" and (process.name in ("bash", "zsh", "sh", "dash", "csh", "tcsh", "ksh", "tclsh", "fish", "base64") or process.name like "tclsh*") and
  process.command_line like~ "*base64*-d*"] by process.parent.entity_id
'''

min_endpoint_version = "8.11.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.002"
name = "AppleScript"
reference = "https://attack.mitre.org/techniques/T1059/002/"



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

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


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

[internal]
min_endpoint_version = "8.11.0"

Stages and Predicates

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

Stage 1: process

[process where event.type == "start" and event.action == "exec" and process.parent.name == "osascript" and 
  (process.name in ("bash", "zsh", "sh", "dash", "csh", "tcsh", "ksh", "tclsh", "fish") or process.name like "tclsh*") and process.args == "-c"] by process.entity_id

Stage 2: process

[process where event.type == "start" and event.action == "exec" and (process.name in ("bash", "zsh", "sh", "dash", "csh", "tcsh", "ksh", "tclsh", "fish", "base64") or process.name like "tclsh*") and
  process.command_line like~ "*base64*-d*"] by process.parent.entity_id

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • exec corpus 547 (elastic 547)
field:"EventType" kind:eq value:"exec"
event.typeeq
  • start corpus 1036 (elastic 1036)
field:"event.type" kind:eq value:"start"
process.argseq
  • -c corpus 91 (elastic 91)
field:"process.args" kind:eq value:"-c"
process.command_linewildcard
  • *base64*-d*
field:"CommandLine" kind:wildcard value:"*base64*-d*"
process.namein
  • base64 corpus 20 (elastic 20)
  • 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
  • tclsh* corpus 23 (elastic 23)
field:"process_basename" kind:wildcard value:"tclsh*"
process.parent.nameeq
  • osascript corpus 11 (elastic 11)
field:"parent_process_basename" kind:eq value:"osascript"

AWS Bedrock AgentCore Execution Role Used Outside Its Runtime

#
Status
production
Severity
high
Time window
9m
Group by
aws.cloudtrail.user_identity.session_context.session_issuer.arn, event.provider
Author
Elastic
Source
github.com/elastic/detection-rules

Identifies an Amazon Bedrock AgentCore execution role (an AssumedRole identity whose role name begins with "AgentCore-" or contains "BedrockAgentCore") making an AWS API call to a service it has not previously called. AgentCore runtimes normally interact only with Bedrock inference, AgentCore data-plane, and observability services (CloudWatch Logs, X-Ray, CloudWatch metrics), so an execution role suddenly calling STS, EC2, IAM, Secrets Manager, or other services is a strong indicator that the role's temporary credentials were exfiltrated from the agent's microVM (for example, via the Code Interpreter instance-metadata-service credential theft) and are being used outside the runtime for reconnaissance, privilege escalation, or lateral movement. Because the stolen credentials are recorded in CloudTrail under the execution role's own identity, the anomalous service usage, not the identity, is the detectable signal.

Known False Positives

  • An AgentCore agent that legitimately integrates with additional AWS services will produce a first-time service call for its execution role. Verify the role in "aws.cloudtrail.user_identity.session_context.session_issuer.arn", the action in "event.action" and "event.provider", and the origin in "source.ip" and "source.as.organization.name", and confirm the activity matches the agent's intended design. Known agent integrations can be excluded after validation.

MITRE ATT&CK Coverage

Rule Body

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

[rule]
author = ["Elastic"]
description = """
Identifies an Amazon Bedrock AgentCore execution role (an AssumedRole identity whose role name begins with
"AgentCore-" or contains "BedrockAgentCore") making an AWS API call to a service it has not previously called. AgentCore runtimes normally interact
only with Bedrock inference, AgentCore data-plane, and observability services (CloudWatch Logs, X-Ray, CloudWatch
metrics), so an execution role suddenly calling STS, EC2, IAM,
Secrets Manager, or other services is a strong indicator that the role's temporary credentials were exfiltrated from
the agent's microVM (for example, via the Code Interpreter instance-metadata-service credential theft) and are being
used outside the runtime for reconnaissance, privilege escalation, or lateral movement. Because the stolen credentials
are recorded in CloudTrail under the execution role's own identity, the anomalous service usage, not the identity, is
the detectable signal.
"""
false_positives = [
    """
    An AgentCore agent that legitimately integrates with additional AWS services will produce a first-time service call
    for its execution role. Verify the role in
    "aws.cloudtrail.user_identity.session_context.session_issuer.arn", the action in "event.action" and "event.provider",
    and the origin in "source.ip" and "source.as.organization.name", and confirm the activity matches the agent's
    intended design. Known agent integrations can be excluded after validation.
    """,
]
from = "now-9m"
index = ["logs-aws.cloudtrail-*"]
language = "kuery"
license = "Elastic License v2"
name = "AWS Bedrock AgentCore Execution Role Used Outside Its Runtime"
note = """## Triage and analysis

### Investigating AWS Bedrock AgentCore Execution Role Used Outside Its Runtime

AgentCore runtime and tool execution roles are assumed by the AgentCore service and normally only call Bedrock inference, AgentCore data-plane, and observability (CloudWatch Logs, X-Ray, CloudWatch metrics) APIs, all of which this rule excludes. Public research has shown the Code Interpreter microVM exposes the execution role's temporary credentials through the instance metadata service (IMDS), and that a string-filter bypass allows exfiltrating them outside the sandbox. Once stolen, the credentials are used to call other AWS services, but those calls are logged in CloudTrail under the execution role's identity rather than the attacker's, creating an attribution gap. This rule flags the first time an AgentCore execution role ("AgentCore-*" or "*BedrockAgentCore*") calls a non-Bedrock service, which is the point at which exfiltrated credentials are put to use.

### Possible investigation steps

- Identify the execution role in "aws.cloudtrail.user_identity.session_context.session_issuer.arn" and map it to its AgentCore runtime, gateway, or code interpreter.
- Review "event.provider" and "event.action" for reconnaissance (sts:GetCallerIdentity, ec2:Describe*, iam:List*/Get*), privilege escalation (sts:AssumeRole, iam:Put*/Attach*), or data access, and assess what the role can reach.
- Compare "source.ip", "source.as.organization.name", and "user_agent.original" against the AgentCore service origin; calls from an external network strongly indicate exfiltrated credentials.
- Determine whether the agent design legitimately added this integration, or whether the activity is unexpected for the role.

### False positive analysis

- A newly designed agent integration produces a first-time non-Bedrock call for its execution role. Confirm the integration is approved and exclude the role and service after validation.

### Response and remediation

- If unauthorized, revoke the execution role's active sessions, rotate any associated secrets, and review every action the role took since the first anomalous call.
- Restrict the execution role to least privilege, prefer VPC network mode for code interpreters, and ensure the metadata service requires session tokens.
"""
references = [
    "https://sonraisecurity.com/blog/sandboxed-to-compromised-new-research-exposes-credential-exfiltration-paths-in-aws-code-interpreters/",
    "https://unit42.paloaltonetworks.com/bypass-of-aws-sandbox-network-isolation-mode/",
]
risk_score = 73
rule_id = "ee066db8-4f2f-42d3-8ebd-ea25cd9bdc73"
setup = "This rule requires AWS CloudTrail logs ingested via the Elastic AWS integration. See https://docs.elastic.co/integrations/aws/cloudtrail for setup details. The AgentCore execution-role name prefix may differ in your environment; tune the role-name filter accordingly."
severity = "high"
tags = [
    "Domain: Cloud",
    "Data Source: AWS",
    "Data Source: AWS CloudTrail",
    "Data Source: Amazon Web Services",
    "Data Source: Amazon Bedrock",
    "Use Case: Threat Detection",
    "Tactic: Privilege Escalation",
    "Tactic: Credential Access",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "new_terms"

query = '''
data_stream.dataset: "aws.cloudtrail"
    and aws.cloudtrail.user_identity.type: "AssumedRole"
    and aws.cloudtrail.user_identity.session_context.session_issuer.arn: (*role/AgentCore-* or *role/*BedrockAgentCore*)
    and event.outcome: "success"
    and not event.provider: (
        "bedrock.amazonaws.com" or
        "bedrock-runtime.amazonaws.com" or
        "bedrock-agentcore.amazonaws.com" or
        "bedrock-agentcore-control.amazonaws.com" or
        "logs.amazonaws.com" or
        "xray.amazonaws.com" or
        "monitoring.amazonaws.com" or
        "ecr.amazonaws.com" or
        "ecr-public.amazonaws.com"
    )
'''


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


[rule.threat.tactic]
id = "TA0004"
name = "Privilege Escalation"
reference = "https://attack.mitre.org/tactics/TA0004/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1552"
name = "Unsecured Credentials"
reference = "https://attack.mitre.org/techniques/T1552/"
[[rule.threat.technique.subtechnique]]
id = "T1552.005"
name = "Cloud Instance Metadata API"
reference = "https://attack.mitre.org/techniques/T1552/005/"


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

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

[rule.new_terms]
field = "new_terms_fields"
value = ["aws.cloudtrail.user_identity.session_context.session_issuer.arn", "event.provider"]
[[rule.new_terms.history_window_start]]
field = "history_window_start"
value = "now-7d"

Stages and Predicates

Stage 1: new_terms

data_stream.dataset: "aws.cloudtrail"
    and aws.cloudtrail.user_identity.type: "AssumedRole"
    and aws.cloudtrail.user_identity.session_context.session_issuer.arn: (*role/AgentCore-* or *role/*BedrockAgentCore*)
    and event.outcome: "success"
    and not event.provider: (
        "bedrock.amazonaws.com" or
        "bedrock-runtime.amazonaws.com" or
        "bedrock-agentcore.amazonaws.com" or
        "bedrock-agentcore-control.amazonaws.com" or
        "logs.amazonaws.com" or
        "xray.amazonaws.com" or
        "monitoring.amazonaws.com" or
        "ecr.amazonaws.com" or
        "ecr-public.amazonaws.com"
    )

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
event.providerinbedrock-agentcore-control.amazonaws.com, bedrock-agentcore.amazonaws.com, bedrock-runtime.amazonaws.com, bedrock.amazonaws.com, ecr-public.amazonaws.com, ecr.amazonaws.com, logs.amazonaws.com, monitoring.amazonaws.com, xray.amazonaws.comexcludes:event.provider

AWS Bedrock AgentCore Runtime Prompt Containing Credentials

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

Identifies prompts sent to an Amazon Bedrock AgentCore runtime that contain AWS access key identifiers (AKIA long-term or ASIA temporary/STS), Amazon Bedrock API keys (ABSK bearer tokens), or PEM-encoded private keys. The runtime application logs record the caller-supplied prompt; credentials embedded in a prompt are exposed to the model provider, persisted in observability logs, and may be returned in completions or used by downstream tools. This commonly indicates accidental secret leakage by a user or application, or an attempt to stage credentials for misuse through the agent. Secrets should never be passed to an agent in clear text.

Known False Positives

  • Documentation, examples, or test content may include sample key material. Confirm whether the key is live by reviewing "aws.bedrock_agentcore.request_payload.prompt" and the originating session and application.

MITRE ATT&CK Coverage

TacticTechniques
Credential Access

Rule Body

[metadata]
creation_date = "2026/07/08"
integration = ["aws_bedrock_agentcore"]
maturity = "production"
updated_date = "2026/07/08"

[rule]
author = ["Elastic"]
description = """
Identifies prompts sent to an Amazon Bedrock AgentCore runtime that contain AWS access key identifiers (AKIA long-term
or ASIA temporary/STS), Amazon Bedrock API keys (ABSK bearer tokens), or PEM-encoded private keys. The runtime application logs record the caller-supplied prompt; credentials
embedded in a prompt are exposed to the model provider, persisted in observability logs, and may be returned in
completions or used by downstream tools. This commonly indicates accidental secret leakage by a user or application,
or an attempt to stage credentials for misuse through the agent. Secrets should never be passed to an agent in clear
text.
"""
false_positives = [
    """
    Documentation, examples, or test content may include sample key material. Confirm whether the key is live by
    reviewing "aws.bedrock_agentcore.request_payload.prompt" and the originating session and application.
    """,
]
from = "now-30m"
interval = "10m"
language = "esql"
license = "Elastic License v2"
name = "AWS Bedrock AgentCore Runtime Prompt Containing Credentials"
note = """## Triage and analysis

### Investigating AWS Bedrock AgentCore Runtime Prompt Containing Credentials

Amazon Bedrock AgentCore runtime application logs capture the prompt supplied to the agent. When that prompt contains an AWS access key (AKIA/ASIA) or a PEM private key, the secret is exposed to the model provider and stored in observability logs, and it may be echoed in completions or consumed by the agent's tools. This usually reflects accidental leakage but can also be an attempt to stage credentials for abuse through the agent.

### Possible investigation steps

- Review "aws.bedrock_agentcore.request_payload.prompt" to identify the credential material and determine whether it is live.
- Identify the agent in "aws.bedrock_agentcore.agent_name"/"aws.bedrock_agentcore.resource_arn" and the conversation in "aws.bedrock_agentcore.session_id"; review surrounding prompts in the session.
- Determine the source application or identity invoking the runtime and whether passing secrets was intentional.
- If the key is an AWS access key, identify the IAM principal it belongs to and review its recent activity in CloudTrail for misuse.

### False positive analysis

- Sample or documentation key material can match. Confirm whether the credential is live before escalating.

### Response and remediation

- If the credential is live, rotate or revoke it immediately and review its activity for unauthorized use.
- Remove the secret from any retained logs or conversation stores where feasible, and notify the owning team.
- Educate users and applications to never pass secrets to agents in clear text, and consider input filtering or guardrails that block credential patterns.
"""
references = [
    "https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/observability.html",
]
risk_score = 73
rule_id = "b3e1f7a2-9d4c-4e8a-8f2b-1c6d5a0e3f77"
setup = """This rule requires Amazon Bedrock AgentCore runtime application logs collected via the Elastic AWS Bedrock AgentCore integration (observability logs delivered to S3 and ingested into the aws_bedrock_agentcore.runtime_application_logs dataset). See https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/observability.html for enabling AgentCore observability."""
severity = "high"
tags = [
    "Domain: Cloud",
    "Data Source: AWS",
    "Data Source: Amazon Web Services",
    "Data Source: Amazon Bedrock",
    "Use Case: Threat Detection",
    "Tactic: Credential Access",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "esql"

query = '''
from logs-aws_bedrock_agentcore.runtime_application_logs-* metadata _id, _version, _index
| where aws.bedrock_agentcore.operation == "InvokeAgentRuntime" and (
    aws.bedrock_agentcore.request_payload.prompt rlike """.*(AKIA|ASIA)[A-Z0-9]{16}.*"""
    or aws.bedrock_agentcore.request_payload.prompt rlike """.*-----BEGIN [A-Z ]*PRIVATE KEY-----.*"""
    or aws.bedrock_agentcore.request_payload.prompt rlike """.*ABSK[A-Za-z0-9+/=]{20}.*"""
    or aws.bedrock_agentcore.request_payload.prompt rlike """.*bedrock-api-key-[-A-Za-z0-9+/=._~:]{20,}.*"""
  )
| keep _id, _version, _index, @timestamp, aws.*, cloud.*, event.*
'''


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


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

Stages and Predicates

Stage 1: from

from logs-aws_bedrock_agentcore.runtime_application_logs-* metadata _id, _version, _index

Stage 2: where

| where aws.bedrock_agentcore.operation == "InvokeAgentRuntime" and (
    aws.bedrock_agentcore.request_payload.prompt rlike """.*(AKIA|ASIA)[A-Z0-9]{16}.*"""
    or aws.bedrock_agentcore.request_payload.prompt rlike """.*-----BEGIN [A-Z ]*PRIVATE KEY-----.*"""
    or aws.bedrock_agentcore.request_payload.prompt rlike """.*ABSK[A-Za-z0-9+/=]{20}.*"""
    or aws.bedrock_agentcore.request_payload.prompt rlike """.*bedrock-api-key-[-A-Za-z0-9+/=._~:]{20,}.*"""
  )

Stage 3: keep

| keep _id, _version, _index, @timestamp, aws.*, cloud.*, event.*

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
aws.bedrock_agentcore.operationeq
  • InvokeAgentRuntime
field:"aws.bedrock_agentcore.operation" kind:eq value:"InvokeAgentRuntime"
aws.bedrock_agentcore.request_payload.promptregex_match
  • .*(AKIA|ASIA)[A-Z0-9]{16}.*
  • .*-----BEGIN [A-Z ]*PRIVATE KEY-----.*
  • .*ABSK[A-Za-z0-9+/=]{20}.*
  • .*bedrock-api-key-[-A-Za-z0-9+/=._~:]{20,}.*
field:"aws.bedrock_agentcore.request_payload.prompt" kind:regex_match

Output Fields

These fields are emitted when the rule matches.

FieldSource
_idKEEP _id
_versionKEEP _version
_indexKEEP _index
@timestampKEEP @timestamp
aws.*KEEP aws.*
cloud.*KEEP cloud.*
event.*KEEP event.*

AWS S3 Object Encryption Using External KMS Key

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

Identifies use of the S3 CopyObject API where the destination object is encrypted using an AWS KMS key from an external AWS account. This behavior may indicate ransomware-style impact activity where an adversary with access to a misconfigured S3 bucket encrypts objects using a KMS key they control, preventing the bucket owner from decrypting their own data. This technique is a critical early signal of destructive intent or cross-account misuse.

Known False Positives

  • Cross-account KMS key usage may be legitimate in multi-account AWS Organizations architectures where centralized encryption keys are used for data governance or auditing workflows. Confirm whether the external KMS key belongs to an expected account before taking action. Data migration or cross-account backup workflows may legitimately re-encrypt S3 objects using a key in another account. Ensure these workflows are documented, tied to known IAM roles, and occur on predictable schedules.

MITRE ATT&CK Coverage

TacticTechniques
Impact

Telemetry Coverage

Rules Detecting the Same Action

These rules filter on the same operation.

Rule Body

[metadata]
creation_date = "2024/07/02"
integration = ["aws"]
maturity = "production"
updated_date = "2026/04/10"

[rule]
author = ["Elastic"]
description = """
Identifies use of the S3 CopyObject API where the destination object is encrypted using an AWS KMS key from an external
AWS account. This behavior may indicate ransomware-style impact activity where an adversary with access to a
misconfigured S3 bucket encrypts objects using a KMS key they control, preventing the bucket owner from decrypting their
own data. This technique is a critical early signal of destructive intent or cross-account misuse.
"""
false_positives = [
    """
    Cross-account KMS key usage may be legitimate in multi-account AWS Organizations architectures where centralized
    encryption keys are used for data governance or auditing workflows. Confirm whether the external KMS key belongs to
    an expected account before taking action. Data migration or cross-account backup workflows may legitimately
    re-encrypt S3 objects using a key in another account. Ensure these workflows are documented, tied to known IAM
    roles, and occur on predictable schedules.
    """,
]
from = "now-6m"
language = "esql"
license = "Elastic License v2"
name = "AWS S3 Object Encryption Using External KMS Key"
note = """## Triage and analysis

### Investigating AWS S3 Object Encryption Using External KMS Key

This rule detects when an S3 `CopyObject` operation encrypts an object using a KMS key belonging to a different AWS account than the bucket owner. This behavior is unusual and a strong indicator of:

- Cloud ransomware techniques, where adversaries encrypt data using a key only they control.
- Cross-account privilege misuse, especially when an unauthorized principal has write access to S3.
- Misconfigured bucket permissions, enabling principals from another account to perform privileged copy operations.
- Early impact-stage activity in incidents where attackers prepare to destroy availability or deny the owner access.

The rule uses ESQL to identify cases where the `cloud.account.id` (bucket owner) differs from the dissected `kms_key_account_id` used for encrypting the new object version.


#### Possible investigation steps

**Identify the actor and access pathway**
- Review `aws.cloudtrail.user_identity.arn` and `aws.cloudtrail.user_identity.access_key_id`.
- Check whether the caller is:
  - A legitimate cross-account automation role,  
  - A compromised IAM user or workload identity, or  
  - A federated identity behaving outside of normal patterns.
- Inspect `user_agent.original` to determine whether the action came from the AWS Console, CLI, SDK, or unusual tooling.

**Analyze the encryption behavior**
- Inspect the dissected KMS key fields:
  - `Esql.aws_cloudtrail_request_parameters_kms_key_account_id`
  - `Esql.aws_cloudtrail_request_parameters_kms_key_id`
- Confirm whether the external key:
  - Belongs to an attacker-controlled account,  
  - Is unknown to your organization, or  
  - Lives in a shared or security tooling account.

**Assess the objects affected**
- Review:
  - `Esql.aws_cloudtrail_request_parameters_target_bucket_name`
  - `Esql.aws_cloudtrail_request_parameters_target_object_key`
- Identify:
  - Whether objects were overwritten or new encrypted copies were created.
  - The sensitivity or criticality of the affected data.
  - Whether object versioning is enabled (important for recovery).

**Correlate surrounding access patterns**
Pivot in CloudTrail on:
- The same access key ID  
- The same IAM principal  
- Affected bucket ARN  

Look for:
- `DeleteObject` or `DeleteObjects` calls (common in ransomware behavior)
- Mass enumeration prior to the event (`ListObjectsV2`, `GetObject`)
- Other impact-stage actions (`PutBucketPolicy`, `PutBucketAcl`, disabling logging)
- Attempts to encrypt additional objects in rapid succession

**Evaluate bucket permissions and exposure**
Review:
- S3 bucket policy changes
- IAM roles with `s3:PutObject` or `s3:PutObjectAcl` permissions
- Whether unintended cross-account `Principal` entries exist
- Whether the KMS key policy explicitly trusts your account or a foreign one

**Validate business justification**
- Confirm with storage, data engineering, or application teams whether:
  - Any migration, transformation, or backup workflows should be encrypting objects cross-account.
  - Scheduled jobs or CI/CD pipelines were operating at the time of the event.

### False positive analysis

- **Expected cross-account encryption**  
  Many organizations use centralized encryption accounts or shared security accounts. Validate:
  - Whether the KMS key account is part of your AWS Organization
  - Whether the workflow, role, or application is documented
  - Whether the principal routinely performs CopyObject operations

### Response and remediation

**Contain and prevent further impact**
- Immediately restrict S3 write access for the principal involved.
- If the KMS key is attacker-controlled, the impacted objects may be unrecoverable without versioning.
- If object versioning is disabled, enable it on the affected bucket to strengthen future resilience.

**Investigate scope and severity**
- Identify:
  - Additional objects encrypted using external keys
  - Related suspicious actions (delete, modify, exfiltration events)
  - Whether any ransom markers or unauthorized files were uploaded
- Validate whether the external KMS key grants *decrypt* permission back to the bucket owner (rare in attacker use).

**Recover and secure the bucket**
- Restore accessible previous versions if versioning is enabled.
- Revoke unauthorized access key pairs or session credentials.
- Audit bucket policies, ACLs, and IAM conditions (`aws:PrincipalArn`, `aws:SourceAccount`, `aws:SourceArn`).
- Tighten cross-account access controls:
  - Remove unintended `Principal` clauses
  - Restrict KMS usage to known accounts
  - Enforce SCPs that block cross-account KMS use unless explicitly approved

**Long-term hardening**
- Integrate object-level access logging and S3 server access logging into security monitoring.
- Add AWS Config rules (or Security Hub controls) detecting:
  - Public buckets
  - Cross-account access to S3
  - KMS policies permitting foreign principals
- Document required cross-account workflows and add explicit allowlists.

### Additional information

- **[AWS IR Playbooks](https://github.com/aws-samples/aws-incident-response-playbooks/blob/c151b0dc091755fffd4d662a8f29e2f6794da52c/playbooks/)** 
- **[AWS Customer Playbook Framework](https://github.com/aws-samples/aws-customer-playbook-framework/tree/a8c7b313636b406a375952ac00b2d68e89a991f2/docs)** 
- **Security Best Practices:** [AWS Knowledge Center – Security Best Practices](https://aws.amazon.com/premiumsupport/knowledge-center/security-best-practices/).
"""
references = [
    "https://docs.aws.amazon.com/AmazonS3/latest/userguide/UsingKMSEncryption.html/",
    "https://docs.aws.amazon.com/kms/latest/APIReference/API_GenerateDataKey.html/",
    "https://www.gem.security/post/cloud-ransomware-a-new-take-on-an-old-attack-pattern/",
    "https://rhinosecuritylabs.com/aws/s3-ransomware-part-1-attack-vector/",
]
risk_score = 47
rule_id = "ab8f074c-5565-4bc4-991c-d49770e19fc9"
setup = "AWS S3 data event types need to be enabled in the CloudTrail trail configuration for CopyObject events."
severity = "medium"
tags = [
    "Domain: Cloud",
    "Data Source: AWS",
    "Data Source: Amazon Web Services",
    "Data Source: AWS S3",
    "Data Source: AWS KMS",
    "Use Case: Threat Detection",
    "Tactic: Impact",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "esql"

query = '''
from logs-aws.cloudtrail-* metadata _id, _version, _index

// any successful S3 copy event
| where
  data_stream.dataset == "aws.cloudtrail"
  and event.provider == "s3.amazonaws.com"
  and event.action == "CopyObject"
  and event.outcome == "success"

// dissect request parameters to extract KMS key info and target object info
| dissect aws.cloudtrail.request_parameters
    "{%{?bucketName}=%{Esql.aws_cloudtrail_request_parameters_target_bucket_name},%{?x-amz-server-side-encryption-aws-kms-key-id}=%{?arn}:%{?aws}:%{?kms}:%{?region}:%{Esql.aws_cloudtrail_request_parameters_kms_key_account_id}:%{?key}/%{Esql.aws_cloudtrail_request_parameters_kms_key_id},%{?Host}=%{?tls.client.server.name},%{?x-amz-server-side-encryption}=%{?server_side_encryption},%{?x-amz-copy-source}=%{?bucket.object.name},%{?key}=%{Esql.aws_cloudtrail_request_parameters_target_object_key}}"

// detect cross-account key usage
| where cloud.account.id != Esql.aws_cloudtrail_request_parameters_kms_key_account_id

// keep ECS and dissected fields
| keep
  @timestamp,
  data_stream.namespace,
  user.name,
  user_agent.original,
  source.ip,
  aws.cloudtrail.user_identity.arn,
  aws.cloudtrail.user_identity.type,
  aws.cloudtrail.user_identity.access_key_id,
  aws.cloudtrail.resources.arn,
  aws.cloudtrail.resources.type,
  event.action,
  event.outcome,
  cloud.account.id,
  cloud.region,
  aws.cloudtrail.request_parameters,
  aws.cloudtrail.response_elements,
  Esql.aws_cloudtrail_request_parameters_target_bucket_name,
  Esql.aws_cloudtrail_request_parameters_target_object_key,
  Esql.aws_cloudtrail_request_parameters_kms_key_account_id,
  Esql.aws_cloudtrail_request_parameters_kms_key_id,
  _id,
  _version,
  _index
'''


[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1486"
name = "Data Encrypted for Impact"
reference = "https://attack.mitre.org/techniques/T1486/"


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

[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",
    "aws.cloudtrail.resources.arn",
    "aws.cloudtrail.resources.type",
    "event.action",
    "event.outcome",
    "cloud.account.id",
    "cloud.region",
    "aws.cloudtrail.request_parameters",
    "aws.cloudtrail.response_elements",
    "Esql.aws_cloudtrail_request_parameters_target_bucket_name",
    "Esql.aws_cloudtrail_request_parameters_target_object_key",
    "Esql.aws_cloudtrail_request_parameters_kms_key_account_id",
    "Esql.aws_cloudtrail_request_parameters_kms_key_id",
]

Stages and Predicates

Stage 1: from

from logs-aws.cloudtrail-* metadata _id, _version, _index

Stage 2: where

| where
  data_stream.dataset == "aws.cloudtrail"
  and event.provider == "s3.amazonaws.com"
  and event.action == "CopyObject"
  and event.outcome == "success"

Stage 3: dissect

| dissect aws.cloudtrail.request_parameters
    "{%{?bucketName}=%{Esql.aws_cloudtrail_request_parameters_target_bucket_name},%{?x-amz-server-side-encryption-aws-kms-key-id}=%{?arn}:%{?aws}:%{?kms}:%{?region}:%{Esql.aws_cloudtrail_request_parameters_kms_key_account_id}:%{?key}/%{Esql.aws_cloudtrail_request_parameters_kms_key_id},%{?Host}=%{?tls.client.server.name},%{?x-amz-server-side-encryption}=%{?server_side_encryption},%{?x-amz-copy-source}=%{?bucket.object.name},%{?key}=%{Esql.aws_cloudtrail_request_parameters_target_object_key}}"

Stage 4: where

| where cloud.account.id != Esql.aws_cloudtrail_request_parameters_kms_key_account_id

Stage 5: keep

| keep
  @timestamp,
  data_stream.namespace,
  user.name,
  user_agent.original,
  source.ip,
  aws.cloudtrail.user_identity.arn,
  aws.cloudtrail.user_identity.type,
  aws.cloudtrail.user_identity.access_key_id,
  aws.cloudtrail.resources.arn,
  aws.cloudtrail.resources.type,
  event.action,
  event.outcome,
  cloud.account.id,
  cloud.region,
  aws.cloudtrail.request_parameters,
  aws.cloudtrail.response_elements,
  Esql.aws_cloudtrail_request_parameters_target_bucket_name,
  Esql.aws_cloudtrail_request_parameters_target_object_key,
  Esql.aws_cloudtrail_request_parameters_kms_key_account_id,
  Esql.aws_cloudtrail_request_parameters_kms_key_id,
  _id,
  _version,
  _index

Indicators

These rows show field, operator, and value matches.

Output Fields

These fields are emitted when the rule matches.

FieldSource
@timestampKEEP @timestamp
data_stream.namespaceKEEP data_stream.namespace
user.nameKEEP user.name
user_agent.originalKEEP user_agent.original
source.ipKEEP source.ip
aws.cloudtrail.user_identity.arnKEEP aws.cloudtrail.user_identity.arn
aws.cloudtrail.user_identity.typeKEEP aws.cloudtrail.user_identity.type
aws.cloudtrail.user_identity.access_key_idKEEP aws.cloudtrail.user_identity.access_key_id
aws.cloudtrail.resources.arnKEEP aws.cloudtrail.resources.arn
aws.cloudtrail.resources.typeKEEP aws.cloudtrail.resources.type
event.actionKEEP event.action
event.outcomeKEEP event.outcome
cloud.account.idKEEP cloud.account.id
cloud.regionKEEP cloud.region
aws.cloudtrail.request_parametersKEEP aws.cloudtrail.request_parameters
aws.cloudtrail.response_elementsKEEP aws.cloudtrail.response_elements
Esql.aws_cloudtrail_request_parameters_target_bucket_nameKEEP Esql.aws_cloudtrail_request_parameters_target_bucket_name
Esql.aws_cloudtrail_request_parameters_target_object_keyKEEP Esql.aws_cloudtrail_request_parameters_target_object_key
Esql.aws_cloudtrail_request_parameters_kms_key_account_idKEEP Esql.aws_cloudtrail_request_parameters_kms_key_account_id
Esql.aws_cloudtrail_request_parameters_kms_key_idKEEP Esql.aws_cloudtrail_request_parameters_kms_key_id
_idKEEP _id
_versionKEEP _version
_indexKEEP _index

AWS Secrets Manager Rapid Secrets Retrieval

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

Identifies rapid secret retrieval activity from AWS Secrets Manager using the GetSecretValue or BatchGetSecretValue API actions. Adversaries who compromise an IAM user, instance role, or temporary credentials may attempt to enumerate or exfiltrate secrets in bulk to escalate privileges, move laterally, or gain persistence. This rule detects 20 or more unique secret retrievals by the same user identity within a short time window, which may indicate credential compromise or automated secret harvesting.

Known False Positives

  • Verify whether the user identity, user agent, and/or hostname should be using GetSecretValue or BatchGetSecretValue APIs for the specified SecretId. If known behavior is causing false positives, it can be exempted from the rule.

MITRE ATT&CK Coverage

Telemetry Coverage

Rules Detecting the Same Action

These rules filter on the same operation.

Rule Body

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

[rule]
author = ["Elastic"]
description = """
Identifies rapid secret retrieval activity from AWS Secrets Manager using the GetSecretValue or BatchGetSecretValue API
actions. Adversaries who compromise an IAM user, instance role, or temporary credentials may attempt to enumerate or
exfiltrate secrets in bulk to escalate privileges, move laterally, or gain persistence. This rule detects 20 or more
unique secret retrievals by the same user identity within a short time window, which may indicate credential compromise
or automated secret harvesting.
"""
false_positives = [
    """
    Verify whether the user identity, user agent, and/or hostname should be using GetSecretValue or BatchGetSecretValue
    APIs for the specified SecretId. If known behavior is causing false positives, it can be exempted from the rule.
    """,
]
from = "now-6m"
index = ["filebeat-*", "logs-aws.cloudtrail*"]
language = "kuery"
license = "Elastic License v2"
name = "AWS Secrets Manager Rapid Secrets Retrieval"
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, validate and adapt it for your operational needs.

### Investigating AWS Secrets Manager Rapid Secrets Retrieval

AWS Secrets Manager stores sensitive credentials such as database passwords, API keys, OAuth tokens, and service 
configuration values. In credential compromise scenarios, attackers frequently attempt to retrieve as many secrets as 
possible in a short timeframe to escalate privileges or move laterally across the environment.

This threshold rule triggers when a single user identity successfully retrieves 20 or more unique secrets using 
`GetSecretValue` or `BatchGetSecretValue` within a short timespan. Retrieval of many different secrets in rapid succession is highly unusual and strongly associated with reconnaissance, secret harvesting, or compromised automation.

Note: `BatchGetSecretValue` API calls the `GetSecretValue` API for each secret value; this alert only captures the `GetSecretValue` calls rather than the `BatchGetSecretValue` call itself.

#### Possible investigation steps

- **Identify the user or role**
  - Review `aws.cloudtrail.user_identity.arn`, `user.name`, and `aws.cloudtrail.user_identity.type`.
  - Determine whether the identity normally accesses Secrets Manager or is tied to a known automation workload.

- **Analyze the set of secrets retrieved**
  - Expand the alert in Timeline and review `aws.cloudtrail.request_parameters` for all `SecretId` values in the grouped threshold event.
  - Identify whether the accessed secrets include:
    - Privileged database credentials  
    - IAM user or service account credentials  
    - Production application secrets  
    - Rarely accessed or high-sensitivity secrets  

- **Assess the runtime context**
  - Investigate `source.ip`, `source.geo.location`, and `user_agent.original`.
  - Validate whether the calls originated from known internal automation (e.g., ECS task, Lambda runtime, EC2 instance profile) 
    or from an unexpected IP or user agent.

- **Correlate with other activity from the same identity**
  - Look for related reconnaissance or credential-access events:
    - `ListSecrets`, `DescribeSecret`
    - IAM enumeration (`ListUsers`, `GetCallerIdentity`)
    - Role-chaining or unusual `AssumeRole` flows  
  - Check for subsequent use of exposed credentials (RDS login attempts, API activity, abnormal resource access).

- **Determine whether unusual automation or deployment activity is occurring**
  - Confirm with application owners whether a new deployment, config reload, or migration might explain the multi-secret access.

### False positive analysis

- Legitimate application initialization or rollouts may retrieve many secrets once on startup.
- CI/CD pipelines or configuration management tools may enumerate secrets as part of environment bootstrapping.

To reduce noise, consider exceptions based on:
- Known service roles  
- Expected source IP ranges  
- Specific application identities tied to secret orchestration  

### Response and remediation

- **Containment**
  - Immediately revoke or disable the IAM user, role session, or instance profile if compromise is suspected.
  - Quarantine EC2/ECS/Lambda resources originating suspicious calls.

- **Investigation**
  - Identify all secrets accessed in the grouped alert and determine where those credentials are used.
  - Review CloudTrail for any suspicious follow-on activity using the retrieved secrets.
  - Assess whether additional identities or workloads show similar enumeration behavior.

- **Recovery and hardening**
  - Rotate all accessed secrets and update dependent systems.
  - Rotate IAM access keys or temporary credentials for the impacted identity.
  - Restrict permissions to Secrets Manager following least privilege.
  - Review automation and application behavior to ensure secrets are accessed only when required.
"""
references = [
    "https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_GetSecretValue.html",
    "https://detectioninthe.cloud/ttps/credential_access/access_secret_in_secrets_manager/",
    "https://cloud.hacktricks.xyz/pentesting-cloud/aws-security/aws-services/aws-secrets-manager-enum",
]
risk_score = 47
rule_id = "185c782e-f86a-11ee-9d9f-f661ea17fbce"
severity = "medium"
tags = [
    "Domain: Cloud",
    "Data Source: AWS",
    "Data Source: Amazon Web Services",
    "Data Source: AWS Secrets Manager",
    "Tactic: Credential Access",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "threshold"

query = '''
data_stream.dataset: "aws.cloudtrail" 
    and event.provider: "secretsmanager.amazonaws.com" 
    and event.action: "GetSecretValue" 
    and event.outcome: "success" 
    and not (
        user_agent.name: ("Chrome" or "Firefox" or "Safari" or "Edge" or "Brave" or "Opera") 
        or source.address: ("kafka.amazonaws.com" or "apidestinations.events.amazonaws.com")
    )
'''


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

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

[[rule.threat.technique]]
id = "T1213"
name = "Data from Information Repositories"
reference = "https://attack.mitre.org/techniques/T1213/"

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

[rule.threat.tactic]
id = "TA0009"
name = "Collection"
reference = "https://attack.mitre.org/tactics/TA0009/"
[rule.threshold]
field = ["user.id"]
value = 1
[[rule.threshold.cardinality]]
field = "aws.cloudtrail.request_parameters"
value = 20


Stages and Predicates

Stage 1: query

data_stream.dataset: "aws.cloudtrail" 
    and event.provider: "secretsmanager.amazonaws.com" 
    and event.action: "GetSecretValue" 
    and event.outcome: "success" 
    and not (
        user_agent.name: ("Chrome" or "Firefox" or "Safari" or "Edge" or "Brave" or "Opera") 
        or source.address: ("kafka.amazonaws.com" or "apidestinations.events.amazonaws.com")
    )
Threshold
gte 1
Cardinality
aws.cloudtrail.request_parameters ≥ 20

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
data_stream.dataseteq
  • aws.cloudtrail corpus 143 (elastic 143)
field:"data_stream.dataset" kind:eq value:"aws.cloudtrail"
event.actioneq
  • GetSecretValue corpus 2 (elastic 2)
field:"EventType" kind:eq value:"GetSecretValue"
event.outcomeeq
  • success corpus 306 (elastic 306)
field:"event.outcome" kind:eq value:"success"
event.providereq
  • secretsmanager.amazonaws.com corpus 2 (elastic 2)
field:"Provider_Name" kind:eq value:"secretsmanager.amazonaws.com"

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
source.addressinapidestinations.events.amazonaws.com, kafka.amazonaws.comexcludes:source.address field:"source.address" value:"apidestinations.events.amazonaws.com" field:"source.address" value:"kafka.amazonaws.com"
user_agent.nameinBrave, Chrome, Edge, Firefox, Opera, Safariexcludes:user_agent.name

Credential Access via TruffleHog Execution

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

This rule detects the execution of TruffleHog, a tool used to search for high-entropy strings and secrets in code repositories, which may indicate an attempt to access credentials. This tool was abused by the Shai-Hulud worm to search for credentials in code repositories.

Known False Positives

  • Trufflehog is a legitimate open-source tool used by security professionals and developers to search for sensitive information, such as passwords, API keys, and other secrets, within code repositories. It is commonly employed during security assessments and code reviews to identify potential vulnerabilities.

MITRE ATT&CK Coverage

Rule Body

[metadata]
creation_date = "2025/09/18"
integration = ["endpoint", "windows", "system", "m365_defender", "sentinel_one_cloud_funnel", "crowdstrike", "auditd_manager"]
maturity = "production"
updated_date = "2026/04/07"

[rule]
author = ["Elastic"]
description = """
This rule detects the execution of TruffleHog, a tool used to search for high-entropy strings and secrets
in code repositories, which may indicate an attempt to access credentials. This tool was abused by the Shai-Hulud
worm to search for credentials in code repositories.
"""
false_positives = [
    """
    Trufflehog is a legitimate open-source tool used by security professionals and developers to search for sensitive
    information, such as passwords, API keys, and other secrets, within code repositories. It is commonly employed
    during security assessments and code reviews to identify potential vulnerabilities.
    """,
]
from = "now-9m"
index = [
    "endgame-*",
    "logs-crowdstrike.fdr*",
    "logs-endpoint.events.process-*",
    "logs-m365_defender.event-*",
    "logs-sentinel_one_cloud_funnel.*",
    "logs-system.security*",
    "logs-windows.forwarded*",
    "logs-windows.sysmon_operational-*",
    "winlogbeat-*",
    "auditbeat-*",
    "logs-auditd_manager.auditd-*"
]
language = "eql"
license = "Elastic License v2"
name = "Credential Access via TruffleHog Execution"
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 Credential Access via TruffleHog Execution

This rule flags TruffleHog executed to scan the local filesystem with verified JSON results, a direct path to harvesting secrets from source code, configs, and build artifacts. Attackers gain shell access on a developer workstation or CI runner, clone or point to internal repositories, run 'trufflehog --results=verified --json filesystem .' to enumerate valid tokens, and then pivot using the recovered keys to pull private code or authenticate to cloud and CI/CD systems.

### Possible investigation steps

- Review binary path, code signature/hash, parent process chain, initiating user, and host role (developer workstation vs CI runner) to quickly decide if the execution matches an approved secret-scanning job or an ad‑hoc run.
- Determine the working directory and target path used by the scan to identify which repositories or configuration directories were inspected and whether sensitive files (e.g., .env, deployment keys, build secrets) were in scope.
- Pivot to same-session activity to spot credential use or exfiltration by correlating subsequent outbound connections to git remotes or cloud/CI APIs and launches of developer CLIs like git, gh, aws, az, gcloud, docker, kubectl, or vault.
- Look for output artifacts and exfil channels by checking for creation or deletion of JSON reports or archives, clipboard access, or piping of results to curl/wget/netcat and whether those artifacts were emailed or uploaded externally.
- Cross-check VCS and CI/CD audit logs for this identity and host for unusual pushes, pipeline changes, or new tokens issued shortly after the scan, which may indicate worm-like propagation or credential abuse.

### False positive analysis

- An approved secret-scanning task by a developer or security engineer runs trufflehog with --results=verified --json filesystem to audit local code and configuration, producing benign activity on a development host.
- An internal automation or scheduled job invokes trufflehog to baseline filesystem secrets for compliance or hygiene checks, leading to expected process-start logs without credential abuse.

### Response and remediation

- Immediately isolate the host or CI runner, terminate the trufflehog process and its parent shell/script, and block egress to git remotes and cloud APIs from that asset.
- Collect the verified findings from trufflehog output (stdout or JSON file), revoke and rotate any listed secrets (GitHub personal access tokens, AWS access keys, Azure service principal credentials, CI job tokens), and clear credential caches on the host.
- Remove unauthorized trufflehog binaries/packages, helper scripts, and scheduled tasks; delete report files and scanned working directories (local repo clones, .env/config folders), and purge shell history containing exfil commands like curl/wget/netcat.
- Restore the workstation or runner from a known-good image if tampering is suspected, re-enroll endpoint protection, reissue required developer or CI credentials with least privilege, and validate normal pulls to internal git and cloud services.
- Escalate to full incident response if trufflehog ran under a service account, on a build server/CI runner, or if any discovered secret was used to authenticate to external git remotes (e.g., github.com), cloud APIs, or private registries in the same session.
- Harden by blocking unapproved trufflehog execution via application control, moving approved secret scanning to a locked-down pipeline, enforcing short-lived PATs and key rotation, enabling egress filtering from developer hosts/runners, and deploying fleet-wide detections for "trufflehog --results=verified --json filesystem".
"""
references = [
    "https://www.elastic.co/blog/shai-hulud-worm-npm-supply-chain-compromise",
    "https://socket.dev/blog/shai-hulud-strikes-again-v2",
]
risk_score = 47
rule_id = "47595dea-452b-4d37-b82d-6dd691325139"
severity = "medium"
tags = [
    "Domain: Endpoint",
    "OS: Linux",
    "OS: Windows",
    "OS: macOS",
    "Use Case: Threat Detection",
    "Tactic: Credential Access",
    "Data Source: Elastic Endgame",
    "Data Source: Elastic Defend",
    "Data Source: Windows Security Event Logs",
    "Data Source: Microsoft Defender XDR",
    "Data Source: Sysmon",
    "Data Source: SentinelOne",
    "Data Source: Crowdstrike",
    "Data Source: Auditd Manager",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
process where event.type == "start" and process.name : ("trufflehog.exe", "trufflehog") and
process.args == "--json" and process.args == "filesystem"
'''

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

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

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

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

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

[[rule.threat.technique]]
id = "T1005"
name = "Data from Local System"
reference = "https://attack.mitre.org/techniques/T1005/"

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

Stages and Predicates

Stage 1: process

process where event.type == "start" and process.name : ("trufflehog.exe", "trufflehog") and
process.args == "--json" and process.args == "filesystem"

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.argseq
  • --json corpus 3 (elastic 3)
  • filesystem corpus 3 (elastic 3)
field:"process.args" kind:eq
process.namewildcard
  • trufflehog
  • trufflehog.exe
field:"process_basename" kind:wildcard

Delegated Managed Service Account Modification by an Unusual User

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

Detects modifications to the msDS-ManagedAccountPrecededByLink attribute of a delegated managed service account by an unusual subject account. Attackers can abuse this attribute to inherit a target account's permissions and further elevate privileges.

MITRE ATT&CK Coverage

Telemetry Coverage

Rule Body

[metadata]
creation_date = "2025/05/23"
integration = ["system", "windows"]
maturity = "production"
updated_date = "2026/05/03"

[rule]
author = ["Elastic"]
description = """
Detects modifications to the msDS-ManagedAccountPrecededByLink attribute of a delegated managed service account by an
unusual subject account. Attackers can abuse this attribute to inherit a target account's permissions and further
elevate privileges.
"""
from = "now-9m"
index = ["winlogbeat-*", "logs-system.security*", "logs-windows.forwarded*"]
language = "kuery"
license = "Elastic License v2"
name = "Delegated Managed Service Account Modification by an Unusual User"
references = ["https://www.akamai.com/blog/security-research/abusing-dmsa-for-privilege-escalation-in-active-directory"]
risk_score = 73
rule_id = "2c74e26b-dfe3-4644-b62b-d0482f124210"
severity = "high"
tags = [
    "Domain: Endpoint",
    "OS: Windows",
    "Use Case: Threat Detection",
    "Tactic: Privilege Escalation",
    "Use Case: Active Directory Monitoring",
    "Data Source: Active Directory",
    "Data Source: Windows Security Event Logs",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "new_terms"

query = '''
event.code:5136 and host.os.type:"windows" and winlog.event_data.AttributeLDAPDisplayName:"msDS-ManagedAccountPrecededByLink"
'''

note = """## Triage and analysis

### Investigating Delegated Managed Service Account Modification by an Unusual User

#### Possible investigation steps

- What dMSA link did the alert record?
  - Focus: confirm 5136 with `winlog.event_data.AttributeLDAPDisplayName` "msDS-ManagedAccountPrecededByLink"; read `winlog.event_data.ObjectDN`, `winlog.event_data.ObjectClass`, `winlog.event_data.AttributeValue`, and `winlog.event_data.OperationType` for dMSA, superseded account DN, and change type.
  - Implication: escalate when the link targets a privileged, sync, backup, or widely trusted service account, or the modified object is unexpected; lower suspicion only when object, link, and change type fit one low-impact migration pair.
- Did the controller operation look like bounded dMSA migration or direct link write?
  - Why: real migration should not be a lone sensitive attribute write; BadSuccessor risk rises when the link is isolated or paired with unrelated high-impact changes.
  - Focus: review same-controller 5136 changes by `winlog.event_data.OpCorrelationID`; compare `winlog.event_data.ObjectDN`, `winlog.event_data.AttributeLDAPDisplayName`, `winlog.event_data.OperationType`, and `winlog.event_data.AttributeValue`. $investigate_0
  - Hint: if the operation ID is incomplete, query 5136 on `host.id` plus `winlog.event_data.SubjectLogonId` for same-session dMSA or privileged-object changes.
  - Implication: escalate on standalone link write, unexpected value replacement, or unrelated ACL, delegation, SPN, or service-account changes; lower suspicion when same-operation or same-session changes stay bounded to one expected migration pair.
- Who wrote the link, and does the identity fit dMSA management?
  - Focus: use `winlog.event_data.SubjectUserSid`, `winlog.event_data.SubjectUserName`, `winlog.event_data.SubjectDomainName`, `winlog.event_data.SubjectLogonId`, and `winlog.computer_name` to identify writer, controller session, and service vs human.
  - Implication: escalate when the writer is an unfamiliar human, helpdesk account, or low-privilege service identity for dMSA management; keep unresolved when a recognized writer is not tied to the exact dMSA pair.
- Did the writer session originate from an expected source and logon type?
  - Focus: pivot from `winlog.event_data.SubjectLogonId` and `host.id` to authentication where `winlog.event_data.TargetLogonId` matches; review `source.ip`, `winlog.logon.type`, and `winlog.event_data.AuthenticationPackageName`. $investigate_1
  - Hint: search 4648 on `winlog.event_data.SubjectLogonId` for explicit-credential use; missing authentication records or `source.ip` are unresolved, not benign.
  - Implication: escalate when the session starts from an unexpected host, uses unusual interactive/RDP logon, or shows explicit-credential behavior outside the writer's role; expected source and logon type support closure only after link target and operation cohere.
- Did the linked dMSA or superseded account authenticate from unexpected systems after the change?
  - Why: risk peaks when the new dMSA relationship is exercised from hosts that should not use the inherited service account.
  - Focus: derive dMSA and superseded account names from `winlog.event_data.ObjectDN` and `winlog.event_data.AttributeValue`, then review authentication by `winlog.event_data.TargetUserName`, `source.ip`, and `winlog.logon.type`.
  - Hint: missing authentication telemetry is unresolved, not benign; an unused link still needs disposition from link target, writer, and sequence.
  - Implication: escalate when either account authenticates from a new host, admin workstation, or service path after the change; unchanged or absent use does not clear suspicion.
- If still suspicious or unresolved, do recent writer or dMSA alerts show broader abuse?
  - Focus: review recent alerts for modifying `user.id`, then modified `winlog.event_data.ObjectGUID`. $investigate_2
  - Hint: use object alerts for shadow credentials, delegation abuse, unusual service changes, or other AD tampering tied to the dMSA. $investigate_3
  - Implication: escalate and widen scope when either alert set shows privilege abuse, directory tampering, or suspicious authentication; keep scope local when both are quiet and local evidence is the only unresolved signal.
- What disposition fits?
  - Weigh link target, operation, writer/session, follow-on use, and related alerts: escalate on high-value link, incoherent operation, unexpected writer/session, new use, or AD abuse; close only when all evidence proves one exact migration; mixed/incomplete evidence -> preserve directory-change and session records, then escalate.

### False positive analysis

- Planned dMSA migration by identity/service-account admins may set "msDS-ManagedAccountPrecededByLink". Confirm `winlog.event_data.ObjectDN`, planned `winlog.event_data.AttributeValue`, paired `winlog.event_data.OpCorrelationID`, `winlog.event_data.SubjectUserSid`, recovered `source.ip`, and `winlog.logon.type` match migration account/host path. Telemetry-only closure requires anchors proving one bounded migration; otherwise require records, tickets, or identity-admin confirmation for the exact dMSA pair and writer. Do not close from recurrence or role assumptions.
- Lab validation or staged service-account modernization may trigger. Confirm `winlog.event_data.ObjectDN` and `winlog.event_data.AttributeValue` stay in the authorized test/staging OU, session avoids unrelated privileged objects, and follow-on `winlog.event_data.TargetUserName` or `source.ip` is limited to test hosts. Telemetry-only closure requires test OU, writer, bounded change set, and follow-on hosts proving lab scope; otherwise require test records or lab owner confirmation.
- Before exception, confirm the exact workflow: `winlog.event_data.SubjectUserSid`, `winlog.event_data.ObjectDN`, `winlog.event_data.AttributeValue`, bounded `winlog.event_data.OpCorrelationID`, and recovered controller or source path. Use exceptions only when that verified workflow should repeat; avoid exceptions on the attribute, 5136, or all dMSA changes.

### Response and remediation

- If confirmed benign, reverse containment and record: writer SID, dMSA DN, superseded account DN, bounded sequence, recovered source path, and external confirmation for the change. Create an exception only when that workflow should repeat.
- If suspicious but unconfirmed, export the triggering 5136 record, same-operation change sequence, writer-session auth records, explicit-credential evidence, and related alerts before destructive changes. Apply reversible containment first: restrict the recovered source host from domain controllers or monitor the writer, modified dMSA, and superseded account. Disable the writer or isolate the source host only if additional privileged changes, unexpected follow-on authentication, or related alerts appear.
- If confirmed malicious, preserve directory-change and session evidence first, then use endpoint response to isolate the recovered source host and disable/reset the malicious dMSA, compromised writer, and affected superseded service account. If endpoint response is unavailable on the source system, escalate with preserved `source.ip`, `winlog.event_data.SubjectUserSid`, `winlog.event_data.SubjectLogonId`, `winlog.event_data.ObjectGUID`, and related 5136, 4624, or 4648 evidence to responders. Review hosts/services that used the same superseded account or new dMSA before cleanup, verify rollback replication across domain controllers, and only then remove the unauthorized `winlog.event_data.AttributeValue` link, roll back related migration/SPN/delegation changes in the same `winlog.event_data.OpCorrelationID` sequence, and rotate affected secrets or restore service bindings.
- Post-incident hardening: restrict dMSA creation/migration rights, verify domain-controller retention for 5136, 4624, and 4648, and record the migration workflow or BadSuccessor evidence for reuse.
"""

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

[rule.investigation_fields]
field_names = [
    "@timestamp",
    "event.code",
    "winlog.event_data.SubjectUserName",
    "winlog.event_data.SubjectUserSid",
    "winlog.event_data.SubjectDomainName",
    "winlog.event_data.SubjectLogonId",
    "winlog.event_data.ObjectDN",
    "winlog.event_data.ObjectGUID",
    "winlog.event_data.ObjectClass",
    "winlog.event_data.AttributeLDAPDisplayName",
    "winlog.event_data.AttributeValue",
    "winlog.event_data.OperationType",
    "winlog.event_data.OpCorrelationID",
    "host.id",
    "winlog.computer_name",
]

[transform]

[[transform.investigate]]
label = "Directory changes for the same operation on this controller"
description = ""
providers = [
  [
    { excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" },
    { excluded = false, field = "winlog.event_data.OpCorrelationID", queryType = "phrase", value = "{{winlog.event_data.OpCorrelationID}}", valueType = "string" },
    { excluded = false, field = "event.code", queryType = "phrase", value = "5136", valueType = "string" }
  ]
]
relativeFrom = "now-1h"
relativeTo = "now"

[[transform.investigate]]
label = "Authentication events for the writer session on this controller"
description = ""
providers = [
  [
    { excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" },
    { excluded = false, field = "winlog.event_data.TargetLogonId", queryType = "phrase", value = "{{winlog.event_data.SubjectLogonId}}", valueType = "string" }
  ]
]
relativeFrom = "now-48h/h"
relativeTo = "now"

[[transform.investigate]]
label = "Alerts associated with the source account"
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" }
  ],
  [
    { excluded = false, field = "event.kind", queryType = "phrase", value = "signal", valueType = "string" },
    { excluded = false, field = "winlog.event_data.SubjectUserSid", queryType = "phrase", value = "{{winlog.event_data.SubjectUserSid}}", valueType = "string" }
  ]
]
relativeFrom = "now-48h/h"
relativeTo = "now"

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

[rule.new_terms]
field = "new_terms_fields"
value = ["winlog.event_data.SubjectUserName"]
[[rule.new_terms.history_window_start]]
field = "history_window_start"
value = "now-7d"

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

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

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

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

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

Stages and Predicates

Stage 1: new_terms

event.code:5136 and host.os.type:"windows" and winlog.event_data.AttributeLDAPDisplayName:"msDS-ManagedAccountPrecededByLink"

Indicators

These rows show field, operator, and value matches.

Evasion via Sleep API Hooking

#
Source
github.com/elastic/protections-artifacts

Identifies attempts to hook the Sleep function. This may indicate an attempt to evade detection by tampering the normal behavior of this function to obfuscate the malware content in memory while sleeping.

MITRE ATT&CK Coverage

TacticTechniques
Stealth

Rule Body

[rule]
description = """
Identifies attempts to hook the Sleep function. This may indicate an attempt to evade detection by tampering the normal
behavior of this function to obfuscate the malware content in memory while sleeping.
"""
id = "a4e1883e-e203-4b65-9cb0-b582081b0bf8"
license = "Elastic License v2"
name = "Evasion via Sleep API Hooking"
os_list = ["windows"]
version = "1.0.6"

query = '''
api where process.Ext.api.name in ("WriteProcessMemory", "VirtualProtect", "VirtualProtectEx") and
 process.Ext.api.metadata.target_address_name == "kernel32.dll!Sleep" and
 process.Ext.token.integrity_level_name != "low" and
 not _arraysearch(process.thread.Ext.call_stack_final_user_module.code_signature, $entry, $entry.trusted == true and
                  $entry.subject_name in ("FireEye, Inc.", "Sophos Ltd", "Microsoft Windows Hardware Compatibility Publisher", "Microsoft Windows Software Compatibility Publisher", "Trend Micro, Inc.", "Symantec Corporation", "Bitdefender SRL", "Carbon Black, Inc.")) and
 not process.thread.Ext.call_stack_final_user_module.protection_provenance like ("Kernel", "Kernel|*") and
 not _arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info: "c:\\windows\\system32\\kernel32.dll!ExitProcess*") and
 not process.thread.Ext.call_stack_final_user_module.name in ("Kernel", "Unknown", "Undetermined") and 
 not process.thread.Ext.call_stack_final_user_module.hash.sha256 in
                  ("d0fe1eecad868460c162fd40cacf2ac954008b2de1234b2d1cd3b1e361f5e6c0",
                   "e376f3c42c5806ccc2f9051db611d14057444dd6012b0a80f5e50aeea7a4d97a",
                   "c7d4e4d82e5d9b326c05e968c7236daf4ddefe35060049e079bf51910f81996e",
                   "519ee50c16137e1b1643a2b726cd34fff876719692cd37e06f08546ee44285e8",
                   "854156e019372fbf49b7d6f7278a05a74f0e41572572ca6beeb2dca672e53270")
'''

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

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


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

[internal]
min_endpoint_version = "8.10.0"

Stages and Predicates

Stage 1: api

api where process.Ext.api.name in ("WriteProcessMemory", "VirtualProtect", "VirtualProtectEx") and
 process.Ext.api.metadata.target_address_name == "kernel32.dll!Sleep" and
 process.Ext.token.integrity_level_name != "low" and
 not _arraysearch(process.thread.Ext.call_stack_final_user_module.code_signature, $entry, $entry.trusted == true and
                  $entry.subject_name in ("FireEye, Inc.", "Sophos Ltd", "Microsoft Windows Hardware Compatibility Publisher", "Microsoft Windows Software Compatibility Publisher", "Trend Micro, Inc.", "Symantec Corporation", "Bitdefender SRL", "Carbon Black, Inc.")) and
 not process.thread.Ext.call_stack_final_user_module.protection_provenance like ("Kernel", "Kernel|*") and
 not _arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info: "c:\\windows\\system32\\kernel32.dll!ExitProcess*") and
 not process.thread.Ext.call_stack_final_user_module.name in ("Kernel", "Unknown", "Undetermined") and 
 not process.thread.Ext.call_stack_final_user_module.hash.sha256 in
                  ("d0fe1eecad868460c162fd40cacf2ac954008b2de1234b2d1cd3b1e361f5e6c0",
                   "e376f3c42c5806ccc2f9051db611d14057444dd6012b0a80f5e50aeea7a4d97a",
                   "c7d4e4d82e5d9b326c05e968c7236daf4ddefe35060049e079bf51910f81996e",
                   "519ee50c16137e1b1643a2b726cd34fff876719692cd37e06f08546ee44285e8",
                   "854156e019372fbf49b7d6f7278a05a74f0e41572572ca6beeb2dca672e53270")

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
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_stackarray_any(no value, null check)excludes:process.thread.Ext.call_stack
process.thread.Ext.call_stack_final_user_module.hash.sha256in519ee50c16137e1b1643a2b726cd34fff876719692cd37e06f08546ee44285e8, 854156e019372fbf49b7d6f7278a05a74f0e41572572ca6beeb2dca672e53270, c7d4e4d82e5d9b326c05e968c7236daf4ddefe35060049e079bf51910f81996e, d0fe1eecad868460c162fd40cacf2ac954008b2de1234b2d1cd3b1e361f5e6c0, e376f3c42c5806ccc2f9051db611d14057444dd6012b0a80f5e50aeea7a4d97aexcludes:process.thread.Ext.call_stack_final_user_module.hash.sha256
process.thread.Ext.call_stack_final_user_module.nameinKernel, Undetermined, Unknownexcludes:process.thread.Ext.call_stack_final_user_module.name field:"process.thread.Ext.call_stack_final_user_module.name" value:"Kernel" field:"process.thread.Ext.call_stack_final_user_module.name" value:"Undetermined" field:"process.thread.Ext.call_stack_final_user_module.name" value:"Unknown"
process.thread.Ext.call_stack_final_user_module.protection_provenancewildcardKernel, Kernel|*excludes:process.thread.Ext.call_stack_final_user_module.protection_provenance field:"process.thread.Ext.call_stack_final_user_module.protection_provenance" value:"Kernel" field:"process.thread.Ext.call_stack_final_user_module.protection_provenance" value:"Kernel|*"

Execution via Windows Subsystem for Linux

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

Detects attempts to execute a program on the host from the Windows Subsystem for Linux. Adversaries may enable and use WSL for Linux to avoid detection.

MITRE ATT&CK Coverage

Rules Detecting the Same Action

These rules filter on the same operation.

Rule Body

[metadata]
creation_date = "2023/01/12"
integration = ["endpoint", "windows", "system", "m365_defender", "sentinel_one_cloud_funnel", "crowdstrike"]
maturity = "production"
updated_date = "2026/05/04"

[rule]
author = ["Elastic"]
description = """
Detects attempts to execute a program on the host from the Windows Subsystem for Linux. Adversaries may enable and use
WSL for Linux to avoid detection.
"""
from = "now-9m"
index = [
    "endgame-*",
    "logs-crowdstrike.fdr*",
    "logs-endpoint.events.process-*",
    "logs-m365_defender.event-*",
    "logs-sentinel_one_cloud_funnel.*",
    "logs-system.security*",
    "logs-windows.forwarded*",
    "logs-windows.sysmon_operational-*",
    "winlogbeat-*",
]
language = "eql"
license = "Elastic License v2"
name = "Execution via Windows Subsystem for Linux"
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 Execution via Windows Subsystem for Linux

Windows Subsystem for Linux (WSL) allows users to run Linux binaries natively on Windows, providing a seamless integration of Linux tools. Adversaries may exploit WSL to execute malicious scripts or binaries, bypassing traditional Windows security mechanisms. The detection rule identifies suspicious executions initiated by WSL processes, excluding known safe executables, to flag potential misuse for defense evasion.

### Possible investigation steps

- Review the process details to identify the executable path and determine if it matches any known malicious or suspicious binaries not listed in the safe executables.
- Investigate the parent process, specifically wsl.exe or wslhost.exe, to understand how the execution was initiated and if it aligns with expected user behavior or scheduled tasks.
- Check the user account associated with the process execution to verify if the activity is consistent with the user's typical behavior or if the account may have been compromised.
- Analyze the event dataset, especially if it is from crowdstrike.fdr, to gather additional context about the process execution and any related activities on the host.
- Correlate the alert with other security events or logs from data sources like Microsoft Defender XDR or SentinelOne to identify any related suspicious activities or patterns.
- Assess the risk score and severity in the context of the organization's environment to prioritize the investigation and response actions accordingly.

### False positive analysis

- Legitimate administrative tasks using WSL may trigger alerts. Users can create exceptions for known administrative scripts or binaries that are frequently executed via WSL.
- Development environments often use WSL for compiling or testing code. Exclude specific development tools or scripts that are regularly used by developers to prevent unnecessary alerts.
- Automated system maintenance scripts running through WSL can be mistaken for malicious activity. Identify and whitelist these scripts to reduce false positives.
- Security tools or monitoring solutions that leverage WSL for legitimate purposes should be identified and excluded from detection to avoid interference with their operations.
- Frequent use of WSL by specific users or groups for non-malicious purposes can be managed by creating user-based exceptions, allowing their activities to proceed without triggering alerts.

### Response and remediation

- Isolate the affected system from the network to prevent further malicious activity and lateral movement.
- Terminate any suspicious processes identified as being executed via WSL that are not part of the known safe executables list.
- Conduct a thorough review of the affected system's WSL configuration and installed Linux distributions to identify unauthorized changes or installations.
- Remove any unauthorized or malicious scripts and binaries found within the WSL environment.
- Restore the system from a known good backup if malicious activity has compromised system integrity.
- Update and patch the system to ensure all software, including WSL, is up to date to mitigate known vulnerabilities.
- Escalate the incident to the security operations center (SOC) or incident response team for further analysis and to determine if additional systems are affected."""
references = ["https://learn.microsoft.com/en-us/windows/wsl/wsl-config"]
risk_score = 47
rule_id = "db7dbad5-08d2-4d25-b9b1-d3a1e4a15efd"
severity = "medium"
tags = [
    "Domain: Endpoint",
    "OS: Windows",
    "Use Case: Threat Detection",
    "Tactic: Defense Evasion",
    "Data Source: Elastic Endgame",
    "Data Source: Elastic Defend",
    "Data Source: Windows Security Event Logs",
    "Data Source: Microsoft Defender XDR",
    "Data Source: SentinelOne",
    "Data Source: Crowdstrike",
    "Resources: Investigation Guide",
    "Data Source: Sysmon",
]
timestamp_override = "event.ingested"
type = "eql"

query = '''
process where host.os.type == "windows" and event.type : "start" and process.command_line != null and
  process.parent.name : ("wsl.exe", "wslhost.exe") and
  not process.executable : (
        "?:\\Program Files (x86)\\*",
        "?:\\Program Files\\*",
        "?:\\Program Files*\\WindowsApps\\MicrosoftCorporationII.WindowsSubsystemForLinux_*\\wsl*.exe",
        "?:\\Windows\\System32\\conhost.exe",
        "?:\\Windows\\System32\\lxss\\wslhost.exe",
        "?:\\Windows\\System32\\WerFault.exe",
        "?:\\Windows\\System32\\wsl.exe",
        "?:\\Windows\\Sys?????\\wslconfig.exe"
  ) and
  not (
    /* Crowdstrike specific exclusion as it uses NT Object paths */
    (data_stream.dataset == "crowdstrike.fdr" or event.action == "ProcessRollup2") and
      process.executable : (
        "\\Device\\HarddiskVolume*\\Program Files (x86)\\*",
        "\\Device\\HarddiskVolume*\\Program Files\\*",
        "\\Device\\HarddiskVolume*\\Program Files*\\WindowsApps\\MicrosoftCorporationII.WindowsSubsystemForLinux_*\\wsl*.exe",
        "\\Device\\HarddiskVolume*\\Windows\\System32\\conhost.exe",
        "\\Device\\HarddiskVolume*\\Windows\\System32\\lxss\\wslhost.exe",
        "\\Device\\HarddiskVolume*\\Windows\\System32\\WerFault.exe",
        "\\Device\\HarddiskVolume*\\Windows\\System32\\wsl.exe",
        "\\Device\\HarddiskVolume*\\Windows\\Sys?????\\wslconfig.exe"
      )
  ) and
  not (
    (process.name : "cmd.exe" and process.command_line : "*echo*%USERPROFILE%*") or
    (process.name : "git.exe" and process.command_line : "git.exe -c log.*") or
    (process.name : "powershell.exe" and process.command_line : "powershell.exe -Command $env:USERPROFILE") or
    (process.name : "Code.exe" and process.command_line : ("*cli.js --folder-uri=vscode-remote://wsl*", "ms-vscode-remote.remote-wsl"))
  )
'''

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 = "T1202"
name = "Indirect Command Execution"
reference = "https://attack.mitre.org/techniques/T1202/"

[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.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.command_line != null and
  process.parent.name : ("wsl.exe", "wslhost.exe") and
  not process.executable : (
        "?:\\Program Files (x86)\\*",
        "?:\\Program Files\\*",
        "?:\\Program Files*\\WindowsApps\\MicrosoftCorporationII.WindowsSubsystemForLinux_*\\wsl*.exe",
        "?:\\Windows\\System32\\conhost.exe",
        "?:\\Windows\\System32\\lxss\\wslhost.exe",
        "?:\\Windows\\System32\\WerFault.exe",
        "?:\\Windows\\System32\\wsl.exe",
        "?:\\Windows\\Sys?????\\wslconfig.exe"
  ) and
  not (
    (data_stream.dataset == "crowdstrike.fdr" or event.action == "ProcessRollup2") and
      process.executable : (
        "\\Device\\HarddiskVolume*\\Program Files (x86)\\*",
        "\\Device\\HarddiskVolume*\\Program Files\\*",
        "\\Device\\HarddiskVolume*\\Program Files*\\WindowsApps\\MicrosoftCorporationII.WindowsSubsystemForLinux_*\\wsl*.exe",
        "\\Device\\HarddiskVolume*\\Windows\\System32\\conhost.exe",
        "\\Device\\HarddiskVolume*\\Windows\\System32\\lxss\\wslhost.exe",
        "\\Device\\HarddiskVolume*\\Windows\\System32\\WerFault.exe",
        "\\Device\\HarddiskVolume*\\Windows\\System32\\wsl.exe",
        "\\Device\\HarddiskVolume*\\Windows\\Sys?????\\wslconfig.exe"
      )
  ) and
  not (
    (process.name : "cmd.exe" and process.command_line : "*echo*%USERPROFILE%*") or
    (process.name : "git.exe" and process.command_line : "git.exe -c log.*") or
    (process.name : "powershell.exe" and process.command_line : "powershell.exe -Command $env:USERPROFILE") or
    (process.name : "Code.exe" and process.command_line : ("*cli.js --folder-uri=vscode-remote://wsl*", "ms-vscode-remote.remote-wsl"))
  )

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.typewildcard
  • start corpus 67 (elastic 67)
field:"event.type" kind:wildcard value:"start"
process.command_lineis_not_null
  • (no value, null check)
field:"CommandLine" kind:is_not_null
process.parent.namewildcard
  • wsl.exe corpus 2 (elastic 2)
  • wslhost.exe
field:"parent_process_basename" kind:wildcard

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
data_stream.dataseteqcrowdstrike.fdrexcludes:data_stream.dataset field:"data_stream.dataset" value:"crowdstrike.fdr"
event.actioneqProcessRollup2excludes:event.action field:"event.action" value:"ProcessRollup2"
process.executablewildcard\Device\HarddiskVolume*\Program Files (x86)\*, \Device\HarddiskVolume*\Program Files\*, \Device\HarddiskVolume*\Program Files*\WindowsApps\MicrosoftCorporationII.WindowsSubsystemForLinux_*\wsl*.exe, \Device\HarddiskVolume*\Windows\System32\conhost.exe, \Device\HarddiskVolume*\Windows\System32\lxss\wslhost.exe, \Device\HarddiskVolume*\Windows\System32\WerFault.exe, \Device\HarddiskVolume*\Windows\System32\wsl.exe, \Device\HarddiskVolume*\Windows\Sys?????\wslconfig.exeexcludes:process.executable
process.command_lineeqpowershell.exe -Command $env:USERPROFILEexcludes:process.command_line field:"process.command_line" value:"powershell.exe -Command $env:USERPROFILE"
process.nameeqpowershell.exeexcludes:process.name field:"process.name" value:"powershell.exe"
process.command_linestarts_withgit.exe -c log.excludes:process.command_line field:"process.command_line" value:"git.exe -c log."
process.nameeqgit.exeexcludes:process.name field:"process.name" value:"git.exe"
process.command_linewildcard*cli.js --folder-uri=vscode-remote://wsl*, ms-vscode-remote.remote-wslexcludes:process.command_line field:"process.command_line" value:"*cli.js --folder-uri=vscode-remote://wsl*" field:"process.command_line" value:"ms-vscode-remote.remote-wsl"
process.nameeqCode.exeexcludes:process.name field:"process.name" value:"Code.exe"
process.command_linewildcard*echo*%USERPROFILE%*excludes:process.command_line field:"process.command_line" value:"*echo*%USERPROFILE%*"
process.nameeqcmd.exeexcludes:process.name field:"process.name" value:"cmd.exe"
process.executablewildcard?:\Program Files (x86)\*, ?:\Program Files\*, ?:\Program Files*\WindowsApps\MicrosoftCorporationII.WindowsSubsystemForLinux_*\wsl*.exe, ?:\Windows\System32\conhost.exe, ?:\Windows\System32\lxss\wslhost.exe, ?:\Windows\System32\WerFault.exe, ?:\Windows\System32\wsl.exe, ?:\Windows\Sys?????\wslconfig.exeexcludes:process.executable

GetAsyncKeyState API Call from Suspicious Process

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

Identifies attempts to enumerate the state of keyboard keys by an unusual process. Adversaries may log user keystrokes to intercept credentials or other information from the user as the user types them.

MITRE ATT&CK Coverage

TacticTechniques
Collection

Rule Body

[rule]
description = """
Identifies attempts to enumerate the state of keyboard keys by an unusual process. Adversaries may log user keystrokes
to intercept credentials or other information from the user as the user types them.
"""
id = "ef0a2322-641b-4127-8b48-2def55fe1f1f"
license = "Elastic License v2"
name = "GetAsyncKeyState API Call from Suspicious Process"
os_list = ["windows"]
reference = [
    "https://attack.mitre.org/techniques/T1056/001/",
    "https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getasynckeystate",
    "https://www.elastic.co/security-labs/protecting-your-devices-from-information-theft-keylogger-protection",
]
version = "1.0.5"

query = '''
sequence by process.entity_id with maxspan=5m
 [process where event.action == "start" and
  (
   (process.Ext.device.product_id : ("Virtual DVD-ROM", "Virtual Disk") and not process.executable : "C:\\*") or
   (process.Ext.relative_file_creation_time <= 500 and (process.code_signature.trusted == false or process.code_signature.exists == false)) or
   process.name in~ ("rundll32.exe", "regsvr32.exe", "powershell.exe", "wscript.exe", "cscript.exe", "mshta.exe") or
   process.pe.original_file_name : ("python*.exe", "AutoIt*.exe") or
   (process.Ext.relative_file_creation_time <= 500 and
    process.executable :
                ("?:\\Users\\Public\\*",
                 "?:\\Users\\*\\Downloads\\*",
                 "?:\\Windows\\Temp\\*",
                 "?:\\Windows\\Tasks\\*",
                 "?:\\ProgramData\\*",
                 "?:\\Windows\\Microsoft.NET\\*")) or
    process.executable : ("?:\\Users\\*\\AppData\\Local\\Temp\\7z*\\",
                         "?:\\Users\\*\\AppData\\Local\\Temp\\Rar$*\\*",
                         "?:\\Users\\*\\AppData\\Local\\Temp\\Temp?_*\\*",
                         "?:\\Users\\*\\AppData\\Local\\Temp\\BNZ.*") or
   (process.parent.name : "svchost.exe" and process.parent.args : "Schedule")
  ) and
  not process.executable :
              ("?:\\ProgramData\\Microsoft\\Windows Defender\\Platform\\*\\MsMpEng.exe",
              "?:\\Program Files (x86)\\*.exe",
              "?:\\Program Files\\*.exe") and
  not (process.name : "rundll32.exe" and process.args : "C:\\Windows\\System32\\LogiLDA.dll,LogiFetch")
  ]
 [api where process.Ext.api.name == "GetAsyncKeyState" and
   process.Ext.api.metadata.background_callcount >= 400 and process.Ext.api.metadata.ms_since_last_keyevent >= 100 and 
   not (process.executable : "?:\\Windows\\System32\\rundll32.exe" and 
        process.command_line : "\"?:\\Windows\\System32\\rundll32.exe\" C:\\Windows\\System32\\LogiLDA.dll,LogiFetch" and 
        process.thread.Ext.call_stack_summary == "win32u.dll|winsrvext.dll|ntdll.dll")]
'''

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

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

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1056"
name = "Input Capture"
reference = "https://attack.mitre.org/techniques/T1056/"
[[threat.technique.subtechnique]]
id = "T1056.001"
name = "Keylogging"
reference = "https://attack.mitre.org/techniques/T1056/001/"



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

[internal]
min_endpoint_version = "8.12.0"

Stages and Predicates

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

Stage 1: process

[process where event.action == "start" and
  (
   (process.Ext.device.product_id : ("Virtual DVD-ROM", "Virtual Disk") and not process.executable : "C:\\*") or
   (process.Ext.relative_file_creation_time <= 500 and (process.code_signature.trusted == false or process.code_signature.exists == false)) or
   process.name in~ ("rundll32.exe", "regsvr32.exe", "powershell.exe", "wscript.exe", "cscript.exe", "mshta.exe") or
   process.pe.original_file_name : ("python*.exe", "AutoIt*.exe") or
   (process.Ext.relative_file_creation_time <= 500 and
    process.executable :
                ("?:\\Users\\Public\\*",
                 "?:\\Users\\*\\Downloads\\*",
                 "?:\\Windows\\Temp\\*",
                 "?:\\Windows\\Tasks\\*",
                 "?:\\ProgramData\\*",
                 "?:\\Windows\\Microsoft.NET\\*")) or
    process.executable : ("?:\\Users\\*\\AppData\\Local\\Temp\\7z*\\",
                         "?:\\Users\\*\\AppData\\Local\\Temp\\Rar$*\\*",
                         "?:\\Users\\*\\AppData\\Local\\Temp\\Temp?_*\\*",
                         "?:\\Users\\*\\AppData\\Local\\Temp\\BNZ.*") or
   (process.parent.name : "svchost.exe" and process.parent.args : "Schedule")
  ) and
  not process.executable :
              ("?:\\ProgramData\\Microsoft\\Windows Defender\\Platform\\*\\MsMpEng.exe",
              "?:\\Program Files (x86)\\*.exe",
              "?:\\Program Files\\*.exe") and
  not (process.name : "rundll32.exe" and process.args : "C:\\Windows\\System32\\LogiLDA.dll,LogiFetch")
  ]

Stage 2: api

[api where process.Ext.api.name == "GetAsyncKeyState" and
   process.Ext.api.metadata.background_callcount >= 400 and process.Ext.api.metadata.ms_since_last_keyevent >= 100 and 
   not (process.executable : "?:\\Windows\\System32\\rundll32.exe" and 
        process.command_line : "\"?:\\Windows\\System32\\rundll32.exe\" C:\\Windows\\System32\\LogiLDA.dll,LogiFetch" and 
        process.thread.Ext.call_stack_summary == "win32u.dll|winsrvext.dll|ntdll.dll")]

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • start corpus 388 (elastic 388)
field:"EventType" kind:eq value:"start"
process.Ext.api.metadata.background_callcountge
  • 400 transforms: number corpus 2 (elastic 2)
field:"process.Ext.api.metadata.background_callcount" kind:ge value:"400"
process.Ext.api.metadata.ms_since_last_keyeventge
  • 100 transforms: number corpus 2 (elastic 2)
field:"process.Ext.api.metadata.ms_since_last_keyevent" kind:ge value:"100"
process.Ext.api.nameeq
  • GetAsyncKeyState corpus 4 (elastic 4)
field:"process.Ext.api.name" kind:eq value:"GetAsyncKeyState"
process.Ext.device.product_idwildcard
  • Virtual DVD-ROM corpus 13 (elastic 13)
  • Virtual Disk corpus 13 (elastic 13)
field:"process.Ext.device.product_id" kind:wildcard
process.Ext.relative_file_creation_timele
  • 500 transforms: number corpus 28 (elastic 28)
field:"process.Ext.relative_file_creation_time" kind:le value:"500"
process.code_signature.existseq
  • false transforms: boolean corpus 118 (elastic 118)
field:"process.code_signature.exists" kind:eq value:"false"
process.code_signature.trustedeq
  • false transforms: boolean corpus 114 (elastic 114)
field:"process.code_signature.trusted" kind:eq value:"false"
process.executablewildcard
  • ?:\ProgramData\* corpus 18 (elastic 18)
  • ?:\Users\*\AppData\Local\Temp\7z*\ corpus 3 (elastic 3)
  • ?:\Users\*\AppData\Local\Temp\BNZ.* corpus 7 (elastic 7)
  • ?:\Users\*\AppData\Local\Temp\Rar$*\* corpus 4 (elastic 4)
  • ?:\Users\*\AppData\Local\Temp\Temp?_*\* corpus 4 (elastic 4)
  • ?:\Users\*\Downloads\* corpus 12 (elastic 12)
  • ?:\Users\Public\* corpus 22 (elastic 22)
  • ?:\Windows\Microsoft.NET\* corpus 11 (elastic 11)
  • ?:\Windows\Tasks\* corpus 7 (elastic 7)
  • ?:\Windows\Temp\* corpus 7 (elastic 7)
field:"Image" kind:wildcard
process.namein
  • cscript.exe corpus 24 (splunk 16, elastic 8)
  • mshta.exe corpus 27 (splunk 15, elastic 12)
  • powershell.exe corpus 31 (splunk 19, elastic 11, kusto 1)
  • regsvr32.exe corpus 14 (splunk 10, elastic 4)
  • rundll32.exe corpus 17 (splunk 12, elastic 5)
  • wscript.exe corpus 28 (elastic 14, splunk 14)
field:"process_basename" kind:in
process.parent.argswildcard
  • Schedule corpus 4 (elastic 4)
field:"process.parent.args" kind:wildcard value:"Schedule"
process.parent.namewildcard
  • svchost.exe corpus 15 (elastic 10, splunk 5)
field:"parent_process_basename" kind:wildcard value:"svchost.exe"
process.pe.original_file_namewildcard
  • AutoIt*.exe corpus 8 (elastic 8)
  • python*.exe corpus 2 (elastic 2)
field:"OriginalFileName" kind:wildcard

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.argseqC:\Windows\System32\LogiLDA.dll,LogiFetchexcludes:process.args field:"process.args" value:"C:\Windows\System32\LogiLDA.dll,LogiFetch"
process.nameeqrundll32.exeexcludes:process.name field:"process.name" value:"rundll32.exe"
process.executablewildcard?:\ProgramData\Microsoft\Windows Defender\Platform\*\MsMpEng.exe, ?:\Program Files (x86)\*.exe, ?:\Program Files\*.exeexcludes:process.executable field:"process.executable" value:"?:\ProgramData\Microsoft\Windows Defender\Platform\*\MsMpEng.exe" field:"process.executable" value:"?:\Program Files (x86)\*.exe" field:"process.executable" value:"?:\Program Files\*.exe"
process.command_lineeq"?:\Windows\System32\rundll32.exe" C:\Windows\System32\LogiLDA.dll,LogiFetchexcludes:process.command_line
process.executableeq?:\Windows\System32\rundll32.exeexcludes:process.executable field:"process.executable" value:"?:\Windows\System32\rundll32.exe"
process.thread.Ext.call_stack_summaryeqwin32u.dll|winsrvext.dll|ntdll.dllexcludes:process.thread.Ext.call_stack_summary field:"process.thread.Ext.call_stack_summary" value:"win32u.dll|winsrvext.dll|ntdll.dll"

GitHub PAT Access Revoked

#
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

Access to private GitHub organization resources was revoked for a PAT.

MITRE ATT&CK Coverage

TacticTechniques
Impact

Telemetry Coverage

Rule Body

[metadata]
bypass_bbr_timing = true
creation_date = "2023/10/11"
integration = ["github"]
maturity = "production"
updated_date = "2025/03/20"

[rule]
author = ["Elastic"]
building_block_type = "default"
description = "Access to private GitHub organization resources was revoked for a PAT.\n"
from = "now-9m"
index = ["logs-github.audit-*"]
language = "eql"
license = "Elastic License v2"
name = "GitHub PAT Access Revoked"
risk_score = 21
rule_id = "8a0fd93a-7df8-410d-8808-4cc5e340f2b9"
severity = "low"
tags = [
    "Domain: Cloud",
    "Use Case: Threat Detection",
    "Use Case: UEBA",
    "Tactic: Impact",
    "Rule Type: BBR",
    "Data Source: Github",
]
timestamp_override = "event.ingested"
type = "eql"

query = '''
configuration where event.dataset == "github.audit" and event.action == "personal_access_token.access_revoked"
'''


[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1531"
name = "Account Access Removal"
reference = "https://attack.mitre.org/techniques/T1531/"


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

Stages and Predicates

Stage 1: configuration

configuration where event.dataset == "github.audit" and event.action == "personal_access_token.access_revoked"

Indicators

These rows show field, operator, and value matches.

GKE Container Created with Excessive Linux Capabilities

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

Detects GKE pod creation with dangerous Linux capabilities that are commonly abused in container escape techniques. Standalone pods are included; controller-owned ReplicaSet, DaemonSet, and StatefulSet workloads are excluded.

Known False Positives

  • Some platform or security images legitimately require elevated capabilities. Add image or namespace exceptions after review.

MITRE ATT&CK Coverage

TacticTechniques
Execution
Privilege Escalation

Telemetry Coverage

PlatformRecord / event type
Kubernetescreate-pods: create pods

Rules Detecting the Same Action

These rules filter on the same operation.

Rule Body

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

[rule]
author = ["Elastic"]
description = """
Detects GKE pod creation with dangerous Linux capabilities that are commonly abused in container escape techniques.
Standalone pods are included; controller-owned ReplicaSet, DaemonSet, and StatefulSet workloads are excluded.
"""
false_positives = [
    """
    Some platform or security images legitimately require elevated capabilities. Add image or namespace exceptions after
    review.
    """,
]
index = ["logs-gcp.audit-*"]
language = "kuery"
license = "Elastic License v2"
name = "GKE Container Created with Excessive Linux Capabilities"
note = """## Triage and analysis

### Investigating GKE Container Created with Excessive Linux Capabilities

Capabilities such as SYS_ADMIN, NET_ADMIN, and BPF can enable host escape. Review `gcp.audit.request.spec.containers`
and the creating identity.

### Investigation steps

- Confirm which capability was added and whether the image requires it.
- Review `user.email`, namespace, and follow-on API activity from the same actor.

### False positives

- Known DaemonSet or operator images may need capabilities; exclude after validation.

## Setup

The GCP Fleet integration with GKE audit logs enabled is required to be compatible with this rule."""
references = [
    "https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-capabilities-for-a-container",
    "https://0xn3va.gitbook.io/cheat-sheets/container/escaping/excessive-capabilities",
]
risk_score = 47
rule_id = "a8a48752-58f3-43a9-beb5-14b9e9f6a8b0"
severity = "medium"
tags = [
    "Domain: Cloud",
    "Domain: Kubernetes",
    "Data Source: GCP",
    "Data Source: Google Cloud Platform",
    "Use Case: Threat Detection",
    "Tactic: Privilege Escalation",
    "Tactic: Execution",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "query"

query = '''
data_stream.dataset:gcp.audit and event.action:"io.k8s.core.v1.pods.create" and event.outcome:success and
gcp.audit.request.spec.containers.securityContext.capabilities.add:(
  "BPF" or "DAC_READ_SEARCH" or "NET_ADMIN" or "SYS_ADMIN" or "SYS_BOOT" or "SYS_MODULE" or "SYS_PTRACE" or "SYS_RAWIO" or
  "SYSLOG"
) and not gcp.audit.request.metadata.ownerReferences.kind:("ReplicaSet" or "DaemonSet" or "StatefulSet")
'''

[[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 = "T1610"
name = "Deploy Container"
reference = "https://attack.mitre.org/techniques/T1610/"

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

Stages and Predicates

Stage 1: query

data_stream.dataset:gcp.audit and event.action:"io.k8s.core.v1.pods.create" and event.outcome:success and
gcp.audit.request.spec.containers.securityContext.capabilities.add:(
  "BPF" or "DAC_READ_SEARCH" or "NET_ADMIN" or "SYS_ADMIN" or "SYS_BOOT" or "SYS_MODULE" or "SYS_PTRACE" or "SYS_RAWIO" or
  "SYSLOG"
) and not gcp.audit.request.metadata.ownerReferences.kind:("ReplicaSet" or "DaemonSet" or "StatefulSet")

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

Kubernetes Creation or Modification of Sensitive Role

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

Detects the creation or modification of Kubernetes Roles or ClusterRoles that grant high-risk permissions, such as wildcard access or RBAC escalation verbs (e.g., bind, escalate, impersonate), which may enable privilege escalation or unauthorized access within the cluster.

MITRE ATT&CK Coverage

Telemetry Coverage

Rules Detecting the Same Action

These rules filter on the same operation.

Rule Body

[metadata]
creation_date = "2026/02/04"
integration = ["kubernetes"]
maturity = "production"
updated_date = "2026/04/27"

[rule]
author = ["Elastic"]
description = """
Detects the creation or modification of Kubernetes Roles or ClusterRoles that grant high-risk permissions,
such as wildcard access or RBAC escalation verbs (e.g., bind, escalate, impersonate), which may enable
privilege escalation or unauthorized access within the cluster.
"""
language = "esql"
license = "Elastic License v2"
name = "Kubernetes Creation or Modification of Sensitive Role"
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 Kubernetes Creation or Modification of Sensitive Role

This rule detects allowed create, update, or patch actions on Roles and ClusterRoles that introduce high-risk RBAC permissions, including wildcard access and escalation verbs like bind, escalate, or impersonate. These changes matter because they can silently expand privileges and enable persistence or lateral movement across the cluster. Attackers commonly add a new ClusterRole with `*` verbs/resources and then use it to bind themselves or a service account to cluster-admin–equivalent access.

### Possible investigation steps

- Identify the responsible identity and origin by reviewing the audit event’s user/service account, userAgent, and source IPs, then confirm whether the action came from approved automation (e.g., GitOps/CI) or an interactive session.  
- Retrieve and diff the Role/ClusterRole manifest before vs after the change to pinpoint newly added wildcards, escalation verbs (bind/escalate/impersonate), or permissions over RBAC resources that enable privilege escalation.  
- Enumerate RoleBindings/ClusterRoleBindings that reference the modified role and determine which users/groups/service accounts gained effective permissions, prioritizing bindings created/changed near the same time.  
- Validate authorization intent by correlating the change with a change ticket/PR and the expected namespace/cluster scope, and flag any out-of-band edits (kubectl apply/edit) that bypass the normal workflow.  
- If suspicious, contain by reverting the role and removing or disabling newly privileged bindings/subjects, then hunt for follow-on activity from the same identity (e.g., creation of new service accounts, secrets access, or additional RBAC changes) within the incident window.

### False positive analysis

- Cluster administrators or platform automation legitimately create or update Roles/ClusterRoles to include wildcard verbs/resources or escalation-related verbs (bind/escalate/impersonate) during initial cluster bootstrapping, feature enablement, or maintenance, especially when enabling broad operational access for system components.  
- Routine RBAC refactoring such as consolidating multiple granular roles into a single reusable role, migrating permissions across namespaces, or adjusting access for incident response can temporarily add permissions over RBAC resources (roles/rolebindings/clusterroles/clusterrolebindings) and trigger the rule even when the change is approved and tracked.

### Response and remediation

- Immediately locate and quarantine the changed Role/ClusterRole by reverting it to the last known-good manifest (from Git/GitOps) or deleting it if unauthorized, and remove any new RoleBinding/ClusterRoleBinding subjects that reference it.  
- Contain the actor by disabling or rotating credentials for the responsible user/service account (and its tokens), and if the change came from a workload, isolate the namespace/workload (scale down, deny egress) until provenance is confirmed.  
- Eradicate persistence by searching for and removing additional RBAC changes made in the same window (new roles, bindings, service accounts) and by revoking any newly granted access to secrets or cluster-scoped resources discovered during review.  
- Recover by redeploying RBAC from a controlled pipeline, validating effective permissions for impacted subjects, and monitoring for re-creation of the same role name or re-binding attempts after rollback.  
- Escalate to platform security/incident response immediately if the role grants wildcard permissions, includes `impersonate`/`escalate`/`bind`, is cluster-scoped, or is bound to non-admin subjects or external identities without an approved change record.  
- Harden by enforcing RBAC guardrails (OPA Gatekeeper/Kyverno policies blocking wildcard/escalation verbs except for approved groups), restricting who can create/update RBAC objects, and requiring all RBAC changes to flow through code review and signed GitOps automation.
"""
references = [
    "https://heilancoos.github.io/research/2025/12/16/kubernetes.html#overly-permissive-role-based-access-control",
]
risk_score = 47
rule_id = "0fb25791-d8d4-42ab-8fc7-4954642de85f"
severity = "medium"
tags = [
    "Data Source: Kubernetes",
    "Domain: Kubernetes",
    "Use Case: Threat Detection",
    "Tactic: Persistence",
    "Tactic: Privilege Escalation",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "esql"
query = '''
FROM logs-kubernetes.audit_logs-* metadata _id, _index, _version
| WHERE
  kubernetes.audit.objectRef.resource in ("roles", "clusterroles") and
  kubernetes.audit.verb in ("create", "update", "patch") and
  `kubernetes.audit.annotations.authorization_k8s_io/decision` == "allow" and
  kubernetes.audit.level == "RequestResponse" and kubernetes.audit.stage == "ResponseComplete" and
  not kubernetes.audit.sourceIPs in ("::1", "127.0.0.1") and 
  not (user.name like "eks:*" and kubernetes.audit.objectRef.name like "eks:*") and 
  not (user.name == "aksService" and event.action == "create" and kubernetes.audit.objectRef.name like "aks:*") and 
  not (user.name == "system:serviceaccount:kube-system:clusterrole-aggregation-controller" and  kubernetes.audit.objectRef.name in ("admin", "edit") and event.action == "patch") and 
  (
    // using requestObject
    KQL(""" kubernetes.audit.requestObject.rules.verbs:("*" or "escalate" or "bind" or "impersonate") """) or 
    KQL(""" kubernetes.audit.requestObject.rules.verbs: ("*" or "create" or "patch" or "update") and kubernetes.audit.requestObject.rules.resources:("*" or "clusterroles" or "clusterrolebindings" or "roles" or "rolebindings" or "pods/exec" or "serviceaccounts/token" or "nodes/proxy" or "daemonsets") """) or 
    KQL(""" kubernetes.audit.requestObject.rules.verbs: ("*" or "get" or "list") and kubernetes.audit.requestObject.rules.resources:("*" or "secrets") """) or

    // using responseObject
    KQL(""" kubernetes.audit.responseObject.rules.verbs:("*" or "escalate" or "bind" or "impersonate") """) or 
    KQL(""" kubernetes.audit.responseObject.rules.verbs: ("*" or "create" or "patch" or "update") and kubernetes.audit.responseObject.rules.resources:("*" or "clusterroles" or "clusterrolebindings" or "roles" or "rolebindings" or "pods/exec" or "serviceaccounts/token" or "nodes/proxy" or "daemonsets") """) or 
    KQL(""" kubernetes.audit.responseObject.rules.verbs: ("*" or "get" or "list") and kubernetes.audit.responseObject.rules.resources:("*" or "secrets") """)
  )
| keep user.name, user_agent.original, event.action, source.ip, kubernetes.audit.verb, kubernetes.audit.objectRef.resource, kubernetes.audit.objectRef.name, kubernetes.audit.requestURI, kubernetes.audit.user.username, kubernetes.audit.user.groups, `kubernetes.audit.annotations.authorization_k8s_io/decision`, event.original, _id, _version, _index, data_stream.namespace
'''

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

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

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

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

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

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

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

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

Stages and Predicates

Stage 1: from

FROM logs-kubernetes.audit_logs-* metadata _id, _index, _version

Stage 2: where

| WHERE
  kubernetes.audit.objectRef.resource in ("roles", "clusterroles") and
  kubernetes.audit.verb in ("create", "update", "patch") and
  `kubernetes.audit.annotations.authorization_k8s_io/decision` == "allow" and
  kubernetes.audit.level == "RequestResponse" and kubernetes.audit.stage == "ResponseComplete" and
  not kubernetes.audit.sourceIPs in ("::1", "127.0.0.1") and
  not (user.name like "eks:*" and kubernetes.audit.objectRef.name like "eks:*") and
  not (user.name == "aksService" and event.action == "create" and kubernetes.audit.objectRef.name like "aks:*") and
  not (user.name == "system:serviceaccount:kube-system:clusterrole-aggregation-controller" and  kubernetes.audit.objectRef.name in ("admin", "edit") and event.action == "patch") and
  (
    KQL(""" kubernetes.audit.requestObject.rules.verbs:("*" or "escalate" or "bind" or "impersonate") """) or
    KQL(""" kubernetes.audit.requestObject.rules.verbs: ("*" or "create" or "patch" or "update") and kubernetes.audit.requestObject.rules.resources:("*" or "clusterroles" or "clusterrolebindings" or "roles" or "rolebindings" or "pods/exec" or "serviceaccounts/token" or "nodes/proxy" or "daemonsets") """) or
    KQL(""" kubernetes.audit.requestObject.rules.verbs: ("*" or "get" or "list") and kubernetes.audit.requestObject.rules.resources:("*" or "secrets") """) or
    KQL(""" kubernetes.audit.responseObject.rules.verbs:("*" or "escalate" or "bind" or "impersonate") """) or
    KQL(""" kubernetes.audit.responseObject.rules.verbs: ("*" or "create" or "patch" or "update") and kubernetes.audit.responseObject.rules.resources:("*" or "clusterroles" or "clusterrolebindings" or "roles" or "rolebindings" or "pods/exec" or "serviceaccounts/token" or "nodes/proxy" or "daemonsets") """) or
    KQL(""" kubernetes.audit.responseObject.rules.verbs: ("*" or "get" or "list") and kubernetes.audit.responseObject.rules.resources:("*" or "secrets") """)
  )

Stage 3: keep

| keep user.name, user_agent.original, event.action, source.ip, kubernetes.audit.verb, kubernetes.audit.objectRef.resource, kubernetes.audit.objectRef.name, kubernetes.audit.requestURI, kubernetes.audit.user.username, kubernetes.audit.user.groups, `kubernetes.audit.annotations.authorization_k8s_io/decision`, event.original, _id, _version, _index, data_stream.namespace

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
kubernetes.audit.annotations.authorization_k8s_io/decisioneq
  • allow corpus 4 (elastic 4)
field:"kubernetes.audit.annotations.authorization_k8s_io/decision" kind:eq value:"allow"
kubernetes.audit.leveleq
  • RequestResponse corpus 2 (elastic 2)
field:"kubernetes.audit.level" kind:eq value:"RequestResponse"
kubernetes.audit.objectRef.resourcein
  • clusterroles corpus 5 (elastic 5)
  • roles corpus 5 (elastic 5)
field:"kubernetes.audit.objectRef.resource" kind:in
kubernetes.audit.requestObject.rules.resourcesin
  • *
  • clusterrolebindings
  • clusterroles
  • daemonsets
  • nodes/proxy
  • pods/exec
  • rolebindings
  • roles
  • secrets
  • serviceaccounts/token
field:"kubernetes.audit.requestObject.rules.resources" kind:in
kubernetes.audit.requestObject.rules.verbsin
  • *
  • bind
  • create
  • escalate
  • get
  • impersonate
  • list
  • patch
  • update
field:"kubernetes.audit.requestObject.rules.verbs" kind:in
kubernetes.audit.responseObject.rules.resourcesin
  • *
  • clusterrolebindings
  • clusterroles
  • daemonsets
  • nodes/proxy
  • pods/exec
  • rolebindings
  • roles
  • secrets
  • serviceaccounts/token
field:"kubernetes.audit.responseObject.rules.resources" kind:in
kubernetes.audit.responseObject.rules.verbsin
  • *
  • bind
  • create
  • escalate
  • get
  • impersonate
  • list
  • patch
  • update
field:"kubernetes.audit.responseObject.rules.verbs" kind:in
kubernetes.audit.stageeq
  • ResponseComplete corpus 5 (elastic 5)
field:"kubernetes.audit.stage" kind:eq value:"ResponseComplete"
kubernetes.audit.verbin
  • create corpus 7 (elastic 7)
  • patch corpus 7 (elastic 7)
  • update corpus 7 (elastic 7)
field:"kubernetes.audit.verb" kind:in

Exclusions

The rule actively suppresses these predicates.

Output Fields

These fields are emitted when the rule matches.

FieldSource
user.nameKEEP user.name
user_agent.originalKEEP user_agent.original
event.actionKEEP event.action
source.ipKEEP source.ip
kubernetes.audit.verbKEEP kubernetes.audit.verb
kubernetes.audit.objectRef.resourceKEEP kubernetes.audit.objectRef.resource
kubernetes.audit.objectRef.nameKEEP kubernetes.audit.objectRef.name
kubernetes.audit.requestURIKEEP kubernetes.audit.requestURI
kubernetes.audit.user.usernameKEEP kubernetes.audit.user.username
kubernetes.audit.user.groupsKEEP kubernetes.audit.user.groups
`kubernetes.audit.annotations.authorization_k8s_io/decision`KEEP `kubernetes.audit.annotations.authorization_k8s_io/decision`
event.originalKEEP event.original
_idKEEP _id
_versionKEEP _version
_indexKEEP _index
data_stream.namespaceKEEP data_stream.namespace

Kubernetes Secret Get or List from Node or Pod Service Account

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

Kubernetes audit identities for kubelet (system:node:) and workloads (system:serviceaccount:) are meant to operate with tight, predictable API usage. Direct get or list on the Secrets API from those principals is often a sign of credential access. Attackers who stole a pod service-account token or node credentials sweep Secret objects for tokens, registry credentials, TLS keys, or application configuration. Even denied attempts still reveal intent to reach sensitive material. Legitimate controllers do read secrets they mount or manage, so this signal is most valuable when paired with triage (namespace scope, user agent, RBAC, and whether the identity should touch those secret names at all).

Known False Positives

  • In-cluster operators, CSI drivers, GitOps agents, and some platform controllers legitimately list or get Secrets in namespaces they manage; exclude known service accounts, namespaces, or user agents after baselining.
  • Rare kubelet or node maintenance tooling may touch Secret APIs; validate against change windows and approved node management paths.

MITRE ATT&CK Coverage

TacticTechniques
Credential Access

Telemetry Coverage

Rules Detecting the Same Action

These rules filter on the same operation.

Rule Body

[metadata]
creation_date = "2026/04/22"
integration = ["kubernetes"]
maturity = "production"
updated_date = "2026/08/18"

[rule]
author = ["Elastic"]
description = """
Kubernetes audit identities for kubelet (system:node:*) and workloads (system:serviceaccount:*) are meant to
operate with tight, predictable API usage. Direct get or list on the Secrets API from those principals is
often a sign of credential access. Attackers who stole a pod service-account token or node credentials sweep Secret objects for
tokens, registry credentials, TLS keys, or application configuration. Even denied attempts still reveal intent to
reach sensitive material. Legitimate controllers do read secrets they mount or manage, so this signal is most valuable
when paired with triage (namespace scope, user agent, RBAC, and whether the identity should touch those secret names at
all).
"""
false_positives = [
    """
    In-cluster operators, CSI drivers, GitOps agents, and some platform controllers legitimately list or get Secrets in
    namespaces they manage; exclude known service accounts, namespaces, or user agents after baselining.
    """,
    """
    Rare kubelet or node maintenance tooling may touch Secret APIs; validate against change windows and approved node
    management paths.
    """,
]
index = ["logs-kubernetes.audit_logs-*"]
language = "kuery"
license = "Elastic License v2"
name = "Kubernetes Secret Get or List from Node or Pod Service Account"
note = """## Triage and analysis

### Investigating Kubernetes Secret Get or List from Node or Pod Service Account

This rule fires on Kubernetes audit events where the authenticated user is a node (`system:node:<nodename>`) or a
pod service account (`system:serviceaccount:<namespace>:<name>`) and the verb maps to read-style access
(`get`, `list`) on the **secrets** resource. Treat node-originated secret reads as high priority: kubelet should
not broadly enumerate cluster secrets. For service accounts, prioritize cross-namespace access, access to
high-value secret names, and clients that do not match the workload’s normal user agent or deployment.

### Possible investigation steps

- Resolve `user.name` (or `kubernetes.audit.user.username` if present) to the node or workload and review RBAC
  RoleBindings and ClusterRoleBindings for secret `get`/`list` scope.
- Inspect `kubernetes.audit.objectRef.namespace`, `kubernetes.audit.objectRef.name`, source IP, and
  `user_agent.original` for automation you recognize versus anomalous scripts or generic HTTP clients.
- Review `kubernetes.audit.annotations.authorization_k8s_io/decision` for successful reads versus probing denials.
- Correlate with pod exec, token creation, RoleBinding changes, or secret modification in the same time window.

### False positive analysis

- Controllers that reconcile Secrets (e.g. cert-manager, external-secrets, sealed-secrets) may match; allowlist their
  service accounts if behavior is expected and scoped.
- Helm and package managers can list release secrets during deploys; correlate with pipelines and chart releases.

### Response and remediation

- If malicious, revoke the token or node credentials, cordon or isolate the host or workload, rotate exposed secrets, and
  tighten RBAC to least privilege for the affected identity.
"""
references = [
    "https://attack.mitre.org/techniques/T1552/007/",
    "https://kubernetes.io/docs/reference/access-authn-authz/authentication/#service-account-tokens",
]
risk_score = 47
rule_id = "f8a31c62-0d4e-4b9a-b7e1-6c2a9d4e8f10"
severity = "medium"
tags = [
    "Data Source: Kubernetes",
    "Data Source: Kubernetes API Server Audit Logs",
    "Domain: Kubernetes",
    "Platform: Kubernetes",
    "Use Case: Threat Detection",
    "Tactic: Credential Access",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "query"
query = '''
data_stream.dataset:"kubernetes.audit_logs" and
event.action:(get or list) and
kubernetes.audit.objectRef.resource:"secrets" and
user.name:(system\:serviceaccount\:* or system\:node\:*) and source.ip:(* and not "127.0.0.1") and 
not kubernetes.audit.user.groups:(
  "system:serviceaccounts:flux-system"
  or "system:serviceaccounts:kyverno"
  or "system:serviceaccounts:ibm-csi"
  or "system:serviceaccounts:harvester-system"
  or "system:serviceaccounts:cattle-system"
  or "system:serviceaccounts:cattle-monitoring-system"
  or system\:serviceaccounts\:cluster-fleet-local-local-*
  or "system:serviceaccounts:rabbitmq-system"
  or "system:serviceaccounts:cattle-fleet-system"
) and 
not (kubernetes.audit.user.username:"system:serviceaccount:security:trivy-operator" and kubernetes.audit.user.extra.authentication.kubernetes.io/pod-name :trivy-operator-*) and 
not (kubernetes.audit.user.username:"system:serviceaccount:cert-manager:cert-manager-cainjector" and kubernetes.audit.user.extra.authentication.kubernetes.io/pod-name:cert-manager-cainjector-*) and 
not (kubernetes.audit.user.username:"system:serviceaccount:monitoring:plat-central-monitoring-pr-operator" and kubernetes.audit.user.extra.authentication.kubernetes.io/pod-name:plat-central-monitoring-pr-operator*) and 
not (kubernetes.audit.user.username:"system:serviceaccount:cert-manager:cert-manager" and kubernetes.audit.user.extra.authentication.kubernetes.io/pod-name:cert-manager-*)
'''

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

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

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

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

Stages and Predicates

Stage 1: query

data_stream.dataset:"kubernetes.audit_logs" and
event.action:(get or list) and
kubernetes.audit.objectRef.resource:"secrets" and
user.name:(system\:serviceaccount\:* or system\:node\:*) and source.ip:(* and not "127.0.0.1") and 
not kubernetes.audit.user.groups:(
  "system:serviceaccounts:flux-system"
  or "system:serviceaccounts:kyverno"
  or "system:serviceaccounts:ibm-csi"
  or "system:serviceaccounts:harvester-system"
  or "system:serviceaccounts:cattle-system"
  or "system:serviceaccounts:cattle-monitoring-system"
  or system\:serviceaccounts\:cluster-fleet-local-local-*
  or "system:serviceaccounts:rabbitmq-system"
  or "system:serviceaccounts:cattle-fleet-system"
) and 
not (kubernetes.audit.user.username:"system:serviceaccount:security:trivy-operator" and kubernetes.audit.user.extra.authentication.kubernetes.io/pod-name :trivy-operator-*) and 
not (kubernetes.audit.user.username:"system:serviceaccount:cert-manager:cert-manager-cainjector" and kubernetes.audit.user.extra.authentication.kubernetes.io/pod-name:cert-manager-cainjector-*) and 
not (kubernetes.audit.user.username:"system:serviceaccount:monitoring:plat-central-monitoring-pr-operator" and kubernetes.audit.user.extra.authentication.kubernetes.io/pod-name:plat-central-monitoring-pr-operator*) and 
not (kubernetes.audit.user.username:"system:serviceaccount:cert-manager:cert-manager" and kubernetes.audit.user.extra.authentication.kubernetes.io/pod-name:cert-manager-*)

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
data_stream.dataseteq
  • kubernetes.audit_logs corpus 24 (elastic 24)
field:"data_stream.dataset" kind:eq value:"kubernetes.audit_logs"
event.actionin
  • get corpus 2 (elastic 2)
  • list corpus 2 (elastic 2)
field:"EventType" kind:in
kubernetes.audit.objectRef.resourceeq
  • secrets corpus 4 (elastic 4)
field:"kubernetes.audit.objectRef.resource" kind:eq value:"secrets"
source.ipis_not_null
  • (no value, null check)
field:"src_ip" kind:is_not_null
user.namewildcard
  • system:node:*
  • system:serviceaccount:* corpus 3 (elastic 3)
field:"user" kind:wildcard

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
kubernetes.audit.user.extra.authentication.kubernetes.io/pod-namestarts_withcert-manager-excludes:kubernetes.audit.user.extra.authentication.kubernetes.io/pod-name field:"kubernetes.audit.user.extra.authentication.kubernetes.io/pod-name" value:"cert-manager-"
kubernetes.audit.user.usernameeqsystem:serviceaccount:cert-manager:cert-managerexcludes:kubernetes.audit.user.username field:"kubernetes.audit.user.username" value:"system:serviceaccount:cert-manager:cert-manager"
kubernetes.audit.user.extra.authentication.kubernetes.io/pod-namestarts_withcert-manager-cainjector-excludes:kubernetes.audit.user.extra.authentication.kubernetes.io/pod-name field:"kubernetes.audit.user.extra.authentication.kubernetes.io/pod-name" value:"cert-manager-cainjector-"
kubernetes.audit.user.usernameeqsystem:serviceaccount:cert-manager:cert-manager-cainjectorexcludes:kubernetes.audit.user.username field:"kubernetes.audit.user.username" value:"system:serviceaccount:cert-manager:cert-manager-cainjector"
kubernetes.audit.user.extra.authentication.kubernetes.io/pod-namestarts_withplat-central-monitoring-pr-operatorexcludes:kubernetes.audit.user.extra.authentication.kubernetes.io/pod-name field:"kubernetes.audit.user.extra.authentication.kubernetes.io/pod-name" value:"plat-central-monitoring-pr-operator"
kubernetes.audit.user.usernameeqsystem:serviceaccount:monitoring:plat-central-monitoring-pr-operatorexcludes:kubernetes.audit.user.username field:"kubernetes.audit.user.username" value:"system:serviceaccount:monitoring:plat-central-monitoring-pr-operator"
kubernetes.audit.user.extra.authentication.kubernetes.io/pod-namestarts_withtrivy-operator-excludes:kubernetes.audit.user.extra.authentication.kubernetes.io/pod-name field:"kubernetes.audit.user.extra.authentication.kubernetes.io/pod-name" value:"trivy-operator-"
kubernetes.audit.user.usernameeqsystem:serviceaccount:security:trivy-operatorexcludes:kubernetes.audit.user.username field:"kubernetes.audit.user.username" value:"system:serviceaccount:security:trivy-operator"
kubernetes.audit.user.groupseqsystem:serviceaccounts:cattle-fleet-systemexcludes:kubernetes.audit.user.groups field:"kubernetes.audit.user.groups" value:"system:serviceaccounts:cattle-fleet-system"
kubernetes.audit.user.groupseqsystem:serviceaccounts:cattle-monitoring-systemexcludes:kubernetes.audit.user.groups field:"kubernetes.audit.user.groups" value:"system:serviceaccounts:cattle-monitoring-system"
kubernetes.audit.user.groupseqsystem:serviceaccounts:cattle-systemexcludes:kubernetes.audit.user.groups field:"kubernetes.audit.user.groups" value:"system:serviceaccounts:cattle-system"
kubernetes.audit.user.groupseqsystem:serviceaccounts:flux-systemexcludes:kubernetes.audit.user.groups field:"kubernetes.audit.user.groups" value:"system:serviceaccounts:flux-system"
kubernetes.audit.user.groupseqsystem:serviceaccounts:harvester-systemexcludes:kubernetes.audit.user.groups field:"kubernetes.audit.user.groups" value:"system:serviceaccounts:harvester-system"
kubernetes.audit.user.groupseqsystem:serviceaccounts:ibm-csiexcludes:kubernetes.audit.user.groups field:"kubernetes.audit.user.groups" value:"system:serviceaccounts:ibm-csi"
kubernetes.audit.user.groupseqsystem:serviceaccounts:kyvernoexcludes:kubernetes.audit.user.groups field:"kubernetes.audit.user.groups" value:"system:serviceaccounts:kyverno"
kubernetes.audit.user.groupseqsystem:serviceaccounts:rabbitmq-systemexcludes:kubernetes.audit.user.groups field:"kubernetes.audit.user.groups" value:"system:serviceaccounts:rabbitmq-system"
kubernetes.audit.user.groupsstarts_withsystem:serviceaccounts:cluster-fleet-local-local-excludes:kubernetes.audit.user.groups field:"kubernetes.audit.user.groups" value:"system:serviceaccounts:cluster-fleet-local-local-"
source.ipeq127.0.0.1excludes:source.ip field:"source.ip" value:"127.0.0.1"

Native API Call from Unsigned Module

#
Source
github.com/elastic/protections-artifacts

Identifies suspicious calls to Windows Native APIs from a unsigned module. This may indicate an attempt to bypass Kernelbase APIs hooking.

MITRE ATT&CK Coverage

TacticTechniques
Execution
Stealth

Rule Body

[rule]
description = """
Identifies suspicious calls to Windows Native APIs from a unsigned module. This may indicate an attempt to bypass
Kernelbase APIs hooking.
"""
id = "27202cd8-c5a6-4b82-9bb8-f3da69a4d5d3"
license = "Elastic License v2"
name = "Native API Call from Unsigned Module"
os_list = ["windows"]
version = "1.0.15"

query = '''
api where
process.Ext.api.behaviors == "native_api" and process.Ext.api.behaviors != "hidden_code" and
process.Ext.api.metadata.target_address_name in ("Unbacked", "Unknown") and
process.Ext.api.name in ("VirtualProtect", "VirtualProtectEx", "WriteProcessMemory", "MapViewOfFile", "MapViewOfFile2", "VirtualAllocEx", "VirtualAlloc", "SetThreadContext") and
process.thread.Ext.call_stack_final_user_module.name != "Unbacked" and process.thread.Ext.call_stack_final_user_module.name != null and
_arraysearch(process.thread.Ext.call_stack_final_user_module.code_signature, $entry, $entry.trusted == false or $entry.exists == false) and
not process.thread.Ext.call_stack_final_user_module.protection_provenance like "Kernel*" and
not (process.executable : "C:\\Windows\\explorer.exe" and process.thread.Ext.call_stack_final_user_module.path == "c:\\windows\\dxgi.dll") and
process.thread.Ext.call_stack_final_user_module.hash.sha256 != null and 
not process.thread.Ext.call_stack_summary like "ntdll.dll|*|Unknown" and 
not (process.Ext.api.name == "MapViewOfFile" and process.thread.Ext.call_stack_final_user_module.name in ("cygwin1.dll", "msys-2.0.dll")) and 
not process.thread.Ext.call_stack_final_user_module.path like ("c:\\windows\\assembly\\nativeimages_*.ni.dll",
                                                               "c:\\windows\\microsoft.net\\framework*.dll",
                                                               "?:\\program files (x86)\\*",
                                                               "?:\\program files\\*",
                                                               "c:\\windows\\winsxs\\*.dll",
                                                               "c:\\windows\\systemapps\\microsoft.windows.*.dll",
                                                               "c:\\windows\\system32\\ntdll.dll",
                                                               "c:\\windows\\syswow64\\ntdll.dll",
                                                               "c:\\windows\\syswow64\\apphelp.dll",
                                                               "c:\\windows\\syswow64\\cyinjct.dll",
                                                               "c:\\windows\\system32\\cyvrtrap.dll",
                                                               "c:\\windows\\system32\\edrpm64.dll",
                                                               "c:\\windows\\system32\\esensordbi.dll",
                                                               "c:\\windows\\system32\\hmpalert.dll", 
                                                               "?:\\windows\\system32\\spool\\drivers\\x64\\*\\ricoh_*.dll", 
                                                               "c:\\windows\\systemapps\\shellexperiencehost_*\\dxgi.dll",
                                                               "c:\\windows\\system32\\sophosed\\sophosed.dll",
                                                               "c:\\windows\\system32\\xtajit64.dll",
                                                               "c:\\windows\\system32\\microsoftaccounttokenprovider.dll", 
                                                               "c:\\windows\\system32\\appxsip.dll") and
not process.thread.Ext.call_stack_final_user_module.protection_provenance_path : ("c:\\program files (x86)\\*", "c:\\program files\\*") and
not (process.executable : "C:\\Windows\\System32\\lsass.exe" and process.thread.Ext.call_stack_final_user_module.path == "c:\\windows\\system32\\lsasrv.dll") and
not (process.executable : "C:\\Windows\\System32\\csrss.exe" and process.thread.Ext.call_stack_final_user_module.path == "c:\\windows\\system32\\sxssrv.dll") and
not (process.thread.Ext.call_stack_final_user_module.path == "c:\\windows\\syswow64\\wrusr.dll" and process.thread.Ext.call_stack_summary like "ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|wrusr.dll|kernelbase.dll|*") and
not process.thread.Ext.call_stack_final_user_module.hash.sha256 in
                                ("20623b2da7f3a2c1773f044921d2a99ce6b719f232796d88f164c41dc40b941a",
                                 "8a0e3caa3ee18379d63b9bd709ac6a87fb0dd8c31c833cb48bc4c9bc10017486",
                                 "0f3ed1563ab2ec7dbbf8e9db14e6ff649fcb3bfd607dd81ce4fc91a211559a4b",
                                 "b2d86212afab00e7b9bf19b7931277130b653c9258ac419a7a24d749471ea5ac",
                                 "8526104317a63fbdb2d126e737f822a03a2cf05046d712a136545a428320443d",
                                 "ecf5054d7f1ad0da4b1c9295b23389645780bb20855b6c727762163170d38d48",
                                 "6a2bf3ad9caeec71ff5fbd187f5db3337e4c99fa51e36ee039183b0aa610b22c",
                                 "65b2be41a8c2456dc69fd216000c2400d8fc48f37a40d21f94318a77d7459441",
                                 "f7c78dba07128af325d8da99138ebf78be163ecfb5da5b01fa6b65b96efecef1",
                                 "6778b8d1eabffe78447ec4aa6d793e776a9db351c202c955dda196e90df19fa2",
                                 "31fb9c74183eaa737317fd0260c218e38ae5b243988108c7e5e60e416fe54a84",
                                 "f239c27b50cef792fea5b34378fbac83bcc06b8442d508bd9add7ddf8ca5c632",
                                 "685774f56983b22fbd1f84880fe60f149ccf0322abe8dd09b7a0d81f4a5dd1f1",
                                 "c8f242570144ac4ba77967a1dc59d6681ca2d8a6a85c4db2a30e1e4629db843a",
                                 "16e40b77295687c45e7c9eefce8336aa69c08ac6648ba3a919bc5497b6ed7f83",
                                 "ab77212a71c2e2e8b870452d2c32bc72a6708d6e963dd3ebe2ac1a946cffc242",
                                 "7a94bc02118f56e337709f1e71f730ebe1245e8c641027326e30db213169abe7",
                                 "63120cd3e9b950400bd9366c1cc543d55e7823a51fc81d4b2d021536662c85a7",
                                 "9c58c33c68c8494d8eac12c6a4ff122b1e719ebba988c7c12c597bd0f01ff1a1",
                                 "cf05e4d1b1c8d93caf36dff4b4abaec8144a0281f8cbb611d0fb6e2a7fb38385",
                                 "d32b9f057abc3dda988d443cf9866d70a3e986a57f2c6f82379e45b8b900128b",
                                 "5e09159104bf3a9036e90e35b4bb4de0123907b3d6b5c30d155f50231f98e60a", 
                                 "7d5cb5629aad0d20f2127d39f3f72112936731880678b1e86a9d2eec475301db",
                                 "f9d96115b770e86878dda0abe837a4922a67f1621c1c09a713d9e5259b7daba7",
                                 "e4aefb3e93a05959581f99378cfb034c5c4bf072063fa82572fe271a835d7c3d",
                                 "3e7873f34404c87d7b2db9f6a460f3caa22a36f093a01ad50494863b392569ce",
                                 "cd2688a74a151b03282388dadb8b6aaca309f2535c8b2b21d1243846d2b259dc",
                                 "d5006c0d9e14d5c9e96936405c4ad2a6aab4e6756dac16fcbdfffe47efb807dd",
                                 "182607dfc1170294301053ff004bbc9db5ffa68e5d36d29fe64a22a13d75aeb1",
                                 "e17249c2157e01acceb725d50ede423fb63fd75d615433276ae846742f06112c",
                                 "c0403bb03cd6860d227b6a24772d30ac511bf51cddda16414abba13567d95e66",
                                 "32954725dfc81d4d557a693f5d6901ac9d0556a6b51f00a5c2beed8a337a8e5d",
                                 "21e4c7ec5ebfc98d8322ac362e0e4719b30138df58a99aa0200fb345bb83657e",
                                 "d8bdfbd3e3d8e4991edcf69337c6a747985e2e15ca7ec971c4165d68f66eed86",
                                 "2b6c43f27f3c72652dedd07fa12131d64b4451638922361879a13e7289e552af",
                                 "644bca8e169fe2434124f528a7e2fabd45634301575890da81377d8f03636d35",
                                 "7eabaf02d37a50a3fb4aaae154f9e803f67a275e9af4b59adac4dccd733485d7",
                                 "21eb39285fcd91148385d11b77489aad84e00f15b42bbdd98c6bc2fdaca7b987",
                                 "18bc51c6c267f218e14280d7b21b48ee23968c9ea76bbab945d7456a3da05907", 
                                 "f52cf893bd4b5ed92065197bb1eecb2546cd192b603c831cef0acb2d03ab83a4", 
                                 "eb5a608211fc88588094ef613b9983f4a7744a90309375096eaf12fe29d506d9", 
                                 "cf131738f4b5fe3f42e9108e24595fc3e6573347d78e4e69ec42106c1eebe42c", 
                                 "097b30f6ef06eb2447f459a20a777190eefda55d148dd109ed3547b2338b540f", 
                                 "c4bac26cc79788539e98b99989b3d2e9e13b74974b861badc66613a5e661ba90", 
                                 "b83ca6663e8840c29790c00783bf29c8aa6d8cab6bae5cb9ca8aa7c7901462f4", 
                                 "705e4e1db0576aa2a6df0ba9ebeda9e647e2ce95d90727d6b95f559a4a95c1fe",
                                 "c70c8840b2d56de13c20fd2144784bfb955b847c83b45673352375802d14b3d5",
                                 "394ba9db0f6d26ec083decceee35ef7973a41681c522b9d400cf46fc5709015f",
                                 "28304f6396076ca10babe682950eaa06574a291e5fbee5aaeec8ac69f1dc46b3", 
                                 "dbd690d20b6a0ef2fec54ce7cf549884ad0509ed08ae0eb715fe5b7c501afe6b") and
not _arraysearch(process.thread.Ext.call_stack_final_user_module.code_signature, $entry,
($entry.trusted == true or $entry.status == "errorExpired") and
$entry.subject_name in (
"AMD PMP-PE CB Code Signer v20140501",
"Carbon Black, Inc.",
"PC SOFT INFORMATIQUE SAS",
"Kaspersky Lab JSC",
"Kaspersky Lab",
"AO Kaspersky Lab",
"ESET, spol. s r.o.",
"MUSARUBRA US LLC",
"Microsoft Windows Hardware Compatibility Publisher"
)) and
not _arraysearch(process.thread.Ext.call_stack, $entry,
                 $entry.symbol_info like
                                     ("c:\\windows\\*\\ntdll.dll!Ldr*",
                                      "c:\\windows\\*\\ntdll.dll!RtlAllocateHeap*",
                                      "c:\\windows\\sys?????\\ntdll.dll!RtlFreeHeap*",
                                      "c:\\windows\\sys?????\\ntdll.dll!RtlReAllocateHeap*",
                                      "c:\\windows\\sys?????\\ntdll.dll!RtlUnlockHeap*",
                                      "c:\\windows\\sys?????\\ntdll.dll+0x*", 
                                      "c:\\windows\\sys*\\kernelbase.dll!VirtualAlloc*", 
                                      "c:\\windows\\system32\\kernelbase.dll!HeapCreat*")) and
not (process.executable : "\\\\?\\Volume{*}\\*.exe" and process.thread.Ext.call_stack_final_user_module.path like "?:\\*\\docker\\*\\windows\\*") and 
not process.thread.Ext.call_stack_summary like ("ntdll.dll|libpcre*.dll|libgobject-*.dll|ntdll.dll", "ntdll.dll|libffi-*.dll|libpython*.dll|ntdll.dll")
'''

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

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1106"
name = "Native API"
reference = "https://attack.mitre.org/techniques/T1106/"


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

Stages and Predicates

Stage 1: api

api where
process.Ext.api.behaviors == "native_api" and process.Ext.api.behaviors != "hidden_code" and
process.Ext.api.metadata.target_address_name in ("Unbacked", "Unknown") and
process.Ext.api.name in ("VirtualProtect", "VirtualProtectEx", "WriteProcessMemory", "MapViewOfFile", "MapViewOfFile2", "VirtualAllocEx", "VirtualAlloc", "SetThreadContext") and
process.thread.Ext.call_stack_final_user_module.name != "Unbacked" and process.thread.Ext.call_stack_final_user_module.name != null and
_arraysearch(process.thread.Ext.call_stack_final_user_module.code_signature, $entry, $entry.trusted == false or $entry.exists == false) and
not process.thread.Ext.call_stack_final_user_module.protection_provenance like "Kernel*" and
not (process.executable : "C:\\Windows\\explorer.exe" and process.thread.Ext.call_stack_final_user_module.path == "c:\\windows\\dxgi.dll") and
process.thread.Ext.call_stack_final_user_module.hash.sha256 != null and 
not process.thread.Ext.call_stack_summary like "ntdll.dll|*|Unknown" and 
not (process.Ext.api.name == "MapViewOfFile" and process.thread.Ext.call_stack_final_user_module.name in ("cygwin1.dll", "msys-2.0.dll")) and 
not process.thread.Ext.call_stack_final_user_module.path like ("c:\\windows\\assembly\\nativeimages_*.ni.dll",
                                                               "c:\\windows\\microsoft.net\\framework*.dll",
                                                               "?:\\program files (x86)\\*",
                                                               "?:\\program files\\*",
                                                               "c:\\windows\\winsxs\\*.dll",
                                                               "c:\\windows\\systemapps\\microsoft.windows.*.dll",
                                                               "c:\\windows\\system32\\ntdll.dll",
                                                               "c:\\windows\\syswow64\\ntdll.dll",
                                                               "c:\\windows\\syswow64\\apphelp.dll",
                                                               "c:\\windows\\syswow64\\cyinjct.dll",
                                                               "c:\\windows\\system32\\cyvrtrap.dll",
                                                               "c:\\windows\\system32\\edrpm64.dll",
                                                               "c:\\windows\\system32\\esensordbi.dll",
                                                               "c:\\windows\\system32\\hmpalert.dll", 
                                                               "?:\\windows\\system32\\spool\\drivers\\x64\\*\\ricoh_*.dll", 
                                                               "c:\\windows\\systemapps\\shellexperiencehost_*\\dxgi.dll",
                                                               "c:\\windows\\system32\\sophosed\\sophosed.dll",
                                                               "c:\\windows\\system32\\xtajit64.dll",
                                                               "c:\\windows\\system32\\microsoftaccounttokenprovider.dll", 
                                                               "c:\\windows\\system32\\appxsip.dll") and
not process.thread.Ext.call_stack_final_user_module.protection_provenance_path : ("c:\\program files (x86)\\*", "c:\\program files\\*") and
not (process.executable : "C:\\Windows\\System32\\lsass.exe" and process.thread.Ext.call_stack_final_user_module.path == "c:\\windows\\system32\\lsasrv.dll") and
not (process.executable : "C:\\Windows\\System32\\csrss.exe" and process.thread.Ext.call_stack_final_user_module.path == "c:\\windows\\system32\\sxssrv.dll") and
not (process.thread.Ext.call_stack_final_user_module.path == "c:\\windows\\syswow64\\wrusr.dll" and process.thread.Ext.call_stack_summary like "ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|wrusr.dll|kernelbase.dll|*") and
not process.thread.Ext.call_stack_final_user_module.hash.sha256 in
                                ("20623b2da7f3a2c1773f044921d2a99ce6b719f232796d88f164c41dc40b941a",
                                 "8a0e3caa3ee18379d63b9bd709ac6a87fb0dd8c31c833cb48bc4c9bc10017486",
                                 "0f3ed1563ab2ec7dbbf8e9db14e6ff649fcb3bfd607dd81ce4fc91a211559a4b",
                                 "b2d86212afab00e7b9bf19b7931277130b653c9258ac419a7a24d749471ea5ac",
                                 "8526104317a63fbdb2d126e737f822a03a2cf05046d712a136545a428320443d",
                                 "ecf5054d7f1ad0da4b1c9295b23389645780bb20855b6c727762163170d38d48",
                                 "6a2bf3ad9caeec71ff5fbd187f5db3337e4c99fa51e36ee039183b0aa610b22c",
                                 "65b2be41a8c2456dc69fd216000c2400d8fc48f37a40d21f94318a77d7459441",
                                 "f7c78dba07128af325d8da99138ebf78be163ecfb5da5b01fa6b65b96efecef1",
                                 "6778b8d1eabffe78447ec4aa6d793e776a9db351c202c955dda196e90df19fa2",
                                 "31fb9c74183eaa737317fd0260c218e38ae5b243988108c7e5e60e416fe54a84",
                                 "f239c27b50cef792fea5b34378fbac83bcc06b8442d508bd9add7ddf8ca5c632",
                                 "685774f56983b22fbd1f84880fe60f149ccf0322abe8dd09b7a0d81f4a5dd1f1",
                                 "c8f242570144ac4ba77967a1dc59d6681ca2d8a6a85c4db2a30e1e4629db843a",
                                 "16e40b77295687c45e7c9eefce8336aa69c08ac6648ba3a919bc5497b6ed7f83",
                                 "ab77212a71c2e2e8b870452d2c32bc72a6708d6e963dd3ebe2ac1a946cffc242",
                                 "7a94bc02118f56e337709f1e71f730ebe1245e8c641027326e30db213169abe7",
                                 "63120cd3e9b950400bd9366c1cc543d55e7823a51fc81d4b2d021536662c85a7",
                                 "9c58c33c68c8494d8eac12c6a4ff122b1e719ebba988c7c12c597bd0f01ff1a1",
                                 "cf05e4d1b1c8d93caf36dff4b4abaec8144a0281f8cbb611d0fb6e2a7fb38385",
                                 "d32b9f057abc3dda988d443cf9866d70a3e986a57f2c6f82379e45b8b900128b",
                                 "5e09159104bf3a9036e90e35b4bb4de0123907b3d6b5c30d155f50231f98e60a", 
                                 "7d5cb5629aad0d20f2127d39f3f72112936731880678b1e86a9d2eec475301db",
                                 "f9d96115b770e86878dda0abe837a4922a67f1621c1c09a713d9e5259b7daba7",
                                 "e4aefb3e93a05959581f99378cfb034c5c4bf072063fa82572fe271a835d7c3d",
                                 "3e7873f34404c87d7b2db9f6a460f3caa22a36f093a01ad50494863b392569ce",
                                 "cd2688a74a151b03282388dadb8b6aaca309f2535c8b2b21d1243846d2b259dc",
                                 "d5006c0d9e14d5c9e96936405c4ad2a6aab4e6756dac16fcbdfffe47efb807dd",
                                 "182607dfc1170294301053ff004bbc9db5ffa68e5d36d29fe64a22a13d75aeb1",
                                 "e17249c2157e01acceb725d50ede423fb63fd75d615433276ae846742f06112c",
                                 "c0403bb03cd6860d227b6a24772d30ac511bf51cddda16414abba13567d95e66",
                                 "32954725dfc81d4d557a693f5d6901ac9d0556a6b51f00a5c2beed8a337a8e5d",
                                 "21e4c7ec5ebfc98d8322ac362e0e4719b30138df58a99aa0200fb345bb83657e",
                                 "d8bdfbd3e3d8e4991edcf69337c6a747985e2e15ca7ec971c4165d68f66eed86",
                                 "2b6c43f27f3c72652dedd07fa12131d64b4451638922361879a13e7289e552af",
                                 "644bca8e169fe2434124f528a7e2fabd45634301575890da81377d8f03636d35",
                                 "7eabaf02d37a50a3fb4aaae154f9e803f67a275e9af4b59adac4dccd733485d7",
                                 "21eb39285fcd91148385d11b77489aad84e00f15b42bbdd98c6bc2fdaca7b987",
                                 "18bc51c6c267f218e14280d7b21b48ee23968c9ea76bbab945d7456a3da05907", 
                                 "f52cf893bd4b5ed92065197bb1eecb2546cd192b603c831cef0acb2d03ab83a4", 
                                 "eb5a608211fc88588094ef613b9983f4a7744a90309375096eaf12fe29d506d9", 
                                 "cf131738f4b5fe3f42e9108e24595fc3e6573347d78e4e69ec42106c1eebe42c", 
                                 "097b30f6ef06eb2447f459a20a777190eefda55d148dd109ed3547b2338b540f", 
                                 "c4bac26cc79788539e98b99989b3d2e9e13b74974b861badc66613a5e661ba90", 
                                 "b83ca6663e8840c29790c00783bf29c8aa6d8cab6bae5cb9ca8aa7c7901462f4", 
                                 "705e4e1db0576aa2a6df0ba9ebeda9e647e2ce95d90727d6b95f559a4a95c1fe",
                                 "c70c8840b2d56de13c20fd2144784bfb955b847c83b45673352375802d14b3d5",
                                 "394ba9db0f6d26ec083decceee35ef7973a41681c522b9d400cf46fc5709015f",
                                 "28304f6396076ca10babe682950eaa06574a291e5fbee5aaeec8ac69f1dc46b3", 
                                 "dbd690d20b6a0ef2fec54ce7cf549884ad0509ed08ae0eb715fe5b7c501afe6b") and
not _arraysearch(process.thread.Ext.call_stack_final_user_module.code_signature, $entry,
($entry.trusted == true or $entry.status == "errorExpired") and
$entry.subject_name in (
"AMD PMP-PE CB Code Signer v20140501",
"Carbon Black, Inc.",
"PC SOFT INFORMATIQUE SAS",
"Kaspersky Lab JSC",
"Kaspersky Lab",
"AO Kaspersky Lab",
"ESET, spol. s r.o.",
"MUSARUBRA US LLC",
"Microsoft Windows Hardware Compatibility Publisher"
)) and
not _arraysearch(process.thread.Ext.call_stack, $entry,
                 $entry.symbol_info like
                                     ("c:\\windows\\*\\ntdll.dll!Ldr*",
                                      "c:\\windows\\*\\ntdll.dll!RtlAllocateHeap*",
                                      "c:\\windows\\sys?????\\ntdll.dll!RtlFreeHeap*",
                                      "c:\\windows\\sys?????\\ntdll.dll!RtlReAllocateHeap*",
                                      "c:\\windows\\sys?????\\ntdll.dll!RtlUnlockHeap*",
                                      "c:\\windows\\sys?????\\ntdll.dll+0x*", 
                                      "c:\\windows\\sys*\\kernelbase.dll!VirtualAlloc*", 
                                      "c:\\windows\\system32\\kernelbase.dll!HeapCreat*")) and
not (process.executable : "\\\\?\\Volume{*}\\*.exe" and process.thread.Ext.call_stack_final_user_module.path like "?:\\*\\docker\\*\\windows\\*") and 
not process.thread.Ext.call_stack_summary like ("ntdll.dll|libpcre*.dll|libgobject-*.dll|ntdll.dll", "ntdll.dll|libffi-*.dll|libpython*.dll|ntdll.dll")

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
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.Ext.api.nameeqMapViewOfFileexcludes:process.Ext.api.name field:"process.Ext.api.name" value:"MapViewOfFile"
process.thread.Ext.call_stack_final_user_module.nameincygwin1.dll, msys-2.0.dllexcludes:process.thread.Ext.call_stack_final_user_module.name field:"process.thread.Ext.call_stack_final_user_module.name" value:"cygwin1.dll" field:"process.thread.Ext.call_stack_final_user_module.name" value:"msys-2.0.dll"
process.executableeqC:\Windows\System32\csrss.exeexcludes:process.executable field:"process.executable" value:"C:\Windows\System32\csrss.exe"
process.thread.Ext.call_stack_final_user_module.patheqc:\windows\system32\sxssrv.dllexcludes:process.thread.Ext.call_stack_final_user_module.path field:"process.thread.Ext.call_stack_final_user_module.path" value:"c:\windows\system32\sxssrv.dll"
process.executableeqC:\Windows\System32\lsass.exeexcludes:process.executable field:"process.executable" value:"C:\Windows\System32\lsass.exe"
process.thread.Ext.call_stack_final_user_module.patheqc:\windows\system32\lsasrv.dllexcludes:process.thread.Ext.call_stack_final_user_module.path field:"process.thread.Ext.call_stack_final_user_module.path" value:"c:\windows\system32\lsasrv.dll"
process.executableeqC:\Windows\explorer.exeexcludes:process.executable field:"process.executable" value:"C:\Windows\explorer.exe"
process.thread.Ext.call_stack_final_user_module.patheqc:\windows\dxgi.dllexcludes:process.thread.Ext.call_stack_final_user_module.path field:"process.thread.Ext.call_stack_final_user_module.path" value:"c:\windows\dxgi.dll"
process.executablewildcard\\?\Volume{*}\*.exeexcludes:process.executable field:"process.executable" value:"\\?\Volume{*}\*.exe"
process.thread.Ext.call_stack_final_user_module.pathwildcard?:\*\docker\*\windows\*excludes:process.thread.Ext.call_stack_final_user_module.path field:"process.thread.Ext.call_stack_final_user_module.path" value:"?:\*\docker\*\windows\*"
process.thread.Ext.call_stackarray_any(no value, null check)excludes:process.thread.Ext.call_stack
process.thread.Ext.call_stack_final_user_module.patheqc:\windows\syswow64\wrusr.dllexcludes:process.thread.Ext.call_stack_final_user_module.path field:"process.thread.Ext.call_stack_final_user_module.path" value:"c:\windows\syswow64\wrusr.dll"
process.thread.Ext.call_stack_summarystarts_withntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|wrusr.dll|kernelbase.dll|excludes:process.thread.Ext.call_stack_summary field:"process.thread.Ext.call_stack_summary" value:"ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|wrusr.dll|kernelbase.dll|"
process.thread.Ext.call_stack_final_user_module.hash.sha256in097b30f6ef06eb2447f459a20a777190eefda55d148dd109ed3547b2338b540f, 0f3ed1563ab2ec7dbbf8e9db14e6ff649fcb3bfd607dd81ce4fc91a211559a4b, 16e40b77295687c45e7c9eefce8336aa69c08ac6648ba3a919bc5497b6ed7f83, 182607dfc1170294301053ff004bbc9db5ffa68e5d36d29fe64a22a13d75aeb1, 18bc51c6c267f218e14280d7b21b48ee23968c9ea76bbab945d7456a3da05907, 20623b2da7f3a2c1773f044921d2a99ce6b719f232796d88f164c41dc40b941a, 21e4c7ec5ebfc98d8322ac362e0e4719b30138df58a99aa0200fb345bb83657e, 21eb39285fcd91148385d11b77489aad84e00f15b42bbdd98c6bc2fdaca7b987, 28304f6396076ca10babe682950eaa06574a291e5fbee5aaeec8ac69f1dc46b3, 2b6c43f27f3c72652dedd07fa12131d64b4451638922361879a13e7289e552af, 31fb9c74183eaa737317fd0260c218e38ae5b243988108c7e5e60e416fe54a84, 32954725dfc81d4d557a693f5d6901ac9d0556a6b51f00a5c2beed8a337a8e5d, 394ba9db0f6d26ec083decceee35ef7973a41681c522b9d400cf46fc5709015f, 3e7873f34404c87d7b2db9f6a460f3caa22a36f093a01ad50494863b392569ce, 5e09159104bf3a9036e90e35b4bb4de0123907b3d6b5c30d155f50231f98e60a, 63120cd3e9b950400bd9366c1cc543d55e7823a51fc81d4b2d021536662c85a7, 644bca8e169fe2434124f528a7e2fabd45634301575890da81377d8f03636d35, 65b2be41a8c2456dc69fd216000c2400d8fc48f37a40d21f94318a77d7459441, 6778b8d1eabffe78447ec4aa6d793e776a9db351c202c955dda196e90df19fa2, 685774f56983b22fbd1f84880fe60f149ccf0322abe8dd09b7a0d81f4a5dd1f1, 6a2bf3ad9caeec71ff5fbd187f5db3337e4c99fa51e36ee039183b0aa610b22c, 705e4e1db0576aa2a6df0ba9ebeda9e647e2ce95d90727d6b95f559a4a95c1fe, 7a94bc02118f56e337709f1e71f730ebe1245e8c641027326e30db213169abe7, 7d5cb5629aad0d20f2127d39f3f72112936731880678b1e86a9d2eec475301db, 7eabaf02d37a50a3fb4aaae154f9e803f67a275e9af4b59adac4dccd733485d7, 8526104317a63fbdb2d126e737f822a03a2cf05046d712a136545a428320443d, 8a0e3caa3ee18379d63b9bd709ac6a87fb0dd8c31c833cb48bc4c9bc10017486, 9c58c33c68c8494d8eac12c6a4ff122b1e719ebba988c7c12c597bd0f01ff1a1, ab77212a71c2e2e8b870452d2c32bc72a6708d6e963dd3ebe2ac1a946cffc242, b2d86212afab00e7b9bf19b7931277130b653c9258ac419a7a24d749471ea5ac, b83ca6663e8840c29790c00783bf29c8aa6d8cab6bae5cb9ca8aa7c7901462f4, c0403bb03cd6860d227b6a24772d30ac511bf51cddda16414abba13567d95e66, c4bac26cc79788539e98b99989b3d2e9e13b74974b861badc66613a5e661ba90, c70c8840b2d56de13c20fd2144784bfb955b847c83b45673352375802d14b3d5, c8f242570144ac4ba77967a1dc59d6681ca2d8a6a85c4db2a30e1e4629db843a, cd2688a74a151b03282388dadb8b6aaca309f2535c8b2b21d1243846d2b259dc, cf05e4d1b1c8d93caf36dff4b4abaec8144a0281f8cbb611d0fb6e2a7fb38385, cf131738f4b5fe3f42e9108e24595fc3e6573347d78e4e69ec42106c1eebe42c, d32b9f057abc3dda988d443cf9866d70a3e986a57f2c6f82379e45b8b900128b, d5006c0d9e14d5c9e96936405c4ad2a6aab4e6756dac16fcbdfffe47efb807dd, d8bdfbd3e3d8e4991edcf69337c6a747985e2e15ca7ec971c4165d68f66eed86, dbd690d20b6a0ef2fec54ce7cf549884ad0509ed08ae0eb715fe5b7c501afe6b, e17249c2157e01acceb725d50ede423fb63fd75d615433276ae846742f06112c, e4aefb3e93a05959581f99378cfb034c5c4bf072063fa82572fe271a835d7c3d, eb5a608211fc88588094ef613b9983f4a7744a90309375096eaf12fe29d506d9, ecf5054d7f1ad0da4b1c9295b23389645780bb20855b6c727762163170d38d48, f239c27b50cef792fea5b34378fbac83bcc06b8442d508bd9add7ddf8ca5c632, f52cf893bd4b5ed92065197bb1eecb2546cd192b603c831cef0acb2d03ab83a4, f7c78dba07128af325d8da99138ebf78be163ecfb5da5b01fa6b65b96efecef1, f9d96115b770e86878dda0abe837a4922a67f1621c1c09a713d9e5259b7daba7excludes:process.thread.Ext.call_stack_final_user_module.hash.sha256
process.thread.Ext.call_stack_final_user_module.pathwildcardc:\windows\assembly\nativeimages_*.ni.dll, c:\windows\microsoft.net\framework*.dll, ?:\program files (x86)\*, ?:\program files\*, c:\windows\winsxs\*.dll, c:\windows\systemapps\microsoft.windows.*.dll, c:\windows\system32\ntdll.dll, c:\windows\syswow64\ntdll.dll, c:\windows\syswow64\apphelp.dll, c:\windows\syswow64\cyinjct.dll, c:\windows\system32\cyvrtrap.dll, c:\windows\system32\edrpm64.dll, c:\windows\system32\esensordbi.dll, c:\windows\system32\hmpalert.dll, ?:\windows\system32\spool\drivers\x64\*\ricoh_*.dll, c:\windows\systemapps\shellexperiencehost_*\dxgi.dll, c:\windows\system32\sophosed\sophosed.dll, c:\windows\system32\xtajit64.dll, c:\windows\system32\microsoftaccounttokenprovider.dll, c:\windows\system32\appxsip.dllexcludes:process.thread.Ext.call_stack_final_user_module.path
process.thread.Ext.call_stack_final_user_module.protection_provenancestarts_withKernelexcludes:process.thread.Ext.call_stack_final_user_module.protection_provenance field:"process.thread.Ext.call_stack_final_user_module.protection_provenance" value:"Kernel"
process.thread.Ext.call_stack_final_user_module.protection_provenance_pathstarts_withc:\program files (x86)\, c:\program files\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 (x86)\" field:"process.thread.Ext.call_stack_final_user_module.protection_provenance_path" value:"c:\program files\"
process.thread.Ext.call_stack_summarywildcardntdll.dll|*|Unknownexcludes:process.thread.Ext.call_stack_summary field:"process.thread.Ext.call_stack_summary" value:"ntdll.dll|*|Unknown"
process.thread.Ext.call_stack_summarywildcardntdll.dll|libpcre*.dll|libgobject-*.dll|ntdll.dll, ntdll.dll|libffi-*.dll|libpython*.dll|ntdll.dllexcludes:process.thread.Ext.call_stack_summary field:"process.thread.Ext.call_stack_summary" value:"ntdll.dll|libpcre*.dll|libgobject-*.dll|ntdll.dll" field:"process.thread.Ext.call_stack_summary" value:"ntdll.dll|libffi-*.dll|libpython*.dll|ntdll.dll"

Potential Credential Access via Memory Dump File Creation

#
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 the creation or modification of a medium size memory dump file which can indicate an attempt to access credentials from a process memory.

MITRE ATT&CK Coverage

TacticTechniques
Credential Access

Telemetry Coverage

ProviderRecord / event type
SysmonEvent ID 11: FileCreate

Rule Body

[metadata]
bypass_bbr_timing = true
creation_date = "2023/09/21"
integration = ["endpoint"]
maturity = "production"
updated_date = "2025/01/10"

[rule]
author = ["Elastic"]
building_block_type = "default"
description = """
Identifies the creation or modification of a medium size memory dump file which can indicate an attempt to access
credentials from a process memory.
"""
from = "now-9m"
index = ["logs-endpoint.events.file-*"]
language = "eql"
license = "Elastic License v2"
name = "Potential Credential Access via Memory Dump File Creation"
risk_score = 21
rule_id = "e707a7be-cc52-41ac-8ab3-d34b38c20005"
severity = "low"
tags = [
    "Domain: Endpoint",
    "OS: Windows",
    "Use Case: Threat Detection",
    "Tactic: Credential Access",
    "Data Source: Elastic Defend",
    "Rule Type: BBR",
]
timestamp_override = "event.ingested"
type = "eql"

query = '''
file where host.os.type == "windows" and event.type == "creation" and

  /* MDMP header */
  file.Ext.header_bytes : "4d444d50*" and file.size >= 30000 and
  not

  (
    (
      process.name : "System" or
      process.executable : (
        "?:\\Windows\\System32\\WerFault.exe",
        "?:\\Windows\\SysWOW64\\WerFault.exe",
        "?:\\Windows\\System32\\Wermgr.exe",
        "?:\\Windows\\SysWOW64\\Wermgr.exe",
        "?:\\Windows\\System32\\WerFaultSecure.exe",
        "?:\\Windows\\SysWOW64\\WerFaultSecure.exe",
        "?:\\Windows\\System32\\WUDFHost.exe",
        "C:\\Windows\\System32\\rdrleakdiag.exe",
        "?:\\Windows\\System32\\Taskmgr.exe",
        "?:\\Windows\\SysWOW64\\Taskmgr.exe",
        "?:\\Program Files\\*.exe",
        "?:\\Program Files (x86)\\*.exe",
        "?:\\Windows\\SystemApps\\*.exe",
        "?:\\Users\\*\\AppData\\Roaming\\Zoom\\bin\\zCrashReport64.exe",
        "?:\\Windows\\CCM\\ccmdump.exe",
        "?:\\$WINDOWS.~BT\\Sources\\SetupHost.exe"
      ) and process.code_signature.trusted == true
    ) or
    (
      file.path : (
        "?:\\ProgramData\\Microsoft\\Windows\\WER\\*",
        "?:\\ProgramData\\Microsoft\\WDF\\*",
        "?:\\ProgramData\\Alteryx\\ErrorLogs\\*",
        "?:\\ProgramData\\Goodix\\*",
        "?:\\Windows\\system32\\config\\systemprofile\\AppData\\Local\\CrashDumps\\*",
        "?:\\Users\\*\\AppData\\Roaming\\Zoom\\logs\\zoomcrash*",
        "?:\\Users\\*\\AppData\\*\\Crashpad\\*",
        "?:\\Users\\*\\AppData\\*\\crashpaddb\\*",
        "?:\\Users\\*\\AppData\\*\\HungReports\\*",
        "?:\\Users\\*\\AppData\\*\\CrashDumps\\*",
        "?:\\Users\\*\\AppData\\*\\NativeCrashReporting\\*",
        "?:\\Program Files (x86)\\*\\Crashpad\\*",
        "?:\\Program Files\\*\\Crashpad\\*"
      ) and (process.code_signature.trusted == true or process.executable == null)
    )
  )
'''


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



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

Stages and Predicates

Stage 1: file

file where host.os.type == "windows" and event.type == "creation" and
  file.Ext.header_bytes : "4d444d50*" and file.size >= 30000 and
  not
  (
    (
      process.name : "System" or
      process.executable : (
        "?:\\Windows\\System32\\WerFault.exe",
        "?:\\Windows\\SysWOW64\\WerFault.exe",
        "?:\\Windows\\System32\\Wermgr.exe",
        "?:\\Windows\\SysWOW64\\Wermgr.exe",
        "?:\\Windows\\System32\\WerFaultSecure.exe",
        "?:\\Windows\\SysWOW64\\WerFaultSecure.exe",
        "?:\\Windows\\System32\\WUDFHost.exe",
        "C:\\Windows\\System32\\rdrleakdiag.exe",
        "?:\\Windows\\System32\\Taskmgr.exe",
        "?:\\Windows\\SysWOW64\\Taskmgr.exe",
        "?:\\Program Files\\*.exe",
        "?:\\Program Files (x86)\\*.exe",
        "?:\\Windows\\SystemApps\\*.exe",
        "?:\\Users\\*\\AppData\\Roaming\\Zoom\\bin\\zCrashReport64.exe",
        "?:\\Windows\\CCM\\ccmdump.exe",
        "?:\\$WINDOWS.~BT\\Sources\\SetupHost.exe"
      ) and process.code_signature.trusted == true
    ) or
    (
      file.path : (
        "?:\\ProgramData\\Microsoft\\Windows\\WER\\*",
        "?:\\ProgramData\\Microsoft\\WDF\\*",
        "?:\\ProgramData\\Alteryx\\ErrorLogs\\*",
        "?:\\ProgramData\\Goodix\\*",
        "?:\\Windows\\system32\\config\\systemprofile\\AppData\\Local\\CrashDumps\\*",
        "?:\\Users\\*\\AppData\\Roaming\\Zoom\\logs\\zoomcrash*",
        "?:\\Users\\*\\AppData\\*\\Crashpad\\*",
        "?:\\Users\\*\\AppData\\*\\crashpaddb\\*",
        "?:\\Users\\*\\AppData\\*\\HungReports\\*",
        "?:\\Users\\*\\AppData\\*\\CrashDumps\\*",
        "?:\\Users\\*\\AppData\\*\\NativeCrashReporting\\*",
        "?:\\Program Files (x86)\\*\\Crashpad\\*",
        "?:\\Program Files\\*\\Crashpad\\*"
      ) and (process.code_signature.trusted == true or process.executable == null)
    )
  )

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.Ext.header_byteswildcard
  • 4d444d50* corpus 2 (elastic 2)
field:"file.Ext.header_bytes" kind:wildcard value:"4d444d50*"
file.sizege
  • 30000 transforms: number corpus 5 (elastic 5)
field:"file.size" kind:ge value:"30000"

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.code_signature.trustedeqtrueexcludes:process.code_signature.trusted field:"process.code_signature.trusted" value:"true"
process.executableis_null(no value, null check)excludes:process.executable
file.pathwildcard?:\ProgramData\Microsoft\Windows\WER\*, ?:\ProgramData\Microsoft\WDF\*, ?:\ProgramData\Alteryx\ErrorLogs\*, ?:\ProgramData\Goodix\*, ?:\Windows\system32\config\systemprofile\AppData\Local\CrashDumps\*, ?:\Users\*\AppData\Roaming\Zoom\logs\zoomcrash*, ?:\Users\*\AppData\*\Crashpad\*, ?:\Users\*\AppData\*\crashpaddb\*, ?:\Users\*\AppData\*\HungReports\*, ?:\Users\*\AppData\*\CrashDumps\*, ?:\Users\*\AppData\*\NativeCrashReporting\*, ?:\Program Files (x86)\*\Crashpad\*, ?:\Program Files\*\Crashpad\*excludes:file.path
process.executablewildcard?:\Windows\System32\WerFault.exe, ?:\Windows\SysWOW64\WerFault.exe, ?:\Windows\System32\Wermgr.exe, ?:\Windows\SysWOW64\Wermgr.exe, ?:\Windows\System32\WerFaultSecure.exe, ?:\Windows\SysWOW64\WerFaultSecure.exe, ?:\Windows\System32\WUDFHost.exe, C:\Windows\System32\rdrleakdiag.exe, ?:\Windows\System32\Taskmgr.exe, ?:\Windows\SysWOW64\Taskmgr.exe, ?:\Program Files\*.exe, ?:\Program Files (x86)\*.exe, ?:\Windows\SystemApps\*.exe, ?:\Users\*\AppData\Roaming\Zoom\bin\zCrashReport64.exe, ?:\Windows\CCM\ccmdump.exe, ?:\$WINDOWS.~BT\Sources\SetupHost.exeexcludes:process.executable
process.nameeqSystemexcludes:process.name field:"process.name" value:"System"

Potential Execution via Foxmail Exploitation

#
Source
github.com/elastic/protections-artifacts

Identifies the Foxmail client process spawning a child process with argument pointing to the Foxmail temp directory. This may indicate the successful exploitation of a Foxmail vulnerability for initial access and execution via a malicious email that automatically double clicks a hidden executable attachment.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
Identifies the Foxmail client process spawning a child process with argument pointing to the Foxmail temp directory.
This may indicate the successful exploitation of a Foxmail vulnerability for initial access and execution via a
malicious email that automatically double clicks a hidden executable attachment.
"""
id = "0f00dd3b-3a41-45d3-afb6-cdf874f28d8c"
license = "Elastic License v2"
name = "Potential Execution via Foxmail Exploitation"
os_list = ["windows"]
reference = ["https://mp.weixin.qq.com/s/F8hNyESBdKhwXkQPgtGpew"]
version = "1.0.3"

query = '''
process where event.action == "start" and
 process.parent.name : "Foxmail.exe" and process.args : "?:\\Users\\*\\AppData\\Roaming\\Foxmail*" and
 not process.executable : ("?:\\Program Files\\*.exe", "?:\\Program Files (x86)\\*.exe") and
 not (process.code_signature.subject_name in ("Zhuhai Kingsoft Office Software Co., Ltd.", "Tencent Technology(Shenzhen) Company Limited") and
     process.code_signature.trusted == true)
'''

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

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

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1189"
name = "Drive-by Compromise"
reference = "https://attack.mitre.org/techniques/T1189/"


[threat.tactic]
id = "TA0001"
name = "Initial Access"
reference = "https://attack.mitre.org/tactics/TA0001/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1203"
name = "Exploitation for Client Execution"
reference = "https://attack.mitre.org/techniques/T1203/"


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

[internal]
min_endpoint_version = "7.16.0"

Stages and Predicates

Stage 1: process

process where event.action == "start" and
 process.parent.name : "Foxmail.exe" and process.args : "?:\\Users\\*\\AppData\\Roaming\\Foxmail*" and
 not process.executable : ("?:\\Program Files\\*.exe", "?:\\Program Files (x86)\\*.exe") and
 not (process.code_signature.subject_name in ("Zhuhai Kingsoft Office Software Co., Ltd.", "Tencent Technology(Shenzhen) Company Limited") and
     process.code_signature.trusted == true)

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

Potential Instruction Pointer Modification via Ptrace

#
Source
github.com/elastic/protections-artifacts

This rule detects PTRACE_POKEUSER requests targeting offsets associated with the x86-64 instruction pointer (RIP) or the 32-bit x86 instruction pointer (EIP). Modification of an instruction pointer through ptrace can redirect execution to attacker-controlled code and may indicate process injection. Offset 48 may refer to a different register when the target uses a native 64-bit register layout, so this rule is released as diagnostic.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
This rule detects PTRACE_POKEUSER requests targeting offsets associated with the x86-64 instruction pointer (RIP) or the
32-bit x86 instruction pointer (EIP). Modification of an instruction pointer through ptrace can redirect execution to
attacker-controlled code and may indicate process injection. Offset 48 may refer to a different register when the target
uses a native 64-bit register layout, so this rule is released as diagnostic.
"""
id = "953190e1-7c86-4a75-9f42-2d78d213291f"
license = "Elastic License v2"
name = "Potential Instruction Pointer Modification via Ptrace"
os_list = ["linux"]
reference = [
    "https://man7.org/linux/man-pages/man2/ptrace.2.html",
    "https://www.akamai.com/blog/security-research/the-definitive-guide-to-linux-process-injection",
]
version = "1.0.1"

query = '''
process where event.type == "start" and event.action == "ptrace" and process.Ext.ptrace.request == 6 and
process.Ext.ptrace.addr in (
  128, // RIP: x86-64
  48   // EIP: 32-bit x86; R11 with a native x86-64 register layout
)
'''

min_endpoint_version = "9.1.4"
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 = "T1055"
name = "Process Injection"
reference = "https://attack.mitre.org/techniques/T1055/"
[[threat.technique.subtechnique]]
id = "T1055.008"
name = "Ptrace System Calls"
reference = "https://attack.mitre.org/techniques/T1055/008/"



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

[internal]
min_endpoint_version = "9.1.4"

Stages and Predicates

Stage 1: process

process where event.type == "start" and event.action == "ptrace" and process.Ext.ptrace.request == 6 and
process.Ext.ptrace.addr in (
  128,
  48
)

Indicators

These rows show field, operator, and value matches.

Potential Masquerading via /proc/self/exe

#
Source
github.com/elastic/protections-artifacts

This rule detects when a process is started directly by calling "/proc/self/exe". This is a technique used by malware to masquerade the legitimate binary name as "exe" in an attempt to evade detection.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
This rule detects when a process is started directly by calling "/proc/self/exe". This is a technique used by malware to
masquerade the legitimate binary name as "exe" in an attempt to evade detection.
"""
id = "eb66a097-a2e0-4fc9-b1e8-c59d26fd9f93"
license = "Elastic License v2"
name = "Potential Masquerading via /proc/self/exe"
os_list = ["linux"]
reference = ["https://x.com/CraigHRowland/status/1858296306202292613"]
version = "1.0.5"

query = '''
process where event.type == "start" and event.action == "exec" and (
  process.executable like (
    "./*", "/tmp/*", "/var/tmp/*", "/dev/shm/*", "/run/*", "/var/run/*", "/boot/*", "/home/*", "/root/*"
  ) or
  process.name like ".*"
) and
process.command_line == "/proc/self/exe" and
not process.parent.executable in ("/usr/bin/bwrap", "/.init")
'''

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

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1036"
name = "Masquerading"
reference = "https://attack.mitre.org/techniques/T1036/"
[[threat.technique.subtechnique]]
id = "T1036.005"
name = "Match Legitimate Resource Name or Location"
reference = "https://attack.mitre.org/techniques/T1036/005/"



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

[internal]
min_endpoint_version = "7.15.0"

Stages and Predicates

Stage 1: process

process where event.type == "start" and event.action == "exec" and (
  process.executable like (
    "./*", "/tmp/*", "/var/tmp/*", "/dev/shm/*", "/run/*", "/var/run/*", "/boot/*", "/home/*", "/root/*"
  ) or
  process.name like ".*"
) and
process.command_line == "/proc/self/exe" and
not process.parent.executable in ("/usr/bin/bwrap", "/.init")

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

Potential Privilege Escalation via Container Misconfiguration

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

This rule monitors for the execution of processes that interact with Linux containers through an interactive shell without root permissions. Utilities such as runc and ctr are universal command-line utilities leveraged to interact with containers via root permissions. On systems where the access to these utilities are misconfigured, attackers might be able to create and run a container that mounts the root folder or spawn a privileged container vulnerable to a container escape attack, which might allow them to escalate privileges and gain further access onto the host file system.

MITRE ATT&CK Coverage

TacticTechniques
Execution
Privilege Escalation

Rule Body

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

[rule]
author = ["Elastic"]
description = """
This rule monitors for the execution of processes that interact with Linux containers through an interactive shell
without root permissions. Utilities such as runc and ctr are universal command-line utilities leveraged to interact with
containers via root permissions. On systems where the access to these utilities are misconfigured, attackers might be
able to create and run a container that mounts the root folder or spawn a privileged container vulnerable to a container
escape attack, which might allow them to escalate privileges and gain further access onto the host file system.
"""
from = "now-9m"
index = ["logs-endpoint.events.process*"]
language = "eql"
license = "Elastic License v2"
name = "Potential Privilege Escalation via Container Misconfiguration"
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 Privilege Escalation via Container Misconfiguration

Containers, managed by tools like runc and ctr, isolate applications for security and efficiency. Misconfigurations can allow attackers to exploit these tools, running containers with elevated privileges or accessing sensitive host resources. The detection rule identifies suspicious use of these utilities by non-root users in interactive sessions, flagging potential privilege escalation attempts.

### Possible investigation steps

- Review the alert details to identify the specific non-root user and group involved in the suspicious activity, as indicated by the user.Ext.real.id and group.Ext.real.id fields.
- Examine the process tree to understand the parent-child relationship of the processes, focusing on the interactive nature of both the process and its parent, as indicated by process.interactive and process.parent.interactive fields.
- Investigate the command-line arguments used with the runc or ctr utilities, particularly looking for the use of "run" and any potentially dangerous flags like "--privileged" or "--mount" that could indicate an attempt to escalate privileges.
- Check the system logs and audit logs for any additional context around the time of the alert, focusing on any other suspicious activities or anomalies involving the same user or process.
- Assess the configuration and access controls of the container management tools on the host to identify any misconfigurations or vulnerabilities that could have been exploited.

### False positive analysis

- Non-root users in development environments may frequently use runc or ctr for legitimate container management tasks. To mitigate this, consider creating exceptions for specific user IDs or groups known to perform these actions regularly.
- Automated scripts or CI/CD pipelines might execute container commands interactively without root permissions. Identify these scripts and exclude their associated user accounts or process names from triggering the rule.
- Some system administrators may operate with non-root accounts for security reasons but still require access to container management tools. Document these users and adjust the rule to exclude their activities by user ID or group ID.
- Training or testing environments where users are encouraged to experiment with container configurations might trigger false positives. Implement a separate monitoring policy for these environments to reduce noise in production alerts.

### Response and remediation

- Immediately isolate the affected container to prevent further unauthorized access or potential lateral movement within the host system.
- Terminate any suspicious container processes identified by the detection rule to halt any ongoing privilege escalation attempts.
- Conduct a thorough review of container configurations and permissions, specifically focusing on the use of runc and ctr utilities, to identify and rectify any misconfigurations that allow non-root users to execute privileged operations.
- Implement strict access controls and enforce the principle of least privilege for container management utilities to ensure only authorized users can execute privileged commands.
- Monitor for any additional signs of compromise or unusual activity on the host system, particularly focusing on processes initiated by non-root users with elevated privileges.
- Escalate the incident to the security operations team for further investigation and to assess the potential impact on the broader environment.
- Update and enhance detection capabilities to include additional indicators of compromise related to container misconfigurations and privilege escalation attempts, ensuring timely alerts for similar threats in the future."""
references = [
    "https://book.hacktricks.xyz/linux-hardening/privilege-escalation/runc-privilege-escalation",
    "https://book.hacktricks.xyz/linux-hardening/privilege-escalation/containerd-ctr-privilege-escalation",
]
risk_score = 73
rule_id = "afe6b0eb-dd9d-4922-b08a-1910124d524d"
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).

Session View uses process data collected by the Elastic Defend integration, but this data is not always collected by default. Session View is available on enterprise subscription for versions 8.3 and above.
#### To confirm that Session View data is enabled:
- Go to “Manage → Policies”, and edit one or more of your Elastic Defend integration policies.
- Select the” Policy settings” tab, then scroll down to the “Linux event collection” section near the bottom.
- Check the box for “Process events”, and turn on the “Include session data” toggle.
- If you want to include file and network alerts in Session View, check the boxes for “Network and File events”.
- If you want to enable terminal output capture, turn on the “Capture terminal output” toggle.
For more information about the additional fields collected when this setting is enabled and the usage of Session View for Analysis refer to the [helper guide](https://www.elastic.co/guide/en/security/current/session-view.html).
"""
severity = "high"
tags = [
    "Domain: Endpoint",
    "OS: Linux",
    "Use Case: Threat Detection",
    "Tactic: Privilege Escalation",
    "Domain: Container",
    "Data Source: Elastic Defend",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
process where host.os.type == "linux" and event.type == "start" and event.action == "exec" and (
  (process.name == "runc" and process.args == "run") or
  (process.name == "ctr" and process.args == "run" and process.args in ("--privileged", "--mount"))
) and not user.Ext.real.id == "0" and not group.Ext.real.id == "0" and
process.interactive == true and process.parent.interactive == true
'''

[[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 = "T1610"
name = "Deploy Container"
reference = "https://attack.mitre.org/techniques/T1610/"

[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 == "linux" and event.type == "start" and event.action == "exec" and (
  (process.name == "runc" and process.args == "run") or
  (process.name == "ctr" and process.args == "run" and process.args in ("--privileged", "--mount"))
) and not user.Ext.real.id == "0" and not group.Ext.real.id == "0" and
process.interactive == true and process.parent.interactive == true

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

Potential SIP Extension Enumeration

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

Identifies SIP OPTIONS requests targeting many distinct extension values from a single client within two minutes. Attackers and VoIP scanners use OPTIONS sweeps to discover valid users before REGISTER brute force, toll fraud, or registration hijacking attempts.

Known False Positives

  • Some legitimate provisioning or monitoring tools enumerate extensions during onboarding. Validate the source against known PBX management systems before closing.

MITRE ATT&CK Coverage

TacticTechniques
Reconnaissance
Discovery

Rule Body

[metadata]
creation_date = "2026/07/30"
integration = ["network_traffic"]
maturity = "production"
min_stack_comments = "Requires ES|QL JSON_EXTRACT on _source to read SIP fields across current and legacy schemas."
min_stack_version = "9.4.0"
updated_date = "2026/07/31"

[rule]
author = ["Elastic"]
description = """
Identifies SIP OPTIONS requests targeting many distinct extension values from a single client within two minutes.
Attackers and VoIP scanners use OPTIONS sweeps to discover valid users before REGISTER brute force, toll fraud, or
registration hijacking attempts.
"""
false_positives = [
    """
    Some legitimate provisioning or monitoring tools enumerate extensions during onboarding. Validate the source against
    known PBX management systems before closing.
    """,
]
from = "now-9m"
language = "esql"
license = "Elastic License v2"
max_signals = 5
name = "Potential SIP Extension Enumeration"
note = """## Triage and analysis

### Investigating Potential SIP Extension Enumeration

SIP OPTIONS is commonly used for capability discovery. Attack tools such as SIPvicious send OPTIONS across sequential or randomized extensions to map valid users. High cardinality of `Esql.to_user` values from one client IP is a strong reconnaissance signal on VoIP segments.

### Possible investigation steps

- Review `Esql.sample_extensions` for sequential or patterned usernames indicative of scanning.
- Inspect `Esql.user_agents` for scanner strings such as `friendly-scanner` or SIPvicious variants.
- Check for follow-on REGISTER or INVITE activity from the same source within the next hour.
- Confirm whether `Esql.client_ip` is an expected management or monitoring host for the `Esql.server_ip` PBX/SBC.

### False positive analysis

- PBX auto-provisioning, extension audits, or SBC health checks may generate OPTIONS to many extensions from a fixed management IP. Add exceptions for those sources only after documenting the tool and schedule.

### Response and remediation

- Block the scanning `Esql.client_ip` at the SBC or perimeter firewall if the activity is unauthorized.
- Enforce SIP authentication and rate limits on the targeted PBX/SBC.
- Hunt for subsequent credential access or toll-fraud INVITE patterns from the same source.
"""
references = ["https://attack.mitre.org/techniques/T1595/", "https://attack.mitre.org/techniques/T1046/"]
risk_score = 47
rule_id = "e7bf9314-f346-45b5-a6ed-044dc3b839c8"
setup = """## Setup

This rule requires the Elastic **network_traffic** integration with the **SIP** protocol module enabled on a sensor that
observes VoIP signaling traffic. SIP monitoring uses UDP port 5060 by default. Enable the integration's **Use TCP**
option when the monitored environment carries plaintext SIP over TCP; Packetbeat monitors the selected transport.

The rule requires decoded SIP headers. SIP over TLS (commonly TCP 5061) is not visible unless the sensor receives
decrypted traffic or observes plaintext SIP after TLS termination. SRTP encryption does not affect this rule when SIP
signaling remains visible.
"""
severity = "medium"
tags = [
    "Domain: Network",
    "Use Case: Threat Detection",
    "Use Case: Network Security Monitoring",
    "Tactic: Discovery",
    "Tactic: Reconnaissance",
    "Data Source: Network Packet Capture",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "esql"

query = '''
from logs-network_traffic.sip-*, packetbeat-* metadata _source
| eval
    Esql.method = TO_UPPER(COALESCE(
        JSON_EXTRACT(_source, "network_traffic.sip.method"),
        JSON_EXTRACT(_source, "sip.method")
    )),
    Esql.to_user = COALESCE(
        JSON_EXTRACT(_source, "network_traffic.sip.to.uri.username"),
        JSON_EXTRACT(_source, "sip.to.uri.username")
    ),
    Esql.user_agent = COALESCE(
        JSON_EXTRACT(_source, "network_traffic.sip.user_agent.original"),
        JSON_EXTRACT(_source, "sip.user_agent.original")
    ),
    Esql.client_ip = COALESCE(client.ip, source.ip),
    Esql.server_ip = COALESCE(server.ip, destination.ip)
| where
    Esql.method == "OPTIONS" and
    Esql.to_user is not null and
    Esql.client_ip is not null and
    Esql.server_ip is not null
| eval Esql.time_window = DATE_TRUNC(2 minutes, @timestamp)
| stats
    Esql.distinct_extensions = COUNT_DISTINCT(Esql.to_user),
    Esql.request_count = COUNT(*),
    Esql.sample_extensions = MV_SLICE(VALUES(Esql.to_user), 0, 20),
    Esql.user_agents = MV_SLICE(VALUES(Esql.user_agent), 0, 10)
  by Esql.time_window, Esql.client_ip, Esql.server_ip
| where Esql.distinct_extensions >= 20
| keep Esql.*
'''


[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1046"
name = "Network Service Discovery"
reference = "https://attack.mitre.org/techniques/T1046/"


[rule.threat.tactic]
id = "TA0007"
name = "Discovery"
reference = "https://attack.mitre.org/tactics/TA0007/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1595"
name = "Active Scanning"
reference = "https://attack.mitre.org/techniques/T1595/"


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

[rule.alert_suppression]
group_by = ["Esql.client_ip", "Esql.server_ip"]
missing_fields_strategy = "suppress"

[rule.alert_suppression.duration]
unit = "h"
value = 1

Stages and Predicates

Stage 1: from

from logs-network_traffic.sip-*, packetbeat-* metadata _source

Stage 2: eval

| eval
    Esql.method = TO_UPPER(COALESCE(
        JSON_EXTRACT(_source, "network_traffic.sip.method"),
        JSON_EXTRACT(_source, "sip.method")
    )),
    Esql.to_user = COALESCE(
        JSON_EXTRACT(_source, "network_traffic.sip.to.uri.username"),
        JSON_EXTRACT(_source, "sip.to.uri.username")
    ),
    Esql.user_agent = COALESCE(
        JSON_EXTRACT(_source, "network_traffic.sip.user_agent.original"),
        JSON_EXTRACT(_source, "sip.user_agent.original")
    ),
    Esql.client_ip = COALESCE(client.ip, source.ip),
    Esql.server_ip = COALESCE(server.ip, destination.ip)

Stage 3: where

| where
    Esql.method == "OPTIONS" and
    Esql.to_user is not null and
    Esql.client_ip is not null and
    Esql.server_ip is not null

Stage 4: eval

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

Stage 5: stats

| stats
    Esql.distinct_extensions = COUNT_DISTINCT(Esql.to_user),
    Esql.request_count = COUNT(*),
    Esql.sample_extensions = MV_SLICE(VALUES(Esql.to_user), 0, 20),
    Esql.user_agents = MV_SLICE(VALUES(Esql.user_agent), 0, 10)
  by Esql.time_window, Esql.client_ip, Esql.server_ip

Stage 6: where

| where Esql.distinct_extensions >= 20

Stage 7: keep

| keep Esql.*

Indicators

These rows show field, operator, and value matches.

Output Fields

These fields are emitted when the rule matches.

FieldSource
Esql.*KEEP Esql.*

Python Library Load and Delete

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

Detects Python loading a library from a user's home directory followed by immediate deletion. This technique is used by malware to execute code while removing forensic evidence.

MITRE ATT&CK Coverage

Telemetry Coverage

Rule Body

[rule]
description = """
Detects Python loading a library from a user's home directory followed by immediate deletion. This technique is used by
malware to execute code while removing forensic evidence.
"""
id = "76a1f901-4495-4cbd-a35a-7ff8d116602b"
license = "Elastic License v2"
name = "Python Library Load and Delete"
os_list = ["macos"]
reference = [
    "https://unit42.paloaltonetworks.com/slow-pisces-new-custom-malware/",
    "https://slowmist.medium.com/cryptocurrency-apt-intelligence-unveiling-lazarus-groups-intrusion-techniques-a1a6efda7d34",
]
version = "1.0.7"

query = '''
sequence by process.entity_id with maxspan=10s
[library where event.action == "load" and dll.path like~ "/Users/*" and process.name like~ "python*" and
  not dll.name : "*.so"] as event0
[file where event.action == "deletion" and startswith~(file.path, event0.dll.path)]
'''

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

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

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "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 = "T1070"
name = "Indicator Removal"
reference = "https://attack.mitre.org/techniques/T1070/"
[[threat.technique.subtechnique]]
id = "T1070.004"
name = "File Deletion"
reference = "https://attack.mitre.org/techniques/T1070/004/"



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

[internal]
min_endpoint_version = "8.16.0"

Stages and Predicates

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

Stage 1: library

[library where event.action == "load" and dll.path like~ "/Users/*" and process.name like~ "python*" and
  not dll.name : "*.so"] as event0

Stage 2: file

[file where event.action == "deletion" and startswith~(file.path, event0.dll.path)]

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
dll.pathwildcard
  • /Users/* corpus 2 (elastic 2)
field:"ImageLoaded" kind:wildcard value:"/Users/*"
event.actioneq
  • deletion corpus 13 (elastic 13)
  • load corpus 23 (elastic 23)
field:"EventType" kind:eq
file.pathstarts_with
  • event0.dll.path (field reference)
field:"TargetFilename" kind:starts_with value:"event0.dll.path"
process.namewildcard
  • python* corpus 55 (elastic 55)
field:"process_basename" kind:wildcard value:"python*"

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
dll.nameends_with.soexcludes:dll.name field:"dll.name" value:".so"

Remote Computer Account DnsHostName Update

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

Identifies the remote update to a computer account's DnsHostName attribute. If the new value set is a valid domain controller DNS hostname and the subject computer name is not a domain controller, then it's highly likely a preparation step to exploit CVE-2022-26923 in an attempt to elevate privileges from a standard domain user to domain admin privileges.

MITRE ATT&CK Coverage

Telemetry Coverage

Rule Body

[metadata]
creation_date = "2022/05/11"
integration = ["system", "windows"]
maturity = "production"
updated_date = "2026/05/03"

[rule]
author = ["Elastic"]
description = """
Identifies the remote update to a computer account's DnsHostName attribute. If the new value set is a valid domain
controller DNS hostname and the subject computer name is not a domain controller, then it's highly likely a preparation
step to exploit CVE-2022-26923 in an attempt to elevate privileges from a standard domain user to domain admin
privileges.
"""
from = "now-9m"
index = ["logs-system.security*", "logs-windows.forwarded*", "winlogbeat-*"]
language = "eql"
license = "Elastic License v2"
name = "Remote Computer Account DnsHostName Update"
references = [
    "https://research.ifcr.dk/certifried-active-directory-domain-privilege-escalation-cve-2022-26923-9e098fe298f4",
    "https://portal.msrc.microsoft.com/en-US/security-guidance/advisory/CVE-2022-26923",
]
risk_score = 73
rule_id = "6bed021a-0afb-461c-acbe-ffdb9574d3f3"
severity = "high"
tags = [
    "Domain: Endpoint",
    "OS: Windows",
    "Use Case: Threat Detection",
    "Tactic: Privilege Escalation",
    "Use Case: Active Directory Monitoring",
    "Data Source: Active Directory",
    "Use Case: Vulnerability",
    "Data Source: Windows Security Event Logs",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"

query = '''
iam where host.os.type == "windows" and event.action == "changed-computer-account" and
    user.id : ("S-1-5-21-*", "S-1-12-1-*") and

    /* if DnsHostName value equal a DC DNS hostname then it's highly suspicious */
    winlog.event_data.DnsHostName : "??*" and

    /* exclude FPs where DnsHostName starts with the ComputerName that was changed */
    not startswith~(winlog.event_data.DnsHostName, substring(winlog.event_data.TargetUserName, 0, length(winlog.event_data.TargetUserName) - 1))
'''

note = """## Triage and analysis

### Investigating Remote Computer Account DnsHostName Update

#### Possible investigation steps

- What object, initiator, and DNS-name mismatch does the alert prove?
  - Focus: `winlog.event_data.TargetUserName`, `winlog.event_data.TargetSid`, `winlog.event_data.DnsHostName`, `winlog.event_data.SubjectUserSid`, and `winlog.event_data.SubjectLogonId`.
  - Implication: escalate or continue when the new DNS host name no longer matches the target computer account and points to another server namespace; lower suspicion only when target SID, subject SID, and logon session fit a recognized rename, promotion, re-binding, or authorized test.

- Does the new DNS host name collide with a domain controller or other sensitive host?
  - Why: Certifried abuse makes a controlled computer account look like a trusted host before requesting or using a machine certificate.
  - Focus: `winlog.event_data.DnsHostName`, `winlog.event_data.TargetUserName`, `winlog.event_data.TargetDomainName`, and `winlog.computer_name`.
  - Implication: high risk when the value matches a real domain controller, CA, or privileged server different from `winlog.event_data.TargetUserName`; lower risk only when it belongs to the same object transition and does not collide with a privileged asset.

- Who made the update, and does the source/session context fit that account's role?
  - Focus: `winlog.event_data.SubjectUserSid`, `winlog.event_data.SubjectUserName`, `winlog.event_data.SubjectDomainName`, `winlog.event_data.SubjectLogonId`, and `source.ip`.
  - Implication: escalate when the subject is a standard user, non-tier-0 admin, unusual service account, machine account, or unexpected source for computer-account management; lower suspicion when subject, source when present, and logon session match a recognized AD management path.

- Did the same object show SPN deletion, empty-SPN creation, or other preparation?
  - Why: successful DNS-name spoofing often requires removing FQDN service principal names or creating a computer account without them so SPN uniqueness checks do not block the DNS update.
  - Focus: Windows Security account-management and directory-change events for `winlog.event_data.TargetSid`, especially `event.code`, `winlog.event_data.AttributeLDAPDisplayName`, `winlog.event_data.AttributeValue`, and `winlog.event_data.ObjectDN`.
  - Implication: escalate when the sequence removes servicePrincipalName values, creates or controls the computer object, or changes related attributes just before the DNS update; lower suspicion when the same change set follows a recognized promotion or re-binding path.

- Did certificate-service or Kerberos activity use the spoofed identity after the update?
  - Focus: post-alert Windows Security certificate enrollment and authentication events for `winlog.event_data.TargetUserName` or the spoofed host name, reading `event.code`, `winlog.event_data.AuthenticationPackageName`, `winlog.logon.type`, and `source.ip`.
  - Hint: missing certificate-service or Kerberos telemetry leaves post-update use unresolved, not benign.
  - Implication: escalate when the modified object requests or receives a machine certificate, uses Kerberos with the spoofed identity, authenticates from unexpected `source.ip` when present, or appears in privileged follow-on activity; absence of follow-on use lowers urgency only when object, initiator, and preparation evidence also align benignly.

- If local evidence stays suspicious or unresolved, do related alerts show the same modifying user elsewhere?
  - Focus: related alerts for modifying `user.id`, especially AD manipulation, certificate abuse, credential-access, or privilege-escalation alerts. $investigate_0
  - Implication: broaden scope when the same user appears in more directory changes, certificate abuse, unusual authentication, or privilege escalation; keep response local only when related alerts are absent and local evidence supports one recognized workflow.

- What disposition do the DNS-name mismatch, hostname collision, initiator, preparation, follow-on use, and scope support?
  - Escalate on sensitive-host collision, suspicious initiator, SPN/object preparation, certificate/Kerberos use, or related AD abuse; close only when all evidence binds one recognized test or object-transition workflow with no contradictions; preserve evidence and escalate when answers conflict or visibility is incomplete.

### False positive analysis

- Benign matches are uncommon because changing a computer account DNS host name to another host namespace is an AD identity anti-pattern. Authorized CVE-2022-26923 testing or patch validation explains the alert only when subject SID/logon, target SID/name, spoofed host name, event-origin controller, SPN/object-change sequence, and follow-on certificate or authentication events all match the same test scope. Without a test plan, close only when telemetry proves a bounded lab pattern; drift in initiator, hostname, or follow-on use keeps the alert suspicious.
- Rare promotion, rename, migration, or re-binding explains the alert only when the same computer object intentionally assumes the new DNS identity, no privileged-host collision exists, and subject, target SID, new host name, controller, and bounded follow-on authentication path all align. Do not close if telemetry leaves object identity, collision, or follow-on use unresolved.
- Build exceptions from the minimum confirmed workflow: stable `winlog.event_data.SubjectUserSid`, `winlog.event_data.TargetSid`, `winlog.event_data.TargetUserName`, `winlog.event_data.DnsHostName`, `winlog.computer_name`, and bounded follow-on `source.ip` or `event.code`. Avoid exceptions on `event.action`, `winlog.event_data.DnsHostName`, or `winlog.event_data.TargetSid` alone.

### Response and remediation

- If confirmed benign, document the exact workflow evidence first: subject SID/logon, target SID/name, DNS host name, event-origin controller, SPN/object-change context, and bounded follow-on authentication or certificate pattern. Then reverse temporary containment. Create an exception only after the same pattern is stable enough to avoid suppressing lookalike spoofing.
- If suspicious but unconfirmed, export the alert and surrounding Windows Security records first, preserving the target object, spoofed host name, subject identity/logon, event-origin controller, SPN/object changes, certificate/authentication events, source IPs, and related alerts. Then use reversible containment, such as restoring the prior DNS host name or temporarily disabling the modified computer account with AD owner coordination. Escalate to account or host containment only when certificate issuance, Kerberos use, or related privilege abuse shows active use.
- If confirmed malicious, preserve the same AD object-change and follow-on authentication/certificate evidence before restoration. Disable or restore the modified computer object, reset the machine-account secret or trust path, revoke or map affected certificates when issued, and contain the modifying account and suspected source host. Use broader domain recovery only when certificate or Kerberos abuse extends beyond the single object.
- Before final object restoration, search the same subject SID and target SID across Windows Security logs for additional DNS host name, SPN, certificate, or privilege-abuse events so scope is complete before evidence changes.
- Post-incident hardening: apply CVE-2022-26923 domain controller and AD CS fixes, reduce ms-DS-MachineAccountQuota where feasible, restrict computer-account creation and validated writes, retain computer-account and 5136 directory-service auditing, and record the confirmed subject/target/hostname/follow-on-authentication pattern for future triage.
"""

setup = """## Setup

Audit Computer Account Management must be enabled to generate the events used by this rule.
Setup instructions: https://ela.st/audit-computer-account-management
"""

[rule.investigation_fields]
field_names = [
    "@timestamp",
    "event.code",
    "event.action",
    "user.name",
    "user.id",
    "user.domain",
    "winlog.event_data.SubjectUserName",
    "winlog.event_data.SubjectUserSid",
    "winlog.event_data.SubjectDomainName",
    "winlog.event_data.SubjectLogonId",
    "winlog.logon.id",
    "winlog.event_data.TargetUserName",
    "winlog.event_data.TargetSid",
    "winlog.event_data.TargetDomainName",
    "winlog.event_data.DnsHostName",
    "host.name",
    "host.id",
    "winlog.computer_name",
]

[transform]

[[transform.investigate]]
label = "Alerts associated with the modifying user in the surrounding window"
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-2h/h"
relativeTo = "now"

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

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

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

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

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

Stages and Predicates

Stage 1: iam

iam where host.os.type == "windows" and event.action == "changed-computer-account" and
    user.id : ("S-1-5-21-*", "S-1-12-1-*") and
    winlog.event_data.DnsHostName : "??*" and
    not startswith~(winlog.event_data.DnsHostName, substring(winlog.event_data.TargetUserName, 0, length(winlog.event_data.TargetUserName) - 1))

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • changed-computer-account
field:"EventType" kind:eq value:"changed-computer-account"
user.idwildcard
  • S-1-12-1-* corpus 6 (elastic 6)
  • S-1-5-21-* corpus 6 (elastic 6)
field:"user.id" kind:wildcard
winlog.event_data.DnsHostNamewildcard
  • ??*
field:"DnsHostName" kind:wildcard value:"??*"

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
winlog.event_data.DnsHostNamestarts_withsubstring(winlog.event_data.TargetUserName, 0, (length(winlog.event_data.TargetUserName) - 1))excludes:winlog.event_data.DnsHostName field:"winlog.event_data.DnsHostName" value:"substring(winlog.event_data.TargetUserName, 0, (length(winlog.event_data.TargetUserName) - 1))"

Scriptlet Execution via Rundll32

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

Identifies when scrobj.dll is loaded into rundll32.exe. An adversary may abuse rundll32.exe to proxy execution of malicious code.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
Identifies when scrobj.dll is loaded into rundll32.exe. An adversary may abuse rundll32.exe to proxy execution of
malicious code.
"""
id = "93438ae3-becd-43fa-81de-645ce17afa8e"
license = "Elastic License v2"
name = "Scriptlet Execution via Rundll32"
os_list = ["windows"]
reference = [
    "https://lolbas-project.github.io/lolbas/Libraries/Ieadvpack/",
    "https://lolbas-project.github.io/lolbas/Libraries/Advpack/",
]
version = "1.0.30"

query = '''
sequence by process.entity_id with maxspan=1m
 [process where event.action == "start" and process.pe.original_file_name == "RUNDLL32.EXE" and
  process.command_line : "*advpack*LaunchINFSection*"]
 [library where dll.name : "scrobj.dll"]
'''

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

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

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



[threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
[[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.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 1m, correlated by process.entity_id.

Stage 1: process

[process where event.action == "start" and process.pe.original_file_name == "RUNDLL32.EXE" and
  process.command_line : "*advpack*LaunchINFSection*"]

Stage 2: library

[library where dll.name : "scrobj.dll"]

Indicators

These rows show field, operator, and value matches.

Shellcode Fluctuation via CallBack

#
Source
github.com/elastic/protections-artifacts

Identifies private (JIT) code memory with fluctuating page protections. This may indicate an attempt to hide injected code from memory scanners.

MITRE ATT&CK Coverage

TacticTechniques
Stealth

Rule Body

[rule]
description = """
Identifies private (JIT) code memory with fluctuating page protections. This may indicate an attempt to hide injected
code from memory scanners.
"""
id = "2909b5bc-c975-4dbe-ac79-4029a2c5763f"
license = "Elastic License v2"
name = "Shellcode Fluctuation via CallBack"
os_list = ["windows"]
version = "1.0.4"

query = '''
api where process.Ext.api.behaviors in ("execute_fluctuation", "write_fluctuation") and 
 process.Ext.api.behaviors == "proxy_call" and
 process.thread.Ext.call_stack_summary in
            ("ntdll.dll|kernelbase.dll|ntdll.dll|kernel32.dll|ntdll.dll", "ntdll.dll|kernelbase.dll|ntdll.dll|Unknown") and
 (process.thread.Ext.call_stack_final_user_module.path == "c:\\windows\\system32\\ntdll.dll" or
  process.thread.Ext.call_stack_final_user_module.name == "Undetermined")
'''

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

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

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


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

[internal]
min_endpoint_version = "8.10.0"

Stages and Predicates

Stage 1: api

api where process.Ext.api.behaviors in ("execute_fluctuation", "write_fluctuation") and 
 process.Ext.api.behaviors == "proxy_call" and
 process.thread.Ext.call_stack_summary in
            ("ntdll.dll|kernelbase.dll|ntdll.dll|kernel32.dll|ntdll.dll", "ntdll.dll|kernelbase.dll|ntdll.dll|Unknown") and
 (process.thread.Ext.call_stack_final_user_module.path == "c:\\windows\\system32\\ntdll.dll" or
  process.thread.Ext.call_stack_final_user_module.name == "Undetermined")

Indicators

These rows show field, operator, and value matches.

Slack Workspace Files Accessed by Unsigned or Untrusted Process

#
Source
github.com/elastic/protections-artifacts

Identifies an untrusted or unsigned process accessing sensitive Slack files. Adversaries can steal certain Slack files that will allow them to log in to the Slack workspace as that user without a password in order to collect additional sensitive data or spy on the organization.

MITRE ATT&CK Coverage

TacticTechniques
Credential Access

Telemetry Coverage

Rule Body

[rule]
description = """
Identifies an untrusted or unsigned process accessing sensitive Slack files. Adversaries can steal certain Slack files
that will allow them to log in to the Slack workspace as that user without a password in order to collect additional
sensitive data or spy on the organization.
"""
id = "2f1ca71e-536b-4721-9aa8-06bc019541de"
license = "Elastic License v2"
name = "Slack Workspace Files Accessed by Unsigned or Untrusted Process"
os_list = ["macos"]
version = "1.0.5"

query = '''
file where event.action == "open" and 
 file.path like~ ("/Users/*/Library/Application Support/Slack/storage/slack-workspaces.db", 
                  "/Users/*/Library/Application Support/Slack/Cookies.sqlite", 
                  "/Users/*/Library/Containers/com.tinyspeck.slackmacgap/Data/Library/Application Support/Slack/slack-workspaces.db", 
                  "/Users/*/Library/Containers/com.tinyspeck.slackmacgap/Data/Library/Application Support/Slack/Cookies.sqlite") and 
 (process.code_signature.trusted == false or process.code_signature.exists == false)
'''

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

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

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



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

[internal]
min_endpoint_version = "8.11.1"

Stages and Predicates

Stage 1: file

file where event.action == "open" and 
 file.path like~ ("/Users/*/Library/Application Support/Slack/storage/slack-workspaces.db", 
                  "/Users/*/Library/Application Support/Slack/Cookies.sqlite", 
                  "/Users/*/Library/Containers/com.tinyspeck.slackmacgap/Data/Library/Application Support/Slack/slack-workspaces.db", 
                  "/Users/*/Library/Containers/com.tinyspeck.slackmacgap/Data/Library/Application Support/Slack/Cookies.sqlite") and 
 (process.code_signature.trusted == false or process.code_signature.exists == false)

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • open corpus 49 (elastic 49)
field:"EventType" kind:eq value:"open"
file.pathwildcard
  • /Users/*/Library/Application Support/Slack/Cookies.sqlite corpus 2 (elastic 2)
  • /Users/*/Library/Application Support/Slack/storage/slack-workspaces.db corpus 2 (elastic 2)
  • /Users/*/Library/Containers/com.tinyspeck.slackmacgap/Data/Library/Application Support/Slack/Cookies.sqlite corpus 2 (elastic 2)
  • /Users/*/Library/Containers/com.tinyspeck.slackmacgap/Data/Library/Application Support/Slack/slack-workspaces.db corpus 2 (elastic 2)
field:"TargetFilename" 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.trustedeq
  • false transforms: boolean corpus 114 (elastic 114)
field:"process.code_signature.trusted" kind:eq value:"false"

Successful SSH Authentication from Unusual IP Address

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

This rule leverages the new_terms rule type to detect successful SSH authentications by an IP- address that has not been authenticated in the last 5 days. This behavior may indicate an attacker attempting to gain access to the system using a valid account.

MITRE ATT&CK Coverage

TacticTechniques
Initial Access
Lateral Movement

Rule Body

[metadata]
creation_date = "2025/02/21"
integration = ["system"]
maturity = "production"
updated_date = "2026/03/24"

[rule]
author = ["Elastic"]
description = """
This rule leverages the new_terms rule type to detect successful SSH authentications by an IP-
address that has not been authenticated in the last 5 days. This behavior may indicate an
attacker attempting to gain access to the system using a valid account.
"""
from = "now-9m"
index = ["logs-system.auth-*", "filebeat-*"]
language = "kuery"
license = "Elastic License v2"
name = "Successful SSH Authentication from Unusual IP Address"
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 Successful SSH Authentication from Unusual IP Address

Secure Shell (SSH) is a protocol used to securely access and manage Linux systems. Adversaries may exploit SSH by using stolen credentials to gain unauthorized access. The detection rule identifies successful logins from IPs not seen in the past 10 days, flagging potential intrusions. This approach helps in spotting unusual access patterns that could indicate compromised accounts.

### Possible investigation steps

- Review the IP address flagged in the alert to determine its geolocation and assess if it aligns with expected access patterns for the user account involved.
- Check historical authentication logs for the user account to identify any other unusual or unauthorized access attempts, focusing on the event.category:authentication and event.action:ssh_login fields.
- Investigate the user account's recent activity on the system to identify any suspicious commands or actions executed post-authentication.
- Correlate the flagged IP address with known threat intelligence sources to determine if it is associated with any malicious activity or previously reported incidents.
- Contact the user associated with the account to verify if they recognize the login attempt and if they have recently accessed the system from a new location or device.

### False positive analysis

- New employee or contractor access from a previously unseen IP address may trigger the rule. Regularly update the list of known IP addresses for new users to prevent unnecessary alerts.
- Remote workers or employees traveling may log in from different IP addresses. Implement a process to whitelist IP ranges associated with common travel destinations or VPNs used by the organization.
- Automated scripts or services that occasionally run from different IPs can cause false positives. Identify and document these services, then create exceptions for their known IP addresses.
- Cloud-based infrastructure changes, such as new instances or containers, might authenticate from new IPs. Maintain an updated inventory of cloud resources and their expected IP ranges to adjust the rule accordingly.
- Third-party vendors accessing systems for maintenance or support might use different IPs. Establish a protocol for temporary exceptions for vendor IPs during their access periods.

### Response and remediation

- Immediately isolate the affected system from the network to prevent further unauthorized access or lateral movement by the attacker.
- Verify the legitimacy of the login by contacting the account owner to confirm whether the access was authorized. If unauthorized, proceed with further steps.
- Change the password of the compromised account and any other accounts that may have been accessed using the same credentials.
- Review and analyze the system logs for any additional suspicious activity or changes made during the unauthorized access period.
- Escalate the incident to the security operations team for a thorough investigation and to determine if further systems are affected.
- Implement IP whitelisting or geofencing to restrict SSH access to known and trusted IP addresses only.
- Update and enhance monitoring rules to detect similar unauthorized access attempts in the future, ensuring that alerts are promptly reviewed and acted upon.
"""
risk_score = 21
rule_id = "5c495612-9992-49a7-afe3-0f647671fb60"
setup = """## Setup

This rule requires data coming in from one of the following integrations:
- Filebeat

### Filebeat Setup
Filebeat is a lightweight shipper for forwarding and centralizing log data. Installed as an agent on your servers, Filebeat monitors the log files or locations that you specify, collects log events, and forwards them either to Elasticsearch or Logstash for indexing.

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

#### Rule Specific Setup Note
- This rule requires the Filebeat System Module to be enabled.
- The system module collects and parses logs created by the system logging service of common Unix/Linux based distributions.
- To run the system module of Filebeat on Linux follow the setup instructions in the [helper guide](https://www.elastic.co/guide/en/beats/filebeat/current/filebeat-module-system.html).
"""
severity = "low"
tags = [
    "Domain: Endpoint",
    "OS: Linux",
    "Use Case: Threat Detection",
    "Tactic: Initial Access",
    "Data Source: Elastic Defend",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "new_terms"
query = '''
event.category:authentication and host.os.type:linux and event.action:ssh_login and event.outcome:success
'''

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

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

[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 = "T1021"
name = "Remote Services"
reference = "https://attack.mitre.org/techniques/T1021/"

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

[rule.threat.tactic]
id = "TA0008"
name = "Lateral Movement"
reference = "https://attack.mitre.org/tactics/TA0008/"
[rule.new_terms]
field = "new_terms_fields"
value = ["related.ip"]

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

Stages and Predicates

Stage 1: new_terms

event.category:authentication and host.os.type:linux and event.action:ssh_login and event.outcome:success

Indicators

These rows show field, operator, and value matches.

System V Init Script Created

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

Files that are placed in the "/etc/init.d/" directory in Unix can be used to start custom applications, services, scripts or commands during start-up. Init.d has been mostly replaced in favor of Systemd. However, the "systemd-sysv-generator" can convert init.d files to service unit files that run at boot. Adversaries may add or alter files located in the "/etc/init.d/" directory to execute malicious code upon boot in order to gain persistence on the system.

MITRE ATT&CK Coverage

Rule Body

[metadata]
creation_date = "2023/03/21"
integration = ["endpoint", "sentinel_one_cloud_funnel"]
maturity = "production"
updated_date = "2026/09/10"

[transform]
[[transform.osquery]]
label = "Osquery - Retrieve File Information"
query = "SELECT * FROM file WHERE path = {{file.path}}"

[[transform.osquery]]
label = "Osquery - Retrieve File Listing Information"
query = "SELECT * FROM file WHERE path LIKE '/etc/init.d/%'"

[[transform.osquery]]
label = "Osquery - Retrieve Additional File Listing Information"
query = """
SELECT f.path, u.username AS file_owner, g.groupname AS group_owner, datetime(f.atime, 'unixepoch') AS
file_last_access_time, datetime(f.mtime, 'unixepoch') AS file_last_modified_time, datetime(f.ctime, 'unixepoch') AS
file_last_status_change_time, datetime(f.btime, 'unixepoch') AS file_created_time, f.size AS size_bytes FROM file f LEFT
JOIN users u ON f.uid = u.uid LEFT JOIN groups g ON f.gid = g.gid WHERE path LIKE '/etc/init.d/%' OR path LIKE '/etc/init/%' OR path IN ('/etc/init', '/etc/inittab', '/etc/inittab2')

"""

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

[[transform.osquery]]
label = "Osquery - Retrieve Crontab Information"
query = "SELECT * FROM crontab"

[rule]
author = ["Elastic"]
description = """
Files that are placed in the "/etc/init.d/" directory in Unix can be used to start custom applications, services, scripts
or commands during start-up. Init.d has been mostly replaced in favor of Systemd. However, the "systemd-sysv-generator"
can convert init.d files to service unit files that run at boot. Adversaries may add or alter files located in the
"/etc/init.d/" directory to execute malicious code upon boot in order to gain persistence on the system.
"""
from = "now-9m"
index = ["endgame-*", "logs-endpoint.events.file*", "logs-sentinel_one_cloud_funnel.*"]
language = "eql"
license = "Elastic License v2"
name = "System V Init Script Created"
note = """## Triage and analysis

### Investigating System V Init Script Created

The `/etc/init.d` directory is used in Linux systems to store the initialization scripts for various services and daemons that are executed during system startup and shutdown.

Attackers can abuse files within the `/etc/init.d/` directory to run scripts, commands or malicious software every time a system is rebooted by converting an executable file into a service file through the `systemd-sysv-generator`. After conversion, a unit file is created within the `/run/systemd/generator.late/` directory.

This rule looks for the creation of new files within the `/etc/init.d/` directory. Executable files in these directories will automatically run at boot with root privileges.

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

- Investigate the file that was created or modified.
  - $osquery_0
- Investigate whether any other files in the `/etc/init.d/` or `/run/systemd/generator.late/` directories have been altered.
  - $osquery_1
  - $osquery_2
- Investigate the script execution chain (parent process tree) for unknown processes. Examine their executable files for prevalence and whether they are located in expected locations.
  - $osquery_3
- Investigate syslog through the `sudo cat /var/log/syslog | grep 'LSB'` command to find traces of the LSB header of the script (if present). If syslog is being ingested into Elasticsearch, the same can be accomplished through Kibana.
- Investigate other alerts associated with the user/host during the past 48 hours.
- Validate whether this activity is related to planned patches, updates, network administrator activity, or legitimate software installations.
- Investigate whether the altered scripts call other malicious scripts elsewhere on the file system. 
  - If scripts or executables were dropped, retrieve the files and determine if they are malicious:
    - Use a private sandboxed malware analysis system to perform analysis.
      - Observe and collect information about the following activities:
        - Attempts to contact external domains and addresses.
          - Check if the domain is newly registered or unexpected.
          - Check the reputation of the domain or IP address.
        - File access, modification, and creation activities.
        - Cron jobs, services and other persistence mechanisms.
            - $osquery_4

### False Positive Analysis

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

### Related Rules

- Suspicious File Creation in /etc for Persistence - 1c84dd64-7e6c-4bad-ac73-a5014ee37042

### 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.
- 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.
- Delete the maliciously created service/init.d files or restore it to the original configuration.
- Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
- Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
- Leverage the incident response data and logging to improve the mean time to detect (MTTD) and the mean time to respond (MTTR).
"""
references = [
    "https://www.intezer.com/blog/malware-analysis/hiddenwasp-malware-targeting-linux-systems/",
    "https://pberba.github.io/security/2022/02/06/linux-threat-hunting-for-persistence-initialization-scripts-and-shell-configuration/#8-boot-or-logon-initialization-scripts-rc-scripts",
    "https://www.cyberciti.biz/faq/how-to-enable-rc-local-shell-script-on-systemd-while-booting-linux-system/",
    "https://www.elastic.co/security-labs/sequel-on-persistence-mechanisms",
]
risk_score = 21
rule_id = "474fd20e-14cc-49c5-8160-d9ab4ba16c8b"
setup = """## Setup

This rule requires data coming in from Elastic Defend.

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

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

#### The following steps should be executed in order to add the Elastic Defend integration on a Linux System:
- Go to the Kibana home page and click "Add integrations".
- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.
- Click "Add Elastic Defend".
- Configure the integration name and optionally add a description.
- Select the type of environment you want to protect, either "Traditional Endpoints" or "Cloud Workloads".
- Select a configuration preset. Each preset comes with different default settings for Elastic Agent, you can further customize these later by configuring the Elastic Defend integration policy. [Helper guide](https://www.elastic.co/guide/en/security/current/configure-endpoint-integration-policy.html).
- We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"
- Enter a name for the agent policy in "New agent policy name". If other agent policies already exist, you can click the "Existing hosts" tab and select an existing policy instead.
For more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/8.10/agent-policy.html).
- Click "Save and Continue".
- To complete the integration, select "Add Elastic Agent to your hosts" and continue to the next section to install the Elastic Agent on your hosts.
For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
"""
severity = "low"
tags = [
    "Domain: Endpoint",
    "OS: Linux",
    "Use Case: Threat Detection",
    "Tactic: Persistence",
    "Data Source: Elastic Endgame",
    "Resources: Investigation Guide",
    "Data Source: Elastic Defend",
    "Data Source: SentinelOne",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
file where host.os.type == "linux" and event.action in ("creation", "file_create_event", "rename", "file_rename_event")
and file.path like ("/etc/init.d/*", "/etc/init/*", "/etc/init", "/etc/inittab*") and
not (
  process.executable in (
    "/bin/dpkg", "/usr/bin/dpkg", "/bin/dockerd", "/usr/bin/dockerd", "/usr/sbin/dockerd", "/bin/microdnf",
    "/usr/bin/microdnf", "/bin/rpm", "/usr/bin/rpm", "/bin/snapd", "/usr/bin/snapd", "/bin/yum", "/usr/bin/yum",
    "/bin/dnf", "/usr/bin/dnf", "/bin/podman", "/usr/bin/podman", "/bin/dnf-automatic", "/usr/bin/dnf-automatic",
    "/bin/pacman", "/usr/bin/pacman", "/usr/bin/dpkg-divert", "/bin/dpkg-divert", "/sbin/apk", "/usr/sbin/apk",
    "/usr/local/sbin/apk", "/usr/bin/apt", "/usr/sbin/pacman", "/bin/podman", "/usr/bin/podman", "/usr/bin/puppet",
    "/bin/puppet", "/opt/puppetlabs/puppet/bin/puppet", "/usr/bin/chef-client", "/bin/chef-client", "./envbuilder/bin/envbuilder",
    "/bin/autossl_check", "/usr/bin/autossl_check", "/proc/self/exe", "/usr/bin/pamac-daemon", "/opt/puppetlabs/puppet/bin/ruby",
    "/bin/pamac-daemon", "/usr/lib/snapd/snapd", "/usr/local/bin/dockerd", "./usr/bin/podman", "/usr/lib/systemd/systemd",
    "/usr/bin/buildah", "/dev/.buildkit_qemu_emulator", "/usr/lib/nvidia/post-install", "/usr/bin/dnf5", "/usr/sbin/yum-cron"
  ) or
  file.extension in ("swp", "swpx", "swx", "dpkg-remove", "dpkg-new") or
  ?file.Ext.original.name like "*.dpkg-new" or
  file.path like ("/etc/init.d/*beat*", "/etc/init.d/elastic-agent*") or
  process.executable like (
    "/nix/store/*", "/var/lib/dpkg/*", "/snap/*", "/dev/fd/*", "/usr/lib/virtualbox/*", "/var/lib/docker/overlay2/*/dockerd ",
    "/var/lib/containers/storage/overlay/*/dockerd"
  ) or
  process.name in ("docker-init", "jumpcloud-agent", "crio") or
  process.executable == null or
  process.name in ("executor", "univention-config-registry", "install", "dockerd-entrypoint.sh", "platform-python*", "ssm-agent-worker") or
  (process.name == "ln" and file.path : "/etc/init.d/rc*.d/*") or
  (process.name == "sed" and file.name : "sed*") or
  (process.name == "perl" and file.name : "e2scrub_all.tmp*") or
  (process.name == "cp" and file.path == "/etc/init.d/unified-monitoring-agent") or
  (process.name == "./vmware-install.pl" and file.path == "/etc/init.d/vmware-tools")
)
'''

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

[[rule.threat.technique]]
id = "T1037"
name = "Boot or Logon Initialization Scripts"
reference = "https://attack.mitre.org/techniques/T1037/"

[[rule.threat.technique.subtechnique]]
id = "T1037.004"
name = "RC Scripts"
reference = "https://attack.mitre.org/techniques/T1037/004/"

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

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

[[rule.threat.technique]]
id = "T1037"
name = "Boot or Logon Initialization Scripts"
reference = "https://attack.mitre.org/techniques/T1037/"

[[rule.threat.technique.subtechnique]]
id = "T1037.004"
name = "RC Scripts"
reference = "https://attack.mitre.org/techniques/T1037/004/"

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

Stages and Predicates

Stage 1: file

file where host.os.type == "linux" and event.action in ("creation", "file_create_event", "rename", "file_rename_event")
and file.path like ("/etc/init.d/*", "/etc/init/*", "/etc/init", "/etc/inittab*") and
not (
  process.executable in (
    "/bin/dpkg", "/usr/bin/dpkg", "/bin/dockerd", "/usr/bin/dockerd", "/usr/sbin/dockerd", "/bin/microdnf",
    "/usr/bin/microdnf", "/bin/rpm", "/usr/bin/rpm", "/bin/snapd", "/usr/bin/snapd", "/bin/yum", "/usr/bin/yum",
    "/bin/dnf", "/usr/bin/dnf", "/bin/podman", "/usr/bin/podman", "/bin/dnf-automatic", "/usr/bin/dnf-automatic",
    "/bin/pacman", "/usr/bin/pacman", "/usr/bin/dpkg-divert", "/bin/dpkg-divert", "/sbin/apk", "/usr/sbin/apk",
    "/usr/local/sbin/apk", "/usr/bin/apt", "/usr/sbin/pacman", "/bin/podman", "/usr/bin/podman", "/usr/bin/puppet",
    "/bin/puppet", "/opt/puppetlabs/puppet/bin/puppet", "/usr/bin/chef-client", "/bin/chef-client", "./envbuilder/bin/envbuilder",
    "/bin/autossl_check", "/usr/bin/autossl_check", "/proc/self/exe", "/usr/bin/pamac-daemon", "/opt/puppetlabs/puppet/bin/ruby",
    "/bin/pamac-daemon", "/usr/lib/snapd/snapd", "/usr/local/bin/dockerd", "./usr/bin/podman", "/usr/lib/systemd/systemd",
    "/usr/bin/buildah", "/dev/.buildkit_qemu_emulator", "/usr/lib/nvidia/post-install", "/usr/bin/dnf5", "/usr/sbin/yum-cron"
  ) or
  file.extension in ("swp", "swpx", "swx", "dpkg-remove", "dpkg-new") or
  ?file.Ext.original.name like "*.dpkg-new" or
  file.path like ("/etc/init.d/*beat*", "/etc/init.d/elastic-agent*") or
  process.executable like (
    "/nix/store/*", "/var/lib/dpkg/*", "/snap/*", "/dev/fd/*", "/usr/lib/virtualbox/*", "/var/lib/docker/overlay2/*/dockerd ",
    "/var/lib/containers/storage/overlay/*/dockerd"
  ) or
  process.name in ("docker-init", "jumpcloud-agent", "crio") or
  process.executable == null or
  process.name in ("executor", "univention-config-registry", "install", "dockerd-entrypoint.sh", "platform-python*", "ssm-agent-worker") or
  (process.name == "ln" and file.path : "/etc/init.d/rc*.d/*") or
  (process.name == "sed" and file.name : "sed*") or
  (process.name == "perl" and file.name : "e2scrub_all.tmp*") or
  (process.name == "cp" and file.path == "/etc/init.d/unified-monitoring-agent") or
  (process.name == "./vmware-install.pl" and file.path == "/etc/init.d/vmware-tools")
)

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actionin
  • creation
  • file_create_event
  • file_rename_event
  • rename
field:"EventType" kind:in
file.pathwildcard
  • /etc/init
  • /etc/init.d/*
  • /etc/init/*
  • /etc/inittab*
field:"TargetFilename" kind:wildcard

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
file.namestarts_withe2scrub_all.tmpexcludes:file.name field:"file.name" value:"e2scrub_all.tmp"
process.nameeqperlexcludes:process.name field:"process.name" value:"perl"
file.namestarts_withsedexcludes:file.name field:"file.name" value:"sed"
process.nameeqsedexcludes:process.name field:"process.name" value:"sed"
file.patheq/etc/init.d/unified-monitoring-agentexcludes:file.path field:"file.path" value:"/etc/init.d/unified-monitoring-agent"
process.nameeqcpexcludes:process.name field:"process.name" value:"cp"
file.patheq/etc/init.d/vmware-toolsexcludes:file.path field:"file.path" value:"/etc/init.d/vmware-tools"
process.nameeq./vmware-install.plexcludes:process.name field:"process.name" value:"./vmware-install.pl"
file.pathwildcard/etc/init.d/rc*.d/*excludes:file.path field:"file.path" value:"/etc/init.d/rc*.d/*"
process.nameeqlnexcludes:process.name field:"process.name" value:"ln"
file.Ext.original.nameends_with.dpkg-newexcludes:file.Ext.original.name field:"file.Ext.original.name" value:".dpkg-new"
file.extensionindpkg-new, dpkg-remove, swp, swpx, swxexcludes:file.extension
file.pathwildcard/etc/init.d/*beat*, /etc/init.d/elastic-agent*excludes:file.path field:"file.path" value:"/etc/init.d/*beat*" field:"file.path" value:"/etc/init.d/elastic-agent*"
process.executablein./envbuilder/bin/envbuilder, ./usr/bin/podman, /bin/autossl_check, /bin/chef-client, /bin/dnf, /bin/dnf-automatic, /bin/dockerd, /bin/dpkg, /bin/dpkg-divert, /bin/microdnf, /bin/pacman, /bin/pamac-daemon, /bin/podman, /bin/puppet, /bin/rpm, /bin/snapd, /bin/yum, /dev/.buildkit_qemu_emulator, /opt/puppetlabs/puppet/bin/puppet, /opt/puppetlabs/puppet/bin/ruby, /proc/self/exe, /sbin/apk, /usr/bin/apt, /usr/bin/autossl_check, /usr/bin/buildah, /usr/bin/chef-client, /usr/bin/dnf, /usr/bin/dnf-automatic, /usr/bin/dnf5, /usr/bin/dockerd, /usr/bin/dpkg, /usr/bin/dpkg-divert, /usr/bin/microdnf, /usr/bin/pacman, /usr/bin/pamac-daemon, /usr/bin/podman, /usr/bin/puppet, /usr/bin/rpm, /usr/bin/snapd, /usr/bin/yum, /usr/lib/nvidia/post-install, /usr/lib/snapd/snapd, /usr/lib/systemd/systemd, /usr/local/bin/dockerd, /usr/local/sbin/apk, /usr/sbin/apk, /usr/sbin/dockerd, /usr/sbin/pacman, /usr/sbin/yum-cronexcludes:process.executable
process.executableis_null(no value, null check)excludes:process.executable
process.executablewildcard/nix/store/*, /var/lib/dpkg/*, /snap/*, /dev/fd/*, /usr/lib/virtualbox/*, /var/lib/docker/overlay2/*/dockerd , /var/lib/containers/storage/overlay/*/dockerdexcludes:process.executable
process.nameincrio, docker-init, jumpcloud-agentexcludes:process.name field:"process.name" value:"crio" field:"process.name" value:"docker-init" field:"process.name" value:"jumpcloud-agent"
process.nameindockerd-entrypoint.sh, executor, install, platform-python*, ssm-agent-worker, univention-config-registryexcludes:process.name

Unusual Process Execution on WBEM Path

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

Identifies unusual processes running from the WBEM path, uncommon outside WMI-related Windows processes.

MITRE ATT&CK Coverage

Telemetry Coverage

Rule Body

[metadata]
creation_date = "2023/08/23"
integration = ["endpoint", "windows", "system"]
maturity = "production"
updated_date = "2026/03/24"

[rule]
author = ["Elastic"]
building_block_type = "default"
description = "Identifies unusual processes running from the WBEM path, uncommon outside WMI-related Windows processes.\n"
from = "now-119m"
index = [
    "endgame-*",
    "logs-endpoint.events.process-*",
    "logs-system.security*",
    "logs-windows.*",
    "winlogbeat-*",
]
interval = "60m"
language = "eql"
license = "Elastic License v2"
name = "Unusual Process Execution on WBEM Path"
risk_score = 21
rule_id = "1f460f12-a3cf-4105-9ebb-f788cc63f365"
severity = "low"
tags = [
    "Domain: Endpoint",
    "OS: Windows",
    "Use Case: Threat Detection",
    "Tactic: Defense Evasion",
    "Data Source: Elastic Defend",
    "Rule Type: BBR",
    "Data Source: Elastic Endgame",
    "Data Source: Windows Security Event Logs",
]
timestamp_override = "event.ingested"
type = "eql"

query = '''
process where host.os.type == "windows" and event.type == "start" and
  process.executable : ("?:\\Windows\\System32\\wbem\\*", "?:\\Windows\\SysWow64\\wbem\\*") and
  not process.name : (
    "mofcomp.exe",
    "scrcons.exe",
    "unsecapp.exe",
    "wbemtest.exe",
    "winmgmt.exe",
    "wmiadap.exe",
    "wmiapsrv.exe",
    "wmic.exe",
    "wmiprvse.exe"
  )
'''


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

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

[[rule.threat.technique.subtechnique]]
id = "T1036.005"
name = "Match Legitimate Resource Name or Location"
reference = "https://attack.mitre.org/techniques/T1036/005/"

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

Stages and Predicates

Stage 1: process

process where host.os.type == "windows" and event.type == "start" and
  process.executable : ("?:\\Windows\\System32\\wbem\\*", "?:\\Windows\\SysWow64\\wbem\\*") and
  not process.name : (
    "mofcomp.exe",
    "scrcons.exe",
    "unsecapp.exe",
    "wbemtest.exe",
    "winmgmt.exe",
    "wmiadap.exe",
    "wmiapsrv.exe",
    "wmic.exe",
    "wmiprvse.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.executablewildcard
  • ?:\Windows\SysWow64\wbem\*
  • ?:\Windows\System32\wbem\*
field:"Image" kind:wildcard

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.nameeqmofcomp.exe, scrcons.exe, unsecapp.exe, wbemtest.exe, winmgmt.exe, wmiadap.exe, wmiapsrv.exe, wmic.exe, wmiprvse.exeexcludes:process.name

Windows Service Installed via an Unusual Client

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

Identifies the creation of a Windows service by an unusual client process. Services may be created with administrator privileges but are executed under SYSTEM privileges, so an adversary may also use a service to escalate privileges from administrator to SYSTEM.

MITRE ATT&CK Coverage

Telemetry Coverage

Rule Body

[metadata]
creation_date = "2022/02/07"
integration = ["system", "windows"]
maturity = "production"
updated_date = "2026/05/03"

[rule]
author = ["Elastic"]
description = """
Identifies the creation of a Windows service by an unusual client process. Services may be created with administrator
privileges but are executed under SYSTEM privileges, so an adversary may also use a service to escalate privileges from
administrator to SYSTEM.
"""
from = "now-9m"
index = ["logs-system.security*", "logs-windows.forwarded*", "winlogbeat-*"]
language = "eql"
license = "Elastic License v2"
name = "Windows Service Installed via an Unusual Client"
references = [
    "https://www.x86matthew.com/view_post?id=create_svc_rpc",
    "https://learn.microsoft.com/en-us/windows/security/threat-protection/auditing/event-4697",
    "https://github.com/atc-project/atomic-threat-coverage/blob/master/Atomic_Threat_Coverage/Logging_Policies/LP_0100_windows_audit_security_system_extension.md",
    "https://www.elastic.co/security-labs/siestagraph-new-implant-uncovered-in-asean-member-foreign-ministry",
]
risk_score = 73
rule_id = "55c2bf58-2a39-4c58-a384-c8b1978153c2"
severity = "high"
tags = [
    "Domain: Endpoint",
    "OS: Windows",
    "Use Case: Threat Detection",
    "Tactic: Privilege Escalation",
    "Data Source: Windows Security Event Logs",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"

query = '''
configuration where host.os.type == "windows" and
  event.action == "service-installed" and
  (winlog.event_data.ClientProcessId == "0" or winlog.event_data.ParentProcessId == "0") and
  startswith~(user.domain, winlog.computer_name) and winlog.event_data.ServiceAccount == "LocalSystem" and 
  not winlog.event_data.ServiceFileName : (
    "?:\\Windows\\VeeamVssSupport\\VeeamGuestHelper.exe*",
    "?:\\Windows\\VeeamLogShipper\\VeeamLogShipper.exe",
    "%SystemRoot%\\system32\\Drivers\\Crowdstrike\\*-CsInstallerService.exe",
    "\"%windir%\\AdminArsenal\\PDQInventory-Scanner\\service-1\\PDQInventory-Scanner-1.exe\" ",
    "\"%windir%\\AdminArsenal\\PDQDeployRunner\\service-1\\PDQDeployRunner-1.exe\" ",
    "\"%windir%\\AdminArsenal\\PDQInventoryWakeCommand\\service-1\\PDQInventoryWakeCommand-1.exe\" ",
    "\"%SystemRoot%\\nsnetpush.exe\"",
    "\"C:\\WINDOWS\\ccmsetup\\ccmsetup.exe\" /runservice /ignoreskipupgrade /config:MobileClient.tcf",
    "\"?:\\SMS\\bin\\x64\\srvboot.exe\"",
    "%SystemRoot%\\pbpsdeploy.exe"
  )
'''

note = """## Triage and analysis

### Investigating Windows Service Installed via an Unusual Client
#### Possible investigation steps

- Which unusual service-control path did the alert preserve?
  - Why: Custom Service Control Manager RPC clients can create services without normal attribution; PID 0 is the path this alert needs interpreted.
  - Focus: `winlog.event_data.ClientProcessId`, `winlog.event_data.ParentProcessId`, `user.domain`, `winlog.computer_name`, and `winlog.event_data.ServiceAccount`.
  - Implication: escalate when PID 0 attribution combines with a local-account domain and LocalSystem; lower suspicion only when exact host, account, service, and time match a recognized deployment or test explaining zeroed attribution.

- What would the new service execute and how privileged is it?
  - Why: Event 4697 captures the create-time image path only; later service changes can contradict a clean create-time string.
  - Focus: `winlog.event_data.ServiceName`, `winlog.event_data.ServiceFileName`, `winlog.event_data.ServiceType`, `winlog.event_data.ServiceStartType`, and `winlog.event_data.ServiceAccount`.
  - Implication: escalate when the image path is user-writable, temporary, ProgramData, or system-masqueraded; type is driver; start type is boot, system, or disabled; or LocalSystem lacks a matching product. Lower suspicion when all service fields align with one recognized installer, endpoint agent, backup, or deployment tool.

- Which account and logon session requested the service creation?
  - Focus: service-install `winlog.event_data.SubjectUserSid`, `winlog.event_data.SubjectUserName`, and `winlog.event_data.SubjectLogonId`; 4624 `source.ip` and `winlog.logon.type`; 4648 explicit-credential context.
  - Implication: escalate when the subject is an unexpected local admin or machine account, origin is remote or rare for the host, explicit credentials appear, or source is absent where remote administration is expected; lower suspicion when subject, logon type, source, and service target fit one recognized management session. Missing 4624/4648 or source fields leaves origin unresolved, not benign.
  - Hint: on `host.id`, search 4624 where `winlog.event_data.TargetLogonId` equals service-install `winlog.event_data.SubjectLogonId`; search 4648 where `winlog.event_data.SubjectLogonId` matches.
    - $investigate_0
    - $investigate_1

- Do surrounding Windows Security records show a contained install or follow-on control activity?
  - Focus: same-host `event.code`, `winlog.record_id`, `winlog.event_data.ServiceName`, and `winlog.event_data.SubjectLogonId` around `@timestamp`.
  - Implication: escalate when the same logon session creates multiple services, pairs install with explicit credentials, or shows account changes or failures around service creation; lower suspicion when records stay limited to one expected installer session for the same service. Missing Security telemetry is unresolved, not benign.
  - Hint: inspect same-session 4697 records for clustered service creation. $investigate_2

- Is the same service-install pattern recurring in a bounded cohort or spreading?
  - Focus: historical Event ID 4697 records by `winlog.event_data.SubjectUserSid`, `winlog.event_data.ServiceName`, `winlog.event_data.ServiceFileName`, `winlog.event_data.ServiceAccount`, and `winlog.computer_name`.
  - Implication: escalate when the same subject creates PID 0 LocalSystem services across unrelated hosts, or service names or paths rotate; lower suspicion when exact service fields recur in the same managed host cohort with a stable subject and no contradictory service metadata.
  - Hint: query 4697 for the same subject or service fields, group by `winlog.computer_name`, `winlog.event_data.ServiceName`, and `winlog.event_data.ServiceFileName`, then compare PID 0 recurrence. $investigate_3

- Based on the Windows Security evidence, what disposition is supported?
  - Implication: escalate when PID 0, LocalSystem image, actor/session evidence, or 4697 recurrence does not bind to one recognized workflow; close only when the same fields prove one exact service deployment or test on this host and no contradictory Security evidence remains; if mixed, preserve service-install and logon records, then escalate.

### False positive analysis

- Software deployment, endpoint agent, backup, configuration tools, or authorized service-control/RPC testing can trigger when Service Control Manager behavior leaves PID 0 attribution. Examples include Veeam, PDQ, CrowdStrike installer, SCCM/SMS, nsnetpush, or pbpsdeploy-style patterns. Confirm service name, file, account, subject SID, host cohort, logon session, and test timing align with one product or test workflow, with no contradictory Security records.
- Before creating an exception, require stable recurrence for the same `winlog.event_data.SubjectUserSid`, `winlog.event_data.ServiceFileName`, `winlog.event_data.ServiceName`, `winlog.event_data.ServiceAccount`, and host cohort. Avoid broad exceptions on `user.name`, `host.name`, or service name alone.

### Response and remediation

- If confirmed benign:
  - Reverse any temporary containment and record the exact evidence that confirmed the workflow: service fields, subject and logon IDs, affected host, and recurrence or change context.
  - Build any exception only from the stable workflow anchors validated above, not from a broad user, host, or service-name match.
- If suspicious but unconfirmed:
  - Preserve the alert, original Event ID 4697 record, related 4624/4648 records, `winlog.record_id` values, service configuration, and the service binary named by `winlog.event_data.ServiceFileName` before containment.
  - Apply reversible containment tied to the findings, such as isolating the host if lateral movement risk is present, restricting the subject account, or disabling the new service after preserving its configuration. Avoid deleting the service or binary until maliciousness and scope are clear.
- If confirmed malicious:
  - Preserve the original Event ID 4697 record, related 4624/4648 records, service configuration, service binary, and recurrence evidence before containment or eradication.
  - Contain the host and affected account based on the service definition, actor/session evidence, and recurrence pattern; weigh host criticality before isolation.
  - Disable or stop the malicious service after preserving configuration and binary evidence, then remove the service and service binary only after scope is established.
  - Reset or rotate credentials for the subject account when logon evidence shows misuse, and review other hosts where the same subject or service pattern created LocalSystem services.
- Post-incident hardening:
  - Restrict service creation to controlled deployment accounts and administrative hosts.
  - Retain Audit Security System Extension success logging and enough Windows Security history to correlate 4624, 4648, and 4697 records.
  - Record the confirmed benign workflow or malicious service pattern so future alerts can compare exact service, subject, and host evidence."""

setup = """## Setup

Audit Security System Extension must be enabled to generate the events used by this rule.
Setup instructions: https://ela.st/audit-security-system-extension
"""

[rule.investigation_fields]
field_names = [
    "@timestamp",
    "event.code",
    "host.id",
    "winlog.computer_name",
    "user.id",
    "user.domain",
    "winlog.event_data.SubjectUserSid",
    "winlog.event_data.SubjectLogonId",
    "winlog.event_data.ServiceName",
    "winlog.event_data.ServiceFileName",
    "winlog.event_data.ServiceType",
    "winlog.event_data.ServiceStartType",
    "winlog.event_data.ServiceAccount",
    "winlog.event_data.ClientProcessId",
    "winlog.event_data.ParentProcessId",
]

[transform]

[[transform.investigate]]
label = "Linked logon for the service-install session"
description = ""
providers = [
  [
    { excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" },
    { excluded = false, field = "event.code", queryType = "phrase", value = "4624", valueType = "string" },
    { excluded = false, field = "winlog.event_data.TargetLogonId", queryType = "phrase", value = "{{winlog.event_data.SubjectLogonId}}", valueType = "string" }
  ]
]
relativeFrom = "now-24h/h"
relativeTo = "now"

[[transform.investigate]]
label = "Explicit-credential events for the service-install session"
description = ""
providers = [
  [
    { excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" },
    { excluded = false, field = "event.code", queryType = "phrase", value = "4648", valueType = "string" },
    { excluded = false, field = "winlog.event_data.SubjectLogonId", queryType = "phrase", value = "{{winlog.event_data.SubjectLogonId}}", valueType = "string" }
  ]
]
relativeFrom = "now-24h/h"
relativeTo = "now"

[[transform.investigate]]
label = "Same-session service-install events"
description = ""
providers = [
  [
    { excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" },
    { excluded = false, field = "event.code", queryType = "phrase", value = "4697", valueType = "string" },
    { excluded = false, field = "winlog.event_data.SubjectLogonId", queryType = "phrase", value = "{{winlog.event_data.SubjectLogonId}}", valueType = "string" }
  ]
]
relativeFrom = "now-1h"
relativeTo = "now"

[[transform.investigate]]
label = "Historical 4697 service-install recurrence"
description = ""
providers = [
  [
    { excluded = false, field = "event.code", queryType = "phrase", value = "4697", valueType = "string" },
    { excluded = false, field = "winlog.event_data.SubjectUserSid", queryType = "phrase", value = "{{winlog.event_data.SubjectUserSid}}", valueType = "string" }
  ],
  [
    { excluded = false, field = "event.code", queryType = "phrase", value = "4697", valueType = "string" },
    { excluded = false, field = "winlog.event_data.ServiceName", queryType = "phrase", value = "{{winlog.event_data.ServiceName}}", valueType = "string" }
  ],
  [
    { excluded = false, field = "event.code", queryType = "phrase", value = "4697", valueType = "string" },
    { excluded = false, field = "winlog.event_data.ServiceFileName", queryType = "phrase", value = "{{winlog.event_data.ServiceFileName}}", valueType = "string" }
  ]
]
relativeFrom = "now-7d/d"
relativeTo = "now"

[[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 = "TA0004"
name = "Privilege Escalation"
reference = "https://attack.mitre.org/tactics/TA0004/"

Stages and Predicates

Stage 1: configuration

configuration where host.os.type == "windows" and
  event.action == "service-installed" and
  (winlog.event_data.ClientProcessId == "0" or winlog.event_data.ParentProcessId == "0") and
  startswith~(user.domain, winlog.computer_name) and winlog.event_data.ServiceAccount == "LocalSystem" and 
  not winlog.event_data.ServiceFileName : (
    "?:\\Windows\\VeeamVssSupport\\VeeamGuestHelper.exe*",
    "?:\\Windows\\VeeamLogShipper\\VeeamLogShipper.exe",
    "%SystemRoot%\\system32\\Drivers\\Crowdstrike\\*-CsInstallerService.exe",
    "\"%windir%\\AdminArsenal\\PDQInventory-Scanner\\service-1\\PDQInventory-Scanner-1.exe\" ",
    "\"%windir%\\AdminArsenal\\PDQDeployRunner\\service-1\\PDQDeployRunner-1.exe\" ",
    "\"%windir%\\AdminArsenal\\PDQInventoryWakeCommand\\service-1\\PDQInventoryWakeCommand-1.exe\" ",
    "\"%SystemRoot%\\nsnetpush.exe\"",
    "\"C:\\WINDOWS\\ccmsetup\\ccmsetup.exe\" /runservice /ignoreskipupgrade /config:MobileClient.tcf",
    "\"?:\\SMS\\bin\\x64\\srvboot.exe\"",
    "%SystemRoot%\\pbpsdeploy.exe"
  )

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
winlog.event_data.ServiceFileNamewildcard?:\Windows\VeeamVssSupport\VeeamGuestHelper.exe*, ?:\Windows\VeeamLogShipper\VeeamLogShipper.exe, %SystemRoot%\system32\Drivers\Crowdstrike\*-CsInstallerService.exe, "%windir%\AdminArsenal\PDQInventory-Scanner\service-1\PDQInventory-Scanner-1.exe" , "%windir%\AdminArsenal\PDQDeployRunner\service-1\PDQDeployRunner-1.exe" , "%windir%\AdminArsenal\PDQInventoryWakeCommand\service-1\PDQInventoryWakeCommand-1.exe" , "%SystemRoot%\nsnetpush.exe", "C:\WINDOWS\ccmsetup\ccmsetup.exe" /runservice /ignoreskipupgrade /config:MobileClient.tcf, "?:\SMS\bin\x64\srvboot.exe", %SystemRoot%\pbpsdeploy.exeexcludes:winlog.event_data.ServiceFileName

Back to all Elastic rules