Detection rules › Elastic

Elastic rules: 2b

API via Trusted App Runtime DLL

#
Source
github.com/elastic/protections-artifacts

Identifies attemtps to call Windows memory management APIs from the Trusted App Runtime DLL tprtdll.dll. This may indicate an attempt to execute syscalls from a trusted module while avoiding potential NTDLL hooks.

MITRE ATT&CK Coverage

TacticTechniques
Stealth

Rule Body

[rule]
description = """
Identifies attemtps to call Windows memory management APIs from the Trusted App Runtime DLL tprtdll.dll. This may
indicate an attempt to execute syscalls from a trusted module while avoiding potential NTDLL hooks.
"""
id = "ed572422-cefc-496c-b59f-65d8c34b9ac4"
license = "Elastic License v2"
name = "API via Trusted App Runtime DLL"
os_list = ["windows"]
reference = [
    "https://github.com/whokilleddb/function-collections/blob/8ad66ca3276b8d1b1864552d0e09f32c56126ec5/winapi_alternatives/NtAllocateMemoryEx/main.c",
]
version = "1.0.3"

query = '''
api where process.Ext.api.name in ("VirtualAlloc", "VirtualProtect", "WriteProcessMemory","VirtualProtectEx", "VirtualAllocEx") and
 (
  process.thread.Ext.call_stack_summary like "tprtdll.dll|*" or

  (process.thread.Ext.call_stack_final_user_module.name == "Unbacked" and
   process.thread.Ext.call_stack_final_user_module.protection_provenance_path == "c:\\windows\\system32\\tprtdll.dll") or

   process.thread.Ext.call_stack_final_user_module.path == "c:\\windows\\system32\\tprtdll.dll"
  )
'''

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

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


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

[internal]
min_endpoint_version = "8.14.2"

Stages and Predicates

Stage 1: api

api where process.Ext.api.name in ("VirtualAlloc", "VirtualProtect", "WriteProcessMemory","VirtualProtectEx", "VirtualAllocEx") and
 (
  process.thread.Ext.call_stack_summary like "tprtdll.dll|*" or

  (process.thread.Ext.call_stack_final_user_module.name == "Unbacked" and
   process.thread.Ext.call_stack_final_user_module.protection_provenance_path == "c:\\windows\\system32\\tprtdll.dll") or

   process.thread.Ext.call_stack_final_user_module.path == "c:\\windows\\system32\\tprtdll.dll"
  )

Indicators

These rows show field, operator, and value matches.

Attempt to Clear Logs via Journalctl

#
Source
github.com/elastic/protections-artifacts

This rule monitors for attempts to clear logs using the "journalctl" command on Linux systems. Adversaries may use this technique to cover their tracks by deleting or truncating log files, making it harder for defenders to investigate their activities. The rule looks for the execution of "journalctl" with arguments that indicate log clearing actions, such as "--vacuum-time", "--vacuum-size", or "--vacuum-files".

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
This rule monitors for attempts to clear logs using the "journalctl" command on Linux systems. Adversaries may use this
technique to cover their tracks by deleting or truncating log files, making it harder for defenders to investigate their
activities. The rule looks for the execution of "journalctl" with arguments that indicate log clearing actions, such as
"--vacuum-time", "--vacuum-size", or "--vacuum-files".
"""
id = "2f45b36f-a60d-46c9-9f82-eb80ab62ce7f"
license = "Elastic License v2"
name = "Attempt to Clear Logs via Journalctl"
os_list = ["linux"]
version = "1.0.1"

query = '''
process where event.type == "start" and event.action == "exec" and process.name == "journalctl" and
process.args like~ ("--vacuum-time=?s", "--vacuum-size=?M", "--vacuum-files=*") and
not (
  process.parent.args in ("/usr/lib/armbian/armbian-truncate-logs", "/root/innovasive_reverseproxy/backupscript/cleanup_hour.sh") or
  process.parent.executable == "/tmp/newroot/usr/bin/sudo"
)
'''

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

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

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1070"
name = "Indicator Removal"
reference = "https://attack.mitre.org/techniques/T1070/"
[[threat.technique.subtechnique]]
id = "T1070.002"
name = "Clear Linux or Mac System Logs"
reference = "https://attack.mitre.org/techniques/T1070/002/"


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

Stage 1: process

process where event.type == "start" and event.action == "exec" and process.name == "journalctl" and
process.args like~ ("--vacuum-time=?s", "--vacuum-size=?M", "--vacuum-files=*") and
not (
  process.parent.args in ("/usr/lib/armbian/armbian-truncate-logs", "/root/innovasive_reverseproxy/backupscript/cleanup_hour.sh") or
  process.parent.executable == "/tmp/newroot/usr/bin/sudo"
)

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.parent.argsin/root/innovasive_reverseproxy/backupscript/cleanup_hour.sh, /usr/lib/armbian/armbian-truncate-logsexcludes:process.parent.args field:"process.parent.args" value:"/root/innovasive_reverseproxy/backupscript/cleanup_hour.sh" field:"process.parent.args" value:"/usr/lib/armbian/armbian-truncate-logs"
process.parent.executableeq/tmp/newroot/usr/bin/sudoexcludes:process.parent.executable field:"process.parent.executable" value:"/tmp/newroot/usr/bin/sudo"

Azure WireServer HTTP Request from Unexpected User Agent

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

Identifies HTTP requests to Azure WireServer (168.63.129.16) for GoalState, certificates, versions, or HostGAPlugin vmSettings that do not use a known guest-agent user agent. These requests retrieve transport certificates and extension protectedSettings, including embedded SAS URLs. Azure Linux Agent, Windows guest agent, and related platform UAs are excluded. Requests with no user agent are also excluded; that pattern is common for the Windows guest agent.

Known False Positives

  • Custom health checks that call HostGAPlugin /versions or /vmSettings with curl. Exclude the specific user agent or host group after validating the script.

MITRE ATT&CK Coverage

Rule Body

[metadata]
creation_date = "2026/08/17"
integration = ["network_traffic"]
maturity = "production"
updated_date = "2026/08/17"

[rule]
author = ["Elastic"]
description = """
Identifies HTTP requests to Azure WireServer (168.63.129.16) for GoalState, certificates, versions, or HostGAPlugin
vmSettings that do not use a known guest-agent user agent. These requests retrieve transport certificates and extension
protectedSettings, including embedded SAS URLs. Azure Linux Agent, Windows guest agent, and related platform UAs are
excluded. Requests with no user agent are also excluded; that pattern is common for the Windows guest agent.
"""
false_positives = [
    """
    Custom health checks that call HostGAPlugin /versions or /vmSettings with curl. Exclude the specific user agent or
    host group after validating the script.
    """,
]
from = "now-9m"
index = ["logs-network_traffic.http*"]
language = "eql"
license = "Elastic License v2"
name = "Azure WireServer HTTP Request from Unexpected User Agent"
note = """## Triage and analysis

### Investigating Azure WireServer HTTP Request from Unexpected User Agent

Network Packet Capture with HTTP decoding on ports 80 and 32526 shows the URI that Elastic Defend network events
lack. The match is the WireServer path or query, not a scripting-tool user-agent allowlist.

- `url.query` contains `comp=versions` (discovery)
- `url.query` contains `comp=goalstate` (incarnation, container, extension list, statusUploadBlob pointer)
- `url.query` contains `comp=certificates` (often with request header `x-ms-guest-agent-public-x509-cert`)
- `destination.port == 32526` and `url.path` in `/versions`, `/vmSettings`

Excluded user agents from lab guest-agent traffic: `WALinuxAgent/*`, `VMAgent/*`, `Python-urllib/*`,
`cpprestsdk/*`, `ACMS/*`, and a missing user agent (Windows guest agent). Curl and Windows PowerShell are not
excluded and will fire.

`/vmSettings` response bodies are often dropped when they exceed keyword `ignore_above`. The URI, port, and user
agent are sufficient. Do not enable body capture to chase this rule.

### Possible investigation steps

- Confirm `url.path`, `url.query`, `destination.port`, and `user_agent.original`.
- GoalState (`comp=goalstate`) is reconnaissance; `comp=certificates` means the client presented a transport
  certificate. Look on the host for `openssl req ... LinuxTransport` or a stolen `.crt`/`.key`.
- Correlate with endpoint network events from the same `host.name` to `168.63.129.16` and process start events for
  openssl cms decrypt.
- Search StorageRead platform logs for anonymous or SAS GetBlob against the same storage account after the scrape.

### False positive analysis

- Administrative curl or other non-agent clients against WireServer during incident response. Exclude the specific
  user agent or host after the change window.
- A new Microsoft guest-agent build with an unfamiliar user agent will fire until that UA is excluded.
- Omitting the user agent looks like the Windows guest agent and is not matched. Do not treat a missing UA as
  suspicious on its own.

### Response and remediation

- Isolate the VM, rotate secrets recovered from vmSettings, and review extension protectedSettings.
- Enable Metadata Security Protocol in audit or enforce mode to restrict WireServer callers.
"""
references = [
    "https://cybercx.com.au/blog/azure-ssrf-metadata/",
    "https://www.netspi.com/blog/technical-blog/cloud-pentesting/decrypting-vm-extension-settings-with-azure-wireserver/",
    "https://cloud.google.com/blog/topics/threat-intelligence/escalating-privileges-azure-kubernetes-services",
    "https://learn.microsoft.com/en-us/azure/virtual-network/what-is-ip-address-168-63-129-16",
]
risk_score = 47
rule_id = "359b5925-a625-4803-90d2-19e44a37d98e"
setup = """## Setup

Deploy the [Network Packet Capture](https://www.elastic.co/docs/reference/integrations/network_traffic) integration
via Fleet on Azure virtual machines. Default HTTP port lists do not include HostGAPlugin.

Required integration settings:

- Enable **Capture HTTP Traffic**.
- Set HTTP ports to include **80** (WireServer GoalState, versions, certificates) and **32526** (HostGAPlugin
  `/versions`, `/vmSettings`). Without 32526, HostGAPlugin requests are invisible.
- Enable **Monitor Processes** so HTTP events include `process.*` when available.
- Optional: **Send all headers** to retain `x-ms-version` and `x-ms-guest-agent-public-x509-cert` for investigation.
  The rule matches URI, port, and user agent, not the certificate PEM.
- Do not enable request or response body capture for this rule. `/vmSettings` bodies are large and often dropped;
  other WireServer XML is not required for the match.
"""
severity = "medium"
tags = [
    "Domain: Cloud",
    "Domain: Network",
    "OS: Linux",
    "OS: Windows",
    "Platform: Azure",
    "Use Case: Threat Detection",
    "Tactic: Credential Access",
    "Tactic: Discovery",
    "Data Source: Network Packet Capture",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"

query = '''
network where event.module == "network_traffic" and
destination.ip == "168.63.129.16" and
user_agent.original != null and
not user_agent.original : (
  "WALinuxAgent*",
  "VMAgent*",
  "Python-urllib*",
  "cpprestsdk*",
  "ACMS/*"
) and
(
  url.query : ("*comp=versions*", "*comp=goalstate*", "*comp=certificates*") or
  (destination.port == 32526 and url.path : ("/versions", "/vmSettings"))
)
'''


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



[rule.threat.tactic]
id = "TA0006"
name = "Credential Access"
reference = "https://attack.mitre.org/tactics/TA0006/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1082"
name = "System Information Discovery"
reference = "https://attack.mitre.org/techniques/T1082/"


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

Stages and Predicates

Stage 1: network

network where event.module == "network_traffic" and
destination.ip == "168.63.129.16" and
user_agent.original != null and
not user_agent.original : (
  "WALinuxAgent*",
  "VMAgent*",
  "Python-urllib*",
  "cpprestsdk*",
  "ACMS/*"
) and
(
  url.query : ("*comp=versions*", "*comp=goalstate*", "*comp=certificates*") or
  (destination.port == 32526 and url.path : ("/versions", "/vmSettings"))
)

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
destination.ipeq
  • 168.63.129.16
field:"dest_ip" kind:eq value:"168.63.129.16"
destination.porteq
  • 32526 transforms: number
field:"DestinationPort" kind:eq value:"32526"
event.moduleeq
  • network_traffic corpus 2 (elastic 2)
field:"event.module" kind:eq value:"network_traffic"
url.pathwildcard
  • /versions
  • /vmSettings
field:"url.path" kind:wildcard
url.querywildcard
  • *comp=certificates*
  • *comp=goalstate*
  • *comp=versions*
field:"url.query" kind:wildcard
user_agent.originalis_not_null
  • (no value, null check)
field:"aws::userAgent" kind:is_not_null

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
user_agent.originalstarts_withWALinuxAgent, VMAgent, Python-urllib, cpprestsdk, ACMS/excludes:user_agent.original

Crypto Wallet or Web Browser File Access via Osascript

#
Source
github.com/elastic/protections-artifacts

Detects when Osascript accesses crypto wallet or web browser files on a macOS system like crypto wallet files, or web browser cookies.

MITRE ATT&CK Coverage

Telemetry Coverage

Rule Body

[rule]
description = """
Detects when Osascript accesses crypto wallet or web browser files on a macOS system like crypto wallet files, or web
browser cookies.
"""
id = "b4428697-1df8-4979-ac49-7183374eee6c"
license = "Elastic License v2"
name = "Crypto Wallet or Web Browser File Access via Osascript"
os_list = ["macos"]
version = "1.0.2"

query = '''
file where event.action == "open" and (process.name == "osascript" or Effective_process.name == "osascript") and 
 (file.path like~ ("/Users/*/.electrum/*",
                   "/Users/*/Library/Application_Support/*/Default/Extensions/*",
                   "/Users/*/Library/Application Support/*/Default/Local Extension Settings/*",
                   "/Users/*/Library/Application Support/Electrum/*",
                   "/Users/*/Library/Application Support/Exodus/*", 
                   "/Users/*/Library/Application Support/Coinomi/*",
                   "/Users/*/Library/Application Support/Atomic/*",
                   "/Users/*/Library/Application Support/@trezor/*",
                   "/Users/*/Library/Application Support/Ledger Live/*",
                   "/Users/*/Library/Application Support/WasabiWallet/*",
                   "/Users/*/Monero/*",
                   "/Users/*/Library/Application Support/Bitcoin/*",
                   "/Users/*/Library/Application Support/Litecoin/*",
                   "/Users/*/Library/Application Support/DashCore/*",
                   "/Users/*/Library/Application Support/ElectronCash/*",
                   "/Users/*/Library/Application Support/Guarda/*",
                   "/Users/*/Library/Application Support/Dogecoin/*",
                   "/Users/*/Library/Application Support/BraveSoftware/Brave-Browser/BraveWallet/*",
                   "/Users/*/Library/Application Support/BraveSoftware/Brave-Browser/Default/Local Extension Settings/pgojbichloddijphfmfhhfolimnhjklk/*",
                   "/Users/*/Library/Application Support/Firefox/Profiles/*/extensions/*") or
   file.name like~ ("cookies.sqlite", 
                    "key?.db", 
                    "logins.json", 
                    "Cookies", 
                    "Cookies.binarycookies", 
                    "Login Data"))
'''

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

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

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



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

[internal]
min_endpoint_version = "8.11.1"

Stages and Predicates

Stage 1: file

file where event.action == "open" and (process.name == "osascript" or Effective_process.name == "osascript") and 
 (file.path like~ ("/Users/*/.electrum/*",
                   "/Users/*/Library/Application_Support/*/Default/Extensions/*",
                   "/Users/*/Library/Application Support/*/Default/Local Extension Settings/*",
                   "/Users/*/Library/Application Support/Electrum/*",
                   "/Users/*/Library/Application Support/Exodus/*", 
                   "/Users/*/Library/Application Support/Coinomi/*",
                   "/Users/*/Library/Application Support/Atomic/*",
                   "/Users/*/Library/Application Support/@trezor/*",
                   "/Users/*/Library/Application Support/Ledger Live/*",
                   "/Users/*/Library/Application Support/WasabiWallet/*",
                   "/Users/*/Monero/*",
                   "/Users/*/Library/Application Support/Bitcoin/*",
                   "/Users/*/Library/Application Support/Litecoin/*",
                   "/Users/*/Library/Application Support/DashCore/*",
                   "/Users/*/Library/Application Support/ElectronCash/*",
                   "/Users/*/Library/Application Support/Guarda/*",
                   "/Users/*/Library/Application Support/Dogecoin/*",
                   "/Users/*/Library/Application Support/BraveSoftware/Brave-Browser/BraveWallet/*",
                   "/Users/*/Library/Application Support/BraveSoftware/Brave-Browser/Default/Local Extension Settings/pgojbichloddijphfmfhhfolimnhjklk/*",
                   "/Users/*/Library/Application Support/Firefox/Profiles/*/extensions/*") or
   file.name like~ ("cookies.sqlite", 
                    "key?.db", 
                    "logins.json", 
                    "Cookies", 
                    "Cookies.binarycookies", 
                    "Login Data"))

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
Effective_process.nameeq
  • osascript corpus 3 (elastic 3)
field:"Effective_process.name" kind:eq value:"osascript"
event.actioneq
  • open corpus 49 (elastic 49)
field:"EventType" kind:eq value:"open"
file.namewildcard
  • Cookies corpus 8 (elastic 8)
  • Cookies.binarycookies corpus 8 (elastic 8)
  • Login Data corpus 8 (elastic 8)
  • cookies.sqlite corpus 11 (elastic 11)
  • key?.db corpus 11 (elastic 11)
  • logins.json corpus 11 (elastic 11)
field:"file.name" kind:wildcard
file.pathwildcard
  • /Users/*/.electrum/* corpus 5 (elastic 5)
  • /Users/*/Library/Application Support/*/Default/Local Extension Settings/* corpus 5 (elastic 5)
  • /Users/*/Library/Application Support/@trezor/* corpus 5 (elastic 5)
  • /Users/*/Library/Application Support/Atomic/* corpus 5 (elastic 5)
  • /Users/*/Library/Application Support/Bitcoin/* corpus 5 (elastic 5)
  • /Users/*/Library/Application Support/BraveSoftware/Brave-Browser/BraveWallet/* corpus 5 (elastic 5)
  • /Users/*/Library/Application Support/BraveSoftware/Brave-Browser/Default/Local Extension Settings/pgojbichloddijphfmfhhfolimnhjklk/* corpus 5 (elastic 5)
  • /Users/*/Library/Application Support/Coinomi/* corpus 5 (elastic 5)
  • /Users/*/Library/Application Support/DashCore/* corpus 5 (elastic 5)
  • /Users/*/Library/Application Support/Dogecoin/* corpus 5 (elastic 5)
  • /Users/*/Library/Application Support/ElectronCash/* corpus 5 (elastic 5)
  • /Users/*/Library/Application Support/Electrum/* corpus 5 (elastic 5)
  • /Users/*/Library/Application Support/Exodus/* corpus 5 (elastic 5)
  • /Users/*/Library/Application Support/Firefox/Profiles/*/extensions/* corpus 5 (elastic 5)
  • /Users/*/Library/Application Support/Guarda/* corpus 5 (elastic 5)
  • /Users/*/Library/Application Support/Ledger Live/* corpus 5 (elastic 5)
  • /Users/*/Library/Application Support/Litecoin/* corpus 5 (elastic 5)
  • /Users/*/Library/Application Support/WasabiWallet/* corpus 5 (elastic 5)
  • /Users/*/Library/Application_Support/*/Default/Extensions/* corpus 5 (elastic 5)
  • /Users/*/Monero/* corpus 5 (elastic 5)
field:"TargetFilename" kind:wildcard
process.nameeq
  • osascript corpus 41 (elastic 41)
field:"process_basename" kind:eq value:"osascript"

Deprecated - M365 Security Compliance Unusual Volume of File Deletion

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

Identifies that a user has deleted an unusually large volume of files as reported by Microsoft Cloud App Security.

Known False Positives

  • Users or System Administrator cleaning out folders.

MITRE ATT&CK Coverage

TacticTechniques
Impact

Rules Detecting the Same Action

These rules filter on the same operation.

Rule Body

[metadata]
creation_date = "2021/07/15"
integration = ["o365"]
maturity = "production"
updated_date = "2026/04/10"

[rule]
author = ["Austin Songer"]
description = "Identifies that a user has deleted an unusually large volume of files as reported by Microsoft Cloud App Security."
false_positives = ["Users or System Administrator cleaning out folders."]
from = "now-9m"
index = ["logs-o365.audit-*", "filebeat-*"]
language = "kuery"
license = "Elastic License v2"
name = "Deprecated - M365 Security Compliance Unusual Volume of File Deletion"
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 Deprecated - M365 Security Compliance Unusual Volume of File Deletion

Microsoft 365's cloud environment facilitates file storage and collaboration, but its vast data handling capabilities can be exploited by adversaries for data destruction. Attackers may delete large volumes of files to disrupt operations or cover their tracks. The detection rule leverages audit logs to identify anomalies in file deletion activities, flagging successful, unusual deletion volumes as potential security incidents, thus enabling timely investigation and response.

### Possible investigation steps

- Review the audit logs for the specific user associated with the alert to confirm the volume and context of the file deletions, focusing on entries with event.action:"Unusual volume of file deletion" and event.outcome:success.
- Correlate the timestamps of the deletion events with other activities in the user's account to identify any suspicious patterns or anomalies, such as unusual login locations or times.
- Check for any recent changes in user permissions or roles that might explain the ability to delete a large volume of files, ensuring these align with the user's typical responsibilities.
- Investigate any recent security alerts or incidents involving the same user or related accounts to determine if this activity is part of a broader attack or compromise.
- Contact the user or their manager to verify if the deletions were intentional and authorized, and gather any additional context that might explain the activity.
- Assess the impact of the deletions on business operations and data integrity, and determine if any recovery actions are necessary to restore critical files.

### False positive analysis

- High-volume legitimate deletions during data migration or cleanup projects can trigger false positives. To manage this, create exceptions for users or groups involved in these activities during the specified time frame.
- Automated processes or scripts that perform bulk deletions as part of routine maintenance may be flagged. Identify these processes and whitelist them to prevent unnecessary alerts.
- Users with roles in data management or IT support may regularly delete large volumes of files as part of their job responsibilities. Establish a baseline for these users and adjust the detection thresholds accordingly.
- Temporary spikes in file deletions due to organizational changes, such as department restructuring, can be mistaken for malicious activity. Monitor these events and temporarily adjust the rule parameters to accommodate expected changes.
- Regularly review and update the list of exceptions to ensure that only legitimate activities are excluded from alerts, maintaining the effectiveness of the detection rule.

### Response and remediation

- Immediately isolate the affected user account to prevent further unauthorized file deletions. This can be done by disabling the account or changing the password.
- Review the audit logs to identify the scope of the deletion and determine if any critical or sensitive files were affected. Restore these files from backups if available.
- Conduct a thorough review of the affected user's recent activities to identify any other suspicious actions or potential indicators of compromise.
- Escalate the incident to the security operations team for further investigation and to determine if the deletion is part of a larger attack or breach.
- Implement additional monitoring on the affected account and similar high-risk accounts to detect any further unusual activities.
- Review and update access controls and permissions to ensure that users have the minimum necessary access to perform their job functions, reducing the risk of large-scale deletions.
- Coordinate with the IT and security teams to conduct a post-incident review, identifying any gaps in the response process and implementing improvements to prevent recurrence.

## Setup

The Office 365 Logs Fleet integration, Filebeat module, or similarly structured data is required to be compatible with this rule.
"""
references = [
    "https://docs.microsoft.com/en-us/cloud-app-security/anomaly-detection-policy",
    "https://docs.microsoft.com/en-us/cloud-app-security/policy-template-reference",
]
risk_score = 47
rule_id = "b2951150-658f-4a60-832f-a00d1e6c6745"
severity = "medium"
tags = ["Domain: Cloud", "Data Source: Microsoft 365", "Use Case: Configuration Audit", "Tactic: Impact", "Resources: Investigation Guide"]
timestamp_override = "event.ingested"
type = "query"

query = '''
data_stream.dataset:o365.audit and event.provider:SecurityComplianceCenter and event.category:web and event.action:"Unusual volume of file deletion" and event.outcome:success
'''


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


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

Stages and Predicates

Stage 1: query

data_stream.dataset:o365.audit and event.provider:SecurityComplianceCenter and event.category:web and event.action:"Unusual volume of file deletion" and event.outcome:success

Indicators

These rows show field, operator, and value matches.

Deprecated - M365 Teams Guest Access Enabled

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

Identifies when guest access is enabled in Microsoft Teams. Guest access in Teams allows people outside the organization to access teams and channels. An adversary may enable guest access to maintain persistence in an environment.

Known False Positives

  • Teams guest access may be enabled by a system or network administrator. Verify that the configuration change was expected. Exceptions can be added to this rule to filter expected behavior.

MITRE ATT&CK Coverage

Telemetry Coverage

Rule Body

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

[rule]
author = ["Elastic"]
description = """
Identifies when guest access is enabled in Microsoft Teams. Guest access in Teams allows people outside the organization
to access teams and channels. An adversary may enable guest access to maintain persistence in an environment.
"""
false_positives = [
    """
    Teams guest access may be enabled by a system or network administrator. Verify that the configuration change was
    expected. Exceptions can be added to this rule to filter expected behavior.
    """,
]
from = "now-9m"
index = ["logs-o365.audit-*", "filebeat-*"]
language = "kuery"
license = "Elastic License v2"
name = "Deprecated - M365 Teams Guest Access Enabled"
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 Deprecated - M365 Teams Guest Access Enabled

Microsoft Teams allows organizations to collaborate with external users through guest access, facilitating communication and teamwork. However, adversaries can exploit this feature to gain persistent access to sensitive environments by enabling guest access without authorization. The detection rule monitors audit logs for specific configurations that indicate guest access has been enabled, helping identify unauthorized changes and potential security breaches.

### Possible investigation steps

- Review the audit logs to confirm the event.action "Set-CsTeamsClientConfiguration" was successfully executed with the parameter o365.audit.Parameters.AllowGuestUser set to True.
- Identify the user account responsible for enabling guest access by examining the event logs for the user ID or account name associated with the action.
- Check the user's activity history to determine if there are any other suspicious actions or patterns, such as changes to other configurations or unusual login times.
- Investigate the context of the change by reviewing any related communications or requests that might justify enabling guest access, ensuring it aligns with organizational policies.
- Assess the potential impact by identifying which teams and channels now have guest access enabled and evaluate the sensitivity of the information accessible to external users.
- Contact the user or their manager to verify if the change was authorized and necessary, and document their response for future reference.

### False positive analysis

- Legitimate collaboration with external partners may trigger alerts when guest access is enabled for business purposes. To manage this, create exceptions for known and approved external domains or specific projects that require guest access.
- Routine administrative actions by IT staff to enable guest access for specific teams or channels can be mistaken for unauthorized changes. Implement a process to log and approve such changes internally, and exclude these from triggering alerts.
- Automated scripts or third-party applications that configure Teams settings, including guest access, might cause false positives. Identify and whitelist these scripts or applications to prevent unnecessary alerts.
- Changes made during scheduled maintenance windows can be misinterpreted as unauthorized. Define and exclude these time periods from monitoring to reduce false positives.

### Response and remediation

- Immediately disable guest access in Microsoft Teams by updating the Teams client configuration to prevent unauthorized external access.
- Conduct a thorough review of recent audit logs to identify any unauthorized changes or suspicious activities related to guest access settings.
- Notify the security team and relevant stakeholders about the potential breach to ensure awareness and initiate further investigation.
- Revoke any unauthorized guest accounts that have been added to Teams to eliminate potential persistence mechanisms.
- Implement additional monitoring on Teams configurations to detect any future unauthorized changes to guest access settings.
- Escalate the incident to the organization's incident response team for a comprehensive investigation and to determine if further containment actions are necessary.
- Review and update access control policies to ensure that enabling guest access requires appropriate authorization and oversight.

## Setup

The Office 365 Logs Fleet integration, Filebeat module, or similarly structured data is required to be compatible with this rule."""
references = [
    "https://docs.microsoft.com/en-us/powershell/module/skype/get-csteamsclientconfiguration?view=skype-ps",
]
risk_score = 47
rule_id = "5e552599-ddec-4e14-bad1-28aa42404388"
severity = "medium"
tags = ["Domain: Cloud", "Data Source: Microsoft 365", "Use Case: Configuration Audit", "Tactic: Persistence", "Resources: Investigation Guide"]
timestamp_override = "event.ingested"
type = "query"

query = '''
data_stream.dataset:o365.audit and event.provider:(SkypeForBusiness or MicrosoftTeams) and
event.category:web and event.action:"Set-CsTeamsClientConfiguration" and
o365.audit.Parameters.AllowGuestUser:True and event.outcome:success
'''


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

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

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

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

Stages and Predicates

Stage 1: query

data_stream.dataset:o365.audit and event.provider:(SkypeForBusiness or MicrosoftTeams) and
event.category:web and event.action:"Set-CsTeamsClientConfiguration" and
o365.audit.Parameters.AllowGuestUser:True and event.outcome:success

Indicators

These rows show field, operator, and value matches.

Docker Socket Enumeration

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

This rule detects potential Docker socket enumeration activity by monitoring processes that attempt to interact with the Docker socket file (/var/run/docker.sock). Docker socket enumeration is a common technique used by attackers to interact with the Docker daemon and perform various operations, such as creating, starting, stopping, and removing containers. Attackers may abuse Docker socket enumeration to gain unauthorized access to the host system, escalate privileges, or move laterally within the environment.

MITRE ATT&CK Coverage

Rule Body

[metadata]
creation_date = "2025/03/04"
integration = ["endpoint", "auditd_manager", "crowdstrike", "sentinel_one_cloud_funnel", "cloud_defend"]
maturity = "production"
min_stack_comments = "Defend for Containers integration was re-introduced in 9.3.0"
min_stack_version = "9.3.0"
updated_date = "2026/03/24"

[rule]
author = ["Elastic"]
description = """
This rule detects potential Docker socket enumeration activity by monitoring processes that attempt to interact with the
Docker socket file (/var/run/docker.sock). Docker socket enumeration is a common technique used by attackers to interact
with the Docker daemon and perform various operations, such as creating, starting, stopping, and removing containers.
Attackers may abuse Docker socket enumeration to gain unauthorized access to the host system, escalate privileges, or
move laterally within the environment.
"""
from = "now-9m"
index = [
    "auditbeat-*",
    "endgame-*",
    "logs-auditd_manager.auditd-*",
    "logs-crowdstrike.fdr*",
    "logs-endpoint.events.process*",
    "logs-sentinel_one_cloud_funnel.*",
    "logs-cloud_defend.process*",
]
language = "eql"
license = "Elastic License v2"
name = "Docker Socket Enumeration"
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 Docker Socket Enumeration

Docker sockets facilitate communication between the Docker client and daemon, enabling container management. Adversaries exploit this by accessing the socket to control containers, potentially escalating privileges or moving laterally. The detection rule identifies suspicious processes interacting with the Docker socket, using specific commands, to flag unauthorized enumeration attempts.

### Possible investigation steps

- Review the process details to confirm the presence of suspicious commands interacting with the Docker socket, specifically looking for the use of tools like curl, socat, nc, netcat, ncat, or nc.traditional.
- Examine the command line arguments of the flagged process to understand the intent and scope of the interaction with the Docker socket, focusing on paths like /var/run/docker.sock or /run/docker.sock.
- Identify the user account under which the suspicious process was executed to assess if it has legitimate access to Docker resources or if it might be compromised.
- Check the historical activity of the involved user and process to determine if this behavior is anomalous or part of a known pattern.
- Investigate any recent changes or deployments in the Docker environment that might explain the interaction with the Docker socket, such as new container setups or updates.
- Correlate the alert with other security events or logs from the same host or network segment to identify potential lateral movement or privilege escalation attempts.

### False positive analysis

- Legitimate administrative tasks using tools like curl or socat to interact with Docker for monitoring or management purposes can trigger alerts. To handle this, create exceptions for specific user accounts or scripts that are known to perform these tasks regularly.
- Automated scripts or services that check the status of Docker containers might be flagged. Identify these scripts and whitelist their process names or command lines to prevent unnecessary alerts.
- Development environments where developers frequently use command-line tools to interact with Docker may cause false positives. Consider excluding specific development machines or user groups from the rule to reduce noise.
- Continuous integration or deployment pipelines that use Docker commands as part of their workflow can be mistaken for enumeration attempts. Exclude these processes by identifying their unique command patterns or execution contexts.
- Security tools that perform regular audits or checks on Docker environments might trigger the rule. Verify these tools and add them to an exception list to avoid false alerts.

### Response and remediation

- Immediately isolate the affected host from the network to prevent further unauthorized access or lateral movement.
- Terminate any suspicious processes identified in the alert that are interacting with the Docker socket, such as those using curl, socat, or netcat.
- Conduct a thorough review of Docker containers on the affected host to identify any unauthorized or malicious containers. Stop and remove any that are not recognized or are deemed suspicious.
- Check for any unauthorized changes to Docker configurations or images and revert them to a known good state.
- Review and restrict permissions on the Docker socket file (/var/run/docker.sock) to limit access to only trusted users and processes.
- Escalate the incident to the security operations team for further investigation and to determine if additional hosts or systems are affected.
- Implement enhanced monitoring and logging for Docker socket interactions to detect and respond to similar threats more quickly in the future.
"""
risk_score = 47
rule_id = "dd983e79-22e8-44d1-9173-d57dba514cac"
setup = """## Setup

This rule requires data coming in from Elastic Defend.

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

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

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

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

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

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

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

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

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

Stages and Predicates

Stage 1: process

process where host.os.type == "linux" and event.type == "start" and
event.action in ("exec", "exec_event", "start", "ProcessRollup2", "executed", "process_started") and
process.name in ("curl", "socat", "nc", "netcat", "ncat", "nc.traditional") and
process.args like ("*/var/run/docker.sock*", "*/run/docker.sock*") and
process.parent.executable != null and
not (
  process.parent.executable in ("/usr/sbin/sshd", "/www/server/panel/BT-Panel") or
  process.parent.args in ("/usr/libexec/netdata/plugins.d/cgroup-name.sh", "/docker-entrypoint")
)

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actionin
  • ProcessRollup2
  • exec
  • exec_event
  • executed
  • process_started
  • start
field:"EventType" kind:in
event.typeeq
  • start
field:"event.type" kind:eq value:"start"
process.argswildcard
  • */run/docker.sock*
  • */var/run/docker.sock*
field:"process.args" kind:wildcard
process.namein
  • curl
  • nc
  • nc.traditional
  • ncat
  • netcat
  • socat
field:"process_basename" kind:in
process.parent.executableis_not_null
  • (no value, null check)
field:"ParentImage" kind:is_not_null

Exclusions

The rule actively suppresses these predicates.

Domain Added to Google Workspace Trusted Domains

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

Detects when an administrator adds a domain to the Google Workspace allowlisted (trusted) domains list. Adversaries with administrative access may onboard a domain they control to relax cross-organization sharing restrictions, enabling data collection and exfiltration through Drive, Chat, and other services that honor the tenant trust boundary.

Known False Positives

  • Trusted domains may be added by system administrators. Verify that the configuration change was expected. Exceptions can be added to this rule to filter expected behavior.

MITRE ATT&CK Coverage

Telemetry Coverage

Rules Detecting the Same Action

These rules filter on the same operation.

Rule Body

[metadata]
creation_date = "2020/11/17"
integration = ["google_workspace"]
maturity = "production"
updated_date = "2026/06/02"

[rule]
author = ["Elastic"]
description = """
Detects when an administrator adds a domain to the Google Workspace allowlisted (trusted) domains list. Adversaries with
administrative access may onboard a domain they control to relax cross-organization sharing restrictions, enabling
data collection and exfiltration through Drive, Chat, and other services that honor the tenant trust boundary.
"""
false_positives = [
    """
    Trusted domains may be added by system administrators. Verify that the configuration change was expected. Exceptions
    can be added to this rule to filter expected behavior.
    """,
]
from = "now-130m"
index = ["filebeat-*", "logs-google_workspace.admin-*"]
interval = "10m"
language = "kuery"
license = "Elastic License v2"
name = "Domain Added to Google Workspace Trusted Domains"
note = """## Triage and analysis

### Investigating Domain Added to Google Workspace Trusted Domains

Google Workspace allowlisted domains define which external organizations users may collaborate with across services such
as Drive, Chat, and Classroom. Adding a domain to this list expands who can receive shared content under the tenant's
trust policies. Threat actors with administrative access may add a domain they operate to bypass out-of-domain sharing
controls and establish a durable path for collection or exfiltration.

This rule identifies when an administrator adds a domain via the `ADD_TRUSTED_DOMAINS` event in the
`google_workspace.admin` data stream.

### Possible investigation steps

- Identify the initiating (actor) administrator by reviewing `user.email` or `user.name`, and note `source.ip` and `event.ingested` if present in the alert.
- Identify the domain added by reviewing `google_workspace.admin.domain.name`.
- Determine whether the change is expected and authorized:
  - Validate there is an approved change request or partner onboarding record for the new domain.
  - If the actor account or `source.ip` is unusual, treat the alert as higher priority until proven benign.
- Review allowlisted domains in the Google Admin console:
  - Navigate to Account > Domains > Allowlisted domains.
  - Confirm the domain from `google_workspace.admin.domain.name` appears on the list and whether it is appropriate for your organization's sharing model.
- Assess domain reputation and ownership using external intelligence (for example, VirusTotal or WHOIS) to determine whether the domain is associated with your organization or a known partner.
- Search Kibana for related admin and sharing activity:
  - Find other trust or sharing policy changes by the same actor:
    ```
    data_stream.dataset: "google_workspace.admin" and user.email: "<ACTOR_EMAIL>" and event.action: ("ADD_TRUSTED_DOMAINS" or "REMOVE_TRUSTED_DOMAINS")
    ```
  - After the add, review Drive events for files shared to users outside your domain:
    ```
    data_stream.dataset: "google_workspace.drive" and event.action: ("change_user_access" or "change_document_visibility")
    ```
  - Scope for other security-weakening admin actions from the same `user.email` within the last 48 hours.

### False positive analysis

- Verify the domain belongs to an approved partner or subsidiary with a documented business need for cross-organization collaboration.
- Adding test or lab domains during migrations is possible — validate timing against change windows.

### Response and remediation

- Initiate the incident response process based on triage findings.
- If the add is not clearly authorized, remove the domain from Allowlisted domains while the investigation proceeds.
- If the initiating admin account is suspected compromised, reset credentials, revoke active sessions, and review delegated admin roles assigned to that account.
- Review recent Drive and Chat sharing to external users for sensitive data exposure tied to the newly trusted domain.
- 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.
- Review the permissions assigned to the implicated administrator to ensure that the least privilege principle is being followed.
- Implement security best practices [outlined](https://support.google.com/a/answer/7587183) by Google.
- 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 Google Workspace Fleet integration, Filebeat module, or similarly structured data is required to be compatible with this rule.

### Important Information Regarding Google Workspace Event Lag Times
- As per Google's documentation, Google Workspace administrators may observe lag times ranging from minutes up to 3 days between the time of an event's occurrence and the event being visible in the Google Workspace admin/audit logs.
- This rule is configured to run every 10 minutes with a lookback time of 130 minutes.
- To reduce the risk of false negatives, consider reducing the interval that the Google Workspace (formerly G Suite) Filebeat module polls Google's reporting API for new events.
- By default, `var.interval` is set to 2 hours (2h). Consider changing this interval to a lower value, such as 10 minutes (10m).
- See the following references for further information:
  - https://support.google.com/a/answer/7061566
  - https://www.elastic.co/guide/en/beats/filebeat/current/filebeat-module-google_workspace.html"""
references = [
    "https://support.google.com/a/answer/6160020?hl=en",
    "https://www.elastic.co/security-labs/google-workspace-attack-surface-part-one",
    "https://www.elastic.co/security-labs/google-workspace-attack-surface-part-two"
]
risk_score = 73
rule_id = "cf549724-c577-4fd6-8f9b-d1b8ec519ec0"
severity = "high"
tags = [
    "Domain: Cloud",
    "Data Source: Google Workspace",
    "Use Case: Configuration Audit",
    "Tactic: Defense Evasion",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "query"

query = '''
data_stream.dataset:google_workspace.admin and event.action:ADD_TRUSTED_DOMAINS
'''

[rule.investigation_fields]
field_names = [
    "user.name",
    "user.email",
    "source.ip",
    "user.domain",
    "event.action",
    "google_workspace.admin.domain.name",
]

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

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

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

[[rule.threat.technique]]
id = "T1562"
name = "Impair Defenses"
reference = "https://attack.mitre.org/techniques/T1562/"

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

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

Stages and Predicates

Stage 1: query

data_stream.dataset:google_workspace.admin and event.action:ADD_TRUSTED_DOMAINS

Indicators

These rows show field, operator, and value matches.

Execution of a File Dropped from Kernel Mode

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

Identifies attempt to load an untrusted executable dropped by a Kernel mode code. Adversaries may execute malicious code in user mode via existing malicious Kernel drivers.

MITRE ATT&CK Coverage

TacticTechniques
Stealth

Rule Body

[rule]
description = """
Identifies attempt to load an untrusted executable dropped by a Kernel mode code. Adversaries may execute malicious code
in user mode via existing malicious Kernel drivers.
"""
id = "1c618d05-2cac-4979-9c85-6320fc317177"
license = "Elastic License v2"
name = "Execution of a File Dropped from Kernel Mode"
os_list = ["windows"]
version = "1.0.5"

query = '''
sequence with maxspan=5m
  [file where event.action == "creation" and
   /* library dropped via System Virtual Process - Kernel mode code */
   process.pid == 4 and user.id : "S-1-5-18" and
   (file.extension : ("exe", "dll") or file.Ext.header_bytes : "4d5a*")] by file.path 
   [library where process.pid != 4 and not dll.code_signature.status : "trusted" and process.executable != null and
    not dll.hash.sha256 : "6957be7503737453c3feab129d4924fca55e7b0c026ec878d0d040765002732c"] by dll.path
'''

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

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

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


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

[internal]
min_endpoint_version = "8.4.0"

Stages and Predicates

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

Stage 1: file

[file where event.action == "creation" and
   process.pid == 4 and user.id : "S-1-5-18" and
   (file.extension : ("exe", "dll") or file.Ext.header_bytes : "4d5a*")] by file.path

Stage 2: library

[library where process.pid != 4 and not dll.code_signature.status : "trusted" and process.executable != null and
    not dll.hash.sha256 : "6957be7503737453c3feab129d4924fca55e7b0c026ec878d0d040765002732c"] by dll.path

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • creation corpus 50 (elastic 50)
field:"EventType" kind:eq value:"creation"
file.Ext.header_byteswildcard
  • 4d5a* corpus 45 (elastic 45)
field:"file.Ext.header_bytes" kind:wildcard value:"4d5a*"
file.extensionwildcard
  • dll corpus 32 (elastic 32)
  • exe corpus 32 (elastic 32)
field:"file.extension" kind:wildcard
process.executableis_not_null
  • (no value, null check)
field:"Image" kind:is_not_null
process.pideq
  • 4 transforms: number corpus 17 (elastic 17)
field:"process_id" kind:eq value:"4"
process.pidne
  • 4 transforms: number corpus 44 (elastic 44)
field:"process_id" kind:ne value:"4"
user.idwildcard
  • S-1-5-18 corpus 13 (elastic 13)
field:"user.id" kind:wildcard value:"S-1-5-18"

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
dll.code_signature.statuseqtrustedexcludes:dll.code_signature.status field:"dll.code_signature.status" value:"trusted"
dll.hash.sha256eq6957be7503737453c3feab129d4924fca55e7b0c026ec878d0d040765002732cexcludes:dll.hash.sha256 field:"dll.hash.sha256" value:"6957be7503737453c3feab129d4924fca55e7b0c026ec878d0d040765002732c"

Expired or Revoked Driver Loaded

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

Identifies an attempt to load a revoked or expired driver. Adversaries may bring outdated drivers with vulnerabilities to gain code execution in kernel mode or abuse revoked certificates to sign their drivers.

MITRE ATT&CK Coverage

Telemetry Coverage

ProviderRecord / event type
SysmonEvent ID 6: Driver loaded

Rule Body

[metadata]
creation_date = "2023/06/26"
integration = ["endpoint"]
maturity = "production"
updated_date = "2026/05/04"

[rule]
author = ["Elastic"]
description = """
Identifies an attempt to load a revoked or expired driver. Adversaries may bring outdated drivers with vulnerabilities
to gain code execution in kernel mode or abuse revoked certificates to sign their drivers.
"""
from = "now-9m"
index = ["logs-endpoint.events.library-*"]
language = "eql"
license = "Elastic License v2"
name = "Expired or Revoked Driver Loaded"
references = [
    "https://docs.microsoft.com/en-us/previous-versions/windows/hardware/design/dn653559(v=vs.85)?redirectedfrom=MSDN",
]
risk_score = 47
rule_id = "d12bac54-ab2a-4159-933f-d7bcefa7b61d"
severity = "medium"
tags = [
    "Domain: Endpoint",
    "OS: Windows",
    "Use Case: Threat Detection",
    "Tactic: Privilege Escalation",
    "Tactic: Defense Evasion",
    "Data Source: Elastic Defend",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"

query = '''
driver where host.os.type == "windows" and process.pid == 4 and
  dll.code_signature.status : ("errorExpired", "errorRevoked")
'''

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

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 Expired or Revoked Driver Loaded
In Windows environments, drivers facilitate communication between the OS and hardware. Adversaries exploit vulnerabilities in outdated drivers or misuse revoked certificates to execute malicious code in kernel mode, bypassing security controls. The detection rule identifies such threats by monitoring for drivers with expired or revoked signatures, focusing on processes critical to system integrity, thus flagging potential privilege escalation or defense evasion attempts.

### Possible investigation steps

- Review the alert details to confirm the presence of a driver with an expired or revoked signature, focusing on the process with PID 4, which is typically the System process in Windows.
- Investigate the specific driver file that triggered the alert by checking its file path, hash, and any associated metadata to determine its origin and legitimacy.
- Cross-reference the driver file against known vulnerability databases and security advisories to identify any known exploits associated with it.
- Examine recent system logs and security events for any unusual activities or attempts to load other drivers around the same time as the alert.
- Assess the system for any signs of privilege escalation or defense evasion, such as unauthorized access attempts or changes to security settings.
- If the driver is confirmed to be malicious or suspicious, isolate the affected system to prevent further compromise and initiate a detailed forensic analysis.

### False positive analysis

- Legitimate software updates may load drivers with expired or revoked signatures temporarily. Verify the source and purpose of the driver before excluding it.
- Some older hardware devices may rely on drivers that have expired signatures but are still necessary for functionality. Confirm the device's necessity and consider excluding these drivers if they are from a trusted source.
- Security software or system management tools might use drivers with expired signatures for legitimate operations. Validate the software's legitimacy and add exceptions for these drivers if they are verified as safe.
- Custom or in-house developed drivers might not have updated signatures. Ensure these drivers are from a trusted internal source and consider excluding them if they are essential for operations.
- Test environments may intentionally use expired or revoked drivers for research or development purposes. Clearly document these cases and exclude them to prevent unnecessary alerts.

### Response and remediation

- Immediately isolate the affected system from the network to prevent further exploitation or lateral movement by the adversary.
- Terminate any processes associated with the expired or revoked driver to halt any ongoing malicious activity.
- Conduct a thorough review of the system to identify any unauthorized changes or additional malicious drivers that may have been loaded.
- Revoke any compromised certificates and update the certificate trust list to prevent future misuse.
- Apply the latest security patches and driver updates to close any vulnerabilities that may have been exploited.
- Restore the system from a known good backup if any unauthorized changes or persistent threats are detected.
- Escalate the incident to the security operations center (SOC) for further analysis and to determine if additional systems are affected."""


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

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

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

[[rule.threat.technique.subtechnique]]
id = "T1036.001"
name = "Invalid Code Signature"
reference = "https://attack.mitre.org/techniques/T1036/001/"

[[rule.threat.technique]]
id = "T1553"
name = "Subvert Trust Controls"
reference = "https://attack.mitre.org/techniques/T1553/"

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

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

Stages and Predicates

Stage 1: driver

driver where host.os.type == "windows" and process.pid == 4 and
  dll.code_signature.status : ("errorExpired", "errorRevoked")

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
dll.code_signature.statuswildcard
  • errorExpired corpus 2 (elastic 2)
  • errorRevoked corpus 2 (elastic 2)
field:"dll.code_signature.status" kind:wildcard
process.pideq
  • 4 transforms: number corpus 17 (elastic 17)
field:"process_id" kind:eq value:"4"

Kubernetes Events Deleted

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

This rule detects the deletion of Kubernetes events, which can indicate an attempt to cover up malicious activity or misconfigurations. Adversaries may delete events to remove traces of their actions, making it harder for defenders to investigate and respond to incidents.

MITRE ATT&CK Coverage

Telemetry Coverage

PlatformRecord / event type
Kubernetesdelete-events: delete events

Rules Detecting the Same Action

These rules filter on the same operation.

Rule Body

[metadata]
creation_date = "2025/06/27"
integration = ["kubernetes"]
maturity = "production"
updated_date = "2026/04/10"

[rule]
author = ["Elastic"]
description = """
This rule detects the deletion of Kubernetes events, which can indicate an attempt to cover up malicious
activity or misconfigurations. Adversaries may delete events to remove traces of their actions, making it
harder for defenders to investigate and respond to incidents.
"""
index = ["logs-kubernetes.audit_logs-*"]
language = "eql"
license = "Elastic License v2"
name = "Kubernetes Events Deleted"
note = """ ## Triage and analysis

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

### Investigating Kubernetes Events Deleted
Kubernetes, a container orchestration platform, logs events to track activities within the cluster. These events are crucial for monitoring and troubleshooting. Adversaries may delete these logs to hide their tracks, impeding incident response. The detection rule identifies deletions of Kubernetes events, signaling potential defense evasion attempts by matching specific audit log attributes, thus alerting security teams to investigate further.

### Possible investigation steps

- Review the audit logs to identify the source of the deletion request by examining the `kubernetes.audit.user.username` field to determine which user or service account initiated the delete action.
- Check the `kubernetes.audit.sourceIPs` field to trace the IP address from which the deletion request originated, which can help identify potential unauthorized access.
- Investigate the `kubernetes.audit.objectRef.namespace` field to understand which namespace the deleted events belonged to, as this can provide context on the affected applications or services.
- Analyze the timeline of events leading up to the deletion by reviewing other audit logs with similar `kubernetes.audit.verb` values to identify any suspicious activities or patterns.
- Assess the role and permissions of the user or service account involved in the deletion to determine if they had legitimate access or if there was a potential privilege escalation.
- Cross-reference the deletion event with other security alerts or logs to identify any correlated activities that might indicate a broader attack or misconfiguration.

### False positive analysis

- Routine maintenance activities may involve the deletion of Kubernetes events, such as during cluster upgrades or cleanup tasks. To manage this, create exceptions for known maintenance periods or specific user accounts responsible for these tasks.
- Automated scripts or tools that manage Kubernetes resources might delete events as part of their normal operation. Identify these scripts and exclude their actions from triggering alerts by whitelisting their service accounts or IP addresses.
- Misconfigured applications or services might inadvertently delete events. Regularly review and update configurations to ensure they align with best practices, and consider excluding specific applications if they are known to cause benign deletions.
- Development and testing environments often have more frequent event deletions as part of iterative testing processes. Implement separate monitoring rules or thresholds for these environments to reduce noise in alerts.

### Response and remediation

- Immediately isolate the affected Kubernetes cluster to prevent further unauthorized access or tampering with event logs.
- Review and restore any deleted Kubernetes events from backup logs or snapshots to ensure a complete audit trail is available for further investigation.
- Conduct a thorough review of access controls and permissions within the Kubernetes environment to identify and revoke any unauthorized access that may have led to the deletion of events.
- Implement stricter logging and monitoring policies to ensure that any future deletions of Kubernetes events are detected and alerted in real-time.
- Escalate the incident to the security operations center (SOC) for a comprehensive analysis of potential breaches and to determine if additional systems or data were affected.
- Coordinate with the incident response team to conduct a root cause analysis and identify any vulnerabilities or misconfigurations that allowed the event deletion to occur.
- Update and reinforce security policies and procedures to prevent similar incidents, including enhancing detection capabilities for defense evasion tactics as outlined in MITRE ATT&CK.
"""
risk_score = 21
rule_id = "33c27b4e-8ec6-406f-b8e5-345dc024aa97"
severity = "low"
tags = [
    "Data Source: Kubernetes",
    "Domain: Kubernetes",
    "Use Case: Threat Detection",
    "Tactic: Defense Evasion",
    "Resources: Investigation Guide",
    ]
timestamp_override = "event.ingested"
type = "eql"
query = '''
any where data_stream.dataset == "kubernetes.audit_logs" and kubernetes.audit.verb == "delete" and
kubernetes.audit.objectRef.resource == "events" and kubernetes.audit.stage == "ResponseComplete"
'''

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

[[rule.threat.technique]]
id = "T1070"
name = "Indicator Removal"
reference = "https://attack.mitre.org/techniques/T1070/"

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

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

Stages and Predicates

Stage 1: any

any where data_stream.dataset == "kubernetes.audit_logs" and kubernetes.audit.verb == "delete" and
kubernetes.audit.objectRef.resource == "events" and kubernetes.audit.stage == "ResponseComplete"

Indicators

These rows show field, operator, and value matches.

Launch Service Creation and Immediate Loading

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

An adversary can establish persistence by installing a new launch agent that executes at login by using launchd or launchctl to load a plist into the appropriate directories.

Known False Positives

  • Trusted applications persisting via LaunchAgent

MITRE ATT&CK Coverage

Rule Body

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

[rule]
author = ["Elastic"]
description = """
An adversary can establish persistence by installing a new launch agent that executes at login by using launchd or
launchctl to load a plist into the appropriate directories.
"""
false_positives = ["Trusted applications persisting via LaunchAgent"]
from = "now-9m"
index = ["logs-endpoint.events.file*", "logs-endpoint.events.process*"]
language = "eql"
license = "Elastic License v2"
name = "Launch Service Creation and Immediate Loading"
references = [
    "https://developer.apple.com/library/archive/documentation/MacOSX/Conceptual/BPSystemStartup/Chapters/CreatingLaunchdJobs.html",
]
risk_score = 21
rule_id = "082e3f8c-6f80-485c-91eb-5b112cb79b28"
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 = "low"
tags = [
    "Domain: Endpoint",
    "OS: macOS",
    "Use Case: Threat Detection",
    "Tactic: Persistence",
    "Data Source: Elastic Defend",
    "Resources: Investigation Guide",
]
type = "eql"

query = '''
sequence by host.id with maxspan=30s
 [file where host.os.type == "macos" and event.action == "launch_daemon"] by process.entity_id
 [process where host.os.type == "macos" and event.type in ("start", "process_started") and process.name == "launchctl" and process.args in ("load", "bootstrap")] 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 Launch Service Creation and Immediate Loading

Launch Agents in macOS are used to execute scripts or applications automatically at user login, providing a mechanism for persistence. Adversaries exploit this by creating or modifying Launch Agents to execute malicious payloads. The detection rule identifies such activities by monitoring file changes in Launch Agent directories and subsequent immediate loading via `launchctl`, indicating potential unauthorized persistence attempts.

### Possible investigation steps

- Review the file path where the modification or creation of the Launch Agent occurred to determine if it is in a system directory (e.g., /System/Library/LaunchAgents/) or a user directory (e.g., /Users/*/Library/LaunchAgents/). This can help assess the potential impact and scope of the change.
- Examine the contents of the newly created or modified plist file to identify the script or application it is configured to execute. Look for any suspicious or unexpected entries that could indicate malicious activity.
- Check the timestamp of the file modification event to correlate it with any known user activities or other system events that might explain the change.
- Investigate the process execution details of the launchctl command, including the user account under which it was executed and any associated parent processes, to determine if it aligns with legitimate administrative actions or if it appears suspicious.
- Search for any additional related alerts or logs around the same timeframe that might indicate further malicious behavior or corroborate the persistence attempt, such as other process executions or network connections initiated by the suspicious process.

### False positive analysis

- System or application updates may create or modify Launch Agents as part of their installation or update process. Users can create exceptions for known and trusted applications by whitelisting their specific file paths or process names.
- User-installed applications that require background processes might use Launch Agents for legitimate purposes. Identify these applications and exclude their associated Launch Agent paths from monitoring.
- Administrative scripts or tools used by IT departments for system management might trigger this rule. Coordinate with IT to document these scripts and exclude their activities from detection.
- Development tools or environments that automatically configure Launch Agents for testing purposes can cause false positives. Developers should be aware of these activities and can exclude their specific development directories.
- Backup or synchronization software that uses Launch Agents to schedule tasks may be flagged. Verify these applications and exclude their Launch Agent paths if they are deemed safe.

### Response and remediation

- Immediately isolate the affected macOS system from the network to prevent further malicious activity or lateral movement.
- Terminate any suspicious processes associated with the unauthorized Launch Agent using Activity Monitor or the `kill` command in Terminal.
- Remove the malicious Launch Agent plist file from the affected directories: `/System/Library/LaunchAgents/`, `/Library/LaunchAgents/`, or `/Users/*/Library/LaunchAgents/`.
- Review and restore any system or application settings that may have been altered by the malicious Launch Agent.
- Conduct a thorough scan of the system using updated antivirus or endpoint detection and response (EDR) tools to identify and remove any additional malicious files or processes.
- Monitor the system for any signs of re-infection or further unauthorized changes to Launch Agents, ensuring that logging and alerting are configured to detect similar activities.
- Escalate the incident to the security operations center (SOC) or incident response team for further investigation and to determine if additional systems are affected."""


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

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

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

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

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

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

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

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

[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 30s, correlated by host.id, process.entity_id, process.parent.entity_id.

Stage 1: file

[file where host.os.type == "macos" and event.action == "launch_daemon"] by process.entity_id

Stage 2: process

[process where host.os.type == "macos" and event.type in ("start", "process_started") and process.name == "launchctl" and process.args in ("load", "bootstrap")] by process.parent.entity_id

Indicators

These rows show field, operator, and value matches.

M365 Exchange Email Safe Link Policy Disabled

#

Mofcomp Activity

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

Managed Object Format (MOF) files can be compiled locally or remotely through mofcomp.exe. Attackers may leverage MOF files to build their own namespaces and classes into the Windows Management Instrumentation (WMI) repository, or establish persistence using WMI Event Subscription.

MITRE ATT&CK Coverage

Telemetry Coverage

Rule Body

[metadata]
creation_date = "2023/08/23"
integration = ["endpoint", "m365_defender", "system", "crowdstrike"]
maturity = "production"
updated_date = "2026/07/28"

[rule]
author = ["Elastic"]
description = """
Managed Object Format (MOF) files can be compiled locally or remotely through mofcomp.exe. Attackers may leverage MOF
files to build their own namespaces and classes into the Windows Management Instrumentation (WMI) repository, or
establish persistence using WMI Event Subscription.
"""
from = "now-9m"
index = [
    "endgame-*",
    "logs-crowdstrike.fdr*",
    "logs-endpoint.events.process-*",
    "logs-m365_defender.event-*",
    "logs-system.security*",
]
language = "eql"
license = "Elastic License v2"
name = "Mofcomp Activity"
risk_score = 21
rule_id = "210d4430-b371-470e-b879-80b7182aa75e"
severity = "low"
tags = [
    "Domain: Endpoint",
    "OS: Windows",
    "Use Case: Threat Detection",
    "Tactic: Execution",
    "Data Source: Elastic Defend",
    "Data Source: Microsoft Defender XDR",
    "Data Source: Elastic Endgame",
    "Data Source: Windows Security Event Logs",
    "Data Source: Crowdstrike",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"

query = '''
process where host.os.type == "windows" and event.type == "start" and
  process.name : "mofcomp.exe" and process.args : "*.mof" and
  not user.id : "S-1-5-18" and
  not process.args : (
    "?:\\Program Files (x86)\\Microsoft Power BI Report Server\\*.mof",
    "?:\\Program Files (x86)\\Microsoft SQL Server Reporting Services\\*.mof",
    "?:\\Program Files (x86)\\Microsoft SQL Server\\*.mof",
    "?:\\Program Files\\Microsoft Policy Platform\\*.mof",
    "?:\\Program Files\\Microsoft Power BI Report Server\\*.mof",
    "?:\\Program Files\\Microsoft SQL Server Reporting Services\\*.mof",
    "?:\\Program Files\\Microsoft SQL Server\\*.mof",
    "?:\\Windows\\System32\\wbem\\com.hp.provider.*.mof",
    "?:\\Windows\\System32\\wbem\\CxAudioSvc_*.mof",
    "?:\\Windows\\System32\\wbem\\Framework\\root\\*.mof",
    "?:\\Windows\\System32\\wbem\\Veeam.Backup.*.mof",
    "?:\\Windows\\System32\\wbem\\ZTITatoo.mof",
    "?:\\Windows\\SysWOW64\\wbem\\Framework\\root\\*.mof"
  )
'''

setup = """## Setup

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

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

### Additional data sources

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

- [CrowdStrike](https://ela.st/crowdstrike-integration)
- [Microsoft Defender XDR](https://ela.st/m365-defender)
- [Windows Process Creation Logs](https://ela.st/audit-process-creation)
"""

note = """## Triage and analysis

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

### Investigating Mofcomp Activity
Mofcomp.exe is a tool used to compile Managed Object Format (MOF) files, which define classes and namespaces in the Windows Management Instrumentation (WMI) repository. Adversaries exploit this by creating malicious WMI scripts for persistence or execution. The detection rule identifies suspicious mofcomp.exe activity by filtering out legitimate processes and focusing on unusual executions, excluding known safe parent processes and system accounts.

### Possible investigation steps

- Review the process execution details to confirm the presence of mofcomp.exe and verify the command-line arguments used, focusing on any unusual or unexpected MOF file paths.
- Investigate the user account associated with the process execution, especially if it is not the system account (S-1-5-18), to determine if the account has been compromised or is being misused.
- Examine the parent process of mofcomp.exe to ensure it is not a known safe process like ScenarioEngine.exe, and assess whether the parent process is legitimate or potentially malicious.
- Check for any recent changes or additions to the WMI repository, including new namespaces or classes, which could indicate malicious activity or persistence mechanisms.
- Correlate the alert with other security events or logs from data sources like Microsoft Defender XDR or Crowdstrike to identify any related suspicious activities or patterns.

### False positive analysis

- Legitimate SQL Server operations may trigger the rule when SQL Server components compile MOF files. To handle this, exclude processes with parent names like ScenarioEngine.exe and specific MOF file paths related to SQL Server.
- System maintenance tasks executed by trusted system accounts can cause false positives. Exclude activities initiated by the system account with user ID S-1-5-18 to reduce noise.
- Regular administrative tasks involving WMI may appear suspicious. Identify and document these tasks, then create exceptions for known safe parent processes or specific MOF file paths to prevent unnecessary alerts.
- Software installations or updates that involve MOF file compilation might be flagged. Monitor installation logs and exclude these processes if they are verified as part of legitimate software updates.

### Response and remediation

- Isolate the affected system from the network to prevent further malicious activity and lateral movement.
- Terminate the mofcomp.exe process if it is confirmed to be executing malicious MOF files.
- Conduct a thorough review of the WMI repository to identify and remove any unauthorized namespaces or classes that may have been created by the attacker.
- Remove any malicious MOF files from the system to prevent re-execution.
- Restore the system from a known good backup if unauthorized changes to the WMI repository or system files are detected.
- Monitor for any recurrence of similar activity by setting up alerts for unusual mofcomp.exe executions and unauthorized WMI modifications.
- Escalate the incident to the security operations center (SOC) or incident response team for further investigation and to determine if additional systems are affected."""


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


[rule.threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1546"
name = "Event Triggered Execution"
reference = "https://attack.mitre.org/techniques/T1546/"
[[rule.threat.technique.subtechnique]]
id = "T1546.003"
name = "Windows Management Instrumentation Event Subscription"
reference = "https://attack.mitre.org/techniques/T1546/003/"



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

Stages and Predicates

Stage 1: process

process where host.os.type == "windows" and event.type == "start" and
  process.name : "mofcomp.exe" and process.args : "*.mof" and
  not user.id : "S-1-5-18" and
  not process.args : (
    "?:\\Program Files (x86)\\Microsoft Power BI Report Server\\*.mof",
    "?:\\Program Files (x86)\\Microsoft SQL Server Reporting Services\\*.mof",
    "?:\\Program Files (x86)\\Microsoft SQL Server\\*.mof",
    "?:\\Program Files\\Microsoft Policy Platform\\*.mof",
    "?:\\Program Files\\Microsoft Power BI Report Server\\*.mof",
    "?:\\Program Files\\Microsoft SQL Server Reporting Services\\*.mof",
    "?:\\Program Files\\Microsoft SQL Server\\*.mof",
    "?:\\Windows\\System32\\wbem\\com.hp.provider.*.mof",
    "?:\\Windows\\System32\\wbem\\CxAudioSvc_*.mof",
    "?:\\Windows\\System32\\wbem\\Framework\\root\\*.mof",
    "?:\\Windows\\System32\\wbem\\Veeam.Backup.*.mof",
    "?:\\Windows\\System32\\wbem\\ZTITatoo.mof",
    "?:\\Windows\\SysWOW64\\wbem\\Framework\\root\\*.mof"
  )

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.argswildcard?:\Program Files (x86)\Microsoft Power BI Report Server\*.mof, ?:\Program Files (x86)\Microsoft SQL Server Reporting Services\*.mof, ?:\Program Files (x86)\Microsoft SQL Server\*.mof, ?:\Program Files\Microsoft Policy Platform\*.mof, ?:\Program Files\Microsoft Power BI Report Server\*.mof, ?:\Program Files\Microsoft SQL Server Reporting Services\*.mof, ?:\Program Files\Microsoft SQL Server\*.mof, ?:\Windows\System32\wbem\com.hp.provider.*.mof, ?:\Windows\System32\wbem\CxAudioSvc_*.mof, ?:\Windows\System32\wbem\Framework\root\*.mof, ?:\Windows\System32\wbem\Veeam.Backup.*.mof, ?:\Windows\System32\wbem\ZTITatoo.mof, ?:\Windows\SysWOW64\wbem\Framework\root\*.mofexcludes:process.args
user.ideqS-1-5-18excludes:user.id field:"user.id" value:"S-1-5-18"

Network Connection from Binary with RWX Memory Region

#
Status
production
Severity
medium
Sequence by
host.id, process.name, process.pid
Author
Elastic
Source
github.com/elastic/detection-rules

Monitors for the execution of a unix binary with read, write and execute memory region permissions, followed by a network connection. The mprotect() system call is used to change the access protections on a region of memory that has already been allocated. This syscall allows a process to modify the permissions of pages in its virtual address space, enabling or disabling permissions such as read, write, and execute for those pages. RWX permissions on memory is in many cases overly permissive, and should (especially in conjunction with an outbound network connection) be analyzed thoroughly.

MITRE ATT&CK Coverage

Rule Body

[metadata]
creation_date = "2024/03/13"
integration = ["auditd_manager", "endpoint"]
maturity = "production"
updated_date = "2026/03/24"

[rule]
author = ["Elastic"]
description = """
Monitors for the execution of a unix binary with read, write and execute memory region permissions, followed by a
network connection. The mprotect() system call is used to change the access protections on a region of memory that has
already been allocated. This syscall allows a process to modify the permissions of pages in its virtual address space,
enabling or disabling permissions such as read, write, and execute for those pages. RWX permissions on memory is in many
cases overly permissive, and should (especially in conjunction with an outbound network connection) be analyzed
thoroughly.
"""
from = "now-9m"
index = ["auditbeat-*", "logs-auditd_manager.auditd-*", "logs-endpoint.events.network*", "logs-endpoint.events.process*"]
language = "eql"
license = "Elastic License v2"
name = "Network Connection from Binary with RWX Memory Region"
references = [
    "https://man7.org/linux/man-pages/man2/mprotect.2.html",
    "https://www.elastic.co/security-labs/linux-detection-engineering-with-auditd",
]
risk_score = 47
rule_id = "32300431-c2d5-432d-8ec8-0e03f9924756"
setup = """## Setup

This rule requires the use of the `auditd_manager` integration. `Auditd_manager` is a tool designed to simplify and enhance the management of the audit subsystem in Linux systems. It provides a user-friendly interface and automation capabilities for configuring and monitoring system auditing through the auditd daemon. With `auditd_manager`, administrators can easily define audit rules, track system events, and generate comprehensive audit reports, improving overall security and compliance in the system. The following steps should be executed in order to install and deploy `auditd_manager` on a Linux system.
```
Kibana -->
Management -->
Integrations -->
Auditd Manager -->
Add Auditd Manager
```
`Auditd_manager` subscribes to the kernel and receives events as they occur without any additional configuration. However, if more advanced configuration is required to detect specific behavior, audit rules can be added to the integration in either the "audit rules" configuration box or the "auditd rule files" box by specifying a file to read the audit rules from.
For this detection rule to trigger, the following additional audit rules are required to be added to the integration:
```
-a always,exit -F arch=b64 -S mprotect
```
Add the newly installed `auditd manager` to an agent policy, and deploy the agent on a Linux system from which auditd log files are desirable.
"""
severity = "medium"
tags = [
    "Domain: Endpoint",
    "OS: Linux",
    "Use Case: Threat Detection",
    "Tactic: Execution",
    "Data Source: Elastic Defend",
    "Data Source: Auditd Manager",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
sample by host.id, process.pid, process.name
  /* auditd.data.a2 == "7" translates to RWX memory region protection (PROT_READ | PROT_WRITE | PROT_EXEC) */
  [process where host.os.type == "linux" and auditd.data.syscall == "mprotect" and auditd.data.a2 == "7" and
   not process.name in ("httpd", "java", "node", "code", "apache2")]
  [network where host.os.type == "linux" and event.type == "start" and event.action == "connection_attempted" and
   not cidrmatch(destination.ip, "127.0.0.0/8", "169.254.0.0/16", "224.0.0.0/4", "::1")]
'''
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 Network Connection from Binary with RWX Memory Region

In Linux environments, the `mprotect()` system call adjusts memory permissions, potentially enabling read, write, and execute (RWX) access. Adversaries exploit this to execute malicious code in memory, often followed by network connections to exfiltrate data or communicate with command-and-control servers. The detection rule identifies such behavior by monitoring for RWX memory changes and subsequent network activity, flagging suspicious processes for further analysis.

### Possible investigation steps

- Review the process details using the process.pid and process.name fields to identify the binary that requested RWX memory permissions.
- Investigate the context of the mprotect() syscall by examining the process's command line arguments and parent process to understand its origin and purpose.
- Analyze the network connection details, focusing on the destination.ip field, to determine if the connection was made to a known malicious IP or an unusual external server.
- Check the process's execution history and any associated files or scripts to identify potential malicious payloads or scripts that may have been executed.
- Correlate the event with other security logs or alerts from the same host.id to identify any related suspicious activities or patterns.
- Assess the risk and impact by determining if any sensitive data was accessed or exfiltrated during the network connection attempt.

### False positive analysis

- Legitimate software updates or patches may temporarily use RWX memory regions. Monitor the specific process names and verify if they are associated with known update mechanisms. Consider adding these processes to an exception list if they are verified as safe.
- Development tools and environments often require RWX permissions for debugging or testing purposes. Identify these tools and exclude them from the rule if they are part of a controlled and secure development environment.
- Certain system services or daemons, like custom web servers or network services, might use RWX memory regions for legitimate reasons. Review the process names and network destinations to determine if they are part of expected system behavior, and exclude them if confirmed.
- Security software or monitoring tools may exhibit this behavior as part of their normal operation. Validate these processes and consider excluding them if they are recognized as part of your security infrastructure.
- Custom scripts or automation tasks that require dynamic code execution might trigger this rule. Ensure these scripts are reviewed and approved, then exclude them if they are deemed non-threatening.

### Response and remediation

- Isolate the affected host from the network immediately to prevent further data exfiltration or communication with potential command-and-control servers.
- Terminate the suspicious process identified by the detection rule to halt any ongoing malicious activity.
- Conduct a memory dump of the affected system to capture the current state for forensic analysis, focusing on the RWX memory regions.
- Review and analyze the network logs to identify any external IP addresses or domains the process attempted to connect to, and block these on the network firewall.
- Patch and update the affected system to the latest security updates to mitigate any known vulnerabilities that could have been exploited.
- Implement stricter memory protection policies to prevent processes from obtaining RWX permissions unless absolutely necessary.
- Escalate the incident to the security operations center (SOC) for further investigation and to determine if this is part of a larger attack campaign."""

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

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

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

[[rule.threat.technique]]
id = "T1106"
name = "Native API"
reference = "https://attack.mitre.org/techniques/T1106/"

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

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

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

[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 = "T1620"
name = "Reflective Code Loading"
reference = "https://attack.mitre.org/techniques/T1620/"

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

Stages and Predicates

Ordered sequence: each step below must occur in order, correlated by host.id, process.name, process.pid.

Stage 1: process

not process.name in ("apache2", "code", "httpd", "java", "node") and auditd.data.a2 == "7" and auditd.data.syscall == "mprotect" and host.os.type == "linux"

Stage 2: network

not (cidrMatch(destination.ip, "127.0.0.0/8") or cidrMatch(destination.ip, "169.254.0.0/16") or cidrMatch(destination.ip, "224.0.0.0/4") or cidrMatch(destination.ip, "::1")) and event.action == "connection_attempted" and event.type == "start" and host.os.type == "linux"

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.nameinapache2, code, httpd, java, nodeexcludes:process.name
destination.ipcidr_match127.0.0.0/8, 169.254.0.0/16, 224.0.0.0/4, ::1excludes:destination.ip

Network Connection via Startup Item

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

Identifies the execution of an unsigned program or script from the Startup shell folder followed by an immediate network connection. This may indicate the presence of a malicious persistent item.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
Identifies the execution of an unsigned program or script from the Startup shell folder followed by an immediate network
connection. This may indicate the presence of a malicious persistent item.
"""
id = "0b33141a-3f73-4414-ba90-d8410e6ab176"
license = "Elastic License v2"
name = "Network Connection via Startup Item"
os_list = ["windows"]
version = "1.0.31"

query = '''
sequence by process.entity_id with maxspan=1m
 [process where event.action == "start" and
  (
   // unsigned program starting from startup folder
   (process.executable : (
    "?:\\Users\\*\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs\\Startup\\*",
    "?:\\ProgramData\\Microsoft\\Windows\\Start Menu\\Programs\\Startup\\*")  and
    not process.code_signature.trusted == true) or

    // Scripts starting from startup folder
   (process.name : ("cscript.exe", "wscript.exe", "mshta.exe", "powershell.exe") and
    process.command_line : (
        "*:\\Users\\*\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs\\Startup\\*",
        "*:\\ProgramData\\Microsoft\\Windows\\Start Menu\\Programs\\Startup\\*"))
  ) and

  /* ConnectWiseManage - unsigned */
  not process.hash.sha256 : "cac904da410372bcd0797b4bfa402c8f8663040f26e80a435d98d12bd2fa6659"]
 [network where not cidrmatch(destination.ip, "10.0.0.0/8", "127.0.0.0/8", "169.254.0.0/16", "172.16.0.0/12", "192.0.0.0/24",
       "192.0.0.0/29", "192.0.0.8/32", "192.0.0.9/32", "192.0.0.10/32", "192.0.0.170/32", "192.0.0.171/32",
       "192.0.2.0/24", "192.31.196.0/24", "192.52.193.0/24", "192.88.99.0/24", "224.0.0.0/4",
       "100.64.0.0/10", "192.168.0.0/16", "192.175.48.0/24","198.18.0.0/15", "198.51.100.0/24", "203.0.113.0/24", "240.0.0.0/4", "::1",
       "FE80::/10", "FF00::/8")]
'''

min_endpoint_version = "7.15.0"
optional_actions = []
[[actions]]
action = "kill_process"
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.005"
name = "Visual Basic"
reference = "https://attack.mitre.org/techniques/T1059/005/"

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



[threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1547"
name = "Boot or Logon Autostart Execution"
reference = "https://attack.mitre.org/techniques/T1547/"
[[threat.technique.subtechnique]]
id = "T1547.001"
name = "Registry Run Keys / Startup Folder"
reference = "https://attack.mitre.org/techniques/T1547/001/"



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



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

[internal]
min_endpoint_version = "7.15.0"

Stages and Predicates

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

Stage 1: process

[process where event.action == "start" and
  (
   (process.executable : (
    "?:\\Users\\*\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs\\Startup\\*",
    "?:\\ProgramData\\Microsoft\\Windows\\Start Menu\\Programs\\Startup\\*")  and
    not process.code_signature.trusted == true) or
   (process.name : ("cscript.exe", "wscript.exe", "mshta.exe", "powershell.exe") and
    process.command_line : (
        "*:\\Users\\*\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs\\Startup\\*",
        "*:\\ProgramData\\Microsoft\\Windows\\Start Menu\\Programs\\Startup\\*"))
  ) and
  not process.hash.sha256 : "cac904da410372bcd0797b4bfa402c8f8663040f26e80a435d98d12bd2fa6659"]

Stage 2: network

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

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • start corpus 388 (elastic 388)
field:"EventType" kind:eq value:"start"
process.command_linewildcard
  • *:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup\*
  • *:\Users\*\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\*
field:"CommandLine" kind:wildcard
process.executablewildcard
  • ?:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup\*
  • ?:\Users\*\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\*
field:"Image" kind:wildcard
process.namewildcard
  • cscript.exe corpus 68 (elastic 66, splunk 2)
  • mshta.exe corpus 84 (elastic 80, splunk 4)
  • powershell.exe corpus 187 (elastic 140, splunk 44, kusto 3)
  • wscript.exe corpus 84 (elastic 82, splunk 1, kusto 1)
field:"process_basename" kind:wildcard

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.hash.sha256eqcac904da410372bcd0797b4bfa402c8f8663040f26e80a435d98d12bd2fa6659excludes:process.hash.sha256 field:"process.hash.sha256" value:"cac904da410372bcd0797b4bfa402c8f8663040f26e80a435d98d12bd2fa6659"
destination.ipcidr_match10.0.0.0/8, 127.0.0.0/8, 169.254.0.0/16, 172.16.0.0/12, 192.0.0.0/24, 192.0.0.0/29, 192.0.0.8/32, 192.0.0.9/32, 192.0.0.10/32, 192.0.0.170/32, 192.0.0.171/32, 192.0.2.0/24, 192.31.196.0/24, 192.52.193.0/24, 192.88.99.0/24, 224.0.0.0/4, 100.64.0.0/10, 192.168.0.0/16, 192.175.48.0/24, 198.18.0.0/15, 198.51.100.0/24, 203.0.113.0/24, 240.0.0.0/4, ::1, FE80::/10, FF00::/8excludes:destination.ip

Outbound Network Connection Followed by Process File Deletion

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

This rule detects a network connection attempt to an external IP address followed by a file deletion event where the file path is the same as the process executable. This behavior may indicate an attempt to cover tracks by deleting the file used to establish the connection, and may be used by attackers to hide their tracks upon successfully establishing a connection to a C2 server.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
This rule detects a network connection attempt to an external IP address followed by a file deletion event where the
file path is the same as the process executable. This behavior may indicate an attempt to cover tracks by deleting the
file used to establish the connection, and may be used by attackers to hide their tracks upon successfully establishing
a connection to a C2 server.
"""
id = "e64787a1-801e-48d2-a09e-d474bba68197"
license = "Elastic License v2"
name = "Outbound Network Connection Followed by Process File Deletion"
os_list = ["linux"]
version = "1.0.7"

query = '''
sequence by process.parent.entity_id with maxspan=10s
  [network where event.type == "start" and event.action == "connection_attempted" and
   process.executable like ("/tmp/*", "/var/tmp/*", "/dev/shm/*") and
   not (
     destination.ip == null or destination.ip == "0.0.0.0" or cidrmatch(
     destination.ip, "10.0.0.0/8", "127.0.0.0/8", "169.254.0.0/16", "172.16.0.0/12", "192.0.0.0/24", "192.0.0.0/29",
     "192.0.0.8/32", "192.0.0.9/32", "192.0.0.10/32", "192.0.0.170/32", "192.0.0.171/32", "192.0.2.0/24",
     "192.31.196.0/24", "192.52.193.0/24", "192.168.0.0/16", "192.88.99.0/24", "224.0.0.0/4", "100.64.0.0/10",
     "192.175.48.0/24","198.18.0.0/15", "198.51.100.0/24", "203.0.113.0/24", "240.0.0.0/4", "::1", "FE80::/10",
     "FF00::/8"
     ) or
     process.executable like (
       "/tmp/regctl", "/tmp/token_handler", "/tmp/tmp.*/juliainstaller", "/tmp/tmp.*/rustup-init",
       "/tmp/tmp.*/elan-init", "/var/tmp/tmp.*/rustup-init", "/tmp/SophosCentralInstall*/bin/telemetry",
       "/tmp/bdconfigure.*/bdconfigure64", "/tmp/nanolayer*/nanolayer", "/tmp/tmp.*/pgp-file-protect",
       "/tmp/tmp.*/rover", "/tmp/tmp.*/sq-ccm", "/tmp/trizen-fric/jfrog-cli/src/jfrog-cli-*/jf",
       "/var/tmp/sdcss_Uninstalltelemetry/seticli", "/tmp/tmp.*/goreleaser", "/var/tmp/tmp.*/hab-x86_64-linux/hab",
       "/tmp/buildroot-*/python/bin/python*", "/tmp/confluent"
     )
   )] as event0
  [file where event.type == "deletion" and process.name == "rm" and startswith~(file.path, event0.process.executable)]
'''

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



[threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1071"
name = "Application Layer Protocol"
reference = "https://attack.mitre.org/techniques/T1071/"


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

[internal]
min_endpoint_version = "8.6.0"

Stages and Predicates

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

Stage 1: network

[network where event.type == "start" and event.action == "connection_attempted" and
   process.executable like ("/tmp/*", "/var/tmp/*", "/dev/shm/*") and
   not (
     destination.ip == null or destination.ip == "0.0.0.0" or cidrmatch(
     destination.ip, "10.0.0.0/8", "127.0.0.0/8", "169.254.0.0/16", "172.16.0.0/12", "192.0.0.0/24", "192.0.0.0/29",
     "192.0.0.8/32", "192.0.0.9/32", "192.0.0.10/32", "192.0.0.170/32", "192.0.0.171/32", "192.0.2.0/24",
     "192.31.196.0/24", "192.52.193.0/24", "192.168.0.0/16", "192.88.99.0/24", "224.0.0.0/4", "100.64.0.0/10",
     "192.175.48.0/24","198.18.0.0/15", "198.51.100.0/24", "203.0.113.0/24", "240.0.0.0/4", "::1", "FE80::/10",
     "FF00::/8"
     ) or
     process.executable like (
       "/tmp/regctl", "/tmp/token_handler", "/tmp/tmp.*/juliainstaller", "/tmp/tmp.*/rustup-init",
       "/tmp/tmp.*/elan-init", "/var/tmp/tmp.*/rustup-init", "/tmp/SophosCentralInstall*/bin/telemetry",
       "/tmp/bdconfigure.*/bdconfigure64", "/tmp/nanolayer*/nanolayer", "/tmp/tmp.*/pgp-file-protect",
       "/tmp/tmp.*/rover", "/tmp/tmp.*/sq-ccm", "/tmp/trizen-fric/jfrog-cli/src/jfrog-cli-*/jf",
       "/var/tmp/sdcss_Uninstalltelemetry/seticli", "/tmp/tmp.*/goreleaser", "/var/tmp/tmp.*/hab-x86_64-linux/hab",
       "/tmp/buildroot-*/python/bin/python*", "/tmp/confluent"
     )
   )] as event0

Stage 2: file

[file where event.type == "deletion" and process.name == "rm" and startswith~(file.path, event0.process.executable)]

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
destination.ipcidr_match10.0.0.0/8, 127.0.0.0/8, 169.254.0.0/16, 172.16.0.0/12, 192.0.0.0/24, 192.0.0.0/29, 192.0.0.8/32, 192.0.0.9/32, 192.0.0.10/32, 192.0.0.170/32, 192.0.0.171/32, 192.0.2.0/24, 192.31.196.0/24, 192.52.193.0/24, 192.168.0.0/16, 192.88.99.0/24, 224.0.0.0/4, 100.64.0.0/10, 192.175.48.0/24, 198.18.0.0/15, 198.51.100.0/24, 203.0.113.0/24, 240.0.0.0/4, ::1, FE80::/10, FF00::/8excludes:destination.ip
destination.ipeq0.0.0.0excludes:destination.ip field:"destination.ip" value:"0.0.0.0"
destination.ipis_null(no value, null check)excludes:destination.ip
process.executablewildcard/tmp/regctl, /tmp/token_handler, /tmp/tmp.*/juliainstaller, /tmp/tmp.*/rustup-init, /tmp/tmp.*/elan-init, /var/tmp/tmp.*/rustup-init, /tmp/SophosCentralInstall*/bin/telemetry, /tmp/bdconfigure.*/bdconfigure64, /tmp/nanolayer*/nanolayer, /tmp/tmp.*/pgp-file-protect, /tmp/tmp.*/rover, /tmp/tmp.*/sq-ccm, /tmp/trizen-fric/jfrog-cli/src/jfrog-cli-*/jf, /var/tmp/sdcss_Uninstalltelemetry/seticli, /tmp/tmp.*/goreleaser, /var/tmp/tmp.*/hab-x86_64-linux/hab, /tmp/buildroot-*/python/bin/python*, /tmp/confluentexcludes:process.executable

Potential Credential Access via Trusted Developer Utility

#
Status
production
Severity
high
Sequence by
process.entity_id
Author
Elastic
Source
github.com/elastic/detection-rules

An instance of MSBuild, the Microsoft Build Engine, loaded DLLs (dynamically linked libraries) responsible for Windows credential management. This technique is sometimes used for credential dumping.

Known False Positives

  • The Build Engine is commonly used by Windows developers but use by non-engineers is unusual.

MITRE ATT&CK Coverage

Telemetry Coverage

Rule Body

[metadata]
creation_date = "2020/03/25"
integration = ["endpoint", "windows"]
maturity = "production"
updated_date = "2026/04/22"

[rule]
author = ["Elastic"]
description = """
An instance of MSBuild, the Microsoft Build Engine, loaded DLLs (dynamically linked libraries) responsible for Windows
credential management. This technique is sometimes used for credential dumping.
"""
false_positives = ["The Build Engine is commonly used by Windows developers but use by non-engineers is unusual."]
from = "now-9m"
index = [
    "winlogbeat-*",
    "logs-endpoint.events.process-*",
    "logs-endpoint.events.library-*",
    "logs-windows.sysmon_operational-*",
]
language = "eql"
license = "Elastic License v2"
name = "Potential Credential Access via Trusted Developer Utility"
references = [
    "https://lolbas-project.github.io/lolbas/Binaries/Msbuild/",
]
risk_score = 73
rule_id = "9d110cb3-5f4b-4c9a-b9f5-53f0a1707ae5"
severity = "high"
tags = [
    "Domain: Endpoint",
    "OS: Windows",
    "Use Case: Threat Detection",
    "Tactic: Credential Access",
    "Tactic: Defense Evasion",
    "Resources: Investigation Guide",
    "Data Source: Elastic Defend",
    "Data Source: Sysmon",
]
timestamp_override = "event.ingested"
type = "eql"

query = '''
sequence by process.entity_id
 [process where host.os.type == "windows" and event.type == "start" and (process.name : "MSBuild.exe" or process.pe.original_file_name == "MSBuild.exe")]
 [library where host.os.type == "windows" and dll.name : ("vaultcli.dll", "SAMLib.DLL")]
'''

note = """## Triage and analysis

### Investigating Potential Credential Access via Trusted Developer Utility

#### Possible investigation steps

- What do the matched source events show about the MSBuild instance?
  - Focus: Timeline source events for `process.entity_id` -- the start-event `process.executable` and `process.command_line` plus the library-stage `dll.path`.
  - Implication: more concerning when MSBuild loads vaultcli.dll or SAMLib.dll from an unusual path or unexpected context; more explainable when Timeline shows a recognized build task loading the library from the default Windows system directory.

- Is the MSBuild binary and launch chain expected for this host?
  - Focus: `process.executable`, `process.pe.original_file_name`, `process.code_signature.subject_name`, and `process.parent.executable`.
  - Implication: more concerning when MSBuild is renamed, unsigned, user-writable, outside expected .NET Framework or Visual Studio build roots, or launched by Office, a script host, an archive utility, or another unexpected parent.

- Does the command line or project path suggest transient or user-delivered build content?
  - Focus: `process.command_line` and `process.working_directory`, especially .csproj, .xml, .proj, /logger, or @ response-file paths in temp folders, downloads, removable media, user-profile paths, or network shares.
  - Implication: supports concern when MSBuild runs user-delivered project content, logger DLLs, response files, or inline tasks outside normal compilation; less suspicious when the project resides in a stable source-tree or CI workspace and the build arguments match a recurring compilation pattern.

- Does the loaded credential library path, trust, and recency fit legitimate development behavior?
  - Focus: `dll.name`, `dll.path`, `dll.code_signature.trusted`, and `dll.Ext.relative_file_creation_time`.
  - Implication: supports concern when vaultcli or SAMLib loads from user-writable or transient paths, arrives unsigned, or was created shortly before the load; weaker support when the path is the expected Windows system directory and project context supports a recognized credential-management test.

- Do file writes or child processes show MSBuild acting as a launcher instead of a compiler?
  - Focus: file activity from `process.entity_id`: written `file.path` values, especially payloads, scripts, or compiled artifacts in user-writable paths. $investigate_2
  - Hint: review child starts where `process.parent.entity_id` equals the MSBuild entity; shell or script-engine children are stronger than normal compiler toolchain children. $investigate_3
  - Implication: suggests proxy execution when MSBuild drops payloads, stages scripts or compiled artifacts, or spawns shells or script engines. Missing file telemetry is unresolved, not benign.

- Do MSBuild or its child processes attempt off-host staging?
  - Focus: same-host connection events for the MSBuild `process.entity_id` or direct children where `process.parent.entity_id` matches the MSBuild entity, with `destination.ip` and `destination.port`. $investigate_4
  - Implication: supports containment when suspicious project, DLL, file, or child-process evidence is followed by outbound staging; missing network telemetry is unresolved, not benign.

- Does the user and host context fit developer or build-runner activity?
  - Focus: `user.id`, `user.domain`, `process.Ext.session_info.logon_type`, `host.id`, and `host.name`; compare prior source events for the same user-host cohort.
  - Implication: risk rises when the user-host pair has no recurring build-tool history or when the session type is unexpected; lower only when the user, host, session, and source events fit a bounded developer or build-service pattern.

- If local MSBuild evidence is still suspicious, does related alert history show the same user or host reusing trusted-utility abuse patterns?
  - Focus: related alerts for `user.id`, especially trusted-utility abuse, credential access, lateral movement, or launches of "InstallUtil", "RegAsm", "MSHTA", or similar signed proxies; inspect their source events before comparing project paths or destinations. $investigate_0
  - Hint: compare `host.id` alert history to assess whether activity is confined to this asset. $investigate_1
  - Implication: suggests broader scope when the same user or host shows trusted-utility abuse, persistence, staging, or credential-access alerts; stays localized when history is limited to the same recognized build or test workflow on this asset.

- Escalate when MSBuild identity, project path, loaded library, follow-on behavior, user-host context, or alert scope show unrecognized use, credential-library loads from non-standard paths, or payload behavior; close only when all jointly fit a recognized build or test scenario; preserve and escalate when evidence is mixed or visibility incomplete.

### False positive analysis

- Authorized credential-management tests, security-tool validation, or build pipelines compiling code that uses Windows credential APIs can legitimately trigger vaultcli.dll or SAMLib.dll loads. Confirm only when `process.command_line`, project path, `dll.path`, `process.executable`, `process.parent.executable`, `user.id`, and `host.id` align with that same recognized lab or build-pipeline workflow. If records are unavailable, require the same process-identity fields, loaded `dll.path`, and `user.id`/`host.id` to recur across prior alerts before treating the activity as benign.
- Before creating an exception, validate that `process.executable`, `process.code_signature.subject_name`, `process.parent.executable`, stable `process.command_line` pattern, loaded `dll.path`, `user.id`, and `host.id` recur across prior alerts from this rule. Build the exception from that minimum confirmed workflow pattern. Avoid exceptions on `process.name` alone, the library name alone, or the host alone.

### Response and remediation

- If confirmed benign, reverse temporary containment and record the confirmed explanation in `process.executable`, `process.parent.executable`, project path from `process.command_line`, loaded `dll.path`, `user.id`, and `host.id`. Create an exception only if that same pattern recurs consistently across prior alerts from this rule.
- If suspicious but unconfirmed, preserve a case export for the recovered MSBuild process, its command line, project/task files, loaded credential DLL, dropped artifacts, child-process lineage, and confirmed destinations. Apply reversible containment first -- temporary destination restrictions or heightened monitoring on `host.id` and `user.id` -- and escalate to host isolation only when preserved evidence shows meaningful staging or payload risk.
- If confirmed malicious, use endpoint response actions to isolate the host and terminate MSBuild or its staging child processes after preserving the recovered MSBuild and parent entity IDs, project files, compiled artifacts, child processes, confirmed destinations, and loaded DLL path. If direct endpoint response is unavailable, hand off that artifact set immediately to the team that can isolate the host or block the destinations.
- Eradicate the malicious project files, inline tasks, payloads, persistence artifacts, and secondary tooling uncovered during the investigation, then remediate the delivery or execution-control gap that allowed MSBuild to proxy the credential-access behavior.
- Investigate credential exposure based on what the project targeted: review Windows Credential Manager, saved secrets, and local-account exposure on the host, and rotate or revoke affected credentials according to the recovered artifacts and follow-on activity.
- Review related hosts for the same project-path pattern, library-load combination, child-process behavior, and adjacent trusted-developer-utility abuse before deleting files or removing tooling, and retain process, library, file, and network telemetry needed for future cases.
"""

setup = """## Setup

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

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

### Additional data sources

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

- [Sysmon Event ID 1 - Process Creation](https://ela.st/sysmon-event-1-setup)
- [Sysmon Event ID 7 - Image Loaded](https://ela.st/sysmon-event-7-setup)
"""

[rule.investigation_fields]
field_names = [
    "@timestamp",
    "host.id",
    "user.name",
    "user.id",
    "process.entity_id",
    "process.executable",
    "process.command_line",
    "process.working_directory",
    "process.parent.executable",
    "process.code_signature.subject_name",
    "process.Ext.session_info.logon_type",
    "dll.name",
    "dll.path",
    "dll.code_signature.trusted",
    "dll.Ext.relative_file_creation_time",
]

[[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 = "File activity for the MSBuild process and children"
description = ""
providers = [
  [
    { excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" },
    { excluded = false, field = "process.entity_id", queryType = "phrase", value = "{{process.entity_id}}", valueType = "string" },
    { excluded = false, field = "event.category", queryType = "phrase", value = "file", valueType = "string" }
  ],
  [
    { excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" },
    { excluded = false, field = "process.parent.entity_id", queryType = "phrase", value = "{{process.entity_id}}", valueType = "string" },
    { excluded = false, field = "event.category", queryType = "phrase", value = "file", valueType = "string" }
  ]
]
relativeFrom = "now-1h"
relativeTo = "now"

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

[[transform.investigate]]
label = "Network activity for the MSBuild process and children"
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" }
  ],
  [
    { excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" },
    { excluded = false, field = "process.parent.entity_id", queryType = "phrase", value = "{{process.entity_id}}", valueType = "string" },
    { excluded = false, field = "event.category", queryType = "phrase", value = "network", valueType = "string" }
  ]
]
relativeFrom = "now-1h"
relativeTo = "now"

[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1003"
name = "OS Credential Dumping"
reference = "https://attack.mitre.org/techniques/T1003/"
[[rule.threat.technique.subtechnique]]
id = "T1003.002"
name = "Security Account Manager"
reference = "https://attack.mitre.org/techniques/T1003/002/"

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

[rule.threat.tactic]
id = "TA0006"
name = "Credential Access"
reference = "https://attack.mitre.org/tactics/TA0006/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "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.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"

Stages and Predicates

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

Stage 1: process

[process where host.os.type == "windows" and event.type == "start" and (process.name : "MSBuild.exe" or process.pe.original_file_name == "MSBuild.exe")]

Stage 2: library

[library where host.os.type == "windows" and dll.name : ("vaultcli.dll", "SAMLib.DLL")]

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
dll.namewildcard
  • SAMLib.DLL corpus 2 (elastic 2)
  • vaultcli.dll corpus 8 (elastic 8)
field:"dll.name" kind:wildcard
event.typeeq
  • start corpus 1036 (elastic 1036)
field:"event.type" kind:eq value:"start"
process.namewildcard
  • MSBuild.exe corpus 39 (elastic 36, splunk 3)
field:"process_basename" kind:wildcard value:"MSBuild.exe"
process.pe.original_file_nameeq
  • MSBuild.exe corpus 4 (elastic 4)
field:"OriginalFileName" kind:eq value:"MSBuild.exe"

Potential Privilege Escalation via Python Exploit

#
Source
github.com/elastic/protections-artifacts

Detects a UID change event to 0 (root) where the responsible process is a Python interpreter running from a user- or world-writeable working directory and the parent process is non-root. This may be indicative of a local privilege escalation exploit executed via Python.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
Detects a UID change event to 0 (root) where the responsible process is a Python interpreter running from a user- or
world-writeable working directory and the parent process is non-root. This may be indicative of a local privilege
escalation exploit executed via Python.
"""
id = "c07d8af8-b688-4299-a3f7-2622a16913bf"
license = "Elastic License v2"
name = "Potential Privilege Escalation via Python Exploit"
os_list = ["linux"]
reference = [
    "https://research.jfrog.com/post/dissecting-and-exploiting-linux-lpe-variant-dirtyclone-cve-2026-43503/",
    "https://github.com/mooder1/dirtyclone-CVE-2026-43503",
]
version = "1.0.2"

query = '''
process where event.type == "change" and event.action == "uid_change" and
user.id == 0 and process.parent.user.id != 0 and process.parent.group.id != 0 and
process.name like "python*" and process.args like "*.py" and
process.working_directory like ("/tmp*", "/dev/shm*", "/var/tmp*", "/home/*", "/run/user*", "/var/run/user*") and
process.parent.working_directory like ("/tmp*", "/dev/shm*", "/var/tmp*", "/home/*", "/run/user*", "/var/run/user*") and
not (
  process.interactive == false or
  process.args like ("/usr/lib/linuxmint/mintUpdate/mintUpdate.py", "/home/*/.ansible/tmp/ansible-tmp-*.py") or
  process.executable like (
   "/sw/eb/sw/Python/*-GCCcore-*/bin/python*", "/home/*/*/anaconda3/envs/*/bin/python*", "/scratch/*/python*",
   "/home/*/.local/share/uv/python/cpython-*-linux-x86_64-gnu/bin/python*"
  ) or
  (
    process.working_directory like "/home/*/openmc/atr-model" and
    process.parent.executable like "/scratch/*/.conda/envs/openmc-env/bin/python*" and
    process.command_line == "python core_model.py"
  ) or
  process.parent.args like ("/home/agent/Claude/Project/Patches/venv/bin/python3*", "/usr/share/cinnamon/cinnamon-settings/cinnamon-settings.py")
)
'''

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

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

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

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



[threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1068"
name = "Exploitation for Privilege Escalation"
reference = "https://attack.mitre.org/techniques/T1068/"


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

[internal]
min_endpoint_version = "8.2.0"

Stages and Predicates

Stage 1: process

process where event.type == "change" and event.action == "uid_change" and
user.id == 0 and process.parent.user.id != 0 and process.parent.group.id != 0 and
process.name like "python*" and process.args like "*.py" and
process.working_directory like ("/tmp*", "/dev/shm*", "/var/tmp*", "/home/*", "/run/user*", "/var/run/user*") and
process.parent.working_directory like ("/tmp*", "/dev/shm*", "/var/tmp*", "/home/*", "/run/user*", "/var/run/user*") and
not (
  process.interactive == false or
  process.args like ("/usr/lib/linuxmint/mintUpdate/mintUpdate.py", "/home/*/.ansible/tmp/ansible-tmp-*.py") or
  process.executable like (
   "/sw/eb/sw/Python/*-GCCcore-*/bin/python*", "/home/*/*/anaconda3/envs/*/bin/python*", "/scratch/*/python*",
   "/home/*/.local/share/uv/python/cpython-*-linux-x86_64-gnu/bin/python*"
  ) or
  (
    process.working_directory like "/home/*/openmc/atr-model" and
    process.parent.executable like "/scratch/*/.conda/envs/openmc-env/bin/python*" and
    process.command_line == "python core_model.py"
  ) or
  process.parent.args like ("/home/agent/Claude/Project/Patches/venv/bin/python3*", "/usr/share/cinnamon/cinnamon-settings/cinnamon-settings.py")
)

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.command_lineeqpython core_model.pyexcludes:process.command_line field:"process.command_line" value:"python core_model.py"
process.parent.executablewildcard/scratch/*/.conda/envs/openmc-env/bin/python*excludes:process.parent.executable field:"process.parent.executable" value:"/scratch/*/.conda/envs/openmc-env/bin/python*"
process.working_directorywildcard/home/*/openmc/atr-modelexcludes:process.working_directory field:"process.working_directory" value:"/home/*/openmc/atr-model"
process.argswildcard/usr/lib/linuxmint/mintUpdate/mintUpdate.py, /home/*/.ansible/tmp/ansible-tmp-*.pyexcludes:process.args field:"process.args" value:"/usr/lib/linuxmint/mintUpdate/mintUpdate.py" field:"process.args" value:"/home/*/.ansible/tmp/ansible-tmp-*.py"
process.executablewildcard/sw/eb/sw/Python/*-GCCcore-*/bin/python*, /home/*/*/anaconda3/envs/*/bin/python*, /scratch/*/python*, /home/*/.local/share/uv/python/cpython-*-linux-x86_64-gnu/bin/python*excludes:process.executable
process.interactiveeqfalseexcludes:process.interactive field:"process.interactive" value:"false"
process.parent.argswildcard/home/agent/Claude/Project/Patches/venv/bin/python3*, /usr/share/cinnamon/cinnamon-settings/cinnamon-settings.pyexcludes:process.parent.args field:"process.parent.args" value:"/home/agent/Claude/Project/Patches/venv/bin/python3*" field:"process.parent.args" value:"/usr/share/cinnamon/cinnamon-settings/cinnamon-settings.py"

Potential release_agent Container Escape Detected via Defend for Containers

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

This rule detects modification of the CGroup release_agent file from inside a privileged container. The release_agent is a script that is executed at the termination of any process on that CGroup and is invoked from the host. A privileged container with SYS_ADMIN capabilities, enables a threat actor to mount a CGroup directory and modify the release_agent which could be used for further privilege escalation and container escapes to the host machine.

MITRE ATT&CK Coverage

Rule Body

[metadata]
creation_date = "2023/10/26"
integration = ["cloud_defend"]
maturity = "production"
min_stack_comments = "Defend for Containers integration was re-introduced in 9.3.0"
min_stack_version = "9.3.0"
updated_date = "2026/07/29"

[rule]
author = ["Elastic"]
description = """
This rule detects modification of the CGroup release_agent file from inside a privileged container. The release_agent is
a script that is executed at the termination of any process on that CGroup and is invoked from the host. A privileged
container with SYS_ADMIN capabilities, enables a threat actor to mount a CGroup directory and modify the release_agent
which could be used for further privilege escalation and container escapes to the host machine.
"""
from = "now-6m"
index = ["logs-cloud_defend.file*"]
interval = "5m"
language = "eql"
license = "Elastic License v2"
name = "Potential release_agent Container Escape Detected via Defend for Containers"
note = """## Setup

## 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 release_agent Container Escape Detected via Defend for Containers

In containerized environments, the release_agent file in CGroup directories can execute scripts upon process termination. Adversaries exploit this by modifying the file from privileged containers, potentially escalating privileges or escaping to the host. The detection rule monitors changes to the release_agent file, flagging unauthorized modifications indicative of such exploits.

### Possible investigation steps

- Identify the container from which the modification attempt originated, focusing on whether it has SYS_ADMIN capabilities, which could indicate a privileged container.
- Check the history of the release_agent file for any recent changes or modifications, including timestamps and user accounts involved, to understand the context of the modification.
- Investigate the processes running within the container at the time of the alert to identify any suspicious or unauthorized activities that could be related to privilege escalation attempts.
- Examine the network activity and connections from the container to detect any unusual outbound traffic that might suggest an attempt to communicate with external systems or exfiltrate data.
- Review system logs and audit logs on the host for any signs of unauthorized access or privilege escalation attempts that coincide with the alert timestamp.
- Assess the security posture of the container environment, including the configuration of CGroup directories and permissions, to identify potential vulnerabilities that could be exploited for container escape.

### False positive analysis

- Routine maintenance scripts or system updates may modify the release_agent file without malicious intent. Users can create exceptions for known maintenance activities by identifying the specific processes or scripts involved and excluding them from the rule.
- Automated container management tools might access and modify the release_agent file as part of their normal operations. Users should verify the legitimacy of these tools and whitelist their actions to prevent unnecessary alerts.
- Custom container orchestration solutions could interact with the release_agent file for legitimate reasons. Users should document these interactions and configure the rule to ignore changes made by these trusted solutions.
- Development and testing environments often involve frequent changes to container configurations, including the release_agent file. Users can reduce false positives by setting up separate monitoring profiles for these environments, allowing more lenient detection thresholds.

### Response and remediation

- Immediately isolate the affected container to prevent further unauthorized actions or potential spread to other containers or the host system.
- Revoke SYS_ADMIN capabilities from the container to limit its ability to modify critical system files and directories.
- Conduct a thorough review of the modified release_agent file to identify any malicious scripts or commands that may have been inserted.
- Restore the release_agent file to its original state from a known good backup to ensure no unauthorized scripts are executed.
- Investigate the source of the privilege escalation to determine how the adversary gained SYS_ADMIN capabilities and address any security gaps.
- Escalate the incident to the security operations team for further analysis and to assess the potential impact on the host system.
- Implement additional monitoring and alerting for changes to critical files and directories within privileged containers to enhance detection of similar threats in the future."""
references = [
    "https://blog.aquasec.com/threat-alert-container-escape",
    "https://sysdig.com/blog/detecting-mitigating-cve-2022-0492-sysdig/",
    "https://book.hacktricks.xyz/linux-hardening/privilege-escalation/docker-security/docker-breakout-privilege-escalation#privileged-escape-abusing-existent-release_agent-cve-2022-0492-poc1",
]
risk_score = 47
rule_id = "160896de-b66f-42cb-8fef-20f53a9006ea"
severity = "medium"
tags = [
    "Data Source: Elastic Defend for Containers",
    "Domain: Container",
    "OS: Linux",
    "Use Case: Threat Detection",
    "Tactic: Privilege Escalation",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
file where host.os.type == "linux" and event.type == "change" and event.action == "open" and
file.name == "release_agent" and container.id like "*"
'''

[[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 = "T1546"
name = "Event Triggered Execution"
reference = "https://attack.mitre.org/techniques/T1546/"

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

Stages and Predicates

Stage 1: file

file where host.os.type == "linux" and event.type == "change" and event.action == "open" and
file.name == "release_agent" and container.id like "*"

Indicators

These rows show field, operator, and value matches.

Privilege Escalation Enumeration via LinPEAS

#
Source
github.com/elastic/protections-artifacts

Identifies suspicious command line patterns that indicate LinPEAS execution. LinPEAS is a script that searches for possible paths to escalate privileges on Linux/Unix/MacOS hosts.

MITRE ATT&CK Coverage

Telemetry Coverage

Rule Body

[rule]
description = """
Identifies suspicious command line patterns that indicate LinPEAS execution. LinPEAS is a script that searches for
possible paths to escalate privileges on Linux/Unix/MacOS hosts.
"""
id = "92bb2a27-745b-4291-90a1-b7b654df1379"
license = "Elastic License v2"
name = "Privilege Escalation Enumeration via LinPEAS"
os_list = ["linux", "macos"]
reference = ["https://github.com/carlospolop/PEASS-ng/tree/master/linPEAS"]
version = "1.0.32"

query = '''
process where event.action == "exec" and
  process.name == "sed" and process.command_line like "*ImPoSSssSiBlEee*"
'''

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

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

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



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

[internal]
min_endpoint_version = "7.15.0"

Stages and Predicates

Stage 1: process

process where event.action == "exec" and
  process.name == "sed" and process.command_line like "*ImPoSSssSiBlEee*"

Indicators

These rows show field, operator, and value matches.

Sensitive File Access via Perl

#
Source
github.com/elastic/protections-artifacts

Detects when Perl accesses sensitive files. Perl is a scripting language that comes pre-installed on macOS and can be abused by adversaries for credential access.

MITRE ATT&CK Coverage

Telemetry Coverage

Rule Body

[rule]
description = """
Detects when Perl accesses sensitive files. Perl is a scripting language that comes pre-installed on macOS and can be
abused by adversaries for credential access.
"""
id = "7d5a6969-3da8-4b41-a016-87077f49fb1c"
license = "Elastic License v2"
name = "Sensitive File Access via Perl"
os_list = ["macos"]
version = "1.0.3"

query = '''
file where event.action == "open" and (process.name == "perl" or Effective_process.name == "perl")
'''

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

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

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



[threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1552"
name = "Unsecured Credentials"
reference = "https://attack.mitre.org/techniques/T1552/"
[[threat.technique.subtechnique]]
id = "T1552.001"
name = "Credentials In Files"
reference = "https://attack.mitre.org/techniques/T1552/001/"



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

[internal]
min_endpoint_version = "8.16.0"

Stages and Predicates

Stage 1: file

file where event.action == "open" and (process.name == "perl" or Effective_process.name == "perl")

Indicators

These rows show field, operator, and value matches.

Sleep Execution from Suspicious Process Path

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

This rule detects the execution of the sleep command from a world-writeable directory or hidden process executable. Attackers may use sleep to delay execution of malicious code.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
This rule detects the execution of the sleep command from a world-writeable directory or hidden process executable.
Attackers may use sleep to delay execution of malicious code.
"""
id = "9e879677-2317-4c1d-bddb-8fa4629be810"
license = "Elastic License v2"
name = "Sleep Execution from Suspicious Process Path"
os_list = ["linux"]
version = "1.0.21"

query = '''
sequence by process.parent.entity_id with maxspan=5s
  [process where event.type == "start" and event.action == "exec" and process.parent.executable != null and
  (process.executable like ("/tmp/*", "/var/tmp/*", "/dev/shm/*") or process.name like ".*") and not (
    process.executable like~ (
      "/tmp/newroot/*", "/tmp/JobScheduler-Agent*", "/tmp/petalinux_*", "/tmp/plz_sandbox/third_party/*", "/var/tmp/buildah*",
      "/infanspr/scripts/.root/.infans-daily-server-script", "/tmp/.mount_jetbrap*", "/tmp/snap.rootfs_*", "/tmp/ubuntu-release-upgrader-*",
      "/tmp/tmp.*/.venv/bin/pytest", "/tmp/par-*/castnet_webserver", "/tmp/build/.heroku/node/bin/node",
      "/tmp/.ansible*", "/tmp/*/com.service_now*", "/tmp/*/easybuild/*", "/nix/store/*", "/tmp/tmp.*/ijent",
      "/tmp/*/.venv/bin/python", "/tmp/text_templater_*", "/var/tmp/container*/usr/bin/dpkg", "/tmp/container*/usr/bin/dpkg",
      "/run/systemd/mount-rootfs/nix/store/*", "/tmp/xfs-*/yarn", "/tmp/root/spack*", "/tmp/nix-shell-*/node",
      "/tmp/nix-shell-*/yarn", "/var/tmp/portage/*", "/tmp/.*.ansible/ansible-tmp-*", "/tmp/nsjail.1000.root/usr/bin/sleep",
      "/tmp/usr/bin/*", "/tmp/build/.heroku/node/bin/npm", "/tmp/petalinux/*", "/tmp/tailsampling-*", "/tmp/*/.cursor-server/bin/linux-x64/*/node",
      "/tmp/cursor-server-cache/bin/linux-x64/*/node", "/tmp/*/.vscode-server/code-*", "/tmp/*-cursor-server/bin/linux-x64/*/node",
      "/tmp/.mount_Cursor*/usr/share/cursor/resources/app/node_modules/@vscode/ripgrep/bin/rg", "/tmp/install.dir.*/Linux/resource/jre/lib/jspawnhelper",
      "/tmp/gomod-overlay/merged/golang.org/*/bin/go", "/tmp/tmp.*/amfu/bin/cinsh", "/tmp/nagent_install/nagent-ubuntu22_64/InitialValidate",
      "/tmp/arcane-install*", "/tmp/p11_keepalive.*/p11_signer", "/tmp/iperf3-extract/usr/bin/iperf3", "/tmp/ventoy-install.*/tool/x86_64/vtoycli",
      "/tmp/odindash-build", "/tmp/snap-private-tmp/snap.rootfs_*", "/tmp/CSFFC/*", "*/.vscode-server/bin/*/bin/code-server", "*/.vscode-server/code-*"
    ) or
    process.command_line == "runc init" or
    process.name in ("gcc", "xgcc", "nvim") or
    process.parent.name == "ansible" or
    process.working_directory like (
      "/build", "/tmp/newroot/*", "/tmp/plz_sandbox", "/tmp/.build/*", "/tmp/tmp/bwrap*", "/jenkins/workspace/*",
      "/var/lib/waagent/*", "/tmp/plz_sandbox/*", "/builds/*", "/opt/bmc/bladelogic/RSCD", "/var/lib/one"
    ) or
    process.parent.executable like (
      "/tmp/go-build*", "/tmp/newroot/tmp/.mount*", "/var/lib/containers/*", "/tmp/newroot/usr/bin/ansible-playbook",
      "/usr/bin/ansible-playbook", "/tmp/newroot/*", "/tmp/.mount_cursor*/cursorsandbox", "/usr/local/bin/crush",
      "./usr/bin/podman", "/usr/bin/podman", "/tmp/*/.vscode-server/extensions/openai.chatgpt-*/bin/*/codex-resources/*"
    ) or
    process.parent.args like ("source /home/*/.claude/shell-snapshots/snapshot-bash*", "/var/ossec/bin/wazuh-control") or
    process.parent.command_line like ("*github.com/community-scripts/ProxmoxVE/*", "*/home/*/.claude/shell-snapshots/snapshot*") or
    process.parent.command_line == "bash -c while true; do sleep 1;head -v -n 8 /proc/meminfo; head -v -n 2 /proc/stat /proc/version /proc/uptime /proc/loadavg /proc/sys/fs/file-nr /proc/sys/kernel/hostname; tail -v -n 32 /proc/net/dev;echo '==> /proc/df <==';df -l;echo '==> /proc/who <==';who;echo '==> /proc/end <==';echo '##Moba##'; done" or
    (process.executable == "/tmp/confluent" and process.parent.args like "./ci/e2e/tests/*")
  )]
  [process where event.type == "start" and event.action == "exec" and process.name == "sleep"]
'''

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

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



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

[internal]
min_endpoint_version = "7.15.0"

Stages and Predicates

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

Stage 1: process

[process where event.type == "start" and event.action == "exec" and process.parent.executable != null and
  (process.executable like ("/tmp/*", "/var/tmp/*", "/dev/shm/*") or process.name like ".*") and not (
    process.executable like~ (
      "/tmp/newroot/*", "/tmp/JobScheduler-Agent*", "/tmp/petalinux_*", "/tmp/plz_sandbox/third_party/*", "/var/tmp/buildah*",
      "/infanspr/scripts/.root/.infans-daily-server-script", "/tmp/.mount_jetbrap*", "/tmp/snap.rootfs_*", "/tmp/ubuntu-release-upgrader-*",
      "/tmp/tmp.*/.venv/bin/pytest", "/tmp/par-*/castnet_webserver", "/tmp/build/.heroku/node/bin/node",
      "/tmp/.ansible*", "/tmp/*/com.service_now*", "/tmp/*/easybuild/*", "/nix/store/*", "/tmp/tmp.*/ijent",
      "/tmp/*/.venv/bin/python", "/tmp/text_templater_*", "/var/tmp/container*/usr/bin/dpkg", "/tmp/container*/usr/bin/dpkg",
      "/run/systemd/mount-rootfs/nix/store/*", "/tmp/xfs-*/yarn", "/tmp/root/spack*", "/tmp/nix-shell-*/node",
      "/tmp/nix-shell-*/yarn", "/var/tmp/portage/*", "/tmp/.*.ansible/ansible-tmp-*", "/tmp/nsjail.1000.root/usr/bin/sleep",
      "/tmp/usr/bin/*", "/tmp/build/.heroku/node/bin/npm", "/tmp/petalinux/*", "/tmp/tailsampling-*", "/tmp/*/.cursor-server/bin/linux-x64/*/node",
      "/tmp/cursor-server-cache/bin/linux-x64/*/node", "/tmp/*/.vscode-server/code-*", "/tmp/*-cursor-server/bin/linux-x64/*/node",
      "/tmp/.mount_Cursor*/usr/share/cursor/resources/app/node_modules/@vscode/ripgrep/bin/rg", "/tmp/install.dir.*/Linux/resource/jre/lib/jspawnhelper",
      "/tmp/gomod-overlay/merged/golang.org/*/bin/go", "/tmp/tmp.*/amfu/bin/cinsh", "/tmp/nagent_install/nagent-ubuntu22_64/InitialValidate",
      "/tmp/arcane-install*", "/tmp/p11_keepalive.*/p11_signer", "/tmp/iperf3-extract/usr/bin/iperf3", "/tmp/ventoy-install.*/tool/x86_64/vtoycli",
      "/tmp/odindash-build", "/tmp/snap-private-tmp/snap.rootfs_*", "/tmp/CSFFC/*", "*/.vscode-server/bin/*/bin/code-server", "*/.vscode-server/code-*"
    ) or
    process.command_line == "runc init" or
    process.name in ("gcc", "xgcc", "nvim") or
    process.parent.name == "ansible" or
    process.working_directory like (
      "/build", "/tmp/newroot/*", "/tmp/plz_sandbox", "/tmp/.build/*", "/tmp/tmp/bwrap*", "/jenkins/workspace/*",
      "/var/lib/waagent/*", "/tmp/plz_sandbox/*", "/builds/*", "/opt/bmc/bladelogic/RSCD", "/var/lib/one"
    ) or
    process.parent.executable like (
      "/tmp/go-build*", "/tmp/newroot/tmp/.mount*", "/var/lib/containers/*", "/tmp/newroot/usr/bin/ansible-playbook",
      "/usr/bin/ansible-playbook", "/tmp/newroot/*", "/tmp/.mount_cursor*/cursorsandbox", "/usr/local/bin/crush",
      "./usr/bin/podman", "/usr/bin/podman", "/tmp/*/.vscode-server/extensions/openai.chatgpt-*/bin/*/codex-resources/*"
    ) or
    process.parent.args like ("source /home/*/.claude/shell-snapshots/snapshot-bash*", "/var/ossec/bin/wazuh-control") or
    process.parent.command_line like ("*github.com/community-scripts/ProxmoxVE/*", "*/home/*/.claude/shell-snapshots/snapshot*") or
    process.parent.command_line == "bash -c while true; do sleep 1;head -v -n 8 /proc/meminfo; head -v -n 2 /proc/stat /proc/version /proc/uptime /proc/loadavg /proc/sys/fs/file-nr /proc/sys/kernel/hostname; tail -v -n 32 /proc/net/dev;echo '==> /proc/df <==';df -l;echo '==> /proc/who <==';who;echo '==> /proc/end <==';echo '##Moba##'; done" or
    (process.executable == "/tmp/confluent" and process.parent.args like "./ci/e2e/tests/*")
  )]

Stage 2: process

[process where event.type == "start" and event.action == "exec" and process.name == "sleep"]

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.executableeq/tmp/confluentexcludes:process.executable field:"process.executable" value:"/tmp/confluent"
process.parent.argsstarts_with./ci/e2e/tests/excludes:process.parent.args field:"process.parent.args" value:"./ci/e2e/tests/"
process.command_lineeqrunc initexcludes:process.command_line field:"process.command_line" value:"runc init"
process.executablewildcard/tmp/newroot/*, /tmp/JobScheduler-Agent*, /tmp/petalinux_*, /tmp/plz_sandbox/third_party/*, /var/tmp/buildah*, /infanspr/scripts/.root/.infans-daily-server-script, /tmp/.mount_jetbrap*, /tmp/snap.rootfs_*, /tmp/ubuntu-release-upgrader-*, /tmp/tmp.*/.venv/bin/pytest, /tmp/par-*/castnet_webserver, /tmp/build/.heroku/node/bin/node, /tmp/.ansible*, /tmp/*/com.service_now*, /tmp/*/easybuild/*, /nix/store/*, /tmp/tmp.*/ijent, /tmp/*/.venv/bin/python, /tmp/text_templater_*, /var/tmp/container*/usr/bin/dpkg, /tmp/container*/usr/bin/dpkg, /run/systemd/mount-rootfs/nix/store/*, /tmp/xfs-*/yarn, /tmp/root/spack*, /tmp/nix-shell-*/node, /tmp/nix-shell-*/yarn, /var/tmp/portage/*, /tmp/.*.ansible/ansible-tmp-*, /tmp/nsjail.1000.root/usr/bin/sleep, /tmp/usr/bin/*, /tmp/build/.heroku/node/bin/npm, /tmp/petalinux/*, /tmp/tailsampling-*, /tmp/*/.cursor-server/bin/linux-x64/*/node, /tmp/cursor-server-cache/bin/linux-x64/*/node, /tmp/*/.vscode-server/code-*, /tmp/*-cursor-server/bin/linux-x64/*/node, /tmp/.mount_Cursor*/usr/share/cursor/resources/app/node_modules/@vscode/ripgrep/bin/rg, /tmp/install.dir.*/Linux/resource/jre/lib/jspawnhelper, /tmp/gomod-overlay/merged/golang.org/*/bin/go, /tmp/tmp.*/amfu/bin/cinsh, /tmp/nagent_install/nagent-ubuntu22_64/InitialValidate, /tmp/arcane-install*, /tmp/p11_keepalive.*/p11_signer, /tmp/iperf3-extract/usr/bin/iperf3, /tmp/ventoy-install.*/tool/x86_64/vtoycli, /tmp/odindash-build, /tmp/snap-private-tmp/snap.rootfs_*, /tmp/CSFFC/*, */.vscode-server/bin/*/bin/code-server, */.vscode-server/code-*excludes:process.executable
process.nameingcc, nvim, xgccexcludes:process.name field:"process.name" value:"gcc" field:"process.name" value:"nvim" field:"process.name" value:"xgcc"
process.parent.argswildcardsource /home/*/.claude/shell-snapshots/snapshot-bash*, /var/ossec/bin/wazuh-controlexcludes:process.parent.args field:"process.parent.args" value:"source /home/*/.claude/shell-snapshots/snapshot-bash*" field:"process.parent.args" value:"/var/ossec/bin/wazuh-control"
process.parent.command_lineeqbash -c while true; do sleep 1;head -v -n 8 /proc/meminfo; head -v -n 2 /proc/stat /proc/version /proc/uptime /proc/loadavg /proc/sys/fs/file-nr /proc/sys/kernel/hostname; tail -v -n 32 /proc/net/dev;echo '==> /proc/df <==';df -l;echo '==> /proc/who <==';who;echo '==> /proc/end <==';echo '##Moba##'; doneexcludes:process.parent.command_line field:"process.parent.command_line" value:"bash -c while true; do sleep 1;head -v -n 8 /proc/meminfo; head -v -n 2 /proc/stat /proc/version /proc/uptime /proc/loadavg /proc/sys/fs/file-nr /proc/sys/kernel/hostname; tail -v -n 32 /proc/net/dev;echo '==> /proc/df <==';df -l;echo '==> /proc/who <==';who;echo '==> /proc/end <==';echo '##Moba##'; done"
process.parent.command_linewildcard*github.com/community-scripts/ProxmoxVE/*, */home/*/.claude/shell-snapshots/snapshot*excludes:process.parent.command_line field:"process.parent.command_line" value:"*github.com/community-scripts/ProxmoxVE/*" field:"process.parent.command_line" value:"*/home/*/.claude/shell-snapshots/snapshot*"
process.parent.executablewildcard/tmp/go-build*, /tmp/newroot/tmp/.mount*, /var/lib/containers/*, /tmp/newroot/usr/bin/ansible-playbook, /usr/bin/ansible-playbook, /tmp/newroot/*, /tmp/.mount_cursor*/cursorsandbox, /usr/local/bin/crush, ./usr/bin/podman, /usr/bin/podman, /tmp/*/.vscode-server/extensions/openai.chatgpt-*/bin/*/codex-resources/*excludes:process.parent.executable
process.parent.nameeqansibleexcludes:process.parent.name field:"process.parent.name" value:"ansible"
process.working_directorywildcard/build, /tmp/newroot/*, /tmp/plz_sandbox, /tmp/.build/*, /tmp/tmp/bwrap*, /jenkins/workspace/*, /var/lib/waagent/*, /tmp/plz_sandbox/*, /builds/*, /opt/bmc/bladelogic/RSCD, /var/lib/oneexcludes:process.working_directory

Sublime Plugin or Application Script Modification

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

Adversaries may create or modify the Sublime application plugins or scripts to execute a malicious payload each time the Sublime application is started.

MITRE ATT&CK Coverage

TacticTechniques
Persistence

Telemetry Coverage

Rule Body

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

[rule]
author = ["Elastic"]
description = """
Adversaries may create or modify the Sublime application plugins or scripts to execute a malicious payload each time the
Sublime application is started.
"""
from = "now-9m"
index = ["logs-endpoint.events.file*"]
language = "eql"
license = "Elastic License v2"
name = "Sublime Plugin or Application Script Modification"
references = ["https://posts.specterops.io/persistent-jxa-66e1c3cd1cf5"]
risk_score = 21
rule_id = "88817a33-60d3-411f-ba79-7c905d865b2a"
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 = "low"
tags = [
    "Domain: Endpoint",
    "OS: macOS",
    "Use Case: Threat Detection",
    "Tactic: Persistence",
    "Data Source: Elastic Defend",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"

query = '''
file where host.os.type == "macos" and event.action == "modification" and file.extension == "py" and
  file.path like
    (
      "/Users/*/Library/Application Support/Sublime Text*/Packages/*.py",
      "/Applications/Sublime Text.app/Contents/MacOS/sublime.py"
    ) and
  not process.executable like
    (
      "/Applications/Sublime Text*.app/Contents/*",
      "/usr/local/Cellar/git/*/bin/git",
      "/Library/Developer/CommandLineTools/usr/bin/git",
      "/usr/libexec/xpcproxy",
      "/System/Library/PrivateFrameworks/DesktopServicesPriv.framework/Versions/A/Resources/DesktopServicesHelper"
    )
'''
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 Sublime Plugin or Application Script Modification

Sublime Text, a popular text editor, supports plugins and scripts written in Python to enhance functionality. Adversaries may exploit this by altering these scripts to execute malicious code whenever the application launches, achieving persistence. The detection rule identifies suspicious modifications or creations of Python files in specific Sublime directories on macOS, excluding legitimate processes, to flag potential threats.

### Possible investigation steps

- Review the file path and name of the modified or created Python file to determine if it aligns with known Sublime Text plugin directories, specifically checking paths like "/Users/*/Library/Application Support/Sublime Text*/Packages/*.py" and "/Applications/Sublime Text.app/Contents/MacOS/sublime.py".
- Examine the process that triggered the file change or creation event, ensuring it is not one of the excluded legitimate processes such as those from "/Applications/Sublime Text*.app/Contents/*" or "/usr/local/Cellar/git/*/bin/git".
- Analyze the contents of the modified or newly created Python file for any suspicious or unauthorized code, focusing on scripts that may execute commands or connect to external networks.
- Check the modification or creation timestamp of the file to correlate with any known user activity or other security events that occurred around the same time.
- Investigate the user account associated with the file modification to determine if the activity aligns with their typical behavior or if it might indicate compromised credentials.
- Look for any additional indicators of compromise on the host, such as unusual network connections or other file modifications, to assess the broader impact of the potential threat.

### False positive analysis

- Legitimate Sublime Text updates or installations may trigger the rule by modifying or creating Python files in the specified directories. Users can mitigate this by temporarily disabling the rule during known update periods or by verifying the update source.
- Development activities involving Sublime Text plugins or scripts can cause false positives. Developers should consider excluding their specific user paths or processes from the rule to prevent unnecessary alerts.
- Automated backup or synchronization tools that modify Sublime Text configuration files might be flagged. Users can exclude these tools' processes from the rule to avoid false positives.
- System maintenance or cleanup scripts that interact with Sublime Text directories could trigger alerts. Identifying and excluding these scripts from the rule can help manage false positives.
- Version control operations, such as those involving git, may modify files in the monitored directories. Users should ensure that legitimate git processes are included in the exclusion list to prevent false alerts.

### Response and remediation

- Immediately isolate the affected system from the network to prevent further spread of any potential malicious activity.
- Terminate any suspicious processes related to Sublime Text that are not part of the legitimate process list provided in the detection rule.
- Restore the modified or newly created Python files in the specified Sublime directories from a known good backup to ensure no malicious code persists.
- Conduct a thorough scan of the affected system using updated antivirus or endpoint detection tools to identify and remove any additional malicious payloads.
- Review system logs and the history of file changes to identify any unauthorized access or modifications, and document findings for further analysis.
- Escalate the incident to the security operations team for a deeper investigation into potential compromise vectors and to assess the need for broader organizational response.
- Implement additional monitoring on the affected system and similar environments to detect any recurrence of the threat, ensuring enhanced logging for the specified directories and processes."""


[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1554"
name = "Compromise Host Software Binary"
reference = "https://attack.mitre.org/techniques/T1554/"


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

Stages and Predicates

Stage 1: file

file where host.os.type == "macos" and event.action == "modification" and file.extension == "py" and
  file.path like
    (
      "/Users/*/Library/Application Support/Sublime Text*/Packages/*.py",
      "/Applications/Sublime Text.app/Contents/MacOS/sublime.py"
    ) and
  not process.executable like
    (
      "/Applications/Sublime Text*.app/Contents/*",
      "/usr/local/Cellar/git/*/bin/git",
      "/Library/Developer/CommandLineTools/usr/bin/git",
      "/usr/libexec/xpcproxy",
      "/System/Library/PrivateFrameworks/DesktopServicesPriv.framework/Versions/A/Resources/DesktopServicesHelper"
    )

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • modification corpus 72 (elastic 72)
field:"EventType" kind:eq value:"modification"
file.extensioneq
  • py corpus 2 (elastic 2)
field:"file.extension" kind:eq value:"py"
file.pathwildcard
  • /Applications/Sublime Text.app/Contents/MacOS/sublime.py
  • /Users/*/Library/Application Support/Sublime Text*/Packages/*.py
field:"TargetFilename" kind:wildcard

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.executablewildcard/Applications/Sublime Text*.app/Contents/*, /usr/local/Cellar/git/*/bin/git, /Library/Developer/CommandLineTools/usr/bin/git, /usr/libexec/xpcproxy, /System/Library/PrivateFrameworks/DesktopServicesPriv.framework/Versions/A/Resources/DesktopServicesHelperexcludes:process.executable

Suspicious Modprobe File Event

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

Detects file events involving kernel modules in modprobe configuration files, which may indicate unauthorized access or manipulation of critical kernel modules. Attackers may tamper with the modprobe files to load malicious or unauthorized kernel modules, potentially bypassing security measures, escalating privileges, or hiding their activities within the system.

MITRE ATT&CK Coverage

Rule Body

[metadata]
creation_date = "2023/06/08"
integration = ["auditd_manager"]
maturity = "production"
updated_date = "2026/03/24"

[rule]
author = ["Elastic"]
building_block_type = "default"
description = """
Detects file events involving kernel modules in modprobe configuration files, which may indicate unauthorized access or
manipulation of critical kernel modules. Attackers may tamper with the modprobe files to load malicious or unauthorized
kernel modules, potentially bypassing security measures, escalating privileges, or hiding their activities within the
system.
"""
from = "now-119m"
index = ["auditbeat-*", "logs-auditd_manager.auditd-*"]
interval = "60m"
language = "kuery"
license = "Elastic License v2"
name = "Suspicious Modprobe File Event"
risk_score = 21
rule_id = "40ddbcc8-6561-44d9-afc8-eefdbfe0cccd"
setup = """## Setup

This rule requires the use of the `auditd_manager` integration. `Auditd_manager` is a tool designed to simplify and enhance the management of the audit subsystem in Linux systems. It provides a user-friendly interface and automation capabilities for configuring and monitoring system auditing through the auditd daemon. With `auditd_manager`, administrators can easily define audit rules, track system events, and generate comprehensive audit reports, improving overall security and compliance in the system. The following steps should be executed in order to install and deploy `auditd_manager` on a Linux system.

```
Kibana -->
Management -->
Integrations -->
Auditd Manager -->
Add Auditd Manager
```

`Auditd_manager` subscribes to the kernel and receives events as they occur without any additional configuration. However, if more advanced configuration is required to detect specific behavior, audit rules can be added to the integration in either the "audit rules" configuration box or the "auditd rule files" box by specifying a file to read the audit rules from.

For this detection rule to trigger, the following additional audit rules are required to be added to the integration:
```
-w /etc/modprobe.conf -p wa -k modprobe
-w /etc/modprobe.d -p wa -k modprobe
```

Add the newly installed `auditd manager` to an agent policy, and deploy the agent on a Linux system from which auditd log files are desirable.
"""
severity = "low"
tags = [
    "Data Source: Auditd Manager",
    "OS: Linux",
    "Use Case: Threat Detection",
    "Tactic: Discovery",
    "Rule Type: BBR",
]
timestamp_override = "event.ingested"
type = "new_terms"

query = '''
host.os.type:linux and event.category:file and event.action:"opened-file" and
file.path : ("/etc/modprobe.conf" or "/etc/modprobe.d" or /etc/modprobe.d/*) and
not (
  process.name:(
    cp or dpkg or dockerd or lynis or mkinitramfs or snapd or systemd-udevd or borg or auditbeat or lspci or
    aide or modprobe or python*
  ) or
  process.executable:(
    /opt/sophos/* or /opt/eset/* or /var/lib/elastic* or /opt/Elastic/* or "/usr/lib/dracut/dracut-install" or
    "/usr/bin/pacman" or /opt/saltstack/salt/bin/python* or /var/lib/waagent/* or /opt/sophos-spl/plugins/av/bin/*
  )
)
'''

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

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

[[rule.threat.technique]]
id = "T1083"
name = "File and Directory Discovery"
reference = "https://attack.mitre.org/techniques/T1083/"

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

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

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

[[rule.threat.technique.subtechnique]]
id = "T1547.006"
name = "Kernel Modules and Extensions"
reference = "https://attack.mitre.org/techniques/T1547/006/"

[rule.threat.tactic]
id = "TA0003"
name = "Persistence"
reference = "https://attack.mitre.org/tactics/TA0003/"
[rule.new_terms]
field = "new_terms_fields"
value = ["process.executable"]

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

Stages and Predicates

Stage 1: new_terms

host.os.type:linux and event.category:file and event.action:"opened-file" and
file.path : ("/etc/modprobe.conf" or "/etc/modprobe.d" or /etc/modprobe.d/*) and
not (
  process.name:(
    cp or dpkg or dockerd or lynis or mkinitramfs or snapd or systemd-udevd or borg or auditbeat or lspci or
    aide or modprobe or python*
  ) or
  process.executable:(
    /opt/sophos/* or /opt/eset/* or /var/lib/elastic* or /opt/Elastic/* or "/usr/lib/dracut/dracut-install" or
    "/usr/bin/pacman" or /opt/saltstack/salt/bin/python* or /var/lib/waagent/* or /opt/sophos-spl/plugins/av/bin/*
  )
)

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.executableeq/usr/bin/pacmanexcludes:process.executable field:"process.executable" value:"/usr/bin/pacman"
process.executableeq/usr/lib/dracut/dracut-installexcludes:process.executable field:"process.executable" value:"/usr/lib/dracut/dracut-install"
process.executablestarts_with/opt/Elastic/excludes:process.executable field:"process.executable" value:"/opt/Elastic/"
process.executablestarts_with/opt/eset/excludes:process.executable field:"process.executable" value:"/opt/eset/"
process.executablestarts_with/opt/saltstack/salt/bin/pythonexcludes:process.executable field:"process.executable" value:"/opt/saltstack/salt/bin/python"
process.executablestarts_with/opt/sophos-spl/plugins/av/bin/excludes:process.executable field:"process.executable" value:"/opt/sophos-spl/plugins/av/bin/"
process.executablestarts_with/opt/sophos/excludes:process.executable field:"process.executable" value:"/opt/sophos/"
process.executablestarts_with/var/lib/elasticexcludes:process.executable field:"process.executable" value:"/var/lib/elastic"
process.executablestarts_with/var/lib/waagent/excludes:process.executable field:"process.executable" value:"/var/lib/waagent/"
process.nameeqaideexcludes:process.name field:"process.name" value:"aide"
process.nameeqauditbeatexcludes:process.name field:"process.name" value:"auditbeat"
process.nameeqborgexcludes:process.name field:"process.name" value:"borg"
process.nameeqcpexcludes:process.name field:"process.name" value:"cp"
process.nameeqdockerdexcludes:process.name field:"process.name" value:"dockerd"
process.nameeqdpkgexcludes:process.name field:"process.name" value:"dpkg"
process.nameeqlspciexcludes:process.name field:"process.name" value:"lspci"
process.nameeqlynisexcludes:process.name field:"process.name" value:"lynis"
process.nameeqmkinitramfsexcludes:process.name field:"process.name" value:"mkinitramfs"
process.nameeqmodprobeexcludes:process.name field:"process.name" value:"modprobe"
process.nameeqsnapdexcludes:process.name field:"process.name" value:"snapd"
process.nameeqsystemd-udevdexcludes:process.name field:"process.name" value:"systemd-udevd"
process.namestarts_withpythonexcludes:process.name field:"process.name" value:"python"

Suspicious Print Spooler SPL File Created

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

Detects attempts to exploit privilege escalation vulnerabilities related to the Print Spooler service including CVE-2020-1048 and CVE-2020-1337.

MITRE ATT&CK Coverage

TacticTechniques
Privilege Escalation

Rule Body

[metadata]
creation_date = "2020/08/14"
integration = ["endpoint", "m365_defender"]
maturity = "production"
updated_date = "2026/05/04"

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

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

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

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


[rule]
author = ["Elastic"]
description = """
Detects attempts to exploit privilege escalation vulnerabilities related to the Print Spooler service including
CVE-2020-1048 and CVE-2020-1337.
"""
from = "now-9m"
index = ["logs-endpoint.events.file-*", "endgame-*", "logs-m365_defender.event-*"]
language = "eql"
license = "Elastic License v2"
name = "Suspicious Print Spooler SPL File Created"
note = """## Triage and analysis

### Investigating Suspicious Print Spooler SPL File Created

Print Spooler is a Windows service enabled by default in all Windows clients and servers. The service manages print jobs by loading printer drivers, receiving files to be printed, queuing them, scheduling, etc.

The Print Spooler service has some known vulnerabilities that attackers can abuse to escalate privileges to SYSTEM, like CVE-2020-1048 and CVE-2020-1337. This rule looks for unusual processes writing SPL files to the location `?:\\Windows\\System32\\spool\\PRINTERS\\`, which is an essential step in exploiting these vulnerabilities.

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

#### Possible investigation steps

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


### False positive analysis

- If this activity is expected and noisy in your environment, consider adding exceptions — preferably with a combination of process executable and file conditions.

### Response and remediation

- Initiate the incident response process based on the outcome of the triage.
- Isolate the involved host to prevent further post-compromise behavior.
- If the triage identified malware, search the environment for additional compromised hosts.
  - Implement temporary network rules, procedures, and segmentation to contain the malware.
  - Stop suspicious processes.
  - Immediately block the identified indicators of compromise (IoCs).
  - Inspect the affected systems for additional malware backdoors like reverse shells, reverse proxies, or droppers that attackers could use to reinfect the system.
- Remove and block malicious artifacts identified during triage.
- Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
- 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.
- Ensure that the machine has the latest security updates and is not running legacy Windows versions.
- 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)
"""

references = ["https://safebreach.com/Post/How-we-bypassed-CVE-2020-1048-Patch-and-got-CVE-2020-1337"]
risk_score = 21
rule_id = "a7ccae7b-9d2c-44b2-a061-98e5946971fa"
severity = "low"
tags = [
    "Domain: Endpoint",
    "OS: Windows",
    "Use Case: Threat Detection",
    "Tactic: Privilege Escalation",
    "Resources: Investigation Guide",
    "Data Source: Elastic Endgame",
    "Use Case: Vulnerability",
    "Data Source: Elastic Defend",
    "Data Source: Microsoft Defender XDR",
]
timestamp_override = "event.ingested"
type = "eql"

query = '''
file where host.os.type == "windows" and event.type != "deletion" and
  file.extension : "spl" and
  file.path : "?:\\Windows\\System32\\spool\\PRINTERS\\*" and
  not process.name : ("spoolsv.exe",
                      "printfilterpipelinesvc.exe",
                      "PrintIsolationHost.exe",
                      "splwow64.exe",
                      "msiexec.exe",
                      "poqexec.exe",
                      "System") and
  not user.id : "S-1-5-18" and
  not process.executable :
            ("?:\\Windows\\System32\\mmc.exe",
             "\\Device\\Mup\\*.exe",
             "?:\\Windows\\System32\\svchost.exe",
             "?:\\Windows\\System32\\mmc.exe",
             "?:\\Windows\\System32\\printui.exe",
             "?:\\Windows\\System32\\mstsc.exe",
             "?:\\Windows\\System32\\spool\\*.exe",
             "?:\\Program Files\\*.exe",
             "?:\\Program Files (x86)\\*.exe",
             "?:\\PROGRA~1\\*.exe",
             "?:\\PROGRA~2\\*.exe",
             "?:\\Windows\\System32\\rundll32.exe")
'''


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

Stages and Predicates

Stage 1: file

file where host.os.type == "windows" and event.type != "deletion" and
  file.extension : "spl" and
  file.path : "?:\\Windows\\System32\\spool\\PRINTERS\\*" and
  not process.name : ("spoolsv.exe",
                      "printfilterpipelinesvc.exe",
                      "PrintIsolationHost.exe",
                      "splwow64.exe",
                      "msiexec.exe",
                      "poqexec.exe",
                      "System") and
  not user.id : "S-1-5-18" and
  not process.executable :
            ("?:\\Windows\\System32\\mmc.exe",
             "\\Device\\Mup\\*.exe",
             "?:\\Windows\\System32\\svchost.exe",
             "?:\\Windows\\System32\\mmc.exe",
             "?:\\Windows\\System32\\printui.exe",
             "?:\\Windows\\System32\\mstsc.exe",
             "?:\\Windows\\System32\\spool\\*.exe",
             "?:\\Program Files\\*.exe",
             "?:\\Program Files (x86)\\*.exe",
             "?:\\PROGRA~1\\*.exe",
             "?:\\PROGRA~2\\*.exe",
             "?:\\Windows\\System32\\rundll32.exe")

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.executablewildcard?:\Windows\System32\mmc.exe, \Device\Mup\*.exe, ?:\Windows\System32\svchost.exe, ?:\Windows\System32\mmc.exe, ?:\Windows\System32\printui.exe, ?:\Windows\System32\mstsc.exe, ?:\Windows\System32\spool\*.exe, ?:\Program Files\*.exe, ?:\Program Files (x86)\*.exe, ?:\PROGRA~1\*.exe, ?:\PROGRA~2\*.exe, ?:\Windows\System32\rundll32.exeexcludes:process.executable
process.nameeqspoolsv.exe, printfilterpipelinesvc.exe, PrintIsolationHost.exe, splwow64.exe, msiexec.exe, poqexec.exe, Systemexcludes:process.name
user.ideqS-1-5-18excludes:user.id field:"user.id" value:"S-1-5-18"

Suspicious Windows Component Object Model via DLLHOST

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

Identifies the instantiation of a registered COM object by classID via DllHost and by an unusual process such as Windows scripts interpreters, recently dropped unsigned executables and common signed proxy binaries like Rundll32. Adversaries may use the Windows Component Object Model (COM) for local code execution, evasion or persistence.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
Identifies the instantiation of a registered COM object by classID via DllHost and by an unusual process such as Windows
scripts interpreters, recently dropped unsigned executables and common signed proxy binaries like Rundll32. Adversaries
may use the Windows Component Object Model (COM) for local code execution, evasion or persistence.
"""
id = "f678ec9a-c348-485c-ac9e-84b0923ff5f5"
license = "Elastic License v2"
name = "Suspicious Windows Component Object Model via DLLHOST"
os_list = ["windows"]
version = "1.0.28"

query = '''
sequence with maxspan=5m
 [process where event.action == "start" and
    (
     /* common initial access processes */
     process.name : ("wscript.exe", "cscript.exe", "regsvr32.exe", "mshta.exe", "rundll32.exe", "vbc.exe",
                     "msbuild.exe", "wmic.exe", "cmstp.exe", "RegAsm.exe", "installutil.exe","RegSvcs.exe",
                     "msxsl.exe", "xwizard.exe", "csc.exe", "winword.exe", "excel.exe", "powerpnt.exe",
                     "powershell.exe")  or

    /* unsigned or untrusted codesign */
    ((process.code_signature.trusted == false or process.code_signature.exists == false) and
      (process.Ext.relative_file_creation_time <= 500 or process.Ext.relative_file_name_modify_time <= 500) and
      not process.executable : ("?:\\Program Files\\*", "?:\\Program Files (x86)\\*")) or

    /* common abused paths */
    process.executable :
         ("?:\\Users\\Public\\*",
          "?:\\Users\\*\\AppData\\Roaming\\*",
          "?:\\Windows\\Microsoft.NET\\*",
          "?:\\Users\\*\\AppData\\Local\\Temp\\Temp?_*",
          "?:\\Users\\*\\AppData\\Local\\Temp\\7z*",
          "?:\\Users\\*\\AppData\\Local\\Temp\\Rar*",
          "?:\\Users\\*\\AppData\\Local\\Temp\\BNZ.*",
          "\\Device\\CdRom*",
          "\\Device\\Mup\\*",
          "\\\\*") or

    /* execution from a mounted device */
    (process.Ext.device.product_id : ("Virtual DVD-ROM", "Virtual Disk") and not process.executable : "C:\\*")
    ) and

    /* known FPs */
    not (process.name : "rundll32.exe" and process.command_line : "*zzzzInvokeManagedCustomActionOutOfProc*" and process.parent.name : "msiexec.exe") and
    not (process.name : ("rundll32.exe", "regsvr32.exe") and process.args : ("?:\\Program Files\\*", "?:\\Program Files (x86)\\*")) and
    not (process.executable : ("?:\\Program Files\\*", "?:\\Program Files (x86)\\*") and process.code_signature.trusted == true) and
    not (process.name : "rundll32.exe" and process.args : ("shell32.dll,Control_RunDLL", "printui.dll,PrintUIEntryDPIAware",  "C:\\windows\\System32\\shell32.dll,Control_RunDLL")) and
    not (process.code_signature.subject_name == "Avora Holdings, LTD" and process.code_signature.trusted == true)
   ] by process.entity_id
 [process where event.action == "start" and
   process.name : "dllhost.exe" and
   process.Ext.effective_parent.name regex~ ".+"  and

   /* excluding common noisy COM objects by classid */
   not process.args :
          (
            /* Wininet */
            "/Processid:{3EB3C877-1F16-487C-9050-104DBCD66683}",

            /* Thumbnail Cache Class Factory via Explorer.exe */
            "/Processid:{AB8902B4-09CA-4BB6-B78D-A8F59079A8D5}",

            /* Web Platform Storage COM object */
            "/Processid:{973D20D7-562D-44B9-B70B-5A0F49CCDF3F}",

            /* SPP Class - diverse third party spp.dll */
            "/Processid:{F32D97DF-E3E5-4CB9-9E3E-0EB5B4E49801}",

            /* Shell Create Object Task Server - Taskhostw */
            "/Processid:{133EAC4F-5891-4D04-BADA-D84870380A80}",

            /* COpenControlPanel via Explorer.exe */
            "/Processid:{06622D85-6856-4460-8DE1-A81921B41C4B}",

            /* UIAutomationCrossBitnessHook32 Class */
            "/Processid:{60A90A2F-858D-42AF-8929-82BE9D99E8A1}",

            /* Adobe-Reader - Acrobat.exe */
            "/Processid:{FD2C8897-2BE8-459C-B8E4-0D2FCFD341F0}",

            /* SCCM related */
            "/Processid:{7DBDD3CA-11BD-406C-9EE4-B0AAE170EE2E}",
            "/Processid:{9967A433-A640-4A56-8C3D-D8E8F95FF8F3}",

            /* PSIProfileNotify - UserEnv.dll */
            "/Processid:{E10F6C3A-F1AE-4ADC-AA9D-2FE65525666E}",

            /* Microsoft.GroupPolicy.Reporting.ReportFactory */
            "/Processid:{7F9BBC82-BA5F-4448-8622-EF76B8D007E6}",

            /* Photoviewer.dll */
            "/Processid:{76D0CB12-7604-4048-B83C-1005C7DDC503}",

            /* PrintTicket */
            "/Processid:{AA0B85DA-FDDF-4272-8D1D-FF9B966D75B0}",

            /* Virtual Factory for Windows Defender */
            "/Processid:{A4B07E49-6567-4FB8-8D39-01920E3B2357}",

            /* ScanSnap */
            "/Processid:{01F2A744-DEB2-471C-A883-0105FF8BFF2D}",

            /* Shell Indexer Admin Object */
            "/Processid:{3F4D7BB8-4F38-4526-8CD3-C44D68689C5F}",

            /* RemoteProxyFactory32 */
            "/Processid:{53362C32-A296-4F2D-A2F8-FD984D08340B}",

            /* Region and Language */
            "/Processid:{514B5E31-5596-422F-BE58-D804464683B5}",

            /* Network and Sharing Center */
            "/Processid:{7A076CE1-4B31-452A-A4F1-0304C8738100}",

            /* Virtual Factory for Power Options */
            "/Processid:{BBD8C065-5E6C-4E88-BFD7-BE3E6D1C063B}",

            /* IIS Config */
            "/Processid:{9FA5C497-F46D-447F-8011-05D03D7D7DDC}",

            /* Shortcut */
            "/Processid:{00021401-0000-0000-C000-000000000046}",

            /* RemoteProxyFactory32 - AccessibleProxyFromWindow */
            "/Processid:{53362C64-A296-4F2D-A2F8-FD984D08340B}",

            /* third party registered clsid */
            "/Processid:{86607BF8-8BC5-11D0-BA55-0080C74F0C94}",

            /* Shell Disc Image Mount */
            "/Processid:{51A1467F-96A2-4B1C-9632-4B4D950FE216}",

            "/Processid:{D4648AF3-803B-4993-BAA3-502E8F892E4B}",

            "/Processid:{1EF75F33-893B-4E8F-9655-C3D602BA4897}",

            "/Processid:{747BBE98-066A-4DA3-80D9-5129AB999BEE}",

            "/Processid:{94773112-72E8-11D0-A42E-00A024DED613}", 

            /* CFmIfsEngine Class */
            "/Processid:{82D94FB3-7FE6-4797-BB72-9A886C66073B}",

            "/Processid:{E1789B51-C801-4DB8-9E35-48E5B29F3316}",
            "/Processid:{0FA40ACA-8A2F-11D0-BA53-0080C74F0C94}",

            /* Home Networking Configuration Manager */
            "/Processid:{46C166AA-3108-11D4-9348-00C04F8EEB71}"
            )
            ] by process.Ext.effective_parent.entity_id
'''

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

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

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

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


[[threat.technique]]
id = "T1559"
name = "Inter-Process Communication"
reference = "https://attack.mitre.org/techniques/T1559/"
[[threat.technique.subtechnique]]
id = "T1559.001"
name = "Component Object Model"
reference = "https://attack.mitre.org/techniques/T1559/001/"



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

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

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



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

[internal]
min_endpoint_version = "8.4.0"

Stages and Predicates

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

Stage 1: process

[process where event.action == "start" and
    (
     process.name : ("wscript.exe", "cscript.exe", "regsvr32.exe", "mshta.exe", "rundll32.exe", "vbc.exe",
                     "msbuild.exe", "wmic.exe", "cmstp.exe", "RegAsm.exe", "installutil.exe","RegSvcs.exe",
                     "msxsl.exe", "xwizard.exe", "csc.exe", "winword.exe", "excel.exe", "powerpnt.exe",
                     "powershell.exe")  or
    ((process.code_signature.trusted == false or process.code_signature.exists == false) and
      (process.Ext.relative_file_creation_time <= 500 or process.Ext.relative_file_name_modify_time <= 500) and
      not process.executable : ("?:\\Program Files\\*", "?:\\Program Files (x86)\\*")) or
    process.executable :
         ("?:\\Users\\Public\\*",
          "?:\\Users\\*\\AppData\\Roaming\\*",
          "?:\\Windows\\Microsoft.NET\\*",
          "?:\\Users\\*\\AppData\\Local\\Temp\\Temp?_*",
          "?:\\Users\\*\\AppData\\Local\\Temp\\7z*",
          "?:\\Users\\*\\AppData\\Local\\Temp\\Rar*",
          "?:\\Users\\*\\AppData\\Local\\Temp\\BNZ.*",
          "\\Device\\CdRom*",
          "\\Device\\Mup\\*",
          "\\\\*") or
    (process.Ext.device.product_id : ("Virtual DVD-ROM", "Virtual Disk") and not process.executable : "C:\\*")
    ) and
    not (process.name : "rundll32.exe" and process.command_line : "*zzzzInvokeManagedCustomActionOutOfProc*" and process.parent.name : "msiexec.exe") and
    not (process.name : ("rundll32.exe", "regsvr32.exe") and process.args : ("?:\\Program Files\\*", "?:\\Program Files (x86)\\*")) and
    not (process.executable : ("?:\\Program Files\\*", "?:\\Program Files (x86)\\*") and process.code_signature.trusted == true) and
    not (process.name : "rundll32.exe" and process.args : ("shell32.dll,Control_RunDLL", "printui.dll,PrintUIEntryDPIAware",  "C:\\windows\\System32\\shell32.dll,Control_RunDLL")) and
    not (process.code_signature.subject_name == "Avora Holdings, LTD" and process.code_signature.trusted == true)
   ] by process.entity_id

Stage 2: process

[process where event.action == "start" and
   process.name : "dllhost.exe" and
   process.Ext.effective_parent.name regex~ ".+"  and
   not process.args :
          (
            "/Processid:{3EB3C877-1F16-487C-9050-104DBCD66683}",
            "/Processid:{AB8902B4-09CA-4BB6-B78D-A8F59079A8D5}",
            "/Processid:{973D20D7-562D-44B9-B70B-5A0F49CCDF3F}",
            "/Processid:{F32D97DF-E3E5-4CB9-9E3E-0EB5B4E49801}",
            "/Processid:{133EAC4F-5891-4D04-BADA-D84870380A80}",
            "/Processid:{06622D85-6856-4460-8DE1-A81921B41C4B}",
            "/Processid:{60A90A2F-858D-42AF-8929-82BE9D99E8A1}",
            "/Processid:{FD2C8897-2BE8-459C-B8E4-0D2FCFD341F0}",
            "/Processid:{7DBDD3CA-11BD-406C-9EE4-B0AAE170EE2E}",
            "/Processid:{9967A433-A640-4A56-8C3D-D8E8F95FF8F3}",
            "/Processid:{E10F6C3A-F1AE-4ADC-AA9D-2FE65525666E}",
            "/Processid:{7F9BBC82-BA5F-4448-8622-EF76B8D007E6}",
            "/Processid:{76D0CB12-7604-4048-B83C-1005C7DDC503}",
            "/Processid:{AA0B85DA-FDDF-4272-8D1D-FF9B966D75B0}",
            "/Processid:{A4B07E49-6567-4FB8-8D39-01920E3B2357}",
            "/Processid:{01F2A744-DEB2-471C-A883-0105FF8BFF2D}",
            "/Processid:{3F4D7BB8-4F38-4526-8CD3-C44D68689C5F}",
            "/Processid:{53362C32-A296-4F2D-A2F8-FD984D08340B}",
            "/Processid:{514B5E31-5596-422F-BE58-D804464683B5}",
            "/Processid:{7A076CE1-4B31-452A-A4F1-0304C8738100}",
            "/Processid:{BBD8C065-5E6C-4E88-BFD7-BE3E6D1C063B}",
            "/Processid:{9FA5C497-F46D-447F-8011-05D03D7D7DDC}",
            "/Processid:{00021401-0000-0000-C000-000000000046}",
            "/Processid:{53362C64-A296-4F2D-A2F8-FD984D08340B}",
            "/Processid:{86607BF8-8BC5-11D0-BA55-0080C74F0C94}",
            "/Processid:{51A1467F-96A2-4B1C-9632-4B4D950FE216}",
            "/Processid:{D4648AF3-803B-4993-BAA3-502E8F892E4B}",
            "/Processid:{1EF75F33-893B-4E8F-9655-C3D602BA4897}",
            "/Processid:{747BBE98-066A-4DA3-80D9-5129AB999BEE}",
            "/Processid:{94773112-72E8-11D0-A42E-00A024DED613}",
            "/Processid:{82D94FB3-7FE6-4797-BB72-9A886C66073B}",
            "/Processid:{E1789B51-C801-4DB8-9E35-48E5B29F3316}",
            "/Processid:{0FA40ACA-8A2F-11D0-BA53-0080C74F0C94}",
            "/Processid:{46C166AA-3108-11D4-9348-00C04F8EEB71}"
            )
            ] by process.Ext.effective_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.Ext.device.product_idwildcard
  • Virtual DVD-ROM corpus 13 (elastic 13)
  • Virtual Disk corpus 13 (elastic 13)
field:"process.Ext.device.product_id" kind:wildcard
process.Ext.effective_parent.nameregex_match
  • .+
field:"process.Ext.effective_parent.name" kind:regex_match value:".+"
process.Ext.relative_file_creation_timele
  • 500 transforms: number corpus 28 (elastic 28)
field:"process.Ext.relative_file_creation_time" kind:le value:"500"
process.Ext.relative_file_name_modify_timele
  • 500 transforms: number corpus 21 (elastic 21)
field:"process.Ext.relative_file_name_modify_time" kind:le value:"500"
process.code_signature.existseq
  • false transforms: boolean corpus 118 (elastic 118)
field:"process.code_signature.exists" kind:eq value:"false"
process.code_signature.trustedeq
  • false transforms: boolean corpus 114 (elastic 114)
field:"process.code_signature.trusted" kind:eq value:"false"
process.executablewildcard
  • ?:\Users\*\AppData\Local\Temp\7z* corpus 4 (elastic 4)
  • ?:\Users\*\AppData\Local\Temp\BNZ.* corpus 7 (elastic 7)
  • ?:\Users\*\AppData\Local\Temp\Rar* corpus 3 (elastic 3)
  • ?:\Users\*\AppData\Local\Temp\Temp?_* corpus 4 (elastic 4)
  • ?:\Users\*\AppData\Roaming\* corpus 5 (elastic 5)
  • ?:\Users\Public\* corpus 22 (elastic 22)
  • ?:\Windows\Microsoft.NET\* corpus 11 (elastic 11)
  • \Device\CdRom* corpus 2 (elastic 2)
  • \Device\Mup\*
  • \\*
field:"Image" kind:wildcard
process.namewildcard
  • RegAsm.exe corpus 25 (elastic 24, splunk 1)
  • RegSvcs.exe corpus 22 (elastic 21, splunk 1)
  • cmstp.exe corpus 25 (elastic 25)
  • csc.exe corpus 12 (elastic 11, splunk 1)
  • cscript.exe corpus 68 (elastic 66, splunk 2)
  • dllhost.exe corpus 19 (elastic 17, splunk 2)
  • excel.exe corpus 34 (elastic 34)
  • installutil.exe corpus 36 (elastic 32, splunk 4)
  • msbuild.exe corpus 39 (elastic 36, splunk 3)
  • mshta.exe corpus 84 (elastic 80, splunk 4)
  • msxsl.exe corpus 22 (elastic 22)
  • powerpnt.exe corpus 31 (elastic 31)
  • 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)
  • vbc.exe corpus 8 (elastic 8)
  • winword.exe corpus 35 (elastic 35)
  • wmic.exe corpus 66 (elastic 39, splunk 27)
  • wscript.exe corpus 84 (elastic 82, splunk 1, kusto 1)
  • xwizard.exe corpus 16 (elastic 16)
field:"process_basename" kind:wildcard

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.argseqshell32.dll,Control_RunDLL, printui.dll,PrintUIEntryDPIAware, C:\windows\System32\shell32.dll,Control_RunDLLexcludes:process.args field:"process.args" value:"shell32.dll,Control_RunDLL" field:"process.args" value:"printui.dll,PrintUIEntryDPIAware" field:"process.args" value:"C:\windows\System32\shell32.dll,Control_RunDLL"
process.nameeqrundll32.exeexcludes:process.name field:"process.name" value:"rundll32.exe"
process.argsstarts_with?:\Program Files\, ?:\Program Files (x86)\excludes:process.args field:"process.args" value:"?:\Program Files\" field:"process.args" value:"?:\Program Files (x86)\"
process.nameeqrundll32.exe, regsvr32.exeexcludes:process.name field:"process.name" value:"rundll32.exe" field:"process.name" value:"regsvr32.exe"
process.code_signature.subject_nameeqAvora Holdings, LTDexcludes:process.code_signature.subject_name field:"process.code_signature.subject_name" value:"Avora Holdings, LTD"
process.code_signature.trustedeqtrueexcludes:process.code_signature.trusted field:"process.code_signature.trusted" value:"true"
process.executablestarts_with?:\Program Files\, ?:\Program Files (x86)\excludes:process.executable field:"process.executable" value:"?:\Program Files\" field:"process.executable" value:"?:\Program Files (x86)\"
process.command_linematchzzzzInvokeManagedCustomActionOutOfProcexcludes:process.command_line field:"process.command_line" value:"zzzzInvokeManagedCustomActionOutOfProc"
process.parent.nameeqmsiexec.exeexcludes:process.parent.name field:"process.parent.name" value:"msiexec.exe"
process.argseq/Processid:{3EB3C877-1F16-487C-9050-104DBCD66683}, /Processid:{AB8902B4-09CA-4BB6-B78D-A8F59079A8D5}, /Processid:{973D20D7-562D-44B9-B70B-5A0F49CCDF3F}, /Processid:{F32D97DF-E3E5-4CB9-9E3E-0EB5B4E49801}, /Processid:{133EAC4F-5891-4D04-BADA-D84870380A80}, /Processid:{06622D85-6856-4460-8DE1-A81921B41C4B}, /Processid:{60A90A2F-858D-42AF-8929-82BE9D99E8A1}, /Processid:{FD2C8897-2BE8-459C-B8E4-0D2FCFD341F0}, /Processid:{7DBDD3CA-11BD-406C-9EE4-B0AAE170EE2E}, /Processid:{9967A433-A640-4A56-8C3D-D8E8F95FF8F3}, /Processid:{E10F6C3A-F1AE-4ADC-AA9D-2FE65525666E}, /Processid:{7F9BBC82-BA5F-4448-8622-EF76B8D007E6}, /Processid:{76D0CB12-7604-4048-B83C-1005C7DDC503}, /Processid:{AA0B85DA-FDDF-4272-8D1D-FF9B966D75B0}, /Processid:{A4B07E49-6567-4FB8-8D39-01920E3B2357}, /Processid:{01F2A744-DEB2-471C-A883-0105FF8BFF2D}, /Processid:{3F4D7BB8-4F38-4526-8CD3-C44D68689C5F}, /Processid:{53362C32-A296-4F2D-A2F8-FD984D08340B}, /Processid:{514B5E31-5596-422F-BE58-D804464683B5}, /Processid:{7A076CE1-4B31-452A-A4F1-0304C8738100}, /Processid:{BBD8C065-5E6C-4E88-BFD7-BE3E6D1C063B}, /Processid:{9FA5C497-F46D-447F-8011-05D03D7D7DDC}, /Processid:{00021401-0000-0000-C000-000000000046}, /Processid:{53362C64-A296-4F2D-A2F8-FD984D08340B}, /Processid:{86607BF8-8BC5-11D0-BA55-0080C74F0C94}, /Processid:{51A1467F-96A2-4B1C-9632-4B4D950FE216}, /Processid:{D4648AF3-803B-4993-BAA3-502E8F892E4B}, /Processid:{1EF75F33-893B-4E8F-9655-C3D602BA4897}, /Processid:{747BBE98-066A-4DA3-80D9-5129AB999BEE}, /Processid:{94773112-72E8-11D0-A42E-00A024DED613}, /Processid:{82D94FB3-7FE6-4797-BB72-9A886C66073B}, /Processid:{E1789B51-C801-4DB8-9E35-48E5B29F3316}, /Processid:{0FA40ACA-8A2F-11D0-BA53-0080C74F0C94}, /Processid:{46C166AA-3108-11D4-9348-00C04F8EEB71}excludes:process.args

Suspicious WMIC XSL Script Execution

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

Identifies WMIC allowlist bypass techniques by alerting on suspicious execution of scripts. When WMIC loads scripting libraries it may be indicative of an allowlist bypass.

MITRE ATT&CK Coverage

Telemetry Coverage

Rule Body

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

[rule]
author = ["Elastic"]
description = """
Identifies WMIC allowlist bypass techniques by alerting on suspicious execution of scripts. When WMIC loads scripting
libraries it may be indicative of an allowlist bypass.
"""
from = "now-9m"
index = [
    "winlogbeat-*",
    "logs-endpoint.events.process-*",
    "logs-endpoint.events.library-*",
    "logs-windows.sysmon_operational-*",
]
language = "eql"
license = "Elastic License v2"
name = "Suspicious WMIC XSL Script 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 Suspicious WMIC XSL Script Execution

Windows Management Instrumentation Command-line (WMIC) is a powerful tool for managing Windows systems. Adversaries exploit WMIC to bypass security measures by executing scripts via XSL files, often loading scripting libraries like jscript.dll or vbscript.dll. The detection rule identifies such suspicious activities by monitoring WMIC executions with atypical arguments and the loading of specific libraries, indicating potential misuse for defense evasion.

### Possible investigation steps

- Review the process execution details to confirm the presence of WMIC.exe or wmic.exe with suspicious arguments such as "format*:*", "/format*:*", or "*-format*:*" that deviate from typical usage patterns.
- Examine the command line used in the process execution to identify any unusual or unexpected parameters that could indicate malicious intent, excluding known benign patterns like "* /format:table *".
- Investigate the sequence of events to determine if there was a library or process event involving the loading of jscript.dll or vbscript.dll, which may suggest script execution through XSL files.
- Correlate the process.entity_id with other related events within the 2-minute window to identify any additional suspicious activities or processes that may have been spawned as a result of the initial execution.
- Check the parent process of the suspicious WMIC execution to understand the context and origin of the activity, which may provide insights into whether it was initiated by a legitimate application or a potentially malicious actor.
- Analyze the host's recent activity and security logs for any other indicators of compromise or related suspicious behavior that could be part of a broader attack campaign.

### False positive analysis

- Legitimate administrative tasks using WMIC with custom scripts may trigger alerts. Review the command line arguments and context to determine if the execution is part of routine system management.
- Automated scripts or software updates that utilize WMIC for legitimate purposes might load scripting libraries like jscript.dll or vbscript.dll. Identify these processes and consider adding them to an allowlist to prevent future false positives.
- Security tools or monitoring solutions that use WMIC for system checks can be mistaken for suspicious activity. Verify the source and purpose of the execution and exclude these known tools from triggering alerts.
- Scheduled tasks or maintenance scripts that use WMIC with non-standard arguments could be flagged. Document these tasks and create exceptions for their specific command line patterns to reduce noise.
- Custom applications developed in-house that rely on WMIC for functionality may inadvertently match the detection criteria. Work with development teams to understand these applications and adjust the detection rule to accommodate their legitimate use cases.

### Response and remediation

- Isolate the affected system from the network to prevent further malicious activity and lateral movement.
- Terminate any suspicious WMIC processes identified by the alert to stop ongoing malicious script execution.
- Conduct a thorough review of the system's recent activity logs to identify any additional indicators of compromise or related malicious activities.
- Remove any unauthorized or suspicious XSL files and associated scripts from the system to prevent re-execution.
- Restore the system from a known good backup if any critical system files or configurations have been altered.
- Update and patch the system to the latest security standards to close any vulnerabilities that may have been exploited.
- Escalate the incident to the security operations center (SOC) or incident response team for further investigation and to determine if additional systems are affected."""
risk_score = 47
rule_id = "7f370d54-c0eb-4270-ac5a-9a6020585dc6"
severity = "medium"
tags = [
    "Domain: Endpoint",
    "OS: Windows",
    "Use Case: Threat Detection",
    "Tactic: Defense Evasion",
    "Tactic: Execution",
    "Data Source: Elastic Defend",
    "Data Source: Sysmon",
    "Resources: Investigation Guide",
]
type = "eql"

query = '''
sequence by process.entity_id with maxspan = 2m
[process where host.os.type == "windows" and event.type == "start" and
   (process.name : "WMIC.exe" or process.pe.original_file_name : "wmic.exe") and
   process.args : ("format*:*", "/format*:*", "*-format*:*") and
   not process.command_line : ("* /format:table *", "* /format:table")]
[any where host.os.type == "windows" and (event.category == "library" or (event.category == "process" and event.action : "Image loaded*")) and
 (?dll.name : ("jscript.dll", "vbscript.dll") or file.name : ("jscript.dll", "vbscript.dll"))]
'''

setup = """## Setup

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

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

### Additional data sources

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

- [Sysmon Event ID 1 - Process Creation](https://ela.st/sysmon-event-1-setup)
- [Sysmon Event ID 7 - Image Loaded](https://ela.st/sysmon-event-7-setup)
"""


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

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

[[rule.threat.technique]]
id = "T1220"
name = "XSL Script Processing"
reference = "https://attack.mitre.org/techniques/T1220/"

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

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

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

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

Stage 1: process

[process where host.os.type == "windows" and event.type == "start" and
   (process.name : "WMIC.exe" or process.pe.original_file_name : "wmic.exe") and
   process.args : ("format*:*", "/format*:*", "*-format*:*") and
   not process.command_line : ("* /format:table *", "* /format:table")]

Stage 2: any

[any where host.os.type == "windows" and (event.category == "library" or (event.category == "process" and event.action : "Image loaded*")) and
 (?dll.name : ("jscript.dll", "vbscript.dll") or file.name : ("jscript.dll", "vbscript.dll"))]

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
dll.namewildcard
  • jscript.dll corpus 4 (elastic 4)
  • vbscript.dll corpus 4 (elastic 4)
field:"dll.name" kind:wildcard
event.actionwildcard
  • Image loaded* corpus 10 (elastic 10)
field:"EventType" kind:wildcard value:"Image loaded*"
event.categoryeq
  • library corpus 11 (elastic 11)
  • process corpus 38 (elastic 38)
field:"event.category" kind:eq
event.typeeq
  • start corpus 1036 (elastic 1036)
field:"event.type" kind:eq value:"start"
file.namewildcard
  • jscript.dll
  • vbscript.dll
field:"file.name" kind:wildcard
process.argswildcard
  • *-format*:*
  • /format*:*
  • format*:*
field:"process.args" kind:wildcard
process.namewildcard
  • WMIC.exe corpus 66 (elastic 39, splunk 27)
field:"process_basename" kind:wildcard value:"WMIC.exe"
process.pe.original_file_namewildcard
  • wmic.exe corpus 74 (sigma 38, elastic 18, splunk 18)
field:"OriginalFileName" kind:wildcard value:"wmic.exe"

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.command_linewildcard* /format:table *, * /format:tableexcludes:process.command_line field:"process.command_line" value:"* /format:table *" field:"process.command_line" value:"* /format:table"

System File Ownership Change

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

Adversaries may modify file or directory ownership to evade access control lists (ACLs) and access protected files.

MITRE ATT&CK Coverage

Telemetry Coverage

Rule Body

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


[rule]
author = ["Elastic"]
description = "Adversaries may modify file or directory ownership to evade access control lists (ACLs) and access protected files."
from = "now-9m"
index = [
    "endgame-*",
    "logs-crowdstrike.fdr*",
    "logs-endpoint.events.process-*",
    "logs-m365_defender.event-*",
    "logs-sentinel_one_cloud_funnel.*",
    "logs-system.security*",
    "logs-windows.forwarded*",
    "logs-windows.sysmon_operational-*",
    "winlogbeat-*",
]
language = "eql"
license = "Elastic License v2"
name = "System File Ownership Change"
note = """## Triage and analysis

### Investigating System File Ownership Change

Adversaries may modify file or directory ownership to evade access control lists (ACLs) and access protected files.

#### Possible investigation steps

- Assess the ownership target file or directory and identify if it's a system critical file.
- Identify the user account that performed the action and whether it should perform this kind of action.
- 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.
- Investigate other alerts associated with the user/host during the past 48 hours.

### False positive analysis

- System updates, backup software and uninstallers tend to modify files ownership.

### Response and remediation

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

setup = """## Setup

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

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

### Additional data sources

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

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

risk_score = 47
rule_id = "7eb54028-ca72-4eb7-8185-b6864572347db"
severity = "medium"
tags = [
    "Domain: Endpoint",
    "OS: Windows",
    "Use Case: Threat Detection",
    "Tactic: Defense Evasion",
    "Tactic: Persistence",
    "Data Source: Elastic Endgame",
    "Resources: Investigation Guide",
    "Data Source: Elastic Defend",
    "Data Source: Windows Security Event Logs",
    "Data Source: Microsoft Defender XDR",
    "Data Source: Sysmon",
    "Data Source: SentinelOne",
    "Data Source: Crowdstrike",
]
timeline_id = "e70679c2-6cde-4510-9764-4823df18f7db"
timeline_title = "Comprehensive Process Timeline"
timestamp_override = "event.ingested"
type = "eql"

query = '''
process where host.os.type == "windows" and event.type == "start" and
  (
   (process.name : "icacls.exe" and process.args : "/reset") or
   (process.name : "takeown.exe" and process.args : "/f") or
   (process.name : "icacls.exe" and process.args : "/grant" and process.args : "Everyone:F")
   ) and
   process.command_line : "*.exe *C:\\Windows\\*"
'''


[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1222"
name = "File and Directory Permissions Modification"
reference = "https://attack.mitre.org/techniques/T1222/"
[[rule.threat.technique.subtechnique]]
id = "T1222.001"
name = "Windows File and Directory Permissions Modification"
reference = "https://attack.mitre.org/techniques/T1222/001/"



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

Stages and Predicates

Stage 1: process

process where host.os.type == "windows" and event.type == "start" and
  (
   (process.name : "icacls.exe" and process.args : "/reset") or
   (process.name : "takeown.exe" and process.args : "/f") or
   (process.name : "icacls.exe" and process.args : "/grant" and process.args : "Everyone:F")
   ) and
   process.command_line : "*.exe *C:\\Windows\\*"

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
  • /f corpus 5 (elastic 5)
  • /grant corpus 2 (elastic 2)
  • /reset corpus 2 (elastic 2)
  • Everyone:F corpus 2 (elastic 2)
field:"process.args" kind:wildcard
process.command_linewildcard
  • *.exe *C:\Windows\*
field:"CommandLine" kind:wildcard value:"*.exe *C:\Windows\*"
process.namewildcard
  • icacls.exe corpus 5 (elastic 5)
  • takeown.exe corpus 5 (elastic 4, splunk 1)
field:"process_basename" kind:wildcard

User or Group Creation/Modification

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

This rule leverages the "auditd_manager" integration to detect user or group creation or modification events on Linux systems. Threat actors may attempt to create or modify users or groups to establish persistence on the system.

MITRE ATT&CK Coverage

Rule Body

[metadata]
creation_date = "2024/06/20"
integration = ["auditd_manager"]
maturity = "production"
updated_date = "2026/03/24"

[rule]
author = ["Elastic"]
description = """
This rule leverages the "auditd_manager" integration to detect user or group creation or modification events on Linux
systems. Threat actors may attempt to create or modify users or groups to establish persistence on the system.
"""
from = "now-9m"
index = ["auditbeat-*", "logs-auditd_manager.auditd-*"]
language = "eql"
license = "Elastic License v2"
name = "User or Group Creation/Modification"
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 User or Group Creation/Modification

In Linux environments, user and group management is crucial for access control and system administration. Adversaries may exploit this by creating or modifying accounts to maintain unauthorized access. The detection rule utilizes audit logs to monitor successful user or group changes, flagging potential persistence tactics by correlating specific actions with known threat behaviors.

### Possible investigation steps

- Review the audit logs to identify the specific user or group account that was created or modified, focusing on the event.action field values such as "changed-password", "added-user-account", or "added-group-account-to".
- Check the timestamp of the event to determine when the account change occurred and correlate it with any other suspicious activities or alerts around the same time.
- Investigate the source of the event by examining the host information, particularly the host.os.type field, to understand which system the changes were made on.
- Identify the user or process that initiated the account change by reviewing the associated user information in the audit logs, which may provide insights into whether the action was authorized or potentially malicious.
- Cross-reference the identified user or group changes with known threat actor behaviors or recent incidents to assess if the activity aligns with any known persistence tactics.

### False positive analysis

- Routine administrative tasks may trigger alerts when system administrators create or modify user or group accounts as part of regular maintenance. To manage this, consider creating exceptions for known administrative accounts or scheduled maintenance windows.
- Automated scripts or configuration management tools that manage user accounts can generate false positives. Identify these tools and exclude their actions from triggering alerts by whitelisting their processes or user accounts.
- System updates or software installations that require user or group modifications might be flagged. Review the context of these changes and exclude specific update processes or installation scripts from the rule.
- Temporary user accounts created for short-term projects or testing purposes can be mistaken for unauthorized access attempts. Implement a naming convention for temporary accounts and exclude them from the rule to reduce noise.
- Changes made by trusted third-party services or applications that integrate with the system may appear suspicious. Verify these services and add them to an exception list to prevent unnecessary alerts.

### Response and remediation

- Immediately isolate the affected system from the network to prevent further unauthorized access or lateral movement by the adversary.
- Review the audit logs to identify the specific user or group accounts that were created or modified, and disable or remove any unauthorized accounts.
- Reset passwords for any compromised or suspicious accounts to prevent further unauthorized access.
- Conduct a thorough review of system and application logs to identify any additional unauthorized changes or suspicious activities that may have occurred.
- Escalate the incident to the security operations team for further investigation and to determine if additional systems have been compromised.
- Implement additional monitoring on the affected system and similar systems to detect any further unauthorized account activities.
- Review and update access control policies and procedures to prevent similar incidents in the future, ensuring that only authorized personnel have the ability to create or modify user and group accounts."""
references = ["https://www.elastic.co/security-labs/primer-on-persistence-mechanisms"]
risk_score = 21
rule_id = "fcf733d5-7801-4eb0-92ac-8ffacf3658f2"
setup = """## Setup

This rule requires data coming in from Auditd Manager.

### Auditd Manager Integration Setup
The Auditd Manager Integration receives audit events from the Linux Audit Framework which is a part of the Linux kernel.
Auditd Manager provides a user-friendly interface and automation capabilities for configuring and monitoring system auditing through the auditd daemon. With `auditd_manager`, administrators can easily define audit rules, track system events, and generate comprehensive audit reports, improving overall security and compliance in the system.

#### The following steps should be executed in order to add the Elastic Agent System integration "auditd_manager" on a Linux System:
- Go to the Kibana home page and click “Add integrations”.
- In the query bar, search for “Auditd Manager” and select the integration to see more details about it.
- Click “Add Auditd Manager”.
- Configure the integration name and optionally add a description.
- Review optional and advanced settings accordingly.
- Add the newly installed “auditd manager” to an existing or a new agent policy, and deploy the agent on a Linux system from which auditd log files are desirable.
- Click “Save and Continue”.
- For more details on the integration refer to the [helper guide](https://docs.elastic.co/integrations/auditd_manager).

#### Rule Specific Setup Note
Auditd Manager subscribes to the kernel and receives events as they occur without any additional configuration.
However, if more advanced configuration is required to detect specific behavior, audit rules can be added to the integration in either the "audit rules" configuration box or the "auditd rule files" box by specifying a file to read the audit rules from.
For this detection rule to trigger, the following additional audit rules are required to be added to the integration:
```
-w /usr/sbin/groupadd -p x -k group_modification
-w /sbin/groupadd -p x -k group_modification
-w /usr/sbin/groupmod -p x -k group_modification
-w /sbin/groupmod -p x -k group_modification
-w /usr/sbin/addgroup -p x -k group_modification
-w /sbin/addgroup -p x -k group_modification
-w /usr/sbin/usermod -p x -k user_modification
-w /sbin/usermod -p x -k user_modification
-w /usr/sbin/userdel -p x -k user_modification
-w /sbin/userdel -p x -k user_modification
-w /usr/sbin/useradd -p x -k user_modification
-w /sbin/useradd -p x -k user_modification
-w /usr/sbin/adduser -p x -k user_modification
-w /sbin/adduser -p x -k user_modification
```
"""
severity = "low"
tags = [
    "Domain: Endpoint",
    "OS: Linux",
    "Use Case: Threat Detection",
    "Tactic: Persistence",
    "Data Source: Auditd Manager",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
iam where host.os.type == "linux" and event.type in ("creation", "change") and auditd.result == "success" and
event.action in ("changed-password", "added-user-account", "added-group-account-to") and process.name != null
'''

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

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

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

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

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

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

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

[[rule.threat.technique.subtechnique]]
id = "T1098.007"
name = "Additional Local or Domain Groups"
reference = "https://attack.mitre.org/techniques/T1098/007/"

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

Stages and Predicates

Stage 1: iam

iam where host.os.type == "linux" and event.type in ("creation", "change") and auditd.result == "success" and
event.action in ("changed-password", "added-user-account", "added-group-account-to") and process.name != null

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
auditd.resulteq
  • success
field:"auditd.result" kind:eq value:"success"
event.actionin
  • added-group-account-to
  • added-user-account
  • changed-password
field:"EventType" kind:in
event.typein
  • change
  • creation
field:"event.type" kind:in
process.nameis_not_null
  • (no value, null check)
field:"process_basename" kind:is_not_null

Back to all Elastic rules