Detection rules › Elastic

Elastic rules: 2n

Accessing Outlook Data Files

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

Identifies commands containing references to Outlook data files extensions, which can potentially indicate the search, access, or modification of these files.

MITRE ATT&CK Coverage

Telemetry Coverage

Rule Body

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

[rule]
author = ["Elastic"]
building_block_type = "default"
description = """
Identifies commands containing references to Outlook data files extensions, which can potentially indicate the search,
access, or modification of these files.
"""
from = "now-119m"
index = [
    "endgame-*",
    "logs-endpoint.events.process-*",
    "logs-system.security*",
    "logs-windows.sysmon_operational-*",
    "winlogbeat-*",
]
interval = "60m"
language = "eql"
license = "Elastic License v2"
name = "Accessing Outlook Data Files"
risk_score = 21
rule_id = "2e311539-cd88-4a85-a301-04f38795007c"
severity = "low"
tags = [
    "Domain: Endpoint",
    "OS: Windows",
    "Use Case: Threat Detection",
    "Tactic: Collection",
    "Data Source: Elastic Defend",
    "Rule Type: BBR",
    "Data Source: Sysmon",
    "Data Source: Elastic Endgame",
    "Data Source: Windows Security Event Logs",
]
timestamp_override = "event.ingested"
type = "eql"

query = '''
process where host.os.type == "windows" and event.type == "start" and process.args : ("*.ost", "*.pst") and
  not process.name : "outlook.exe" and
  not (
        process.name : "rundll32.exe" and
        process.args : "*davclnt.dll,DavSetCookie*"
  )
'''


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

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

[[rule.threat.technique]]
id = "T1114"
name = "Email Collection"
reference = "https://attack.mitre.org/techniques/T1114/"

[[rule.threat.technique.subtechnique]]
id = "T1114.001"
name = "Local Email Collection"
reference = "https://attack.mitre.org/techniques/T1114/001/"

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

Stages and Predicates

Stage 1: process

process where host.os.type == "windows" and event.type == "start" and process.args : ("*.ost", "*.pst") and
  not process.name : "outlook.exe" and
  not (
        process.name : "rundll32.exe" and
        process.args : "*davclnt.dll,DavSetCookie*"
  )

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
  • *.ost
  • *.pst
field:"process.args" kind:wildcard

Exclusions

The rule actively suppresses these predicates.

AWS Configuration Recorder Stopped

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

Identifies when an AWS Config configuration recorder is stopped. AWS Config recorders continuously track and record configuration changes across supported AWS resources. Stopping the recorder immediately reduces visibility into infrastructure changes and can be abused by adversaries to evade detection, obscure follow-on activity, or weaken compliance and security monitoring controls.

Known False Positives

  • Authorized administrators may temporarily stop the AWS Config recorder during planned maintenance, account restructuring, or controlled configuration changes. Automated infrastructure or compliance tooling may also stop and restart the recorder as part of setup or teardown workflows. Activity outside of documented change windows or from unexpected identities should be investigated.

MITRE ATT&CK Coverage

Telemetry Coverage

Rules Detecting the Same Action

These rules filter on the same operation.

Rule Body

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

[rule]
author = ["Elastic"]
description = """
Identifies when an AWS Config configuration recorder is stopped. AWS Config recorders continuously track and record
configuration changes across supported AWS resources. Stopping the recorder immediately reduces visibility into
infrastructure changes and can be abused by adversaries to evade detection, obscure follow-on activity, or weaken
compliance and security monitoring controls.
"""
false_positives = [
    """
    Authorized administrators may temporarily stop the AWS Config recorder during planned maintenance, account
    restructuring, or controlled configuration changes. Automated infrastructure or compliance tooling may also stop and
    restart the recorder as part of setup or teardown workflows. Activity outside of documented change windows or from
    unexpected identities should be investigated.
    """,
]
from = "now-6m"
index = ["filebeat-*", "logs-aws.cloudtrail-*"]
language = "kuery"
license = "Elastic License v2"
name = "AWS Configuration Recorder Stopped"
note = """## Triage and analysis

### Investigating AWS Configuration Recorder Stopped

AWS Config provides continuous visibility into resource configuration changes and underpins many security, compliance,
and audit workflows. Stopping the configuration recorder prevents new changes from being captured and can create blind
spots in detection and forensic timelines.

This behavior is uncommon in steady-state production environments and should be carefully reviewed, especially when
performed outside approved maintenance windows or by unexpected principals.

### Possible investigation steps

**Identify the actor**
- Review `aws.cloudtrail.user_identity.arn` and `aws.cloudtrail.user_identity.access_key_id`
  to determine who initiated the `StopConfigurationRecorder` action. Confirm whether this principal typically administers AWS Config or performs security and compliance operations.

**Examine the request context**
- Review `user_agent.original` to determine whether the request originated from the AWS Console, CLI, SDK, or automation tooling.
- Inspect `source.ip` and any available geo context to assess whether the request originated from an expected network or region.

**Determine scope and impact**
- Identify which configuration recorder was stopped and which regions or resources were affected.
- Determine how long the recorder remained disabled and whether any configuration changes occurred during that window.
- Assess whether AWS Config rules, Security Hub controls, or downstream monitoring systems were impacted.

**Correlate with related activity**
- Look for surrounding CloudTrail activity from the same principal, including:
  - Deletion or modification of Config rules, delivery channels, or conformance packs.
  - IAM changes, credential activity, or other security control modifications.
- Check for signs of follow-on activity that may have relied on reduced visibility, such as resource creation, policy changes,
  or network reconfiguration.

**Validate intent**
- Confirm with the platform, security, or compliance teams whether the recorder stoppage was intentional and approved.
- Compare the timing against change management records, infrastructure deployments, or account bootstrapping workflows.

### False positive analysis

- Planned maintenance or controlled configuration changes may require temporarily stopping the recorder.
- Automated account provisioning, teardown, or remediation tooling may stop and restart the recorder as part of normal workflows.

### Response and remediation

- Immediately restart the AWS Config recorder to restore configuration visibility.
- Review CloudTrail logs for activity that occurred while the recorder was stopped and assess potential security or compliance impact.
- If the action was unauthorized, rotate or disable credentials associated with the initiating principal and investigate for compromise.
- Review IAM permissions to ensure only a minimal set of trusted roles can stop or modify AWS Config components.
- Implement guardrails such as AWS Config rules, SCPs, or automated remediation to detect and respond to recorder stoppage.
- Update monitoring, alerting, and incident response runbooks to explicitly cover AWS Config visibility loss scenarios.

### Additional information
- **[AWS IR Playbooks](https://github.com/aws-samples/aws-incident-response-playbooks/blob/c151b0dc091755fffd4d662a8f29e2f6794da52c/playbooks/)** 
- **[AWS Customer Playbook Framework](https://github.com/aws-samples/aws-customer-playbook-framework/tree/a8c7b313636b406a375952ac00b2d68e89a991f2/docs)** 
- **[AWS Knowledge Center – Security Best Practices](https://aws.amazon.com/premiumsupport/knowledge-center/security-best-practices/)**
"""
references = [
    "https://awscli.amazonaws.com/v2/documentation/api/latest/reference/configservice/stop-configuration-recorder.html",
    "https://docs.aws.amazon.com/config/latest/APIReference/API_StopConfigurationRecorder.html",
]
risk_score = 73
rule_id = "fbd44836-0d69-4004-a0b4-03c20370c435"
severity = "high"
tags = [
    "Domain: Cloud",
    "Data Source: AWS",
    "Data Source: Amazon Web Services",
    "Data Source: AWS Config",
    "Tactic: Defense Evasion",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "query"

query = '''
data_stream.dataset: aws.cloudtrail 
    and event.provider: config.amazonaws.com 
    and event.action: StopConfigurationRecorder 
    and event.outcome: success
'''


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

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



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

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

Stages and Predicates

Stage 1: query

data_stream.dataset: aws.cloudtrail 
    and event.provider: config.amazonaws.com 
    and event.action: StopConfigurationRecorder 
    and event.outcome: success

Indicators

These rows show field, operator, and value matches.

AWS IAM Login Profile Added to User

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

Identifies when an AWS IAM login profile is added to a user. Adversaries may add a login profile to an IAM user who typically does not have one and is used only for programmatic access. This can be used to maintain access to the account even if the original access key is rotated or disabled. This is a building block rule and does not generate alerts on its own. It is meant to be used for correlation with other rules to detect suspicious activity.

MITRE ATT&CK Coverage

Telemetry Coverage

Rules Detecting the Same Action

These rules filter on the same operation.

Rule Body

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

[rule]
author = ["Elastic"]
building_block_type = "default"
description = """
Identifies when an AWS IAM login profile is added to a user. Adversaries may add a login profile to an IAM user who
typically does not have one and is used only for programmatic access. This can be used to maintain access to the account
even if the original access key is rotated or disabled. This is a building block rule and does not generate alerts on
its own. It is meant to be used for correlation with other rules to detect suspicious activity.
"""
from = "now-60m"
index = ["filebeat-*", "logs-aws.cloudtrail-*"]
interval = "10m"
language = "kuery"
license = "Elastic License v2"
name = "AWS IAM Login Profile Added to User"
risk_score = 21
rule_id = "10445cf0-0748-11ef-ba75-f661ea17fbcc"
severity = "low"
tags = [
    "Domain: Cloud",
    "Platform: AWS",
    "Data Source: AWS CloudTrail",
    "Service: AWS IAM",
    "Tactic: Persistence",
    "Rule Type: BBR",
]
timestamp_override = "event.ingested"
type = "query"

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


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

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

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

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

[[rule.threat.technique.subtechnique]]
id = "T1098.001"
name = "Additional Cloud Credentials"
reference = "https://attack.mitre.org/techniques/T1098/001/"

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

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

Stages and Predicates

Stage 1: query

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

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

Direct Syscall from Unsigned Module

#
Source
github.com/elastic/protections-artifacts

Identifies the call of commonly abused Windows APIs to perform code injection and where the call stack not starting with Windows NT syscall DLLs such as ntdll and win32u. This may indicate the use of direct system calls to evade endpoint security solutions hooking Windows APIs.

MITRE ATT&CK Coverage

TacticTechniques
Stealth

Rule Body

[rule]
description = """
Identifies the call of commonly abused Windows APIs to perform code injection and where the call stack not starting with
Windows NT syscall DLLs such as ntdll and win32u. This may indicate the use of direct system calls to evade endpoint
security solutions hooking Windows APIs.
"""
id = "fe44381a-435c-4e19-ad89-40ac3750f514"
license = "Elastic License v2"
name = "Direct Syscall from Unsigned Module"
os_list = ["windows"]
reference = [
    "https://www.elastic.co/security-labs/doubling-down-etw-callstacks",
    "https://www.ired.team/offensive-security/defense-evasion/using-syscalls-directly-from-visual-studio-to-bypass-avs-edrs",
]
version = "1.0.26"

query = '''
api where process.Ext.api.behaviors == "direct_syscall" and
    process.Ext.api.name in ("VirtualAlloc", "VirtualProtect", "MapViewOfFile", "MapViewOfFile2") and
    not _arraysearch(process.thread.Ext.call_stack_final_user_module.code_signature, $entry, $entry.status like ("trusted", "errorCode_endpoint*")) and
    startswith(process.thread.Ext.call_stack_summary, process.thread.Ext.call_stack_final_user_module.name) and
    not process.thread.Ext.call_stack_final_user_module.path like "?:\\windows\\assembly\\nativeimages_*" and
    process.thread.Ext.call_stack_final_user_module.hash.sha256 != null and
    process.thread.Ext.call_stack_final_user_module.protection_provenance != "Kernel" and
    not process.thread.Ext.call_stack_final_user_module.hash.sha256 in
                                 ("f0d37ab8636685fdf3c81f2f1df5fb0a2cdba6e6daf10200c250a31a822f0f10",
                                  "8f7b60cb0dc32277e6e99ebfee047d5a587050a1fcd5c2f98be7204898d7b25d",
                                  "dc1abae9fce7e192232a5be12c6096338529b327ad749e310e7375106e013579",
                                  "f0d37ab8636685fdf3c81f2f1df5fb0a2cdba6e6daf10200c250a31a822f0f10",
                                  "8f7b60cb0dc32277e6e99ebfee047d5a587050a1fcd5c2f98be7204898d7b25d",
                                  "f1f2ab4ee6f0350d6db84a9983f5c734ef32958c848a472931f03ff733b5a5e7",
                                  "99d836285aa612c98765ac6a538aa3ed74bf435b157311c65577949d794eac8b",
                                  "f7fc4fbdd1706f443868047def63c1e9a746a0be2fac0577ce197e84c8b0a3ce",
                                  "2e6febc71362a72e7bed50c8ffbbaef70f3b8ea542a309b9bf32b337b534e0b4",
                                  "ca1b969a9ba62164ddb7fc5d315b0b82d8506238b15bbd7dd88857ef6acd367a",
                                  "2a44a8af200c4ee36de4b0f91471ffca82ce25e0fe90401d64a9d4c01b9f9525",
                                  "a14fd3fd3bd83ac7789295978bc2bfeed80657cc0298b8314dbb02ee19ca73fd",
                                  "6dbf510f4f0ced77341146b24a9b0c320b516ade2248defa09931ea413f8b20e",
                                  "abfa585a5358e658bd92d159e9f846b2950c7e300c47392283443a1bcb70fd52",
                                  "a62ceea27ff8a0dcc0432fd171f8549d38f69e7233415cfe446305aa9e553970",
                                  "d2a55e2d77369b71f90f8840c6b7d0a2739981283e6d77a3350a80de21125b3f",
                                  "dc55eebfbddaee583a29f17610ef15397b97d37d7d4027d2060d6e88c4eb1182",
                                  "bee2f0a5e13b857d749232273e7c45d597fb858bf0f0a72c793e1c37237675aa",
                                  "6cfc98d1ffcdb983e64beac75ccde7d873e3c41fffde2f4d87dd0757eb5a620d",
                                  "155954174a6fa52ec64ca44e4d77f387e7c9f363541c81a4a7812d9c783af3ca",
                                  "8e619459168a1edc8de86d29cb557388d89cdebefae1d001ba394079a7622511",
                                  "5f51051b50e1d9bb9c47089d5774ff3e491be45eeaf40cba7fd86c5d4fa8635d",
                                  "d5693df142632f807bd5707cb5ee58e9edaaa3a40e84cd5c070ec63412820af9",
                                  "f06bc48095cd11e51714d08b8889c32a058282fdb90487ada823a6550089df96",
                                  "aad7e7ac9d74ac18892801950c9728e9c4eacd3b676cbb5d6f63382da2ce0559",
                                  "79364f3e140abd46d8d1bedd21db9646ab55cf35783ef7926a235fa7e1fe6797",
                                  "c56440ab3d623249aabaec871a5da8eccb61dc6a0b3166c972d8c86e7d646ef4",
                                  "ea71387e40682bcc23f676df2b856dca15853aeb854b94168c85bc0479ef1aed",
                                  "ae8a5d43dfc2e8bac34a415449fa67b300cdf9e2995b0e8ec38cd8d0694da7ae",
                                  "3034311292fade8a24ab8e7312cfb7132153c14b9383439b527e8296fe06a492",
                                  "51855557b6215ae93482598f5de7e4875a8612d1a2645893905f0c35d321fd73",
                                  "19b7261bb6162e32eaaf7727d2f77b4647d95ff7554300726e2649ffa99b6eec",
                                  "79b62fd3ed24ca4778dc0261c7570e71f3d0c83913c38f58ab1660dc7a670aee",
                                  "ce0f4cd9d9af178aead83df4f46146f1c66cc2c3e600c8aafa0a392fc5ad9637",
                                  "c572cbc2269ef4adca064f23edd04bbd360fb0e8de40abe90c2be35265fffd3f",
                                  "9a2678818bdc614eab85cddb993daa4c783cd36d8c3eda95c2506a7e6e24698b",
                                  "d0fe1eecad868460c162fd40cacf2ac954008b2de1234b2d1cd3b1e361f5e6c0",
                                  "5c55fe4218757fea3012295b8284e967852f4df0c622b173dbdb51012edeeee0",
                                  "4ae78c687615e7dc4c268d3eee519a19aa581e701b7e46e4bc7ee79501e83ad5",
                                  "ecce95f1b2383a852c1b2226970453494c5bf315c2e0b2adda7e3142e028791e",
                                  "545a3aec876c49c56693f48f5fde740487330ca097775d9a434157aabf25db10",
                                  "a543689f34083f810e0184ec77d8ee9e57d44ebd6212af444853a3a89a3c82c0",
                                  "5a8ae397c178fe9397a41b71b2046ded55feb409fadc30f4053194802f5c2dcd",
                                  "60feb037f14dcc3d1f9adfc35647633cab48a652221b8e2e3c5d68b4313d7d0a",
                                  "03c77f2408290a5b734a86d6a1bfc97739e2f54f165ae333c4eddb380e0adef7",
                                  "d01b8dc8fbf8139a8b0c59a038c7ca755a87630ed242c306fb2b53985e545685",
                                  "ea5f2055397fc76db031de944b10a27a6a7975713f2902df3a3970b65e271b4f",
                                  "d01b8dc8fbf8139a8b0c59a038c7ca755a87630ed242c306fb2b53985e545685",
                                  "ec5e3f367dc8663405dd3f3549e8b8d65d772b148e1e6d7d17ea4fdf5a95195c",
                                  "7024db838ba2d2abb1ff1f96a91b0359cbc7f56d4acfc6c8d851d70fa8b49a1c",
                                  "1bb34f11b79fad256ca2e72ea7bcc618815632d585538e1e601c7fc5512ba72d",
                                  "b72a06025452c94223100a34efacddf3d81cf57f3941fa1f2a6dce66b9b54d5b",
                                  "9c1b56c021a7fdf1d1aa008834499046227ace6f6c7d976ef89d27a84858fdb0",
                                  "0743c51969f7d6eb123a60a8ae9e2451bbd0859b89a57c93cbf9c6e904d6defc",
                                  "bc0715826ce01c4782065a28eaef6547dc60cd60b6069ef76e5a26635e510256",
                                  "6e0f6c689e9b80c69445b574e705f79044c5fd148b9912c79f1381e96fe6edcb",
                                  "c717ae53f81fbb66d2554e3c65c295cb2c98e9c817df9c0cdd378d92b5471d5c",
                                  "50e219e52377465a403da3e1275c10579b3042bfbd03ae383648a81b53b4586e",
                                  "58ac11fdd8de211df2a12d1dc8dafcab56ffdbcec0d0f41b4125de191b4f2180",
                                  "1ba0f1f7aef9c790ad3e431b0850a51da6348e3a65c8620997f737b43215547b",
                                  "94e333beccbc0d7199d0a9bf13922ef8f388e1d7f7e055ad8ec8ca6160b50067",
                                  "3613fc46eab116864d28b7a3af1b7301fc0309bf3ba99c661a8c36ad5c848d02",
                                  "98a27a37c5dbe1e115a0f43d2f0cc8afd332e3e5fb5e4c37e09e83e35dc8efb3",
                                  "56b848c3c125a2a666b13e22ba75df2b3609632d5989bc57a8d5566924829373",
                                  "dfc43850daabf4fec146d04a4c62b3a8679639d2cfa399d005e9fdd5387c2fac",
                                  "2a373bf09a7f1d8abf1dafc50df8dadc073b9a9ec1283efcfc42fd5d66f2c57d",
                                  "72c9da48314a77642d5505d019f454fd32f0933ed8a056fb9c9a18818eb4a6f5",
                                  "e540127862940234446ef7a919f7295a52e751e14f184e779a8b4b2dffb78978",
                                  "f9674626d17346629508557918209728fc2a571aeed62201887281aa992758e8",
                                  "f80c57719e52bbbd9d10aaabf9e30db7b76fabd5d0cb73f2a78b96d5613befc4",
                                  "4706af5ee53476bc4701b81aff0f5f655aea433f1de39365bef271b24a29cd85",
                                  "6fd1551bc0b7b588dabe1865a7a333a4987c552f4aa05b30cb92fbb33c03603e",
                                  "a32c3fbbf74699a10e7642bf4901191f29c88c5aec93ae7ba28c79ab28462a69",
                                  "30a7ee75311049b34c6240646cc01235fd9860b98c73c267ae7ffc4350aa0825",
                                  "7e562fc41c9e36fbe0b06339e57cb842354a61b6c21bd975eb56ad550615a5f6",
                                  "7a96d50d91310903f591478e7d1513be5689f1ecf59fe752fbaa6cb4ba8820ce",
                                  "ae885757debdc97de2498d84cfb0b7f05e6af00ec14030b1fe678276518f56b0",
                                  "1b5d9cec668335295c8e575bcedf4afcedbc445d8ccf8374c9380188965e78e3",
                                  "f6391baaf220428eab56c30d45d53fc76e651c1b2e66f2908a312526a1e45331",
                                  "79b73fa504fdc7c41be70f74c6ded66e12f271d3bb8afb5c1c94a6eb4514f0cf",
                                  "1c2cf78885c0487e28fdcd201dca52a6dbded5eeb108e4638ddc867fac473e37",
                                  "b1ce6d1ccf9f48f3ff3f45d94e088fc2fc964e55ee8f97c08c1c1adfb9c9328e",
                                  "e4edc03903a3463425bf570ca35f66f2acbb8ba8b9c1757adb4a9e6f0a070f45",
                                  "701d795207cfc31e2ace3823d9793edf3f8a5d1521acb64bb26f7e25c2871599",
                                  "e825c36285a43e15aa5bbf270ff12a3323bb444d173621ab8158d05808bdaaf0",
                                  "a6d3a9ae1527b586691d2d3b678279385e434beea0afa114b0a06e64a7f2148d",
                                  "26234e9692dc1a048d143518306f83a4192a260b5b884aeef28478e40d209239",
                                  "669ee31e18f1901098d0b296e0ebbe38b5602bf4c17000dda9409aa5bd64133a",
                                  "499b68eb465d06a2b23c2da325786e15d721c3a0d7a32ce6f57305886cfb09d8",
                                  "22121600323bc22f24944a97e0ea4b8b2250b9541f0505c1f1569ac8e585659f",
                                  "5b4f622cb9b451a6427fc9caebecd7662ec14af325697c4619ec61b7117d6273",
                                  "da7dfd4b7df4f2813428306649b10d1f2d6d71c1d43c5cfffe880101d62d7b08",
                                  "7920398ba4c6a03a55c394145444fc5d475301fb5393e96a2b1667a9bbda1ac5",
                                  "17a410b194cecfc6b771c14679944fc58911d528c2a7946a480e2ce3bc6e8bcf",
                                  "549d3a52cd9b25d24fc547f25a9e6615501a18142baa362199f4f82577a48edf",
                                  "018de92d5333ec58cc4620f1a7e0212b8883fe61b1af06af5d741b665d65b6ff",
                                  "25db6d97dcec8e306149c19b9dd7e3f4818a58b57b6a9f192bd7529123bc4f24",
                                  "76fcb15956144d5477d4636ee09ce3db64597c7ccdf840163862fa837534bdd1",
                                  "2898c1471434df740f2ac0d561c5f4c17d1b8fc5ec17cd1e267afed6eadb9ff7") and
    not (process.Ext.api.name == "VirtualProtect" and process.Ext.api.metadata.target_address_name == "terminal64.exe" and
         process.thread.Ext.call_stack_final_user_module.name == "terminal64.exe") and
    not (process.Ext.api.name == "VirtualProtect" and process.thread.Ext.call_stack_summary == "Unbacked") and
    not (process.thread.Ext.call_stack_final_user_module.name == "Unbacked" and
         (process.thread.Ext.call_stack_final_user_module.protection_provenance_path like "c:\\windows\\assembly\\nativeimages_*.ni.dll" or
          process.thread.Ext.call_stack_final_user_module.protection_provenance == "system.transactions.ni.dll"))
'''

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


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

[internal]
min_endpoint_version = "8.14.2"

Stages and Predicates

Stage 1: api

api where process.Ext.api.behaviors == "direct_syscall" and
    process.Ext.api.name in ("VirtualAlloc", "VirtualProtect", "MapViewOfFile", "MapViewOfFile2") and
    not _arraysearch(process.thread.Ext.call_stack_final_user_module.code_signature, $entry, $entry.status like ("trusted", "errorCode_endpoint*")) and
    startswith(process.thread.Ext.call_stack_summary, process.thread.Ext.call_stack_final_user_module.name) and
    not process.thread.Ext.call_stack_final_user_module.path like "?:\\windows\\assembly\\nativeimages_*" and
    process.thread.Ext.call_stack_final_user_module.hash.sha256 != null and
    process.thread.Ext.call_stack_final_user_module.protection_provenance != "Kernel" and
    not process.thread.Ext.call_stack_final_user_module.hash.sha256 in
                                 ("f0d37ab8636685fdf3c81f2f1df5fb0a2cdba6e6daf10200c250a31a822f0f10",
                                  "8f7b60cb0dc32277e6e99ebfee047d5a587050a1fcd5c2f98be7204898d7b25d",
                                  "dc1abae9fce7e192232a5be12c6096338529b327ad749e310e7375106e013579",
                                  "f0d37ab8636685fdf3c81f2f1df5fb0a2cdba6e6daf10200c250a31a822f0f10",
                                  "8f7b60cb0dc32277e6e99ebfee047d5a587050a1fcd5c2f98be7204898d7b25d",
                                  "f1f2ab4ee6f0350d6db84a9983f5c734ef32958c848a472931f03ff733b5a5e7",
                                  "99d836285aa612c98765ac6a538aa3ed74bf435b157311c65577949d794eac8b",
                                  "f7fc4fbdd1706f443868047def63c1e9a746a0be2fac0577ce197e84c8b0a3ce",
                                  "2e6febc71362a72e7bed50c8ffbbaef70f3b8ea542a309b9bf32b337b534e0b4",
                                  "ca1b969a9ba62164ddb7fc5d315b0b82d8506238b15bbd7dd88857ef6acd367a",
                                  "2a44a8af200c4ee36de4b0f91471ffca82ce25e0fe90401d64a9d4c01b9f9525",
                                  "a14fd3fd3bd83ac7789295978bc2bfeed80657cc0298b8314dbb02ee19ca73fd",
                                  "6dbf510f4f0ced77341146b24a9b0c320b516ade2248defa09931ea413f8b20e",
                                  "abfa585a5358e658bd92d159e9f846b2950c7e300c47392283443a1bcb70fd52",
                                  "a62ceea27ff8a0dcc0432fd171f8549d38f69e7233415cfe446305aa9e553970",
                                  "d2a55e2d77369b71f90f8840c6b7d0a2739981283e6d77a3350a80de21125b3f",
                                  "dc55eebfbddaee583a29f17610ef15397b97d37d7d4027d2060d6e88c4eb1182",
                                  "bee2f0a5e13b857d749232273e7c45d597fb858bf0f0a72c793e1c37237675aa",
                                  "6cfc98d1ffcdb983e64beac75ccde7d873e3c41fffde2f4d87dd0757eb5a620d",
                                  "155954174a6fa52ec64ca44e4d77f387e7c9f363541c81a4a7812d9c783af3ca",
                                  "8e619459168a1edc8de86d29cb557388d89cdebefae1d001ba394079a7622511",
                                  "5f51051b50e1d9bb9c47089d5774ff3e491be45eeaf40cba7fd86c5d4fa8635d",
                                  "d5693df142632f807bd5707cb5ee58e9edaaa3a40e84cd5c070ec63412820af9",
                                  "f06bc48095cd11e51714d08b8889c32a058282fdb90487ada823a6550089df96",
                                  "aad7e7ac9d74ac18892801950c9728e9c4eacd3b676cbb5d6f63382da2ce0559",
                                  "79364f3e140abd46d8d1bedd21db9646ab55cf35783ef7926a235fa7e1fe6797",
                                  "c56440ab3d623249aabaec871a5da8eccb61dc6a0b3166c972d8c86e7d646ef4",
                                  "ea71387e40682bcc23f676df2b856dca15853aeb854b94168c85bc0479ef1aed",
                                  "ae8a5d43dfc2e8bac34a415449fa67b300cdf9e2995b0e8ec38cd8d0694da7ae",
                                  "3034311292fade8a24ab8e7312cfb7132153c14b9383439b527e8296fe06a492",
                                  "51855557b6215ae93482598f5de7e4875a8612d1a2645893905f0c35d321fd73",
                                  "19b7261bb6162e32eaaf7727d2f77b4647d95ff7554300726e2649ffa99b6eec",
                                  "79b62fd3ed24ca4778dc0261c7570e71f3d0c83913c38f58ab1660dc7a670aee",
                                  "ce0f4cd9d9af178aead83df4f46146f1c66cc2c3e600c8aafa0a392fc5ad9637",
                                  "c572cbc2269ef4adca064f23edd04bbd360fb0e8de40abe90c2be35265fffd3f",
                                  "9a2678818bdc614eab85cddb993daa4c783cd36d8c3eda95c2506a7e6e24698b",
                                  "d0fe1eecad868460c162fd40cacf2ac954008b2de1234b2d1cd3b1e361f5e6c0",
                                  "5c55fe4218757fea3012295b8284e967852f4df0c622b173dbdb51012edeeee0",
                                  "4ae78c687615e7dc4c268d3eee519a19aa581e701b7e46e4bc7ee79501e83ad5",
                                  "ecce95f1b2383a852c1b2226970453494c5bf315c2e0b2adda7e3142e028791e",
                                  "545a3aec876c49c56693f48f5fde740487330ca097775d9a434157aabf25db10",
                                  "a543689f34083f810e0184ec77d8ee9e57d44ebd6212af444853a3a89a3c82c0",
                                  "5a8ae397c178fe9397a41b71b2046ded55feb409fadc30f4053194802f5c2dcd",
                                  "60feb037f14dcc3d1f9adfc35647633cab48a652221b8e2e3c5d68b4313d7d0a",
                                  "03c77f2408290a5b734a86d6a1bfc97739e2f54f165ae333c4eddb380e0adef7",
                                  "d01b8dc8fbf8139a8b0c59a038c7ca755a87630ed242c306fb2b53985e545685",
                                  "ea5f2055397fc76db031de944b10a27a6a7975713f2902df3a3970b65e271b4f",
                                  "d01b8dc8fbf8139a8b0c59a038c7ca755a87630ed242c306fb2b53985e545685",
                                  "ec5e3f367dc8663405dd3f3549e8b8d65d772b148e1e6d7d17ea4fdf5a95195c",
                                  "7024db838ba2d2abb1ff1f96a91b0359cbc7f56d4acfc6c8d851d70fa8b49a1c",
                                  "1bb34f11b79fad256ca2e72ea7bcc618815632d585538e1e601c7fc5512ba72d",
                                  "b72a06025452c94223100a34efacddf3d81cf57f3941fa1f2a6dce66b9b54d5b",
                                  "9c1b56c021a7fdf1d1aa008834499046227ace6f6c7d976ef89d27a84858fdb0",
                                  "0743c51969f7d6eb123a60a8ae9e2451bbd0859b89a57c93cbf9c6e904d6defc",
                                  "bc0715826ce01c4782065a28eaef6547dc60cd60b6069ef76e5a26635e510256",
                                  "6e0f6c689e9b80c69445b574e705f79044c5fd148b9912c79f1381e96fe6edcb",
                                  "c717ae53f81fbb66d2554e3c65c295cb2c98e9c817df9c0cdd378d92b5471d5c",
                                  "50e219e52377465a403da3e1275c10579b3042bfbd03ae383648a81b53b4586e",
                                  "58ac11fdd8de211df2a12d1dc8dafcab56ffdbcec0d0f41b4125de191b4f2180",
                                  "1ba0f1f7aef9c790ad3e431b0850a51da6348e3a65c8620997f737b43215547b",
                                  "94e333beccbc0d7199d0a9bf13922ef8f388e1d7f7e055ad8ec8ca6160b50067",
                                  "3613fc46eab116864d28b7a3af1b7301fc0309bf3ba99c661a8c36ad5c848d02",
                                  "98a27a37c5dbe1e115a0f43d2f0cc8afd332e3e5fb5e4c37e09e83e35dc8efb3",
                                  "56b848c3c125a2a666b13e22ba75df2b3609632d5989bc57a8d5566924829373",
                                  "dfc43850daabf4fec146d04a4c62b3a8679639d2cfa399d005e9fdd5387c2fac",
                                  "2a373bf09a7f1d8abf1dafc50df8dadc073b9a9ec1283efcfc42fd5d66f2c57d",
                                  "72c9da48314a77642d5505d019f454fd32f0933ed8a056fb9c9a18818eb4a6f5",
                                  "e540127862940234446ef7a919f7295a52e751e14f184e779a8b4b2dffb78978",
                                  "f9674626d17346629508557918209728fc2a571aeed62201887281aa992758e8",
                                  "f80c57719e52bbbd9d10aaabf9e30db7b76fabd5d0cb73f2a78b96d5613befc4",
                                  "4706af5ee53476bc4701b81aff0f5f655aea433f1de39365bef271b24a29cd85",
                                  "6fd1551bc0b7b588dabe1865a7a333a4987c552f4aa05b30cb92fbb33c03603e",
                                  "a32c3fbbf74699a10e7642bf4901191f29c88c5aec93ae7ba28c79ab28462a69",
                                  "30a7ee75311049b34c6240646cc01235fd9860b98c73c267ae7ffc4350aa0825",
                                  "7e562fc41c9e36fbe0b06339e57cb842354a61b6c21bd975eb56ad550615a5f6",
                                  "7a96d50d91310903f591478e7d1513be5689f1ecf59fe752fbaa6cb4ba8820ce",
                                  "ae885757debdc97de2498d84cfb0b7f05e6af00ec14030b1fe678276518f56b0",
                                  "1b5d9cec668335295c8e575bcedf4afcedbc445d8ccf8374c9380188965e78e3",
                                  "f6391baaf220428eab56c30d45d53fc76e651c1b2e66f2908a312526a1e45331",
                                  "79b73fa504fdc7c41be70f74c6ded66e12f271d3bb8afb5c1c94a6eb4514f0cf",
                                  "1c2cf78885c0487e28fdcd201dca52a6dbded5eeb108e4638ddc867fac473e37",
                                  "b1ce6d1ccf9f48f3ff3f45d94e088fc2fc964e55ee8f97c08c1c1adfb9c9328e",
                                  "e4edc03903a3463425bf570ca35f66f2acbb8ba8b9c1757adb4a9e6f0a070f45",
                                  "701d795207cfc31e2ace3823d9793edf3f8a5d1521acb64bb26f7e25c2871599",
                                  "e825c36285a43e15aa5bbf270ff12a3323bb444d173621ab8158d05808bdaaf0",
                                  "a6d3a9ae1527b586691d2d3b678279385e434beea0afa114b0a06e64a7f2148d",
                                  "26234e9692dc1a048d143518306f83a4192a260b5b884aeef28478e40d209239",
                                  "669ee31e18f1901098d0b296e0ebbe38b5602bf4c17000dda9409aa5bd64133a",
                                  "499b68eb465d06a2b23c2da325786e15d721c3a0d7a32ce6f57305886cfb09d8",
                                  "22121600323bc22f24944a97e0ea4b8b2250b9541f0505c1f1569ac8e585659f",
                                  "5b4f622cb9b451a6427fc9caebecd7662ec14af325697c4619ec61b7117d6273",
                                  "da7dfd4b7df4f2813428306649b10d1f2d6d71c1d43c5cfffe880101d62d7b08",
                                  "7920398ba4c6a03a55c394145444fc5d475301fb5393e96a2b1667a9bbda1ac5",
                                  "17a410b194cecfc6b771c14679944fc58911d528c2a7946a480e2ce3bc6e8bcf",
                                  "549d3a52cd9b25d24fc547f25a9e6615501a18142baa362199f4f82577a48edf",
                                  "018de92d5333ec58cc4620f1a7e0212b8883fe61b1af06af5d741b665d65b6ff",
                                  "25db6d97dcec8e306149c19b9dd7e3f4818a58b57b6a9f192bd7529123bc4f24",
                                  "76fcb15956144d5477d4636ee09ce3db64597c7ccdf840163862fa837534bdd1",
                                  "2898c1471434df740f2ac0d561c5f4c17d1b8fc5ec17cd1e267afed6eadb9ff7") and
    not (process.Ext.api.name == "VirtualProtect" and process.Ext.api.metadata.target_address_name == "terminal64.exe" and
         process.thread.Ext.call_stack_final_user_module.name == "terminal64.exe") and
    not (process.Ext.api.name == "VirtualProtect" and process.thread.Ext.call_stack_summary == "Unbacked") and
    not (process.thread.Ext.call_stack_final_user_module.name == "Unbacked" and
         (process.thread.Ext.call_stack_final_user_module.protection_provenance_path like "c:\\windows\\assembly\\nativeimages_*.ni.dll" or
          process.thread.Ext.call_stack_final_user_module.protection_provenance == "system.transactions.ni.dll"))

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.thread.Ext.call_stack_final_user_module.protection_provenanceeqsystem.transactions.ni.dllexcludes:process.thread.Ext.call_stack_final_user_module.protection_provenance field:"process.thread.Ext.call_stack_final_user_module.protection_provenance" value:"system.transactions.ni.dll"
process.thread.Ext.call_stack_final_user_module.protection_provenance_pathwildcardc:\windows\assembly\nativeimages_*.ni.dllexcludes:process.thread.Ext.call_stack_final_user_module.protection_provenance_path field:"process.thread.Ext.call_stack_final_user_module.protection_provenance_path" value:"c:\windows\assembly\nativeimages_*.ni.dll"
process.thread.Ext.call_stack_final_user_module.nameeqUnbackedexcludes:process.thread.Ext.call_stack_final_user_module.name field:"process.thread.Ext.call_stack_final_user_module.name" value:"Unbacked"
process.Ext.api.metadata.target_address_nameeqterminal64.exeexcludes:process.Ext.api.metadata.target_address_name field:"process.Ext.api.metadata.target_address_name" value:"terminal64.exe"
process.Ext.api.nameeqVirtualProtectexcludes:process.Ext.api.name field:"process.Ext.api.name" value:"VirtualProtect"
process.thread.Ext.call_stack_final_user_module.nameeqterminal64.exeexcludes:process.thread.Ext.call_stack_final_user_module.name field:"process.thread.Ext.call_stack_final_user_module.name" value:"terminal64.exe"
process.thread.Ext.call_stack_summaryeqUnbackedexcludes:process.thread.Ext.call_stack_summary field:"process.thread.Ext.call_stack_summary" value:"Unbacked"
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.sha256in018de92d5333ec58cc4620f1a7e0212b8883fe61b1af06af5d741b665d65b6ff, 03c77f2408290a5b734a86d6a1bfc97739e2f54f165ae333c4eddb380e0adef7, 0743c51969f7d6eb123a60a8ae9e2451bbd0859b89a57c93cbf9c6e904d6defc, 155954174a6fa52ec64ca44e4d77f387e7c9f363541c81a4a7812d9c783af3ca, 17a410b194cecfc6b771c14679944fc58911d528c2a7946a480e2ce3bc6e8bcf, 19b7261bb6162e32eaaf7727d2f77b4647d95ff7554300726e2649ffa99b6eec, 1b5d9cec668335295c8e575bcedf4afcedbc445d8ccf8374c9380188965e78e3, 1ba0f1f7aef9c790ad3e431b0850a51da6348e3a65c8620997f737b43215547b, 1bb34f11b79fad256ca2e72ea7bcc618815632d585538e1e601c7fc5512ba72d, 1c2cf78885c0487e28fdcd201dca52a6dbded5eeb108e4638ddc867fac473e37, 22121600323bc22f24944a97e0ea4b8b2250b9541f0505c1f1569ac8e585659f, 25db6d97dcec8e306149c19b9dd7e3f4818a58b57b6a9f192bd7529123bc4f24, 26234e9692dc1a048d143518306f83a4192a260b5b884aeef28478e40d209239, 2898c1471434df740f2ac0d561c5f4c17d1b8fc5ec17cd1e267afed6eadb9ff7, 2a373bf09a7f1d8abf1dafc50df8dadc073b9a9ec1283efcfc42fd5d66f2c57d, 2a44a8af200c4ee36de4b0f91471ffca82ce25e0fe90401d64a9d4c01b9f9525, 2e6febc71362a72e7bed50c8ffbbaef70f3b8ea542a309b9bf32b337b534e0b4, 3034311292fade8a24ab8e7312cfb7132153c14b9383439b527e8296fe06a492, 30a7ee75311049b34c6240646cc01235fd9860b98c73c267ae7ffc4350aa0825, 3613fc46eab116864d28b7a3af1b7301fc0309bf3ba99c661a8c36ad5c848d02, 4706af5ee53476bc4701b81aff0f5f655aea433f1de39365bef271b24a29cd85, 499b68eb465d06a2b23c2da325786e15d721c3a0d7a32ce6f57305886cfb09d8, 4ae78c687615e7dc4c268d3eee519a19aa581e701b7e46e4bc7ee79501e83ad5, 50e219e52377465a403da3e1275c10579b3042bfbd03ae383648a81b53b4586e, 51855557b6215ae93482598f5de7e4875a8612d1a2645893905f0c35d321fd73, 545a3aec876c49c56693f48f5fde740487330ca097775d9a434157aabf25db10, 549d3a52cd9b25d24fc547f25a9e6615501a18142baa362199f4f82577a48edf, 56b848c3c125a2a666b13e22ba75df2b3609632d5989bc57a8d5566924829373, 58ac11fdd8de211df2a12d1dc8dafcab56ffdbcec0d0f41b4125de191b4f2180, 5a8ae397c178fe9397a41b71b2046ded55feb409fadc30f4053194802f5c2dcd, 5b4f622cb9b451a6427fc9caebecd7662ec14af325697c4619ec61b7117d6273, 5c55fe4218757fea3012295b8284e967852f4df0c622b173dbdb51012edeeee0, 5f51051b50e1d9bb9c47089d5774ff3e491be45eeaf40cba7fd86c5d4fa8635d, 60feb037f14dcc3d1f9adfc35647633cab48a652221b8e2e3c5d68b4313d7d0a, 669ee31e18f1901098d0b296e0ebbe38b5602bf4c17000dda9409aa5bd64133a, 6cfc98d1ffcdb983e64beac75ccde7d873e3c41fffde2f4d87dd0757eb5a620d, 6dbf510f4f0ced77341146b24a9b0c320b516ade2248defa09931ea413f8b20e, 6e0f6c689e9b80c69445b574e705f79044c5fd148b9912c79f1381e96fe6edcb, 6fd1551bc0b7b588dabe1865a7a333a4987c552f4aa05b30cb92fbb33c03603e, 701d795207cfc31e2ace3823d9793edf3f8a5d1521acb64bb26f7e25c2871599, 7024db838ba2d2abb1ff1f96a91b0359cbc7f56d4acfc6c8d851d70fa8b49a1c, 72c9da48314a77642d5505d019f454fd32f0933ed8a056fb9c9a18818eb4a6f5, 76fcb15956144d5477d4636ee09ce3db64597c7ccdf840163862fa837534bdd1, 7920398ba4c6a03a55c394145444fc5d475301fb5393e96a2b1667a9bbda1ac5, 79364f3e140abd46d8d1bedd21db9646ab55cf35783ef7926a235fa7e1fe6797, 79b62fd3ed24ca4778dc0261c7570e71f3d0c83913c38f58ab1660dc7a670aee, 79b73fa504fdc7c41be70f74c6ded66e12f271d3bb8afb5c1c94a6eb4514f0cf, 7a96d50d91310903f591478e7d1513be5689f1ecf59fe752fbaa6cb4ba8820ce, 7e562fc41c9e36fbe0b06339e57cb842354a61b6c21bd975eb56ad550615a5f6, 8e619459168a1edc8de86d29cb557388d89cdebefae1d001ba394079a7622511, 8f7b60cb0dc32277e6e99ebfee047d5a587050a1fcd5c2f98be7204898d7b25d, 94e333beccbc0d7199d0a9bf13922ef8f388e1d7f7e055ad8ec8ca6160b50067, 98a27a37c5dbe1e115a0f43d2f0cc8afd332e3e5fb5e4c37e09e83e35dc8efb3, 99d836285aa612c98765ac6a538aa3ed74bf435b157311c65577949d794eac8b, 9a2678818bdc614eab85cddb993daa4c783cd36d8c3eda95c2506a7e6e24698b, 9c1b56c021a7fdf1d1aa008834499046227ace6f6c7d976ef89d27a84858fdb0, a14fd3fd3bd83ac7789295978bc2bfeed80657cc0298b8314dbb02ee19ca73fd, a32c3fbbf74699a10e7642bf4901191f29c88c5aec93ae7ba28c79ab28462a69, a543689f34083f810e0184ec77d8ee9e57d44ebd6212af444853a3a89a3c82c0, a62ceea27ff8a0dcc0432fd171f8549d38f69e7233415cfe446305aa9e553970, a6d3a9ae1527b586691d2d3b678279385e434beea0afa114b0a06e64a7f2148d, aad7e7ac9d74ac18892801950c9728e9c4eacd3b676cbb5d6f63382da2ce0559, abfa585a5358e658bd92d159e9f846b2950c7e300c47392283443a1bcb70fd52, ae885757debdc97de2498d84cfb0b7f05e6af00ec14030b1fe678276518f56b0, ae8a5d43dfc2e8bac34a415449fa67b300cdf9e2995b0e8ec38cd8d0694da7ae, b1ce6d1ccf9f48f3ff3f45d94e088fc2fc964e55ee8f97c08c1c1adfb9c9328e, b72a06025452c94223100a34efacddf3d81cf57f3941fa1f2a6dce66b9b54d5b, bc0715826ce01c4782065a28eaef6547dc60cd60b6069ef76e5a26635e510256, bee2f0a5e13b857d749232273e7c45d597fb858bf0f0a72c793e1c37237675aa, c56440ab3d623249aabaec871a5da8eccb61dc6a0b3166c972d8c86e7d646ef4, c572cbc2269ef4adca064f23edd04bbd360fb0e8de40abe90c2be35265fffd3f, c717ae53f81fbb66d2554e3c65c295cb2c98e9c817df9c0cdd378d92b5471d5c, ca1b969a9ba62164ddb7fc5d315b0b82d8506238b15bbd7dd88857ef6acd367a, ce0f4cd9d9af178aead83df4f46146f1c66cc2c3e600c8aafa0a392fc5ad9637, d01b8dc8fbf8139a8b0c59a038c7ca755a87630ed242c306fb2b53985e545685, d0fe1eecad868460c162fd40cacf2ac954008b2de1234b2d1cd3b1e361f5e6c0, d2a55e2d77369b71f90f8840c6b7d0a2739981283e6d77a3350a80de21125b3f, d5693df142632f807bd5707cb5ee58e9edaaa3a40e84cd5c070ec63412820af9, da7dfd4b7df4f2813428306649b10d1f2d6d71c1d43c5cfffe880101d62d7b08, dc1abae9fce7e192232a5be12c6096338529b327ad749e310e7375106e013579, dc55eebfbddaee583a29f17610ef15397b97d37d7d4027d2060d6e88c4eb1182, dfc43850daabf4fec146d04a4c62b3a8679639d2cfa399d005e9fdd5387c2fac, e4edc03903a3463425bf570ca35f66f2acbb8ba8b9c1757adb4a9e6f0a070f45, e540127862940234446ef7a919f7295a52e751e14f184e779a8b4b2dffb78978, e825c36285a43e15aa5bbf270ff12a3323bb444d173621ab8158d05808bdaaf0, ea5f2055397fc76db031de944b10a27a6a7975713f2902df3a3970b65e271b4f, ea71387e40682bcc23f676df2b856dca15853aeb854b94168c85bc0479ef1aed, ec5e3f367dc8663405dd3f3549e8b8d65d772b148e1e6d7d17ea4fdf5a95195c, ecce95f1b2383a852c1b2226970453494c5bf315c2e0b2adda7e3142e028791e, f06bc48095cd11e51714d08b8889c32a058282fdb90487ada823a6550089df96, f0d37ab8636685fdf3c81f2f1df5fb0a2cdba6e6daf10200c250a31a822f0f10, f1f2ab4ee6f0350d6db84a9983f5c734ef32958c848a472931f03ff733b5a5e7, f6391baaf220428eab56c30d45d53fc76e651c1b2e66f2908a312526a1e45331, f7fc4fbdd1706f443868047def63c1e9a746a0be2fac0577ce197e84c8b0a3ce, f80c57719e52bbbd9d10aaabf9e30db7b76fabd5d0cb73f2a78b96d5613befc4, f9674626d17346629508557918209728fc2a571aeed62201887281aa992758e8excludes:process.thread.Ext.call_stack_final_user_module.hash.sha256
process.thread.Ext.call_stack_final_user_module.pathstarts_with?:\windows\assembly\nativeimages_excludes:process.thread.Ext.call_stack_final_user_module.path field:"process.thread.Ext.call_stack_final_user_module.path" value:"?:\windows\assembly\nativeimages_"

DNS Tunneling

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

A machine learning job detected unusually large numbers of DNS queries for a single top-level DNS domain, which is often used for DNS tunneling. DNS tunneling can be used for command-and-control, persistence, or data exfiltration activity. For example, dnscat tends to generate many DNS questions for a top-level domain as it uses the DNS protocol to tunnel data.

Known False Positives

  • DNS domains that use large numbers of child domains, such as software or content distribution networks, can trigger this alert and such parent domains can be excluded.

MITRE ATT&CK Coverage

Rule Body

[metadata]
creation_date = "2020/03/25"
integration = ["endpoint", "network_traffic"]
maturity = "production"
min_stack_version = "9.5.0"
min_stack_comments = "Migrate packetbeat job to security network module"
updated_date = "2026/07/27"

[rule]
anomaly_threshold = 50
author = ["Elastic"]
description = """
A machine learning job detected unusually large numbers of DNS queries for a single top-level DNS domain, which is often
used for DNS tunneling. DNS tunneling can be used for command-and-control, persistence, or data exfiltration activity.
For example, dnscat tends to generate many DNS questions for a top-level domain as it uses the DNS protocol to tunnel
data.
"""
false_positives = [
    """
    DNS domains that use large numbers of child domains, such as software or content distribution networks, can trigger
    this alert and such parent domains can be excluded.
    """,
]
from = "now-45m"
interval = "15m"
license = "Elastic License v2"
machine_learning_job_id = "dns_tunneling_ea"
name = "DNS Tunneling"
setup = """## Setup

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

### Anomaly Detection Setup

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

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

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

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

### Network Packet Capture Integration Setup
The Network Packet Capture integration sniffs network packets on a host and dissects known protocols. Monitoring the network traffic is critical to gaining observability and securing your environment — ensuring high levels of performance and security. The Network Packet Capture integration captures the network traffic between your application servers, decodes common application layer protocols and records the interesting fields for each transaction.

#### The following steps should be executed in order to add the Elastic Agent System integration "network_traffic" to your system:
- Go to the Kibana home page and click “Add integrations”.
- In the query bar, search for “Network Packet Capture” and select the integration to see more details about it.
- Click “Add Network Packet Capture”.
- Configure the integration name and optionally add a description.
- Review optional and advanced settings accordingly.
- Add the newly installed “network_traffic” to an existing or a new agent policy, and deploy the agent on your system from which network log files are desirable.
- Click “Save and Continue”.
- For more details on the integration refer to the [helper guide](https://docs.elastic.co/integrations/network_traffic).
"""
references = ["https://www.elastic.co/guide/en/security/current/prebuilt-ml-jobs.html"]
risk_score = 21
rule_id = "91f02f01-969f-4167-8f66-07827ac3bdd9"
severity = "low"
tags = [
    "Data Source: Elastic Defend",
    "Data Source: Network Packet Capture",
    "Use Case: Threat Detection",
    "Rule Type: ML",
    "Rule Type: Machine Learning",
    "Tactic: Command and Control",
    "Resources: Investigation Guide",
]
type = "machine_learning"
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 DNS Tunneling

DNS tunneling exploits the DNS protocol to covertly transmit data between a compromised system and an attacker-controlled server. Adversaries use it for stealthy command-and-control, persistence, or data exfiltration by embedding data within DNS queries. The detection rule leverages machine learning to identify anomalies, such as an unusually high volume of DNS queries to a single domain, indicating potential tunneling activity.

### Possible investigation steps

- Review the DNS query logs to identify the specific top-level domain generating the unusually high volume of queries. This can help pinpoint the potential source of tunneling activity.
- Analyze the source IP addresses associated with the DNS queries to determine if they originate from known or suspicious hosts within the network.
- Check for any recent changes or anomalies in the network traffic patterns related to the identified domain, which might indicate tunneling or exfiltration attempts.
- Investigate the history of the identified domain to assess its reputation and any known associations with malicious activities or threat actors.
- Correlate the DNS query activity with other security events or alerts in the network to identify any related suspicious behavior or indicators of compromise.

### False positive analysis

- High volume of DNS queries from legitimate software updates or patch management systems can trigger false positives. Users should identify and whitelist domains associated with trusted update services.
- Content delivery networks (CDNs) often generate numerous DNS queries due to their distributed nature. Exclude known CDN domains from the analysis to reduce false positives.
- Internal network monitoring tools that rely on DNS for service discovery may cause an increase in DNS queries. Consider excluding these internal domains if they are verified as non-threatening.
- Some cloud services use DNS for load balancing and may result in high query volumes. Users should review and whitelist these domains if they are confirmed to be safe.
- Automated scripts or applications that frequently query DNS for legitimate purposes can be excluded by identifying their specific patterns and adding them to an exception list.

### Response and remediation

- Isolate the affected system from the network to prevent further data exfiltration or command-and-control communication.
- Conduct a thorough analysis of DNS logs to identify the specific domain involved in the tunneling activity and block it at the network perimeter.
- Review and terminate any suspicious processes or services running on the compromised system that may be associated with the tunneling activity.
- Reset credentials and review access permissions for accounts that were active on the compromised system to prevent unauthorized access.
- Escalate the incident to the security operations center (SOC) for further investigation and to determine if additional systems are affected.
- Implement enhanced monitoring for DNS traffic to detect similar tunneling activities in the future, focusing on high-frequency queries to single domains.
- Coordinate with IT and security teams to apply necessary patches and updates to the affected system to close any vulnerabilities exploited by the attacker."""
[[rule.threat]]
framework = "MITRE ATT&CK"

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

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

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

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

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

[[rule.threat.technique]]
id = "T1041"
name = "Exfiltration Over C2 Channel"
reference = "https://attack.mitre.org/techniques/T1041/"

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

Entra ID High Risk User Sign-in Heuristic

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

Identifies high risk Azure Active Directory (AD) sign-ins by leveraging Microsoft Identity Protection machine learning and heuristics.

MITRE ATT&CK Coverage

TacticTechniques
Initial Access

Telemetry Coverage

Rule Body

[metadata]
creation_date = "2021/10/18"
integration = ["azure"]
maturity = "production"
updated_date = "2026/04/10"

[rule]
author = ["Austin Songer"]
description = """
Identifies high risk Azure Active Directory (AD) sign-ins by leveraging Microsoft Identity Protection machine learning
and heuristics.
"""
from = "now-9m"
index = ["logs-azure.signinlogs-*", "filebeat-*"]
language = "kuery"
license = "Elastic License v2"
name = "Entra ID High Risk User Sign-in Heuristic"
note = """## Triage and analysis

### Investigating Entra ID High Risk User Sign-in Heuristic

Microsoft Identity Protection is an Azure AD security tool that detects various types of identity risks and attacks.

This rule identifies events produced by the Microsoft Identity Protection with a risk state equal to `confirmedCompromised` or `atRisk`.

#### Possible investigation steps

- Identify the Risk Detection that triggered the event. A list with descriptions can be found [here](https://docs.microsoft.com/en-us/azure/active-directory/identity-protection/concept-identity-protection-risks#risk-types-and-detection).
- Identify the user account involved and validate whether the suspicious activity is normal for that user.
  - Consider the source IP address and geolocation for the involved user account. Do they look normal?
  - Consider the device used to sign in. Is it registered and compliant?
- Investigate other alerts associated with the user account during the past 48 hours.
- Contact the account owner and confirm whether they are aware of this activity.
- Check if this operation was approved and performed according to the organization's change management policy.
- If you suspect the account has been compromised, scope potentially compromised assets by tracking servers, services, and data accessed by the account in the last 24 hours.

### 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 device conditions.

### 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.
    - Assess the criticality of affected services and servers.
    - Work with your IT team to identify and minimize the impact on users.
    - Identify if the attacker is moving laterally and compromising other accounts, servers, or services.
    - Identify any regulatory or legal ramifications related to this activity.
- Investigate credential exposure on systems compromised or used by the attacker to ensure all compromised accounts are identified. Reset passwords or delete API keys as needed to revoke the attacker's access to the environment. Work with your IT teams to minimize the impact on business operations during these actions.
- Check if unauthorized new users were created, remove unauthorized new accounts, and request password resets for other IAM users.
- Consider enabling multi-factor authentication for users.
- Follow security best practices [outlined](https://docs.microsoft.com/en-us/azure/security/fundamentals/identity-management-best-practices) by Microsoft.
- 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).

## Setup

The Azure Fleet integration, Filebeat module, or similarly structured data is required to be compatible with this rule."""
references = [
    "https://docs.microsoft.com/en-us/azure/active-directory/reports-monitoring/reference-azure-monitor-sign-ins-log-schema",
    "https://docs.microsoft.com/en-us/azure/active-directory/identity-protection/overview-identity-protection",
    "https://docs.microsoft.com/en-us/azure/active-directory/identity-protection/howto-identity-protection-investigate-risk",
    "https://docs.microsoft.com/en-us/azure/active-directory/identity-protection/howto-identity-protection-investigate-risk#investigation-framework",
]
risk_score = 47
rule_id = "26edba02-6979-4bce-920a-70b080a7be81"
severity = "medium"
tags = [
    "Domain: Cloud",
    "Data Source: Azure",
    "Use Case: Identity and Access Audit",
    "Resources: Investigation Guide",
    "Tactic: Initial Access",
]
timestamp_override = "event.ingested"
type = "query"

query = '''
data_stream.dataset:azure.signinlogs and
  azure.signinlogs.properties.risk_state:("confirmedCompromised" or "atRisk") and event.outcome:(success or Success)
'''


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


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

Stages and Predicates

Stage 1: query

data_stream.dataset:azure.signinlogs and
  azure.signinlogs.properties.risk_state:("confirmedCompromised" or "atRisk") and event.outcome:(success or Success)

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
azure.signinlogs.properties.risk_statein
  • atRisk
  • confirmedCompromised
field:"azure.signinlogs.properties.risk_state" kind:in
data_stream.dataseteq
  • azure.signinlogs corpus 26 (elastic 26)
field:"data_stream.dataset" kind:eq value:"azure.signinlogs"
event.outcomein
  • Success corpus 306 (elastic 306)
  • success corpus 306 (elastic 306)
field:"event.outcome" kind:in

GKE Pod Created With HostNetwork

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

Detects GKE pod create, update, or patch events that enable host network namespace sharing. HostNetwork grants access to the node network stack and can bypass namespace network policies. System identities and controller-owned workloads are excluded.

Known False Positives

  • Monitoring agents and CNI components may require hostNetwork. Exclude known platform identities after review.

MITRE ATT&CK Coverage

TacticTechniques
Execution
Privilege Escalation

Telemetry Coverage

Rules Detecting the Same Action

These rules filter on the same operation.

Rule Body

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

[rule]
author = ["Elastic"]
description = """
Detects GKE pod create, update, or patch events that enable host network namespace sharing. HostNetwork grants access to
the node network stack and can bypass namespace network policies. System identities and controller-owned workloads are
excluded.
"""
false_positives = [
    """
    Monitoring agents and CNI components may require hostNetwork. Exclude known platform identities after review.
    """,
]
index = ["logs-gcp.audit-*"]
language = "kuery"
license = "Elastic License v2"
name = "GKE Pod Created With HostNetwork"
note = """## Triage and analysis

### Investigating GKE Pod Created With HostNetwork

HostNetwork pods can observe or interact with node-local services. Validate the actor and workload purpose.

### Investigation steps

- Review `user.email`, pod name, namespace, and container images in `gcp.audit.request`.
- Hunt for secret access or exec from the same identity after the change.

### False positives

- Platform DaemonSets often use hostNetwork; controller ownerReferences exclusion reduces noise.

## Setup

The GCP Fleet integration with GKE audit logs enabled is required to be compatible with this rule."""
references = [
    "https://kubernetes.io/docs/concepts/security/pod-security-standards/",
    "https://bishopfox.com/blog/kubernetes-pod-privilege-escalation",
]
risk_score = 47
rule_id = "0030f681-0142-4231-b728-49bb9fc12066"
severity = "medium"
tags = [
    "Domain: Cloud",
    "Domain: Kubernetes",
    "Data Source: GCP",
    "Data Source: Google Cloud Platform",
    "Use Case: Threat Detection",
    "Tactic: Privilege Escalation",
    "Tactic: Execution",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "query"

query = '''
data_stream.dataset:gcp.audit and
event.action:("io.k8s.core.v1.pods.create" or "io.k8s.core.v1.pods.update" or "io.k8s.core.v1.pods.patch") and
gcp.audit.request.spec.hostNetwork:true and
not gcp.audit.request.metadata.ownerReferences.kind:("ReplicaSet" or "DaemonSet" or "StatefulSet") and
not user.email:system\:*
'''

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

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

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

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

[[rule.threat.technique]]
id = "T1610"
name = "Deploy Container"
reference = "https://attack.mitre.org/techniques/T1610/"

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

Stages and Predicates

Stage 1: query

data_stream.dataset:gcp.audit and
event.action:("io.k8s.core.v1.pods.create" or "io.k8s.core.v1.pods.update" or "io.k8s.core.v1.pods.patch") and
gcp.audit.request.spec.hostNetwork:true and
not gcp.audit.request.metadata.ownerReferences.kind:("ReplicaSet" or "DaemonSet" or "StatefulSet") and
not user.email:system\:*

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
data_stream.dataseteq
  • gcp.audit corpus 60 (elastic 60)
field:"data_stream.dataset" kind:eq value:"gcp.audit"
event.actionin
  • io.k8s.core.v1.pods.create corpus 5 (elastic 5)
  • io.k8s.core.v1.pods.patch corpus 5 (elastic 5)
  • io.k8s.core.v1.pods.update corpus 5 (elastic 5)
field:"EventType" kind:in
gcp.audit.request.spec.hostNetworkeq
  • true
field:"gcp.audit.request.spec.hostNetwork" kind:eq value:"true"

Exclusions

The rule actively suppresses these predicates.

GKE Service Account Modified RBAC Objects

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

Detects write operations performed by GKE service accounts against RBAC resources (Roles, ClusterRoles, RoleBindings, ClusterRoleBindings). Service accounts typically do not manage RBAC directly; this activity may indicate token abuse or unauthorized privilege escalation.

Known False Positives

  • In-cluster controllers, operators, and CI jobs may legitimately reconcile RBAC manifests. Baseline known automation service accounts before tuning.

MITRE ATT&CK Coverage

Telemetry Coverage

Rules Detecting the Same Action

These rules filter on the same operation.

Rule Body

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

[rule]
author = ["Elastic"]
description = """
Detects write operations performed by GKE service accounts against RBAC resources (Roles, ClusterRoles, RoleBindings,
ClusterRoleBindings). Service accounts typically do not manage RBAC directly; this activity may indicate token abuse or
unauthorized privilege escalation.
"""
false_positives = [
    """
    In-cluster controllers, operators, and CI jobs may legitimately reconcile RBAC manifests. Baseline known automation
    service accounts before tuning.
    """,
]
from = "now-6m"
index = ["logs-gcp.audit-*"]
language = "kuery"
license = "Elastic License v2"
name = "GKE Service Account Modified RBAC Objects"
note = """## Triage and analysis

### Investigating GKE Service Account Modified RBAC Objects

This rule detects service accounts performing allowed write actions on RBAC resources. Stolen or over-privileged service
account tokens can silently alter authorization to gain or retain elevated access.

### Possible investigation steps

- Review `client.user.email`, `event.action`, and `gcp.audit.resource_name`.
- Trace the acting service account to its owning workload and inspect recent image changes or exec activity.
- Correlate with change tickets or GitOps commits for the same RBAC object.

### False positive analysis

- Platform operators and GitOps controllers running in-cluster commonly create or patch RBAC objects.

### Response and remediation

- Revert unauthorized RBAC changes, rotate the service account credentials, and tighten RBAC for the workload.

"""
setup = "The GCP Fleet integration with GKE audit logs enabled is required to be compatible with this rule."
references = [
    "https://kubernetes.io/docs/reference/access-authn-authz/rbac/",
    "https://heilancoos.github.io/research/2025/12/16/kubernetes.html#overly-permissive-role-based-access-control",
]
risk_score = 47
rule_id = "c41e9854-3df3-465a-8234-4d625084ff86"
severity = "medium"
tags = [
    "Domain: Cloud",
    "Domain: Kubernetes",
    "Data Source: GCP",
    "Data Source: Google Cloud Platform",
    "Use Case: Threat Detection",
    "Tactic: Privilege Escalation",
    "Tactic: Persistence",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "query"

query = '''
data_stream.dataset:gcp.audit and service.name:"k8s.io" and event.outcome:success and
client.user.email:(system\:serviceaccount\:* and not (
  "system:serviceaccount:kube-system:clusterrole-aggregation-controller" or
  "system:serviceaccount:kube-system:generic-garbage-collector"
)) and event.action:(
  "io.k8s.authorization.rbac.v1.clusterrolebindings.create" or
  "io.k8s.authorization.rbac.v1.clusterrolebindings.delete" or
  "io.k8s.authorization.rbac.v1.clusterrolebindings.patch" or
  "io.k8s.authorization.rbac.v1.clusterrolebindings.update" or
  "io.k8s.authorization.rbac.v1.clusterroles.create" or
  "io.k8s.authorization.rbac.v1.clusterroles.delete" or
  "io.k8s.authorization.rbac.v1.clusterroles.patch" or
  "io.k8s.authorization.rbac.v1.clusterroles.update" or
  "io.k8s.authorization.rbac.v1.rolebindings.create" or
  "io.k8s.authorization.rbac.v1.rolebindings.delete" or
  "io.k8s.authorization.rbac.v1.rolebindings.patch" or
  "io.k8s.authorization.rbac.v1.rolebindings.update" or
  "io.k8s.authorization.rbac.v1.roles.create" or
  "io.k8s.authorization.rbac.v1.roles.delete" or
  "io.k8s.authorization.rbac.v1.roles.patch" or
  "io.k8s.authorization.rbac.v1.roles.update"
)
'''

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

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

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

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

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

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

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

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

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

Stages and Predicates

Stage 1: query

data_stream.dataset:gcp.audit and service.name:"k8s.io" and event.outcome:success and
client.user.email:(system\:serviceaccount\:* and not (
  "system:serviceaccount:kube-system:clusterrole-aggregation-controller" or
  "system:serviceaccount:kube-system:generic-garbage-collector"
)) and event.action:(
  "io.k8s.authorization.rbac.v1.clusterrolebindings.create" or
  "io.k8s.authorization.rbac.v1.clusterrolebindings.delete" or
  "io.k8s.authorization.rbac.v1.clusterrolebindings.patch" or
  "io.k8s.authorization.rbac.v1.clusterrolebindings.update" or
  "io.k8s.authorization.rbac.v1.clusterroles.create" or
  "io.k8s.authorization.rbac.v1.clusterroles.delete" or
  "io.k8s.authorization.rbac.v1.clusterroles.patch" or
  "io.k8s.authorization.rbac.v1.clusterroles.update" or
  "io.k8s.authorization.rbac.v1.rolebindings.create" or
  "io.k8s.authorization.rbac.v1.rolebindings.delete" or
  "io.k8s.authorization.rbac.v1.rolebindings.patch" or
  "io.k8s.authorization.rbac.v1.rolebindings.update" or
  "io.k8s.authorization.rbac.v1.roles.create" or
  "io.k8s.authorization.rbac.v1.roles.delete" or
  "io.k8s.authorization.rbac.v1.roles.patch" or
  "io.k8s.authorization.rbac.v1.roles.update"
)

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
client.user.emailwildcard
  • system:serviceaccount:* corpus 3 (elastic 3)
field:"client.user.email" kind:wildcard value:"system:serviceaccount:*"
data_stream.dataseteq
  • gcp.audit corpus 60 (elastic 60)
field:"data_stream.dataset" kind:eq value:"gcp.audit"
event.actionin
  • io.k8s.authorization.rbac.v1.clusterrolebindings.create corpus 3 (elastic 3)
  • io.k8s.authorization.rbac.v1.clusterrolebindings.delete
  • io.k8s.authorization.rbac.v1.clusterrolebindings.patch corpus 2 (elastic 2)
  • io.k8s.authorization.rbac.v1.clusterrolebindings.update corpus 2 (elastic 2)
  • io.k8s.authorization.rbac.v1.clusterroles.create corpus 2 (elastic 2)
  • io.k8s.authorization.rbac.v1.clusterroles.delete
  • io.k8s.authorization.rbac.v1.clusterroles.patch corpus 3 (elastic 3)
  • io.k8s.authorization.rbac.v1.clusterroles.update corpus 3 (elastic 3)
  • io.k8s.authorization.rbac.v1.rolebindings.create corpus 2 (elastic 2)
  • io.k8s.authorization.rbac.v1.rolebindings.delete
  • io.k8s.authorization.rbac.v1.rolebindings.patch
  • io.k8s.authorization.rbac.v1.rolebindings.update
  • io.k8s.authorization.rbac.v1.roles.create corpus 2 (elastic 2)
  • io.k8s.authorization.rbac.v1.roles.delete
  • io.k8s.authorization.rbac.v1.roles.patch corpus 3 (elastic 3)
  • io.k8s.authorization.rbac.v1.roles.update corpus 3 (elastic 3)
field:"EventType" kind:in
event.outcomeeq
  • success corpus 306 (elastic 306)
field:"event.outcome" kind:eq value:"success"
service.nameeq
  • k8s.io corpus 28 (elastic 28)
field:"ServiceName" kind:eq value:"k8s.io"

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
client.user.emailinsystem:serviceaccount:kube-system:clusterrole-aggregation-controller, system:serviceaccount:kube-system:generic-garbage-collectorexcludes:client.user.email field:"client.user.email" value:"system:serviceaccount:kube-system:clusterrole-aggregation-controller" field:"client.user.email" value:"system:serviceaccount:kube-system:generic-garbage-collector"

Kubernetes Multi-Resource Discovery

#
Status
production
Severity
medium
Time window
11m
Group by
Esql.time_interval, kubernetes.audit.user.username, source.ip, user.name, user_agent.original
Author
Elastic
Source
github.com/elastic/detection-rules

Adversaries who land credentials in a cluster—or abuse an over-privileged token—often map the environment before exfiltration or privilege escalation. A practical first pass is to learn where workloads run, how the cluster is partitioned, and what RBAC exists at namespace vs cluster scope. Rapid get/list traffic across distinct API resource kinds that answer those questions (namespaces, workloads, roles, cluster-wide roles) is a common setup and orientation pattern for both interactive attackers and automated recon scripts. It is less typical for steady-state controllers, which usually touch a narrow set of resources repeatedly. This rule highlights that cross-resource burst from a single client fingerprint within a one-minute bucket so analysts can separate routine automation from potential discovery and permission reconnaissance ahead of follow-on actions.

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

[rule]
author = ["Elastic"]
description = """
Adversaries who land credentials in a cluster—or abuse an over-privileged token—often map the environment before
exfiltration or privilege escalation. A practical first pass is to learn where workloads run, how the cluster is
partitioned, and what RBAC exists at namespace vs cluster scope. Rapid `get`/`list` traffic across distinct
API resource kinds that answer those questions (namespaces, workloads, roles, cluster-wide roles) is a common
setup and orientation pattern for both interactive attackers and automated recon scripts. It is less typical for
steady-state controllers, which usually touch a narrow set of resources repeatedly. This rule highlights that
cross-resource burst from a single client fingerprint within a one-minute bucket so analysts can separate routine
automation from potential discovery and permission reconnaissance ahead of follow-on actions.
"""
from = "now-11m"
interval = "5m"
language = "esql"
license = "Elastic License v2"
name = "Kubernetes Multi-Resource Discovery"
note = """## Triage and analysis

### Investigating Kubernetes Multi-Resource Discovery

The rule groups Kubernetes audit `get`/`list` events on namespaces, pods, roles, and clusterroles into one-minute windows 
per `user.name`, `source.ip`, `user_agent.original`, and flags windows where three or more distinct resource types appear. 
That combination is consistent with someone sketching cluster layout and privilege structure rather than touching a single 
resource type. **Allowed and denied** authorizations are both included: failures still signal probing and validate which 
object types the caller attempted to reach.

### Possible investigation steps

- Pivot on `Esql.time_interval` and the same identity or IP in raw audit logs to see ordering (e.g. namespaces first,
  then roles, then pods) and whether calls succeeded.
- Review `Esql.decisions` and namespaces touched; correlate with RBAC for that identity to see if scope matches a
  known job or breaks least-privilege expectations.
- Hunt for follow-on activity: secret/configmap reads, rolebinding changes, pod exec, anonymous or unusual user agents.
- Baseline automation: CI, GitOps, and some monitoring agents can read several resource types during sync; exclude
  known service accounts or source networks if noisy.

### False positive analysis

- Platform operators or runbooks that reconcile RBAC and workload state may legitimately span these resource types in
  a short window; tune by user, IP allowlist, or user agent when documented.
- Some installers briefly query namespaces, pods, and roles during upgrades—correlate with change windows.

### Response and remediation

- If malicious, revoke or rotate the implicated credentials, review and tighten RBAC, and inspect for data access or
  persistence established after the burst.
"""
references = [
    "https://attack.mitre.org/techniques/T1613/",
    "https://microsoft.github.io/Threat-Matrix-for-Kubernetes/",
]
risk_score = 47
rule_id = "c2a91e88-4f4b-4e1d-9c7b-8fde112a9403"
severity = "medium"
tags = [
    "Data Source: Kubernetes",
    "Domain: Kubernetes",
    "Use Case: Threat Detection",
    "Tactic: Discovery",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "esql"
query = '''
from logs-kubernetes.audit_logs-* metadata _id, _index, _version
| eval Esql.time_interval = date_trunc(1 minute, @timestamp)
| where event.dataset == "kubernetes.audit_logs"
    and event.action in ("get", "list")
    and kubernetes.audit.objectRef.resource in ("namespaces", "nodes", "pods", "roles", "configmaps", "serviceaccounts", "clusterroles", "clusterrolebindings", "rolebindings")
    and source.ip is not null and user.name IS NOT NULL
    and not to_string(source.ip) in ("127.0.0.1", "::1")
    and not user.name rlike """(system:serviceaccount:kube-system:|eks:|system:kube-|arn:aws:sts::.*:assumed-role/AWSServiceRoleForAmazonEKS/|system:serviceaccount:kube-system:azure|system:node:aks-default|aksService).*""" 
    and not kubernetes.audit.user.username in ("system:serviceaccount:flux-system:kustomize-controller", "system:serviceaccount:flux-system:helm-controller", "system:serviceaccount:flux-system:source-controller", "system:serviceaccount:security:trivy-operator")
| stats
    Esql.unique_resources = count_distinct(kubernetes.audit.objectRef.resource),
    Esql.enumerated_resources = values(kubernetes.audit.objectRef.resource),
    Esql.enumerated_namespaces = values(kubernetes.audit.objectRef.namespace),
    Esql.decisions = values(`kubernetes.audit.annotations.authorization_k8s_io/decision`)
  by user.name, kubernetes.audit.user.username, source.ip, user_agent.original, Esql.time_interval
| where Esql.unique_resources >= 3
| keep Esql.*, kubernetes.audit.user.username, user.name, source.ip, user_agent.original
'''

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

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

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

Stages and Predicates

Stage 1: from

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

Stage 2: eval

| eval Esql.time_interval = date_trunc(1 minute, @timestamp)

Stage 3: where

| where event.dataset == "kubernetes.audit_logs"
    and event.action in ("get", "list")
    and kubernetes.audit.objectRef.resource in ("namespaces", "nodes", "pods", "roles", "configmaps", "serviceaccounts", "clusterroles", "clusterrolebindings", "rolebindings")
    and source.ip is not null and user.name IS NOT NULL
    and not to_string(source.ip) in ("127.0.0.1", "::1")
    and not user.name rlike """(system:serviceaccount:kube-system:|eks:|system:kube-|arn:aws:sts::.*:assumed-role/AWSServiceRoleForAmazonEKS/|system:serviceaccount:kube-system:azure|system:node:aks-default|aksService).*""" 
    and not kubernetes.audit.user.username in ("system:serviceaccount:flux-system:kustomize-controller", "system:serviceaccount:flux-system:helm-controller", "system:serviceaccount:flux-system:source-controller", "system:serviceaccount:security:trivy-operator")

Stage 4: stats

| stats
    Esql.unique_resources = count_distinct(kubernetes.audit.objectRef.resource),
    Esql.enumerated_resources = values(kubernetes.audit.objectRef.resource),
    Esql.enumerated_namespaces = values(kubernetes.audit.objectRef.namespace),
    Esql.decisions = values(`kubernetes.audit.annotations.authorization_k8s_io/decision`)
  by user.name, kubernetes.audit.user.username, source.ip, user_agent.original, Esql.time_interval

Stage 5: where

| where Esql.unique_resources >= 3

Stage 6: keep

| keep Esql.*, kubernetes.audit.user.username, user.name, source.ip, user_agent.original

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
Esql.unique_resourcesge
  • 3
field:"Esql.unique_resources" kind:ge value:"3"
event.actionin
  • get
  • list
field:"EventType" kind:in
event.dataseteq
  • kubernetes.audit_logs corpus 2 (elastic 2)
field:"event.dataset" kind:eq value:"kubernetes.audit_logs"
kubernetes.audit.objectRef.resourcein
  • clusterrolebindings corpus 2 (elastic 2)
  • clusterroles corpus 5 (elastic 5)
  • configmaps corpus 3 (elastic 3)
  • namespaces corpus 2 (elastic 2)
  • nodes corpus 2 (elastic 2)
  • pods corpus 2 (elastic 2)
  • rolebindings corpus 2 (elastic 2)
  • roles corpus 5 (elastic 5)
  • serviceaccounts corpus 2 (elastic 2)
field:"kubernetes.audit.objectRef.resource" kind:in
source.ipis_not_null
  • (no value, null check)
field:"src_ip" kind:is_not_null
user.nameis_not_null
  • (no value, null check)
field:"user" kind:is_not_null

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
kubernetes.audit.user.usernameinsystem:serviceaccount:flux-system:helm-controller, system:serviceaccount:flux-system:kustomize-controller, system:serviceaccount:flux-system:source-controller, system:serviceaccount:security:trivy-operatorexcludes:kubernetes.audit.user.username
user.nameregex_match(system:serviceaccount:kube-system:|eks:|system:kube-|arn:aws:sts::.*:assumed-role/AWSServiceRoleForAmazonEKS/|system:serviceaccount:kube-system:azure|system:node:aks-default|aksService).*excludes:user.name field:"user.name" value:"(system:serviceaccount:kube-system:|eks:|system:kube-|arn:aws:sts::.*:assumed-role/AWSServiceRoleForAmazonEKS/|system:serviceaccount:kube-system:azure|system:node:aks-default|aksService).*"

Output Fields

These fields are emitted when the rule matches.

FieldSource
Esql.*KEEP Esql.*
kubernetes.audit.user.usernameKEEP kubernetes.audit.user.username
user.nameKEEP user.name
source.ipKEEP source.ip
user_agent.originalKEEP user_agent.original

Kubernetes Pod Creation Using Common Debug or Base Images

#
Status
production
Kind
building block (feeds higher-level correlation rules; not a standalone alert)
Severity
low
Group by
source.ip, user.name, user_agent.original
Author
Elastic
Source
github.com/elastic/detection-rules

Detects successful Kubernetes pod creation requests using commonly abused base and debugging container images such as BusyBox, Alpine, Ubuntu, Netshoot, and network multitool variants. These images are frequently used by attackers to deploy short-lived or interactive "throwaway" containers for reconnaissance, payload staging, or command execution due to their small footprint or built-in tooling.

MITRE ATT&CK Coverage

Telemetry Coverage

PlatformRecord / event type
Kubernetescreate-pods: create pods

Rules Detecting the Same Action

These rules filter on the same operation.

Rule Body

[metadata]
bypass_bbr_timing = true
creation_date = "2026/05/04"
integration = ["kubernetes"]
maturity = "production"
updated_date = "2026/05/04"

[rule]
author = ["Elastic"]
building_block_type = "default"
description = """
Detects successful Kubernetes pod creation requests using commonly abused base and debugging container
images such as BusyBox, Alpine, Ubuntu, Netshoot, and network multitool variants. These images are
frequently used by attackers to deploy short-lived or interactive "throwaway" containers for
reconnaissance, payload staging, or command execution due to their small footprint or built-in tooling.
"""
index = ["logs-kubernetes.audit_logs-*"]
language = "kuery"
license = "Elastic License v2"
name = "Kubernetes Pod Creation Using Common Debug or Base Images"
risk_score = 21
rule_id = "93120a05-caf5-47f6-a305-e8abee463fb9"
severity = "low"
tags = [
    "Data Source: Kubernetes",
    "Domain: Kubernetes",
    "Use Case: Threat Detection",
    "Tactic: Execution",
    "Tactic: Defense Evasion",
    "Rule Type: BBR",
    ]
timestamp_override = "event.ingested"
type = "new_terms"
query = '''
event.dataset:"kubernetes.audit_logs" and
kubernetes.audit.stage:"ResponseComplete" and
kubernetes.audit.annotations.authorization_k8s_io/decision:"allow" and
kubernetes.audit.objectRef.resource:"pods" and
kubernetes.audit.verb:"create" and
kubernetes.audit.requestObject.spec.containers.image:(alpine* or busybox* or ubuntu\:* or debian\:* or *netshoot\:* or *network-multitool\:* or *curl\:*)
'''

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

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

[[rule.threat.technique]]
id = "T1610"
name = "Deploy Container"
reference = "https://attack.mitre.org/techniques/T1610/"

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

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

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

[[rule.threat.technique]]
id = "T1610"
name = "Deploy Container"
reference = "https://attack.mitre.org/techniques/T1610/"

[rule.new_terms]
field = "new_terms_fields"
value = ["source.ip", "user_agent.original", "user.name"]

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

Stages and Predicates

Stage 1: new_terms

event.dataset:"kubernetes.audit_logs" and
kubernetes.audit.stage:"ResponseComplete" and
kubernetes.audit.annotations.authorization_k8s_io/decision:"allow" and
kubernetes.audit.objectRef.resource:"pods" and
kubernetes.audit.verb:"create" and
kubernetes.audit.requestObject.spec.containers.image:(alpine* or busybox* or ubuntu\:* or debian\:* or *netshoot\:* or *network-multitool\:* or *curl\:*)

Indicators

These rows show field, operator, and value matches.

Network Activity to a Suspicious Top Level Domain

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

Identifies DNS queries to commonly abused Top Level Domains by common LOLBINs or executables running from world writable directories or unsigned binaries. This behavior matches on common malware C2 abusing less formal domain names.

MITRE ATT&CK Coverage

Telemetry Coverage

ProviderRecord / event type
SysmonEvent ID 3: Network connection

Rule Body

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

[rule]
author = ["Elastic"]
description = """
Identifies DNS queries to commonly abused Top Level Domains by common LOLBINs or executables running from world writable
directories or unsigned binaries. This behavior matches on common malware C2 abusing less formal domain names.
"""
from = "now-9m"
index = [
    "endgame-*",
    "logs-endpoint.events.network-*",
    "logs-sentinel_one_cloud_funnel.*",
    "logs-crowdstrike.fdr*",
    "logs-windows.sysmon_operational-*",
    "winlogbeat-*"
]
language = "eql"
license = "Elastic License v2"
name = "Network Activity to a Suspicious Top Level Domain"
references = ["https://www.cybercrimeinfocenter.org/top-20-tlds-by-malicious-phishing-domains"]
risk_score = 73
rule_id = "e516bf56-d51b-43e8-91ec-9e276331f433"
severity = "high"
tags = [
    "Domain: Endpoint",
    "OS: Windows",
    "Use Case: Threat Detection",
    "Tactic: Command and Control",
    "Resources: Investigation Guide",
    "Data Source: Elastic Endgame",
    "Data Source: Elastic Defend",
    "Data Source: SentinelOne",
    "Data Source: Crowdstrike",
    "Data Source: Sysmon",
]
timestamp_override = "event.ingested"
type = "eql"

query = '''
network where host.os.type == "windows" and dns.question.name != null and
 (
  process.name : ("MSBuild.exe", "mshta.exe", "wscript.exe", "powershell.exe", "pwsh.exe", "msiexec.exe", "rundll32.exe",
                  "bitsadmin.exe", "InstallUtil.exe", "python.exe", "regsvr32.exe", "dllhost.exe", "node.exe", "curl.exe",
                  "java.exe", "javaw.exe", "*.pif", "*.com", "*.scr") or
  (?process.code_signature.trusted == false or ?process.code_signature.exists == false) or
  ?process.code_signature.subject_name : ("AutoIt Consulting Ltd", "OpenJS Foundation", "Python Software Foundation") or
  ?process.executable : (
    "?:\\Users\\Public\\*.exe", "?:\\ProgramData\\*.exe", "?:\\Users\\*\\Downloads\\*.exe",
    "\\Device\\HarddiskVolume*\\Users\\Public\\*.exe", "\\Device\\HarddiskVolume*\\ProgramData\\*.exe", "\\Device\\HarddiskVolume*\\Users\\*\\Downloads\\*.exe"
  )
 ) and
dns.question.name regex """.*\.(top|buzz|xyz|rest|ml|cf|gq|ga|onion|monster|cyou|quest|cc|bar|cfd|click|cam|surf|tk|shop|club|icu|pw|ws|online|fun|life|boats|store|hair|skin|motorcycles|christmas|lol|makeup|mom|bond|beauty|biz|live|work|zip|country|accountant|date|party|science|loan|win|men|faith|review|racing|download|host|zone)""" and

not process.executable : (
    "?:\\ProgramData\\Microsoft\\Windows Defender\\platform\\*\\*.exe",
    "\\Device\\HarddiskVolume*\\ProgramData\\Microsoft\\Windows Defender\\platform\\*\\*.exe",
    "?:\\ProgramData\\Microsoft\\Windows Defender Advanced Threat Protection\\Platform\\Versions\\*\\*.exe",
    "\\Device\\HarddiskVolume*\\ProgramData\\Microsoft\\Windows Defender Advanced Threat Protection\\Platform\\Versions\\*\\*.exe"
)
'''

note = """## Triage and analysis

### Investigating Network Activity to a Suspicious Top Level Domain

#### Possible investigation steps

- Does the alert-local DNS result and domain shape fit the process role?
  - Focus: the alert's `event.action`, `dns.question.name`, `dns.Ext.status`, and `dns.resolved_ip`; use "lookup_result" for resolved IPs and "lookup_requested" for failed or request-only lookups.
  - Implication: concern rises when the name is algorithmic, newly introduced for that tool, or resolves to unrelated external infrastructure; weaker when the lookup fails immediately or the domain matches a known vendor pattern for that process, but a failed lookup alone does not clear the process. `.onion` lookups signal Tor hidden-service resolution -- treat these as elevated concern and look for Tor binaries or proxy configuration.

- Is the alerting binary the expected tool in the expected install context?
  - Focus: `process.executable`, `process.code_signature.subject_name`, `process.code_signature.trusted`, and `process.pe.original_file_name`.
  - Implication: more concerning when the binary is unsigned, renamed, user-writable, or inconsistent with its usual signer. Identity alone does not clear the DNS behavior.

- Does the command line and launch chain fit a legitimate workflow?
  - Focus: `process.command_line`, `process.parent.executable`, and `process.parent.command_line`.
  - Implication: more concerning if a document, script, or unexpected launcher started the process, or if the arguments look staged or evasive.

- Does the same process resolve the domain and then communicate with the returned infrastructure?
  - Why: a suspicious DNS lookup carries more weight when the same process reuses the returned IPs for follow-on connections or transfer behavior in the same window.
  - Focus: process-scoped "lookup_result" and connection events on the same `host.id`, using `dns.resolved_ip` to bridge `dns.question.name` to `destination.ip`; treat `destination.as.organization.name` as ownership context rather than a verdict. $investigate_2
  - Hint: if the transform returns no results, broaden to host-scoped network events around the alert time.
  - Implication: escalate when the same process repeatedly resolves the domain, connects to the returned IPs, or shows suspicious transfer patterns; lower suspicion when activity is limited to a one-off lookup with no matching connection behavior. Missing follow-on network telemetry is unresolved, not benign.

- Do file events or child processes from the same process chain show download-and-execute or artifact staging?
  - Focus: same-host file and process activity around the alert time, scoped to the alert's `process.entity_id`, with attention to `file.path`, `file.origin_url`, `file.Ext.windows.zone_identifier`, and later `process.executable` reuse of a written path.
  - Hint: if file coverage is missing, keep the artifact review bounded to the same host, lineage, and alert window rather than treating the lookup as harmless.
  - Implication: staging risk rises when the chain writes scripts, archives, or executables to user-writable paths and later runs them.

- Does the same process chain pivot to direct-IP traffic, lookalike domains, or TLD rotation that this rule would miss?
  - Why: attackers often keep the same process chain but swap to a nearby domain, a different abusive TLD, or direct-IP egress after the first lookup.
  - Focus: reuse the process-scoped network results from the prior step to look for direct `destination.ip` connections with no preceding DNS, sibling `dns.question.name` values under different TLDs, or repeated reuse of the same `dns.resolved_ip` across multiple domains. $investigate_2
  - Implication: escalate when the process shifts from the flagged lookup to direct-IP traffic, nearby domain variants, or fast domain and TLD rotation on the same infrastructure; lower suspicion when surrounding DNS stays limited to one recognized vendor domain family with no adjacent variant traffic.

- If the local DNS, process, or artifact evidence stays suspicious or unresolved, does related alert history show this DNS pattern is isolated or part of broader compromise?
  - Focus: related alerts for the same `host.id` and `user.id` in the last 48 hours to test whether the same lineage, domain family, or follow-on activity recurs on the asset or follows the user across hosts.
    - $investigate_0
    - $investigate_1
  - Implication: broaden scope when the host or user view shows repeated suspicious lineage, related delivery or persistence alerts, or reuse of the same infrastructure on other assets; keep scope narrow when the pattern stays confined to one recognized workflow with no contradictory evidence.

- Escalate when DNS fit, process context, follow-on communication, artifacts, or variant traffic point to unauthorized C2 or delivery; close only when all evidence aligns with a recognized benign workflow; if mixed or incomplete, preserve and escalate.

### False positive analysis

- Software distribution, developer tooling, or security-testing workflows can legitimately query less common TLDs. Confirm by matching the same `process.executable`, `process.code_signature.subject_name`, `dns.question.name` family, and `host.id` across prior alerts or against workflow records.
- Before creating an exception, build on `process.executable`, `process.code_signature.subject_name`, the `dns.question.name` family, and `host.id` or `user.id`. Avoid exceptions on the TLD alone, `process.name` alone, or `host.id` alone.

### Response and remediation

- If confirmed benign, reverse any temporary containment and document the `process.executable`, `process.code_signature.subject_name`, `process.parent.command_line`, `dns.question.name` family, and bounded `host.id` or `user.id` scope that proved the workflow. Create an exception only if that same pattern recurs consistently across prior alerts from this rule.
- If suspicious but unconfirmed, first preserve `dns.question.name`, `dns.resolved_ip`, connected `destination.ip` values, the alert's `process.entity_id`, `process.command_line`, `process.parent.command_line`, and any staged `file.path` values. Then apply reversible containment such as temporary DNS or egress blocks for the observed infrastructure or heightened monitoring on `host.id`. Escalate to host isolation only if the preserved evidence shows likely follow-on communication or staging and the asset role can tolerate stronger containment.
- If confirmed malicious, document the alert's `process.entity_id`, `process.command_line`, `process.parent.command_line`, written `file.path` artifacts, and connected `dns.question.name` or `destination.ip` infrastructure before initiating response actions. Prefer endpoint isolation as the first containment step; if direct endpoint response is unavailable, escalate with the preserved artifact set to the team that can isolate the host. Block the confirmed malicious domains and direct-IP destinations before terminating processes or deleting files.
- After containment, review other `host.id` and `user.id` alerts for the same `dns.question.name`, `destination.ip`, or `process.executable` pattern before deleting artifacts or restoring access. Then eradicate staged binaries, scripts, and any persistence or proxy changes identified during the file or variant review, and remediate the entry path that allowed the suspicious process to run. If the same suspicious window includes credential, admin-tool, or remote-session alerts, review those sessions for follow-on misuse and reset exposed credentials when the evidence supports compromise.
"""

setup = """## Setup

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

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

### Additional data sources

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

- [CrowdStrike](https://ela.st/crowdstrike-integration)
- [SentinelOne Cloud Funnel](https://ela.st/sentinel-one-cloud-funnel)
- [Sysmon Event ID 3 - Network Connection](https://ela.st/sysmon-event-3-setup)
"""

[rule.investigation_fields]
field_names = [
    "@timestamp",
    "host.name",
    "host.id",
    "user.name",
    "user.id",
    "process.name",
    "process.executable",
    "process.entity_id",
    "process.pid",
    "process.code_signature.subject_name",
    "process.code_signature.trusted",
    "dns.question.name",
    "dns.resolved_ip",
    "event.action",
]

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

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

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

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

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

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

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

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

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

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

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

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

Stages and Predicates

Stage 1: network

network where host.os.type == "windows" and dns.question.name != null and
 (
  process.name : ("MSBuild.exe", "mshta.exe", "wscript.exe", "powershell.exe", "pwsh.exe", "msiexec.exe", "rundll32.exe",
                  "bitsadmin.exe", "InstallUtil.exe", "python.exe", "regsvr32.exe", "dllhost.exe", "node.exe", "curl.exe",
                  "java.exe", "javaw.exe", "*.pif", "*.com", "*.scr") or
  (?process.code_signature.trusted == false or ?process.code_signature.exists == false) or
  ?process.code_signature.subject_name : ("AutoIt Consulting Ltd", "OpenJS Foundation", "Python Software Foundation") or
  ?process.executable : (
    "?:\\Users\\Public\\*.exe", "?:\\ProgramData\\*.exe", "?:\\Users\\*\\Downloads\\*.exe",
    "\\Device\\HarddiskVolume*\\Users\\Public\\*.exe", "\\Device\\HarddiskVolume*\\ProgramData\\*.exe", "\\Device\\HarddiskVolume*\\Users\\*\\Downloads\\*.exe"
  )
 ) and
dns.question.name regex """.*\.(top|buzz|xyz|rest|ml|cf|gq|ga|onion|monster|cyou|quest|cc|bar|cfd|click|cam|surf|tk|shop|club|icu|pw|ws|online|fun|life|boats|store|hair|skin|motorcycles|christmas|lol|makeup|mom|bond|beauty|biz|live|work|zip|country|accountant|date|party|science|loan|win|men|faith|review|racing|download|host|zone)""" and

not process.executable : (
    "?:\\ProgramData\\Microsoft\\Windows Defender\\platform\\*\\*.exe",
    "\\Device\\HarddiskVolume*\\ProgramData\\Microsoft\\Windows Defender\\platform\\*\\*.exe",
    "?:\\ProgramData\\Microsoft\\Windows Defender Advanced Threat Protection\\Platform\\Versions\\*\\*.exe",
    "\\Device\\HarddiskVolume*\\ProgramData\\Microsoft\\Windows Defender Advanced Threat Protection\\Platform\\Versions\\*\\*.exe"
)

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
dns.question.nameis_not_null
  • (no value, null check)
field:"QueryName" kind:is_not_null
dns.question.nameregex_match
  • .*.(top|buzz|xyz|rest|ml|cf|gq|ga|onion|monster|cyou|quest|cc|bar|cfd|click|cam|surf|tk|shop|club|icu|pw|ws|online|fun|life|boats|store|hair|skin|motorcycles|christmas|lol|makeup|mom|bond|beauty|biz|live|work|zip|country|accountant|date|party|science|loan|win|men|faith|review|racing|download|host|zone)
field:"QueryName" kind:regex_match value:".*.(top|buzz|xyz|rest|ml|cf|gq|ga|onion|monster|cyou|quest|cc|bar|cfd|click|cam|surf|tk|shop|club|icu|pw|ws|online|fun|life|boats|store|hair|skin|motorcycles|christmas|lol|makeup|mom|bond|beauty|biz|live|work|zip|country|accountant|date|party|science|loan|win|men|faith|review|racing|download|host|zone)"
process.code_signature.existseq
  • false transforms: boolean corpus 118 (elastic 118)
field:"process.code_signature.exists" kind:eq value:"false"
process.code_signature.subject_namewildcard
  • AutoIt Consulting Ltd corpus 5 (elastic 5)
  • OpenJS Foundation corpus 6 (elastic 6)
  • Python Software Foundation corpus 6 (elastic 6)
field:"Signature" kind:wildcard
process.code_signature.trustedeq
  • false transforms: boolean corpus 114 (elastic 114)
field:"process.code_signature.trusted" kind:eq value:"false"
process.executablewildcard
  • ?:\ProgramData\*.exe corpus 9 (elastic 9)
  • ?:\Users\*\Downloads\*.exe corpus 2 (elastic 2)
  • ?:\Users\Public\*.exe corpus 3 (elastic 3)
  • \Device\HarddiskVolume*\ProgramData\*.exe corpus 4 (elastic 4)
  • \Device\HarddiskVolume*\Users\*\Downloads\*.exe corpus 2 (elastic 2)
  • \Device\HarddiskVolume*\Users\Public\*.exe corpus 2 (elastic 2)
field:"Image" kind:wildcard
process.namewildcard
  • *.com corpus 3 (elastic 3)
  • *.pif corpus 3 (elastic 3)
  • *.scr
  • InstallUtil.exe corpus 3 (elastic 3)
  • MSBuild.exe corpus 4 (elastic 4)
  • bitsadmin.exe corpus 3 (elastic 3)
  • curl.exe corpus 7 (elastic 7)
  • dllhost.exe corpus 3 (elastic 3)
  • java.exe corpus 3 (elastic 3)
  • javaw.exe corpus 4 (elastic 4)
  • mshta.exe corpus 6 (elastic 6)
  • msiexec.exe corpus 4 (elastic 4)
  • node.exe corpus 8 (elastic 8)
  • powershell.exe corpus 12 (elastic 12)
  • pwsh.exe corpus 6 (elastic 6)
  • python.exe corpus 2 (elastic 2)
  • regsvr32.exe corpus 4 (elastic 4)
  • rundll32.exe corpus 8 (elastic 8)
  • wscript.exe corpus 9 (elastic 9)
field:"process_basename" kind:wildcard

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.executablewildcard?:\ProgramData\Microsoft\Windows Defender\platform\*\*.exe, \Device\HarddiskVolume*\ProgramData\Microsoft\Windows Defender\platform\*\*.exe, ?:\ProgramData\Microsoft\Windows Defender Advanced Threat Protection\Platform\Versions\*\*.exe, \Device\HarddiskVolume*\ProgramData\Microsoft\Windows Defender Advanced Threat Protection\Platform\Versions\*\*.exeexcludes:process.executable

New GitHub App Installed

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

This rule detects when a new GitHub App has been installed in your organization account. GitHub Apps extend GitHub's functionality both within and outside of GitHub. When an app is installed it is granted permissions to read or modify your repository and organization data. Only trusted apps should be installed and any newly installed apps should be investigated to verify their legitimacy. Unauthorized app installation could lower your organization's security posture and leave you exposed for future attacks.

MITRE ATT&CK Coverage

Telemetry Coverage

Rules Detecting the Same Action

These rules filter on the same operation.

Rule Body

[metadata]
creation_date = "2023/08/29"
integration = ["github"]
maturity = "production"
updated_date = "2026/04/10"

[rule]
author = ["Elastic"]
description = """
This rule detects when a new GitHub App has been installed in your organization account. GitHub Apps extend GitHub's
functionality both within and outside of GitHub. When an app is installed it is granted permissions to read or modify
your repository and organization data. Only trusted apps should be installed and any newly installed apps should be
investigated to verify their legitimacy. Unauthorized app installation could lower your organization's security posture
and leave you exposed for future attacks.
"""
from = "now-9m"
index = ["logs-github.audit-*"]
language = "eql"
license = "Elastic License v2"
name = "New GitHub App Installed"
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 New GitHub App Installed

GitHub Apps enhance functionality by integrating with repositories and organization data, requiring careful scrutiny upon installation. Adversaries may exploit these apps to gain unauthorized access or manipulate data. The detection rule monitors audit logs for new app installations, flagging potential threats by identifying unauthorized or suspicious integrations, thus safeguarding organizational security.

### Possible investigation steps

- Review the audit logs for the specific event.dataset "github.audit" and event.action "integration_installation.create" to identify the newly installed GitHub App.
- Verify the identity of the user or service account that performed the installation to ensure it aligns with expected behavior and authorized personnel.
- Check the permissions requested by the newly installed app to assess the level of access it has to your repositories and organization data.
- Cross-reference the app with a list of approved or trusted applications within your organization to determine if it is authorized.
- Investigate the app's developer or vendor to ensure they are reputable and have a history of secure and reliable applications.
- Communicate with the team or individual responsible for the installation to confirm the app's purpose and necessity within the organization.

### False positive analysis

- Frequent installations of trusted internal apps may trigger alerts. To manage this, maintain a list of approved internal apps and create exceptions for these in the detection rule.
- Automated deployment tools that integrate with GitHub might cause false positives. Identify these tools and exclude their installation events from triggering alerts.
- Regular updates or re-installations of existing apps can be mistaken for new installations. Track app version updates separately and adjust the rule to differentiate between updates and new installations.
- Development or testing environments often install and remove apps frequently. Consider excluding these environments from the rule or setting up a separate monitoring process for them.

### Response and remediation

- Immediately revoke the permissions of the newly installed GitHub App to prevent any unauthorized access or data manipulation.
- Notify the security team and relevant stakeholders about the unauthorized app installation for awareness and further investigation.
- Conduct a review of recent repository and organization changes to identify any unauthorized modifications or data access that may have occurred.
- If malicious activity is detected, initiate a rollback of affected repositories to a secure state prior to the app installation.
- Escalate the incident to higher-level security management if the app installation is linked to a broader security breach or if sensitive data has been compromised.
- Implement stricter access controls and approval processes for future GitHub App installations to prevent unauthorized installations.
- Update detection mechanisms to include additional indicators of compromise related to GitHub App installations, enhancing future threat detection capabilities."""
risk_score = 47
rule_id = "1ca62f14-4787-4913-b7af-df11745a49da"
severity = "medium"
tags = [
    "Domain: Cloud",
    "Use Case: Threat Detection",
    "Tactic: Execution",
    "Data Source: Github",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"

query = '''
configuration where data_stream.dataset == "github.audit" and event.action == "integration_installation.create"
'''


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

[[rule.threat.technique]]
id = "T1072"
name = "Software Deployment Tools"
reference = "https://attack.mitre.org/techniques/T1072/"

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

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

[[rule.threat.technique]]
id = "T1199"
name = "Trusted Relationship"
reference = "https://attack.mitre.org/techniques/T1199/"

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

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

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

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

Stages and Predicates

Stage 1: configuration

configuration where data_stream.dataset == "github.audit" and event.action == "integration_installation.create"

Indicators

These rows show field, operator, and value matches.

Potential Evasion with Hardware Breakpoints

#
Source
github.com/elastic/protections-artifacts

Identifies attempt to abuse a thread debug registers along with malicious exception handlers to hijack the normal execution flow of a thread. This provides an adversary an advantage to inject commands to perform unexpected, unwanted, or malicious operations.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
Identifies attempt to abuse a thread debug registers along with malicious exception handlers to hijack the normal
execution flow of a thread. This provides an adversary an advantage to inject commands to perform unexpected, unwanted,
or malicious operations.
"""
id = "a10e7b14-4b7b-4a34-b3f6-64791c1114b3"
license = "Elastic License v2"
name = "Potential Evasion with Hardware Breakpoints"
os_list = ["windows"]
reference = ["https://github.com/rad9800/hwbp4mw"]
version = "1.0.20"

query = '''
library where process.thread.Ext.hardware_breakpoint_set == true and process.executable != null and
   dll.name : ("wininet.dll", "ws2_32.dll", "dnsapi.dll", "winhttp.dll", "clr.dll", "netapi32.dll",
                "mscorwks.dll", "System.*.dll", "mscorlib*.dll", "Microsoft.PowerShell.Security*.dll", 
                "Microsoft.PowerShell.ConsoleHost*.dll", "wmiutils.dll", "fastprox.dll", "wbemprox.dll", 
                "vaultcli.dll", "taskschd.dll", "dsquery.dll", "mstscax.dll", "ntdll.dll", "wldap32.dll", 
                "wtsapi32.dll", "psapi.dll") and
 not (process.code_signature.trusted == true and 
      process.code_signature.subject_name : 
                ("Riot Games, Inc.", "Roblox Corporation", "ROBLOX CORPORATION", "Intelligent Security Systems Corporation", 
                 "Famatech Corp.", "Nuance Communications, Inc.", "Blizzard Entertainment, Inc.", "Kofax, Inc.", "KRAFTON, Inc.",
                 "Guidance Software, Inc.", "Open Text Corporation", "CUMMINS INC.", "Cockos Incorporated", "ByteSphere Technologies LLC",
                 "PROMICRA, s.r.o.", "Avid Technology, Inc.", "Avid Technology, Inc", "Krzysztof Kowalczyk",
                 "Yummy Interactive Inc", "Caliper Corporation", "Tencent Technology (Shenzhen) Company Limited",
                 "Big Fish Games, Inc.", "Big Fish Games", "GdP Software", "Tonec Inc.", "Active Database Software LLC",
                 "URSoft, Inc.", "Respondus, Inc.", "Meta Enterprises LLC", "Epic Games Inc.", "Valve Corp.",
                 "Medical Information Technology, Inc.")) and
 not _arraysearch(process.thread.Ext.call_stack, $entry,
                  $entry.symbol_info : ("?:\\Windows\\apppatch\\AppPatch64\\exploitblocker.dll!*",
                                        "?:\\Windows\\apppatch\\exploitblocker.dll*",
                                        "?:\\Windows\\AppPatch\\emet.dll!*",
                                        "?:\\Windows\\AppPatch\\apppatch64\\emet.dll!*",
                                        "?:\\Windows\\AppPatch\\emet64.dll!*",
                                        "?:\\Windows\\AppPatch\\apppatch64\\emet64.dll!*")) and
 not process.executable : ("C:\\Program Files (x86)\\Cambridge\\CEPD - 17th Edition\\cepd17.exe",
                           "C:\\Program Files (x86)\\SCRABBLE\\GHScrabble.exe",
                           "C:\\Program Files (x86)\\Kofax\\Power PDF 31\\NPDFLM.exe",
                           "C:\\Program Files (x86)\\Common Files\\ExpertGPS\\ExpertGPS.exe",
                           "C:\\Program Files (x86)\\IBH softec GmbH\\S57W\\S57W.exe",
                           "C:\\Program Files (x86)\\Microsoft Games\\Age of Empires III\\age3y.exe",
                           "C:\\Program Files (x86)\\TheLearningPit\\LogixPro\\LPovl.exe",
                           "C:\\Program Files (x86)\\iLok License Manager\\iLok License Manager.exe",
                           "C:\\Program Files (x86)\\Common Files\\PACE\\Services\\LicenseServices\\LDSvc.exe",
                           "C:\\Program Files (x86)\\NWPS\\SwitchPortMapper\\spmap.exe",
                           "C:\\Program Files (x86)\\Steam\\steamapps\\common\\Call of Duty Black Ops II\\t6zm.exe",
                           "C:\\Program Files (x86)\\Microsoft Office\\Office16\\MSACCESS.EXE",
                           "C:\\Program Files (x86)\\Boardmaker with SD Pro\\BM_SDP.exe",
                           "C:\\Program Files (x86)\\Nuance\\Power PDF 20\\NPDFLM.exe",
                           "C:\\ProgramData\\Big Fish\\Game Manager\\Addons\\gmActivator.exe",
                           "C:\\Program Files (x86)\\Boardmaker with SD Pro\\BM_SDP.exe",
                           "C:\\Program Files (x86)\\Nuance\\PDF Professional 6\\PdfPro6Hook.exe",
                           "C:\\Program Files (x86)\\FormTool 7\\Program\\FormTool.exe",
                           "D:\\DesktopAPP\\SteamDesktop\\steamapps\\common\\VRChat\\VRChat.exe",
                           "C:\\Program Files (x86)\\Christmas Wonderland 15 Collectors Edition\\kcfjhdd.exe",
                           "C:\\Program Files (x86)\\Sea Life Explorer Collectors Edition\\fqlkpjx.exe",
                           "C:\\Program Files (x86)\\Hidden Differences - World Tour\\cgrtmwc.exe",
                           "\\Device\\HarddiskVolume4\\Program Files (x86)\\WeGame\\tenprotect\\TASLogin.exe",
                           "C:\\Program Files (x86)\\Hunter\\Aligner\\Execute\\aligner.exe",
                           "D:\\Program Files (x86)\\NWPS\\SwitchPortMapper\\spmap.exe",
                           "C:\\Program Files (x86)\\Ultra Screen Saver Maker\\ussm.exe") and
 not (process.executable : "C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe" and dll.name == "ws2_32.dll" and
      process.thread.Ext.call_stack_summary == "Unbacked" and
      _arraysearch(process.thread.Ext.call_stack, $entry,
       $entry.callsite_trailing_bytes == "c3cd2ec30f1f84000000000000000000000000000000000000000000000000000000000000000000000000004c8bd1b82a000000f604250803fe7f0175030f05")) and
 not (endswith~(process.thread.Ext.call_stack_summary, concat("ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|kernelbase.dll|", process.name)) and
      _arraysearch(process.thread.Ext.call_stack, $entry, $entry.protection : "RWX" and $entry.allocation_private_bytes >= 100000 and stringcontains~($entry.symbol_info, process.name))) and
 not (dll.name : "wininet.dll" and process.thread.Ext.call_stack_summary == "ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|kernelbase.dll|sscprot.dll|ntdll.dll|kernelbase.dll|combase.dll|shellhelper32.dll|calipermtxf.dll")
'''

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

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

[[threat.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.0"

Stages and Predicates

Stage 1: library

library where process.thread.Ext.hardware_breakpoint_set == true and process.executable != null and
   dll.name : ("wininet.dll", "ws2_32.dll", "dnsapi.dll", "winhttp.dll", "clr.dll", "netapi32.dll",
                "mscorwks.dll", "System.*.dll", "mscorlib*.dll", "Microsoft.PowerShell.Security*.dll", 
                "Microsoft.PowerShell.ConsoleHost*.dll", "wmiutils.dll", "fastprox.dll", "wbemprox.dll", 
                "vaultcli.dll", "taskschd.dll", "dsquery.dll", "mstscax.dll", "ntdll.dll", "wldap32.dll", 
                "wtsapi32.dll", "psapi.dll") and
 not (process.code_signature.trusted == true and 
      process.code_signature.subject_name : 
                ("Riot Games, Inc.", "Roblox Corporation", "ROBLOX CORPORATION", "Intelligent Security Systems Corporation", 
                 "Famatech Corp.", "Nuance Communications, Inc.", "Blizzard Entertainment, Inc.", "Kofax, Inc.", "KRAFTON, Inc.",
                 "Guidance Software, Inc.", "Open Text Corporation", "CUMMINS INC.", "Cockos Incorporated", "ByteSphere Technologies LLC",
                 "PROMICRA, s.r.o.", "Avid Technology, Inc.", "Avid Technology, Inc", "Krzysztof Kowalczyk",
                 "Yummy Interactive Inc", "Caliper Corporation", "Tencent Technology (Shenzhen) Company Limited",
                 "Big Fish Games, Inc.", "Big Fish Games", "GdP Software", "Tonec Inc.", "Active Database Software LLC",
                 "URSoft, Inc.", "Respondus, Inc.", "Meta Enterprises LLC", "Epic Games Inc.", "Valve Corp.",
                 "Medical Information Technology, Inc.")) and
 not _arraysearch(process.thread.Ext.call_stack, $entry,
                  $entry.symbol_info : ("?:\\Windows\\apppatch\\AppPatch64\\exploitblocker.dll!*",
                                        "?:\\Windows\\apppatch\\exploitblocker.dll*",
                                        "?:\\Windows\\AppPatch\\emet.dll!*",
                                        "?:\\Windows\\AppPatch\\apppatch64\\emet.dll!*",
                                        "?:\\Windows\\AppPatch\\emet64.dll!*",
                                        "?:\\Windows\\AppPatch\\apppatch64\\emet64.dll!*")) and
 not process.executable : ("C:\\Program Files (x86)\\Cambridge\\CEPD - 17th Edition\\cepd17.exe",
                           "C:\\Program Files (x86)\\SCRABBLE\\GHScrabble.exe",
                           "C:\\Program Files (x86)\\Kofax\\Power PDF 31\\NPDFLM.exe",
                           "C:\\Program Files (x86)\\Common Files\\ExpertGPS\\ExpertGPS.exe",
                           "C:\\Program Files (x86)\\IBH softec GmbH\\S57W\\S57W.exe",
                           "C:\\Program Files (x86)\\Microsoft Games\\Age of Empires III\\age3y.exe",
                           "C:\\Program Files (x86)\\TheLearningPit\\LogixPro\\LPovl.exe",
                           "C:\\Program Files (x86)\\iLok License Manager\\iLok License Manager.exe",
                           "C:\\Program Files (x86)\\Common Files\\PACE\\Services\\LicenseServices\\LDSvc.exe",
                           "C:\\Program Files (x86)\\NWPS\\SwitchPortMapper\\spmap.exe",
                           "C:\\Program Files (x86)\\Steam\\steamapps\\common\\Call of Duty Black Ops II\\t6zm.exe",
                           "C:\\Program Files (x86)\\Microsoft Office\\Office16\\MSACCESS.EXE",
                           "C:\\Program Files (x86)\\Boardmaker with SD Pro\\BM_SDP.exe",
                           "C:\\Program Files (x86)\\Nuance\\Power PDF 20\\NPDFLM.exe",
                           "C:\\ProgramData\\Big Fish\\Game Manager\\Addons\\gmActivator.exe",
                           "C:\\Program Files (x86)\\Boardmaker with SD Pro\\BM_SDP.exe",
                           "C:\\Program Files (x86)\\Nuance\\PDF Professional 6\\PdfPro6Hook.exe",
                           "C:\\Program Files (x86)\\FormTool 7\\Program\\FormTool.exe",
                           "D:\\DesktopAPP\\SteamDesktop\\steamapps\\common\\VRChat\\VRChat.exe",
                           "C:\\Program Files (x86)\\Christmas Wonderland 15 Collectors Edition\\kcfjhdd.exe",
                           "C:\\Program Files (x86)\\Sea Life Explorer Collectors Edition\\fqlkpjx.exe",
                           "C:\\Program Files (x86)\\Hidden Differences - World Tour\\cgrtmwc.exe",
                           "\\Device\\HarddiskVolume4\\Program Files (x86)\\WeGame\\tenprotect\\TASLogin.exe",
                           "C:\\Program Files (x86)\\Hunter\\Aligner\\Execute\\aligner.exe",
                           "D:\\Program Files (x86)\\NWPS\\SwitchPortMapper\\spmap.exe",
                           "C:\\Program Files (x86)\\Ultra Screen Saver Maker\\ussm.exe") and
 not (process.executable : "C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe" and dll.name == "ws2_32.dll" and
      process.thread.Ext.call_stack_summary == "Unbacked" and
      _arraysearch(process.thread.Ext.call_stack, $entry,
       $entry.callsite_trailing_bytes == "c3cd2ec30f1f84000000000000000000000000000000000000000000000000000000000000000000000000004c8bd1b82a000000f604250803fe7f0175030f05")) and
 not (endswith~(process.thread.Ext.call_stack_summary, concat("ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|kernelbase.dll|", process.name)) and
      _arraysearch(process.thread.Ext.call_stack, $entry, $entry.protection : "RWX" and $entry.allocation_private_bytes >= 100000 and stringcontains~($entry.symbol_info, process.name))) and
 not (dll.name : "wininet.dll" and process.thread.Ext.call_stack_summary == "ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|kernelbase.dll|sscprot.dll|ntdll.dll|kernelbase.dll|combase.dll|shellhelper32.dll|calipermtxf.dll")

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
dll.namewildcard
  • Microsoft.PowerShell.ConsoleHost*.dll corpus 2 (elastic 2)
  • Microsoft.PowerShell.Security*.dll corpus 2 (elastic 2)
  • System.*.dll corpus 2 (elastic 2)
  • clr.dll corpus 2 (elastic 2)
  • dnsapi.dll corpus 2 (elastic 2)
  • dsquery.dll corpus 2 (elastic 2)
  • fastprox.dll corpus 2 (elastic 2)
  • mscorlib*.dll corpus 2 (elastic 2)
  • mscorwks.dll corpus 2 (elastic 2)
  • mstscax.dll corpus 2 (elastic 2)
  • netapi32.dll corpus 2 (elastic 2)
  • ntdll.dll corpus 2 (elastic 2)
  • psapi.dll corpus 2 (elastic 2)
  • taskschd.dll corpus 2 (elastic 2)
  • vaultcli.dll corpus 2 (elastic 2)
  • wbemprox.dll corpus 2 (elastic 2)
  • winhttp.dll corpus 2 (elastic 2)
  • wininet.dll corpus 2 (elastic 2)
  • wldap32.dll corpus 3 (elastic 3)
  • wmiutils.dll corpus 2 (elastic 2)
  • ws2_32.dll corpus 2 (elastic 2)
  • wtsapi32.dll corpus 2 (elastic 2)
field:"dll.name" kind:wildcard
process.executableis_not_null
  • (no value, null check)
field:"Image" kind:is_not_null
process.thread.Ext.hardware_breakpoint_seteq
  • true transforms: boolean corpus 2 (elastic 2)
field:"process.thread.Ext.hardware_breakpoint_set" kind:eq value:"true"

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.thread.Ext.call_stackarray_any(no value, null check)excludes:process.thread.Ext.call_stack
process.thread.Ext.call_stack_summaryends_withconcat("ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|kernelbase.dll|", process.name)excludes:process.thread.Ext.call_stack_summary
dll.nameeqws2_32.dllexcludes:dll.name field:"dll.name" value:"ws2_32.dll"
process.executableeqC:\Program Files\Google\Chrome\Application\chrome.exeexcludes:process.executable field:"process.executable" value:"C:\Program Files\Google\Chrome\Application\chrome.exe"
process.thread.Ext.call_stack_summaryeqUnbackedexcludes:process.thread.Ext.call_stack_summary field:"process.thread.Ext.call_stack_summary" value:"Unbacked"
dll.nameeqwininet.dllexcludes:dll.name field:"dll.name" value:"wininet.dll"
process.thread.Ext.call_stack_summaryeqntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|kernelbase.dll|sscprot.dll|ntdll.dll|kernelbase.dll|combase.dll|shellhelper32.dll|calipermtxf.dllexcludes:process.thread.Ext.call_stack_summary field:"process.thread.Ext.call_stack_summary" value:"ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|kernelbase.dll|sscprot.dll|ntdll.dll|kernelbase.dll|combase.dll|shellhelper32.dll|calipermtxf.dll"
process.code_signature.subject_nameeqRiot Games, Inc., Roblox Corporation, ROBLOX CORPORATION, Intelligent Security Systems Corporation, Famatech Corp., Nuance Communications, Inc., Blizzard Entertainment, Inc., Kofax, Inc., KRAFTON, Inc., Guidance Software, Inc., Open Text Corporation, CUMMINS INC., Cockos Incorporated, ByteSphere Technologies LLC, PROMICRA, s.r.o., Avid Technology, Inc., Avid Technology, Inc, Krzysztof Kowalczyk, Yummy Interactive Inc, Caliper Corporation, Tencent Technology (Shenzhen) Company Limited, Big Fish Games, Inc., Big Fish Games, GdP Software, Tonec Inc., Active Database Software LLC, URSoft, Inc., Respondus, Inc., Meta Enterprises LLC, Epic Games Inc., Valve Corp., Medical Information Technology, Inc.excludes:process.code_signature.subject_name
process.code_signature.trustedeqtrueexcludes:process.code_signature.trusted field:"process.code_signature.trusted" value:"true"
process.executableeqC:\Program Files (x86)\Cambridge\CEPD - 17th Edition\cepd17.exe, C:\Program Files (x86)\SCRABBLE\GHScrabble.exe, C:\Program Files (x86)\Kofax\Power PDF 31\NPDFLM.exe, C:\Program Files (x86)\Common Files\ExpertGPS\ExpertGPS.exe, C:\Program Files (x86)\IBH softec GmbH\S57W\S57W.exe, C:\Program Files (x86)\Microsoft Games\Age of Empires III\age3y.exe, C:\Program Files (x86)\TheLearningPit\LogixPro\LPovl.exe, C:\Program Files (x86)\iLok License Manager\iLok License Manager.exe, C:\Program Files (x86)\Common Files\PACE\Services\LicenseServices\LDSvc.exe, C:\Program Files (x86)\NWPS\SwitchPortMapper\spmap.exe, C:\Program Files (x86)\Steam\steamapps\common\Call of Duty Black Ops II\t6zm.exe, C:\Program Files (x86)\Microsoft Office\Office16\MSACCESS.EXE, C:\Program Files (x86)\Boardmaker with SD Pro\BM_SDP.exe, C:\Program Files (x86)\Nuance\Power PDF 20\NPDFLM.exe, C:\ProgramData\Big Fish\Game Manager\Addons\gmActivator.exe, C:\Program Files (x86)\Boardmaker with SD Pro\BM_SDP.exe, C:\Program Files (x86)\Nuance\PDF Professional 6\PdfPro6Hook.exe, C:\Program Files (x86)\FormTool 7\Program\FormTool.exe, D:\DesktopAPP\SteamDesktop\steamapps\common\VRChat\VRChat.exe, C:\Program Files (x86)\Christmas Wonderland 15 Collectors Edition\kcfjhdd.exe, C:\Program Files (x86)\Sea Life Explorer Collectors Edition\fqlkpjx.exe, C:\Program Files (x86)\Hidden Differences - World Tour\cgrtmwc.exe, \Device\HarddiskVolume4\Program Files (x86)\WeGame\tenprotect\TASLogin.exe, C:\Program Files (x86)\Hunter\Aligner\Execute\aligner.exe, D:\Program Files (x86)\NWPS\SwitchPortMapper\spmap.exe, C:\Program Files (x86)\Ultra Screen Saver Maker\ussm.exeexcludes:process.executable

Potential Malicious PowerShell Based on Alert Correlation

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

Identifies PowerShell script blocks linked to multiple distinct PowerShell detections via the same ScriptBlock ID, indicating compound suspicious behavior. Attackers often chain obfuscation, decoding, and execution within a single script block.

MITRE ATT&CK Coverage

Rule Body

[metadata]
creation_date = "2025/04/16"
maturity = "production"
updated_date = "2026/05/01"

[rule]
author = ["Elastic"]
description = """
Identifies PowerShell script blocks linked to multiple distinct PowerShell detections via the same ScriptBlock ID,
indicating compound suspicious behavior. Attackers often chain obfuscation, decoding, and execution within a single
script block.
"""
from = "now-9m"
language = "esql"
license = "Elastic License v2"
name = "Potential Malicious PowerShell Based on Alert Correlation"
risk_score = 73
rule_id = "f770ce79-05fd-4d74-9866-1c5d66c9b34b"
severity = "high"
tags = [
    "Domain: Endpoint",
    "OS: Windows",
    "Use Case: Threat Detection",
    "Tactic: Execution",
    "Rule Type: Higher-Order Rule",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "esql"

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

// Filter for PowerShell related alerts
| where kibana.alert.rule.name like "*PowerShell*"

// as alerts don't have non-ECS fields, parse the script block ID using grok
| grok message "ScriptBlock ID: (?<Esql.script_block_id>.+)"
| where Esql.script_block_id is not null

// keep relevant fields for further processing
| keep kibana.alert.rule.name, Esql.script_block_id, _id, user.id, process.pid, host.id

// count distinct alerts and filter for matches above the threshold
| stats
    Esql.kibana_alert_rule_name_count_distinct = count_distinct(kibana.alert.rule.name),
    Esql.kibana_alert_rule_name_values = values(kibana.alert.rule.name),
    Esql._id_values = values(_id),
    Esql.user_id_values = values(user.id),
    Esql.process_pid_values = values(process.pid),
    Esql.host_id_values = values(host.id)
  by Esql.script_block_id

// Apply detection threshold
| where Esql.kibana_alert_rule_name_count_distinct >= 5
| eval user.id = MV_MIN(Esql.user_id_values),
       process.pid = MV_MIN(Esql.process_pid_values),
       host.id = MV_MIN(Esql.host_id_values)
| keep host.id, user.id, process.pid, Esql.*
'''

note = """## Triage and analysis

### Investigating Potential Malicious PowerShell Based on Alert Correlation

#### Possible investigation steps

- What does the ES|QL grouped alert preserve about the suspicious PowerShell mix?
  - Focus: treat `Esql.script_block_id`, `Esql.kibana_alert_rule_name_values`, `Esql._id_values`, preserved `host.id` / `user.id`, and `Esql.kibana_alert_rule_name_count_distinct` as search clues, not evidence.
  - Implication: escalate if rule names span obfuscation, download, execution, persistence, credential access, or defense evasion for one host/user; lower suspicion only when recovered source alerts/events show one recognized detection-validation script or controlled encoded-content automation pattern.

- Do the contributing alerts bind the summary to one script execution?
  - Focus: recover contributing alerts around grouped-alert time using preserved host/user, `Esql.kibana_alert_rule_name_values`, and script-block ID; use `Esql._id_values` only when alert search supports those IDs.
  - Hint: recover contributing alerts before interpreting grouped behavior; ES|QL grouped alerts lack member-event Timeline pivots and reliable source-event time, PID, or entity anchors.
  - Implication: treat as one execution chain only when source alerts and events align to one host, one user, one source-event window, and one script-block ID; keep unresolved if timestamps, script evidence, PID reuse risk, or entity scope conflict.

- Can you reconstruct and interpret the source PowerShell script block?
  - Focus: using recovered source-event host, process, and time, query PowerShell 4104 or source events; match `powershell.file.script_block_id`, order `powershell.sequence` / `powershell.total`, and read script-block text.
  - Implication: escalate when reconstructed text shows encoded/decoded stages, download cradles, reflection, hosted System.Management.Automation execution, credential access, persistence, or defense evasion; missing fragments or source PowerShell telemetry are unresolved, not benign.

- Which process and launch chain executed the script block?
  - Focus: use recovered time, `host.id`, and process identifiers to find the process start; collect `process.entity_id`, `process.command_line`, `process.parent.command_line`, and `process.Ext.authentication_id`.
  - Hint: if no process start appears, expand time first; if still missing, scope later file, registry, and network review to recovered source-event host/user/process/time.
  - Implication: escalate when the launcher is a document, browser, remote-management tool, scheduled task, unexpected script or .NET host, or command line with encoded, hidden, bypass, download, or dynamic evaluation; lower suspicion only when the same parent, command, user, and host bind to the exact recovered benign workflow.

- Did the process stage payloads, persistence, or security-impacting changes?
  - Focus: scope file and registry events to recovered `process.entity_id` or fallback source-event host/PID/time context; review `file.path`, `file.origin_url`, `registry.path`, `registry.value`, and `registry.data.strings`.
  - Implication: escalate when the script writes executable or scriptable content to user-writable or startup paths, leaves internet provenance, modifies persistence or security keys, or later executes staged content; lower suspicion only when artifacts stay inside the exact recovered benign workflow. Missing file or registry telemetry does not clear the alert.

- Did network or session evidence fit offensive PowerShell use?
  - Focus: scope DNS/connections to recovered `process.entity_id` or source-event host/PID/time context; read `dns.question.name`, `destination.ip`, and `destination.port`; when origin matters, bridge `process.Ext.authentication_id` to `winlog.event_data.TargetLogonId`.
  - Implication: escalate when the script reaches rare or public destinations, pulls content, contacts infrastructure unrelated to the recovered workflow, or runs from an unexpected remote session; missing network or Windows Security telemetry is unresolved, not benign.

- If local evidence is suspicious or unresolved, does the same pattern recur elsewhere enough to change scope?
  - Focus: related alerts for preserved `user.id` over 48 hours, looking for the same `Esql.kibana_alert_rule_name_values`, reconstructed script fragment, launch context, or extracted indicators. $investigate_0
  - Hint: if user-scoped alerts are quiet or ambiguous, compare related alerts for preserved `host.id` over 48 hours. $investigate_1
  - Implication: broaden response when the same script body, rule-name mix, or indicators appear on unrelated hosts or users; keep scope local when recurrence stays on the host under review, but do not close from recurrence alone.

- Weigh contributing-alert alignment, reconstructed script, launch chain, artifacts, destinations, and host/user scope; escalate for offensive tooling, unauthorized execution, staged payloads, persistence, or suspicious destinations; close only when source evidence binds to one exact benign workflow, using outside confirmation only for facts telemetry cannot prove; preserve artifacts and escalate on conflicts or missing telemetry.

### False positive analysis

- Authorized red-team, lab, or detection-validation can trigger several PowerShell rules on one script. Confirm alert mix, reconstructed script, launch chain, `user.id`, and `host.id` match exact test scope; if records are unavailable, recurrence can support scoping but cannot close the alert.
- Endpoint management or deployment automation can trigger multiple detections through encoded content, dynamic script generation, or controlled downloads. Confirm `powershell.file.script_block_text`, parent/child command lines, artifacts, and destinations align with one managed workflow. If script body, destinations, or follow-on artifacts diverge, do not close as benign.
- Before an exception, validate stable benign anchors: `user.id`, `host.id`, parent/child command lines, script fragment, and destination or artifact pattern. Avoid exceptions on ES|QL summary fields or `Esql.script_block_id`; they are alert-local or execution-specific.

### Response and remediation

- If confirmed benign, document the alert mix, reconstructed script, launch chain, and recovered host/user context before reversing containment. Build exceptions from stable recovered workflow anchors, not ES|QL summary fields alone.
- If suspicious but unconfirmed, preserve contributing alerts, `Esql._id_values`, `Esql.script_block_id`, rule-name values, reconstructed script text, recovered parent/child command lines, file/registry paths, and DNS/destination indicators before cleanup. Apply reversible containment first, such as temporary destination restrictions or heightened monitoring on recovered `host.id` and `user.id`; isolate or strengthen account action only if the script is still executing, staging payloads, or reaching suspicious destinations and host role allows.
- If confirmed malicious, record entity IDs, command lines, and indicators, then isolate the host when lateral-movement or active-payload risk is present. Stop the PowerShell process or descendants only after preserving evidence; if direct response is unavailable, escalate with the evidence set. Block confirmed malicious destinations, URLs, hashes, and script paths; eradicate only tied files, registry changes, tasks, services, and payloads; remediate the launch path; and review related hosts/users before destructive cleanup.
- Post-incident hardening: preserve or expand PowerShell 4104 logging, source-alert retention, endpoint process telemetry, and Windows Security logs when gaps limited recovery; where operations allow, restrict high-risk PowerShell through signed scripts, Constrained Language Mode, JEA, or WinRM controls. Document the rule-name mix, observables, and adjacent variants such as indirect System.Management.Automation execution.
"""

[rule.investigation_fields]
field_names = [
    "host.id",
    "user.id",
    "process.pid",
    "Esql.script_block_id",
    "Esql._id_values",
    "Esql.kibana_alert_rule_name_values",
    "Esql.kibana_alert_rule_name_count_distinct",
]

[transform]

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

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

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

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

Stages and Predicates

Stage 1: from

from .alerts-security.* metadata _id

Stage 2: where

| where kibana.alert.rule.name like "*PowerShell*"

Stage 3: grok

| grok message "ScriptBlock ID: (?<Esql.script_block_id>.+)"

Stage 4: where

| where Esql.script_block_id is not null

Stage 5: keep

| keep kibana.alert.rule.name, Esql.script_block_id, _id, user.id, process.pid, host.id

Stage 6: stats

| stats
    Esql.kibana_alert_rule_name_count_distinct = count_distinct(kibana.alert.rule.name),
    Esql.kibana_alert_rule_name_values = values(kibana.alert.rule.name),
    Esql._id_values = values(_id),
    Esql.user_id_values = values(user.id),
    Esql.process_pid_values = values(process.pid),
    Esql.host_id_values = values(host.id)
  by Esql.script_block_id

Stage 7: where

| where Esql.kibana_alert_rule_name_count_distinct >= 5

Stage 8: eval

| eval user.id = MV_MIN(Esql.user_id_values),
       process.pid = MV_MIN(Esql.process_pid_values),
       host.id = MV_MIN(Esql.host_id_values)

Stage 9: keep

| keep host.id, user.id, process.pid, Esql.*

Indicators

These rows show field, operator, and value matches.

Output Fields

These fields are emitted when the rule matches.

FieldSource
host.idKEEP host.id
user.idKEEP user.id
process.pidKEEP process.pid
Esql.*KEEP Esql.*

Potential Privilege Escalation via PKEXEC

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

Identifies an attempt to exploit a local privilege escalation in polkit pkexec (CVE-2021-4034) via unsecure environment variable injection. Successful exploitation allows an unprivileged user to escalate to the root user.

MITRE ATT&CK Coverage

Rule Body

[metadata]
creation_date = "2022/01/26"
integration = ["endpoint", "sentinel_one_cloud_funnel"]
maturity = "production"
updated_date = "2026/03/24"

[rule]
author = ["Elastic"]
description = """
Identifies an attempt to exploit a local privilege escalation in polkit pkexec (CVE-2021-4034) via unsecure environment
variable injection. Successful exploitation allows an unprivileged user to escalate to the root user.
"""
from = "now-9m"
index = ["endgame-*", "logs-endpoint.events.file*", "logs-sentinel_one_cloud_funnel.*"]
language = "eql"
license = "Elastic License v2"
name = "Potential Privilege Escalation via PKEXEC"
note = """## Triage and analysis

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

### Investigating Potential Privilege Escalation via PKEXEC

Polkit's pkexec is a command-line utility that allows an authorized user to execute commands as another user, typically root, in Linux environments. Adversaries exploit vulnerabilities like CVE-2021-4034 by injecting unsecure environment variables, enabling unauthorized privilege escalation. The detection rule identifies suspicious file paths indicative of such exploitation attempts, focusing on environment variable manipulation to preemptively flag potential threats.

### Possible investigation steps

- Review the alert details to confirm the presence of the file path pattern "/*GCONV_PATH*" on a Linux host, as this is indicative of the potential exploitation attempt.
- Examine the process execution history on the affected host to identify any instances of pkexec being executed around the time of the alert. Look for unusual or unauthorized command executions.
- Check the environment variables set during the pkexec execution to identify any suspicious or unauthorized modifications that could indicate an exploitation attempt.
- Investigate the user account associated with the alert to determine if it has a history of privilege escalation attempts or other suspicious activities.
- Analyze system logs and security events for any additional indicators of compromise or related suspicious activities that occurred before or after the alert.
- Assess the patch status of the affected system to determine if it is vulnerable to CVE-2021-4034 and ensure that appropriate security updates have been applied.

### False positive analysis

- Routine administrative tasks involving pkexec may trigger alerts if they involve environment variable manipulation. Review the context of the command execution to determine if it aligns with expected administrative behavior.
- Custom scripts or applications that legitimately use environment variables in their execution paths might be flagged. Identify these scripts and consider adding them to an exception list if they are verified as non-threatening.
- Automated system management tools that modify environment variables for legitimate purposes could cause false positives. Monitor these tools and exclude their known safe operations from the detection rule.
- Development environments where developers frequently test applications with varying environment variables might generate alerts. Establish a baseline of normal activity and exclude these patterns if they are consistent and verified as safe.
- Scheduled tasks or cron jobs that involve environment variable changes should be reviewed. If they are part of regular system maintenance, document and exclude them from triggering alerts.

### Response and remediation

- Immediately isolate the affected system from the network to prevent further exploitation or lateral movement by the attacker.
- Terminate any suspicious processes associated with pkexec or unauthorized privilege escalation attempts to halt ongoing exploitation.
- Conduct a thorough review of system logs and file access records to identify any unauthorized changes or access patterns, focusing on the presence of GCONV_PATH in file paths.
- Revert any unauthorized changes made by the attacker, such as modifications to critical system files or configurations, to restore system integrity.
- Apply the latest security patches and updates to the polkit package to address CVE-2021-4034 and prevent future exploitation.
- Implement enhanced monitoring and alerting for similar privilege escalation attempts, ensuring that any future attempts are detected and responded to promptly.
- Report the incident to relevant internal security teams and, if necessary, escalate to external authorities or cybersecurity partners for further investigation and support."""
references = ["https://seclists.org/oss-sec/2022/q1/80", "https://haxx.in/files/blasty-vs-pkexec.c"]
risk_score = 73
rule_id = "8da41fc9-7735-4b24-9cc6-c78dfc9fc9c9"
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: Privilege Escalation",
    "Data Source: Elastic Endgame",
    "Use Case: Vulnerability",
    "Data Source: Elastic Defend",
    "Data Source: SentinelOne",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"

query = '''
file where host.os.type == "linux" and file.path : "/*GCONV_PATH*"
'''


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

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

[[rule.threat.technique]]
id = "T1574"
name = "Hijack Execution Flow"
reference = "https://attack.mitre.org/techniques/T1574/"

[[rule.threat.technique.subtechnique]]
id = "T1574.006"
name = "Dynamic Linker Hijacking"
reference = "https://attack.mitre.org/techniques/T1574/006/"

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

[[rule.threat.technique.subtechnique]]
id = "T1574.006"
name = "Dynamic Linker Hijacking"
reference = "https://attack.mitre.org/techniques/T1574/006/"

[[rule.threat.technique.subtechnique]]
id = "T1574.007"
name = "Path Interception by PATH Environment Variable"
reference = "https://attack.mitre.org/techniques/T1574/007/"

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

Stages and Predicates

Stage 1: file

file where host.os.type == "linux" and file.path : "/*GCONV_PATH*"

Indicators

These rows show field, operator, and value matches.

Potential Remote Desktop Protocol Tunneling

#
Time window
2m
Source
github.com/elastic/protections-artifacts

Identifies remote interactive logon attempt with from the localhost as a source address. This may indicate the initiation of a Remote Desktop Tunneling session.

MITRE ATT&CK Coverage

TacticTechniques
Command & Control

Rule Body

[rule]
description = """
Identifies remote interactive logon attempt with from the localhost as a source address. This may indicate the
initiation of a Remote Desktop Tunneling session.
"""
id = "2ad77d41-b36a-49b2-a54b-7be157e7a8c3"
license = "Elastic License v2"
name = "Potential Remote Desktop Protocol Tunneling"
os_list = ["windows"]
reference = [
    "https://blog.netspi.com/how-to-access-rdp-over-a-reverse-ssh-tunnel/",
    "https://github.com/sbousseaden/EVTX-ATTACK-SAMPLES/blob/4ceed2f4706daf601c212a8f91c113dd85349a2c/Command%20and%20Control/DE_RDP_Tunneling_4624.evtx",
]
version = "1.0.13"

query = '''
sequence with maxspan=2m
 [api where process.Ext.api.name == "connect" and process.Ext.api.summary like "connect( ipv4, tcp, 127.0.*, 3389 )" and
  not (process.code_signature.trusted == true and process.code_signature.subject_name in ("UiPath, Inc.", "Automation Anywhere, Inc.", "Google LLC", "Tanium Inc.",
      "Mozilla Corporation", "Nmap Software LLC", "N-ABLE TECHNOLOGIES LTD", "Connectwise, LLC", "Datto, LLC", "Zabbix SIA", "d.velop AG",
      "ESET, spol. s r.o.", "NoMachine S.a.r.l.", "Check Point Software Technologies Ltd.", "Amazon.com Services LLC", "Ericom Software Ltd",
      "ZABBIX, Sabiedriba ar ierobezotu atbildibu", "Intuit Inc", "TYCHON, LLC", "Siber Systems", "Axeda Corporation", "Kaseya Holdings Inc.",
      "OpsRamp, Inc.", "Paessler GmbH", "Ecosia GmbH")) and
  process.thread.Ext.call_stack_final_user_module.name != "Kernel" and process.executable != 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.path like
                                              ("c:\\windows\\assembly\\nativeimages_*.ni.dll",
                                               "c:\\program files\\*", "c:\\program files (x86)\\*") and
  not process.thread.Ext.call_stack_final_user_module.name in ("Undetermined", "Unknown") and
  not process.executable :
                 ("C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe",
                  "C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe",
                  "C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe",
                  "C:\\Program Files (x86)\\N-able Technologies\\Windows Agent\\bin\\agent.exe",
                  "C:\\Program Files\\Tenable\\Nessus Agent\\nessus-agent-module.exe",
                  "C:\\Program Files\\Intuit\\QuickBooks Enterprise Solutions *\\CefSharp.BrowserSubprocess.exe",
                  "C:\\Program Files\\WindowsApps\\DuckDuckGo.DesktopBrowser_*\\WindowsBrowser\\WebView2\\msedgewebview2.exe",
                  "C:\\Windows\\LTSvc\\LTSVC.exe") and
  not (process.name : "powershell.exe" and
       process.parent.executable : ("C:\\Program Files\\Tychon\\TychonEngine.exe",
                                    "C:\\Program Files\\Windows Defender Advanced Threat Protection\\SenseIR.exe",
                                    "C:\\ProgramData\\Microsoft\\Windows Defender Advanced Threat Protection\\Platform\\*\\SenseIR.exe"))
  ]
 [authentication where event.action == "log_on" and
  process.Ext.session_info.logon_type in ("RemoteInteractive", "Network") and cidrmatch(source.ip, "127.0.0.0/8", "::1")]
'''

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

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1572"
name = "Protocol Tunneling"
reference = "https://attack.mitre.org/techniques/T1572/"


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

[internal]
min_endpoint_version = "8.15.0"

Stages and Predicates

Stage 1: api

[api where process.Ext.api.name == "connect" and process.Ext.api.summary like "connect( ipv4, tcp, 127.0.*, 3389 )" and
  not (process.code_signature.trusted == true and process.code_signature.subject_name in ("UiPath, Inc.", "Automation Anywhere, Inc.", "Google LLC", "Tanium Inc.",
      "Mozilla Corporation", "Nmap Software LLC", "N-ABLE TECHNOLOGIES LTD", "Connectwise, LLC", "Datto, LLC", "Zabbix SIA", "d.velop AG",
      "ESET, spol. s r.o.", "NoMachine S.a.r.l.", "Check Point Software Technologies Ltd.", "Amazon.com Services LLC", "Ericom Software Ltd",
      "ZABBIX, Sabiedriba ar ierobezotu atbildibu", "Intuit Inc", "TYCHON, LLC", "Siber Systems", "Axeda Corporation", "Kaseya Holdings Inc.",
      "OpsRamp, Inc.", "Paessler GmbH", "Ecosia GmbH")) and
  process.thread.Ext.call_stack_final_user_module.name != "Kernel" and process.executable != 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.path like
                                              ("c:\\windows\\assembly\\nativeimages_*.ni.dll",
                                               "c:\\program files\\*", "c:\\program files (x86)\\*") and
  not process.thread.Ext.call_stack_final_user_module.name in ("Undetermined", "Unknown") and
  not process.executable :
                 ("C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe",
                  "C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe",
                  "C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe",
                  "C:\\Program Files (x86)\\N-able Technologies\\Windows Agent\\bin\\agent.exe",
                  "C:\\Program Files\\Tenable\\Nessus Agent\\nessus-agent-module.exe",
                  "C:\\Program Files\\Intuit\\QuickBooks Enterprise Solutions *\\CefSharp.BrowserSubprocess.exe",
                  "C:\\Program Files\\WindowsApps\\DuckDuckGo.DesktopBrowser_*\\WindowsBrowser\\WebView2\\msedgewebview2.exe",
                  "C:\\Windows\\LTSvc\\LTSVC.exe") and
  not (process.name : "powershell.exe" and
       process.parent.executable : ("C:\\Program Files\\Tychon\\TychonEngine.exe",
                                    "C:\\Program Files\\Windows Defender Advanced Threat Protection\\SenseIR.exe",
                                    "C:\\ProgramData\\Microsoft\\Windows Defender Advanced Threat Protection\\Platform\\*\\SenseIR.exe"))
  ]

Stage 2: authentication

[authentication where event.action == "log_on" and
  process.Ext.session_info.logon_type in ("RemoteInteractive", "Network") and cidrmatch(source.ip, "127.0.0.0/8", "::1")]

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.code_signature.subject_nameinAmazon.com Services LLC, Automation Anywhere, Inc., Axeda Corporation, Check Point Software Technologies Ltd., Connectwise, LLC, Datto, LLC, ESET, spol. s r.o., Ecosia GmbH, Ericom Software Ltd, Google LLC, Intuit Inc, Kaseya Holdings Inc., Mozilla Corporation, N-ABLE TECHNOLOGIES LTD, Nmap Software LLC, NoMachine S.a.r.l., OpsRamp, Inc., Paessler GmbH, Siber Systems, TYCHON, LLC, Tanium Inc., UiPath, Inc., ZABBIX, Sabiedriba ar ierobezotu atbildibu, Zabbix SIA, d.velop AGexcludes:process.code_signature.subject_name
process.code_signature.trustedeqtrueexcludes:process.code_signature.trusted field:"process.code_signature.trusted" value:"true"
process.nameeqpowershell.exeexcludes:process.name field:"process.name" value:"powershell.exe"
process.parent.executablewildcardC:\Program Files\Tychon\TychonEngine.exe, C:\Program Files\Windows Defender Advanced Threat Protection\SenseIR.exe, C:\ProgramData\Microsoft\Windows Defender Advanced Threat Protection\Platform\*\SenseIR.exeexcludes:process.parent.executable field:"process.parent.executable" value:"C:\Program Files\Tychon\TychonEngine.exe" field:"process.parent.executable" value:"C:\Program Files\Windows Defender Advanced Threat Protection\SenseIR.exe" field:"process.parent.executable" value:"C:\ProgramData\Microsoft\Windows Defender Advanced Threat Protection\Platform\*\SenseIR.exe"
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.executablewildcardC:\Program Files (x86)\Google\Chrome\Application\chrome.exe, C:\Program Files\Google\Chrome\Application\chrome.exe, C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe, C:\Program Files (x86)\N-able Technologies\Windows Agent\bin\agent.exe, C:\Program Files\Tenable\Nessus Agent\nessus-agent-module.exe, C:\Program Files\Intuit\QuickBooks Enterprise Solutions *\CefSharp.BrowserSubprocess.exe, C:\Program Files\WindowsApps\DuckDuckGo.DesktopBrowser_*\WindowsBrowser\WebView2\msedgewebview2.exe, C:\Windows\LTSvc\LTSVC.exeexcludes:process.executable
process.thread.Ext.call_stack_final_user_module.nameinUndetermined, Unknownexcludes:process.thread.Ext.call_stack_final_user_module.name field:"process.thread.Ext.call_stack_final_user_module.name" value:"Undetermined" field:"process.thread.Ext.call_stack_final_user_module.name" value:"Unknown"
process.thread.Ext.call_stack_final_user_module.pathwildcardc:\windows\assembly\nativeimages_*.ni.dll, c:\program files\*, c:\program files (x86)\*excludes:process.thread.Ext.call_stack_final_user_module.path field:"process.thread.Ext.call_stack_final_user_module.path" value:"c:\windows\assembly\nativeimages_*.ni.dll" field:"process.thread.Ext.call_stack_final_user_module.path" value:"c:\program files\*" field:"process.thread.Ext.call_stack_final_user_module.path" value:"c:\program files (x86)\*"

Ptrace Memory Write Followed by Register Modification

#
Time window
2s
Sequence by
process.Ext.ptrace.child_pid, process.entity_id
Source
github.com/elastic/protections-artifacts

This rule detects a process using ptrace to write to another process's memory before modifying the register state of the same target. This sequence is commonly used to place code in a remote process and redirect its execution, and may indicate process injection.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
This rule detects a process using ptrace to write to another process's memory before modifying the register state of the
same target. This sequence is commonly used to place code in a remote process and redirect its execution, and may
indicate process injection.
"""
id = "719490d3-a828-464f-b9e2-82b72b7fbd4b"
license = "Elastic License v2"
name = "Ptrace Memory Write Followed by Register Modification"
os_list = ["linux"]
reference = [
    "https://man7.org/linux/man-pages/man2/ptrace.2.html",
    "https://www.akamai.com/blog/security-research/the-definitive-guide-to-linux-process-injection",
]
version = "1.0.3"

query = '''
sequence by process.entity_id, process.Ext.ptrace.child_pid with maxspan=2s
  [process where event.type == "start" and event.action == "ptrace" and
   process.Ext.ptrace.request in (4, 5) and process.Ext.ptrace.addr > 4096 and
   process.executable != null and not process.executable like (
     "/opt/dynatrace/oneagent/agent/lib64/oneagenthelper", "/opt/scorec/toolworks/totalview.*/bin/tvdsvrmain_mrnet",
     "/usr/libexec/platform-python*", "/usr/libexec/gdb", "/home/*/.var/app/com.usebottles.bottles/data/bottles/runners/*/bin/wineserver",
     "/usr/imperva/ragent/bin/InjectionManager", "/usr/bin/reptyr"
   )]
  [process where event.type == "start" and event.action == "ptrace" and
   process.Ext.ptrace.request in (6, 13, 16901)]
'''

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

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

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

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

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



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

[internal]
min_endpoint_version = "9.1.4"

Stages and Predicates

Ordered sequence: each step below must occur in order within 2s, correlated by process.Ext.ptrace.child_pid, process.entity_id.

Stage 1: process

[process where event.type == "start" and event.action == "ptrace" and
   process.Ext.ptrace.request in (4, 5) and process.Ext.ptrace.addr > 4096 and
   process.executable != null and not process.executable like (
     "/opt/dynatrace/oneagent/agent/lib64/oneagenthelper", "/opt/scorec/toolworks/totalview.*/bin/tvdsvrmain_mrnet",
     "/usr/libexec/platform-python*", "/usr/libexec/gdb", "/home/*/.var/app/com.usebottles.bottles/data/bottles/runners/*/bin/wineserver",
     "/usr/imperva/ragent/bin/InjectionManager", "/usr/bin/reptyr"
   )]

Stage 2: process

[process where event.type == "start" and event.action == "ptrace" and
   process.Ext.ptrace.request in (6, 13, 16901)]

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • ptrace
field:"EventType" kind:eq value:"ptrace"
event.typeeq
  • start
field:"event.type" kind:eq value:"start"
process.Ext.ptrace.addrgt
  • 4096 transforms: number
field:"process.Ext.ptrace.addr" kind:gt value:"4096"
process.Ext.ptrace.requestin
  • 13 transforms: number
  • 16901 transforms: number
  • 4 transforms: number
  • 5 transforms: number
  • 6 transforms: number
field:"process.Ext.ptrace.request" kind:in
process.executableis_not_null
  • (no value, null check)
field:"Image" kind:is_not_null

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.executablewildcard/opt/dynatrace/oneagent/agent/lib64/oneagenthelper, /opt/scorec/toolworks/totalview.*/bin/tvdsvrmain_mrnet, /usr/libexec/platform-python*, /usr/libexec/gdb, /home/*/.var/app/com.usebottles.bottles/data/bottles/runners/*/bin/wineserver, /usr/imperva/ragent/bin/InjectionManager, /usr/bin/reptyrexcludes:process.executable

Shell Execution via Apple Scripting

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

Identifies the execution of the shell process (sh) via scripting (JXA or AppleScript). Adversaries may use the doShellScript functionality in JXA or do shell script in AppleScript to execute system commands.

MITRE ATT&CK Coverage

Telemetry Coverage

Rule Body

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

[rule]
author = ["Elastic"]
description = """
Identifies the execution of the shell process (sh) via scripting (JXA or AppleScript). Adversaries may use the
doShellScript functionality in JXA or do shell script in AppleScript to execute system commands.
"""
from = "now-9m"
index = ["logs-endpoint.events.process*"]
language = "eql"
license = "Elastic License v2"
name = "Shell Execution via Apple Scripting"
references = [
    "https://developer.apple.com/library/archive/technotes/tn2065/_index.html",
    "https://objectivebythesea.com/v2/talks/OBTS_v2_Thomas.pdf",
]
risk_score = 47
rule_id = "d461fac0-43e8-49e2-85ea-3a58fe120b4f"
setup = """## Setup

This rule requires data coming in from Elastic Defend.

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

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

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

query = '''
sequence by host.id with maxspan=10s
 [process where host.os.type == "macos" and event.type in ("start", "process_started") and event.action == "exec" and process.name == "osascript" and process.args == "-e"] by process.entity_id
 [process where host.os.type == "macos" and event.type in ("start", "process_started") and process.name in ("sh", "bash", "zsh") and process.args == "-c" and process.command_line : ("*curl*", "*pbpaste*", "*http*", "*chmod*", "*nscurl*")] by process.parent.entity_id
'''
note = """## Triage and analysis

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

### Investigating Shell Execution via Apple Scripting

AppleScript and JXA are scripting languages used in macOS to automate tasks and control applications. Adversaries exploit these by executing shell commands through functions like `doShellScript`, enabling unauthorized actions such as data exfiltration or system modification. The detection rule identifies suspicious shell processes initiated by AppleScript, focusing on specific command patterns and rapid sequence execution, indicating potential misuse.

### Possible investigation steps

- Review the alert details to identify the specific host.id and process.entity_id involved in the suspicious activity.
- Examine the process arguments for osascript to determine the exact AppleScript command executed, focusing on the presence of the "-e" flag which indicates script execution.
- Investigate the parent process of the shell (sh, bash, zsh) to understand the context in which the shell command was executed, using process.parent.entity_id for correlation.
- Analyze the shell command arguments, particularly looking for potentially malicious patterns such as "*curl*", "*pbcopy*", "*http*", or "*chmod*", which may indicate data exfiltration or system modification attempts.
- Check the sequence and timing of the processes to assess if the execution pattern aligns with typical user behavior or if it suggests automated or rapid execution indicative of a script.
- Correlate the findings with any other security alerts or logs from the same host to identify if this activity is part of a broader attack or isolated incident.
- If necessary, escalate the investigation by capturing additional forensic data from the affected host, such as network traffic or file system changes, to further understand the impact and scope of the activity.

### False positive analysis

- Routine administrative scripts may trigger the rule if they use AppleScript or JXA to automate tasks involving shell commands. To manage this, identify and whitelist these scripts by their specific command patterns or execution context.
- Software updates or legitimate application installations might execute shell commands through AppleScript, appearing suspicious. Monitor and document these activities, and create exceptions for known update processes.
- Development tools and environments that rely on scripting for building or testing applications can generate false positives. Exclude these processes by verifying their source and ensuring they align with expected development activities.
- User-initiated automation tasks, such as custom scripts for personal productivity, may be flagged. Educate users on safe scripting practices and establish a process for reviewing and approving such scripts to prevent unnecessary alerts.

### Response and remediation

- Immediately isolate the affected macOS host from the network to prevent further unauthorized access or data exfiltration.
- Terminate any suspicious shell processes identified by the detection rule, specifically those initiated by `osascript` executing shell commands.
- Conduct a thorough review of the affected system's logs and process history to identify any additional unauthorized activities or persistence mechanisms.
- Remove any unauthorized scripts or files that were executed or created as part of the malicious activity.
- Reset credentials and review permissions for any accounts that may have been compromised or used in the attack.
- Escalate the incident to the security operations team for further investigation and to determine if additional systems are affected.
- Implement enhanced monitoring and alerting for similar patterns of behavior, focusing on the use of `osascript` and shell command execution, to prevent recurrence."""


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

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

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

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

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

Stages and Predicates

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

Stage 1: process

[process where host.os.type == "macos" and event.type in ("start", "process_started") and event.action == "exec" and process.name == "osascript" and process.args == "-e"] by process.entity_id

Stage 2: process

[process where host.os.type == "macos" and event.type in ("start", "process_started") and process.name in ("sh", "bash", "zsh") and process.args == "-c" and process.command_line : ("*curl*", "*pbpaste*", "*http*", "*chmod*", "*nscurl*")] by process.parent.entity_id

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • exec corpus 547 (elastic 547)
field:"EventType" kind:eq value:"exec"
event.typein
  • process_started corpus 39 (elastic 39)
  • start corpus 40 (elastic 40)
field:"event.type" kind:in
process.argseq
  • -c corpus 91 (elastic 91)
  • -e corpus 42 (elastic 42)
field:"process.args" kind:eq
process.command_linewildcard
  • *chmod*
  • *curl* corpus 17 (sigma 14, elastic 2, splunk 1)
  • *http* corpus 45 (sigma 34, elastic 10, splunk 1)
  • *nscurl* corpus 2 (elastic 2)
  • *pbpaste*
field:"CommandLine" kind:wildcard
process.nameeq
  • osascript corpus 41 (elastic 41)
field:"process_basename" kind:eq value:"osascript"
process.namein
  • bash corpus 181 (elastic 181)
  • sh corpus 180 (elastic 180)
  • zsh corpus 180 (elastic 180)
field:"process_basename" kind:in

Suspicious Browser Child Process

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

Identifies the execution of a suspicious browser child process. Adversaries may gain access to a system through a user visiting a website over the normal course of browsing. With this technique, the user's web browser is typically targeted for exploitation.

MITRE ATT&CK Coverage

Rule Body

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

[rule]
author = ["Elastic"]
description = """
Identifies the execution of a suspicious browser child process. Adversaries may gain access to a system through a user
visiting a website over the normal course of browsing. With this technique, the user's web browser is typically targeted
for exploitation.
"""
from = "now-9m"
index = ["logs-endpoint.events.process*"]
language = "eql"
license = "Elastic License v2"
name = "Suspicious Browser Child Process"
references = [
    "https://objective-see.com/blog/blog_0x43.html",
    "https://fr.slideshare.net/codeblue_jp/cb19-recent-apt-attack-on-crypto-exchange-employees-by-heungsoo-kang",
]
risk_score = 73
rule_id = "080bc66a-5d56-4d1f-8071-817671716db9"
setup = """## Setup

This rule requires data coming in from Elastic Defend.

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

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

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

query = '''
process where host.os.type == "macos" and event.type in ("start", "process_started") and
  process.parent.name like~ ("Google Chrome", "Google Chrome Helper*", "firefox", "Opera", "Safari", "com.apple.WebKit.WebContent", "Microsoft Edge") and
  ((process.name like~ ("sh", "bash", "dash", "ksh", "tcsh", "zsh") and process.command_line : ("*curl*", "*nscurl*", "*wget*", "*whoami*", "*pwd*")) or
  process.name like~ ("curl", "wget", "python*", "perl*", "php*", "osascript", "pwsh")) and
  process.command_line != null
'''
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 Browser Child Process

Web browsers are integral to user interaction with the internet, often serving as gateways for adversaries to exploit vulnerabilities. Attackers may execute malicious scripts or commands by spawning child processes from browsers, leveraging scripting languages or command-line tools. The detection rule identifies unusual child processes initiated by browsers on macOS, filtering out known benign activities to highlight potential threats, thus aiding in early threat detection and response.

### Possible investigation steps

- Review the process command line to understand the context of the execution and identify any potentially malicious scripts or commands.
- Check the parent process name to confirm it is one of the specified browsers (e.g., Google Chrome, Safari) and verify if the browser was expected to be running at the time of the alert.
- Investigate the user account associated with the process to determine if the activity aligns with their typical behavior or if the account may have been compromised.
- Examine the network activity around the time of the alert to identify any suspicious connections or data transfers that may indicate further malicious activity.
- Look for any related alerts or logs that might provide additional context or evidence of a broader attack or compromise.
- Assess the risk and impact of the detected activity by considering the severity and risk score provided, and determine if immediate response actions are necessary.

### False positive analysis

- Legitimate software updates or installations may trigger the rule if they use shell scripts or command-line tools. Users can create exceptions for known update paths, such as those related to Microsoft AutoUpdate or Google Chrome installations, to prevent these from being flagged.
- Development or testing activities involving scripting languages like Python or shell scripts may be mistakenly identified as threats. Users should consider excluding specific development directories or command patterns that are frequently used in their workflows.
- Automated scripts or tools that interact with web browsers for legitimate purposes, such as web scraping or data collection, might be detected. Users can whitelist these processes by specifying their command-line arguments or paths to avoid false positives.
- System administration tasks that involve remote management or configuration changes via command-line tools could be misinterpreted as suspicious. Users should identify and exclude these routine administrative commands to reduce unnecessary alerts.
- Browser extensions or plugins that execute scripts for enhanced functionality might trigger the rule. Users should review and whitelist trusted extensions that are known to execute benign scripts.

### Response and remediation

- Immediately isolate the affected macOS system from the network to prevent further malicious activity or lateral movement by the adversary.
- Terminate the suspicious child process identified in the alert to halt any ongoing malicious execution.
- Conduct a thorough review of the browser's recent activity and history to identify any potentially malicious websites or downloads that may have triggered the alert.
- Remove any malicious files or scripts that were executed by the suspicious child process to prevent further exploitation.
- Apply the latest security patches and updates to the affected browser and macOS system to mitigate known vulnerabilities that could be exploited.
- Monitor the system for any signs of persistence mechanisms or additional suspicious activity, ensuring that no backdoors or unauthorized access points remain.
- Escalate the incident to the security operations team for further investigation and to determine if additional systems may be affected, ensuring a coordinated response."""


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

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

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

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

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

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

[[rule.threat.technique]]
id = "T1203"
name = "Exploitation for Client Execution"
reference = "https://attack.mitre.org/techniques/T1203/"

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

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

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

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

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

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

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

Stages and Predicates

Stage 1: process

process where host.os.type == "macos" and event.type in ("start", "process_started") and
  process.parent.name like~ ("Google Chrome", "Google Chrome Helper*", "firefox", "Opera", "Safari", "com.apple.WebKit.WebContent", "Microsoft Edge") and
  ((process.name like~ ("sh", "bash", "dash", "ksh", "tcsh", "zsh") and process.command_line : ("*curl*", "*nscurl*", "*wget*", "*whoami*", "*pwd*")) or
  process.name like~ ("curl", "wget", "python*", "perl*", "php*", "osascript", "pwsh")) and
  process.command_line != null

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.typein
  • process_started
  • start
field:"event.type" kind:in
process.command_lineis_not_null
  • (no value, null check)
field:"CommandLine" kind:is_not_null
process.command_linewildcard
  • *curl*
  • *nscurl*
  • *pwd*
  • *wget*
  • *whoami*
field:"CommandLine" kind:wildcard
process.namewildcard
  • bash
  • curl
  • dash
  • ksh
  • osascript
  • perl*
  • php*
  • pwsh
  • python*
  • sh
  • tcsh
  • wget
  • zsh
field:"process_basename" kind:wildcard
process.parent.namewildcard
  • Google Chrome
  • Google Chrome Helper*
  • Microsoft Edge
  • Opera
  • Safari
  • com.apple.WebKit.WebContent
  • firefox
field:"parent_process_basename" kind:wildcard

Suspicious Memory Page Protection

#
Source
github.com/elastic/protections-artifacts

Identifies memory regions unexpectedly marked as inaccessible. This may indicate an attempt to hide injected code from memory scanners.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
Identifies memory regions unexpectedly marked as inaccessible. This may indicate an attempt to hide injected code from
memory scanners.
"""
id = "f72e1e5b-acc3-42aa-9f75-88badc64401e"
license = "Elastic License v2"
name = "Suspicious Memory Page Protection"
os_list = ["windows"]
version = "1.0.10"

query = '''
api where
 process.Ext.api.name in ("VirtualProtect", "VirtualProtectEx") and
  (
   process.Ext.api.behaviors in ("hidden_code", "guarded_code") or
   (process.Ext.api.parameters.protection : "*GUARD*" and not process.Ext.api.parameters.protection_old : "*GUARD*") or
   (process.Ext.api.parameters.protection_old : "*GUARD*" and not process.Ext.api.parameters.protection : "*GUARD*") or
   (process.Ext.api.parameters.protection == "---")
   ) and
 _arraysearch(process.thread.Ext.call_stack_final_user_module.code_signature, $entry, $entry.trusted == false or $entry.exists == false) and
 not process.thread.Ext.call_stack_final_user_module.protection_provenance like ("Kernel", "Kernel|*", "Undetermined") and
 process.thread.Ext.call_stack_final_user_module.name != "Undetermined" and
 not _arraysearch(process.thread.Ext.call_stack_final_user_module.code_signature, $entry, $entry.trusted == true and
                  $entry.subject_name : ("Microsoft Windows Hardware Compatibility Publisher", "Microsoft Windows Software Compatibility Publisher")) and
 not process.thread.Ext.call_stack_final_user_module.path :
                                ("c:\\program files\\*", "c:\\program files (x86)\\*",
                                 "c:\\windows\\assembly\\nativeimages_*.dll",
                                 "c:\\windows\\system32\\spool\\drivers\\x64\\3\\*.dll") and
 not (process.Ext.api.parameters.size == 12288 and process.thread.Ext.call_stack_final_user_module.name == "jvm.dll") and
 not _arraysearch(process.thread.Ext.call_stack, $entry,
                  $entry.symbol_info: ("c:\\program files\\sentinelone\\sentinel agent*\\inprocessclient32.dll*",
                                       "c:\\program files (x86)\\common files\\intuit shared\\*\\bin\\client\\jvm.dll*")) and
 not (process.executable : ("C:\\Program Files (x86)\\*.exe", "C:\\Program Files\\*.exe") and
      process.thread.Ext.call_stack_final_user_module.path like "c:\\windows\\assembly\\nativeimages*dll") and
 not (process.thread.Ext.call_stack_final_user_module.protection_provenance == "chrome_elf.dll" and process.thread.Ext.call_stack_final_user_module.name == "ntdll.dll") and
 not process.thread.Ext.call_stack_final_user_module.hash.sha256 in
                                         ("b0968a364408aad11a33343cb9fdf66b994dbd251cc64237f8894d66efe96f19",
                                          "20fd2dc66d81acd93b7e8637a05068fd200b09c9c1b62c7929d6abf1e8c17947",
                                          "01b97babae60d36afe65aca64e003eecf541eaea4c5e14eba9638706975f70b7",
                                          "22ea1a2a7027e8abd2bf9abd86090f8e516313f75863ce77aec51f60aebb12ff",
                                          "e7efa5fe27806ba4250af12ff5ca062cff53b417299068a280ca6a3edd3fc07f",
                                          "d32b9f057abc3dda988d443cf9866d70a3e986a57f2c6f82379e45b8b900128b",
                                          "8bc3607f8b8a57d713e858b7184cdfed945cfb1a9da156c34530042697e96f9f",
                                          "ae6cf7164d0fe4a67a9fe5eb63199644221507f3137d1e74334675c2a218f1f2",
                                          "e6d0513d318659ffef650adc7bc0d7b281096b072c111d1c65cf9db956abdc29",
                                          "1240b0ea281791197e1b666222598ce64d04f4a34069703e13ff4ee16b6b20ae",
                                          "c545668ecbd33a0362e594980a1a59b64bffce663c177750b457125b9e4ecfe8",
                                          "5b0c9fe8d89b25f44c4d99bd8b51923d7a9f0c581a2ca3e338179a3e52693fca",
                                          "8de3be9033f632fa0419df7ac908314c8c4988481c655559a9e0ac326fffd36e",
                                          "246d64c447d819520b2834e40cf08a91e959999382827fd915a2a03a47c7d7b1",
                                          "d5dc7e48951b2e48a3495d859310c2918a9ce1cbb3eff6115d41fd5073f6a991",
                                          "d35f27257c523399b7c9a7a4557ac3827cbb7179c807887b8c9a66f4955e5a14",
                                          "f404ec5734f17b776e2b97ae248505dade6a3e9502d173a64a301d0060abc47d",
                                          "9cefa5d9c48c558ae54ac6c7450c944d3bdc0dacf2a09152a93e6aa780c5ee34",
                                          "83d7eb6ec24f4639c3fdb34049bdf6208b7de1eb0155e05766b4bee40ef6fec9",
                                          "886748c092683079296cc7f334994698899ff04f5a344ba021d6443cef13a3ff",
                                          "bbff088a88a0a754dc9d312e52ef7e60dd93537d78d73f79c89aa5b5091457fc",
                                          "25d49934fc220b169cadeb21fc99dc2a8fb1dd5a4f244265799392f0f5f2f8f8",
                                          "aad7e7ac9d74ac18892801950c9728e9c4eacd3b676cbb5d6f63382da2ce0559",
                                          "7a94bc02118f56e337709f1e71f730ebe1245e8c641027326e30db213169abe7",
                                          "a32c3fbbf74699a10e7642bf4901191f29c88c5aec93ae7ba28c79ab28462a69", 
                                          "b57b7886ba87c5e65e37dbac6cf2711ddfa47581e545eee9cd6757e4ffa81101", 
                                          "0f2e933d5af1f775aba02e4d0ca52fca9bbfa6b2b2b06f2bd2b8a09282a32a52",
                                          "621cd08540f41ec7313533c9e516115244bac3f8d42aa9f08295cae1551e5fe1", 
                                          "a6972aac814d4344b84f1461092ead49e315ae6cbabadd9a60dddb4f397ff723",
                                          "c30b2b5f344a2f84ba0cb1d63f51888794d0b0c2bd74afe2aca4cbc73be47c61", 
                                          "5254b706b4d8d73f3a5343890bea83b7172a8d4fb3e65df0530934f9c68eab7a", 
                                          "2c26e3994367eaad1156ca137e99e229fffac3ec7203373ca3c11bb5e9aee052", 
                                          "c8f242570144ac4ba77967a1dc59d6681ca2d8a6a85c4db2a30e1e4629db843a",
                                          "7090edd64e7f0cbfa7bdcc6f48cdae692e94a04c7b8121a1bd96f15f24374830",
                                          "f572e4057d7504a04dabc6fcf154e12c79af313e32f63105ae9874d97d5d3593",
                                          "709e4e2af91135b8ed78c551de0bff2f161e498341ec2ae7b89a7d9898c4e93b",
                                          "71587b6b0b06301ac1a4037955a2ba6729a3d40103f1bc625d4ab62aef13ebb5",
                                          "ea71387e40682bcc23f676df2b856dca15853aeb854b94168c85bc0479ef1aed",
                                          "c953034220bda1e5751c4ebd61c4951224db6919394b0bf7901d66cd5ec99c27",
                                          "3c3c62d2118b3029c27c60c8995f50b90b5329a24bb6dd9ccc9b8f83e9f3446c",
                                          "2f3361f43762299182a183372fa446bffa756d98d219935aee780018368067ba",
                                          "17ca0c6b2c3539f8e8af8ab166419d0602397270f43f370d93d9b99bf9751790",
                                          "8bd2eda8551d7198ebc8a70573e31c06e5fe56054e869d357d88f33c5b90d0f3",
                                          "e958d03db79e9f1d2770c70a5bc24904aa3e2d27a8d5637684cf8166b38908f2",
                                          "8094af5ee310714caebccaeee7769ffb08048503ba478b879edfef5f1a24fefe",
                                          "a68bd14e096ad75ed540a9ce0d60e2033fdfa44de415d2dc3febb50ef8d21311",
                                          "dc5f61ebae311c3f99a335f36acd4d96bd4b60e56b9825555561898509f72925",
                                          "8094af5ee310714caebccaeee7769ffb08048503ba478b879edfef5f1a24fefe",
                                          "e3886ed0bc0261ac34b088a0905779b86106ae54aa10cd2271c24ad3eed3ea8e",
                                          "a6407bb570e7243afe3fe8bd6d35676fa4140aeb9e3208c06e1652343aea67ff",
                                          "b3034b1b920bd44f589a1957dbc90ad96f82b0a15774ab4d7d102099b7b10272",
                                          "7570ed9a44a6e251fe24697d62df9dfcadad2b10ba6803818a928f9247822721",
                                          "37ba4ae6d60d08de22b6b0fe1f24de264cd781ca80bfcdae14c661c36d8a5d57",
                                          "1eb27475909563236c3c87e5138da5406a1a8cb611229e73d0ae275f784e75e3",
                                          "4706af5ee53476bc4701b81aff0f5f655aea433f1de39365bef271b24a29cd85",
                                          "54a8497dda5a1e9b60e724292672465bbfbbf5828012f301ec63bd723f2a4c99",
                                          "a65f0144101d93656c5f9ad445b3993336e1f295a838351aeca6332c0949b463",
                                          "11daac36176d514ae3a85dd578a2425850df61af4ad7ccad66e4a20297a18dd7",
                                          "db351dcd1d0317fee8a03d49c21a1bb89c4044a9c8a72a8bbf410d82c05ef990",
                                          "c2887bb114336c7a80004136d0703063fde440367319631695a5ef757a165911",
                                          "88f810995dc3dd58a8a3f36a2c780e899d8114a03a6945ddd5b94a85b43b8d1a",
                                          "e8bc4d680c47c09a5f5a0b774f43eda7cd3ad0574240578a97d5ad117899953b",
                                          "19c8c989b43446df7fc1997e0bb78e8dc729c38bd4f9b52521517c88396b5410",
                                          "fb703a94c37289dba2ebbb73391f158935823d7a96decc2d38c788c899fa4c27")
'''

min_endpoint_version = "8.10.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 = "T1564"
name = "Hide Artifacts"
reference = "https://attack.mitre.org/techniques/T1564/"

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


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

[internal]
min_endpoint_version = "8.10.0"

Stages and Predicates

Stage 1: api

api where
 process.Ext.api.name in ("VirtualProtect", "VirtualProtectEx") and
  (
   process.Ext.api.behaviors in ("hidden_code", "guarded_code") or
   (process.Ext.api.parameters.protection : "*GUARD*" and not process.Ext.api.parameters.protection_old : "*GUARD*") or
   (process.Ext.api.parameters.protection_old : "*GUARD*" and not process.Ext.api.parameters.protection : "*GUARD*") or
   (process.Ext.api.parameters.protection == "---")
   ) and
 _arraysearch(process.thread.Ext.call_stack_final_user_module.code_signature, $entry, $entry.trusted == false or $entry.exists == false) and
 not process.thread.Ext.call_stack_final_user_module.protection_provenance like ("Kernel", "Kernel|*", "Undetermined") and
 process.thread.Ext.call_stack_final_user_module.name != "Undetermined" and
 not _arraysearch(process.thread.Ext.call_stack_final_user_module.code_signature, $entry, $entry.trusted == true and
                  $entry.subject_name : ("Microsoft Windows Hardware Compatibility Publisher", "Microsoft Windows Software Compatibility Publisher")) and
 not process.thread.Ext.call_stack_final_user_module.path :
                                ("c:\\program files\\*", "c:\\program files (x86)\\*",
                                 "c:\\windows\\assembly\\nativeimages_*.dll",
                                 "c:\\windows\\system32\\spool\\drivers\\x64\\3\\*.dll") and
 not (process.Ext.api.parameters.size == 12288 and process.thread.Ext.call_stack_final_user_module.name == "jvm.dll") and
 not _arraysearch(process.thread.Ext.call_stack, $entry,
                  $entry.symbol_info: ("c:\\program files\\sentinelone\\sentinel agent*\\inprocessclient32.dll*",
                                       "c:\\program files (x86)\\common files\\intuit shared\\*\\bin\\client\\jvm.dll*")) and
 not (process.executable : ("C:\\Program Files (x86)\\*.exe", "C:\\Program Files\\*.exe") and
      process.thread.Ext.call_stack_final_user_module.path like "c:\\windows\\assembly\\nativeimages*dll") and
 not (process.thread.Ext.call_stack_final_user_module.protection_provenance == "chrome_elf.dll" and process.thread.Ext.call_stack_final_user_module.name == "ntdll.dll") and
 not process.thread.Ext.call_stack_final_user_module.hash.sha256 in
                                         ("b0968a364408aad11a33343cb9fdf66b994dbd251cc64237f8894d66efe96f19",
                                          "20fd2dc66d81acd93b7e8637a05068fd200b09c9c1b62c7929d6abf1e8c17947",
                                          "01b97babae60d36afe65aca64e003eecf541eaea4c5e14eba9638706975f70b7",
                                          "22ea1a2a7027e8abd2bf9abd86090f8e516313f75863ce77aec51f60aebb12ff",
                                          "e7efa5fe27806ba4250af12ff5ca062cff53b417299068a280ca6a3edd3fc07f",
                                          "d32b9f057abc3dda988d443cf9866d70a3e986a57f2c6f82379e45b8b900128b",
                                          "8bc3607f8b8a57d713e858b7184cdfed945cfb1a9da156c34530042697e96f9f",
                                          "ae6cf7164d0fe4a67a9fe5eb63199644221507f3137d1e74334675c2a218f1f2",
                                          "e6d0513d318659ffef650adc7bc0d7b281096b072c111d1c65cf9db956abdc29",
                                          "1240b0ea281791197e1b666222598ce64d04f4a34069703e13ff4ee16b6b20ae",
                                          "c545668ecbd33a0362e594980a1a59b64bffce663c177750b457125b9e4ecfe8",
                                          "5b0c9fe8d89b25f44c4d99bd8b51923d7a9f0c581a2ca3e338179a3e52693fca",
                                          "8de3be9033f632fa0419df7ac908314c8c4988481c655559a9e0ac326fffd36e",
                                          "246d64c447d819520b2834e40cf08a91e959999382827fd915a2a03a47c7d7b1",
                                          "d5dc7e48951b2e48a3495d859310c2918a9ce1cbb3eff6115d41fd5073f6a991",
                                          "d35f27257c523399b7c9a7a4557ac3827cbb7179c807887b8c9a66f4955e5a14",
                                          "f404ec5734f17b776e2b97ae248505dade6a3e9502d173a64a301d0060abc47d",
                                          "9cefa5d9c48c558ae54ac6c7450c944d3bdc0dacf2a09152a93e6aa780c5ee34",
                                          "83d7eb6ec24f4639c3fdb34049bdf6208b7de1eb0155e05766b4bee40ef6fec9",
                                          "886748c092683079296cc7f334994698899ff04f5a344ba021d6443cef13a3ff",
                                          "bbff088a88a0a754dc9d312e52ef7e60dd93537d78d73f79c89aa5b5091457fc",
                                          "25d49934fc220b169cadeb21fc99dc2a8fb1dd5a4f244265799392f0f5f2f8f8",
                                          "aad7e7ac9d74ac18892801950c9728e9c4eacd3b676cbb5d6f63382da2ce0559",
                                          "7a94bc02118f56e337709f1e71f730ebe1245e8c641027326e30db213169abe7",
                                          "a32c3fbbf74699a10e7642bf4901191f29c88c5aec93ae7ba28c79ab28462a69", 
                                          "b57b7886ba87c5e65e37dbac6cf2711ddfa47581e545eee9cd6757e4ffa81101", 
                                          "0f2e933d5af1f775aba02e4d0ca52fca9bbfa6b2b2b06f2bd2b8a09282a32a52",
                                          "621cd08540f41ec7313533c9e516115244bac3f8d42aa9f08295cae1551e5fe1", 
                                          "a6972aac814d4344b84f1461092ead49e315ae6cbabadd9a60dddb4f397ff723",
                                          "c30b2b5f344a2f84ba0cb1d63f51888794d0b0c2bd74afe2aca4cbc73be47c61", 
                                          "5254b706b4d8d73f3a5343890bea83b7172a8d4fb3e65df0530934f9c68eab7a", 
                                          "2c26e3994367eaad1156ca137e99e229fffac3ec7203373ca3c11bb5e9aee052", 
                                          "c8f242570144ac4ba77967a1dc59d6681ca2d8a6a85c4db2a30e1e4629db843a",
                                          "7090edd64e7f0cbfa7bdcc6f48cdae692e94a04c7b8121a1bd96f15f24374830",
                                          "f572e4057d7504a04dabc6fcf154e12c79af313e32f63105ae9874d97d5d3593",
                                          "709e4e2af91135b8ed78c551de0bff2f161e498341ec2ae7b89a7d9898c4e93b",
                                          "71587b6b0b06301ac1a4037955a2ba6729a3d40103f1bc625d4ab62aef13ebb5",
                                          "ea71387e40682bcc23f676df2b856dca15853aeb854b94168c85bc0479ef1aed",
                                          "c953034220bda1e5751c4ebd61c4951224db6919394b0bf7901d66cd5ec99c27",
                                          "3c3c62d2118b3029c27c60c8995f50b90b5329a24bb6dd9ccc9b8f83e9f3446c",
                                          "2f3361f43762299182a183372fa446bffa756d98d219935aee780018368067ba",
                                          "17ca0c6b2c3539f8e8af8ab166419d0602397270f43f370d93d9b99bf9751790",
                                          "8bd2eda8551d7198ebc8a70573e31c06e5fe56054e869d357d88f33c5b90d0f3",
                                          "e958d03db79e9f1d2770c70a5bc24904aa3e2d27a8d5637684cf8166b38908f2",
                                          "8094af5ee310714caebccaeee7769ffb08048503ba478b879edfef5f1a24fefe",
                                          "a68bd14e096ad75ed540a9ce0d60e2033fdfa44de415d2dc3febb50ef8d21311",
                                          "dc5f61ebae311c3f99a335f36acd4d96bd4b60e56b9825555561898509f72925",
                                          "8094af5ee310714caebccaeee7769ffb08048503ba478b879edfef5f1a24fefe",
                                          "e3886ed0bc0261ac34b088a0905779b86106ae54aa10cd2271c24ad3eed3ea8e",
                                          "a6407bb570e7243afe3fe8bd6d35676fa4140aeb9e3208c06e1652343aea67ff",
                                          "b3034b1b920bd44f589a1957dbc90ad96f82b0a15774ab4d7d102099b7b10272",
                                          "7570ed9a44a6e251fe24697d62df9dfcadad2b10ba6803818a928f9247822721",
                                          "37ba4ae6d60d08de22b6b0fe1f24de264cd781ca80bfcdae14c661c36d8a5d57",
                                          "1eb27475909563236c3c87e5138da5406a1a8cb611229e73d0ae275f784e75e3",
                                          "4706af5ee53476bc4701b81aff0f5f655aea433f1de39365bef271b24a29cd85",
                                          "54a8497dda5a1e9b60e724292672465bbfbbf5828012f301ec63bd723f2a4c99",
                                          "a65f0144101d93656c5f9ad445b3993336e1f295a838351aeca6332c0949b463",
                                          "11daac36176d514ae3a85dd578a2425850df61af4ad7ccad66e4a20297a18dd7",
                                          "db351dcd1d0317fee8a03d49c21a1bb89c4044a9c8a72a8bbf410d82c05ef990",
                                          "c2887bb114336c7a80004136d0703063fde440367319631695a5ef757a165911",
                                          "88f810995dc3dd58a8a3f36a2c780e899d8114a03a6945ddd5b94a85b43b8d1a",
                                          "e8bc4d680c47c09a5f5a0b774f43eda7cd3ad0574240578a97d5ad117899953b",
                                          "19c8c989b43446df7fc1997e0bb78e8dc729c38bd4f9b52521517c88396b5410",
                                          "fb703a94c37289dba2ebbb73391f158935823d7a96decc2d38c788c899fa4c27")

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.thread.Ext.call_stack_final_user_module.code_signaturearray_any(no value, null check)excludes:process.thread.Ext.call_stack_final_user_module.code_signature
process.Ext.api.parameters.sizeeq12288excludes:process.Ext.api.parameters.size field:"process.Ext.api.parameters.size" value:"12288"
process.thread.Ext.call_stack_final_user_module.nameeqjvm.dllexcludes:process.thread.Ext.call_stack_final_user_module.name field:"process.thread.Ext.call_stack_final_user_module.name" value:"jvm.dll"
process.executablewildcardC:\Program Files (x86)\*.exe, C:\Program Files\*.exeexcludes:process.executable field:"process.executable" value:"C:\Program Files (x86)\*.exe" field:"process.executable" value:"C:\Program Files\*.exe"
process.thread.Ext.call_stack_final_user_module.pathwildcardc:\windows\assembly\nativeimages*dllexcludes:process.thread.Ext.call_stack_final_user_module.path field:"process.thread.Ext.call_stack_final_user_module.path" value:"c:\windows\assembly\nativeimages*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.nameeqntdll.dllexcludes:process.thread.Ext.call_stack_final_user_module.name field:"process.thread.Ext.call_stack_final_user_module.name" value:"ntdll.dll"
process.thread.Ext.call_stack_final_user_module.protection_provenanceeqchrome_elf.dllexcludes:process.thread.Ext.call_stack_final_user_module.protection_provenance field:"process.thread.Ext.call_stack_final_user_module.protection_provenance" value:"chrome_elf.dll"
process.thread.Ext.call_stack_final_user_module.hash.sha256in01b97babae60d36afe65aca64e003eecf541eaea4c5e14eba9638706975f70b7, 0f2e933d5af1f775aba02e4d0ca52fca9bbfa6b2b2b06f2bd2b8a09282a32a52, 11daac36176d514ae3a85dd578a2425850df61af4ad7ccad66e4a20297a18dd7, 1240b0ea281791197e1b666222598ce64d04f4a34069703e13ff4ee16b6b20ae, 17ca0c6b2c3539f8e8af8ab166419d0602397270f43f370d93d9b99bf9751790, 19c8c989b43446df7fc1997e0bb78e8dc729c38bd4f9b52521517c88396b5410, 1eb27475909563236c3c87e5138da5406a1a8cb611229e73d0ae275f784e75e3, 20fd2dc66d81acd93b7e8637a05068fd200b09c9c1b62c7929d6abf1e8c17947, 22ea1a2a7027e8abd2bf9abd86090f8e516313f75863ce77aec51f60aebb12ff, 246d64c447d819520b2834e40cf08a91e959999382827fd915a2a03a47c7d7b1, 25d49934fc220b169cadeb21fc99dc2a8fb1dd5a4f244265799392f0f5f2f8f8, 2c26e3994367eaad1156ca137e99e229fffac3ec7203373ca3c11bb5e9aee052, 2f3361f43762299182a183372fa446bffa756d98d219935aee780018368067ba, 37ba4ae6d60d08de22b6b0fe1f24de264cd781ca80bfcdae14c661c36d8a5d57, 3c3c62d2118b3029c27c60c8995f50b90b5329a24bb6dd9ccc9b8f83e9f3446c, 4706af5ee53476bc4701b81aff0f5f655aea433f1de39365bef271b24a29cd85, 5254b706b4d8d73f3a5343890bea83b7172a8d4fb3e65df0530934f9c68eab7a, 54a8497dda5a1e9b60e724292672465bbfbbf5828012f301ec63bd723f2a4c99, 5b0c9fe8d89b25f44c4d99bd8b51923d7a9f0c581a2ca3e338179a3e52693fca, 621cd08540f41ec7313533c9e516115244bac3f8d42aa9f08295cae1551e5fe1, 7090edd64e7f0cbfa7bdcc6f48cdae692e94a04c7b8121a1bd96f15f24374830, 709e4e2af91135b8ed78c551de0bff2f161e498341ec2ae7b89a7d9898c4e93b, 71587b6b0b06301ac1a4037955a2ba6729a3d40103f1bc625d4ab62aef13ebb5, 7570ed9a44a6e251fe24697d62df9dfcadad2b10ba6803818a928f9247822721, 7a94bc02118f56e337709f1e71f730ebe1245e8c641027326e30db213169abe7, 8094af5ee310714caebccaeee7769ffb08048503ba478b879edfef5f1a24fefe, 83d7eb6ec24f4639c3fdb34049bdf6208b7de1eb0155e05766b4bee40ef6fec9, 886748c092683079296cc7f334994698899ff04f5a344ba021d6443cef13a3ff, 88f810995dc3dd58a8a3f36a2c780e899d8114a03a6945ddd5b94a85b43b8d1a, 8bc3607f8b8a57d713e858b7184cdfed945cfb1a9da156c34530042697e96f9f, 8bd2eda8551d7198ebc8a70573e31c06e5fe56054e869d357d88f33c5b90d0f3, 8de3be9033f632fa0419df7ac908314c8c4988481c655559a9e0ac326fffd36e, 9cefa5d9c48c558ae54ac6c7450c944d3bdc0dacf2a09152a93e6aa780c5ee34, a32c3fbbf74699a10e7642bf4901191f29c88c5aec93ae7ba28c79ab28462a69, a6407bb570e7243afe3fe8bd6d35676fa4140aeb9e3208c06e1652343aea67ff, a65f0144101d93656c5f9ad445b3993336e1f295a838351aeca6332c0949b463, a68bd14e096ad75ed540a9ce0d60e2033fdfa44de415d2dc3febb50ef8d21311, a6972aac814d4344b84f1461092ead49e315ae6cbabadd9a60dddb4f397ff723, aad7e7ac9d74ac18892801950c9728e9c4eacd3b676cbb5d6f63382da2ce0559, ae6cf7164d0fe4a67a9fe5eb63199644221507f3137d1e74334675c2a218f1f2, b0968a364408aad11a33343cb9fdf66b994dbd251cc64237f8894d66efe96f19, b3034b1b920bd44f589a1957dbc90ad96f82b0a15774ab4d7d102099b7b10272, b57b7886ba87c5e65e37dbac6cf2711ddfa47581e545eee9cd6757e4ffa81101, bbff088a88a0a754dc9d312e52ef7e60dd93537d78d73f79c89aa5b5091457fc, c2887bb114336c7a80004136d0703063fde440367319631695a5ef757a165911, c30b2b5f344a2f84ba0cb1d63f51888794d0b0c2bd74afe2aca4cbc73be47c61, c545668ecbd33a0362e594980a1a59b64bffce663c177750b457125b9e4ecfe8, c8f242570144ac4ba77967a1dc59d6681ca2d8a6a85c4db2a30e1e4629db843a, c953034220bda1e5751c4ebd61c4951224db6919394b0bf7901d66cd5ec99c27, d32b9f057abc3dda988d443cf9866d70a3e986a57f2c6f82379e45b8b900128b, d35f27257c523399b7c9a7a4557ac3827cbb7179c807887b8c9a66f4955e5a14, d5dc7e48951b2e48a3495d859310c2918a9ce1cbb3eff6115d41fd5073f6a991, db351dcd1d0317fee8a03d49c21a1bb89c4044a9c8a72a8bbf410d82c05ef990, dc5f61ebae311c3f99a335f36acd4d96bd4b60e56b9825555561898509f72925, e3886ed0bc0261ac34b088a0905779b86106ae54aa10cd2271c24ad3eed3ea8e, e6d0513d318659ffef650adc7bc0d7b281096b072c111d1c65cf9db956abdc29, e7efa5fe27806ba4250af12ff5ca062cff53b417299068a280ca6a3edd3fc07f, e8bc4d680c47c09a5f5a0b774f43eda7cd3ad0574240578a97d5ad117899953b, e958d03db79e9f1d2770c70a5bc24904aa3e2d27a8d5637684cf8166b38908f2, ea71387e40682bcc23f676df2b856dca15853aeb854b94168c85bc0479ef1aed, f404ec5734f17b776e2b97ae248505dade6a3e9502d173a64a301d0060abc47d, f572e4057d7504a04dabc6fcf154e12c79af313e32f63105ae9874d97d5d3593, fb703a94c37289dba2ebbb73391f158935823d7a96decc2d38c788c899fa4c27excludes:process.thread.Ext.call_stack_final_user_module.hash.sha256
process.thread.Ext.call_stack_final_user_module.pathwildcardc:\program files\*, c:\program files (x86)\*, c:\windows\assembly\nativeimages_*.dll, c:\windows\system32\spool\drivers\x64\3\*.dllexcludes:process.thread.Ext.call_stack_final_user_module.path
process.thread.Ext.call_stack_final_user_module.protection_provenancewildcardKernel, Kernel|*, Undeterminedexcludes:process.thread.Ext.call_stack_final_user_module.protection_provenance field:"process.thread.Ext.call_stack_final_user_module.protection_provenance" value:"Kernel" field:"process.thread.Ext.call_stack_final_user_module.protection_provenance" value:"Kernel|*" field:"process.thread.Ext.call_stack_final_user_module.protection_provenance" value:"Undetermined"

Suspicious Windows Defender Exclusions Added via PowerShell

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

Identifies modifications to the Windows Defender configuration settings using PowerShell to add exclusions at the folder directory or process level.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
Identifies modifications to the Windows Defender configuration settings using PowerShell to add exclusions at the folder
directory or process level.
"""
id = "2ad8b514-baf0-4e29-a712-d6734868aa57"
license = "Elastic License v2"
name = "Suspicious Windows Defender Exclusions Added via PowerShell"
os_list = ["windows"]
reference = [
    "https://docs.microsoft.com/en-us/powershell/module/defender/add-mppreference?view=windowsserver2019-ps",
]
version = "1.0.29"

query = '''
sequence with maxspan=1m
  [process where event.action == "start" and
   not process.Ext.token.integrity_level_name == "system" and
   (
    (process.code_signature.trusted != true) or
    (process.executable : ("?:\\Windows\\Microsoft.NET\\*",
                           "?:\\Users\\Public\\*",
                           "?:\\Users\\*\\AppData\\Local\\Temp\\*",
                           "?:\\Users\\*\\AppData\\Roaming\\*",
                           "?:\\Users\\*\\Pictures\\*",
                           "?:\\Users\\*\\Documents\\*",
                           "?:\\Windows\\Resources\\Themes\\*",
                           "?:\\ProgramData\\*") and not process.executable : "?:\\ProgramData\\*\\*") or
    (process.name : ("rundll32.exe", "regsvr32.exe", "WScript.exe")) or
    descendant of [process where event.action == "start" and process.name : "msiexec.exe"]
    )] by process.entity_id
  [process where event.action == "start" and
   process.name : ("cmd.exe", "powershell.exe") and
   process.command_line : ("*Add-MpPreference*", "*Set-MpPreference*") and
   process.command_line: ("*-ExclusionPath*", "*-DisableRealtimeMonitoring*", "*-DisableScriptScanning*", "*-DisableArchiveScanning*")] by process.parent.entity_id
'''

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

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

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

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "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.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
[[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 = "7.15.0"

Stages and Predicates

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

Stage 1: process

[process where event.action == "start" and
   not process.Ext.token.integrity_level_name == "system" and
   (
    (process.code_signature.trusted != true) or
    (process.executable : ("?:\\Windows\\Microsoft.NET\\*",
                           "?:\\Users\\Public\\*",
                           "?:\\Users\\*\\AppData\\Local\\Temp\\*",
                           "?:\\Users\\*\\AppData\\Roaming\\*",
                           "?:\\Users\\*\\Pictures\\*",
                           "?:\\Users\\*\\Documents\\*",
                           "?:\\Windows\\Resources\\Themes\\*",
                           "?:\\ProgramData\\*") and not process.executable : "?:\\ProgramData\\*\\*") or
    (process.name : ("rundll32.exe", "regsvr32.exe", "WScript.exe")) or
    descendant of [process where event.action == "start" and process.name : "msiexec.exe"]
    )] by process.entity_id

Stage 2: process

[process where event.action == "start" and
   process.name : ("cmd.exe", "powershell.exe") and
   process.command_line : ("*Add-MpPreference*", "*Set-MpPreference*") and
   process.command_line: ("*-ExclusionPath*", "*-DisableRealtimeMonitoring*", "*-DisableScriptScanning*", "*-DisableArchiveScanning*")] by process.parent.entity_id

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • start corpus 388 (elastic 388)
field:"EventType" kind:eq value:"start"
process.code_signature.trustedne
  • true transforms: boolean corpus 8 (elastic 8)
field:"process.code_signature.trusted" kind:ne value:"true"
process.command_linewildcard
  • *-DisableArchiveScanning*
  • *-DisableRealtimeMonitoring*
  • *-DisableScriptScanning*
  • *-ExclusionPath*
  • *Add-MpPreference* corpus 3 (sigma 2, elastic 1)
  • *Set-MpPreference* corpus 6 (sigma 3, splunk 2, elastic 1)
field:"CommandLine" kind:wildcard
process.executablewildcard
  • ?:\ProgramData\* corpus 18 (elastic 18)
  • ?:\Users\*\AppData\Local\Temp\*
  • ?:\Users\*\AppData\Roaming\* corpus 5 (elastic 5)
  • ?:\Users\*\Documents\* corpus 2 (elastic 2)
  • ?:\Users\*\Pictures\* corpus 2 (elastic 2)
  • ?:\Users\Public\* corpus 22 (elastic 22)
  • ?:\Windows\Microsoft.NET\* corpus 11 (elastic 11)
  • ?:\Windows\Resources\Themes\*
field:"Image" kind:wildcard
process.namewildcard
  • WScript.exe corpus 84 (elastic 82, splunk 1, kusto 1)
  • cmd.exe corpus 122 (elastic 93, splunk 29)
  • powershell.exe corpus 187 (elastic 140, splunk 44, kusto 3)
  • regsvr32.exe corpus 74 (elastic 69, splunk 5)
  • rundll32.exe corpus 123 (elastic 100, splunk 23)
field:"process_basename" kind:wildcard

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.Ext.token.integrity_level_nameeqsystemexcludes:process.Ext.token.integrity_level_name field:"process.Ext.token.integrity_level_name" value:"system"

Unusual Pkexec Execution

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

This rule detects the execution of the pkexec command by a shell process. The pkexec command is used to execute programs as another user, typically as the superuser. Through the new_terms rule type, unusual executions of pkexec are identified, and may indicate an attempt to escalate privileges or perform unauthorized actions on the system.

MITRE ATT&CK Coverage

Rule Body

[metadata]
creation_date = "2025/01/16"
integration = ["endpoint", "sentinel_one_cloud_funnel"]
maturity = "production"
updated_date = "2026/03/24"

[rule]
author = ["Elastic"]
description = """
This rule detects the execution of the `pkexec` command by a shell process. The `pkexec` command is used to execute
programs as another user, typically as the superuser. Through the `new_terms` rule type, unusual executions of `pkexec`
are identified, and may indicate an attempt to escalate privileges or perform unauthorized actions on the system.
"""
from = "now-9m"
index = [
    "logs-endpoint.events.process*",
    "endgame-*",
    "logs-sentinel_one_cloud_funnel.*",
]
language = "kuery"
license = "Elastic License v2"
name = "Unusual Pkexec Execution"
note = """## Triage and analysis

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

### Investigating Unusual Pkexec Execution

`Pkexec` is a command-line utility in Linux environments that allows users to execute commands as another user, often with elevated privileges. Adversaries may exploit `pkexec` to escalate privileges or execute unauthorized actions by invoking it through shell processes. The detection rule identifies atypical `pkexec` executions initiated by common shell interpreters, flagging potential misuse by monitoring specific process attributes and execution patterns.

### Possible investigation steps

- Review the process tree to understand the context of the pkexec execution, focusing on the parent process names such as bash, dash, sh, tcsh, csh, zsh, ksh, or fish, as these are indicative of shell-based invocations.
- Examine the command-line arguments passed to pkexec to determine the intended action and assess whether it aligns with expected administrative tasks or appears suspicious.
- Check the user account associated with the pkexec execution to verify if the account has legitimate reasons to perform such actions, and investigate any anomalies in user behavior or account activity.
- Investigate the timing and frequency of the pkexec executions to identify patterns or correlations with other suspicious activities or known attack timelines.
- Cross-reference the alert with other security logs and alerts from data sources like Elastic Endgame, Elastic Defend, Crowdstrike, or SentinelOne to gather additional context and corroborate findings.
- Assess the system's current state for signs of compromise, such as unauthorized changes, unexpected network connections, or the presence of known malicious files or processes.

### False positive analysis

- Routine administrative tasks: System administrators may use pkexec for legitimate purposes, such as performing maintenance tasks. To handle this, create exceptions for known administrator accounts or specific maintenance scripts that regularly invoke pkexec.
- Automated scripts: Some automated scripts or cron jobs might use pkexec to perform scheduled tasks. Identify these scripts and exclude their specific process names or paths from the rule to prevent false alerts.
- Software updates: Certain software update processes might use pkexec to apply patches or updates. Monitor and document these processes, then configure exceptions for recognized update mechanisms.
- Development environments: Developers might use pkexec during testing or development. Establish a list of development machines or user accounts and exclude them from the rule to reduce noise.
- Custom user applications: Users may have custom applications that require pkexec for legitimate functionality. Review these applications and whitelist their specific execution patterns to avoid unnecessary alerts.

### Response and remediation

- Immediately isolate the affected system from the network to prevent potential lateral movement by the adversary.
- Terminate any suspicious `pkexec` processes identified by the alert to halt unauthorized actions or privilege escalation attempts.
- Review and analyze the parent shell process and its command history to understand the context and origin of the `pkexec` execution.
- Reset credentials and review permissions for the user accounts involved to mitigate any unauthorized access or privilege escalation.
- Conduct a thorough scan of the affected system for additional indicators of compromise or persistence mechanisms that may have been deployed.
- Escalate the incident to the security operations team for further investigation and to determine if additional systems are affected.
- Update and enhance monitoring rules to detect similar `pkexec` misuse attempts in the future, ensuring comprehensive coverage of shell processes and privilege escalation activities."""
risk_score = 73
rule_id = "3ca81a95-d5af-4b77-b0ad-b02bc746f640"
setup = """## Setup

This rule requires data coming in from one of the following integrations:
- 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).

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

#### The following steps should be executed in order to add the Auditbeat on a Linux System:
- Elastic provides repositories available for APT and YUM-based distributions. Note that we provide binary packages, but no source packages.
- To install the APT and YUM repositories follow the setup instructions in this [helper guide](https://www.elastic.co/guide/en/beats/auditbeat/current/setup-repositories.html).
- To run Auditbeat on Docker follow the setup instructions in the [helper guide](https://www.elastic.co/guide/en/beats/auditbeat/current/running-on-docker.html).
- To run Auditbeat on Kubernetes follow the setup instructions in the [helper guide](https://www.elastic.co/guide/en/beats/auditbeat/current/running-on-kubernetes.html).
- For complete “Setup and Run Auditbeat” information refer to the [helper guide](https://www.elastic.co/guide/en/beats/auditbeat/current/setting-up-and-running.html).
"""
severity = "high"
tags = [
    "Domain: Endpoint",
    "OS: Linux",
    "Use Case: Threat Detection",
    "Tactic: Execution",
    "Tactic: Persistence",
    "Data Source: Elastic Endgame",
    "Data Source: Elastic Defend",
    "Data Source: SentinelOne",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "new_terms"
query = '''
event.category:process and host.os.type:linux and event.type:start and
event.action:(exec or exec_event or start or ProcessRollup2) and process.name:pkexec and
process.args:pkexec and process.parent.name:(bash or dash or sh or tcsh or csh or zsh or ksh or fish) and
not (
  process.args:(
    "/usr/libexec/gvfsd-admin" or "udevadm" or "/opt/forticlient/stop-forticlient.sh" or "/usr/bin/gparted" or
    "dpkg" or "/usr/sbin/gparted" or "input-remapper-control" or "/usr/lib/ubuntu-release-upgrader/do-partial-upgrade"
  ) or
  process.parent.command_line:*/home/*/.claude/shell-snapshots/* or
  process.parent.args:"/usr/bin/timeshift-launcher"
)
'''

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

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

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

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

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

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

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

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

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

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

[rule.threat.tactic]
id = "TA0004"
name = "Privilege Escalation"
reference = "https://attack.mitre.org/tactics/TA0004/"
[rule.new_terms]
field = "new_terms_fields"
value = ["process.parent.command_line"]

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

Stages and Predicates

Stage 1: new_terms

event.category:process and host.os.type:linux and event.type:start and
event.action:(exec or exec_event or start or ProcessRollup2) and process.name:pkexec and
process.args:pkexec and process.parent.name:(bash or dash or sh or tcsh or csh or zsh or ksh or fish) and
not (
  process.args:(
    "/usr/libexec/gvfsd-admin" or "udevadm" or "/opt/forticlient/stop-forticlient.sh" or "/usr/bin/gparted" or
    "dpkg" or "/usr/sbin/gparted" or "input-remapper-control" or "/usr/lib/ubuntu-release-upgrader/do-partial-upgrade"
  ) or
  process.parent.command_line:*/home/*/.claude/shell-snapshots/* or
  process.parent.args:"/usr/bin/timeshift-launcher"
)

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.argsin/opt/forticlient/stop-forticlient.sh, /usr/bin/gparted, /usr/lib/ubuntu-release-upgrader/do-partial-upgrade, /usr/libexec/gvfsd-admin, /usr/sbin/gparted, dpkg, input-remapper-control, udevadmexcludes:process.args
process.parent.argseq/usr/bin/timeshift-launcherexcludes:process.parent.args field:"process.parent.args" value:"/usr/bin/timeshift-launcher"
process.parent.command_linewildcard*/home/*/.claude/shell-snapshots/*excludes:process.parent.command_line field:"process.parent.command_line" value:"*/home/*/.claude/shell-snapshots/*"

Windows Defender Disabled via Registry Modification

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

Identifies modifications to the Windows Defender registry settings to disable the service or set the service to be started manually.

MITRE ATT&CK Coverage

Telemetry Coverage

Rule Body

[metadata]
creation_date = "2020/12/23"
integration = ["endpoint", "windows", "m365_defender"]
maturity = "production"
updated_date = "2026/05/04"

[rule]
author = ["Elastic"]
description = """
Identifies modifications to the Windows Defender registry settings to disable the service or set the service to be
started manually.
"""
from = "now-9m"
index = [
    "logs-endpoint.events.registry-*",
    "endgame-*",
    "logs-windows.sysmon_operational-*",
    "winlogbeat-*",
    "logs-m365_defender.event-*",
]
language = "eql"
license = "Elastic License v2"
name = "Windows Defender Disabled via Registry Modification"
note = """## Triage and analysis

### Investigating Windows Defender Disabled via Registry Modification

Microsoft Windows Defender is an antivirus product built into Microsoft Windows, which makes it popular across multiple environments. Disabling it is a common step in threat actor playbooks.

This rule monitors the registry for configurations that disable Windows Defender or the start of its service.

#### Possible investigation steps

- Investigate the process execution chain (parent process tree) for unknown processes. Examine their executable files for prevalence, whether they are located in expected locations, and if they are signed with valid digital signatures.
- Validate the activity is not related to planned patches, updates, network administrator activity, or legitimate software installations.
- Identify the user account that performed the action and whether it should perform this kind of action.
- Contact the account owner and confirm whether they are aware of this activity.
- Investigate other alerts associated with the user/host during the past 48 hours.
- Check if this operation was approved and performed according to the organization's change management policy.

### False positive analysis

- This mechanism can be used legitimately. Analysts can dismiss the alert if the administrator is aware of the activity, the configuration is justified (for example, it is being used to deploy other security solutions or troubleshooting), and no other suspicious activity has been observed.

### Related rules

- Disabling Windows Defender Security Settings via PowerShell - c8cccb06-faf2-4cd5-886e-2c9636cfcb87
- Microsoft Windows Defender Tampering - fe794edd-487f-4a90-b285-3ee54f2af2d3

### Response and remediation

- Initiate the incident response process based on the outcome of the triage.
- Isolate the involved hosts to prevent further post-compromise behavior.
- Investigate credential exposure on systems compromised or used by the attacker to ensure all compromised accounts are identified. Reset passwords for these accounts and other potentially compromised credentials, such as email, business systems, and web services.
- Re-enable Windows Defender and restore the service configurations to automatic start.
- Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
- Review the privileges assigned to the user to ensure that the least privilege principle is being followed.
- 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:

- [Microsoft Defender XDR](https://ela.st/m365-defender)
- [Sysmon Registry Events](https://ela.st/sysmon-event-reg-setup)
"""

references = ["https://thedfirreport.com/2020/12/13/defender-control/"]
risk_score = 21
rule_id = "2ffa1f1e-b6db-47fa-994b-1512743847eb"
severity = "low"
tags = [
    "Domain: Endpoint",
    "OS: Windows",
    "Use Case: Threat Detection",
    "Tactic: Defense Evasion",
    "Resources: Investigation Guide",
    "Data Source: Elastic Endgame",
    "Data Source: Elastic Defend",
    "Data Source: Sysmon",
    "Data Source: Microsoft Defender XDR",
]
timestamp_override = "event.ingested"
type = "eql"

query = '''
registry where host.os.type == "windows" and event.type == "change" and
  (
    (
      registry.path: (
        "HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows Defender\\DisableAntiSpyware",
        "\\REGISTRY\\MACHINE\\SOFTWARE\\Policies\\Microsoft\\Windows Defender\\DisableAntiSpyware"
      ) and
      registry.data.strings: ("1", "0x00000001")
   ) or
   (
      registry.path: (
        "HKLM\\System\\*ControlSet*\\Services\\WinDefend\\Start",
        "\\REGISTRY\\MACHINE\\System\\*ControlSet*\\Services\\WinDefend\\Start"
      ) and
      registry.data.strings in ("3", "4", "0x00000003", "0x00000004")
   )
  ) and

  not
    (
      process.executable : (
          "?:\\WINDOWS\\system32\\services.exe",
          "?:\\Windows\\System32\\svchost.exe",
          "?:\\Program Files (x86)\\Trend Micro\\Security Agent\\NTRmv.exe"
      ) and user.id : "S-1-5-18"
    )
'''


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

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

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



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

Stages and Predicates

Stage 1: registry

registry where host.os.type == "windows" and event.type == "change" and
  (
    (
      registry.path: (
        "HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows Defender\\DisableAntiSpyware",
        "\\REGISTRY\\MACHINE\\SOFTWARE\\Policies\\Microsoft\\Windows Defender\\DisableAntiSpyware"
      ) and
      registry.data.strings: ("1", "0x00000001")
   ) or
   (
      registry.path: (
        "HKLM\\System\\*ControlSet*\\Services\\WinDefend\\Start",
        "\\REGISTRY\\MACHINE\\System\\*ControlSet*\\Services\\WinDefend\\Start"
      ) and
      registry.data.strings in ("3", "4", "0x00000003", "0x00000004")
   )
  ) and

  not
    (
      process.executable : (
          "?:\\WINDOWS\\system32\\services.exe",
          "?:\\Windows\\System32\\svchost.exe",
          "?:\\Program Files (x86)\\Trend Micro\\Security Agent\\NTRmv.exe"
      ) and user.id : "S-1-5-18"
    )

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.stringsin
  • 0x00000003
  • 0x00000004
  • 3
  • 4
field:"Details" kind:in
registry.data.stringswildcard
  • 0x00000001 corpus 61 (splunk 52, elastic 9)
  • 1 corpus 16 (elastic 14, splunk 2)
field:"Details" kind:wildcard
registry.pathwildcard
  • HKLM\SOFTWARE\Policies\Microsoft\Windows Defender\DisableAntiSpyware
  • HKLM\System\*ControlSet*\Services\WinDefend\Start
  • \REGISTRY\MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\DisableAntiSpyware
  • \REGISTRY\MACHINE\System\*ControlSet*\Services\WinDefend\Start
field:"TargetObject" kind:wildcard

Exclusions

The rule actively suppresses these predicates.

Back to all Elastic rules