Detection rules › Elastic

Elastic rules: 2t

AWS Bedrock Model Prompt or Completion Containing Credentials

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

Identifies an Amazon Bedrock model invocation whose prompt or completion contains an AWS access key identifier (AKIA long-term or ASIA temporary/STS, followed by 16 characters), an Amazon Bedrock API key (ABSK bearer token), or a PEM private-key block. Credentials in the model input mean an application or user is sending secrets to the model, exposing them to invocation logging, the model provider, and prompt history; credentials in the model output mean the model is emitting secrets, which can result from training-data leakage, poisoned context, or a prompt-injection-driven exfiltration attempt. Either case is a credential-exposure event that warrants immediate rotation of the affected secret.

Known False Positives

  • Prompts or completions that reference example or documentation keys (for example the AWS sample access key ending in EXAMPLE) match the access-key pattern. Review the matched value in "gen_ai.prompt" or "gen_ai.completion" and confirm whether it is a live credential before responding.

MITRE ATT&CK Coverage

TacticTechniques
Credential Access

Rule Body

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

[rule]
author = ["Elastic"]
description = """
Identifies an Amazon Bedrock model invocation whose prompt or completion contains an AWS access key identifier
(AKIA long-term or ASIA temporary/STS, followed by 16 characters), an Amazon Bedrock API key (ABSK bearer token),
or a PEM private-key block. Credentials in the model input mean an
application or user is sending secrets to the model, exposing them to invocation logging, the model provider, and
prompt history; credentials in the model output mean the model is emitting secrets, which can result from
training-data leakage, poisoned context, or a prompt-injection-driven exfiltration attempt. Either case is a
credential-exposure event that warrants immediate rotation of the affected secret.
"""
false_positives = [
    """
    Prompts or completions that reference example or documentation keys (for example the AWS sample access key ending
    in EXAMPLE) match the access-key pattern. Review the matched value in "gen_ai.prompt" or "gen_ai.completion" and
    confirm whether it is a live credential before responding.
    """,
]
from = "now-60m"
interval = "10m"
language = "esql"
license = "Elastic License v2"
name = "AWS Bedrock Model Prompt or Completion Containing Credentials"
note = """## Triage and analysis

### Investigating AWS Bedrock Model Prompt or Completion Containing Credentials

Bedrock model invocation logging records the full request and response of each InvokeModel/Converse call. This rule scans the decoded prompt and completion for live-credential patterns: AWS access key IDs (AKIA/ASIA followed by 16 characters) and PEM private-key headers. A credential in the prompt indicates secrets are being sent to the model (and persisted in logs and, for hosted models, to the provider); a credential in the completion indicates the model returned a secret, which is a sign of training-data or context leakage or a successful prompt-injection exfiltration.

### Possible investigation steps

- Review the matched value in "gen_ai.prompt" and "gen_ai.completion" and confirm whether it is a live credential or an example/placeholder.
- Identify the caller in "user.id" and the model in "aws_bedrock.invocation.model_id", and determine which application generated the invocation.
- If the credential is in the completion, review the prompt for injection or data-exfiltration instructions and check the model's knowledge base or context sources.
- Determine the scope and privileges of the exposed credential to gauge impact.

### False positive analysis

- Example or documentation keys (such as the AWS EXAMPLE key) match the pattern. Confirm the value is a real credential before escalating.

### Response and remediation

- If the credential is live, rotate or deactivate it immediately and review CloudTrail for any use of it.
- Identify and fix the application path that placed the credential into the prompt, and add input/output filtering (such as a Bedrock guardrail with a sensitive-information policy) to prevent recurrence.
"""
references = [
    "https://www.beyondtrust.com/blog/entry/aws-bedrock-security-guide-api-keys-detection-response",
]
risk_score = 47
rule_id = "68521f99-9b4f-40ef-a4e7-4d74794852b2"
setup = "This rule requires Amazon Bedrock model invocation logs ingested via the Elastic AWS Bedrock integration, with text data delivery enabled in the Bedrock model-invocation-logging configuration."
severity = "medium"
tags = [
    "Domain: LLM",
    "Data Source: AWS Bedrock",
    "Data Source: Amazon Web Services",
    "Use Case: Threat Detection",
    "Mitre Atlas: LLM06",
    "Resources: Investigation Guide",
    "Tactic: Credential Access"
]
timestamp_override = "event.ingested"
type = "esql"

query = '''
from logs-aws_bedrock.invocation-* metadata _id, _version, _index
| where event.action in ("ConverseStream", "Converse") AND 
   ( gen_ai.prompt rlike """.*(AKIA|ASIA)[A-Z0-9]{16}.*"""
    or gen_ai.completion rlike """.*(AKIA|ASIA)[A-Z0-9]{16}.*"""
    or gen_ai.prompt rlike """.*-----BEGIN [A-Z ]*PRIVATE KEY-----.*"""
    or gen_ai.completion rlike """.*-----BEGIN [A-Z ]*PRIVATE KEY-----.*"""
    or gen_ai.prompt rlike """.*ABSK[A-Za-z0-9+/=]{20}.*"""
    or gen_ai.completion rlike """.*ABSK[A-Za-z0-9+/=]{20}.*"""
    or gen_ai.prompt rlike """.*gh[pousr]_[A-Za-z0-9]{36}.*"""
    or gen_ai.completion rlike """.*gh[pousr]_[A-Za-z0-9]{36}.*"""
    or gen_ai.prompt rlike """.*github_pat_[A-Za-z0-9_]+.*"""
    or gen_ai.completion rlike """.*github_pat_[A-Za-z0-9_]+.*"""
    or gen_ai.prompt rlike """.*glpat-[A-Za-z0-9_\\-]+.*"""
    or gen_ai.completion rlike """.*glpat-[A-Za-z0-9_\\-]+.*""")
| keep _id, _version, _index, @timestamp, gen_ai.*, aws_bedrock.*, user.*, 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.invocation-* metadata _id, _version, _index

Stage 2: where

| where event.action in ("ConverseStream", "Converse") AND 
   ( gen_ai.prompt rlike """.*(AKIA|ASIA)[A-Z0-9]{16}.*"""
    or gen_ai.completion rlike """.*(AKIA|ASIA)[A-Z0-9]{16}.*"""
    or gen_ai.prompt rlike """.*-----BEGIN [A-Z ]*PRIVATE KEY-----.*"""
    or gen_ai.completion rlike """.*-----BEGIN [A-Z ]*PRIVATE KEY-----.*"""
    or gen_ai.prompt rlike """.*ABSK[A-Za-z0-9+/=]{20}.*"""
    or gen_ai.completion rlike """.*ABSK[A-Za-z0-9+/=]{20}.*"""
    or gen_ai.prompt rlike """.*gh[pousr]_[A-Za-z0-9]{36}.*"""
    or gen_ai.completion rlike """.*gh[pousr]_[A-Za-z0-9]{36}.*"""
    or gen_ai.prompt rlike """.*github_pat_[A-Za-z0-9_]+.*"""
    or gen_ai.completion rlike """.*github_pat_[A-Za-z0-9_]+.*"""
    or gen_ai.prompt rlike """.*glpat-[A-Za-z0-9_\\-]+.*"""
    or gen_ai.completion rlike """.*glpat-[A-Za-z0-9_\\-]+.*""")

Stage 3: keep

| keep _id, _version, _index, @timestamp, gen_ai.*, aws_bedrock.*, user.*, cloud.*, event.*

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actionin
  • Converse
  • ConverseStream
field:"EventType" kind:in
gen_ai.completionregex_match
  • .*(AKIA|ASIA)[A-Z0-9]{16}.*
  • .*-----BEGIN [A-Z ]*PRIVATE KEY-----.*
  • .*ABSK[A-Za-z0-9+/=]{20}.*
  • .*gh[pousr]_[A-Za-z0-9]{36}.*
  • .*github_pat_[A-Za-z0-9_]+.*
  • .*glpat-[A-Za-z0-9_\-]+.*
field:"gen_ai.completion" kind:regex_match
gen_ai.promptregex_match
  • .*(AKIA|ASIA)[A-Z0-9]{16}.*
  • .*-----BEGIN [A-Z ]*PRIVATE KEY-----.*
  • .*ABSK[A-Za-z0-9+/=]{20}.*
  • .*gh[pousr]_[A-Za-z0-9]{36}.*
  • .*github_pat_[A-Za-z0-9_]+.*
  • .*glpat-[A-Za-z0-9_\-]+.*
field:"gen_ai.prompt" kind:regex_match

Output Fields

These fields are emitted when the rule matches.

FieldSource
_idKEEP _id
_versionKEEP _version
_indexKEEP _index
@timestampKEEP @timestamp
gen_ai.*KEEP gen_ai.*
aws_bedrock.*KEEP aws_bedrock.*
user.*KEEP user.*
cloud.*KEEP cloud.*
event.*KEEP event.*

AWS IAM Customer Managed Policy Version Created or Default Version Set

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

Identifies successful IAM API calls that create a new customer managed policy version or set the default version for an existing customer managed policy. Attackers with iam:CreatePolicyVersion or iam:SetDefaultPolicyVersion on a privileged policy can introduce a permissive policy document and activate it, escalating effective permissions without attaching a new policy. These APIs are high impact when the target policy is attached to powerful roles or users.

Known False Positives

  • Infrastructure-as-code, CI/CD, and IAM administrators routinely publish new policy versions or roll back defaults. Validate the policy ARN, change tickets, and whether the policy document broadens permissions. Exclude automation roles or pipelines after review.

MITRE ATT&CK Coverage

Telemetry Coverage

Rules Detecting the Same Action

These rules filter on the same operation.

Rule Body

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

[rule]
author = ["Elastic"]
description = """
Identifies successful IAM API calls that create a new customer managed policy version or set the default version for an
existing customer managed policy. Attackers with `iam:CreatePolicyVersion` or `iam:SetDefaultPolicyVersion` on a
privileged policy can introduce a permissive policy document and activate it, escalating effective permissions without
attaching a new policy. These APIs are high impact when the target policy is attached to powerful roles or users.
"""
false_positives = [
    """
    Infrastructure-as-code, CI/CD, and IAM administrators routinely publish new policy versions or roll back defaults.
    Validate the policy ARN, change tickets, and whether the policy document broadens permissions. Exclude automation
    roles or pipelines after review.
    """,
]
from = "now-6m"
index = ["filebeat-*", "logs-aws.cloudtrail-*"]
language = "kuery"
license = "Elastic License v2"
name = "AWS IAM Customer Managed Policy Version Created or Default Version Set"
note = """## Triage and analysis

### Investigating AWS IAM Customer Managed Policy Version Created or Default Version Set

`CreatePolicyVersion` uploads a new immutable version of a customer managed policy. `SetDefaultPolicyVersion` switches
which version principals evaluate—immediately changing effective access if the policy is already attached.

#### Possible investigation steps

- From `aws.cloudtrail.request_parameters`, extract `policyArn`, `policyDocument` (if present), and `setAsDefault`.
- Map the policy ARN to attached users, groups, and roles; prioritize policies attached to admin or break-glass roles.
- Compare the new or selected version to prior versions in IAM or version history for added `Action`/`Resource` wildcards.
- Review `aws.cloudtrail.user_identity.arn`, `source.ip`, and `user_agent.original` for interactive vs automation context.
- Correlate with `AttachUserPolicy`, `AttachRolePolicy`, or `CreatePolicyVersion` spikes from the same principal.

### False positive analysis

- Planned policy releases and rollbacks are expected in mature shops; baseline known publishers.

### Response and remediation

- If malicious: set default to a known-good version, delete bad versions where supported, detach policy if necessary, and
  revoke excess `iam:*` on the actor.

### Additional information

- [CreatePolicyVersion](https://docs.aws.amazon.com/IAM/latest/APIReference/API_CreatePolicyVersion.html)
- [SetDefaultPolicyVersion](https://docs.aws.amazon.com/IAM/latest/APIReference/API_SetDefaultPolicyVersion.html)
"""
references = [
    "https://docs.aws.amazon.com/IAM/latest/APIReference/API_CreatePolicyVersion.html",
    "https://docs.aws.amazon.com/IAM/latest/APIReference/API_SetDefaultPolicyVersion.html",
    "https://rhinosecuritylabs.com/aws/aws-privilege-escalation-methods-mitigation/",
]
risk_score = 47
rule_id = "d4e8f0a1-2b3c-4d5e-a6f7-8b9c0d1e2f3a"
severity = "medium"
tags = [
    "Domain: Cloud",
    "Domain: Identity",
    "Platform: AWS",
    "Data Source: AWS CloudTrail",
    "Service: AWS IAM",
    "Tactic: Privilege Escalation",
    "Rule Type: Custom Query (KQL)",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "query"

query = '''
event.dataset: "aws.cloudtrail"
    and event.provider: "iam.amazonaws.com"
    and event.action: ("CreatePolicyVersion" or "SetDefaultPolicyVersion")
    and event.outcome: "success"
    and not aws.cloudtrail.user_identity.type: "AWSService" 
    and not aws.cloudtrail.user_identity.arn:arn*/terraform 
    and not source.as.organization.name:(Amazon* or AMAZON* or "Google LLC" or "MongoDB, Inc.")
    and not source.address: ( "cloudformation.amazonaws.com" or "servicecatalog.amazonaws.com")
    and not user_agent.original: (*Terraform* or *Pulumi*)
'''

[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",
]

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

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

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

[[rule.threat.technique.subtechnique]]
id = "T1548.005"
name = "Temporary Elevated Cloud Access"
reference = "https://attack.mitre.org/techniques/T1548/005/"

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

Stages and Predicates

Stage 1: query

event.dataset: "aws.cloudtrail"
    and event.provider: "iam.amazonaws.com"
    and event.action: ("CreatePolicyVersion" or "SetDefaultPolicyVersion")
    and event.outcome: "success"
    and not aws.cloudtrail.user_identity.type: "AWSService" 
    and not aws.cloudtrail.user_identity.arn:arn*/terraform 
    and not source.as.organization.name:(Amazon* or AMAZON* or "Google LLC" or "MongoDB, Inc.")
    and not source.address: ( "cloudformation.amazonaws.com" or "servicecatalog.amazonaws.com")
    and not user_agent.original: (*Terraform* or *Pulumi*)

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actionin
  • CreatePolicyVersion
  • SetDefaultPolicyVersion
field:"EventType" kind:in
event.dataseteq
  • aws.cloudtrail corpus 14 (elastic 14)
field:"event.dataset" kind:eq value:"aws.cloudtrail"
event.outcomeeq
  • success corpus 306 (elastic 306)
field:"event.outcome" kind:eq value:"success"
event.providereq
  • iam.amazonaws.com corpus 24 (elastic 24)
field:"Provider_Name" kind:eq value:"iam.amazonaws.com"

Exclusions

The rule actively suppresses these predicates.

Browser Debugging from Unusual Parent

#
Source
github.com/elastic/protections-artifacts

Identifies the execution of a Chromium-based browser with the debugging process argument, which may indicate an attempt to steal authentication cookies. An adversary may steal web application or service session cookies and use them to access web applications or Internet services as an authenticated user without credentials.

MITRE ATT&CK Coverage

TacticTechniques
Credential Access

Rule Body

[rule]
description = """
Identifies the execution of a Chromium-based browser with the debugging process argument, which may indicate an attempt
to steal authentication cookies. An adversary may steal web application or service session cookies and use them to
access web applications or Internet services as an authenticated user without credentials.
"""
id = "09931e34-fe6b-4155-91ec-490d64fb72a2"
license = "Elastic License v2"
name = "Browser Debugging from Unusual Parent"
os_list = ["windows"]
reference = [
    "https://github.com/defaultnamehere/cookie_crimes",
    "https://embracethered.com/blog/posts/2020/cookie-crimes-on-mirosoft-edge/",
    "https://github.com/rapid7/metasploit-framework/blob/master/documentation/modules/post/multi/gather/chrome_cookies.md",
    "https://posts.specterops.io/hands-in-the-cookie-jar-dumping-cookies-with-chromiums-remote-debugger-port-34c4f468844e",
    "https://github.com/BishopFox/sliver/wiki/Cursed",
]
version = "1.0.24"

query = '''
process where event.type == "start" and
   process.name : ("chrome.exe", "msedge.exe") and not user.id : "S-1-5-18" and
   process.code_signature.trusted == true and
   process.parent.executable != null and
   process.args : ("--remote-debugging-port=*",
                   "--remote-debugging-targets=*",
                   "--remote-debugging-pipe=*") and
   process.args : "--user-data-dir=*" and not process.args:"--remote-debugging-port=0" and
   not (process.parent.name == "chrome.exe" and process.parent.args == "--remote-debugging-host=127.0.0.1") and
   not process.parent.executable : ("?:\\Program Files\\Microsoft VS Code\\Code.exe",
                                    "?:\\Program Files (x86)\\PRTG Network Monitor\\Sensor System\\reporter.exe",
                                    "?:\\Program Files\\nodejs\\node.exe",
                                    "?:\\Windows\\System32\\inetsrv\\w3wp.exe",
                                    "?:\\Program Files\\Google\\Chrome\\Application\\chrome.exe",
                                    "?:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe",
                                    "?:\\Program Files (x86)\\Brackets\\Brackets.exe",
                                    "?:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe",
                                    "?:\\Program Files\\Microsoft\\Edge\\Application\\msedge.exe",
                                    "?:\\Program Files\\OutSystems\\Development Environment*\\Service Studio\\ServiceStudio.exe",
                                    "?:\\Program Files (x86)\\CyberArk\\PSM\\Components\\chromedriver.exe",
                                    "?:\\Program Files\\Microsoft Visual Studio\\*\\node.exe",
                                    "?:\\Program Files (x86)\\Microsoft Visual Studio\\*\\node.exe",
                                    "?:\\Program Files (x86)\\Price Pro\\PricePro.exe",
                                    "?:\\Users\\*\\Versioning_SPCRepository\\SPCProcessor\\SPCEngine\\app.exe",
                                    "E:\\PRTG\\Sensor System\\reporter.exe" ,
                                    "E:\\eclipse\\chromedriver.exe",
                                    "c:\\ibi\\AppStudio82\\bin\\chromedriver.exe",
                                    "C:\\Windows\\chromedriver.exe",
                                    "?:\\Program Files\\Google\\Chrome Dev\\Application\\chrome.exe",
                                    "?:\\ibi\\AppStudio90\\bin\\chromedriver.exe",
                                    "?:\\Users\\*\\AppData\\Roaming\\nvm\\v*\\node.exe",
                                    "?:\\*\\bin\\cache\\dart-sdk\\bin\\dart.exe",
                                    "C:\\Users\\*\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe",
                                    "C:\\Program Files\\Python3??\\python.exe") and
   not (process.parent.executable : "?:\\Windows\\explorer.exe" and process.command_line : "*VisualStudio*") and
   not (process.parent.name : "chromedriver.exe" and process.parent.command_line : "*chromedriver.exe --port=*") and
   not (process.parent.executable : "?:\\Users\\*\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe" and
        process.parent.command_line : "*--ms-enable-electron-run-as-node*") and
   not (process.parent.name : "node.exe" and process.parent.args : "--code-coverage") and
   not process.args :
             ("--user-data-dir=?:\\Users\\*\\AppData\\Local\\JetBrains\\WebStorm*\\chrome-user-data-*",
              "--user-data-dir=?:\\Users\\*\\AppData\\Local\\Temp\\1\\flutter_tools.*\\flutter_tools_chrome_device.*") and
   not process.parent.args : "?:\\Program Files\\nodejs\\node.exe" and
   not (process.parent.code_signature.subject_name == "Google LLC" and process.parent.code_signature.trusted == true)
'''

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


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

[internal]
min_endpoint_version = "8.14.0"

Stages and Predicates

Stage 1: process

process where event.type == "start" and
   process.name : ("chrome.exe", "msedge.exe") and not user.id : "S-1-5-18" and
   process.code_signature.trusted == true and
   process.parent.executable != null and
   process.args : ("--remote-debugging-port=*",
                   "--remote-debugging-targets=*",
                   "--remote-debugging-pipe=*") and
   process.args : "--user-data-dir=*" and not process.args:"--remote-debugging-port=0" and
   not (process.parent.name == "chrome.exe" and process.parent.args == "--remote-debugging-host=127.0.0.1") and
   not process.parent.executable : ("?:\\Program Files\\Microsoft VS Code\\Code.exe",
                                    "?:\\Program Files (x86)\\PRTG Network Monitor\\Sensor System\\reporter.exe",
                                    "?:\\Program Files\\nodejs\\node.exe",
                                    "?:\\Windows\\System32\\inetsrv\\w3wp.exe",
                                    "?:\\Program Files\\Google\\Chrome\\Application\\chrome.exe",
                                    "?:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe",
                                    "?:\\Program Files (x86)\\Brackets\\Brackets.exe",
                                    "?:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe",
                                    "?:\\Program Files\\Microsoft\\Edge\\Application\\msedge.exe",
                                    "?:\\Program Files\\OutSystems\\Development Environment*\\Service Studio\\ServiceStudio.exe",
                                    "?:\\Program Files (x86)\\CyberArk\\PSM\\Components\\chromedriver.exe",
                                    "?:\\Program Files\\Microsoft Visual Studio\\*\\node.exe",
                                    "?:\\Program Files (x86)\\Microsoft Visual Studio\\*\\node.exe",
                                    "?:\\Program Files (x86)\\Price Pro\\PricePro.exe",
                                    "?:\\Users\\*\\Versioning_SPCRepository\\SPCProcessor\\SPCEngine\\app.exe",
                                    "E:\\PRTG\\Sensor System\\reporter.exe" ,
                                    "E:\\eclipse\\chromedriver.exe",
                                    "c:\\ibi\\AppStudio82\\bin\\chromedriver.exe",
                                    "C:\\Windows\\chromedriver.exe",
                                    "?:\\Program Files\\Google\\Chrome Dev\\Application\\chrome.exe",
                                    "?:\\ibi\\AppStudio90\\bin\\chromedriver.exe",
                                    "?:\\Users\\*\\AppData\\Roaming\\nvm\\v*\\node.exe",
                                    "?:\\*\\bin\\cache\\dart-sdk\\bin\\dart.exe",
                                    "C:\\Users\\*\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe",
                                    "C:\\Program Files\\Python3??\\python.exe") and
   not (process.parent.executable : "?:\\Windows\\explorer.exe" and process.command_line : "*VisualStudio*") and
   not (process.parent.name : "chromedriver.exe" and process.parent.command_line : "*chromedriver.exe --port=*") and
   not (process.parent.executable : "?:\\Users\\*\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe" and
        process.parent.command_line : "*--ms-enable-electron-run-as-node*") and
   not (process.parent.name : "node.exe" and process.parent.args : "--code-coverage") and
   not process.args :
             ("--user-data-dir=?:\\Users\\*\\AppData\\Local\\JetBrains\\WebStorm*\\chrome-user-data-*",
              "--user-data-dir=?:\\Users\\*\\AppData\\Local\\Temp\\1\\flutter_tools.*\\flutter_tools_chrome_device.*") and
   not process.parent.args : "?:\\Program Files\\nodejs\\node.exe" and
   not (process.parent.code_signature.subject_name == "Google LLC" and process.parent.code_signature.trusted == true)

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.typeeq
  • start corpus 1036 (elastic 1036)
field:"event.type" kind:eq value:"start"
process.argswildcard
  • --remote-debugging-pipe=* corpus 2 (elastic 2)
  • --remote-debugging-port=* corpus 2 (elastic 2)
  • --remote-debugging-targets=* corpus 2 (elastic 2)
  • --user-data-dir=* corpus 2 (elastic 2)
field:"process.args" kind:wildcard
process.code_signature.trustedeq
  • true transforms: boolean corpus 14 (elastic 14)
field:"process.code_signature.trusted" kind:eq value:"true"
process.namewildcard
  • chrome.exe corpus 16 (elastic 14, splunk 2)
  • msedge.exe corpus 12 (elastic 12)
field:"process_basename" kind:wildcard
process.parent.executableis_not_null
  • (no value, null check)
field:"ParentImage" kind:is_not_null

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.command_linematchVisualStudioexcludes:process.command_line field:"process.command_line" value:"VisualStudio"
process.parent.executableeq?:\Windows\explorer.exeexcludes:process.parent.executable field:"process.parent.executable" value:"?:\Windows\explorer.exe"
process.parent.argseq--remote-debugging-host=127.0.0.1excludes:process.parent.args field:"process.parent.args" value:"--remote-debugging-host=127.0.0.1"
process.parent.nameeqchrome.exeexcludes:process.parent.name field:"process.parent.name" value:"chrome.exe"
process.parent.argseq--code-coverageexcludes:process.parent.args field:"process.parent.args" value:"--code-coverage"
process.parent.nameeqnode.exeexcludes:process.parent.name field:"process.parent.name" value:"node.exe"
process.parent.code_signature.subject_nameeqGoogle LLCexcludes:process.parent.code_signature.subject_name field:"process.parent.code_signature.subject_name" value:"Google LLC"
process.parent.code_signature.trustedeqtrueexcludes:process.parent.code_signature.trusted field:"process.parent.code_signature.trusted" value:"true"
process.parent.command_linematch--ms-enable-electron-run-as-nodeexcludes:process.parent.command_line field:"process.parent.command_line" value:"--ms-enable-electron-run-as-node"
process.parent.executablewildcard?:\Users\*\AppData\Local\Programs\Microsoft VS Code\Code.exeexcludes:process.parent.executable field:"process.parent.executable" value:"?:\Users\*\AppData\Local\Programs\Microsoft VS Code\Code.exe"
process.parent.command_linematchchromedriver.exe --port=excludes:process.parent.command_line field:"process.parent.command_line" value:"chromedriver.exe --port="
process.parent.nameeqchromedriver.exeexcludes:process.parent.name field:"process.parent.name" value:"chromedriver.exe"
process.argseq--remote-debugging-port=0excludes:process.args field:"process.args" value:"--remote-debugging-port=0"
process.argswildcard--user-data-dir=?:\Users\*\AppData\Local\JetBrains\WebStorm*\chrome-user-data-*, --user-data-dir=?:\Users\*\AppData\Local\Temp\1\flutter_tools.*\flutter_tools_chrome_device.*excludes:process.args field:"process.args" value:"--user-data-dir=?:\Users\*\AppData\Local\JetBrains\WebStorm*\chrome-user-data-*" field:"process.args" value:"--user-data-dir=?:\Users\*\AppData\Local\Temp\1\flutter_tools.*\flutter_tools_chrome_device.*"
process.parent.argseq?:\Program Files\nodejs\node.exeexcludes:process.parent.args field:"process.parent.args" value:"?:\Program Files\nodejs\node.exe"
process.parent.executablewildcard?:\Program Files\Microsoft VS Code\Code.exe, ?:\Program Files (x86)\PRTG Network Monitor\Sensor System\reporter.exe, ?:\Program Files\nodejs\node.exe, ?:\Windows\System32\inetsrv\w3wp.exe, ?:\Program Files\Google\Chrome\Application\chrome.exe, ?:\Program Files (x86)\Google\Chrome\Application\chrome.exe, ?:\Program Files (x86)\Brackets\Brackets.exe, ?:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe, ?:\Program Files\Microsoft\Edge\Application\msedge.exe, ?:\Program Files\OutSystems\Development Environment*\Service Studio\ServiceStudio.exe, ?:\Program Files (x86)\CyberArk\PSM\Components\chromedriver.exe, ?:\Program Files\Microsoft Visual Studio\*\node.exe, ?:\Program Files (x86)\Microsoft Visual Studio\*\node.exe, ?:\Program Files (x86)\Price Pro\PricePro.exe, ?:\Users\*\Versioning_SPCRepository\SPCProcessor\SPCEngine\app.exe, E:\PRTG\Sensor System\reporter.exe, E:\eclipse\chromedriver.exe, c:\ibi\AppStudio82\bin\chromedriver.exe, C:\Windows\chromedriver.exe, ?:\Program Files\Google\Chrome Dev\Application\chrome.exe, ?:\ibi\AppStudio90\bin\chromedriver.exe, ?:\Users\*\AppData\Roaming\nvm\v*\node.exe, ?:\*\bin\cache\dart-sdk\bin\dart.exe, C:\Users\*\AppData\Local\Programs\Microsoft VS Code\Code.exe, C:\Program Files\Python3??\python.exeexcludes:process.parent.executable
user.ideqS-1-5-18excludes:user.id field:"user.id" value:"S-1-5-18"

Browser Extension Install

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

Identifies the install of browser extensions. Malicious browser extensions can be installed via app store downloads masquerading as legitimate extensions, social engineering, or by an adversary that has already compromised a system.

MITRE ATT&CK Coverage

Telemetry Coverage

ProviderRecord / event type
SysmonEvent ID 11: FileCreate

Rule Body

[metadata]
creation_date = "2023/08/22"
integration = ["endpoint", "m365_defender", "sentinel_one_cloud_funnel", "windows"]
maturity = "production"
updated_date = "2026/05/04"

[rule]
author = ["Elastic"]
description = """
Identifies the install of browser extensions. Malicious browser extensions can be installed via app store downloads
masquerading as legitimate extensions, social engineering, or by an adversary that has already compromised a system.
"""
from = "now-9m"
index = [
    "logs-endpoint.events.file-*",
    "logs-m365_defender.event-*",
    "logs-sentinel_one_cloud_funnel.*",
    "logs-windows.sysmon_operational-*",
    "winlogbeat-*",
    "endgame-*",
]
language = "eql"
license = "Elastic License v2"
name = "Browser Extension Install"
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 Browser Extension Install
Browser extensions enhance functionality in web browsers but can be exploited by adversaries to gain persistence or execute malicious activities. Attackers may disguise harmful extensions as legitimate or use compromised systems to install them. The detection rule identifies suspicious extension installations by monitoring file creation events in typical extension directories, filtering out known safe processes, and focusing on Windows environments.

### Possible investigation steps

- Review the file creation event details to identify the specific browser extension file (e.g., .xpi or .crx) and its path to determine if it aligns with known malicious patterns or locations.
- Check the process that initiated the file creation event, especially if it is not a known safe process like firefox.exe, to assess if it is a legitimate application or potentially malicious.
- Investigate the user account associated with the file creation event to determine if the activity is expected or if the account may have been compromised.
- Examine recent system activity and logs for any signs of social engineering attempts or unauthorized access that could have led to the installation of the extension.
- Cross-reference the extension file name and path with threat intelligence sources to identify if it is associated with known malicious browser extensions.
- If applicable, review the browser's extension management interface to verify the presence and legitimacy of the installed extension.

### False positive analysis

- Language pack installations for Firefox can trigger false positives. Exclude files named "langpack-*@firefox.mozilla.org.xpi" from detection to prevent unnecessary alerts.
- Dictionary add-ons for Firefox may also be flagged. Add exceptions for files named "*@dictionaries.addons.mozilla.org.xpi" to reduce false positives.
- Regular updates or installations of legitimate browser extensions from trusted sources can be mistaken for malicious activity. Maintain a list of trusted processes and paths to exclude from monitoring.
- User-initiated installations from official browser stores might be flagged. Educate users on safe installation practices and consider excluding known safe processes like "firefox.exe" when associated with legitimate extension paths.
- Frequent installations in enterprise environments due to software deployment tools can cause alerts. Coordinate with IT to identify and exclude these routine activities from detection.

### Response and remediation

- Isolate the affected system from the network to prevent further spread or communication with potential command and control servers.
- Terminate any suspicious processes associated with the unauthorized browser extension installation, such as unknown or unexpected instances of browser processes.
- Remove the malicious browser extension by deleting the associated files from the extension directories identified in the alert.
- Conduct a full antivirus and anti-malware scan on the affected system to identify and remove any additional threats or remnants of the malicious extension.
- Review and reset browser settings to default to ensure no residual configurations or settings are left by the malicious extension.
- Escalate the incident to the security operations team for further investigation and to determine if additional systems are affected.
- Implement application whitelisting to prevent unauthorized browser extensions from being installed in the future, focusing on the directories and file types identified in the detection query."""
risk_score = 21
rule_id = "f97504ac-1053-498f-aeaa-c6d01e76b379"
severity = "low"
tags = [
    "Domain: Endpoint",
    "OS: Windows",
    "Use Case: Threat Detection",
    "Tactic: Persistence",
    "Data Source: Elastic Defend",
    "Data Source: Elastic Endgame",
    "Data Source: SentinelOne",
    "Data Source: Sysmon",
    "Data Source: Microsoft Defender XDR",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"

query = '''
file where host.os.type == "windows" and event.type : "creation" and
(
  /* Firefox-Based Browsers */
  (
    file.name : "*.xpi" and
    file.path : "?:\\Users\\*\\AppData\\Roaming\\*\\Profiles\\*\\Extensions\\*.xpi" and
    not
    (
      process.name : "firefox.exe" and
      file.name : (
        "langpack-*@firefox.mozilla.org.xpi",
        "*@dictionaries.addons.mozilla.org.xpi",
        "newtab@mozilla.org.xpi",
        "uBlock0@raymondhill.net.xpi",
        /* AdBlockPlus */
        "{d10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d}.xpi",
        /* Bitwarden */
        "{446900e4-71c2-419f-a6a7-df9c091e268b}.xpi",
        "addon@darkreader.org.xpi",
        /* 1Password */
        "{d634138d-c276-4fc8-924b-40a0ea21d284}.xpi",
        "support@lastpass.com.xpi",
        /* Grammarly */
        "87677a2c52b84ad3a151a4a72f5bd3c4@jetpack.xpi",
        "sentinelone_visibility@sentinelone.com.xpi",
        "keepassxc-browser@keepassxc.org.xpi"
      )
    )
  ) or
  /* Chromium-Based Browsers */
  (
    file.name : "*.crx" and
    file.path : "?:\\Users\\*\\AppData\\Local\\*\\*\\User Data\\Webstore Downloads\\*"
  )
)
'''

setup = """## Setup

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

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

### Additional data sources

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

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


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

[[rule.threat.technique]]
id = "T1176"
name = "Software Extensions"
reference = "https://attack.mitre.org/techniques/T1176/"

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

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

Stages and Predicates

Stage 1: file

file where host.os.type == "windows" and event.type : "creation" and
(
  (
    file.name : "*.xpi" and
    file.path : "?:\\Users\\*\\AppData\\Roaming\\*\\Profiles\\*\\Extensions\\*.xpi" and
    not
    (
      process.name : "firefox.exe" and
      file.name : (
        "langpack-*@firefox.mozilla.org.xpi",
        "*@dictionaries.addons.mozilla.org.xpi",
        "newtab@mozilla.org.xpi",
        "uBlock0@raymondhill.net.xpi",
        "{d10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d}.xpi",
        "{446900e4-71c2-419f-a6a7-df9c091e268b}.xpi",
        "addon@darkreader.org.xpi",
        "{d634138d-c276-4fc8-924b-40a0ea21d284}.xpi",
        "support@lastpass.com.xpi",
        "87677a2c52b84ad3a151a4a72f5bd3c4@jetpack.xpi",
        "sentinelone_visibility@sentinelone.com.xpi",
        "keepassxc-browser@keepassxc.org.xpi"
      )
    )
  ) or
  (
    file.name : "*.crx" and
    file.path : "?:\\Users\\*\\AppData\\Local\\*\\*\\User Data\\Webstore Downloads\\*"
  )
)

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.typewildcard
  • creation corpus 4 (elastic 4)
field:"event.type" kind:wildcard value:"creation"
file.namewildcard
  • *.crx
  • *.xpi
field:"file.name" kind:wildcard
file.pathwildcard
  • ?:\Users\*\AppData\Local\*\*\User Data\Webstore Downloads\*
  • ?:\Users\*\AppData\Roaming\*\Profiles\*\Extensions\*.xpi
field:"TargetFilename" kind:wildcard

Executable Masquerading as Kernel Process

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

Monitors for kernel processes with associated process executable fields that are not empty. Unix kernel processes such as kthreadd and kworker typically do not have process.executable fields associated to them. Attackers may attempt to hide their malicious programs by masquerading as legitimate kernel processes.

MITRE ATT&CK Coverage

Rule Body

[metadata]
creation_date = "2024/02/01"
integration = ["endpoint", "crowdstrike", "sentinel_one_cloud_funnel"]
maturity = "production"
updated_date = "2026/03/24"

[rule]
author = ["Elastic"]
description = """
Monitors for kernel processes with associated process executable fields that are not empty. Unix kernel processes such
as kthreadd and kworker typically do not have process.executable fields associated to them. Attackers may attempt to
hide their malicious programs by masquerading as legitimate kernel processes.
"""
from = "now-9m"
index = [
    "endgame-*",
    "logs-crowdstrike.fdr*",
    "logs-endpoint.events.process*",
    "logs-sentinel_one_cloud_funnel.*",
]
language = "eql"
license = "Elastic License v2"
name = "Executable Masquerading as Kernel Process"
note = """## Triage and analysis

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

### Investigating Executable Masquerading as Kernel Process

In Linux environments, kernel processes like `kthreadd` and `kworker` typically run without associated executable paths. Adversaries exploit this by naming malicious executables after these processes to evade detection. The detection rule identifies anomalies by flagging kernel-named processes with non-empty executable fields, indicating potential masquerading attempts. This helps in uncovering stealthy threats that mimic legitimate system activities.

### Possible investigation steps

- Review the process details for the flagged process, focusing on the process.executable field to identify the path and name of the executable. This can provide initial insights into whether the executable is legitimate or potentially malicious.
- Check the process's parent process (process.parent) to understand the context in which the process was started. This can help determine if the process was spawned by a legitimate system process or a suspicious one.
- Investigate the file at the path specified in the process.executable field. Verify its legitimacy by checking its hash against known malware databases or using a file reputation service.
- Examine the process's command line arguments (process.command_line) for any unusual or suspicious parameters that might indicate malicious activity.
- Review recent system logs and events around the time the process was started to identify any related activities or anomalies that could provide additional context or evidence of compromise.
- If available, use threat intelligence sources to check for any known indicators of compromise (IOCs) related to the process name or executable path.

### False positive analysis

- Custom scripts or administrative tools may be named similarly to kernel processes for convenience or organizational standards. Review these scripts and tools to ensure they are legitimate and consider adding them to an exception list if verified.
- Some legitimate software or monitoring tools might use kernel-like names for their processes to integrate closely with system operations. Verify the source and purpose of these processes and exclude them if they are confirmed to be non-malicious.
- System updates or patches might temporarily create processes with kernel-like names that have executable paths. Monitor these occurrences and exclude them if they are part of a verified update process.
- Development or testing environments may intentionally use kernel-like names for process simulation. Ensure these environments are isolated and add exceptions for these processes if they are part of controlled testing scenarios.

### Response and remediation

- Isolate the affected system from the network to prevent further spread of the potential threat and to contain any malicious activity.
- Terminate the suspicious process immediately to stop any ongoing malicious actions. Use process management tools to kill the process identified by the alert.
- Conduct a forensic analysis of the affected system to identify any additional indicators of compromise (IOCs) and assess the extent of the intrusion.
- Remove any malicious executables or files associated with the masquerading process from the system to ensure complete remediation.
- Restore the system from a known good backup if the integrity of the system is compromised, ensuring that the backup is free from any malicious artifacts.
- Update and patch the system to close any vulnerabilities that may have been exploited by the attacker, ensuring all software and security tools are up to date.
- Escalate the incident to the security operations center (SOC) or incident response team for further investigation and to determine if additional systems are affected."""
references = ["https://sandflysecurity.com/blog/linux-stealth-rootkit-malware-with-edr-evasion-analyzed/"]
risk_score = 73
rule_id = "202829f6-0271-4e88-b882-11a655c590d4"
setup = """## Setup


This rule requires data coming in from Elastic Defend.

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

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

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

[[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.004"
name = "Masquerade Task or Service"
reference = "https://attack.mitre.org/techniques/T1036/004/"

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

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

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

Stages and Predicates

Stage 1: process

process where host.os.type == "linux" and event.type == "start" and event.action in ("exec", "exec_event", "start", "ProcessRollup2") and
process.name : ("kworker*", "kthread*") and process.executable != null

Indicators

These rows show field, operator, and value matches.

Installation of Custom Shim Databases

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

Identifies the installation of custom Application Compatibility Shim databases. This Windows functionality has been abused by attackers to stealthily gain persistence and arbitrary code execution in legitimate Windows processes.

MITRE ATT&CK Coverage

Telemetry Coverage

Rule Body

[metadata]
creation_date = "2020/09/02"
integration = ["endpoint", "windows", "m365_defender", "sentinel_one_cloud_funnel", "crowdstrike"]
maturity = "production"
updated_date = "2026/08/31"

[rule]
author = ["Elastic"]
description = """
Identifies the installation of custom Application Compatibility Shim databases. This Windows functionality has been
abused by attackers to stealthily gain persistence and arbitrary code execution in legitimate Windows processes.
"""
from = "now-9m"
index = [
    "logs-endpoint.events.registry-*",
    "winlogbeat-*",
    "logs-windows.sysmon_operational-*",
    "logs-m365_defender.event-*",
    "logs-sentinel_one_cloud_funnel.*",
    "endgame-*",
    "logs-crowdstrike.fdr*",
]
language = "eql"
license = "Elastic License v2"
name = "Installation of Custom Shim Databases"
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 Installation of Custom Shim Databases

Application Compatibility Shim databases are used in Windows to ensure older applications run smoothly on newer OS versions by applying compatibility fixes. However, attackers can exploit this feature to maintain persistence and execute arbitrary code by installing malicious shim databases. The detection rule identifies changes in specific registry paths associated with these databases, excluding known legitimate processes, to flag potential abuse.

### Possible investigation steps

- Review the registry path changes identified in the alert to confirm the presence of any unexpected or unauthorized .sdb files in the specified registry paths.
- Investigate the process that made the registry change by examining the process executable path and comparing it against the list of known legitimate processes excluded in the query.
- Check the historical activity of the process responsible for the change to identify any patterns or anomalies that might indicate malicious behavior.
- Analyze the context around the time of the registry change, including other system events or alerts, to identify any related suspicious activities.
- If a suspicious .sdb file is found, conduct a file analysis to determine its purpose and whether it contains any malicious code or configurations.
- Consult threat intelligence sources to see if there are any known threats or campaigns associated with the identified process or .sdb file.

### False positive analysis

- Known legitimate processes such as SAP and Kaspersky applications may trigger false positives due to their use of shim databases. These processes are already excluded in the detection rule to minimize unnecessary alerts.
- If additional legitimate applications are identified as causing false positives, users can update the exclusion list by adding the specific process executable paths to the rule.
- Regularly review and update the exclusion list to ensure it reflects the current environment and any new legitimate applications that may use shim databases.
- Monitor the frequency and context of alerts to distinguish between benign and potentially malicious activities, adjusting the rule as necessary to reduce noise.
- Engage with application owners to verify the legitimacy of processes that frequently trigger alerts, ensuring that only trusted applications are excluded.

### Response and remediation

- Immediately isolate the affected system from the network to prevent further propagation or communication with potential command and control servers.
- Terminate any suspicious processes identified as responsible for the installation of the custom shim database, ensuring they are not legitimate processes mistakenly flagged.
- Remove the malicious shim database entries from the registry paths specified in the detection query to eliminate persistence mechanisms.
- Conduct a thorough scan of the affected system using updated antivirus and endpoint detection tools to identify and remove any additional malware or unauthorized changes.
- Review and restore any altered system configurations or files to their original state to ensure system integrity.
- Escalate the incident to the security operations center (SOC) or incident response team for further analysis and to determine if additional systems are affected.
- Implement enhanced monitoring and logging for the specified registry paths and associated processes to detect and respond to similar threats in the future."""
risk_score = 47
rule_id = "c5ce48a6-7f57-4ee8-9313-3d0024caee10"
severity = "medium"
tags = [
    "Domain: Endpoint",
    "OS: Windows",
    "Use Case: Threat Detection",
    "Tactic: Persistence",
    "Data Source: Elastic Defend",
    "Data Source: Sysmon",
    "Data Source: Microsoft Defender XDR",
    "Data Source: SentinelOne",
    "Data Source: Elastic Endgame",
    "Data Source: Crowdstrike",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"

query = '''
registry where host.os.type == "windows" and event.type == "change" and
  registry.path : "*\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\Custom\\*.sdb" and
  not process.executable : (
        "?:\\Program Files (x86)\\DesktopCentral_Agent\\*\\Setup\\NwSapSetup.exe",
        "?:\\$WINDOWS.~BT\\Sources\\SetupPlatform.exe",
        "?:\\Program Files (x86)\\SAP\\SAPsetup\\setup\\NwSapSetup.exe",
        "?:\\Program Files (x86)\\SAP\\SapSetup\\OnRebootSvc\\NWSAPSetupOnRebootInstSvc.exe",
        "?:\\Program Files (x86)\\Kaspersky Lab\\Kaspersky Security for Windows Server\\kavfs.exe",

        /* Crowdstrike specific exclusion as it uses NT Object paths */
        "\\Device\\HarddiskVolume*\\Program Files (x86)\\DesktopCentral_Agent\\*\\Setup\\NwSapSetup.exe",
        "\\Device\\HarddiskVolume*\\$WINDOWS.~BT\\Sources\\SetupPlatform.exe",
        "\\Device\\HarddiskVolume*\\Program Files (x86)\\SAP\\SAPsetup\\setup\\NwSapSetup.exe",
        "\\Device\\HarddiskVolume*\\Program Files (x86)\\SAP\\SapSetup\\OnRebootSvc\\NWSAPSetupOnRebootInstSvc.exe",
        "\\Device\\HarddiskVolume*\\Program Files (x86)\\Kaspersky Lab\\Kaspersky Security for Windows Server\\kavfs.exe"
  ) and
  /* Microsoft Cloud AppCompat SDB test registrations */
  not registry.path : "*\\AppCompatFlags\\Custom\\*\\{22221111-1111-1111-1111-111111111111}.sdb"
'''

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 Registry Events](https://ela.st/sysmon-event-reg-setup)
"""


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



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

Stages and Predicates

Stage 1: registry

registry where host.os.type == "windows" and event.type == "change" and
  registry.path : "*\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\Custom\\*.sdb" and
  not process.executable : (
        "?:\\Program Files (x86)\\DesktopCentral_Agent\\*\\Setup\\NwSapSetup.exe",
        "?:\\$WINDOWS.~BT\\Sources\\SetupPlatform.exe",
        "?:\\Program Files (x86)\\SAP\\SAPsetup\\setup\\NwSapSetup.exe",
        "?:\\Program Files (x86)\\SAP\\SapSetup\\OnRebootSvc\\NWSAPSetupOnRebootInstSvc.exe",
        "?:\\Program Files (x86)\\Kaspersky Lab\\Kaspersky Security for Windows Server\\kavfs.exe",
        "\\Device\\HarddiskVolume*\\Program Files (x86)\\DesktopCentral_Agent\\*\\Setup\\NwSapSetup.exe",
        "\\Device\\HarddiskVolume*\\$WINDOWS.~BT\\Sources\\SetupPlatform.exe",
        "\\Device\\HarddiskVolume*\\Program Files (x86)\\SAP\\SAPsetup\\setup\\NwSapSetup.exe",
        "\\Device\\HarddiskVolume*\\Program Files (x86)\\SAP\\SapSetup\\OnRebootSvc\\NWSAPSetupOnRebootInstSvc.exe",
        "\\Device\\HarddiskVolume*\\Program Files (x86)\\Kaspersky Lab\\Kaspersky Security for Windows Server\\kavfs.exe"
  ) and
  not registry.path : "*\\AppCompatFlags\\Custom\\*\\{22221111-1111-1111-1111-111111111111}.sdb"

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.typeeq
  • change corpus 89 (elastic 89)
field:"event.type" kind:eq value:"change"
registry.pathwildcard
  • *\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Custom\*.sdb
field:"TargetObject" kind:wildcard value:"*\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Custom\*.sdb"

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.executablewildcard?:\Program Files (x86)\DesktopCentral_Agent\*\Setup\NwSapSetup.exe, ?:\$WINDOWS.~BT\Sources\SetupPlatform.exe, ?:\Program Files (x86)\SAP\SAPsetup\setup\NwSapSetup.exe, ?:\Program Files (x86)\SAP\SapSetup\OnRebootSvc\NWSAPSetupOnRebootInstSvc.exe, ?:\Program Files (x86)\Kaspersky Lab\Kaspersky Security for Windows Server\kavfs.exe, \Device\HarddiskVolume*\Program Files (x86)\DesktopCentral_Agent\*\Setup\NwSapSetup.exe, \Device\HarddiskVolume*\$WINDOWS.~BT\Sources\SetupPlatform.exe, \Device\HarddiskVolume*\Program Files (x86)\SAP\SAPsetup\setup\NwSapSetup.exe, \Device\HarddiskVolume*\Program Files (x86)\SAP\SapSetup\OnRebootSvc\NWSAPSetupOnRebootInstSvc.exe, \Device\HarddiskVolume*\Program Files (x86)\Kaspersky Lab\Kaspersky Security for Windows Server\kavfs.exeexcludes:process.executable
registry.pathwildcard*\AppCompatFlags\Custom\*\{22221111-1111-1111-1111-111111111111}.sdbexcludes:registry.path field:"registry.path" value:"*\AppCompatFlags\Custom\*\{22221111-1111-1111-1111-111111111111}.sdb"

JAVA Application with Unusual File Extension

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

Identifies the execution of a Java JAR application with an unusual file extension. Malicious files may masquerade as non executable file extensions to evade defenses.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
Identifies the execution of a Java JAR application with an unusual file extension. Malicious files may masquerade as non
executable file extensions to evade defenses.
"""
id = "13615fd4-b220-4033-ab4f-8b16b9beae57"
license = "Elastic License v2"
name = "JAVA Application with Unusual File Extension"
os_list = ["windows"]
version = "1.0.7"

query = '''
sequence by process.entity_id with maxspan=5s
[process where event.action == "start" and
 (process.name : "javaw.exe" or process.pe.original_file_name == "javaw.exe") and not process.command_line : "*.jar*" and 
  (
   (process.args_count == 3 and process.args : "-jar") or 
   (process.args_count == 4 and process.args : ("-cp", "-classpath") and process.command_line : " *.* ")
   ) and
  not process.executable : ("?:\\Program Files\\7edit.com\\7Edit *\\bin\\javaw.exe",
                            "?:\\Program Files\\Angry IP Scanner\\jre\\bin\\javaw.exe",
                            "?:\\Program Files\\Eclipse Adoptium\\jdk-*-hotspot\\bin\\javaw.exe",
                            "C:\\Program Files\\Java\\jdk-11\\bin\\javaw.exe",
                            "C:\\Program Files\\Zulu\\zulu-8\\bin\\javaw.exe",
                            "C:\\Program Files\\AdoptOpenJDK\\jre*-hotspot\\bin\\javaw.exe") and
  not process.parent.executable :
                     ("?:\\Program Files (x86)\\AssoSoftware\\AssoInvoice\\AssoInvoice.exe",
                      "C:\\Program Files (x86)\\ImprimeTickets\\ImprimeTickets.exe") and
  not (process.code_signature.subject_name : ("BELLSOFT", "Eclipse.org Foundation, Inc.", "Insurity LLC") and process.code_signature.trusted == true) and
  not process.command_line : "\"C:\\Program Files\\Java\\jre1.8.0_51\\bin\\javaw.exe\" -jar \"C:\\Users\\*\\AppData\\Roaming\\.minecraft\\TLauncher.exe\""
  ]
[network where event.action in ("connection_accepted", "connection_attempted") and
 not cidrmatch(destination.ip, "10.0.0.0/8", "127.0.0.0/8", "169.254.0.0/16", "172.16.0.0/12", "192.0.0.0/24",
       "192.0.0.0/29", "192.0.0.8/32", "192.0.0.9/32", "192.0.0.10/32", "192.0.0.170/32", "192.0.0.171/32",
       "192.0.2.0/24", "192.31.196.0/24", "192.52.193.0/24", "192.88.99.0/24", "224.0.0.0/4",
       "100.64.0.0/10", "192.175.48.0/24","198.18.0.0/15", "198.51.100.0/24", "203.0.113.0/24", "240.0.0.0/4", "::1",
       "FE80::/10", "FF00::/8")]
'''

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


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

[internal]
min_endpoint_version = "7.16.0"

Stages and Predicates

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

Stage 1: process

[process where event.action == "start" and
 (process.name : "javaw.exe" or process.pe.original_file_name == "javaw.exe") and not process.command_line : "*.jar*" and 
  (
   (process.args_count == 3 and process.args : "-jar") or 
   (process.args_count == 4 and process.args : ("-cp", "-classpath") and process.command_line : " *.* ")
   ) and
  not process.executable : ("?:\\Program Files\\7edit.com\\7Edit *\\bin\\javaw.exe",
                            "?:\\Program Files\\Angry IP Scanner\\jre\\bin\\javaw.exe",
                            "?:\\Program Files\\Eclipse Adoptium\\jdk-*-hotspot\\bin\\javaw.exe",
                            "C:\\Program Files\\Java\\jdk-11\\bin\\javaw.exe",
                            "C:\\Program Files\\Zulu\\zulu-8\\bin\\javaw.exe",
                            "C:\\Program Files\\AdoptOpenJDK\\jre*-hotspot\\bin\\javaw.exe") and
  not process.parent.executable :
                     ("?:\\Program Files (x86)\\AssoSoftware\\AssoInvoice\\AssoInvoice.exe",
                      "C:\\Program Files (x86)\\ImprimeTickets\\ImprimeTickets.exe") and
  not (process.code_signature.subject_name : ("BELLSOFT", "Eclipse.org Foundation, Inc.", "Insurity LLC") and process.code_signature.trusted == true) and
  not process.command_line : "\"C:\\Program Files\\Java\\jre1.8.0_51\\bin\\javaw.exe\" -jar \"C:\\Users\\*\\AppData\\Roaming\\.minecraft\\TLauncher.exe\""
  ]

Stage 2: network

[network where event.action in ("connection_accepted", "connection_attempted") and
 not cidrmatch(destination.ip, "10.0.0.0/8", "127.0.0.0/8", "169.254.0.0/16", "172.16.0.0/12", "192.0.0.0/24",
       "192.0.0.0/29", "192.0.0.8/32", "192.0.0.9/32", "192.0.0.10/32", "192.0.0.170/32", "192.0.0.171/32",
       "192.0.2.0/24", "192.31.196.0/24", "192.52.193.0/24", "192.88.99.0/24", "224.0.0.0/4",
       "100.64.0.0/10", "192.175.48.0/24","198.18.0.0/15", "198.51.100.0/24", "203.0.113.0/24", "240.0.0.0/4", "::1",
       "FE80::/10", "FF00::/8")]

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • start corpus 388 (elastic 388)
field:"EventType" kind:eq value:"start"
event.actionin
  • connection_accepted corpus 14 (elastic 14)
  • connection_attempted corpus 24 (elastic 24)
field:"EventType" kind:in
process.argswildcard
  • -classpath corpus 3 (elastic 3)
  • -cp corpus 3 (elastic 3)
  • -jar corpus 8 (elastic 8)
field:"process.args" kind:wildcard
process.args_counteq
  • 3 transforms: number corpus 22 (elastic 22)
  • 4 transforms: number corpus 6 (elastic 6)
field:"process.args_count" kind:eq
process.command_linewildcard
  • *.* corpus 3 (elastic 3)
field:"CommandLine" kind:wildcard value:" *.* "
process.namewildcard
  • javaw.exe corpus 9 (elastic 9)
field:"process_basename" kind:wildcard value:"javaw.exe"
process.pe.original_file_nameeq
  • javaw.exe corpus 3 (elastic 3)
field:"OriginalFileName" kind:eq value:"javaw.exe"

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.code_signature.subject_nameeqBELLSOFT, Eclipse.org Foundation, Inc., Insurity LLCexcludes:process.code_signature.subject_name field:"process.code_signature.subject_name" value:"BELLSOFT" field:"process.code_signature.subject_name" value:"Eclipse.org Foundation, Inc." field:"process.code_signature.subject_name" value:"Insurity LLC"
process.code_signature.trustedeqtrueexcludes:process.code_signature.trusted field:"process.code_signature.trusted" value:"true"
process.command_linematch.jarexcludes:process.command_line field:"process.command_line" value:".jar"
process.command_linewildcard"C:\Program Files\Java\jre1.8.0_51\bin\javaw.exe" -jar "C:\Users\*\AppData\Roaming\.minecraft\TLauncher.exe"excludes:process.command_line
process.executablewildcard?:\Program Files\7edit.com\7Edit *\bin\javaw.exe, ?:\Program Files\Angry IP Scanner\jre\bin\javaw.exe, ?:\Program Files\Eclipse Adoptium\jdk-*-hotspot\bin\javaw.exe, C:\Program Files\Java\jdk-11\bin\javaw.exe, C:\Program Files\Zulu\zulu-8\bin\javaw.exe, C:\Program Files\AdoptOpenJDK\jre*-hotspot\bin\javaw.exeexcludes:process.executable
process.parent.executableeq?:\Program Files (x86)\AssoSoftware\AssoInvoice\AssoInvoice.exe, C:\Program Files (x86)\ImprimeTickets\ImprimeTickets.exeexcludes:process.parent.executable field:"process.parent.executable" value:"?:\Program Files (x86)\AssoSoftware\AssoInvoice\AssoInvoice.exe" field:"process.parent.executable" value:"C:\Program Files (x86)\ImprimeTickets\ImprimeTickets.exe"
destination.ipcidr_match10.0.0.0/8, 127.0.0.0/8, 169.254.0.0/16, 172.16.0.0/12, 192.0.0.0/24, 192.0.0.0/29, 192.0.0.8/32, 192.0.0.9/32, 192.0.0.10/32, 192.0.0.170/32, 192.0.0.171/32, 192.0.2.0/24, 192.31.196.0/24, 192.52.193.0/24, 192.88.99.0/24, 224.0.0.0/4, 100.64.0.0/10, 192.175.48.0/24, 198.18.0.0/15, 198.51.100.0/24, 203.0.113.0/24, 240.0.0.0/4, ::1, FE80::/10, FF00::/8excludes:destination.ip

Kubernetes Service Account Token Created via TokenRequest API

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

Detects the creation of a Kubernetes service account token through the TokenRequest API by a non-system identity. The TokenRequest API allows users and workloads to programmatically generate short-lived tokens for any service account they have create permissions on, without accessing the filesystem or the mounted projected token. Attackers who have gained initial access to a cluster can abuse this API to mint tokens for more privileged service accounts, pivot to cloud provider resources via IRSA/workload identity, or generate long-lived tokens that persist beyond pod termination. Unlike mounted service account tokens which are detectable through file access monitoring, tokens created via the TokenRequest API leave no filesystem footprint, they are only visible in Kubernetes audit logs as a create verb on the serviceaccounts/token subresource. This rule excludes legitimate system components such as the kubelet, kube-controller-manager, and cloud provider managed identities (EKS, AKS, GKE) that routinely create tokens for pod lifecycle management.

Known False Positives

  • New automation, admission webhooks, or platform agents that legitimately call the TokenRequest API under a non-standard user string may require narrow exclusions by user.name or source IP.

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/05/05"
integration = ["kubernetes"]
maturity = "production"
updated_date = "2026/05/05"

[rule]
author = ["Elastic"]
description = """
Detects the creation of a Kubernetes service account token through the TokenRequest API by a non-system identity. The
TokenRequest API allows users and workloads to programmatically generate short-lived tokens for any service account
they have create permissions on, without accessing the filesystem or the mounted projected token. Attackers who have
gained initial access to a cluster can abuse this API to mint tokens for more privileged service accounts, pivot to
cloud provider resources via IRSA/workload identity, or generate long-lived tokens that persist beyond pod
termination. Unlike mounted service account tokens which are detectable through file access monitoring, tokens created
via the TokenRequest API leave no filesystem footprint, they are only visible in Kubernetes audit logs as a create
verb on the serviceaccounts/token subresource. This rule excludes legitimate system components such as the kubelet,
kube-controller-manager, and cloud provider managed identities (EKS, AKS, GKE) that routinely create tokens for pod
lifecycle management.
"""
false_positives = [
    """
    New automation, admission webhooks, or platform agents that legitimately call the TokenRequest API under a
    non-standard user string may require narrow exclusions by user.name or source IP.
    """,
]
from = "now-6m"
index = ["logs-kubernetes.audit_logs-*"]
language = "kuery"
license = "Elastic License v2"
name = "Kubernetes Service Account Token Created via TokenRequest API"
note = """## Triage and analysis

### Investigating Kubernetes Service Account Token Created via TokenRequest API

This alert indicates a successful `create` against the `serviceaccounts/token` subresource (TokenRequest API), which
issues a new service account token without a filesystem read. In EKS and other managed clusters, this can be abused to
mint tokens for more privileged service accounts (including IRSA-linked ones) and pivot to cloud APIs.

#### What to review first

- Actor and origin:
  - `user.name` / `kubernetes.audit.user.username`
  - `source.ip` / `kubernetes.audit.sourceIPs`
  - `user_agent.original` / `kubernetes.audit.userAgent`
  - For cloud identity, review `kubernetes.audit.user.extra.*` (e.g., `arn`, `principalId`).
- Targeted service account:
  - `kubernetes.audit.objectRef.namespace` and `kubernetes.audit.objectRef.name`
  - `kubernetes.audit.requestURI` (should resemble `/api/v1/namespaces/<ns>/serviceaccounts/<sa>/token`)
- Token issuance hints:
  - `kubernetes.audit.annotations.authentication_kubernetes_io/issued-credential-id` (token JTI/issued credential id)

#### Scoping

- Identify which Role/ClusterRoleBindings grant the actor `create` on `serviceaccounts/token` in the affected namespace.
- Pivot on the same `user.name` and `source.ip` for follow-on secret reads, pod exec, RBAC changes, or cloud API calls.

### Response and remediation

- If unauthorized, remove/revert the RBAC permission that allows TokenRequest (`serviceaccounts/token`) and rotate the
  affected service account credentials where applicable.
- For IRSA/workload identity cases, rotate/revoke the cloud role session pathways and review cloud audit logs for API
  activity from the time window of the token mint.
"""
references = [
    "https://kubernetes.io/docs/reference/kubernetes-api/authentication-resources/token-v1/",
    "https://attack.mitre.org/techniques/T1552/007/",
]
risk_score = 47
rule_id = "4df91789-7859-4bc4-9c5a-6b56bfa81a8b"
severity = "medium"
tags = [
    "Data Source: Kubernetes",
    "Domain: 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 
kubernetes.audit.verb:"create" and
kubernetes.audit.objectRef.resource:"serviceaccounts" and
kubernetes.audit.objectRef.subresource:"token" and
user.name:(* and not 
 (system\:kube-controller-manager or
  system\:kube-scheduler or
  system\:node\:* or
  system\:serviceaccount\:kube-system\:* or
  eks\:* or
  aksService or
  aks-service or
  masterclient or
  nodeclient or
  system\:serviceaccount\:gke-managed-system\:* or
  system\:serviceaccount\:gke-connect\:* or
  system\:serviceaccount\:anthos-identity-service\:* or
  system\:gke-controller-manager or
  system\:serviceaccount\:tigera-operator\:* or
  system\:serviceaccount\:calico-system\:*))
'''

[[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 
kubernetes.audit.verb:"create" and
kubernetes.audit.objectRef.resource:"serviceaccounts" and
kubernetes.audit.objectRef.subresource:"token" and
user.name:(* and not 
 (system\:kube-controller-manager or
  system\:kube-scheduler or
  system\:node\:* or
  system\:serviceaccount\:kube-system\:* or
  eks\:* or
  aksService or
  aks-service or
  masterclient or
  nodeclient or
  system\:serviceaccount\:gke-managed-system\:* or
  system\:serviceaccount\:gke-connect\:* or
  system\:serviceaccount\:anthos-identity-service\:* or
  system\:gke-controller-manager or
  system\:serviceaccount\:tigera-operator\:* or
  system\:serviceaccount\:calico-system\:*))

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
user.nameeqaks-serviceexcludes:user.name field:"user.name" value:"aks-service"
user.nameeqaksServiceexcludes:user.name field:"user.name" value:"aksService"
user.nameeqmasterclientexcludes:user.name field:"user.name" value:"masterclient"
user.nameeqnodeclientexcludes:user.name field:"user.name" value:"nodeclient"
user.nameeqsystem:gke-controller-managerexcludes:user.name field:"user.name" value:"system:gke-controller-manager"
user.nameeqsystem:kube-controller-managerexcludes:user.name field:"user.name" value:"system:kube-controller-manager"
user.nameeqsystem:kube-schedulerexcludes:user.name field:"user.name" value:"system:kube-scheduler"
user.namestarts_witheks:excludes:user.name field:"user.name" value:"eks:"
user.namestarts_withsystem:node:excludes:user.name field:"user.name" value:"system:node:"
user.namestarts_withsystem:serviceaccount:anthos-identity-service:excludes:user.name field:"user.name" value:"system:serviceaccount:anthos-identity-service:"
user.namestarts_withsystem:serviceaccount:calico-system:excludes:user.name field:"user.name" value:"system:serviceaccount:calico-system:"
user.namestarts_withsystem:serviceaccount:gke-connect:excludes:user.name field:"user.name" value:"system:serviceaccount:gke-connect:"
user.namestarts_withsystem:serviceaccount:gke-managed-system:excludes:user.name field:"user.name" value:"system:serviceaccount:gke-managed-system:"
user.namestarts_withsystem:serviceaccount:kube-system:excludes:user.name field:"user.name" value:"system:serviceaccount:kube-system:"
user.namestarts_withsystem:serviceaccount:tigera-operator:excludes:user.name field:"user.name" value:"system:serviceaccount:tigera-operator:"

Lateral Movement Alerts from a Newly Observed Source Address

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

This rule detects source IPs that triggered their first lateral movement alert within the last 10 minutes (i.e., newly observed), while also triggering at least 2 distinct lateral movement detection rules. This surfaces new potentially malicious IPs exhibiting immediate lateral movement behavior.

MITRE ATT&CK Coverage

TacticTechniques
Lateral MovementNo specific technique

Rule Body

[metadata]
creation_date = "2026/01/14"
maturity = "production"
updated_date = "2026/02/16"


[rule]
author = ["Elastic"]
description = """
This rule detects source IPs that triggered their first lateral movement alert within the last 10 minutes (i.e., newly observed), while also triggering at least 2 distinct lateral movement detection rules. This surfaces new potentially malicious IPs exhibiting immediate lateral movement behavior.
"""
from = "now-7200m"
interval = "10m"
language = "esql"
license = "Elastic License v2"
name = "Lateral Movement Alerts from a Newly Observed Source Address"
risk_score = 73
rule_id = "0e67f4f1-f683-43c0-8d45-c3293cf31e5d"
setup = """## Setup

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

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

query = '''
FROM .alerts-security.* METADATA _index

// Lateral Movement related rules with fields of interest
| where kibana.alert.rule.threat.tactic.name is not null and
        source.ip IS NOT NULL and destination.ip is not null and
        host.id is not null and KQL("""kibana.alert.rule.threat.tactic.name : "Lateral Movement" and not kibana.alert.rule.tags : "Rule Type: Higher-Order Rule" """)

// aggregate stats by source.ip
| stats  Esql.first_time_seen = MIN(@timestamp),
         Esql.alerts_count = count(*),
         Esql.unique_rules_count = COUNT_DISTINCT(kibana.alert.rule.name),
         Esql.unique_count_host_id = COUNT_DISTINCT(host.id),
         Esql.rule_name_values = VALUES(kibana.alert.rule.name),
         Esql.user_name_values = VALUES(user.name),
         Esql.host_id_values = VALUES(host.id),
         Esql.host_ip_values = VALUES(host.ip),
         Esql.tactic_name_values = VALUES(kibana.alert.rule.threat.tactic.name) by source.ip

// values we will need for next filter
| eval isLocal = locate(MV_CONCAT(to_string(Esql.host_ip_values), ","), to_string(source.ip)),
       Esql.date_diff = DATE_DIFF("minute", Esql.first_time_seen, now())

// at least 2 unique rules from same source.ip and that was first seen in last 5 days
| where Esql.unique_rules_count >= 2 and
        // matches are within 10m of the rule execution time to avoid alert duplicates
        Esql.date_diff <= 10 and
        // make sure source.ip is not equal to host.ip
        not isLocal > 0 and
        // reduce noise from SCCM, Nessus and alike
        Esql.unique_count_host_id <= 3 and Esql.alerts_count <= 20
| eval host.id = MV_FIRST(Esql.host_id_values), user.name = MV_FIRST(Esql.user_name_values)
| KEEP Esql.*, source.ip, host.id, user.name
'''
note = """## Triage and analysis

### Investigating Lateral Movement Alerts from a Newly Observed Source Address

This rule surfaces newly observed, low-frequency source address triggering multiple lateral movement alerts.

Because the alert has not been seen previously for this rule and host, it should be prioritized for validation to determine
whether it represents a true compromise or rare benign activity.

### Investigation Steps

- Identify the source address, affected host, user and review the associated rule name to understand the behavior that triggered the alert.
- Validate the source address and user context under which the activity occurred and assess whether it aligns with normal behavior for that address.
- Refer to the specific rule investigation guide for further actions.

### False Positive Considerations

- Administrative scripts or automation tools can trigger behavior-based detections when first introduced.
- Security tooling, IT management agents, or EDR integrations may generate new behavior alerts during updates or configuration changes.
- Development or testing environments may produce one-off behaviors that resemble malicious techniques.

### Response and Remediation

- If the activity is confirmed malicious, isolate the affected host to prevent further execution or lateral movement.
- Terminate malicious processes and remove any dropped files or persistence mechanisms.
- Collect forensic artifacts to understand initial access and execution flow.
- Patch or remediate any vulnerabilities or misconfigurations that enabled the behavior.
- If benign, document the finding and consider tuning or exception handling to reduce future noise.
- Continue monitoring the host and environment for recurrence of the behavior or related alerts."""
references = ["https://www.elastic.co/docs/solutions/security/detect-and-alert/about-detection-rules"]

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

Stages and Predicates

Stage 1: from

FROM .alerts-security.* METADATA _index

Stage 2: where

| where kibana.alert.rule.threat.tactic.name is not null and
        source.ip IS NOT NULL and destination.ip is not null and
        host.id is not null and KQL("""kibana.alert.rule.threat.tactic.name : "Lateral Movement" and not kibana.alert.rule.tags : "Rule Type: Higher-Order Rule" """)

Stage 3: stats

| stats  Esql.first_time_seen = MIN(@timestamp),
         Esql.alerts_count = count(*),
         Esql.unique_rules_count = COUNT_DISTINCT(kibana.alert.rule.name),
         Esql.unique_count_host_id = COUNT_DISTINCT(host.id),
         Esql.rule_name_values = VALUES(kibana.alert.rule.name),
         Esql.user_name_values = VALUES(user.name),
         Esql.host_id_values = VALUES(host.id),
         Esql.host_ip_values = VALUES(host.ip),
         Esql.tactic_name_values = VALUES(kibana.alert.rule.threat.tactic.name) by source.ip

Stage 4: eval

| eval isLocal = locate(MV_CONCAT(to_string(Esql.host_ip_values), ","), to_string(source.ip)),
       Esql.date_diff = DATE_DIFF("minute", Esql.first_time_seen, now())

Stage 5: where

| where Esql.unique_rules_count >= 2 and
        Esql.date_diff <= 10 and
        not isLocal > 0 and
        Esql.unique_count_host_id <= 3 and Esql.alerts_count <= 20

Stage 6: eval

| eval host.id = MV_FIRST(Esql.host_id_values), user.name = MV_FIRST(Esql.user_name_values)

Stage 7: keep

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

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
kibana.alert.rule.tagseqRule Type: Higher-Order Ruleexcludes:kibana.alert.rule.tags field:"kibana.alert.rule.tags" value:"Rule Type: Higher-Order Rule"
isLocalgt0excludes:isLocal field:"isLocal" value:"0"

Output Fields

These fields are emitted when the rule matches.

FieldSource
Esql.*KEEP Esql.*
source.ipKEEP source.ip
host.idKEEP host.id
user.nameKEEP user.name

Machine Learning Detected a Suspicious Windows Event with a Low Malicious Probability Score

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

A supervised machine learning model (ProblemChild) has identified a suspicious Windows process event with low probability of it being malicious activity. Alternatively, the model's blocklist identified the event as being malicious.

MITRE ATT&CK Coverage

Rule Body

[metadata]
creation_date = "2023/10/16"
integration = ["problemchild", "endpoint"]
maturity = "production"
updated_date = "2025/12/17"

[rule]
author = ["Elastic"]
description = """
A supervised machine learning model (ProblemChild) has identified a suspicious Windows process event with low
probability of it being malicious activity. Alternatively, the model's blocklist identified the event as being
malicious.
"""
from = "now-10m"
index = ["logs-endpoint.events.process-*"]
language = "eql"
license = "Elastic License v2"
name = "Machine Learning Detected a Suspicious Windows Event with a Low Malicious Probability Score"
references = [
    "https://www.elastic.co/guide/en/security/current/prebuilt-ml-jobs.html",
    "https://docs.elastic.co/en/integrations/problemchild",
    "https://www.elastic.co/security-labs/detecting-living-off-the-land-attacks-with-new-elastic-integration",
]
risk_score = 21
rule_id = "13e908b9-7bf0-4235-abc9-b5deb500d0ad"
setup = """## Setup

The rule requires the Living off the Land (LotL) Attack Detection integration assets to be installed, as well as Windows process events collected by integrations such as Elastic Defend or Winlogbeat.

### LotL Attack Detection Setup
The LotL Attack Detection integration detects living-off-the-land activity in Windows process events.

#### Prerequisite Requirements:
- Fleet is required for LotL Attack Detection.
- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).
- Windows process events collected by the [Elastic Defend](https://docs.elastic.co/en/integrations/endpoint) integration or Winlogbeat(https://www.elastic.co/guide/en/beats/winlogbeat/current/_winlogbeat_overview.html).
- To install Elastic Defend, refer to the [documentation](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
- To set up and run Winlogbeat, follow [this](https://www.elastic.co/guide/en/beats/winlogbeat/current/winlogbeat-installation-configuration.html) guide.

#### The following steps should be executed to install assets associated with the LotL Attack Detection integration:
- Go to the Kibana homepage. Under Management, click Integrations.
- In the query bar, search for Living off the Land Attack Detection and select the integration to see more details about it.
- Follow the instructions under the **Installation** section.
- For this rule to work, complete the instructions through **Configure the ingest pipeline**.
"""
severity = "low"
tags = [
    "OS: Windows",
    "Data Source: Elastic Endgame",
    "Use Case: Living off the Land Attack Detection",
    "Rule Type: ML",
    "Rule Type: Machine Learning",
    "Tactic: Defense Evasion",
    "Data Source: Elastic Defend",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"

query = '''
process where ((problemchild.prediction == 1 and problemchild.prediction_probability <= 0.98) or
blocklist_label == 1) and not process.args : ("*C:\\WINDOWS\\temp\\nessus_*.txt*", "*C:\\WINDOWS\\temp\\nessus_*.tmp*") and
process.parent.executable != null and not user.id in ("S-1-5-18", "S-1-5-19", "S-1-5-20") and
not process.parent.name : ("cmd.exe", "powershell.exe") and
not (process.name == "net1.exe" and process.parent.name == "net.exe") and
not (process.parent.executable : "C:\\Windows\\System32\\svchost.exe" and
     process.name : ("UCPDMgr.exe", "sdbinst.exe", "gpupdate.exe", "rundll32.exe", "taskhostw.exe", "taskeng.exe")) and
not (process.name: ("powershell.exe", "cmd.exe", "cscript.exe") and
     process.parent.executable : ("C:\\Program Files\\*.exe",
                                  "C:\\Program Files (x86)\\*.exe",
                                  "C:\\Users\\*\\Documents\\scripts\\nssm-2.24\\win64\\nssm.exe",
                                  "C:\\Windows\\System32\\cmd.exe",
                                  "C:\\Windows\\SysWOW64\\cmd.exe",
                                  "C:\\Windows\\CCM\\CcmExec.exe",
                                  "C:\\Windows\\System32\\svchost.exe",
                                  "C:\\Windows\\System32\\gpscript.exe",
                                  "C:\\Windows\\System32\\wbem\\WmiPrvSE.exe",
                                  "C:\\appian\\java\\bin\\java.exe")) and
not (process.executable : "C:\\Windows\\System32\\cscript.exe" and process.parent.name : ("node.exe", "MicroStrategy Services.exe")) and
not (process.name : "MpCmdRun.exe" and process.parent.name : ("MsMpEng.exe", "MpCmdRun.exe", "svchost.exe")) and
not process.executable : ("C:\\Program Files\\*.exe", "C:\\Program Files (x86)\\*.exe")
'''
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 Machine Learning Detected a Suspicious Windows Event with a Low Malicious Probability Score

The detection leverages a machine learning model to identify potentially suspicious Windows processes with a low likelihood of being malicious, focusing on defense evasion tactics like masquerading. Adversaries may exploit legitimate processes to bypass security measures. This rule flags such events, excluding known benign patterns, to highlight potential threats for further analysis.

### Possible investigation steps

- Review the process details where the problemchild.prediction is 1 and the prediction_probability is less than or equal to 0.98 to understand why the process was flagged as suspicious.
- Check if the process is listed in the blocklist_label as 1, indicating it has been identified as malicious by the model's blocklist.
- Investigate the command-line arguments of the process to identify any unusual or unexpected patterns, excluding known benign patterns such as those involving "C:\\WINDOWS\\temp\\nessus_*.txt" or "C:\\WINDOWS\\temp\\nessus_*.tmp".
- Correlate the flagged process with other system events or logs to determine if it is part of a larger pattern of suspicious activity, focusing on defense evasion tactics like masquerading.
- Assess the parent process and any child processes spawned by the suspicious process to identify potential lateral movement or further malicious activity.
- Consult threat intelligence sources to see if the process or its associated indicators have been reported in recent threat reports or advisories.

### False positive analysis

- Nessus scan files in the Windows temp directory may trigger false positives. Exclude paths like C:\\WINDOWS\\temp\\nessus_*.txt and C:\\WINDOWS\\temp\\nessus_*.tmp to prevent these benign events from being flagged.
- Legitimate software updates or installations might mimic suspicious behavior. Monitor and document regular update schedules to differentiate between expected and unexpected activities.
- System administration scripts that automate tasks can appear suspicious. Identify and whitelist these scripts if they are part of routine operations to avoid unnecessary alerts.
- Custom in-house applications may not be recognized by the model. Work with IT to catalog these applications and create exceptions where necessary to reduce false positives.
- Regularly review and update the blocklist and exception rules to ensure they reflect the current environment and known benign activities.

### Response and remediation

- Isolate the affected system from the network to prevent potential lateral movement by the adversary exploiting the masquerading technique.
- Terminate the suspicious process identified by the machine learning model to halt any ongoing malicious activity.
- Conduct a thorough review of the process's parent and child processes to identify any additional suspicious activities or related processes that may require termination.
- Restore the system from a known good backup if any malicious activity is confirmed, ensuring that the backup is free from compromise.
- Update and patch the system to the latest security standards to close any vulnerabilities that may have been exploited.
- Implement enhanced monitoring for similar masquerading attempts by adjusting alert thresholds or adding specific indicators of compromise (IOCs) related to the detected event.
- Escalate the incident to the security operations center (SOC) or relevant security team for further analysis and to determine if additional systems are affected."""


[[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.004"
name = "Masquerade Task or Service"
reference = "https://attack.mitre.org/techniques/T1036/004/"



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

Stages and Predicates

Stage 1: process

process where ((problemchild.prediction == 1 and problemchild.prediction_probability <= 0.98) or
blocklist_label == 1) and not process.args : ("*C:\\WINDOWS\\temp\\nessus_*.txt*", "*C:\\WINDOWS\\temp\\nessus_*.tmp*") and
process.parent.executable != null and not user.id in ("S-1-5-18", "S-1-5-19", "S-1-5-20") and
not process.parent.name : ("cmd.exe", "powershell.exe") and
not (process.name == "net1.exe" and process.parent.name == "net.exe") and
not (process.parent.executable : "C:\\Windows\\System32\\svchost.exe" and
     process.name : ("UCPDMgr.exe", "sdbinst.exe", "gpupdate.exe", "rundll32.exe", "taskhostw.exe", "taskeng.exe")) and
not (process.name: ("powershell.exe", "cmd.exe", "cscript.exe") and
     process.parent.executable : ("C:\\Program Files\\*.exe",
                                  "C:\\Program Files (x86)\\*.exe",
                                  "C:\\Users\\*\\Documents\\scripts\\nssm-2.24\\win64\\nssm.exe",
                                  "C:\\Windows\\System32\\cmd.exe",
                                  "C:\\Windows\\SysWOW64\\cmd.exe",
                                  "C:\\Windows\\CCM\\CcmExec.exe",
                                  "C:\\Windows\\System32\\svchost.exe",
                                  "C:\\Windows\\System32\\gpscript.exe",
                                  "C:\\Windows\\System32\\wbem\\WmiPrvSE.exe",
                                  "C:\\appian\\java\\bin\\java.exe")) and
not (process.executable : "C:\\Windows\\System32\\cscript.exe" and process.parent.name : ("node.exe", "MicroStrategy Services.exe")) and
not (process.name : "MpCmdRun.exe" and process.parent.name : ("MsMpEng.exe", "MpCmdRun.exe", "svchost.exe")) and
not process.executable : ("C:\\Program Files\\*.exe", "C:\\Program Files (x86)\\*.exe")

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.executableeqC:\Windows\System32\cscript.exeexcludes:process.executable field:"process.executable" value:"C:\Windows\System32\cscript.exe"
process.parent.nameeqnode.exe, MicroStrategy Services.exeexcludes:process.parent.name field:"process.parent.name" value:"node.exe" field:"process.parent.name" value:"MicroStrategy Services.exe"
process.nameeqnet1.exeexcludes:process.name field:"process.name" value:"net1.exe"
process.parent.nameeqnet.exeexcludes:process.parent.name field:"process.parent.name" value:"net.exe"
process.nameeqMpCmdRun.exeexcludes:process.name field:"process.name" value:"MpCmdRun.exe"
process.parent.nameeqMsMpEng.exe, MpCmdRun.exe, svchost.exeexcludes:process.parent.name field:"process.parent.name" value:"MsMpEng.exe" field:"process.parent.name" value:"MpCmdRun.exe" field:"process.parent.name" value:"svchost.exe"
process.nameeqUCPDMgr.exe, sdbinst.exe, gpupdate.exe, rundll32.exe, taskhostw.exe, taskeng.exeexcludes:process.name
process.parent.executableeqC:\Windows\System32\svchost.exeexcludes:process.parent.executable field:"process.parent.executable" value:"C:\Windows\System32\svchost.exe"
process.nameeqpowershell.exe, cmd.exe, cscript.exeexcludes:process.name field:"process.name" value:"powershell.exe" field:"process.name" value:"cmd.exe" field:"process.name" value:"cscript.exe"
process.parent.executablewildcardC:\Program Files\*.exe, C:\Program Files (x86)\*.exe, C:\Users\*\Documents\scripts\nssm-2.24\win64\nssm.exe, C:\Windows\System32\cmd.exe, C:\Windows\SysWOW64\cmd.exe, C:\Windows\CCM\CcmExec.exe, C:\Windows\System32\svchost.exe, C:\Windows\System32\gpscript.exe, C:\Windows\System32\wbem\WmiPrvSE.exe, C:\appian\java\bin\java.exeexcludes:process.parent.executable
process.argswildcard*C:\WINDOWS\temp\nessus_*.txt*, *C:\WINDOWS\temp\nessus_*.tmp*excludes:process.args field:"process.args" value:"*C:\WINDOWS\temp\nessus_*.txt*" field:"process.args" value:"*C:\WINDOWS\temp\nessus_*.tmp*"
process.executablewildcardC:\Program Files\*.exe, C:\Program Files (x86)\*.exeexcludes:process.executable field:"process.executable" value:"C:\Program Files\*.exe" field:"process.executable" value:"C:\Program Files (x86)\*.exe"
process.parent.nameeqcmd.exe, powershell.exeexcludes:process.parent.name field:"process.parent.name" value:"cmd.exe" field:"process.parent.name" value:"powershell.exe"
user.idinS-1-5-18, S-1-5-19, S-1-5-20excludes:user.id field:"user.id" value:"S-1-5-18" field:"user.id" value:"S-1-5-19" field:"user.id" value:"S-1-5-20"

Persistence via Suspicious Launch Agent or Launch Daemon

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

Identifies the creation of a launch agent or daemon property list file containing abnormal or suspicious values. An adversary may establish persistence by installing a new launch agent or daemon which executes at login. This rule looks for plist files created in LaunchAgents/LaunchDaemons directories with paths commonly used by malware.

MITRE ATT&CK Coverage

Rule Body

[metadata]
creation_date = "2026/01/30"
integration = ["endpoint"]
maturity = "production"
updated_date = "2026/06/25"

[rule]
author = ["Elastic"]
description = """
Identifies the creation of a launch agent or daemon property list file containing abnormal or suspicious 
values. An adversary may establish persistence by installing a new launch agent or daemon which executes 
at login. This rule looks for plist files created in LaunchAgents/LaunchDaemons directories with paths 
commonly used by malware.
"""
from = "now-9m"
index = ["logs-endpoint.events.file-*"]
language = "eql"
license = "Elastic License v2"
name = "Persistence via Suspicious Launch Agent or Launch Daemon"
references = [
    "https://medium.com/red-teaming-with-a-blue-team-mentality/a-brief-look-at-macos-detections-and-post-infection-analysis-b0ede7ecfeb9",
    "https://objective-see.org/blog",
    "https://www.elastic.co/security-labs/DPRK-strikes-using-a-new-variant-of-rustbucket"
]
risk_score = 73
rule_id = "62ba8542-1246-4647-9b84-98aa1bc0760a"
severity = "high"
tags = [
    "Domain: Endpoint",
    "OS: macOS",
    "Use Case: Threat Detection",
    "Tactic: Persistence",
    "Data Source: Elastic Defend",
    "Resources: Investigation Guide"
]
timestamp_override = "event.ingested"
type = "eql"
note = """## Triage and analysis

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

### Investigating Persistence via Suspicious Launch Agent or Launch Daemon

LaunchAgents and LaunchDaemons are the standard macOS mechanisms for starting programs automatically at user login or system boot. While essential for legitimate software, these persistence mechanisms are heavily abused by malware including RustBucket (DPRK), Shlayer, and CloudMensis. This detection rule identifies plist file creation in LaunchAgent/LaunchDaemon directories when performed by suspicious processes including scripts executing from temporary directories, unsigned binaries, or scripting interpreters like Python and osascript.

### Possible investigation steps

- Examine the file.path to identify the specific plist file created and its location (user vs system LaunchAgent/LaunchDaemon directory).
- Read the plist contents using plutil or defaults to identify the Program or ProgramArguments configured for execution.
- Analyze the process.executable to understand what created the plist file and assess whether execution from that location (temp directory, hidden folder) is suspicious.
- Check the process.name and process.code_signature fields to determine if the creating process was a scripting interpreter or unsigned binary.
- Locate the binary or script referenced in the plist and calculate its hash for threat intelligence lookups.
- Review the parent process chain to trace back to the initial execution vector that led to plist creation.
- Correlate with other file and process events to identify additional malware components that may have been deployed simultaneously.

### False positive analysis

- Legitimate software installers may create LaunchAgents/LaunchDaemons during setup, but typically from signed installer processes rather than scripts in temp directories.
- Development and testing environments may use scripting languages to create launch items. Verify with development teams if such activities are expected.
- Several legitimate signing IDs are already excluded including vim, JetBrains Toolbox, and Sublime Text.
- System utilities like cfprefsd may modify plist files during normal operations and are excluded.
- Enterprise deployment tools may use scripts to configure launch items. Document and exclude approved deployment processes.

### Response and remediation

- Immediately unload the suspicious LaunchAgent or LaunchDaemon using launchctl unload with the plist path.
- Remove the malicious plist file from the LaunchAgent or LaunchDaemon directory.
- Locate and remove the executable or script referenced in the plist's Program or ProgramArguments keys.
- Check for other persistence mechanisms that may have been deployed by the same threat actor.
- Review system logs for evidence of the persistence mechanism executing and what actions it performed.
- If the detection matches patterns of known malware families (RustBucket, Shlayer), perform comprehensive IOC searches and threat hunting.
- Reset any credentials that may have been accessed while the malicious process was running.
- Monitor for recreation of similar plist files to detect persistent access or ongoing compromise.
"""
query = '''
file where host.os.type == "macos" and event.type != "deletion" and 
  file.extension == "plist" and
  file.path like ("/Library/LaunchAgents/*", "/Library/LaunchDaemons/*", 
                  "/Users/*/Library/LaunchAgents/*", "/System/Library/LaunchAgents/*",
                  "/System/Library/LaunchDaemons/*") and
  (process.executable like ("/private/tmp/*", "/private/var/root/Library/*", "/var/tmp/*", 
                            "/tmp/*", "/var/folders/*", "/Users/Shared/*", "/var/root/*",
                            "/Library/WebServer/*", "/Library/Graphics/*", "/Library/Fonts/*") or
   process.name like~ ("python*", "osascript", "bash", "zsh", "sh", "curl", "nscurl", "wget", "java")) and
  not process.executable like ("/System/*", "/Library/PrivilegedHelperTools/*") and
  not (process.code_signature.signing_id in ("com.apple.vim", "com.apple.cat", "com.apple.cfprefsd",
                                            "com.jetbrains.toolbox", "com.apple.pico", "com.apple.shove",
                                            "com.sublimetext.4", "com.apple.ditto") and process.code_signature.trusted == true) and
  not (file.path like ("/Library/LaunchDaemons/com.jumpcloud.*",
                       "/Library/LaunchAgents/com.jumpcloud.*",
                       "/Library/LaunchDaemons/com.wazuh.*",
                       "/Library/LaunchDaemons/com.zscaler.service.plist") and
       process.executable == "/bin/bash")
'''

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

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

  [[rule.threat.technique]]
  name = "Boot or Logon Autostart Execution"
  id = "T1547"
  reference = "https://attack.mitre.org/techniques/T1547/"

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

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

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

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

Stages and Predicates

Stage 1: file

file where host.os.type == "macos" and event.type != "deletion" and 
  file.extension == "plist" and
  file.path like ("/Library/LaunchAgents/*", "/Library/LaunchDaemons/*", 
                  "/Users/*/Library/LaunchAgents/*", "/System/Library/LaunchAgents/*",
                  "/System/Library/LaunchDaemons/*") and
  (process.executable like ("/private/tmp/*", "/private/var/root/Library/*", "/var/tmp/*", 
                            "/tmp/*", "/var/folders/*", "/Users/Shared/*", "/var/root/*",
                            "/Library/WebServer/*", "/Library/Graphics/*", "/Library/Fonts/*") or
   process.name like~ ("python*", "osascript", "bash", "zsh", "sh", "curl", "nscurl", "wget", "java")) and
  not process.executable like ("/System/*", "/Library/PrivilegedHelperTools/*") and
  not (process.code_signature.signing_id in ("com.apple.vim", "com.apple.cat", "com.apple.cfprefsd",
                                            "com.jetbrains.toolbox", "com.apple.pico", "com.apple.shove",
                                            "com.sublimetext.4", "com.apple.ditto") and process.code_signature.trusted == true) and
  not (file.path like ("/Library/LaunchDaemons/com.jumpcloud.*",
                       "/Library/LaunchAgents/com.jumpcloud.*",
                       "/Library/LaunchDaemons/com.wazuh.*",
                       "/Library/LaunchDaemons/com.zscaler.service.plist") and
       process.executable == "/bin/bash")

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.typene
  • deletion
field:"event.type" kind:ne value:"deletion"
file.extensioneq
  • plist
field:"file.extension" kind:eq value:"plist"
file.pathwildcard
  • /Library/LaunchAgents/*
  • /Library/LaunchDaemons/*
  • /System/Library/LaunchAgents/*
  • /System/Library/LaunchDaemons/*
  • /Users/*/Library/LaunchAgents/*
field:"TargetFilename" kind:wildcard
process.executablewildcard
  • /Library/Fonts/*
  • /Library/Graphics/*
  • /Library/WebServer/*
  • /Users/Shared/*
  • /private/tmp/*
  • /private/var/root/Library/*
  • /tmp/*
  • /var/folders/*
  • /var/root/*
  • /var/tmp/*
field:"Image" kind:wildcard
process.namewildcard
  • bash
  • curl
  • java
  • nscurl
  • osascript
  • python*
  • sh
  • wget
  • zsh
field:"process_basename" kind:wildcard

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
file.pathwildcard/Library/LaunchDaemons/com.jumpcloud.*, /Library/LaunchAgents/com.jumpcloud.*, /Library/LaunchDaemons/com.wazuh.*, /Library/LaunchDaemons/com.zscaler.service.plistexcludes:file.path
process.executableeq/bin/bashexcludes:process.executable field:"process.executable" value:"/bin/bash"
process.code_signature.signing_idincom.apple.cat, com.apple.cfprefsd, com.apple.ditto, com.apple.pico, com.apple.shove, com.apple.vim, com.jetbrains.toolbox, com.sublimetext.4excludes:process.code_signature.signing_id
process.code_signature.trustedeqtrueexcludes:process.code_signature.trusted field:"process.code_signature.trusted" value:"true"
process.executablestarts_with/System/, /Library/PrivilegedHelperTools/excludes:process.executable field:"process.executable" value:"/System/" field:"process.executable" value:"/Library/PrivilegedHelperTools/"

Potential Abuse of Resources by High Token Count and Large Response Sizes

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

Detects potential resource exhaustion or data breach attempts by monitoring for users who consistently generate high input token counts, submit numerous requests, and receive large responses. This behavior could indicate an attempt to overload the system or extract an unusually large amount of data, possibly revealing sensitive information or causing service disruptions.

Known False Positives

  • Authorized heavy usage of the system that is business justified and monitored.

Rule Body

[metadata]
creation_date = "2024/05/04"
integration = ["aws_bedrock"]
maturity = "production"
updated_date = "2025/09/25"

[rule]
author = ["Elastic"]
description = """
Detects potential resource exhaustion or data breach attempts by monitoring for users who consistently generate high
input token counts, submit numerous requests, and receive large responses. This behavior could indicate an attempt to
overload the system or extract an unusually large amount of data, possibly revealing sensitive information or causing
service disruptions.
"""
false_positives = ["Authorized heavy usage of the system that is business justified and monitored."]
from = "now-60m"
interval = "10m"
language = "esql"
license = "Elastic License v2"
name = "Potential Abuse of Resources by High Token Count and Large Response Sizes"
note = """## Triage and analysis

### Investigating Potential Abuse of Resources by High Token Count and Large Response Sizes

Amazon Bedrock is AWS’s managed service that enables developers to build and scale generative AI applications using large foundation models (FMs) from top providers.

Bedrock offers a variety of pretrained models from Amazon (such as the Titan series), as well as models from providers like Anthropic, Meta, Cohere, and AI21 Labs.

#### Possible investigation steps

- Identify the user account that used high prompt token counts and whether it should perform this kind of action.
- Investigate large response sizes and the number of requests made by the user account.
- Investigate other alerts associated with the user account during the past 48 hours.
- Consider the time of day. If the user is a human (not a program or script), did the activity take place during a normal time of day?
- Examine the account's prompts and responses in the last 24 hours.
- If you suspect the account has been compromised, scope potentially compromised assets by tracking Amazon Bedrock model access, prompts generated, and responses to the prompts by the account in the last 24 hours.

### False positive analysis

- Verify the user account that used high prompt and large response sizes, has a business justification for the heavy usage of the system.

### Response and remediation

- Initiate the incident response process based on the outcome of the triage.
- Disable or limit the account during the investigation and response.
- Identify the possible impact of the incident and prioritize accordingly; the following actions can help you gain context:
    - Identify the account role in the cloud environment.
    - Identify if the attacker is moving laterally and compromising other Amazon Bedrock Services.
    - Identify any regulatory or legal ramifications related to this activity.
    - Identify potential resource exhaustion and impact on billing.
- Review the permissions assigned to the implicated user group or role behind these requests to ensure they are authorized and expected to access bedrock and ensure that the least privilege principle is being followed.
- Determine the initial vector abused by the attacker and take action to prevent reinfection via the same vector.
- Using the incident response data, update logging and audit policies to improve the mean time to detect (MTTD) and the mean time to respond (MTTR).
"""
references = [
    "https://atlas.mitre.org/techniques/AML.T0051",
    "https://owasp.org/www-project-top-10-for-large-language-model-applications/",
    "https://www.elastic.co/security-labs/elastic-advances-llm-security",
]
risk_score = 47
rule_id = "b1773d05-f349-45fb-9850-287b8f92f02d"
setup = """## Setup

This rule requires that guardrails are configured in AWS Bedrock. For more information, see the AWS Bedrock documentation:

https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails-create.html
"""
severity = "medium"
tags = [
    "Domain: LLM",
    "Data Source: AWS Bedrock",
    "Data Source: Amazon Web Services",
    "Data Source: AWS S3",
    "Use Case: Potential Overload",
    "Use Case: Resource Exhaustion",
    "Mitre Atlas: LLM04",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "esql"

query = '''
from logs-aws_bedrock.invocation-*

// keep token usage data
| keep
  user.id,
  gen_ai.usage.prompt_tokens,
  gen_ai.usage.completion_tokens

// Aggregate usage metrics
| stats
    Esql.ml_usage_prompt_tokens_max = max(gen_ai.usage.prompt_tokens),
    Esql.ml_invocations_total_count = count(*),
    Esql.ml_usage_completion_tokens_avg = avg(gen_ai.usage.completion_tokens)
  by
    user.id

// Filter for suspicious usage patterns
| where
  Esql.ml_usage_prompt_tokens_max > 5000
  and Esql.ml_invocations_total_count > 10
  and Esql.ml_usage_completion_tokens_avg > 500

// Calculate a custom risk factor
| eval Esql.ml_risk_score =
    (Esql.ml_usage_prompt_tokens_max / 1000) *
    Esql.ml_invocations_total_count *
    (Esql.ml_usage_completion_tokens_avg / 500)

// Filter on risk score
| where Esql.ml_risk_score > 10

// sort high risk users to top
| sort Esql.ml_risk_score desc
'''

Stages and Predicates

Stage 1: from

from logs-aws_bedrock.invocation-*

Stage 2: keep

| keep
  user.id,
  gen_ai.usage.prompt_tokens,
  gen_ai.usage.completion_tokens

Stage 3: stats

| stats
    Esql.ml_usage_prompt_tokens_max = max(gen_ai.usage.prompt_tokens),
    Esql.ml_invocations_total_count = count(*),
    Esql.ml_usage_completion_tokens_avg = avg(gen_ai.usage.completion_tokens)
  by
    user.id

Stage 4: where

| where
  Esql.ml_usage_prompt_tokens_max > 5000
  and Esql.ml_invocations_total_count > 10
  and Esql.ml_usage_completion_tokens_avg > 500

Stage 5: eval

| eval Esql.ml_risk_score =
    (Esql.ml_usage_prompt_tokens_max / 1000) *
    Esql.ml_invocations_total_count *
    (Esql.ml_usage_completion_tokens_avg / 500)

Stage 6: where

| where Esql.ml_risk_score > 10

Stage 7: sort

| sort Esql.ml_risk_score desc

Indicators

These rows show field, operator, and value matches.

Output Fields

These fields are emitted when the rule matches.

FieldSource
Esql.ml_usage_prompt_tokens_maxSTATS Esql.ml_usage_prompt_tokens_max = max(gen_ai.usage.prompt_tokens)
Esql.ml_invocations_total_countSTATS Esql.ml_invocations_total_count = count(*)
Esql.ml_usage_completion_tokens_avgSTATS Esql.ml_usage_completion_tokens_avg = avg(gen_ai.usage.completion_tokens)
user.idSTATS BY
Esql.ml_risk_scoreEVAL (Esql.ml_usage_prompt_tokens_max / 1000) * Esql.ml_invocations_total_count * (Esql.ml_usage_completion_tokens_avg / 500)

Potential Image Load with a Spoofed Creation Time

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

Identifies the load of a library with a modified file creation time. Adversaries may modify file time attributes to blend malicious content with existing files. Timestomping is a technique that modifies the timestamps of a file often to mimic files that are in trusted directories.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
Identifies the load of a library with a modified file creation time. Adversaries may modify file time attributes to
blend malicious content with existing files. Timestomping is a technique that modifies the timestamps of a file often to
mimic files that are in trusted directories.
"""
id = "69b2dd59-13ba-4bda-8d0d-cf0e28eb1323"
license = "Elastic License v2"
name = "Potential Image Load with a Spoofed Creation Time"
os_list = ["windows"]
reference = [
    "https://attack.mitre.org/techniques/T1070/006/",
    "https://posts.specterops.io/revisiting-ttps-timestomper-622d4c28a655",
    "https://www.elastic.co/security-labs/Hunting-for-Suspicious-Windows-Libraries-for-Execution-and-Evasion",
]
version = "1.0.32"

query = '''
sequence with maxspan=5m
 [file where event.action == "creation" and file.Ext.header_bytes : "4d5a*" and

  not user.id : "S-1-5-18" and

  file.path : ("?:\\Windows\\system32\\*", "?:\\Windows\\SysWOW64\\*", "?:\\Program Files\\Microsoft\\*",
               "?:\\Program Files (x86)\\Microsoft\\*", "?:\\Users\\Public\\*", "?:\\ProgramData\\*",
               "?:\\Program Files\\Google\\Chrome\\*.dll", "?:\\Program Files\\Internet Explorer\\*.dll",
               "?:\\Program Files\\Mozilla Firefox\\*.dll") and

  not process.executable :
             ("?:\\Windows\\system32\\msiexec.exe",
              "?:\\Windows\\SysWOW64\\msiexec.exe",
              "?:\\windows\\system32\\drvinst.exe",
              "?:\\windows\\SysWOW64\\drvinst.exe",
              "C:\\Windows\\System32\\Robocopy.exe",
              "?:\\Program Files (x86)\\*.exe",
              "?:\\Program Files\\*.exe",
              "?:\\Windows\\System32\\DriverStore\\FileRepository\\*.exe") and

  not (process.code_signature.subject_name : ("Mozilla Corporation", "Google LLC", "JACK HENRY & ASSOCIATES, INC.") and 
       process.code_signature.trusted == true) and
  not file.path : ("?:\\ProgramData\\chocolatey\\tools\\detector\\*.dll",
                    "?:\\ProgramData\\chocolatey\\tools\\*.dll",
                    "?:\\ProgramData\\chocolatey\\lib\\*") and
  not (process.name : "xcopy.exe" and file.extension == "pyd")
  ] by file.path as event0
 [library where

  /* set to 6months, malwares often spoof creation times to at least 1 years */
  dll.Ext.relative_file_creation_time >= 15778476 and

  /* 5m */
  dll.Ext.relative_file_name_modify_time <= 300 and

  not dll.code_signature.status : ("trusted", "errorExpired", "errorCode_endpoint*") and

  dll.path : ("?:\\Windows\\system32\\*", "?:\\Windows\\SysWOW64\\*", "?:\\Program Files\\Microsoft\\*",
               "?:\\Program Files (x86)\\Microsoft\\*", "?:\\Users\\Public\\*", "?:\\ProgramData\\*",
               "?:\\Program Files\\Google\\Chrome\\*.dll", "?:\\Program Files\\Internet Explorer\\*.dll",
               "?:\\Program Files\\Mozilla Firefox\\*.dll") and

  not startswith~(dll.name, process.name) and

  event0.process.executable != process.executable and

  not (process.executable : ("?:\\Program Files\\*", "?:\\Program Files (x86)\\*") and
       not process.executable : ("?:\\Program Files*\\Microsoft\\*.exe", "?:\\Program Files*\\Google\\Chrome\\*.exe",
                                 "?:\\Program Files*\\Internet Explorer\\*.exe", "?:\\Program Files*\\Mozilla Firefox\\*.exe")) and

  not dll.hash.sha256 :
             ("9ac63dcf5a2437ed43cb143479ec4a810915017d8eb138a7fede88867e2a8121",
              "8bbe5898caa826ac1cb99d6c01c8a5ee9bb660493d2a48c9294d837390f7bae2",
              "42a0d4dca77d4ce7077c18e08b1d49715d6b1038e147611106388aec3e422c82",
              "6e12069312e286307a12ba71228e720e890d242191eb07d0e769630b600098b3",
              "0ae555e24450606fe86938be0450310e8d0da7cd8b661ed79c6f4dc6747cfd95",
              "8180f736781f2af47059a83c73c2c8b9f4423fc764c8897ac7c4f6dd8837a804",
              "c3823447efb2fe8690861541f23890bf5b7a36f40a9c282f4cb33cc3bb3d4689",
              "6324bf7d034935c2781fcef00a9c7b414ffdba4578f5368e09dc892cd49e3ecd",
              "6948e30a0d0eac9584071430d93f4e49645cbaf73ef821d723de6bc00ff13f79",
              "a11c83a10cdcfec7eea0a81ebbcb057513549897c1bdf559dcfb108ace06277f",
              "cd125611cdb5f3a74ee952951a692ee598daa5a7491e87676a4f68930117bb2a",
              "f9032348386637e55788348dc8ed5879daee978be8ab77cd42b0316427d6fbc8",
              "1a45f5985273d2372a352c07db6a15382780d6fce47d36195c6d1c5822c169b7",
              "53b7f8c0e4cb7bc41535985b114a04e7ad95c272a89e193119606e6160974ad5",
              "81c3bfbac5b40c20b4f6408de6b4afc5559517f100d8cb01f9a8f6805026ecf0",
              "e0d2c341e9c16d31e60ffdcbb5f84d49212f5fe695b41c9982eee3e9be5d07d8",
              "19112c6eef7ffc162245d7e19c8601fa49ccd239076ac32d3fe0ad9d0afb3e0b",
              "3430b3680415b494ba7eb41f7bc83933da68d364a94287b9c07384b2fe3dcb54",
              "aa106076e82a3acc62184d51817ae6619da0772cc964530fd843302d29ffb97d",
              "3016d572ea5e695b52b1759432dd30b7a9cbc2b53ac42e8c7735854b464e7d34",
              "b49f071ff276262190c6cc86dceab4936a4786428a834151a17b6845911748e8",
              "4a8fac0d6b09cc3fb57fd063af8b1a332080df5b0e2ff3710a82c109a4eee07c",
              "1ec927f25e4fcd1b5863fe3a0a60c2e8800467d5ed5148a917503b9cb6e9acf8",
              "9a75fd5816a220ab15248f0f337dfe5385fd053617c17742005cb63f126a11b0",
              "51075af59f6696d5dc5446ba39fabfd0022628cdcfa41c80e7cb66e3bf4ee55d",
              "585e2e465bf77e3daa25de7dcba5fac0606ae4a0e029903158d85ae0b1805f34",
              "a575175338706d1473e2bebe1cd811283c63c697a17c0865de85ede345898af6",
              "8dd93adc6e06cb7a404d259e59b644ad49b69a5d4215de607baf659fabfb2c4c") and
  not (process.code_signature.subject_name : ("Epicor Software Corporation", "KONICA MINOLTA, INC.", "3CX Ltd",
                                              "WZT", "Tendyron Corporation", "INTUIT INC.",
                                              "MEDENT (Community Computer Service Inc.)", "Pitney Bowes Inc.",
                                              "Bedford, Freeman & Worth Publishing Group, LLC",
                                              "PFU Limited",
                                              "Watchdata Technologies Pte. Ltd.",
                                              "WINMAN SOFTWARE INDIA LLP",
                                              "Voicebrook Inc",
                                              "CHENGDU YIWO Tech Development Co., Ltd.",
                                              "Benner Sistemas S/A",
                                              "Daybreak Game Company LLC",
                                              "CANON INC.",
                                              "Halliburton Company",
                                              "Mozilla Corporation") and
       process.code_signature.trusted == true) and
  not (dll.code_signature.subject_name : ("Mozilla Corporation", "Google LLC") and dll.code_signature.trusted == true) and
  not process.executable : "?:\\Windows\\SysWOW64\\regsvr32.exe"
  ] by dll.path
'''

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

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

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1070"
name = "Indicator Removal"
reference = "https://attack.mitre.org/techniques/T1070/"
[[threat.technique.subtechnique]]
id = "T1070.006"
name = "Timestomp"
reference = "https://attack.mitre.org/techniques/T1070/006/"



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

[internal]
min_endpoint_version = "8.4.0"

Stages and Predicates

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

Stage 1: file

[file where event.action == "creation" and file.Ext.header_bytes : "4d5a*" and

  not user.id : "S-1-5-18" and

  file.path : ("?:\\Windows\\system32\\*", "?:\\Windows\\SysWOW64\\*", "?:\\Program Files\\Microsoft\\*",
               "?:\\Program Files (x86)\\Microsoft\\*", "?:\\Users\\Public\\*", "?:\\ProgramData\\*",
               "?:\\Program Files\\Google\\Chrome\\*.dll", "?:\\Program Files\\Internet Explorer\\*.dll",
               "?:\\Program Files\\Mozilla Firefox\\*.dll") and

  not process.executable :
             ("?:\\Windows\\system32\\msiexec.exe",
              "?:\\Windows\\SysWOW64\\msiexec.exe",
              "?:\\windows\\system32\\drvinst.exe",
              "?:\\windows\\SysWOW64\\drvinst.exe",
              "C:\\Windows\\System32\\Robocopy.exe",
              "?:\\Program Files (x86)\\*.exe",
              "?:\\Program Files\\*.exe",
              "?:\\Windows\\System32\\DriverStore\\FileRepository\\*.exe") and

  not (process.code_signature.subject_name : ("Mozilla Corporation", "Google LLC", "JACK HENRY & ASSOCIATES, INC.") and 
       process.code_signature.trusted == true) and
  not file.path : ("?:\\ProgramData\\chocolatey\\tools\\detector\\*.dll",
                    "?:\\ProgramData\\chocolatey\\tools\\*.dll",
                    "?:\\ProgramData\\chocolatey\\lib\\*") and
  not (process.name : "xcopy.exe" and file.extension == "pyd")
  ] by file.path as event0

Stage 2: library

[library where
  dll.Ext.relative_file_creation_time >= 15778476 and
  dll.Ext.relative_file_name_modify_time <= 300 and
  not dll.code_signature.status : ("trusted", "errorExpired", "errorCode_endpoint*") and
  dll.path : ("?:\\Windows\\system32\\*", "?:\\Windows\\SysWOW64\\*", "?:\\Program Files\\Microsoft\\*",
               "?:\\Program Files (x86)\\Microsoft\\*", "?:\\Users\\Public\\*", "?:\\ProgramData\\*",
               "?:\\Program Files\\Google\\Chrome\\*.dll", "?:\\Program Files\\Internet Explorer\\*.dll",
               "?:\\Program Files\\Mozilla Firefox\\*.dll") and
  not startswith~(dll.name, process.name) and
  event0.process.executable != process.executable and
  not (process.executable : ("?:\\Program Files\\*", "?:\\Program Files (x86)\\*") and
       not process.executable : ("?:\\Program Files*\\Microsoft\\*.exe", "?:\\Program Files*\\Google\\Chrome\\*.exe",
                                 "?:\\Program Files*\\Internet Explorer\\*.exe", "?:\\Program Files*\\Mozilla Firefox\\*.exe")) and
  not dll.hash.sha256 :
             ("9ac63dcf5a2437ed43cb143479ec4a810915017d8eb138a7fede88867e2a8121",
              "8bbe5898caa826ac1cb99d6c01c8a5ee9bb660493d2a48c9294d837390f7bae2",
              "42a0d4dca77d4ce7077c18e08b1d49715d6b1038e147611106388aec3e422c82",
              "6e12069312e286307a12ba71228e720e890d242191eb07d0e769630b600098b3",
              "0ae555e24450606fe86938be0450310e8d0da7cd8b661ed79c6f4dc6747cfd95",
              "8180f736781f2af47059a83c73c2c8b9f4423fc764c8897ac7c4f6dd8837a804",
              "c3823447efb2fe8690861541f23890bf5b7a36f40a9c282f4cb33cc3bb3d4689",
              "6324bf7d034935c2781fcef00a9c7b414ffdba4578f5368e09dc892cd49e3ecd",
              "6948e30a0d0eac9584071430d93f4e49645cbaf73ef821d723de6bc00ff13f79",
              "a11c83a10cdcfec7eea0a81ebbcb057513549897c1bdf559dcfb108ace06277f",
              "cd125611cdb5f3a74ee952951a692ee598daa5a7491e87676a4f68930117bb2a",
              "f9032348386637e55788348dc8ed5879daee978be8ab77cd42b0316427d6fbc8",
              "1a45f5985273d2372a352c07db6a15382780d6fce47d36195c6d1c5822c169b7",
              "53b7f8c0e4cb7bc41535985b114a04e7ad95c272a89e193119606e6160974ad5",
              "81c3bfbac5b40c20b4f6408de6b4afc5559517f100d8cb01f9a8f6805026ecf0",
              "e0d2c341e9c16d31e60ffdcbb5f84d49212f5fe695b41c9982eee3e9be5d07d8",
              "19112c6eef7ffc162245d7e19c8601fa49ccd239076ac32d3fe0ad9d0afb3e0b",
              "3430b3680415b494ba7eb41f7bc83933da68d364a94287b9c07384b2fe3dcb54",
              "aa106076e82a3acc62184d51817ae6619da0772cc964530fd843302d29ffb97d",
              "3016d572ea5e695b52b1759432dd30b7a9cbc2b53ac42e8c7735854b464e7d34",
              "b49f071ff276262190c6cc86dceab4936a4786428a834151a17b6845911748e8",
              "4a8fac0d6b09cc3fb57fd063af8b1a332080df5b0e2ff3710a82c109a4eee07c",
              "1ec927f25e4fcd1b5863fe3a0a60c2e8800467d5ed5148a917503b9cb6e9acf8",
              "9a75fd5816a220ab15248f0f337dfe5385fd053617c17742005cb63f126a11b0",
              "51075af59f6696d5dc5446ba39fabfd0022628cdcfa41c80e7cb66e3bf4ee55d",
              "585e2e465bf77e3daa25de7dcba5fac0606ae4a0e029903158d85ae0b1805f34",
              "a575175338706d1473e2bebe1cd811283c63c697a17c0865de85ede345898af6",
              "8dd93adc6e06cb7a404d259e59b644ad49b69a5d4215de607baf659fabfb2c4c") and
  not (process.code_signature.subject_name : ("Epicor Software Corporation", "KONICA MINOLTA, INC.", "3CX Ltd",
                                              "WZT", "Tendyron Corporation", "INTUIT INC.",
                                              "MEDENT (Community Computer Service Inc.)", "Pitney Bowes Inc.",
                                              "Bedford, Freeman & Worth Publishing Group, LLC",
                                              "PFU Limited",
                                              "Watchdata Technologies Pte. Ltd.",
                                              "WINMAN SOFTWARE INDIA LLP",
                                              "Voicebrook Inc",
                                              "CHENGDU YIWO Tech Development Co., Ltd.",
                                              "Benner Sistemas S/A",
                                              "Daybreak Game Company LLC",
                                              "CANON INC.",
                                              "Halliburton Company",
                                              "Mozilla Corporation") and
       process.code_signature.trusted == true) and
  not (dll.code_signature.subject_name : ("Mozilla Corporation", "Google LLC") and dll.code_signature.trusted == true) and
  not process.executable : "?:\\Windows\\SysWOW64\\regsvr32.exe"
  ] by dll.path

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
dll.Ext.relative_file_creation_timege
  • 15778476 transforms: number
field:"dll.Ext.relative_file_creation_time" kind:ge value:"15778476"
dll.Ext.relative_file_name_modify_timele
  • 300 transforms: number corpus 2 (elastic 2)
field:"dll.Ext.relative_file_name_modify_time" kind:le value:"300"
dll.pathwildcard
  • ?:\Program Files (x86)\Microsoft\*
  • ?:\Program Files\Google\Chrome\*.dll
  • ?:\Program Files\Internet Explorer\*.dll
  • ?:\Program Files\Microsoft\*
  • ?:\Program Files\Mozilla Firefox\*.dll
  • ?:\ProgramData\*
  • ?:\Users\Public\*
  • ?:\Windows\SysWOW64\*
  • ?:\Windows\system32\*
field:"ImageLoaded" kind:wildcard
event.actioneq
  • creation corpus 50 (elastic 50)
field:"EventType" kind:eq value:"creation"
event0.process.executablene
  • process.executable (field reference)
field:"event0.process.executable" kind:ne value:"process.executable"
file.Ext.header_byteswildcard
  • 4d5a* corpus 45 (elastic 45)
field:"file.Ext.header_bytes" kind:wildcard value:"4d5a*"
file.pathwildcard
  • ?:\Program Files (x86)\Microsoft\*
  • ?:\Program Files\Google\Chrome\*.dll
  • ?:\Program Files\Internet Explorer\*.dll
  • ?:\Program Files\Microsoft\*
  • ?:\Program Files\Mozilla Firefox\*.dll
  • ?:\ProgramData\* corpus 3 (elastic 3)
  • ?:\Users\Public\* corpus 3 (elastic 3)
  • ?:\Windows\SysWOW64\* corpus 2 (elastic 2)
  • ?:\Windows\system32\* corpus 2 (elastic 2)
field:"TargetFilename" kind:wildcard
process.executablewildcard
  • ?:\Program Files*\Google\Chrome\*.exe
  • ?:\Program Files*\Internet Explorer\*.exe
  • ?:\Program Files*\Microsoft\*.exe
  • ?:\Program Files*\Mozilla Firefox\*.exe
field:"Image" kind:wildcard

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
file.extensioneqpydexcludes:file.extension field:"file.extension" value:"pyd"
process.nameeqxcopy.exeexcludes:process.name field:"process.name" value:"xcopy.exe"
process.code_signature.subject_nameeqMozilla Corporation, Google LLC, JACK HENRY & ASSOCIATES, INC.excludes:process.code_signature.subject_name field:"process.code_signature.subject_name" value:"Mozilla Corporation" field:"process.code_signature.subject_name" value:"Google LLC" field:"process.code_signature.subject_name" value:"JACK HENRY & ASSOCIATES, INC."
process.code_signature.trustedeqtrueexcludes:process.code_signature.trusted field:"process.code_signature.trusted" value:"true"
file.pathwildcard?:\ProgramData\chocolatey\tools\detector\*.dll, ?:\ProgramData\chocolatey\tools\*.dll, ?:\ProgramData\chocolatey\lib\*excludes:file.path field:"file.path" value:"?:\ProgramData\chocolatey\tools\detector\*.dll" field:"file.path" value:"?:\ProgramData\chocolatey\tools\*.dll" field:"file.path" value:"?:\ProgramData\chocolatey\lib\*"
process.executablewildcard?:\Windows\system32\msiexec.exe, ?:\Windows\SysWOW64\msiexec.exe, ?:\windows\system32\drvinst.exe, ?:\windows\SysWOW64\drvinst.exe, C:\Windows\System32\Robocopy.exe, ?:\Program Files (x86)\*.exe, ?:\Program Files\*.exe, ?:\Windows\System32\DriverStore\FileRepository\*.exeexcludes:process.executable
user.ideqS-1-5-18excludes:user.id field:"user.id" value:"S-1-5-18"
process.executablewildcard?:\Program Files*\Microsoft\*.exe, ?:\Program Files*\Google\Chrome\*.exe, ?:\Program Files*\Internet Explorer\*.exe, ?:\Program Files*\Mozilla Firefox\*.exeexcludes:process.executable
process.executablestarts_with?:\Program Files\, ?:\Program Files (x86)\excludes:process.executable field:"process.executable" value:"?:\Program Files\" field:"process.executable" value:"?:\Program Files (x86)\"
dll.code_signature.subject_nameeqMozilla Corporation, Google LLCexcludes:dll.code_signature.subject_name field:"dll.code_signature.subject_name" value:"Mozilla Corporation" field:"dll.code_signature.subject_name" value:"Google LLC"
dll.code_signature.trustedeqtrueexcludes:dll.code_signature.trusted field:"dll.code_signature.trusted" value:"true"
process.code_signature.subject_nameeqEpicor Software Corporation, KONICA MINOLTA, INC., 3CX Ltd, WZT, Tendyron Corporation, INTUIT INC., MEDENT (Community Computer Service Inc.), Pitney Bowes Inc., Bedford, Freeman & Worth Publishing Group, LLC, PFU Limited, Watchdata Technologies Pte. Ltd., WINMAN SOFTWARE INDIA LLP, Voicebrook Inc, CHENGDU YIWO Tech Development Co., Ltd., Benner Sistemas S/A, Daybreak Game Company LLC, CANON INC., Halliburton Company, Mozilla Corporationexcludes:process.code_signature.subject_name
dll.code_signature.statuswildcardtrusted, errorExpired, errorCode_endpoint*excludes:dll.code_signature.status field:"dll.code_signature.status" value:"trusted" field:"dll.code_signature.status" value:"errorExpired" field:"dll.code_signature.status" value:"errorCode_endpoint*"
dll.hash.sha256eq9ac63dcf5a2437ed43cb143479ec4a810915017d8eb138a7fede88867e2a8121, 8bbe5898caa826ac1cb99d6c01c8a5ee9bb660493d2a48c9294d837390f7bae2, 42a0d4dca77d4ce7077c18e08b1d49715d6b1038e147611106388aec3e422c82, 6e12069312e286307a12ba71228e720e890d242191eb07d0e769630b600098b3, 0ae555e24450606fe86938be0450310e8d0da7cd8b661ed79c6f4dc6747cfd95, 8180f736781f2af47059a83c73c2c8b9f4423fc764c8897ac7c4f6dd8837a804, c3823447efb2fe8690861541f23890bf5b7a36f40a9c282f4cb33cc3bb3d4689, 6324bf7d034935c2781fcef00a9c7b414ffdba4578f5368e09dc892cd49e3ecd, 6948e30a0d0eac9584071430d93f4e49645cbaf73ef821d723de6bc00ff13f79, a11c83a10cdcfec7eea0a81ebbcb057513549897c1bdf559dcfb108ace06277f, cd125611cdb5f3a74ee952951a692ee598daa5a7491e87676a4f68930117bb2a, f9032348386637e55788348dc8ed5879daee978be8ab77cd42b0316427d6fbc8, 1a45f5985273d2372a352c07db6a15382780d6fce47d36195c6d1c5822c169b7, 53b7f8c0e4cb7bc41535985b114a04e7ad95c272a89e193119606e6160974ad5, 81c3bfbac5b40c20b4f6408de6b4afc5559517f100d8cb01f9a8f6805026ecf0, e0d2c341e9c16d31e60ffdcbb5f84d49212f5fe695b41c9982eee3e9be5d07d8, 19112c6eef7ffc162245d7e19c8601fa49ccd239076ac32d3fe0ad9d0afb3e0b, 3430b3680415b494ba7eb41f7bc83933da68d364a94287b9c07384b2fe3dcb54, aa106076e82a3acc62184d51817ae6619da0772cc964530fd843302d29ffb97d, 3016d572ea5e695b52b1759432dd30b7a9cbc2b53ac42e8c7735854b464e7d34, b49f071ff276262190c6cc86dceab4936a4786428a834151a17b6845911748e8, 4a8fac0d6b09cc3fb57fd063af8b1a332080df5b0e2ff3710a82c109a4eee07c, 1ec927f25e4fcd1b5863fe3a0a60c2e8800467d5ed5148a917503b9cb6e9acf8, 9a75fd5816a220ab15248f0f337dfe5385fd053617c17742005cb63f126a11b0, 51075af59f6696d5dc5446ba39fabfd0022628cdcfa41c80e7cb66e3bf4ee55d, 585e2e465bf77e3daa25de7dcba5fac0606ae4a0e029903158d85ae0b1805f34, a575175338706d1473e2bebe1cd811283c63c697a17c0865de85ede345898af6, 8dd93adc6e06cb7a404d259e59b644ad49b69a5d4215de607baf659fabfb2c4cexcludes:dll.hash.sha256
dll.namestarts_withprocess.nameexcludes:dll.name field:"dll.name" value:"process.name"
process.executableeq?:\Windows\SysWOW64\regsvr32.exeexcludes:process.executable field:"process.executable" value:"?:\Windows\SysWOW64\regsvr32.exe"

Potential Sudo Token Manipulation via Process Injection

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

This rule detects potential sudo token manipulation attacks through process injection by monitoring the use of a debugger (gdb) process followed by a successful uid change event during the execution of the sudo process. A sudo token manipulation attack is performed by injecting into a process that has a valid sudo token, which can then be used by attackers to activate their own sudo token. This attack requires ptrace to be enabled in conjunction with the existence of a living process that has a valid sudo token with the same uid as the current user.

MITRE ATT&CK Coverage

Rule Body

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

[rule]
author = ["Elastic"]
description = """
This rule detects potential sudo token manipulation attacks through process injection by monitoring the use of a
debugger (gdb) process followed by a successful uid change event during the execution of the sudo process. A sudo token
manipulation attack is performed by injecting into a process that has a valid sudo token, which can then be used by
attackers to activate their own sudo token. This attack requires ptrace to be enabled in conjunction with the existence
of a living process that has a valid sudo token with the same uid as the current user.
"""
from = "now-9m"
index = ["logs-endpoint.events.process*"]
language = "eql"
license = "Elastic License v2"
name = "Potential Sudo Token Manipulation via Process Injection"
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 Sudo Token Manipulation via Process Injection

In Linux environments, process injection can be exploited by adversaries to manipulate sudo tokens, allowing unauthorized privilege escalation. Attackers may use debugging tools like gdb to inject code into processes with valid sudo tokens, leveraging ptrace capabilities. The detection rule identifies this threat by monitoring for gdb execution followed by a uid change in the sudo process, indicating potential token manipulation.

### Possible investigation steps

- Review the alert details to identify the specific host and process session leader entity ID involved in the potential sudo token manipulation.
- Examine the process tree on the affected host to trace the parent and child processes of the gdb execution, focusing on any unusual or unauthorized processes.
- Check the system logs for any recent sudo commands executed by the user associated with the gdb process to determine if there were any unauthorized privilege escalations.
- Investigate the user account associated with the gdb process to verify if it has legitimate reasons to use debugging tools and if it has been compromised.
- Analyze the timing and context of the uid change event in the sudo process to assess if it aligns with legitimate administrative activities or if it appears suspicious.
- Review the system's ptrace settings to ensure they are configured securely and assess if there have been any recent changes that could have enabled this attack vector.

### False positive analysis

- Debugging activities by developers or system administrators using gdb for legitimate purposes can trigger this rule. To manage this, create exceptions for specific user IDs or groups known to perform regular debugging tasks.
- Automated scripts or maintenance tools that utilize gdb for process analysis might cause false positives. Identify these scripts and exclude their associated process names or paths from the rule.
- System monitoring or security tools that perform uid changes as part of their normal operation could be mistaken for malicious activity. Review and whitelist these tools by their process names or specific user IDs.
- Training or testing environments where sudo and gdb are used frequently for educational purposes may generate alerts. Consider excluding these environments by host ID or network segment to reduce noise.
- Scheduled tasks or cron jobs that involve gdb and sudo processes might inadvertently match the rule criteria. Analyze these tasks and exclude them based on their execution times or specific process attributes.

### Response and remediation

- Immediately isolate the affected host from the network to prevent further unauthorized access or privilege escalation.
- Terminate any suspicious gdb and sudo processes identified in the alert to stop ongoing process injection attempts.
- Conduct a thorough review of the affected system's process and user activity logs to identify any unauthorized changes or access patterns.
- Reset credentials and sudo tokens for all users on the affected system to prevent further exploitation using compromised tokens.
- Apply security patches and updates to the affected system to address any vulnerabilities that may have been exploited.
- Re-enable ptrace restrictions if they were previously disabled, to limit the ability of attackers to perform process injection.
- Escalate the incident to the security operations team for further investigation and to assess the potential impact on other systems within the network."""
references = ["https://github.com/nongiach/sudo_inject"]
risk_score = 47
rule_id = "ff9bc8b9-f03b-4283-be58-ee0a16f5a11b"
setup = """## Setup

This rule requires data coming in from Elastic Defend.

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

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

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

query = '''
sequence by host.id, process.session_leader.entity_id with maxspan=15s
[ process where host.os.type == "linux" and event.type == "start" and event.action == "exec" and
  process.name == "gdb" and process.user.id != "0" and process.group.id != "0" ]
[ process where host.os.type == "linux" and event.action == "uid_change" and event.type == "change" and
  process.name == "sudo" and process.user.id == "0" and process.group.id == "0" ]
'''


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

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

[[rule.threat.technique.subtechnique]]
id = "T1055.008"
name = "Ptrace System Calls"
reference = "https://attack.mitre.org/techniques/T1055/008/"

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

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

[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 = "T1055"
name = "Process Injection"
reference = "https://attack.mitre.org/techniques/T1055/"

[[rule.threat.technique.subtechnique]]
id = "T1055.008"
name = "Ptrace System Calls"
reference = "https://attack.mitre.org/techniques/T1055/008/"

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

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

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

Stages and Predicates

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

Stage 1: process

[ process where host.os.type == "linux" and event.type == "start" and event.action == "exec" and
  process.name == "gdb" and process.user.id != "0" and process.group.id != "0" ]

Stage 2: process

[ process where host.os.type == "linux" and event.action == "uid_change" and event.type == "change" and
  process.name == "sudo" and process.user.id == "0" and process.group.id == "0" ]

Indicators

These rows show field, operator, and value matches.

Suspicious .NET Code Compilation

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

Identifies executions of .NET compilers with suspicious parent processes, which can indicate an attacker's attempt to compile code after delivery in order to bypass security mechanisms.

MITRE ATT&CK Coverage

Telemetry Coverage

Rule Body

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

[rule]
author = ["Elastic"]
description = """
Identifies executions of .NET compilers with suspicious parent processes, which can indicate an attacker's attempt to
compile code after delivery in order to bypass security mechanisms.
"""
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 = "Suspicious .NET Code Compilation"
note = """## Triage and analysis

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

### Investigating Suspicious .NET Code Compilation

.NET compilers like `csc.exe` and `vbc.exe` are integral to compiling C# and VB.NET code, respectively, in Windows environments. Adversaries exploit these compilers by executing them with unusual parent processes, such as scripting engines or system utilities, to compile malicious code stealthily. The detection rule identifies such anomalies by monitoring compiler executions initiated by suspicious parent processes, signaling potential evasion or execution tactics.

### Possible investigation steps

- Review the process tree to understand the relationship between the suspicious parent process (e.g., wscript.exe, mshta.exe) and the .NET compiler process (csc.exe or vbc.exe) to determine if the execution flow is typical or anomalous.
- Examine the command-line arguments used by the .NET compiler process to identify any potentially malicious code or scripts being compiled.
- Check the user account associated with the process execution to determine if it aligns with expected behavior or if it indicates potential compromise or misuse.
- Investigate the source and integrity of the parent process executable to ensure it has not been tampered with or replaced by a malicious version.
- Correlate the event with other security alerts or logs from the same host or user to identify any patterns or additional indicators of compromise.
- Analyze network activity from the host around the time of the alert to detect any suspicious outbound connections that may indicate data exfiltration or command-and-control communication.

### False positive analysis

- Legitimate software development activities may trigger this rule if developers use scripting engines or system utilities to automate the compilation of .NET code. To manage this, identify and whitelist known development environments or scripts that frequently compile code using these methods.
- System administrators might use scripts or automation tools that invoke .NET compilers for maintenance tasks. Review and document these processes, then create exceptions for recognized administrative scripts to prevent unnecessary alerts.
- Some enterprise applications may use .NET compilers as part of their normal operation, especially if they dynamically generate or compile code. Investigate these applications and exclude their processes from the rule if they are verified as non-threatening.
- Security tools or monitoring solutions might simulate suspicious behavior for testing purposes, which could trigger this rule. Coordinate with your security team to identify such tools and exclude their activities from detection.
- In environments where custom scripts are frequently used for deployment or configuration, ensure these scripts are reviewed and, if safe, added to an exclusion list to reduce false positives.

### Response and remediation

- Immediately isolate the affected system from the network to prevent further execution or spread of potentially malicious code.
- Terminate any suspicious processes identified, such as `csc.exe` or `vbc.exe`, that are running with unusual parent processes.
- Conduct a thorough scan of the isolated system using updated antivirus and endpoint detection tools to identify and remove any malicious files or remnants.
- Review and analyze the execution logs to determine the source and scope of the threat, focusing on the parent processes like `wscript.exe` or `mshta.exe` that initiated the compiler execution.
- Restore the system from a known good backup if malicious activity is confirmed and cannot be fully remediated through cleaning.
- Implement application whitelisting to prevent unauthorized execution of compilers and scripting engines by non-standard parent processes.
- Escalate the incident to the security operations center (SOC) or incident response team for further investigation and to assess the need for broader organizational response measures."""
risk_score = 47
rule_id = "201200f1-a99b-43fb-88ed-f65a45c4972c"
severity = "medium"
tags = [
    "Domain: Endpoint",
    "OS: Windows",
    "Use Case: Threat Detection",
    "Tactic: Defense Evasion",
    "Tactic: Execution",
    "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",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"

query = '''
process where host.os.type == "windows" and event.type == "start" and
  process.name : ("csc.exe", "vbc.exe") and
  process.parent.name : ("wscript.exe", "mshta.exe", "cscript.exe", "wmic.exe", "svchost.exe", "rundll32.exe", "cmstp.exe", "regsvr32.exe")
'''

setup = """## Setup

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

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

### Additional data sources

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

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


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

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

[[rule.threat.technique.subtechnique]]
id = "T1027.004"
name = "Compile After Delivery"
reference = "https://attack.mitre.org/techniques/T1027/004/"

[[rule.threat.technique]]
id = "T1127"
name = "Trusted Developer Utilities Proxy Execution"
reference = "https://attack.mitre.org/techniques/T1127/"

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

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

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

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

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

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

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

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

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

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

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

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

Stages and Predicates

Stage 1: process

process where host.os.type == "windows" and event.type == "start" and
  process.name : ("csc.exe", "vbc.exe") and
  process.parent.name : ("wscript.exe", "mshta.exe", "cscript.exe", "wmic.exe", "svchost.exe", "rundll32.exe", "cmstp.exe", "regsvr32.exe")

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.typeeq
  • start corpus 1036 (elastic 1036)
field:"event.type" kind:eq value:"start"
process.namewildcard
  • csc.exe corpus 12 (elastic 11, splunk 1)
  • vbc.exe corpus 8 (elastic 8)
field:"process_basename" kind:wildcard
process.parent.namewildcard
  • cmstp.exe corpus 2 (elastic 2)
  • cscript.exe corpus 16 (elastic 15, splunk 1)
  • mshta.exe corpus 24 (elastic 22, splunk 2)
  • regsvr32.exe corpus 13 (elastic 13)
  • rundll32.exe corpus 20 (elastic 20)
  • svchost.exe corpus 15 (elastic 10, splunk 5)
  • wmic.exe corpus 4 (elastic 3, splunk 1)
  • wscript.exe corpus 24 (elastic 23, splunk 1)
field:"parent_process_basename" kind:wildcard

Suspicious CertUtil Commands

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

Identifies suspicious commands being used with certutil.exe. CertUtil is a native Windows component which is part of Certificate Services. CertUtil is often abused by attackers to live off the land for stealthier command and control or data exfiltration.

MITRE ATT&CK Coverage

Telemetry Coverage

Rule Body

[metadata]
creation_date = "2020/02/18"
integration = ["endpoint", "windows", "system", "m365_defender", "sentinel_one_cloud_funnel", "crowdstrike"]
maturity = "production"
updated_date = "2026/05/04"

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

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

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

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


[rule]
author = ["Elastic", "Austin Songer"]
description = """
Identifies suspicious commands being used with certutil.exe. CertUtil is a native Windows component which is part of
Certificate Services. CertUtil is often abused by attackers to live off the land for stealthier command and control or
data exfiltration.
"""
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 = "Suspicious CertUtil Commands"
note = """## Triage and analysis

### Investigating Suspicious CertUtil Commands

`certutil.exe` is a command line utility program that is included with Microsoft Windows operating systems. It is used to manage and manipulate digital certificates and certificate services on computers running Windows.

Attackers can abuse `certutil.exe` utility to download and/or deobfuscate malware, offensive security tools, and certificates from external sources to take the next steps in a compromised environment. This rule identifies command line arguments used to accomplish these behaviors.

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

#### Possible investigation steps

- Investigate the script execution chain (parent process tree) for unknown processes. Examine their executable files for prevalence, whether they are located in expected locations, and if they are signed with valid digital signatures.
- Investigate other alerts associated with the user/host during the past 48 hours.
- Examine the command line to determine the nature of the execution.
  - If files were downloaded, retrieve them and check whether they were run, and under which security context.
  - If files were obfuscated or deobfuscated, retrieve them.
- Examine the host for derived artifacts that indicate suspicious activities:
  - Analyze the involved files using a private sandboxed analysis system.
  - Observe and collect information about the following activities in both the sandbox and the alert subject host:
    - Attempts to contact external domains and addresses.
      - Use the Elastic Defend network events to determine domains and addresses contacted by the subject process by filtering by the process' `process.entity_id`.
      - Examine the DNS cache for suspicious or anomalous entries.
        - $osquery_0
    - Use the Elastic Defend registry events to examine registry keys accessed, modified, or created by the related processes in the process tree.
    - Examine the host services for suspicious or anomalous entries.
      - $osquery_1
      - $osquery_2
      - $osquery_3
  - Retrieve the files' SHA-256 hash values using the PowerShell `Get-FileHash` cmdlet and search for the existence and reputation of the hashes in resources like VirusTotal, Hybrid-Analysis, CISCO Talos, Any.run, etc.

### False positive analysis

- If this rule is noisy in your environment due to expected activity, consider adding exceptions — preferably with a combination of user and command line conditions.

### Response and remediation

- Initiate the incident response process based on the outcome of the triage.
- Isolate the involved host to prevent further post-compromise behavior.
- If the triage identified malware, search the environment for additional compromised hosts.
  - Implement temporary network rules, procedures, and segmentation to contain the malware.
  - Stop suspicious processes.
  - Immediately block the identified indicators of compromise (IoCs).
  - Inspect the affected systems for additional malware backdoors like reverse shells, reverse proxies, or droppers that attackers could use to reinfect the system.
- Remove and block malicious artifacts identified during triage.
- Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
- Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
- Using the incident response data, update logging and audit policies to improve the mean time to detect (MTTD) and the mean time to respond (MTTR).
"""

setup = """## Setup

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

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

### Additional data sources

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

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

references = [
    "https://twitter.com/Moriarty_Meng/status/984380793383370752",
    "https://twitter.com/egre55/status/1087685529016193025",
    "https://www.sysadmins.lv/blog-en/certutil-tips-and-tricks-working-with-x509-file-format.aspx",
    "https://docs.microsoft.com/en-us/archive/blogs/pki/basic-crl-checking-with-certutil",
    "https://www.elastic.co/security-labs/siestagraph-new-implant-uncovered-in-asean-member-foreign-ministry",
]
risk_score = 47
rule_id = "fd70c98a-c410-42dc-a2e3-761c71848acf"
severity = "medium"
tags = [
    "Domain: Endpoint",
    "OS: Windows",
    "Use Case: Threat Detection",
    "Tactic: Defense Evasion",
    "Data Source: Elastic Endgame",
    "Resources: Investigation Guide",
    "Data Source: Elastic Defend",
    "Data Source: Windows Security Event Logs",
    "Data Source: Microsoft Defender XDR",
    "Data Source: Sysmon",
    "Data Source: SentinelOne",
    "Data Source: Crowdstrike",
]
timeline_id = "e70679c2-6cde-4510-9764-4823df18f7db"
timeline_title = "Comprehensive Process Timeline"
timestamp_override = "event.ingested"
type = "eql"

query = '''
process where host.os.type == "windows" and event.type == "start" and
  (process.name : "certutil.exe" or ?process.pe.original_file_name == "CertUtil.exe") and
  process.args : ("?decode", "?encode", "?urlcache", "?verifyctl", "?encodehex", "?decodehex", "?exportPFX")
'''


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

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

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

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

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

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

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

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

Stages and Predicates

Stage 1: process

process where host.os.type == "windows" and event.type == "start" and
  (process.name : "certutil.exe" or ?process.pe.original_file_name == "CertUtil.exe") and
  process.args : ("?decode", "?encode", "?urlcache", "?verifyctl", "?encodehex", "?decodehex", "?exportPFX")

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.typeeq
  • start corpus 1036 (elastic 1036)
field:"event.type" kind:eq value:"start"
process.argswildcard
  • ?decode
  • ?decodehex
  • ?encode
  • ?encodehex
  • ?exportPFX
  • ?urlcache
  • ?verifyctl
field:"process.args" kind:wildcard
process.namewildcard
  • certutil.exe corpus 45 (elastic 39, splunk 6)
field:"process_basename" kind:wildcard value:"certutil.exe"
process.pe.original_file_nameeq
  • CertUtil.exe corpus 5 (elastic 5)
field:"OriginalFileName" kind:eq value:"CertUtil.exe"

Suspicious Command Execution via Windows Run

#
Source
github.com/elastic/protections-artifacts

Identifies the execution of Windows commands via the Windows Run window. Adversaries may use phishing to instruct the victim to copy and paste malicious commands for execution via the Windows Run menu.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
Identifies the execution of Windows commands via the Windows Run window. Adversaries may use phishing to instruct the
victim to copy and paste malicious commands for execution via the Windows Run menu.
"""
id = "f4f436c8-5c4a-4f61-b0cc-17b154920887"
license = "Elastic License v2"
name = "Suspicious Command Execution via Windows Run"
os_list = ["windows"]
reference = [
    "https://www.cloudsek.com/blog/unmasking-the-danger-lumma-stealer-malware-exploits-fake-captcha-pages",
]
version = "1.0.9"

query = '''
process where event.action == "start" and
 (
   process.name : ("cmd.exe", "powershell.exe", "curl.exe", "msiexec.exe", "mshta.exe", "wscript.exe", "cscript.exe") or 
   (process.name : "rundll32.exe" and process.command_line : "*\\\\*@*,*")
 ) and
 process.parent.name : "explorer.exe" and process.args_count >= 2 and
 (
  process.parent.thread.Ext.call_stack_summary like "ntdll.dll|kernelbase.dll|kernel32.dll|windows.storage.dll|shell32.dll|user32.dll|shell32.dll|explorer.exe|shcore.dll|*" or
  (process.parent.thread.Ext.call_stack_summary like "*|user32.dll|shell32.dll|explorer.exe|shcore.dll|*" and
   _arraysearch(process.parent.thread.Ext.call_stack, $entry, 
                $entry.symbol_info like ("C:\\Windows\\System32\\user32.dll!DialogBoxParamW*", 
                                         "C:\\Windows\\System32\\user32.dll!DialogBoxIndirectParamW*", 
                                         "C:\\Windows\\System32\\shell32.dll!GetFileNameFromBrowse*")))
 ) and
 not (process.name : "cmd.exe" and
      process.args : ("*.bat*", "*.cmd", "dir", "ipconfig", "C:\\WINDOWS\\system32\\sconfig.cmd ", "Code\\bin\\code.cmd ", "mkdir",
                      "C:\\Users\\*.cmd ")) and
 not (process.name : "powershell.exe" and process.args : ("Start-Process powershell -Verb RunAs", "C:\\*.ps1", "-SPLAGroup", "\\\\*\\netlogon\\*.ps1")) and
 not (process.name : "msiexec.exe" and process.args : "?:\\*.msi") and
 not process.command_line : ("\"C:\\WINDOWS\\system32\\cmd.exe\" /k net use",
                             "\"C:\\WINDOWS\\system32\\cmd.exe\" -a",
                             "\"C:\\WINDOWS\\system32\\cmd.exe\" /c start terminal",
                             "\"C:\\WINDOWS\\system32\\cmd.exe\" D:\\",
                             "\"C:\\WINDOWS\\system32\\cmd.exe\" /admin",
                             "\"C:\\Windows\\system32\\msiexec.exe\" /regserver",
                             "\"C:\\WINDOWS\\system32\\cmd.exe\" /c start WindowsTerminal",
                             "\"C:\\WINDOWS\\system32\\cmd.exe\" /c start chrome --app=D:\\Notify\\index.html",
                             "\"C:\\windows\\system32\\WindowsPowerShell\\v1.0\\PowerShell.exe\" -ep bypass",
                             "\"C:\\WINDOWS\\system32\\WindowsPowerShell\\v1.0\\PowerShell.exe\" ise",
                             "\"C:\\WINDOWS\\system32\\WindowsPowerShell\\v1.0\\PowerShell.exe\" -Command Start-Process PowerShell -Verb RunAs",
                             "C:\\WINDOWS\\system32\\cmd.exe /c \"\"C:\\Users\\*\\AppData\\Roaming\\npm\\*z.cmd\" \"",
                             "\"C:\\WINDOWS\\system32\\WindowsPowerShell\\v1.0\\PowerShell.exe\" -ExecutionPolicy Bypass") and
 not (process.name : ("wscript.exe", "cscript.exe") and process.args : ("\\\\*\\MapNetworkDrives.vbs", "?:\\*.js", "?:\\*.vbs")) and
 not (process.name : "powershell.exe" and process.args : "-command" and process.args : "vnc") and
 not (process.name : ("msiexec.exe", "powershell.exe", "wscript.exe") and process.working_directory : "\\\\*") and
 not (process.name : "msiexec.exe" and process.args :  "\\\\*\\SYSVOL\\*.msi")
'''

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 = "T1566"
name = "Phishing"
reference = "https://attack.mitre.org/techniques/T1566/"


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

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


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


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

[internal]
min_endpoint_version = "8.10.0"

Stages and Predicates

Stage 1: process

process where event.action == "start" and
 (
   process.name : ("cmd.exe", "powershell.exe", "curl.exe", "msiexec.exe", "mshta.exe", "wscript.exe", "cscript.exe") or 
   (process.name : "rundll32.exe" and process.command_line : "*\\\\*@*,*")
 ) and
 process.parent.name : "explorer.exe" and process.args_count >= 2 and
 (
  process.parent.thread.Ext.call_stack_summary like "ntdll.dll|kernelbase.dll|kernel32.dll|windows.storage.dll|shell32.dll|user32.dll|shell32.dll|explorer.exe|shcore.dll|*" or
  (process.parent.thread.Ext.call_stack_summary like "*|user32.dll|shell32.dll|explorer.exe|shcore.dll|*" and
   _arraysearch(process.parent.thread.Ext.call_stack, $entry, 
                $entry.symbol_info like ("C:\\Windows\\System32\\user32.dll!DialogBoxParamW*", 
                                         "C:\\Windows\\System32\\user32.dll!DialogBoxIndirectParamW*", 
                                         "C:\\Windows\\System32\\shell32.dll!GetFileNameFromBrowse*")))
 ) and
 not (process.name : "cmd.exe" and
      process.args : ("*.bat*", "*.cmd", "dir", "ipconfig", "C:\\WINDOWS\\system32\\sconfig.cmd ", "Code\\bin\\code.cmd ", "mkdir",
                      "C:\\Users\\*.cmd ")) and
 not (process.name : "powershell.exe" and process.args : ("Start-Process powershell -Verb RunAs", "C:\\*.ps1", "-SPLAGroup", "\\\\*\\netlogon\\*.ps1")) and
 not (process.name : "msiexec.exe" and process.args : "?:\\*.msi") and
 not process.command_line : ("\"C:\\WINDOWS\\system32\\cmd.exe\" /k net use",
                             "\"C:\\WINDOWS\\system32\\cmd.exe\" -a",
                             "\"C:\\WINDOWS\\system32\\cmd.exe\" /c start terminal",
                             "\"C:\\WINDOWS\\system32\\cmd.exe\" D:\\",
                             "\"C:\\WINDOWS\\system32\\cmd.exe\" /admin",
                             "\"C:\\Windows\\system32\\msiexec.exe\" /regserver",
                             "\"C:\\WINDOWS\\system32\\cmd.exe\" /c start WindowsTerminal",
                             "\"C:\\WINDOWS\\system32\\cmd.exe\" /c start chrome --app=D:\\Notify\\index.html",
                             "\"C:\\windows\\system32\\WindowsPowerShell\\v1.0\\PowerShell.exe\" -ep bypass",
                             "\"C:\\WINDOWS\\system32\\WindowsPowerShell\\v1.0\\PowerShell.exe\" ise",
                             "\"C:\\WINDOWS\\system32\\WindowsPowerShell\\v1.0\\PowerShell.exe\" -Command Start-Process PowerShell -Verb RunAs",
                             "C:\\WINDOWS\\system32\\cmd.exe /c \"\"C:\\Users\\*\\AppData\\Roaming\\npm\\*z.cmd\" \"",
                             "\"C:\\WINDOWS\\system32\\WindowsPowerShell\\v1.0\\PowerShell.exe\" -ExecutionPolicy Bypass") and
 not (process.name : ("wscript.exe", "cscript.exe") and process.args : ("\\\\*\\MapNetworkDrives.vbs", "?:\\*.js", "?:\\*.vbs")) and
 not (process.name : "powershell.exe" and process.args : "-command" and process.args : "vnc") and
 not (process.name : ("msiexec.exe", "powershell.exe", "wscript.exe") and process.working_directory : "\\\\*") and
 not (process.name : "msiexec.exe" and process.args :  "\\\\*\\SYSVOL\\*.msi")

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • start corpus 388 (elastic 388)
field:"EventType" kind:eq value:"start"
process.args_countge
  • 2 transforms: number corpus 18 (elastic 18)
field:"process.args_count" kind:ge value:"2"
process.command_linewildcard
  • *\\*@*,* corpus 2 (elastic 2)
field:"CommandLine" kind:wildcard value:"*\\*@*,*"
process.namewildcard
  • cmd.exe corpus 122 (elastic 93, splunk 29)
  • cscript.exe corpus 68 (elastic 66, splunk 2)
  • curl.exe corpus 34 (elastic 32, splunk 2)
  • mshta.exe corpus 84 (elastic 80, splunk 4)
  • msiexec.exe corpus 45 (elastic 40, splunk 5)
  • powershell.exe corpus 187 (elastic 140, splunk 44, kusto 3)
  • rundll32.exe corpus 123 (elastic 100, splunk 23)
  • wscript.exe corpus 84 (elastic 82, splunk 1, kusto 1)
field:"process_basename" kind:wildcard
process.parent.namewildcard
  • explorer.exe corpus 50 (elastic 50)
field:"parent_process_basename" kind:wildcard value:"explorer.exe"
process.parent.thread.Ext.call_stack_summarywildcard
  • *|user32.dll|shell32.dll|explorer.exe|shcore.dll|*
  • ntdll.dll|kernelbase.dll|kernel32.dll|windows.storage.dll|shell32.dll|user32.dll|shell32.dll|explorer.exe|shcore.dll|*
field:"process.parent.thread.Ext.call_stack_summary" kind:wildcard

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.argseq-commandexcludes:process.args field:"process.args" value:"-command"
process.argseqvncexcludes:process.args field:"process.args" value:"vnc"
process.nameeqpowershell.exeexcludes:process.name field:"process.name" value:"powershell.exe"
process.argswildcard*.bat*, *.cmd, dir, ipconfig, C:\WINDOWS\system32\sconfig.cmd , Code\bin\code.cmd , mkdir, C:\Users\*.cmd excludes:process.args
process.nameeqcmd.exeexcludes:process.name field:"process.name" value:"cmd.exe"
process.argswildcard?:\*.msiexcludes:process.args field:"process.args" value:"?:\*.msi"
process.nameeqmsiexec.exeexcludes:process.name field:"process.name" value:"msiexec.exe"
process.argswildcardStart-Process powershell -Verb RunAs, C:\*.ps1, -SPLAGroup, \\*\netlogon\*.ps1excludes:process.args
process.argswildcard\\*\MapNetworkDrives.vbs, ?:\*.js, ?:\*.vbsexcludes:process.args field:"process.args" value:"\\*\MapNetworkDrives.vbs" field:"process.args" value:"?:\*.js" field:"process.args" value:"?:\*.vbs"
process.nameeqwscript.exe, cscript.exeexcludes:process.name field:"process.name" value:"wscript.exe" field:"process.name" value:"cscript.exe"
process.argswildcard\\*\SYSVOL\*.msiexcludes:process.args field:"process.args" value:"\\*\SYSVOL\*.msi"
process.nameeqmsiexec.exe, powershell.exe, wscript.exeexcludes:process.name field:"process.name" value:"msiexec.exe" field:"process.name" value:"powershell.exe" field:"process.name" value:"wscript.exe"
process.working_directorystarts_with\\excludes:process.working_directory field:"process.working_directory" value:"\\"
process.command_linewildcard"C:\WINDOWS\system32\cmd.exe" /k net use, "C:\WINDOWS\system32\cmd.exe" -a, "C:\WINDOWS\system32\cmd.exe" /c start terminal, "C:\WINDOWS\system32\cmd.exe" D:\, "C:\WINDOWS\system32\cmd.exe" /admin, "C:\Windows\system32\msiexec.exe" /regserver, "C:\WINDOWS\system32\cmd.exe" /c start WindowsTerminal, "C:\WINDOWS\system32\cmd.exe" /c start chrome --app=D:\Notify\index.html, "C:\windows\system32\WindowsPowerShell\v1.0\PowerShell.exe" -ep bypass, "C:\WINDOWS\system32\WindowsPowerShell\v1.0\PowerShell.exe" ise, "C:\WINDOWS\system32\WindowsPowerShell\v1.0\PowerShell.exe" -Command Start-Process PowerShell -Verb RunAs, C:\WINDOWS\system32\cmd.exe /c ""C:\Users\*\AppData\Roaming\npm\*z.cmd" ", "C:\WINDOWS\system32\WindowsPowerShell\v1.0\PowerShell.exe" -ExecutionPolicy Bypassexcludes:process.command_line

Suspicious ImageLoad via Windows CertOC

#
Source
github.com/elastic/protections-artifacts

Identifies abuse of the Microsoft CertOC utility to load an arbitrary DLL. This behavior is used as a defense evasion technique to blend-in malicious activity with legitimate Windows software.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
Identifies abuse of the Microsoft CertOC utility to load an arbitrary DLL. This behavior is used as a defense evasion
technique to blend-in malicious activity with legitimate Windows software.
"""
id = "6fcbf73f-4413-4689-be33-61b0d6bd0ffc"
license = "Elastic License v2"
name = "Suspicious ImageLoad via Windows CertOC"
os_list = ["windows"]
reference = ["https://lolbas-project.github.io/lolbas/Binaries/Certoc/"]
version = "1.0.24"

query = '''
process where event.action == "start" and
  (process.pe.original_file_name == "CertOC.exe" or process.name : "certoc.exe") and process.args : "-LoadDLL"
'''

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

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

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


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

[internal]
min_endpoint_version = "7.15.0"

Stages and Predicates

Stage 1: process

process where event.action == "start" and
  (process.pe.original_file_name == "CertOC.exe" or process.name : "certoc.exe") and process.args : "-LoadDLL"

Indicators

These rows show field, operator, and value matches.

Suspicious Remote Process Suspend Activity

#
Source
github.com/elastic/protections-artifacts

Identifies attempts to suspend a remote process via NtSuspendProcess or a remote thread via SuspendThread and where the target process is not a child process. Adversaries may use this technique to suspend endpoint security processes or hijack the execution flow of a running process.

MITRE ATT&CK Coverage

TacticTechniques
Defense Impairment

Rule Body

[rule]
description = """
Identifies attempts to suspend a remote process via NtSuspendProcess or a remote thread via SuspendThread and where the
target process is not a child process. Adversaries may use this technique to suspend endpoint security processes or
hijack the execution flow of a running process.
"""
id = "9e533f20-733e-4d71-bbe5-2ab5939aaf57"
license = "Elastic License v2"
name = "Suspicious Remote Process Suspend Activity"
os_list = ["windows"]
version = "1.0.21"

query = '''
api where process.Ext.api.name in ("NtSuspendProcess", "SuspendThread") and process.executable != null and

 process.Ext.api.behaviors == "cross-process" and process.Ext.api.behaviors != "parent-child" and

 Target.process.Ext.token.integrity_level_name != "low" and

 process.Ext.api.summary != null and

 (process.thread.Ext.call_stack_final_user_module.hash.sha256 != null or process.thread.Ext.call_stack_final_user_module.name : "Unbacked") and

 /* provenance metadata exists */
 process.thread.Ext.call_stack_final_user_module.name != null and

 /* skip signed */
 not _arraysearch(process.thread.Ext.call_stack_final_user_module.code_signature, $entry, $entry.trusted == true) and

 /* excluding kernel and unknown */
 not process.thread.Ext.call_stack_final_user_module.name : ("Kernel", "Unknown", "Undetermined") and

 not process.thread.Ext.call_stack_final_user_module.protection_provenance : "Unknown" and

 not process.thread.Ext.call_stack_final_user_module.path :
                                   ("c:\\program files (x86)\\*", "c:\\program files\\*",
                                    "c:\\windows\\assembly\\nativeimages_*\\system.directoryservices.ni.dll",
                                    "c:\\windows\\assembly\\nativeimages_v*\\miguicontrols\\*\\miguicontrols.ni.dll",
                                    "C:\\windows\\system32\\crashcollector.exe", "c:\\windows\\system32\\crashcollector.exe") and

 not process.thread.Ext.call_stack_final_user_module.hash.sha256 :
                        (
                         "6847711e7782729fac009ede5fc3ea5ed6ca54ff582eed3386c1f74d83e1a372",
                         "fdef73d692e2e181075bf43a05cd7ebe551f6b1be31f4d471ff709f83a549612",
                         "0e29025fd573a9d818d05a124f83b6fbe74bbb7c37b8149b43f577d5a74d2f02",
                         "3ca49b11a6b12e9efe8b12076d46f4c1c6e9b4fea44f7e572766a7845c6c24a3",
                         "921b33e55f4a7c806fc1e0547398545ae943fa341ed0e8dc29b4c71d49ecac1a",
                         "bf0a9f2845bc536de2693177e93c67a9467ba992cb08f9c66e34912f60fb910d",
                         "e3101d0ebb2656193086f9ebd53563a6cfd802226d13cdb434d4fb89b2cbab7d", 
                         "9045446fe2a4d4e2807e309e47c75c297dd766d934ca60bf0dabb45dda1857c7", 
                         "fed8a5e8e77bf2099334d7bd55b127027b1048c5039aba3825161f07fb8e0889",
                         "ca02e8e2e60491b0fdf52071bea067c3bf5f12fbddb59ef73d6aa54dc6780606",
                         "418a7dc57d5ac225d7f012fe90a1668a797fde56c9add6c3aad841ab0c1e2bc1",
                         "d74adfbaa1a63bdb0089ecaf1500bcc578118c9b4f648ed09883d76232603737",
                         "224b1025c51438d2ce9343d15d3afc32698187c81dbde28e99a80d042ac8a0b9",
                         "e65e63d51b8fe0eeee53918ddb2a8105b5e396f52341074a7997bbed43311cec",
                         "b792d1243950e98d460fb5541fffc723d097d23cfa6830d70673cbea86623afb",
                         "d7cc5804450a1be697c37440059b97e0911fb20d2ef068bfb458b54c46866151",
                         "d5685e38faccdf97ce6ffe4cf53cbfcf48bb20bf83abe316fba81d1abd093cb6",
                         "4b3e16f6df41a2600ddde4769123151cd7c9dcf88b0d30c2e14cfad81f717529",
                         "e825a252b5c5c9c2de8a6a6ade12a7f9cd0040f6a20e6ee44ba659034e6d5223",
                         "5ae5860e24c1e9604efaedb9f57b733feff2a978b23a16751ba1f31ecc62aa6f",
                         "71deb0afa24ddcb687951026e871121556cf114960833a38a00a8c07e9086357",
                         "f6268995735c5aa33dc02e696992ecb0afda879170b90d3333a7ef27165b045f",
                         "d94ad7bcd32ec7b48fe76a4293205c6eb17191b7882a631ccb4eeabee2a96bca",
                         "ec673caa0c703cc3084887824b800502cd45b4a365c2f8d6cbc5175f0e938e1e",
                         "ad76892733513d2f88eeb61ea18a9594defa52a82eab4fca0202752f651307af",
                         "4a23537d3523441a06b705bca6a7bd601c450b17a0586d669b07fd86c1dc0962",
                         "02bec18f77442249a7099ce975e81d7cb22481dd91717b5e5ae5b8fc62b95899",
                         "bc30b686e6c101b1fd4c52caca31e01227fcea8dfe683de4abcd047ec2acca38",
                         "a995140e5ee8d00e571c19654d4628a11a74b5804768da6e147c559fa3747e23",
                         "94bb9904694212c5b1fd037bf10af23557129862626e1dc45b719926be69690b",
                         "024e8872d37aa6656057abbbdc87a6d5e62f2e3d59c9d6de91fbea00e25407ae",
                         "9783d83df9cce5aa741b47495d48c62c1cb2d4521e4ba0c9d059e7f241dd0186",
                         "c6d97ee3652cfc438830ca0e18e7ea96462fa09505ae0ce4ac422950c1272e81",
                         "ccae2a12091763da594e0ceb83e3aa438bccf2449b2dc91c916232ba2117ae22",
                         "b2a99e7f7f7d0edba76da01959988b3b006b9741d1617e7e290b74866a494cdc",
                         "a41d8d34646abd09ef570b8c87a8d36f19a2cffcbe77ea5d1128d6206851c9d8",
                         "e0037ab4d9764fffad985ed44468b93c8dc9aed366a25a651c83e9c5d6f99fc7",
                         "40949e20630ce1c955f0911995de98c3772828c9a37f257c01a29ed62b5be072",
                         "928bd69d852de58f8cf42a37f79c7f4769000ba8ed1c918717d6430be531f5c7",
                         "b72ba56ae1e3f1c81904f837f98b5c7e054da66923236ce2270fd2fa501bb427",
                         "a82b08fb68efd8d93b7849b7180ad414f98c24a5ba56f431dc7a7ff572c6db72",
                         "a6992d2b1ebc09656a991a8337abefb46c9c4376088a97ddf0e3fe50dd1a80c3",
                         "8e67ae6684baca7f02857efc5463bc1da94506ea20577d9e1c0860a0c02a07a1",
                         "76d338198d607ac1432157b18f85367f402b5404983a2c9ca071062e4dcdba33",
                         "838d44c0a68c5d849a582b5f36e33db2dca89e743ce48e6af68df31c8ac93e26",
                         "2e85b02876568f7e1c9a61075373f98e7e754de6acc6ff0e6b847b598f3a66f5",
                         "27c7d20101e03ec0850cdd58f89b8d5e8494e8c0790919c778947ca14ee68a0d",
                         "c12ade1fc56f70f780e4ed0175dd74da5c8b28807b57de9ba25ee376e4f37533",
                         "a94f89d7829129fe15722723a8a41295aca9f1be4d4a531d19fd7a470c282511",
                         "3db86e281aba8818f67ae4026ec184952791896450c4505515e2bf0787aa47f6",
                         "38da0d335a49473fe31894c02aef49ae053abb7951c5307ccbbb314c7b8601b7",
                         "92c068146977d26a656c462af52dba4ce6e36b21ea5787b1fbf778414c3b6f75",
                         "ac8c1db990bd2c5612b2929c097ed5c3e4bc047158d9d7a39c57723c614dd51e",
                         "6a05773105b10471c6d1b3ee9044b5d161bc6b5d2a9fbbde5d4bc217c58c003d",
                         "9ef2eeb69dfcbfe53cae8727f7f48ec580c4da4a22f84952353159a74ebef566",
                         "6b766ffee9ee5ebeee3830a90870afca99a79e7611fd81f2e4afab009513a3dc",
                         "ca8e711eab79c01a3618039370b4434faebe32b1f0143aebef786da0a53cb031",
                         "6cb3d7575d70a9c23fd2480fa0f973ff633844b7ca4261af607e1188bdb52d10",
                         "3413cfc1180ca6948b1ddf3595148e17ef4b4552297e595cb4281b63dbd4515b",
                         "c90796c07e8febb88895c41d2efff0b31fd6b75448909222a47c42d038851e8a",
                         "d0fd1d51c6f211610768b17be7940d24c1d0c170fffb84e3683d3aa837a2ce8a",
                         "6645b5bc9db6514dd8eab204193c95fd6af4836da1b4b2814cdd703081013ece",
                         "14b052ca942fe7045ed56015a5a292d82d80fb3a88d67f15807a5b433a6c2c2c",
                         "c1bfa6b7da76de1143f8db9a53db49063b85bf1e0b26f4d5c617f1bb23f4fb9d",
                         "e3fdcd2b4c5215e74b0cabe91ce7fe2800cbf8e2a28157342960bca61bbd6b5d",
                         "c1bfa6b7da76de1143f8db9a53db49063b85bf1e0b26f4d5c617f1bb23f4fb9d",
                         "5fe0752c103820b17baa9f8a18a381701217ab1631e80800221f2b32d4c889dd",
                         "6d9bef59e10a848541c81157fa1147cce88dccdddd58a20a4e3410aaddfcb1da",
                         "bd6843726688bd7253a42180bf95671ad5b0f9e787adb4f13250f484abd9eae4",
                         "5ba254c1219707934f81b2037b9efb76716edba6e3c4c9666b615bf4cf146d25",
                         "6351a660b57d8b394c15b4e715ce1a2e0332e29f7458db1497062f55551e94d9",
                         "7300120d19b64fa3a774c7dd7a3104ec3520fa99040913522b14520069f49328",
                         "9e33a1e70193ffde452cb8b1a58044531840b2e319342c000ad0c405d94495b8",
                         "69860a487c2bddefa5951076f6112081db159026ca8ff11ab906e13cecb9d299",
                         "4e4b9bcef90731eb9b1306610fc89ba31296a5875ff5ba628f7271130aa61280",
                         "0ebf7d62158317d644c0eb9d15ba504034abd5484a7df2b10ed409bcbf95f8cf",
                         "14da1fbca85ff2b8ac19ab63f4b7019614865ce8d87bce68100c97174b786ff5",
                         "0f7fd870dd2e7272b92ea5dfe88b2662d859818459a3d2c1e9d669aa1a7dddc2",
                         "9fe9a49cfdf8e5764a264c19a11bb123d5bd9f1d11dbc469709b5a8178ec8f8b",
                         "a09f8a37fb83c759598d57fd6b7d33b1fb75f6b5855f1e74c3303df4b36529b1",
                         "6c6abf6e4c7439b853b27fbf542aba0b9c042d39cc317580fe7d55e65d4375e0",
                         "6eed2886728608f1b3f4a54a7a7d338ef1b1669f6f53a5d38bcd352f0ec755c9",
                         "73de63385d6778896e85b672e056ec10040531c83c0872329cfa1ec1e6e10cec",
                         "cea088ae798d2a4a82dc4cdc1b5c1333daf3be26f651319e2215c87e3c7c3bf3",
                         "56a5148d00c2d9e58415be2d64eca922a58063fe26d9af1c87084aa383c9058e",
                         "83ee0ff920144edb2c2f4ea10130f55443493290886985a63233fa2431e450f9",
                         "f4063507bb92ca017b3ce48cd1b2c029d9393c924af1a10c7720884c74c3cc36",
                         "8052a09fb953cd6dbd529bc0fd8313a8806efe5f4b2370d3bedc1c6edfb319f7",
                         "92f102f6bcbe7e03d8f0beac15ed4de396f09952786c8b632477dae15349ca3e",
                         "71b49d2c08f4d9b5952e44ef06846556c944c14ecff4bc2a4071e67921473e46",
                         "379952ec8113b3692872ffb9d07c242968ee1edfac9b3b888496c1480033be91",
                         "aac5bb07168d5a66e21b69dd68f630d7a06fd27be5409daace1d74af244bb60a",
                         "93b98ec9c3da8c9bc422cff03736ed92f3ed51e2b984a38bf19cca80e15b8c76",
                         "011eb5a6789080192f66cc04c2ceecf57ce867bd854a5b8d530a04f41f50a570",
                         "85ebda733d373181ad89d3b5b34d06d3bcd3003c1d7aa07da6d4dc337ff6180f",
                         "6d41389d80d5308f60b1a856dbd38172500b589acd99fb5532f16f4fc31caada",
                         "48229a57d9a45bef840ade321135cf2d0fb41412a397c0ec9c7eed918c8c967f",
                         "afb9e9f543b2e286d4967a7795d2bb3f31c0b37066494bd68eda2d1570d8ebba",
                         "7ba928d7ed3c0b3659410ed06cf8a3e0f0c875e4edfd7691ce0b646ff41489ad",
                         "afcf23763c3ee1dc16ad80fbdded635bd896b0817997273b18375ac7e0059a18",
                         "dfa736b6a8a9a7eed8e7b546c2c7f8109add4db799521b27f2ec04ddbad70d86",
                         "9d569291755f1937996aecbe32fc5d8df656d0cf4122d4c10130938dfd2229fd",
                         "e6b7e45f7a6375f51e1b675b547c48cc44ba543c7081790f102b658c7626f8e6",
                         "8cbfed45a28e410551411cdd6b6329862ed88cf4476b0aafccea5e4fc16e91e8",
                         "a40e2533a200e9e8f29ccf937b05efc92cc4b56251758d978cf73c83f265a014",
                         "fce8c609368c54a21e87dee938a5b3ee3fa910658856b8b28e8d86794c09374e",
                         "d67886a8dee423035ec807b04227aa6c8b8101a8a5e122cfd49f5901668a94ad",
                         "a587142ad5ffdbd852eed2a25f1f4e4cfd41ce82aee290aff5143093352e581e",
                         "c2101b8c881e165c2ba9a02efd3a529d86bf8825f2eefab0fe5d3c5cef736fb6",
                         "e2049b19974678e2e6cf38da5f7cec1e0199e0b3e03606a3b97bd15d796a5971",
                         "22bc08bf0cec3e84d410e114de0d653c12c20f743ed955f7fc0848f218f47a8d",
                         "7d4a6781df906d745569beb38f09f1711cde80dc69ba94083cb805adb3208f58",
                         "f97e4e8a8753608de13d7b4948aeb7f206829a3218007f5f049de151a75be22c",
                         "389b9caaef229a1d08ce4e65835438e8a0200664e547b8f16688287f82c240ce",
                         "1d403006ac76665391a294578678f23634d5699525ecc589fad808cbf8284030",
                         "70adb308b63b5f02126672cd6d89d830c47b19d1c48d55a13cb4f530a4716e6a",
                         "a3272147ae66166bc1edf8fac3e245e7ab8a2f882efaa52ba6679f96faec5545",
                         "e9b488ad3101d386a3b2248db0c0dfe43c83fd856c55d181264da762f5352f38",
                         "bd9b92d3dd1c5d6ba06d0aa3216c74a293510a8807eaecd756c01edbd650825e",
                         "d0cc0a62b6640f6284e4481dfda62ab2a6f488a483c38a54f218653fec7b47e9",
                         "3c1b985c6a707733b4a93213e8178509366d29b1f2201790b625599d0696966c",
                         "8fb6e0cd1c0d01157ee1a87da9e894f7451988a5349cff5d99f2d3d9c6ffc397",
                         "3f9845508e733e1199c623a36fd6fe235239628731fb7b2b28295dfd39680f0f",
                         "a678fc07f50186fae590d58f1538da74ad808b4ed32122e626a39994e60fe22f",
                         "6f24f59053d5500dc65aee44aeb1c3820b1cf6ff382357dc8a53f8658da5e355",
                         "0eb993c468c54ca784024a49fd60472365b9d5fa1418f4c0dcf2f98c2b899278",
                         "3c9e320785466d7c22e466aa398f90a13b297bae250994620c8170952869d6ef",
                         "153106834fb06976c587c39aaef0e8c0d1b1339a575e8d7b87f187058663a094",
                         "b75f16bcdb9317f01bd2be7ceda6b505997930428c8942390340e0e480316c2e",
                         "e432538f05f4f9616a115502251edb6d6a0c4a77a5132ca9fbcf42e6f6e26272",
                         "06d06200a7d1fd57ebc7353466ad121a450d83ee7f9bbdfd74031a7643e3f575") and

 not (process.executable : ("?:\\Windows\\System32\\WerFault.exe", "?:\\Windows\\SysWOW64\\WerFault.exe") and 
      process.thread.Ext.call_stack_final_user_module.path : ("?:\\windows\\*", "?:\\program files (x86)\\*", "?:\\program files\\*")) and

 not (process.executable : ("?:\\Windows\\System32\\WerFault.exe", "?:\\Windows\\SysWOW64\\WerFault.exe") and
      process.thread.Ext.call_stack_summary like "ntdll.dll|*|faultrep.dll|werfault.exe|kernel32.dll|ntdll.dll") and

 not _arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info like "c:\\windows\\sys?????\\dbgcore.dll!MiniDumpWriteDump*") and
 not process.thread.Ext.call_stack_final_user_module.path like ("e:\\*\\*.exe", "f:\\*\\*.exe")
'''

min_endpoint_version = "8.14.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 = "T1562"
name = "Impair Defenses"
reference = "https://attack.mitre.org/techniques/T1562/"
[[threat.technique.subtechnique]]
id = "T1562.001"
name = "Disable or Modify Tools"
reference = "https://attack.mitre.org/techniques/T1562/001/"



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

[internal]
min_endpoint_version = "8.14.0"

Stages and Predicates

Stage 1: api

api where process.Ext.api.name in ("NtSuspendProcess", "SuspendThread") and process.executable != null and
 process.Ext.api.behaviors == "cross-process" and process.Ext.api.behaviors != "parent-child" and
 Target.process.Ext.token.integrity_level_name != "low" and
 process.Ext.api.summary != null and
 (process.thread.Ext.call_stack_final_user_module.hash.sha256 != null or process.thread.Ext.call_stack_final_user_module.name : "Unbacked") and
 process.thread.Ext.call_stack_final_user_module.name != null and
 not _arraysearch(process.thread.Ext.call_stack_final_user_module.code_signature, $entry, $entry.trusted == true) and
 not process.thread.Ext.call_stack_final_user_module.name : ("Kernel", "Unknown", "Undetermined") and
 not process.thread.Ext.call_stack_final_user_module.protection_provenance : "Unknown" and
 not process.thread.Ext.call_stack_final_user_module.path :
                                   ("c:\\program files (x86)\\*", "c:\\program files\\*",
                                    "c:\\windows\\assembly\\nativeimages_*\\system.directoryservices.ni.dll",
                                    "c:\\windows\\assembly\\nativeimages_v*\\miguicontrols\\*\\miguicontrols.ni.dll",
                                    "C:\\windows\\system32\\crashcollector.exe", "c:\\windows\\system32\\crashcollector.exe") and
 not process.thread.Ext.call_stack_final_user_module.hash.sha256 :
                        (
                         "6847711e7782729fac009ede5fc3ea5ed6ca54ff582eed3386c1f74d83e1a372",
                         "fdef73d692e2e181075bf43a05cd7ebe551f6b1be31f4d471ff709f83a549612",
                         "0e29025fd573a9d818d05a124f83b6fbe74bbb7c37b8149b43f577d5a74d2f02",
                         "3ca49b11a6b12e9efe8b12076d46f4c1c6e9b4fea44f7e572766a7845c6c24a3",
                         "921b33e55f4a7c806fc1e0547398545ae943fa341ed0e8dc29b4c71d49ecac1a",
                         "bf0a9f2845bc536de2693177e93c67a9467ba992cb08f9c66e34912f60fb910d",
                         "e3101d0ebb2656193086f9ebd53563a6cfd802226d13cdb434d4fb89b2cbab7d",
                         "9045446fe2a4d4e2807e309e47c75c297dd766d934ca60bf0dabb45dda1857c7",
                         "fed8a5e8e77bf2099334d7bd55b127027b1048c5039aba3825161f07fb8e0889",
                         "ca02e8e2e60491b0fdf52071bea067c3bf5f12fbddb59ef73d6aa54dc6780606",
                         "418a7dc57d5ac225d7f012fe90a1668a797fde56c9add6c3aad841ab0c1e2bc1",
                         "d74adfbaa1a63bdb0089ecaf1500bcc578118c9b4f648ed09883d76232603737",
                         "224b1025c51438d2ce9343d15d3afc32698187c81dbde28e99a80d042ac8a0b9",
                         "e65e63d51b8fe0eeee53918ddb2a8105b5e396f52341074a7997bbed43311cec",
                         "b792d1243950e98d460fb5541fffc723d097d23cfa6830d70673cbea86623afb",
                         "d7cc5804450a1be697c37440059b97e0911fb20d2ef068bfb458b54c46866151",
                         "d5685e38faccdf97ce6ffe4cf53cbfcf48bb20bf83abe316fba81d1abd093cb6",
                         "4b3e16f6df41a2600ddde4769123151cd7c9dcf88b0d30c2e14cfad81f717529",
                         "e825a252b5c5c9c2de8a6a6ade12a7f9cd0040f6a20e6ee44ba659034e6d5223",
                         "5ae5860e24c1e9604efaedb9f57b733feff2a978b23a16751ba1f31ecc62aa6f",
                         "71deb0afa24ddcb687951026e871121556cf114960833a38a00a8c07e9086357",
                         "f6268995735c5aa33dc02e696992ecb0afda879170b90d3333a7ef27165b045f",
                         "d94ad7bcd32ec7b48fe76a4293205c6eb17191b7882a631ccb4eeabee2a96bca",
                         "ec673caa0c703cc3084887824b800502cd45b4a365c2f8d6cbc5175f0e938e1e",
                         "ad76892733513d2f88eeb61ea18a9594defa52a82eab4fca0202752f651307af",
                         "4a23537d3523441a06b705bca6a7bd601c450b17a0586d669b07fd86c1dc0962",
                         "02bec18f77442249a7099ce975e81d7cb22481dd91717b5e5ae5b8fc62b95899",
                         "bc30b686e6c101b1fd4c52caca31e01227fcea8dfe683de4abcd047ec2acca38",
                         "a995140e5ee8d00e571c19654d4628a11a74b5804768da6e147c559fa3747e23",
                         "94bb9904694212c5b1fd037bf10af23557129862626e1dc45b719926be69690b",
                         "024e8872d37aa6656057abbbdc87a6d5e62f2e3d59c9d6de91fbea00e25407ae",
                         "9783d83df9cce5aa741b47495d48c62c1cb2d4521e4ba0c9d059e7f241dd0186",
                         "c6d97ee3652cfc438830ca0e18e7ea96462fa09505ae0ce4ac422950c1272e81",
                         "ccae2a12091763da594e0ceb83e3aa438bccf2449b2dc91c916232ba2117ae22",
                         "b2a99e7f7f7d0edba76da01959988b3b006b9741d1617e7e290b74866a494cdc",
                         "a41d8d34646abd09ef570b8c87a8d36f19a2cffcbe77ea5d1128d6206851c9d8",
                         "e0037ab4d9764fffad985ed44468b93c8dc9aed366a25a651c83e9c5d6f99fc7",
                         "40949e20630ce1c955f0911995de98c3772828c9a37f257c01a29ed62b5be072",
                         "928bd69d852de58f8cf42a37f79c7f4769000ba8ed1c918717d6430be531f5c7",
                         "b72ba56ae1e3f1c81904f837f98b5c7e054da66923236ce2270fd2fa501bb427",
                         "a82b08fb68efd8d93b7849b7180ad414f98c24a5ba56f431dc7a7ff572c6db72",
                         "a6992d2b1ebc09656a991a8337abefb46c9c4376088a97ddf0e3fe50dd1a80c3",
                         "8e67ae6684baca7f02857efc5463bc1da94506ea20577d9e1c0860a0c02a07a1",
                         "76d338198d607ac1432157b18f85367f402b5404983a2c9ca071062e4dcdba33",
                         "838d44c0a68c5d849a582b5f36e33db2dca89e743ce48e6af68df31c8ac93e26",
                         "2e85b02876568f7e1c9a61075373f98e7e754de6acc6ff0e6b847b598f3a66f5",
                         "27c7d20101e03ec0850cdd58f89b8d5e8494e8c0790919c778947ca14ee68a0d",
                         "c12ade1fc56f70f780e4ed0175dd74da5c8b28807b57de9ba25ee376e4f37533",
                         "a94f89d7829129fe15722723a8a41295aca9f1be4d4a531d19fd7a470c282511",
                         "3db86e281aba8818f67ae4026ec184952791896450c4505515e2bf0787aa47f6",
                         "38da0d335a49473fe31894c02aef49ae053abb7951c5307ccbbb314c7b8601b7",
                         "92c068146977d26a656c462af52dba4ce6e36b21ea5787b1fbf778414c3b6f75",
                         "ac8c1db990bd2c5612b2929c097ed5c3e4bc047158d9d7a39c57723c614dd51e",
                         "6a05773105b10471c6d1b3ee9044b5d161bc6b5d2a9fbbde5d4bc217c58c003d",
                         "9ef2eeb69dfcbfe53cae8727f7f48ec580c4da4a22f84952353159a74ebef566",
                         "6b766ffee9ee5ebeee3830a90870afca99a79e7611fd81f2e4afab009513a3dc",
                         "ca8e711eab79c01a3618039370b4434faebe32b1f0143aebef786da0a53cb031",
                         "6cb3d7575d70a9c23fd2480fa0f973ff633844b7ca4261af607e1188bdb52d10",
                         "3413cfc1180ca6948b1ddf3595148e17ef4b4552297e595cb4281b63dbd4515b",
                         "c90796c07e8febb88895c41d2efff0b31fd6b75448909222a47c42d038851e8a",
                         "d0fd1d51c6f211610768b17be7940d24c1d0c170fffb84e3683d3aa837a2ce8a",
                         "6645b5bc9db6514dd8eab204193c95fd6af4836da1b4b2814cdd703081013ece",
                         "14b052ca942fe7045ed56015a5a292d82d80fb3a88d67f15807a5b433a6c2c2c",
                         "c1bfa6b7da76de1143f8db9a53db49063b85bf1e0b26f4d5c617f1bb23f4fb9d",
                         "e3fdcd2b4c5215e74b0cabe91ce7fe2800cbf8e2a28157342960bca61bbd6b5d",
                         "c1bfa6b7da76de1143f8db9a53db49063b85bf1e0b26f4d5c617f1bb23f4fb9d",
                         "5fe0752c103820b17baa9f8a18a381701217ab1631e80800221f2b32d4c889dd",
                         "6d9bef59e10a848541c81157fa1147cce88dccdddd58a20a4e3410aaddfcb1da",
                         "bd6843726688bd7253a42180bf95671ad5b0f9e787adb4f13250f484abd9eae4",
                         "5ba254c1219707934f81b2037b9efb76716edba6e3c4c9666b615bf4cf146d25",
                         "6351a660b57d8b394c15b4e715ce1a2e0332e29f7458db1497062f55551e94d9",
                         "7300120d19b64fa3a774c7dd7a3104ec3520fa99040913522b14520069f49328",
                         "9e33a1e70193ffde452cb8b1a58044531840b2e319342c000ad0c405d94495b8",
                         "69860a487c2bddefa5951076f6112081db159026ca8ff11ab906e13cecb9d299",
                         "4e4b9bcef90731eb9b1306610fc89ba31296a5875ff5ba628f7271130aa61280",
                         "0ebf7d62158317d644c0eb9d15ba504034abd5484a7df2b10ed409bcbf95f8cf",
                         "14da1fbca85ff2b8ac19ab63f4b7019614865ce8d87bce68100c97174b786ff5",
                         "0f7fd870dd2e7272b92ea5dfe88b2662d859818459a3d2c1e9d669aa1a7dddc2",
                         "9fe9a49cfdf8e5764a264c19a11bb123d5bd9f1d11dbc469709b5a8178ec8f8b",
                         "a09f8a37fb83c759598d57fd6b7d33b1fb75f6b5855f1e74c3303df4b36529b1",
                         "6c6abf6e4c7439b853b27fbf542aba0b9c042d39cc317580fe7d55e65d4375e0",
                         "6eed2886728608f1b3f4a54a7a7d338ef1b1669f6f53a5d38bcd352f0ec755c9",
                         "73de63385d6778896e85b672e056ec10040531c83c0872329cfa1ec1e6e10cec",
                         "cea088ae798d2a4a82dc4cdc1b5c1333daf3be26f651319e2215c87e3c7c3bf3",
                         "56a5148d00c2d9e58415be2d64eca922a58063fe26d9af1c87084aa383c9058e",
                         "83ee0ff920144edb2c2f4ea10130f55443493290886985a63233fa2431e450f9",
                         "f4063507bb92ca017b3ce48cd1b2c029d9393c924af1a10c7720884c74c3cc36",
                         "8052a09fb953cd6dbd529bc0fd8313a8806efe5f4b2370d3bedc1c6edfb319f7",
                         "92f102f6bcbe7e03d8f0beac15ed4de396f09952786c8b632477dae15349ca3e",
                         "71b49d2c08f4d9b5952e44ef06846556c944c14ecff4bc2a4071e67921473e46",
                         "379952ec8113b3692872ffb9d07c242968ee1edfac9b3b888496c1480033be91",
                         "aac5bb07168d5a66e21b69dd68f630d7a06fd27be5409daace1d74af244bb60a",
                         "93b98ec9c3da8c9bc422cff03736ed92f3ed51e2b984a38bf19cca80e15b8c76",
                         "011eb5a6789080192f66cc04c2ceecf57ce867bd854a5b8d530a04f41f50a570",
                         "85ebda733d373181ad89d3b5b34d06d3bcd3003c1d7aa07da6d4dc337ff6180f",
                         "6d41389d80d5308f60b1a856dbd38172500b589acd99fb5532f16f4fc31caada",
                         "48229a57d9a45bef840ade321135cf2d0fb41412a397c0ec9c7eed918c8c967f",
                         "afb9e9f543b2e286d4967a7795d2bb3f31c0b37066494bd68eda2d1570d8ebba",
                         "7ba928d7ed3c0b3659410ed06cf8a3e0f0c875e4edfd7691ce0b646ff41489ad",
                         "afcf23763c3ee1dc16ad80fbdded635bd896b0817997273b18375ac7e0059a18",
                         "dfa736b6a8a9a7eed8e7b546c2c7f8109add4db799521b27f2ec04ddbad70d86",
                         "9d569291755f1937996aecbe32fc5d8df656d0cf4122d4c10130938dfd2229fd",
                         "e6b7e45f7a6375f51e1b675b547c48cc44ba543c7081790f102b658c7626f8e6",
                         "8cbfed45a28e410551411cdd6b6329862ed88cf4476b0aafccea5e4fc16e91e8",
                         "a40e2533a200e9e8f29ccf937b05efc92cc4b56251758d978cf73c83f265a014",
                         "fce8c609368c54a21e87dee938a5b3ee3fa910658856b8b28e8d86794c09374e",
                         "d67886a8dee423035ec807b04227aa6c8b8101a8a5e122cfd49f5901668a94ad",
                         "a587142ad5ffdbd852eed2a25f1f4e4cfd41ce82aee290aff5143093352e581e",
                         "c2101b8c881e165c2ba9a02efd3a529d86bf8825f2eefab0fe5d3c5cef736fb6",
                         "e2049b19974678e2e6cf38da5f7cec1e0199e0b3e03606a3b97bd15d796a5971",
                         "22bc08bf0cec3e84d410e114de0d653c12c20f743ed955f7fc0848f218f47a8d",
                         "7d4a6781df906d745569beb38f09f1711cde80dc69ba94083cb805adb3208f58",
                         "f97e4e8a8753608de13d7b4948aeb7f206829a3218007f5f049de151a75be22c",
                         "389b9caaef229a1d08ce4e65835438e8a0200664e547b8f16688287f82c240ce",
                         "1d403006ac76665391a294578678f23634d5699525ecc589fad808cbf8284030",
                         "70adb308b63b5f02126672cd6d89d830c47b19d1c48d55a13cb4f530a4716e6a",
                         "a3272147ae66166bc1edf8fac3e245e7ab8a2f882efaa52ba6679f96faec5545",
                         "e9b488ad3101d386a3b2248db0c0dfe43c83fd856c55d181264da762f5352f38",
                         "bd9b92d3dd1c5d6ba06d0aa3216c74a293510a8807eaecd756c01edbd650825e",
                         "d0cc0a62b6640f6284e4481dfda62ab2a6f488a483c38a54f218653fec7b47e9",
                         "3c1b985c6a707733b4a93213e8178509366d29b1f2201790b625599d0696966c",
                         "8fb6e0cd1c0d01157ee1a87da9e894f7451988a5349cff5d99f2d3d9c6ffc397",
                         "3f9845508e733e1199c623a36fd6fe235239628731fb7b2b28295dfd39680f0f",
                         "a678fc07f50186fae590d58f1538da74ad808b4ed32122e626a39994e60fe22f",
                         "6f24f59053d5500dc65aee44aeb1c3820b1cf6ff382357dc8a53f8658da5e355",
                         "0eb993c468c54ca784024a49fd60472365b9d5fa1418f4c0dcf2f98c2b899278",
                         "3c9e320785466d7c22e466aa398f90a13b297bae250994620c8170952869d6ef",
                         "153106834fb06976c587c39aaef0e8c0d1b1339a575e8d7b87f187058663a094",
                         "b75f16bcdb9317f01bd2be7ceda6b505997930428c8942390340e0e480316c2e",
                         "e432538f05f4f9616a115502251edb6d6a0c4a77a5132ca9fbcf42e6f6e26272",
                         "06d06200a7d1fd57ebc7353466ad121a450d83ee7f9bbdfd74031a7643e3f575") and
 not (process.executable : ("?:\\Windows\\System32\\WerFault.exe", "?:\\Windows\\SysWOW64\\WerFault.exe") and
      process.thread.Ext.call_stack_final_user_module.path : ("?:\\windows\\*", "?:\\program files (x86)\\*", "?:\\program files\\*")) and
 not (process.executable : ("?:\\Windows\\System32\\WerFault.exe", "?:\\Windows\\SysWOW64\\WerFault.exe") and
      process.thread.Ext.call_stack_summary like "ntdll.dll|*|faultrep.dll|werfault.exe|kernel32.dll|ntdll.dll") and
 not _arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info like "c:\\windows\\sys?????\\dbgcore.dll!MiniDumpWriteDump*") and
 not process.thread.Ext.call_stack_final_user_module.path like ("e:\\*\\*.exe", "f:\\*\\*.exe")

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.executableeq?:\Windows\System32\WerFault.exe, ?:\Windows\SysWOW64\WerFault.exeexcludes:process.executable field:"process.executable" value:"?:\Windows\System32\WerFault.exe" field:"process.executable" value:"?:\Windows\SysWOW64\WerFault.exe"
process.thread.Ext.call_stack_final_user_module.pathstarts_with?:\windows\, ?:\program files (x86)\, ?:\program files\excludes:process.thread.Ext.call_stack_final_user_module.path field:"process.thread.Ext.call_stack_final_user_module.path" value:"?:\windows\" field:"process.thread.Ext.call_stack_final_user_module.path" value:"?:\program files (x86)\" field:"process.thread.Ext.call_stack_final_user_module.path" value:"?:\program files\"
process.thread.Ext.call_stack_summarywildcardntdll.dll|*|faultrep.dll|werfault.exe|kernel32.dll|ntdll.dllexcludes:process.thread.Ext.call_stack_summary field:"process.thread.Ext.call_stack_summary" value:"ntdll.dll|*|faultrep.dll|werfault.exe|kernel32.dll|ntdll.dll"
process.thread.Ext.call_stackarray_any(no value, null check)excludes:process.thread.Ext.call_stack
process.thread.Ext.call_stack_final_user_module.code_signaturearray_any(no value, null check)excludes:process.thread.Ext.call_stack_final_user_module.code_signature
process.thread.Ext.call_stack_final_user_module.hash.sha256eq6847711e7782729fac009ede5fc3ea5ed6ca54ff582eed3386c1f74d83e1a372, fdef73d692e2e181075bf43a05cd7ebe551f6b1be31f4d471ff709f83a549612, 0e29025fd573a9d818d05a124f83b6fbe74bbb7c37b8149b43f577d5a74d2f02, 3ca49b11a6b12e9efe8b12076d46f4c1c6e9b4fea44f7e572766a7845c6c24a3, 921b33e55f4a7c806fc1e0547398545ae943fa341ed0e8dc29b4c71d49ecac1a, bf0a9f2845bc536de2693177e93c67a9467ba992cb08f9c66e34912f60fb910d, e3101d0ebb2656193086f9ebd53563a6cfd802226d13cdb434d4fb89b2cbab7d, 9045446fe2a4d4e2807e309e47c75c297dd766d934ca60bf0dabb45dda1857c7, fed8a5e8e77bf2099334d7bd55b127027b1048c5039aba3825161f07fb8e0889, ca02e8e2e60491b0fdf52071bea067c3bf5f12fbddb59ef73d6aa54dc6780606, 418a7dc57d5ac225d7f012fe90a1668a797fde56c9add6c3aad841ab0c1e2bc1, d74adfbaa1a63bdb0089ecaf1500bcc578118c9b4f648ed09883d76232603737, 224b1025c51438d2ce9343d15d3afc32698187c81dbde28e99a80d042ac8a0b9, e65e63d51b8fe0eeee53918ddb2a8105b5e396f52341074a7997bbed43311cec, b792d1243950e98d460fb5541fffc723d097d23cfa6830d70673cbea86623afb, d7cc5804450a1be697c37440059b97e0911fb20d2ef068bfb458b54c46866151, d5685e38faccdf97ce6ffe4cf53cbfcf48bb20bf83abe316fba81d1abd093cb6, 4b3e16f6df41a2600ddde4769123151cd7c9dcf88b0d30c2e14cfad81f717529, e825a252b5c5c9c2de8a6a6ade12a7f9cd0040f6a20e6ee44ba659034e6d5223, 5ae5860e24c1e9604efaedb9f57b733feff2a978b23a16751ba1f31ecc62aa6f, 71deb0afa24ddcb687951026e871121556cf114960833a38a00a8c07e9086357, f6268995735c5aa33dc02e696992ecb0afda879170b90d3333a7ef27165b045f, d94ad7bcd32ec7b48fe76a4293205c6eb17191b7882a631ccb4eeabee2a96bca, ec673caa0c703cc3084887824b800502cd45b4a365c2f8d6cbc5175f0e938e1e, ad76892733513d2f88eeb61ea18a9594defa52a82eab4fca0202752f651307af, 4a23537d3523441a06b705bca6a7bd601c450b17a0586d669b07fd86c1dc0962, 02bec18f77442249a7099ce975e81d7cb22481dd91717b5e5ae5b8fc62b95899, bc30b686e6c101b1fd4c52caca31e01227fcea8dfe683de4abcd047ec2acca38, a995140e5ee8d00e571c19654d4628a11a74b5804768da6e147c559fa3747e23, 94bb9904694212c5b1fd037bf10af23557129862626e1dc45b719926be69690b, 024e8872d37aa6656057abbbdc87a6d5e62f2e3d59c9d6de91fbea00e25407ae, 9783d83df9cce5aa741b47495d48c62c1cb2d4521e4ba0c9d059e7f241dd0186, c6d97ee3652cfc438830ca0e18e7ea96462fa09505ae0ce4ac422950c1272e81, ccae2a12091763da594e0ceb83e3aa438bccf2449b2dc91c916232ba2117ae22, b2a99e7f7f7d0edba76da01959988b3b006b9741d1617e7e290b74866a494cdc, a41d8d34646abd09ef570b8c87a8d36f19a2cffcbe77ea5d1128d6206851c9d8, e0037ab4d9764fffad985ed44468b93c8dc9aed366a25a651c83e9c5d6f99fc7, 40949e20630ce1c955f0911995de98c3772828c9a37f257c01a29ed62b5be072, 928bd69d852de58f8cf42a37f79c7f4769000ba8ed1c918717d6430be531f5c7, b72ba56ae1e3f1c81904f837f98b5c7e054da66923236ce2270fd2fa501bb427, a82b08fb68efd8d93b7849b7180ad414f98c24a5ba56f431dc7a7ff572c6db72, a6992d2b1ebc09656a991a8337abefb46c9c4376088a97ddf0e3fe50dd1a80c3, 8e67ae6684baca7f02857efc5463bc1da94506ea20577d9e1c0860a0c02a07a1, 76d338198d607ac1432157b18f85367f402b5404983a2c9ca071062e4dcdba33, 838d44c0a68c5d849a582b5f36e33db2dca89e743ce48e6af68df31c8ac93e26, 2e85b02876568f7e1c9a61075373f98e7e754de6acc6ff0e6b847b598f3a66f5, 27c7d20101e03ec0850cdd58f89b8d5e8494e8c0790919c778947ca14ee68a0d, c12ade1fc56f70f780e4ed0175dd74da5c8b28807b57de9ba25ee376e4f37533, a94f89d7829129fe15722723a8a41295aca9f1be4d4a531d19fd7a470c282511, 3db86e281aba8818f67ae4026ec184952791896450c4505515e2bf0787aa47f6, 38da0d335a49473fe31894c02aef49ae053abb7951c5307ccbbb314c7b8601b7, 92c068146977d26a656c462af52dba4ce6e36b21ea5787b1fbf778414c3b6f75, ac8c1db990bd2c5612b2929c097ed5c3e4bc047158d9d7a39c57723c614dd51e, 6a05773105b10471c6d1b3ee9044b5d161bc6b5d2a9fbbde5d4bc217c58c003d, 9ef2eeb69dfcbfe53cae8727f7f48ec580c4da4a22f84952353159a74ebef566, 6b766ffee9ee5ebeee3830a90870afca99a79e7611fd81f2e4afab009513a3dc, ca8e711eab79c01a3618039370b4434faebe32b1f0143aebef786da0a53cb031, 6cb3d7575d70a9c23fd2480fa0f973ff633844b7ca4261af607e1188bdb52d10, 3413cfc1180ca6948b1ddf3595148e17ef4b4552297e595cb4281b63dbd4515b, c90796c07e8febb88895c41d2efff0b31fd6b75448909222a47c42d038851e8a, d0fd1d51c6f211610768b17be7940d24c1d0c170fffb84e3683d3aa837a2ce8a, 6645b5bc9db6514dd8eab204193c95fd6af4836da1b4b2814cdd703081013ece, 14b052ca942fe7045ed56015a5a292d82d80fb3a88d67f15807a5b433a6c2c2c, c1bfa6b7da76de1143f8db9a53db49063b85bf1e0b26f4d5c617f1bb23f4fb9d, e3fdcd2b4c5215e74b0cabe91ce7fe2800cbf8e2a28157342960bca61bbd6b5d, c1bfa6b7da76de1143f8db9a53db49063b85bf1e0b26f4d5c617f1bb23f4fb9d, 5fe0752c103820b17baa9f8a18a381701217ab1631e80800221f2b32d4c889dd, 6d9bef59e10a848541c81157fa1147cce88dccdddd58a20a4e3410aaddfcb1da, bd6843726688bd7253a42180bf95671ad5b0f9e787adb4f13250f484abd9eae4, 5ba254c1219707934f81b2037b9efb76716edba6e3c4c9666b615bf4cf146d25, 6351a660b57d8b394c15b4e715ce1a2e0332e29f7458db1497062f55551e94d9, 7300120d19b64fa3a774c7dd7a3104ec3520fa99040913522b14520069f49328, 9e33a1e70193ffde452cb8b1a58044531840b2e319342c000ad0c405d94495b8, 69860a487c2bddefa5951076f6112081db159026ca8ff11ab906e13cecb9d299, 4e4b9bcef90731eb9b1306610fc89ba31296a5875ff5ba628f7271130aa61280, 0ebf7d62158317d644c0eb9d15ba504034abd5484a7df2b10ed409bcbf95f8cf, 14da1fbca85ff2b8ac19ab63f4b7019614865ce8d87bce68100c97174b786ff5, 0f7fd870dd2e7272b92ea5dfe88b2662d859818459a3d2c1e9d669aa1a7dddc2, 9fe9a49cfdf8e5764a264c19a11bb123d5bd9f1d11dbc469709b5a8178ec8f8b, a09f8a37fb83c759598d57fd6b7d33b1fb75f6b5855f1e74c3303df4b36529b1, 6c6abf6e4c7439b853b27fbf542aba0b9c042d39cc317580fe7d55e65d4375e0, 6eed2886728608f1b3f4a54a7a7d338ef1b1669f6f53a5d38bcd352f0ec755c9, 73de63385d6778896e85b672e056ec10040531c83c0872329cfa1ec1e6e10cec, cea088ae798d2a4a82dc4cdc1b5c1333daf3be26f651319e2215c87e3c7c3bf3, 56a5148d00c2d9e58415be2d64eca922a58063fe26d9af1c87084aa383c9058e, 83ee0ff920144edb2c2f4ea10130f55443493290886985a63233fa2431e450f9, f4063507bb92ca017b3ce48cd1b2c029d9393c924af1a10c7720884c74c3cc36, 8052a09fb953cd6dbd529bc0fd8313a8806efe5f4b2370d3bedc1c6edfb319f7, 92f102f6bcbe7e03d8f0beac15ed4de396f09952786c8b632477dae15349ca3e, 71b49d2c08f4d9b5952e44ef06846556c944c14ecff4bc2a4071e67921473e46, 379952ec8113b3692872ffb9d07c242968ee1edfac9b3b888496c1480033be91, aac5bb07168d5a66e21b69dd68f630d7a06fd27be5409daace1d74af244bb60a, 93b98ec9c3da8c9bc422cff03736ed92f3ed51e2b984a38bf19cca80e15b8c76, 011eb5a6789080192f66cc04c2ceecf57ce867bd854a5b8d530a04f41f50a570, 85ebda733d373181ad89d3b5b34d06d3bcd3003c1d7aa07da6d4dc337ff6180f, 6d41389d80d5308f60b1a856dbd38172500b589acd99fb5532f16f4fc31caada, 48229a57d9a45bef840ade321135cf2d0fb41412a397c0ec9c7eed918c8c967f, afb9e9f543b2e286d4967a7795d2bb3f31c0b37066494bd68eda2d1570d8ebba, 7ba928d7ed3c0b3659410ed06cf8a3e0f0c875e4edfd7691ce0b646ff41489ad, afcf23763c3ee1dc16ad80fbdded635bd896b0817997273b18375ac7e0059a18, dfa736b6a8a9a7eed8e7b546c2c7f8109add4db799521b27f2ec04ddbad70d86, 9d569291755f1937996aecbe32fc5d8df656d0cf4122d4c10130938dfd2229fd, e6b7e45f7a6375f51e1b675b547c48cc44ba543c7081790f102b658c7626f8e6, 8cbfed45a28e410551411cdd6b6329862ed88cf4476b0aafccea5e4fc16e91e8, a40e2533a200e9e8f29ccf937b05efc92cc4b56251758d978cf73c83f265a014, fce8c609368c54a21e87dee938a5b3ee3fa910658856b8b28e8d86794c09374e, d67886a8dee423035ec807b04227aa6c8b8101a8a5e122cfd49f5901668a94ad, a587142ad5ffdbd852eed2a25f1f4e4cfd41ce82aee290aff5143093352e581e, c2101b8c881e165c2ba9a02efd3a529d86bf8825f2eefab0fe5d3c5cef736fb6, e2049b19974678e2e6cf38da5f7cec1e0199e0b3e03606a3b97bd15d796a5971, 22bc08bf0cec3e84d410e114de0d653c12c20f743ed955f7fc0848f218f47a8d, 7d4a6781df906d745569beb38f09f1711cde80dc69ba94083cb805adb3208f58, f97e4e8a8753608de13d7b4948aeb7f206829a3218007f5f049de151a75be22c, 389b9caaef229a1d08ce4e65835438e8a0200664e547b8f16688287f82c240ce, 1d403006ac76665391a294578678f23634d5699525ecc589fad808cbf8284030, 70adb308b63b5f02126672cd6d89d830c47b19d1c48d55a13cb4f530a4716e6a, a3272147ae66166bc1edf8fac3e245e7ab8a2f882efaa52ba6679f96faec5545, e9b488ad3101d386a3b2248db0c0dfe43c83fd856c55d181264da762f5352f38, bd9b92d3dd1c5d6ba06d0aa3216c74a293510a8807eaecd756c01edbd650825e, d0cc0a62b6640f6284e4481dfda62ab2a6f488a483c38a54f218653fec7b47e9, 3c1b985c6a707733b4a93213e8178509366d29b1f2201790b625599d0696966c, 8fb6e0cd1c0d01157ee1a87da9e894f7451988a5349cff5d99f2d3d9c6ffc397, 3f9845508e733e1199c623a36fd6fe235239628731fb7b2b28295dfd39680f0f, a678fc07f50186fae590d58f1538da74ad808b4ed32122e626a39994e60fe22f, 6f24f59053d5500dc65aee44aeb1c3820b1cf6ff382357dc8a53f8658da5e355, 0eb993c468c54ca784024a49fd60472365b9d5fa1418f4c0dcf2f98c2b899278, 3c9e320785466d7c22e466aa398f90a13b297bae250994620c8170952869d6ef, 153106834fb06976c587c39aaef0e8c0d1b1339a575e8d7b87f187058663a094, b75f16bcdb9317f01bd2be7ceda6b505997930428c8942390340e0e480316c2e, e432538f05f4f9616a115502251edb6d6a0c4a77a5132ca9fbcf42e6f6e26272, 06d06200a7d1fd57ebc7353466ad121a450d83ee7f9bbdfd74031a7643e3f575excludes:process.thread.Ext.call_stack_final_user_module.hash.sha256
process.thread.Ext.call_stack_final_user_module.nameeqKernel, Unknown, Undeterminedexcludes: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:"Unknown" field:"process.thread.Ext.call_stack_final_user_module.name" value:"Undetermined"
process.thread.Ext.call_stack_final_user_module.pathwildcarde:\*\*.exe, f:\*\*.exeexcludes:process.thread.Ext.call_stack_final_user_module.path field:"process.thread.Ext.call_stack_final_user_module.path" value:"e:\*\*.exe" field:"process.thread.Ext.call_stack_final_user_module.path" value:"f:\*\*.exe"
process.thread.Ext.call_stack_final_user_module.pathwildcardc:\program files (x86)\*, c:\program files\*, c:\windows\assembly\nativeimages_*\system.directoryservices.ni.dll, c:\windows\assembly\nativeimages_v*\miguicontrols\*\miguicontrols.ni.dll, C:\windows\system32\crashcollector.exe, c:\windows\system32\crashcollector.exeexcludes:process.thread.Ext.call_stack_final_user_module.path
process.thread.Ext.call_stack_final_user_module.protection_provenanceeqUnknownexcludes:process.thread.Ext.call_stack_final_user_module.protection_provenance field:"process.thread.Ext.call_stack_final_user_module.protection_provenance" value:"Unknown"

Suspicious Remote Registry Modification

#
Source
github.com/elastic/protections-artifacts

Identifies registry modification via the Remote Registry service to point to an executable or script file, or to make a COM object remotely activatable. This may indicate an attempt to move laterally via remote configuration changes, including DCOM-based .NET deserialization lateral movement (e.g. DCOMIllusionist) which remotely associates a CLSID with an AppID, stands up a DllSurrogate, or points an InprocServer32 at a managed assembly.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
Identifies registry modification via the Remote Registry service to point to an executable or script file, or to make a
COM object remotely activatable. This may indicate an attempt to move laterally via remote configuration changes,
including DCOM-based .NET deserialization lateral movement (e.g. DCOMIllusionist) which remotely associates a CLSID with
an AppID, stands up a DllSurrogate, or points an InprocServer32 at a managed assembly.
"""
id = "01c2b2e3-a0a9-4ad1-92e2-1aa80d70de50"
license = "Elastic License v2"
name = "Suspicious Remote Registry Modification"
os_list = ["windows"]
version = "1.0.17"

query = '''
registry where event.action == "modification" and user.id : ("S-1-5-21*", "S-1-12-*") and
 process.name : "svchost.exe" and process.thread.Ext.call_stack_summary : "*regsvc.dll|rpcrt4.dll*" and
 (
  registry.data.strings : ("*:\\*\\*", "*.exe*", "*.dll*", "*rundll32*", "*powershell*", "*.exe*http*", "* /c *", "*COMSPEC*", "\\\\*.*",
                           "*Version=*Culture=*PublicKeyToken=*") or
  registry.path :
         ("HKLM\\SYSTEM\\ControlSet*\\Services\\*\\ServiceDLL",
          "HKLM\\SYSTEM\\ControlSet*\\Services\\*\\ImagePath",
          "HKEY_USERS\\*Classes\\*\\InprocServer32\\",
          "HKEY_USERS\\*Classes\\*\\LocalServer32\\",
          "HKLM\\SOFTWARE\\Classes\\CLSID\\*\\AppID",
          "HKLM\\SOFTWARE\\WOW6432Node\\Classes\\CLSID\\*\\AppID",
          "HKLM\\SOFTWARE\\Classes\\CLSID\\*\\InprocServer32*",
          "HKLM\\SOFTWARE\\WOW6432Node\\Classes\\CLSID\\*\\InprocServer32*",
          "HKLM\\SOFTWARE\\Classes\\AppID\\*\\DllSurrogate",
          "H*\\Software\\Microsoft\\Windows\\CurrentVersion\\Run\\*",
          "HKLM\\SOFTWARE\\Classes\\AppID\\*",
          "HKEY_USERS\\*Classes\\AppID\\*",
          "HKLM\\SYSTEM\\ControlSet*\\Control\\Lsa\\*") or
  (registry.value : "Start" and registry.data.strings : "4")
  ) and
  not registry.data.strings : "C:\\Windows\\System32\\svchost.exe -k localService" and
  not registry.path : ("HKLM\\SOFTWARE\\Microsoft\\SMS\\*",
                       "HKLM\\SYSTEM\\*ControlSet*\\Services\\EventLog\\*",
                       "HKLM\\SOFTWARE\\EMCO\\Remote Agents\\Remote Installer\\*",
                       "HKLM\\SOFTWARE\\Microsoft\\Service Fabric\\*",
                       "HKLM\\SOFTWARE\\WOW6432Node\\Varonis\\*",
                       "HKLM\\SOFTWARE\\Varonis\\*",
                       "HKLM\\SOFTWARE\\JavaSoft\\*",
                       "HKLM\\SOFTWARE\\WOW6432Node\\ODBC\\ODBC.INI\\*",
                       "HKLM\\SYSTEM\\ControlSet001\\Control\\Session Manager\\PendingFileRenameOperations",
                       "HKLM\\SYSTEM\\ControlSet001\\Services\\mrxsmb10\\Start",
                       "HKLM\\SOFTWARE\\WOW6432Node\\JavaSoft\\*",
                       "HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon\\UserLockInternetURL",
                       "HKLM\\SYSTEM\\ControlSet001\\Services\\MTAppManager\\ImagePath",
                       "HKLM\\SYSTEM\\ControlSet001\\Services\\MAST\\ImagePath",
                       "HKLM\\SYSTEM\\ControlSet001\\Services\\VMagicPPII\\ImagePath",
                       "HKLM\\SYSTEM\\ControlSet001\\Services\\MEDITECH*",
                       "HKLM\\SYSTEM\\ControlSet001\\Services\\ANPServer*",
                       "HKLM\\SYSTEM\\ControlSet001\\Services\\MSO\\ImagePath",
                       "HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Print\\Printers\\*\\sPMigratedPrinterName")
'''

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

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


[threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1021"
name = "Remote Services"
reference = "https://attack.mitre.org/techniques/T1021/"
[[threat.technique.subtechnique]]
id = "T1021.003"
name = "Distributed Component Object Model"
reference = "https://attack.mitre.org/techniques/T1021/003/"



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

[internal]
min_endpoint_version = "8.7.0"

Stages and Predicates

Stage 1: registry

registry where event.action == "modification" and user.id : ("S-1-5-21*", "S-1-12-*") and
 process.name : "svchost.exe" and process.thread.Ext.call_stack_summary : "*regsvc.dll|rpcrt4.dll*" and
 (
  registry.data.strings : ("*:\\*\\*", "*.exe*", "*.dll*", "*rundll32*", "*powershell*", "*.exe*http*", "* /c *", "*COMSPEC*", "\\\\*.*",
                           "*Version=*Culture=*PublicKeyToken=*") or
  registry.path :
         ("HKLM\\SYSTEM\\ControlSet*\\Services\\*\\ServiceDLL",
          "HKLM\\SYSTEM\\ControlSet*\\Services\\*\\ImagePath",
          "HKEY_USERS\\*Classes\\*\\InprocServer32\\",
          "HKEY_USERS\\*Classes\\*\\LocalServer32\\",
          "HKLM\\SOFTWARE\\Classes\\CLSID\\*\\AppID",
          "HKLM\\SOFTWARE\\WOW6432Node\\Classes\\CLSID\\*\\AppID",
          "HKLM\\SOFTWARE\\Classes\\CLSID\\*\\InprocServer32*",
          "HKLM\\SOFTWARE\\WOW6432Node\\Classes\\CLSID\\*\\InprocServer32*",
          "HKLM\\SOFTWARE\\Classes\\AppID\\*\\DllSurrogate",
          "H*\\Software\\Microsoft\\Windows\\CurrentVersion\\Run\\*",
          "HKLM\\SOFTWARE\\Classes\\AppID\\*",
          "HKEY_USERS\\*Classes\\AppID\\*",
          "HKLM\\SYSTEM\\ControlSet*\\Control\\Lsa\\*") or
  (registry.value : "Start" and registry.data.strings : "4")
  ) and
  not registry.data.strings : "C:\\Windows\\System32\\svchost.exe -k localService" and
  not registry.path : ("HKLM\\SOFTWARE\\Microsoft\\SMS\\*",
                       "HKLM\\SYSTEM\\*ControlSet*\\Services\\EventLog\\*",
                       "HKLM\\SOFTWARE\\EMCO\\Remote Agents\\Remote Installer\\*",
                       "HKLM\\SOFTWARE\\Microsoft\\Service Fabric\\*",
                       "HKLM\\SOFTWARE\\WOW6432Node\\Varonis\\*",
                       "HKLM\\SOFTWARE\\Varonis\\*",
                       "HKLM\\SOFTWARE\\JavaSoft\\*",
                       "HKLM\\SOFTWARE\\WOW6432Node\\ODBC\\ODBC.INI\\*",
                       "HKLM\\SYSTEM\\ControlSet001\\Control\\Session Manager\\PendingFileRenameOperations",
                       "HKLM\\SYSTEM\\ControlSet001\\Services\\mrxsmb10\\Start",
                       "HKLM\\SOFTWARE\\WOW6432Node\\JavaSoft\\*",
                       "HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon\\UserLockInternetURL",
                       "HKLM\\SYSTEM\\ControlSet001\\Services\\MTAppManager\\ImagePath",
                       "HKLM\\SYSTEM\\ControlSet001\\Services\\MAST\\ImagePath",
                       "HKLM\\SYSTEM\\ControlSet001\\Services\\VMagicPPII\\ImagePath",
                       "HKLM\\SYSTEM\\ControlSet001\\Services\\MEDITECH*",
                       "HKLM\\SYSTEM\\ControlSet001\\Services\\ANPServer*",
                       "HKLM\\SYSTEM\\ControlSet001\\Services\\MSO\\ImagePath",
                       "HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Print\\Printers\\*\\sPMigratedPrinterName")

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • modification corpus 72 (elastic 72)
field:"EventType" kind:eq value:"modification"
process.namewildcard
  • svchost.exe corpus 21 (elastic 20, splunk 1)
field:"process_basename" kind:wildcard value:"svchost.exe"
process.thread.Ext.call_stack_summarywildcard
  • *regsvc.dll|rpcrt4.dll*
field:"process.thread.Ext.call_stack_summary" kind:wildcard value:"*regsvc.dll|rpcrt4.dll*"
registry.data.stringswildcard
  • * /c *
  • *.dll* corpus 2 (elastic 2)
  • *.exe* corpus 2 (elastic 2)
  • *.exe*http*
  • *:\*\*
  • *COMSPEC*
  • *Version=*Culture=*PublicKeyToken=*
  • *powershell* corpus 3 (elastic 3)
  • *rundll32* corpus 3 (elastic 3)
  • 4 corpus 6 (elastic 6)
  • \\*.*
field:"Details" kind:wildcard
registry.pathwildcard
  • H*\Software\Microsoft\Windows\CurrentVersion\Run\* corpus 12 (elastic 12)
  • HKEY_USERS\*Classes\*\InprocServer32\ corpus 4 (elastic 4)
  • HKEY_USERS\*Classes\*\LocalServer32\ corpus 2 (elastic 2)
  • HKEY_USERS\*Classes\AppID\*
  • HKLM\SOFTWARE\Classes\AppID\*
  • HKLM\SOFTWARE\Classes\AppID\*\DllSurrogate
  • HKLM\SOFTWARE\Classes\CLSID\*\AppID
  • HKLM\SOFTWARE\Classes\CLSID\*\InprocServer32*
  • HKLM\SOFTWARE\WOW6432Node\Classes\CLSID\*\AppID
  • HKLM\SOFTWARE\WOW6432Node\Classes\CLSID\*\InprocServer32*
  • HKLM\SYSTEM\ControlSet*\Control\Lsa\*
  • HKLM\SYSTEM\ControlSet*\Services\*\ImagePath corpus 4 (elastic 4)
  • HKLM\SYSTEM\ControlSet*\Services\*\ServiceDLL corpus 3 (elastic 3)
field:"TargetObject" kind:wildcard
registry.valuewildcard
  • Start corpus 5 (elastic 3, splunk 2)
field:"registry_value_name" kind:wildcard value:"Start"
user.idwildcard
  • S-1-12-* corpus 25 (elastic 25)
  • S-1-5-21* corpus 26 (elastic 26)
field:"user.id" kind:wildcard

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
registry.data.stringseqC:\Windows\System32\svchost.exe -k localServiceexcludes:registry.data.strings field:"registry.data.strings" value:"C:\Windows\System32\svchost.exe -k localService"
registry.pathwildcardHKLM\SOFTWARE\Microsoft\SMS\*, HKLM\SYSTEM\*ControlSet*\Services\EventLog\*, HKLM\SOFTWARE\EMCO\Remote Agents\Remote Installer\*, HKLM\SOFTWARE\Microsoft\Service Fabric\*, HKLM\SOFTWARE\WOW6432Node\Varonis\*, HKLM\SOFTWARE\Varonis\*, HKLM\SOFTWARE\JavaSoft\*, HKLM\SOFTWARE\WOW6432Node\ODBC\ODBC.INI\*, HKLM\SYSTEM\ControlSet001\Control\Session Manager\PendingFileRenameOperations, HKLM\SYSTEM\ControlSet001\Services\mrxsmb10\Start, HKLM\SOFTWARE\WOW6432Node\JavaSoft\*, HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\UserLockInternetURL, HKLM\SYSTEM\ControlSet001\Services\MTAppManager\ImagePath, HKLM\SYSTEM\ControlSet001\Services\MAST\ImagePath, HKLM\SYSTEM\ControlSet001\Services\VMagicPPII\ImagePath, HKLM\SYSTEM\ControlSet001\Services\MEDITECH*, HKLM\SYSTEM\ControlSet001\Services\ANPServer*, HKLM\SYSTEM\ControlSet001\Services\MSO\ImagePath, HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Printers\*\sPMigratedPrinterNameexcludes:registry.path

Suspicious SIP Check by macOS Application

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

Detects the unusual use of csrutil by a macOS application to check System Integrity Protection (SIP) status. While not malicious in itself, this activity is highly indicative of malware verifying it is not running in a virtual machine or protected environment prior to executing its payload.

MITRE ATT&CK Coverage

Telemetry Coverage

Rule Body

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

[rule]
author = ["Elastic"]
description = """
Detects the unusual use of csrutil by a macOS application to check System Integrity Protection (SIP) status. 
While not malicious in itself, this activity is highly indicative of malware verifying it is not running 
in a virtual machine or protected environment prior to executing its payload.
"""
from = "now-9m"
index = ["logs-endpoint.events.process-*"]
language = "eql"
license = "Elastic License v2"
name = "Suspicious SIP Check by macOS Application"
note = """ ## Triage and analysis

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

### Investigating Suspicious SIP Check by macOS Application

This rule detects a macOS application bundle launching `csrutil status` and explicitly parsing for “enabled,” an uncommon behavior that often signals preflight environment checks. Attackers use this to confirm System Integrity Protection constraints before deciding whether to attempt persistence, injection, or privilege escalation, or to abort execution to avoid analysis. A common pattern is a trojanized app from a mounted disk image performing the SIP check immediately after first launch, then conditionally unpacking and running a secondary payload.

### Possible investigation steps

- Identify the initiating application bundle and validate its provenance by reviewing its code signature, notarization status, Team ID, and download origin (e.g., Gatekeeper quarantine attributes and DMG mount source).  
- Build a short timeline around the SIP check to see what executed next from the same parent chain (new processes, scripts, installers, or command interpreters) and whether execution diverged after reading “enabled.”  
- Inspect the app’s bundle contents and related file activity for dropped binaries, launch agents/daemons, login items, or modified plist files that indicate persistence or staged payload execution.  
- Look for follow-on discovery and defense-evasion behavior on the host (e.g., VM/sandbox checks, system profiling, security tool enumeration, permission prompts abuse) that would support a malware preflight workflow.  
- If suspicious, isolate the host and collect the app bundle, associated DMG, and execution artifacts for detonation and reverse engineering, then hunt for the same app hash/Team ID across the fleet.

### False positive analysis

- A legitimate enterprise-managed macOS application performing a preflight compatibility or supportability check may invoke `csrutil status` and look for “enabled” to decide whether to proceed with installing drivers, configuring system settings, or enabling features that require SIP-related constraints awareness.  
- A user-initiated security/compliance workflow from a GUI app (e.g., a system configuration, diagnostic, or remediation utility distributed as an `.app` from `/Applications` or a mounted volume) may run `csrutil status` and parse for “enabled” to display a health report or to gate remediation instructions without any malicious follow-on activity.

### Response and remediation

- Isolate the affected macOS host from the network and prevent further execution by quitting the initiating `.app` and blocking its bundle identifier/hash via MDM/EDR policy.  
- Acquire and preserve artifacts for analysis, including the full `.app` bundle, the originating DMG/ZIP (if launched from `/Volumes`), Gatekeeper quarantine metadata, and recent install logs to trace the download source and execution chain.  
- Eradicate by removing the suspicious application and any follow-on components it created (new LaunchAgents/LaunchDaemons, Login Items, cron entries, and dropped executables in user and system Library paths), then terminate any child processes spawned after the SIP check.  
- Recover by reinstalling trusted software from known-good sources, rotating credentials used on the host since the first execution, and monitoring for re-creation of persistence files or repeated `csrutil status` checks from application bundles.  
- Escalate to incident response if the app is unsigned/notarization-failed, originates from a mounted volume or user Downloads, or if post-check activity includes attempts to modify security settings, write to persistence locations, or launch interpreters like `bash`, `zsh`, `python`, or `osascript`.  
- Harden by enforcing only notarized/signed app execution (Gatekeeper/MDM restrictions), blocking untrusted apps from removable/mounted volumes, and deploying detections for app-bundled execution of `csrutil` and subsequent persistence creation.
"""
risk_score = 47
rule_id = "1615230f-beb7-48d8-9b3f-6d10674703bf"
severity = "medium"
tags = [
    "Domain: Endpoint",
    "OS: macOS",
    "Use Case: Threat Detection",
    "Tactic: Discovery",
    "Tactic: Defense Evasion",
    "Data Source: Elastic Defend",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
process where host.os.type == "macos" and event.type == "start" and event.action == "exec" and
  process.command_line like "*csrutil*status*" and
  process.command_line like "*enabled*" and
  (process.parent.executable like "/*.app/*" or
   process.parent.executable like "/Applications/*.app/*" or
   process.parent.executable like "/Volumes/*.app/*") and
  not process.parent.executable == "/Library/Application Support/Mosyle/MosyleMDM.app/Contents/MacOS/MosyleMDM"
'''

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

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

[[rule.threat.technique]]
id = "T1497"
name = "Virtualization/Sandbox Evasion"
reference = "https://attack.mitre.org/techniques/T1497/"

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

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

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

[[rule.threat.technique]]
id = "T1497"
name = "Virtualization/Sandbox Evasion"
reference = "https://attack.mitre.org/techniques/T1497/"

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

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

Stages and Predicates

Stage 1: process

process where host.os.type == "macos" and event.type == "start" and event.action == "exec" and
  process.command_line like "*csrutil*status*" and
  process.command_line like "*enabled*" and
  (process.parent.executable like "/*.app/*" or
   process.parent.executable like "/Applications/*.app/*" or
   process.parent.executable like "/Volumes/*.app/*") and
  not process.parent.executable == "/Library/Application Support/Mosyle/MosyleMDM.app/Contents/MacOS/MosyleMDM"

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.command_linewildcard
  • *csrutil*status*
  • *enabled* corpus 2 (sigma 1, elastic 1)
field:"CommandLine" kind:wildcard
process.parent.executablewildcard
  • /*.app/*
  • /Applications/*.app/*
  • /Volumes/*.app/*
field:"ParentImage" kind:wildcard

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.parent.executableeq/Library/Application Support/Mosyle/MosyleMDM.app/Contents/MacOS/MosyleMDMexcludes:process.parent.executable field:"process.parent.executable" value:"/Library/Application Support/Mosyle/MosyleMDM.app/Contents/MacOS/MosyleMDM"

Suspicious Windows Script Base64 Encoding

#
Source
github.com/elastic/protections-artifacts

Detects the execution of a Windows script with base64 encoding along with other suspicious features like execution and download.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
Detects the execution of a Windows script with base64 encoding along with other suspicious features like execution and
download.
"""
id = "0c23f47e-2f47-48fb-b00c-201368a9975c"
license = "Elastic License v2"
name = "Suspicious Windows Script Base64 Encoding"
os_list = ["windows"]
version = "1.0.6"

query = '''
api where process.Ext.api.name == "AmsiScanBuffer" and process.executable != null and
 process.name in~ ("wscript.exe", "mshta.exe", "msxsl.exe") and
  (process.Ext.api.parameters.buffer : "*bin.base64*" and
   process.Ext.api.parameters.buffer : ("*.Run(*", "*.ShellExecute(*", "*.responseBody*", "*XMLHTTP*", "*WinHttp*", "*.responseText*", "*http:*", "https:*")) and

  not process.Ext.api.parameters.content_name : ("?:\\Program Files (x86)\\*", "?:\\Program Files\\*", "C:\\Windows\\IMECache\\*\\RunHidden.vbs") and
  not process.parent.executable :
                     ("?:\\Program Files\\HP\\*.exe",
                      "?:\\Program Files (x86)\\Tanium\\Tanium Client\\TaniumClient.exe",
                      "?:\\Program Files\\Bentley\\*.exe",
                      "?:\\Program Files\\System Center Operations Manager\\Gateway\\MonitoringHost.exe",
                      "?:\\Program Files\\Microsoft Monitoring Agent\\Agent\\MonitoringHost.exe",
                      "?:\\Program Files\\Common Files\\Bentley Shared\\CONNECTION Client\\Bentley.Connect.Client.exe",
                      "?:\\Program Files (x86)\\Bentley\\*.exe",
                      "?:\\Program Files\\Bentley\\*.exe",
                      "?:\\Windows\\LSDeployment\\RemoteDeployment*.exe")
'''

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

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



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

[internal]
min_endpoint_version = "8.16.0"

Stages and Predicates

Stage 1: api

api where process.Ext.api.name == "AmsiScanBuffer" and process.executable != null and
 process.name in~ ("wscript.exe", "mshta.exe", "msxsl.exe") and
  (process.Ext.api.parameters.buffer : "*bin.base64*" and
   process.Ext.api.parameters.buffer : ("*.Run(*", "*.ShellExecute(*", "*.responseBody*", "*XMLHTTP*", "*WinHttp*", "*.responseText*", "*http:*", "https:*")) and

  not process.Ext.api.parameters.content_name : ("?:\\Program Files (x86)\\*", "?:\\Program Files\\*", "C:\\Windows\\IMECache\\*\\RunHidden.vbs") and
  not process.parent.executable :
                     ("?:\\Program Files\\HP\\*.exe",
                      "?:\\Program Files (x86)\\Tanium\\Tanium Client\\TaniumClient.exe",
                      "?:\\Program Files\\Bentley\\*.exe",
                      "?:\\Program Files\\System Center Operations Manager\\Gateway\\MonitoringHost.exe",
                      "?:\\Program Files\\Microsoft Monitoring Agent\\Agent\\MonitoringHost.exe",
                      "?:\\Program Files\\Common Files\\Bentley Shared\\CONNECTION Client\\Bentley.Connect.Client.exe",
                      "?:\\Program Files (x86)\\Bentley\\*.exe",
                      "?:\\Program Files\\Bentley\\*.exe",
                      "?:\\Windows\\LSDeployment\\RemoteDeployment*.exe")

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
process.Ext.api.nameeq
  • AmsiScanBuffer corpus 18 (elastic 18)
field:"process.Ext.api.name" kind:eq value:"AmsiScanBuffer"
process.Ext.api.parameters.bufferwildcard
  • *.Run(*
  • *.ShellExecute(*
  • *.responseBody*
  • *.responseText*
  • *WinHttp*
  • *XMLHTTP*
  • *bin.base64*
  • *http:*
  • https:*
field:"process.Ext.api.parameters.buffer" kind:wildcard
process.executableis_not_null
  • (no value, null check)
field:"Image" kind:is_not_null
process.namein
  • mshta.exe corpus 27 (splunk 15, elastic 12)
  • msxsl.exe corpus 3 (elastic 3)
  • wscript.exe corpus 28 (elastic 14, splunk 14)
field:"process_basename" kind:in

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.Ext.api.parameters.content_namewildcard?:\Program Files (x86)\*, ?:\Program Files\*, C:\Windows\IMECache\*\RunHidden.vbsexcludes:process.Ext.api.parameters.content_name field:"process.Ext.api.parameters.content_name" value:"?:\Program Files (x86)\*" field:"process.Ext.api.parameters.content_name" value:"?:\Program Files\*" field:"process.Ext.api.parameters.content_name" value:"C:\Windows\IMECache\*\RunHidden.vbs"
process.parent.executablewildcard?:\Program Files\HP\*.exe, ?:\Program Files (x86)\Tanium\Tanium Client\TaniumClient.exe, ?:\Program Files\Bentley\*.exe, ?:\Program Files\System Center Operations Manager\Gateway\MonitoringHost.exe, ?:\Program Files\Microsoft Monitoring Agent\Agent\MonitoringHost.exe, ?:\Program Files\Common Files\Bentley Shared\CONNECTION Client\Bentley.Connect.Client.exe, ?:\Program Files (x86)\Bentley\*.exe, ?:\Program Files\Bentley\*.exe, ?:\Windows\LSDeployment\RemoteDeployment*.exeexcludes:process.parent.executable

Threat Intel Email Indicator Match

#
Status
production
Severity
high
Group by
email.from.address, email.reply_to.address, email.sender.address, email.to.address, threat.indicator.email.address
Author
Elastic
Source
github.com/elastic/detection-rules

This rule is triggered when an email indicator from the Threat Intel Filebeat module or integrations matches an event containing email-related data, such as logs from email security gateways or email service providers.

Rule Body

[metadata]
creation_date = "2025/04/11"
maturity = "production"
updated_date = "2025/04/22"

[rule]
author = ["Elastic"]
description = """
This rule is triggered when an email indicator from the Threat Intel Filebeat module or integrations matches an event
containing email-related data, such as logs from email security gateways or email service providers.
"""
from = "now-65m"
index = ["filebeat-*", "logs-*"]
interval = "1h"
language = "kuery"
license = "Elastic License v2"
name = "Threat Intel Email Indicator Match"
note = """## Triage and analysis

### Investigating Threat Intel Email Indicator Match Match

Threat Intel indicator match rules allow matching from a local observation, such as an endpoint event that records a file hash, with an entry of a file hash stored within the Threat Intel integrations index.

Matches are based on threat intelligence data that's been ingested during the last 30 days. Some integrations don't place expiration dates on their threat indicators, so we strongly recommend validating ingested threat indicators and reviewing match results. When reviewing match results, check associated activity to determine whether the event requires additional investigation.

This rule is triggered when an email indicator from the Threat Intel Filebeat module or integrations matches an event containing email-related data, such as logs from email security gateways or email service providers.

#### Possible investigation steps

- Investigate the email indicator, which can be found in the threat.indicator.matched.atomic field:
  - Determine the nature of the email-based threat (phishing, spam, BEC, malware attachment, etc.).
  - Check the reputation of the email address, domain, and IP in threat intel platforms such as VirusTotal, AbuseIPDB, Cisco Talos, and others.
  - Perform a WHOIS lookup on the sending domain to gather registration info and potential abuse contacts.
  - Review historical context: Has this email indicator been observed in other events or associated with known campaigns?
- If the event is potentially phishing or BEC-related:
  - Contact the recipient to gather additional context (did they interact with the email, click links, open attachments, reply, etc.).
  - Review the email headers and content to identify spoofing tactics, display name impersonation, or suspicious links/domains.
  - Analyze the email body and any attachments for signs of malicious intent or social engineering techniques.
  - Extract and investigate any embedded links, attachments, or payloads for further IOCs.
- Check logs from email security gateways and mail servers for:
  - Additional recipients or similar messages sent in the same timeframe.
  - Delivery status and any filtering or quarantine actions taken.

### False Positive Analysis

- False positives may occur when email indicators match legitimate communications.
- Some threat intelligence feeds may mistakenly include benign or internal email addresses, domains, or sender infrastructure (e.g., noreply@yourdomain.com, legitimate SaaS providers, or shared mail services). Always validate indicators before taking enforcement actions.
- Review the context of the match: Consider whether the sender domain or address is part of a known legitimate service, commonly used internally, or associated with a partner/vendor.
- Blocking or alerting based on common email domains or infrastructure (e.g., mail gateways, newsletters, cloud-based platforms) without proper validation can lead to disruptions in communication.

### Response and Remediation

- Initiate the incident response process based on the outcome of the triage.
- If a user interacted with the malicious email (clicked a link, opened an attachment, replied, etc.), isolate the involved host to prevent further post-compromise behavior.
- If the triage identified malware, search the environment for additional compromised hosts.
  - Implement temporary email filters and segmentation to prevent further delivery or spread.
  - Stop suspicious processes associated with any attachments or payloads.
  - Immediately block the identified indicators of compromise (IoCs), including sender addresses, domains, URLs, and file hashes.
  - Inspect affected systems for additional backdoors, such as reverse shells, droppers, or tunneling tools that could enable reinfection or remote access.
- Consider reporting the sender address or domain for abuse using WHOIS or relevant abuse reporting services.
- Remove and block malicious artifacts identified during triage, including phishing emails, attachments, and URLs.
- Run a full antimalware scan. This may reveal additional artifacts, persistence mechanisms, or malware components on the system.
- Determine the initial vector abused by the attacker—e.g., bypassed email filters, spoofed domain, etc.—and take action to prevent reinfection through the same vector.
- Using the incident response data, update logging and audit policies to improve the mean time to detect (MTTD) and the mean time to respond (MTTR).
"""
references = [
    "https://www.elastic.co/guide/en/beats/filebeat/current/filebeat-module-threatintel.html",
    "https://www.elastic.co/guide/en/security/current/es-threat-intel-integrations.html",
    "https://www.elastic.co/security/tip",
]
risk_score = 73
rule_id = "fcf18de8-ad7d-4d01-b3f7-a11d5b3883af"
setup = """## Setup

This rule needs threat intelligence indicators to work.
Threat intelligence indicators can be collected using an [Elastic Agent integration](https://www.elastic.co/guide/en/security/current/es-threat-intel-integrations.html#agent-ti-integration),
the [Threat Intel module](https://www.elastic.co/guide/en/security/current/es-threat-intel-integrations.html#ti-mod-integration),
or a [custom integration](https://www.elastic.co/guide/en/security/current/es-threat-intel-integrations.html#custom-ti-integration).

More information can be found [here](https://www.elastic.co/guide/en/security/current/es-threat-intel-integrations.html).
"""
severity = "high"
tags = ["Rule Type: Threat Match", "Resources: Investigation Guide"]
threat_index = ["filebeat-*", "logs-ti_*"]
threat_indicator_path = "threat.indicator"
threat_language = "kuery"
threat_query = """
@timestamp >= "now-30d/d" and event.module:(threatintel or ti_*) and threat.indicator.email.address:* and not
labels.is_ioc_transform_source:"true"
"""
timeline_id = "495ad7a7-316e-4544-8a0f-9c098daee76e"
timeline_title = "Generic Threat Match Timeline"
timestamp_override = "event.ingested"
type = "threat_match"

query = '''
email.from.address:* or email.sender.address:* or email.reply_to.address:* or email.to.address:*
'''


[[rule.threat_filters]]

[rule.threat_filters."$state"]
store = "appState"
[rule.threat_filters.meta]
disabled = false
key = "event.category"
negate = false
type = "phrase"
[rule.threat_filters.meta.params]
query = "threat"
[rule.threat_filters.query.match_phrase]
"event.category" = "threat"
[[rule.threat_filters]]

[rule.threat_filters."$state"]
store = "appState"
[rule.threat_filters.meta]
disabled = false
key = "event.kind"
negate = false
type = "phrase"
[rule.threat_filters.meta.params]
query = "enrichment"
[rule.threat_filters.query.match_phrase]
"event.kind" = "enrichment"
[[rule.threat_filters]]

[rule.threat_filters."$state"]
store = "appState"
[rule.threat_filters.meta]
disabled = false
key = "event.type"
negate = false
type = "phrase"
[rule.threat_filters.meta.params]
query = "indicator"
[rule.threat_filters.query.match_phrase]
"event.type" = "indicator"
[[rule.threat_mapping]]

[[rule.threat_mapping.entries]]
type = "mapping"
field = "email.from.address"
value = "threat.indicator.email.address"

[[rule.threat_mapping]]

[[rule.threat_mapping.entries]]
type = "mapping"
field = "email.to.address"
value = "threat.indicator.email.address"


[[rule.threat_mapping]]

[[rule.threat_mapping.entries]]
type = "mapping"
field = "email.sender.address"
value = "threat.indicator.email.address"

[[rule.threat_mapping]]

[[rule.threat_mapping.entries]]
type = "mapping"
field = "email.reply_to.address"
value = "threat.indicator.email.address"

Stages and Predicates

Stage 1: threat_match:event

(email.from.address:* or email.reply_to.address:* or email.sender.address:* or email.to.address:*)

Stage 2: threat_match:indicator

(event.module:"threatintel" or event.module:ti_*) and not labels.is_ioc_transform_source:true and @timestamp >= "now-30d/d" and threat.indicator.email.address:*

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
labels.is_ioc_transform_sourceeqtrueexcludes:labels.is_ioc_transform_source field:"labels.is_ioc_transform_source" value:"true"

Unusual Dylib Load from Users Shared Directory

#
Source
github.com/elastic/protections-artifacts

Detects when a dylib gets loaded from an unusual location ("/usr/local/lib") by an application in the /Users/Shared directory. This is highly uncommon and has been used by the LightSpy malware when loading post-exploitation modules.

MITRE ATT&CK Coverage

TacticTechniques
Stealth

Rule Body

[rule]
description = """
Detects when a dylib gets loaded from an unusual location ("/usr/local/lib") by an application in the /Users/Shared
directory. This is highly uncommon and has been used by the LightSpy malware when loading post-exploitation modules.
"""
id = "99ab55b4-03c9-4d1c-8766-6cf6d01fd5a2"
license = "Elastic License v2"
name = "Unusual Dylib Load from Users Shared Directory"
os_list = ["macos"]
reference = ["https://www.huntress.com/blog/lightspy-malware-variant-targeting-macos"]
version = "1.0.5"

query = '''
library where event.action == "load" and dll.path like "/usr/local/lib/*" and 
 (process.executable like "/Users/Shared/*" or Effective_process.executable like "/Users/Shared/*")
'''

min_endpoint_version = "8.11.1"
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 = "T1574"
name = "Hijack Execution Flow"
reference = "https://attack.mitre.org/techniques/T1574/"


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

[internal]
min_endpoint_version = "8.11.1"

Stages and Predicates

Stage 1: library

library where event.action == "load" and dll.path like "/usr/local/lib/*" and 
 (process.executable like "/Users/Shared/*" or Effective_process.executable like "/Users/Shared/*")

Indicators

These rows show field, operator, and value matches.

Unusual Persistence via Services Registry

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

Identifies processes modifying the services registry key directly, instead of through the expected Windows APIs. This could be an indication of an adversary attempting to stealthily persist through abnormal service creation or modification of an existing service.

MITRE ATT&CK Coverage

Telemetry Coverage

Rule Body

[metadata]
creation_date = "2020/11/18"
integration = ["endpoint", "windows", "m365_defender", "sentinel_one_cloud_funnel"]
maturity = "production"
updated_date = "2026/05/04"

[rule]
author = ["Elastic"]
description = """
Identifies processes modifying the services registry key directly, instead of through the expected Windows APIs. This
could be an indication of an adversary attempting to stealthily persist through abnormal service creation or
modification of an existing service.
"""
from = "now-9m"
index = [
    "logs-endpoint.events.registry-*",
    "endgame-*",
    "logs-windows.sysmon_operational-*",
    "winlogbeat-*",
    "logs-m365_defender.event-*",
    "logs-sentinel_one_cloud_funnel.*",
]
language = "eql"
license = "Elastic License v2"
name = "Unusual Persistence via Services Registry"
note = """## Triage and analysis

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

### Investigating Unusual Persistence via Services Registry

Windows services are crucial for running background processes. Adversaries may exploit this by directly altering service registry keys to maintain persistence, bypassing standard APIs. The detection rule identifies such anomalies by monitoring changes to specific registry paths and filtering out legitimate processes, thus highlighting potential unauthorized service modifications indicative of malicious activity.

### Possible investigation steps

- Review the specific registry paths and values that triggered the alert, focusing on "ServiceDLL" and "ImagePath" within the specified registry paths to identify any unauthorized or suspicious modifications.
- Examine the process responsible for the registry change, paying attention to the process name and executable path, to determine if it is a known legitimate process or potentially malicious.
- Cross-reference the process executable path against the list of known legitimate paths excluded in the query to ensure it is not a false positive.
- Investigate the historical behavior of the process and any associated files or network activity to identify patterns indicative of malicious intent or persistence mechanisms.
- Check for any recent changes or anomalies in the system's service configurations that could correlate with the registry modifications, indicating potential unauthorized service creation or alteration.
- Consult threat intelligence sources or databases to determine if the process or registry changes are associated with known malware or adversary techniques.

### False positive analysis

- Legitimate software installations or updates may modify service registry keys directly. Users can create exceptions for known software update processes by excluding their executables from the detection rule.
- System maintenance tools like Process Explorer may trigger false positives when they interact with service registry keys. Exclude these tools by adding their process names and paths to the exception list.
- Drivers installed by trusted hardware peripherals might alter service registry keys. Users should identify and exclude these driver paths if they are known to be safe and frequently updated.
- Custom enterprise applications that require direct registry modifications for service management can be excluded by specifying their executable paths in the rule exceptions.
- Regular system processes such as svchost.exe or services.exe are already excluded, but ensure any custom scripts or automation tools that mimic these processes are also accounted for in the exceptions.

### Response and remediation

- Isolate the affected system from the network to prevent further unauthorized access or lateral movement by the adversary.
- Terminate any suspicious processes identified in the alert that are not part of legitimate applications or services.
- Restore the modified registry keys to their original state using a known good backup or by manually correcting the entries to ensure the integrity of the service configurations.
- Conduct a thorough scan of the affected system using updated antivirus and anti-malware tools to identify and remove any additional malicious software or artifacts.
- Review and update endpoint protection policies to ensure that similar unauthorized registry modifications are detected and blocked in the future.
- Escalate the incident to the security operations center (SOC) or incident response team for further analysis and to determine if additional systems are affected.
- Document the incident details, including the steps taken for containment and remediation, to enhance future response efforts and update threat intelligence databases."""
risk_score = 21
rule_id = "403ef0d3-8259-40c9-a5b6-d48354712e49"
severity = "low"
tags = [
    "Domain: Endpoint",
    "OS: Windows",
    "Use Case: Threat Detection",
    "Tactic: Persistence",
    "Tactic: Defense Evasion",
    "Data Source: Elastic Endgame",
    "Data Source: Elastic Defend",
    "Data Source: Sysmon",
    "Data Source: Microsoft Defender XDR",
    "Data Source: SentinelOne",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"

query = '''
registry where host.os.type == "windows" and event.type == "change" and
  registry.data.strings != null and registry.value : ("ServiceDLL", "ImagePath") and
  registry.path : (
      "HKLM\\SYSTEM\\ControlSet*\\Services\\*\\ServiceDLL",
      "HKLM\\SYSTEM\\ControlSet*\\Services\\*\\ImagePath",
      "\\REGISTRY\\MACHINE\\SYSTEM\\ControlSet*\\Services\\*\\ServiceDLL",
      "\\REGISTRY\\MACHINE\\SYSTEM\\ControlSet*\\Services\\*\\ImagePath",
      "MACHINE\\SYSTEM\\ControlSet*\\Services\\*\\ServiceDLL",
      "MACHINE\\SYSTEM\\ControlSet*\\Services\\*\\ImagePath"
  ) and not registry.data.strings : (
      "?:\\windows\\system32\\Drivers\\*.sys",
      "\\SystemRoot\\System32\\drivers\\*.sys",
      "\\??\\?:\\Windows\\system32\\Drivers\\*.SYS",
      "\\??\\?:\\Windows\\syswow64\\*.sys",
      "system32\\DRIVERS\\USBSTOR", 
      "system32\\drivers\\*.sys", 
      "C:\\WindowsAzure\\GuestAgent*.exe", 
      "\"C:\\Program Files\\Common Files\\McAfee\\*", 
      "C:\\Program Files (x86)\\VERITAS\\VxPBX\\bin\\pbx_exchange.exe", 
      "\"C:\\Program Files (x86)\\VERITAS\\VxPBX\\bin\\pbx_exchange.exe\"",
      "\"C:\\ProgramData\\McAfee\\Agent\\Current\\*") and
  not (process.name : "procexp??.exe" and registry.data.strings : "?:\\*\\procexp*.sys") and
  not process.executable : (
      "?:\\Program Files\\*.exe",
      "?:\\Program Files (x86)\\*.exe",
      "?:\\Windows\\System32\\svchost.exe",
      "?:\\Windows\\winsxs\\*\\TiWorker.exe",
      "?:\\Windows\\System32\\drvinst.exe",
      "?:\\Windows\\System32\\services.exe",
      "?:\\Windows\\System32\\msiexec.exe",
      "?:\\Windows\\System32\\regsvr32.exe",
      "?:\\Windows\\System32\\WaaSMedicAgent.exe", 
      "?:\\Windows\\UUS\\amd64\\WaaSMedicAgent.exe"
  )
'''

setup = """## Setup

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

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

### Additional data sources

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

- [Microsoft Defender XDR](https://ela.st/m365-defender)
- [SentinelOne Cloud Funnel](https://ela.st/sentinel-one-cloud-funnel)
- [Sysmon Registry Events](https://ela.st/sysmon-event-reg-setup)
"""


[[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.technique]]
id = "T1574"
name = "Hijack Execution Flow"
reference = "https://attack.mitre.org/techniques/T1574/"

[[rule.threat.technique.subtechnique]]
id = "T1574.011"
name = "Services Registry Permissions Weakness"
reference = "https://attack.mitre.org/techniques/T1574/011/"

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

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

[[rule.threat.technique]]
id = "T1112"
name = "Modify Registry"
reference = "https://attack.mitre.org/techniques/T1112/"

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

Stages and Predicates

Stage 1: registry

registry where host.os.type == "windows" and event.type == "change" and
  registry.data.strings != null and registry.value : ("ServiceDLL", "ImagePath") and
  registry.path : (
      "HKLM\\SYSTEM\\ControlSet*\\Services\\*\\ServiceDLL",
      "HKLM\\SYSTEM\\ControlSet*\\Services\\*\\ImagePath",
      "\\REGISTRY\\MACHINE\\SYSTEM\\ControlSet*\\Services\\*\\ServiceDLL",
      "\\REGISTRY\\MACHINE\\SYSTEM\\ControlSet*\\Services\\*\\ImagePath",
      "MACHINE\\SYSTEM\\ControlSet*\\Services\\*\\ServiceDLL",
      "MACHINE\\SYSTEM\\ControlSet*\\Services\\*\\ImagePath"
  ) and not registry.data.strings : (
      "?:\\windows\\system32\\Drivers\\*.sys",
      "\\SystemRoot\\System32\\drivers\\*.sys",
      "\\??\\?:\\Windows\\system32\\Drivers\\*.SYS",
      "\\??\\?:\\Windows\\syswow64\\*.sys",
      "system32\\DRIVERS\\USBSTOR", 
      "system32\\drivers\\*.sys", 
      "C:\\WindowsAzure\\GuestAgent*.exe", 
      "\"C:\\Program Files\\Common Files\\McAfee\\*", 
      "C:\\Program Files (x86)\\VERITAS\\VxPBX\\bin\\pbx_exchange.exe", 
      "\"C:\\Program Files (x86)\\VERITAS\\VxPBX\\bin\\pbx_exchange.exe\"",
      "\"C:\\ProgramData\\McAfee\\Agent\\Current\\*") and
  not (process.name : "procexp??.exe" and registry.data.strings : "?:\\*\\procexp*.sys") and
  not process.executable : (
      "?:\\Program Files\\*.exe",
      "?:\\Program Files (x86)\\*.exe",
      "?:\\Windows\\System32\\svchost.exe",
      "?:\\Windows\\winsxs\\*\\TiWorker.exe",
      "?:\\Windows\\System32\\drvinst.exe",
      "?:\\Windows\\System32\\services.exe",
      "?:\\Windows\\System32\\msiexec.exe",
      "?:\\Windows\\System32\\regsvr32.exe",
      "?:\\Windows\\System32\\WaaSMedicAgent.exe", 
      "?:\\Windows\\UUS\\amd64\\WaaSMedicAgent.exe"
  )

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.typeeq
  • change corpus 89 (elastic 89)
field:"event.type" kind:eq value:"change"
registry.data.stringsis_not_null
  • (no value, null check)
field:"Details" kind:is_not_null
registry.pathwildcard
  • HKLM\SYSTEM\ControlSet*\Services\*\ImagePath corpus 4 (elastic 4)
  • HKLM\SYSTEM\ControlSet*\Services\*\ServiceDLL corpus 3 (elastic 3)
  • MACHINE\SYSTEM\ControlSet*\Services\*\ImagePath
  • MACHINE\SYSTEM\ControlSet*\Services\*\ServiceDLL
  • \REGISTRY\MACHINE\SYSTEM\ControlSet*\Services\*\ImagePath
  • \REGISTRY\MACHINE\SYSTEM\ControlSet*\Services\*\ServiceDLL
field:"TargetObject" kind:wildcard
registry.valuewildcard
  • ImagePath corpus 4 (elastic 2, splunk 2)
  • ServiceDLL corpus 2 (elastic 2)
field:"registry_value_name" kind:wildcard

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.nameeqprocexp??.exeexcludes:process.name field:"process.name" value:"procexp??.exe"
registry.data.stringswildcard?:\*\procexp*.sysexcludes:registry.data.strings field:"registry.data.strings" value:"?:\*\procexp*.sys"
process.executablewildcard?:\Program Files\*.exe, ?:\Program Files (x86)\*.exe, ?:\Windows\System32\svchost.exe, ?:\Windows\winsxs\*\TiWorker.exe, ?:\Windows\System32\drvinst.exe, ?:\Windows\System32\services.exe, ?:\Windows\System32\msiexec.exe, ?:\Windows\System32\regsvr32.exe, ?:\Windows\System32\WaaSMedicAgent.exe, ?:\Windows\UUS\amd64\WaaSMedicAgent.exeexcludes:process.executable
registry.data.stringswildcard?:\windows\system32\Drivers\*.sys, \SystemRoot\System32\drivers\*.sys, \??\?:\Windows\system32\Drivers\*.SYS, \??\?:\Windows\syswow64\*.sys, system32\DRIVERS\USBSTOR, system32\drivers\*.sys, C:\WindowsAzure\GuestAgent*.exe, "C:\Program Files\Common Files\McAfee\*, C:\Program Files (x86)\VERITAS\VxPBX\bin\pbx_exchange.exe, "C:\Program Files (x86)\VERITAS\VxPBX\bin\pbx_exchange.exe", "C:\ProgramData\McAfee\Agent\Current\*excludes:registry.data.strings

User Keychain Exfiltration via Curl

#
Source
github.com/elastic/protections-artifacts

Detects when curl or nscurl is executed with the user's keychain database file path in the command line, indicating potential exfiltration of sensitive credentials. This technique is commonly observed in npm typosquatting attacks and macOS stealers where malicious packages use curl to upload the keychain database to attacker-controlled servers. The macOS keychain contains highly sensitive credential data including passwords, certificates, and encryption keys that adversaries seek to exfiltrate for further compromise.

MITRE ATT&CK Coverage

Telemetry Coverage

Rule Body

[rule]
description = """
Detects when curl or nscurl is executed with the user's keychain database file path in the command line, indicating
potential exfiltration of sensitive credentials. This technique is commonly observed in npm typosquatting attacks and
macOS stealers where malicious packages use curl to upload the keychain database to attacker-controlled servers. The
macOS keychain contains highly sensitive credential data including passwords, certificates, and encryption keys that
adversaries seek to exfiltrate for further compromise.
"""
id = "de452505-4d5a-4d44-90ff-56b4912a20f3"
license = "Elastic License v2"
name = "User Keychain Exfiltration via Curl"
os_list = ["macos"]
reference = [
    "https://socket.dev/blog/10-npm-typosquatted-packages-deploy-credential-harvester",
    "https://hunt.io/blog/macos-malware-impersonates-the-unarchiver-app-to-steal-user-data",
]
version = "1.0.1"

query = '''
process where event.type == "start" and event.action == "exec" and process.name in ("curl", "nscurl") and process.command_line : "*/Users/*/Library/Keychains/login.keychain-db*"
'''

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

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1555"
name = "Credentials from Password Stores"
reference = "https://attack.mitre.org/techniques/T1555/"
[[threat.technique.subtechnique]]
id = "T1555.001"
name = "Keychain"
reference = "https://attack.mitre.org/techniques/T1555/001/"



[threat.tactic]
id = "TA0006"
name = "Credential Access"
reference = "https://attack.mitre.org/tactics/TA0006/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1048"
name = "Exfiltration Over Alternative Protocol"
reference = "https://attack.mitre.org/techniques/T1048/"


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

[internal]
min_endpoint_version = "8.16.0"

Stages and Predicates

Stage 1: process

process where event.type == "start" and event.action == "exec" and process.name in ("curl", "nscurl") and process.command_line : "*/Users/*/Library/Keychains/login.keychain-db*"

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.command_linewildcard
  • */Users/*/Library/Keychains/login.keychain-db* corpus 2 (elastic 2)
field:"CommandLine" kind:wildcard value:"*/Users/*/Library/Keychains/login.keychain-db*"
process.namein
  • curl corpus 82 (elastic 82)
  • nscurl corpus 41 (elastic 41)
field:"process_basename" kind:in

Back to all Elastic rules