Detection rules › Elastic

Elastic rules: 35

Attempt to Disable Windows Defender Services

#
Source
github.com/elastic/protections-artifacts

Identifies attempt to stop or disable the Windows Defender services from an unusual parent process.

MITRE ATT&CK Coverage

TacticTechniques
Defense Impairment

Rule Body

[rule]
description = "Identifies attempt to stop or disable the Windows Defender services from an unusual parent process."
id = "32ab2977-2932-4172-9117-36e382591818"
license = "Elastic License v2"
name = "Attempt to Disable Windows Defender Services"
os_list = ["windows"]
reference = ["https://www.elastic.co/security-labs/luna-ransomware-attack-pattern"]
version = "1.0.28"

query = '''
process where event.action == "start" and
  process.pe.original_file_name : ("net.exe", "sc.exe", "cmd.exe") and
  process.command_line : ("*disabled*", "*stop*") and process.command_line : ("*WdNisSvc*", "*WinDefend*") and
    (process.parent.executable :
                    ("?:\\Windows\\Microsoft.NET\\*",
                     "?:\\Users\\*",
                     "?:\\ProgramData\\*") or
    process.parent.name : ("rundll32.exe", "regsvr32.exe", "wscript.exe", "cscript.exe", "powershell.exe", "mshta.exe"))
'''

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

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

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

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "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.action == "start" and
  process.pe.original_file_name : ("net.exe", "sc.exe", "cmd.exe") and
  process.command_line : ("*disabled*", "*stop*") and process.command_line : ("*WdNisSvc*", "*WinDefend*") and
    (process.parent.executable :
                    ("?:\\Windows\\Microsoft.NET\\*",
                     "?:\\Users\\*",
                     "?:\\ProgramData\\*") or
    process.parent.name : ("rundll32.exe", "regsvr32.exe", "wscript.exe", "cscript.exe", "powershell.exe", "mshta.exe"))

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
  • *WdNisSvc* corpus 2 (sigma 1, elastic 1)
  • *WinDefend* corpus 4 (sigma 3, elastic 1)
  • *disabled* corpus 7 (sigma 5, elastic 1, splunk 1)
  • *stop* corpus 8 (sigma 5, splunk 2, elastic 1)
field:"CommandLine" kind:wildcard
process.parent.executablewildcard
  • ?:\ProgramData\* corpus 2 (elastic 2)
  • ?:\Users\* corpus 2 (elastic 2)
  • ?:\Windows\Microsoft.NET\*
field:"ParentImage" kind:wildcard
process.parent.namewildcard
  • cscript.exe corpus 16 (elastic 15, splunk 1)
  • mshta.exe corpus 24 (elastic 22, splunk 2)
  • powershell.exe corpus 37 (elastic 35, splunk 1, kusto 1)
  • regsvr32.exe corpus 13 (elastic 13)
  • rundll32.exe corpus 20 (elastic 20)
  • wscript.exe corpus 24 (elastic 23, splunk 1)
field:"parent_process_basename" kind:wildcard
process.pe.original_file_namewildcard
  • cmd.exe corpus 75 (sigma 43, splunk 17, elastic 15)
  • net.exe corpus 25 (sigma 19, elastic 4, splunk 2)
  • sc.exe corpus 28 (sigma 12, splunk 10, elastic 6)
field:"OriginalFileName" kind:wildcard

Crypto Wallet or Web Browser File Access via Python

#
Source
github.com/elastic/protections-artifacts

Detects when Python 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 Python accesses crypto wallet or web browser files on a macOS system like crypto wallet files, or web
browser cookies.
"""
id = "cb8feeee-02f4-43bc-a836-4e510382acd3"
license = "Elastic License v2"
name = "Crypto Wallet or Web Browser File Access via Python"
os_list = ["macos"]
version = "1.0.6"

query = '''
file where event.action == "open" and (process.name like~ "python*" or Effective_process.name like~ "python*") 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")) and
   not file.path like "/Users/*/Library/Application Support/Slack/Cookies" and
   not Effective_process.executable like "/Applications/Vorta.app/Contents/MacOS/vorta-darwin"
'''

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 like~ "python*" or Effective_process.name like~ "python*") 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")) and
   not file.path like "/Users/*/Library/Application Support/Slack/Cookies" and
   not Effective_process.executable like "/Applications/Vorta.app/Contents/MacOS/vorta-darwin"

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
Effective_process.namewildcard
  • python*
field:"Effective_process.name" kind:wildcard value:"python*"
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.namewildcard
  • python* corpus 55 (elastic 55)
field:"process_basename" kind:wildcard value:"python*"

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
Effective_process.executableeq/Applications/Vorta.app/Contents/MacOS/vorta-darwinexcludes:Effective_process.executable field:"Effective_process.executable" value:"/Applications/Vorta.app/Contents/MacOS/vorta-darwin"
file.pathwildcard/Users/*/Library/Application Support/Slack/Cookiesexcludes:file.path field:"file.path" value:"/Users/*/Library/Application Support/Slack/Cookies"

DebugFS Execution Detected via Defend for Containers

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

This rule detects the use of the built-in Linux DebugFS utility from inside a privileged container. DebugFS is a special file system debugging utility which supports reading and writing directly from a hard drive device. When launched inside a privileged container, a container deployed with all the capabilities of the host machine, an attacker can access sensitive host level files which could be used for further privilege escalation and container escapes to the host machine.

MITRE ATT&CK Coverage

TacticTechniques
Privilege Escalation
Stealth

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 the use of the built-in Linux DebugFS utility from inside a privileged container. DebugFS is a special
file system debugging utility which supports reading and writing directly from a hard drive device. When launched inside
a privileged container, a container deployed with all the capabilities of the host machine, an attacker can access
sensitive host level files which could be used for further privilege escalation and container escapes to the host
machine.
"""
from = "now-6m"
index = ["logs-cloud_defend.process*"]
interval = "5m"
language = "eql"
license = "Elastic License v2"
name = "DebugFS Execution 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 DebugFS Execution Detected via Defend for Containers

DebugFS is a Linux utility for direct file system manipulation, often used for debugging. In a privileged container, which has extensive access to the host, adversaries can exploit DebugFS to access sensitive host files, potentially leading to privilege escalation or container escape. The detection rule identifies suspicious DebugFS usage by monitoring process initiation with specific arguments in privileged containers, flagging potential misuse.

### Possible investigation steps

- Review the alert details to confirm the process name is "debugfs" and check the specific arguments used, particularly looking for "/dev/sd*" to identify potential access to host file systems.
- Verify the container's security context to ensure it is indeed privileged, as this increases the risk of host-level access.
- Investigate the origin of the container image and deployment configuration to determine if the use of a privileged container was intentional or necessary.
- Check the user or service account that initiated the process to assess if it aligns with expected behavior or if it indicates potential unauthorized access.
- Examine recent logs and events from the container and host to identify any unusual activities or patterns that coincide with the alert.
- Assess the potential impact by identifying any sensitive files or directories that may have been accessed or modified by the debugfs process.

### False positive analysis

- Routine maintenance tasks using DebugFS in privileged containers can trigger alerts. To manage this, identify and document regular maintenance processes and create exceptions for these specific processes.
- Automated scripts or tools that utilize DebugFS for legitimate monitoring or debugging purposes may cause false positives. Review these scripts and whitelist them by excluding their specific process arguments or execution contexts.
- Development and testing environments often run privileged containers with DebugFS for debugging purposes. Establish a separate set of rules or exceptions for these environments to prevent unnecessary alerts.
- Backup or recovery operations that involve direct disk access might use DebugFS. Ensure these operations are well-documented and create exceptions based on their unique process signatures or execution schedules.

### Response and remediation

- Immediately isolate the affected container to prevent further access to sensitive host files. This can be done by stopping the container or removing its network access.
- Conduct a thorough review of the container's security context and capabilities to ensure it does not have unnecessary privileges. Adjust the container's configuration to remove privileged access if not required.
- Analyze the container's logs and process history to identify any unauthorized access or actions taken by the DebugFS utility. This will help determine the extent of the potential breach.
- If unauthorized access to host files is confirmed, perform a security assessment of the host system to identify any changes or breaches. This may include checking for new user accounts, modified files, or unexpected network connections.
- Escalate the incident to the security operations team for further investigation and to determine if additional systems may be affected. Provide them with all relevant logs and findings.
- Implement additional monitoring and alerting for similar activities across other containers and hosts to detect any recurrence of this threat.
- Review and update container deployment policies to enforce the principle of least privilege, ensuring containers only have the necessary permissions to perform their intended functions."""
references = [
    "https://cyberark.wistia.com/medias/ygbzkzx93q?wvideo=ygbzkzx93q",
    "https://book.hacktricks.xyz/linux-hardening/privilege-escalation/docker-security/docker-breakout-privilege-escalation#privileged",
]
risk_score = 47
rule_id = "97697a52-4a76-4f0a-aa4f-25c178aae6eb"
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 = '''
process where host.os.type == "linux" and event.type == "start" and event.action == "exec" and (
  process.name == "debugfs" or
  (
    /* account for tools that execute utilities as a subprocess, in this case the target utility name will appear as a process arg */
    process.name in ("bash", "dash", "sh", "tcsh", "csh", "zsh", "ksh", "fish", "busybox") and
    process.args in (
      "debugfs", "/bin/debugfs", "/usr/bin/debugfs", "/usr/local/bin/debugfs"
    ) and
    /* default exclusion list to not FP on default multi-process commands */
    not process.args in (
      "which", "/bin/which", "/usr/bin/which", "/usr/local/bin/which",
      "man", "/bin/man", "/usr/bin/man", "/usr/local/bin/man",
      "chmod", "/bin/chmod", "/usr/bin/chmod", "/usr/local/bin/chmod",
      "chown", "/bin/chown", "/usr/bin/chown", "/usr/local/bin/chown"
    )
  )
) and
process.args like "/dev/sd*" and not process.args == "-R" and
container.security_context.privileged == true 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 = "T1006"
name = "Direct Volume Access"
reference = "https://attack.mitre.org/techniques/T1006/"

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

Stages and Predicates

Stage 1: process

process where host.os.type == "linux" and event.type == "start" and event.action == "exec" and (
  process.name == "debugfs" or
  (
    process.name in ("bash", "dash", "sh", "tcsh", "csh", "zsh", "ksh", "fish", "busybox") and
    process.args in (
      "debugfs", "/bin/debugfs", "/usr/bin/debugfs", "/usr/local/bin/debugfs"
    ) and
    not process.args in (
      "which", "/bin/which", "/usr/bin/which", "/usr/local/bin/which",
      "man", "/bin/man", "/usr/bin/man", "/usr/local/bin/man",
      "chmod", "/bin/chmod", "/usr/bin/chmod", "/usr/local/bin/chmod",
      "chown", "/bin/chown", "/usr/bin/chown", "/usr/local/bin/chown"
    )
  )
) and
process.args like "/dev/sd*" and not process.args == "-R" and
container.security_context.privileged == true and container.id like "*"

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.argseq-Rexcludes:process.args field:"process.args" value:"-R"

Domain Accounts Enumeration via LDAP Search

#
Source
github.com/elastic/protections-artifacts

Identifies a list of suspicious LDAP queries often used by reconnaissance tools to enumerate domain user accounts.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = "Identifies a list of suspicious LDAP queries often used by reconnaissance tools to enumerate domain user accounts."
id = "c3b3cd2e-04f5-457f-8d69-f92468f22eae"
license = "Elastic License v2"
name = "Domain Accounts Enumeration via LDAP Search"
os_list = ["windows"]
reference = ["https://attack.mitre.org/techniques/T1087/002/"]
version = "1.0.3"

query = '''
api where process.Ext.api.name == "ldap_search" and not user.id in ("S-1-5-18", "S-1-5-19", "S-1-5-20") and
 not process.executable :
             ("?:\\Program Files\\Azure Advanced Threat Protection Sensor\\*\\Microsoft.Tri.Sensor.exe",
              "?:\\Windows\\ADFS\\Microsoft.IdentityServer.ServiceHost.exe") and
 process.Ext.api.parameters.search_filter : (
  "(&(samAccountType=805306368)(samAccountName=?)",
  "(&(objectCategory=person)(lastLogon>=*",
  "(&(objectCategory=person)(objectClass=user)(lastLogon>=*",
  "(&(objectCategory=person)(objectClass=user)(directReports=?)(!(manager=?)))"
 )
'''

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

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1087"
name = "Account Discovery"
reference = "https://attack.mitre.org/techniques/T1087/"
[[threat.technique.subtechnique]]
id = "T1087.002"
name = "Domain Account"
reference = "https://attack.mitre.org/techniques/T1087/002/"


[[threat.technique]]
id = "T1482"
name = "Domain Trust Discovery"
reference = "https://attack.mitre.org/techniques/T1482/"


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

[internal]
min_endpoint_version = "9.1.0"

Stages and Predicates

Stage 1: api

api where process.Ext.api.name == "ldap_search" and not user.id in ("S-1-5-18", "S-1-5-19", "S-1-5-20") and
 not process.executable :
             ("?:\\Program Files\\Azure Advanced Threat Protection Sensor\\*\\Microsoft.Tri.Sensor.exe",
              "?:\\Windows\\ADFS\\Microsoft.IdentityServer.ServiceHost.exe") and
 process.Ext.api.parameters.search_filter : (
  "(&(samAccountType=805306368)(samAccountName=?)",
  "(&(objectCategory=person)(lastLogon>=*",
  "(&(objectCategory=person)(objectClass=user)(lastLogon>=*",
  "(&(objectCategory=person)(objectClass=user)(directReports=?)(!(manager=?)))"
 )

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
process.Ext.api.nameeq
  • ldap_search corpus 14 (elastic 14)
field:"process.Ext.api.name" kind:eq value:"ldap_search"
process.Ext.api.parameters.search_filterwildcard
  • (&(objectCategory=person)(lastLogon>=*
  • (&(objectCategory=person)(objectClass=user)(directReports=?)(!(manager=?))) corpus 2 (elastic 2)
  • (&(objectCategory=person)(objectClass=user)(lastLogon>=*
  • (&(samAccountType=805306368)(samAccountName=?)
field:"process.Ext.api.parameters.search_filter" kind:wildcard

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.executablewildcard?:\Program Files\Azure Advanced Threat Protection Sensor\*\Microsoft.Tri.Sensor.exe, ?:\Windows\ADFS\Microsoft.IdentityServer.ServiceHost.exeexcludes:process.executable field:"process.executable" value:"?:\Program Files\Azure Advanced Threat Protection Sensor\*\Microsoft.Tri.Sensor.exe" field:"process.executable" value:"?:\Windows\ADFS\Microsoft.IdentityServer.ServiceHost.exe"
user.idinS-1-5-18, S-1-5-19, S-1-5-20excludes:user.id field:"user.id" value:"S-1-5-18" field:"user.id" value:"S-1-5-19" field:"user.id" value:"S-1-5-20"

Endpoint Security Evasion via Malicious AppLocker Deny Rules

#
Source
github.com/elastic/protections-artifacts

Detects the creation or modification of AppLocker executable rules that explicitly deny execution of known endpoint security or EDR components by file path. Adversaries may abuse AppLocker policies to prevent security agents from starting after reboot or policy refresh, resulting in impaired defensive visibility and protection on the endpoint.

MITRE ATT&CK Coverage

TacticTechniques
Defense Impairment

Rule Body

[rule]
description = """
Detects the creation or modification of AppLocker executable rules that explicitly deny execution of known endpoint
security or EDR components by file path. Adversaries may abuse AppLocker policies to prevent security agents from
starting after reboot or policy refresh, resulting in impaired defensive visibility and protection on the endpoint.
"""
id = "2ace03f0-e37f-444a-a208-fa6da672f73c"
license = "Elastic License v2"
name = "Endpoint Security Evasion via Malicious AppLocker Deny Rules"
os_list = ["windows"]
reference = ["https://github.com/zero2504/EDR-GhostLocker/tree/main"]
version = "1.0.1"

query = '''
registry where event.action == "modification" and registry.value == "Value" and
 registry.path : "H*\\Software\\Policies\\Microsoft\\Windows\\SrpV2\\Exe\\*\\Value" and
 registry.data.strings : "*Deny*" and
 registry.data.strings : ("*Elastic*",
                          "*WinDefend*",
                          "*MsMpEng*",
                          "*MpDefenderCoreService*",
                          "*Windows Defender*",
                          "*CrowdStrike*",
                          "*SentinelOne*")
'''

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

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



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

[internal]
min_endpoint_version = "7.16.0"

Stages and Predicates

Stage 1: registry

registry where event.action == "modification" and registry.value == "Value" and
 registry.path : "H*\\Software\\Policies\\Microsoft\\Windows\\SrpV2\\Exe\\*\\Value" and
 registry.data.strings : "*Deny*" and
 registry.data.strings : ("*Elastic*",
                          "*WinDefend*",
                          "*MsMpEng*",
                          "*MpDefenderCoreService*",
                          "*Windows Defender*",
                          "*CrowdStrike*",
                          "*SentinelOne*")

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • modification corpus 72 (elastic 72)
field:"EventType" kind:eq value:"modification"
registry.data.stringswildcard
  • *CrowdStrike*
  • *Deny*
  • *Elastic*
  • *MpDefenderCoreService*
  • *MsMpEng*
  • *SentinelOne*
  • *WinDefend*
  • *Windows Defender*
field:"Details" kind:wildcard
registry.pathwildcard
  • H*\Software\Policies\Microsoft\Windows\SrpV2\Exe\*\Value
field:"TargetObject" kind:wildcard value:"H*\Software\Policies\Microsoft\Windows\SrpV2\Exe\*\Value"
registry.valueeq
  • Value
field:"registry_value_name" kind:eq value:"Value"

Enumeration of Administrator Accounts

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

Identifies instances of lower privilege accounts enumerating Administrator accounts or groups using built-in Windows tools.

MITRE ATT&CK Coverage

Telemetry Coverage

Rule Body

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

[rule]
author = ["Elastic"]
description = """
Identifies instances of lower privilege accounts enumerating Administrator accounts or groups using built-in Windows
tools.
"""
from = "now-9m"
index = [
    "endgame-*",
    "logs-crowdstrike.fdr*",
    "logs-endpoint.events.process-*",
    "logs-m365_defender.event-*",
    "logs-system.security*",
    "logs-windows.forwarded*",
    "winlogbeat-*",
]
language = "eql"
license = "Elastic License v2"
name = "Enumeration of Administrator Accounts"
note = """## Triage and analysis

### Investigating Enumeration of Administrator Accounts

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

This rule looks for the execution of the `net` and `wmic` utilities to enumerate administrator-related users or groups in the domain and local machine scope. Attackers can use this information to plan their next steps of the attack, such as mapping targets for credential compromise and other post-exploitation activities.

#### Possible investigation steps

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

### False positive analysis

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

### Related rules

- AdFind Command Activity - eda499b8-a073-4e35-9733-22ec71f57f3a

### Response and remediation

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

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

risk_score = 21
rule_id = "871ea072-1b71-4def-b016-6278b505138d"
severity = "low"
tags = [
    "Domain: Endpoint",
    "OS: Windows",
    "Use Case: Threat Detection",
    "Tactic: Discovery",
    "Resources: Investigation Guide",
    "Data Source: Elastic Endgame",
    "Data Source: Elastic Defend",
    "Data Source: Windows Security Event Logs",
    "Data Source: Microsoft Defender XDR",
    "Data Source: Crowdstrike",
]
timestamp_override = "event.ingested"
type = "eql"

query = '''
process where host.os.type == "windows" and event.type == "start" and
(
  (
    (
      (process.name : "net.exe" or ?process.pe.original_file_name == "net.exe") or
      ((process.name : "net1.exe" or ?process.pe.original_file_name == "net1.exe") and not process.parent.name : "net.exe")
    ) and
    process.args : ("group", "user", "localgroup") and
    process.args : ("*admin*", "Domain Admins", "Remote Desktop Users", "Enterprise Admins", "Organization Management")
    and not process.args : ("/add", "/delete")
  ) or
  (
    (process.name : "wmic.exe" or ?process.pe.original_file_name == "wmic.exe") and
    process.args : ("group", "useraccount")
  )
) and not user.id : ("S-1-5-18", "S-1-5-19", "S-1-5-20")
'''


[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1069"
name = "Permission Groups Discovery"
reference = "https://attack.mitre.org/techniques/T1069/"
[[rule.threat.technique.subtechnique]]
id = "T1069.001"
name = "Local Groups"
reference = "https://attack.mitre.org/techniques/T1069/001/"

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


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

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



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

Stages and Predicates

Stage 1: process

process where host.os.type == "windows" and event.type == "start" and
(
  (
    (
      (process.name : "net.exe" or ?process.pe.original_file_name == "net.exe") or
      ((process.name : "net1.exe" or ?process.pe.original_file_name == "net1.exe") and not process.parent.name : "net.exe")
    ) and
    process.args : ("group", "user", "localgroup") and
    process.args : ("*admin*", "Domain Admins", "Remote Desktop Users", "Enterprise Admins", "Organization Management")
    and not process.args : ("/add", "/delete")
  ) or
  (
    (process.name : "wmic.exe" or ?process.pe.original_file_name == "wmic.exe") and
    process.args : ("group", "useraccount")
  )
) and not user.id : ("S-1-5-18", "S-1-5-19", "S-1-5-20")

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
  • *admin*
  • Domain Admins
  • Enterprise Admins
  • Organization Management
  • Remote Desktop Users
  • group corpus 3 (elastic 3)
  • localgroup corpus 2 (elastic 2)
  • user corpus 4 (elastic 4)
  • useraccount
field:"process.args" kind:wildcard
process.namewildcard
  • net.exe corpus 30 (elastic 27, splunk 2, kusto 1)
  • net1.exe corpus 40 (elastic 21, splunk 19)
  • wmic.exe corpus 66 (elastic 39, splunk 27)
field:"process_basename" kind:wildcard
process.pe.original_file_nameeq
  • net.exe corpus 7 (elastic 7)
  • net1.exe corpus 6 (elastic 6)
  • wmic.exe corpus 6 (elastic 6)
field:"OriginalFileName" kind:eq

Exclusions

The rule actively suppresses these predicates.

Kernel Module Loaded with Tainting Flags

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

This rule detects the loading of tainted kernel modules on Linux systems. A tainted kernel module indicates that the module is not officially supported or may have been modified. Attackers may load tainted kernel modules to maintain persistence or evade detection on the system. This may be a sign of malicious activity involving kernel modules.

MITRE ATT&CK Coverage

Rule Body

[metadata]
creation_date = "2026/08/05"
integration = ["endpoint"]
maturity = "production"
min_stack_version = "9.5.0"
min_stack_comments = "The process.Ext.load_module.taint_flags field was introduced in 9.5.0, and is required for this rule to function."
updated_date = "2026/08/05"

[rule]
author = ["Elastic"]
description = """
This rule detects the loading of tainted kernel modules on Linux systems. A tainted kernel module indicates that
the module is not officially supported or may have been modified. Attackers may load tainted kernel modules to
maintain persistence or evade detection on the system. This may be a sign of malicious activity involving kernel
modules.
"""
from = "now-9m"
index = ["logs-endpoint.events.process*"]
language = "eql"
license = "Elastic License v2"
name = "Kernel Module Loaded with Tainting Flags"
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 Kernel Module Loaded with Tainting Flags

This alert triggers when Linux loads a kernel module marked tainted, which means the code is unsupported, altered, or built outside the trusted kernel tree. That matters because kernel-level code can bypass normal visibility, tamper with system behavior, and help an intruder persist on the host. A common attacker pattern is loading a custom rootkit module after gaining root access to hook system calls and hide backdoor processes or network activity.

### Possible investigation steps

- Determine whether the module is expected for the host by validating it against approved drivers, security tools, recent kernel updates, hardware changes, and any open change requests with the system owner.
- Collect the module’s file path, hash, package ownership, signer status, and build metadata, then compare them with trusted baselines or vendor artifacts to identify tampering or an out-of-band build.
- Review kernel, audit, and system logs around the load time for preceding root-level activity, module insertion commands, boot-time scripts, service changes, or errors that explain how the module was introduced.
- Assess the host for post-load impact such as hidden processes or sockets, disabled security controls, unusual kernel hooks, or persistence via startup configuration that would indicate malicious kernel-level behavior.
- If the module is not approved or cannot be verified, isolate the host, preserve volatile evidence and a copy of the module for forensic analysis, and plan controlled removal with reboot validation to confirm the kernel returns to an expected state.

### False positive analysis

- An administrator may legitimately load an out-of-tree or locally compiled driver after a kernel update or hardware change, which can set taint flags; verify the module path, hash, and package or build records match an approved change for the host.
- A Linux system may load an unsigned or unsupported module during maintenance, troubleshooting, or compatibility testing, causing a benign taint event; confirm the load time aligns with documented admin activity and that the same module is expected on similar hosts.

### Response and remediation

- Immediately isolate the affected Linux host from all production networks except a trusted containment channel, stop nonessential remote access, and preserve the loaded module file and related boot artifacts before any cleanup.
- Remove attacker persistence by deleting the module from disk and clearing every load path that references it, including `/etc/modules`, `/etc/modules-load.d/`, initramfs or dracut hooks, DKMS builds, kernel command lines, and any systemd unit or script that runs `insmod` or `modprobe`.
- Restore the system to a known-good state by rebuilding or reimaging from a trusted baseline, reinstalling vendor-signed kernel packages, regenerating initramfs, and rebooting into the clean kernel rather than relying on module unload alone.
- Escalate immediately to incident response if the same tainted module or hash appears on more than one host, if you find signs of kernel tampering such as hidden processes or modified system call behavior, or if Secure Boot or module-signing protections were bypassed.
- After containment, rotate credentials used on the host, review adjacent systems for the same module filename, hash, startup scripts, or package changes, and harden Linux endpoints by enforcing Secure Boot, kernel module signing, lockdown mode, least-privilege admin access, and alerting on new out-of-tree module loads.
"""
risk_score = 47
rule_id = "cc3dab79-3706-4775-9404-a722e2b00fed"
setup = """## Setup

This rule requires data coming in from Elastic Defend.

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

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

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

[[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.threat]]
framework = "MITRE ATT&CK"

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

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

Stages and Predicates

Stage 1: process

process where host.os.type == "linux" and event.type == "start" and event.action == "load_module" and
process.Ext.load_module.taint_flags != null

Indicators

These rows show field, operator, and value matches.

Kubernetes Static Pod Manifest File Access

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

Detects Linux process executions where shells, editors, interpreters, or file/stream utilities reference /etc/kubernetes/manifests in process arguments. That directory holds static pod manifests read by the kubelet; interaction via editors, downloaders, kubectl, redirection helpers (tee, dd), or scripting runtimes may indicate staging or tampering with manifests for persistence or privileged workload placement. Pairs with file-telemetry rules that flag direct manifest creation on container workloads.

Known False Positives

  • Cluster provisioning (kubeadm), configuration management, or administrators editing manifests during maintenance may match. Baseline approved automation and interactive admin sessions on control plane nodes.

MITRE ATT&CK Coverage

Rule Body

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

[rule]
author = ["Elastic"]
description = """
Detects Linux process executions where shells, editors, interpreters, or file/stream utilities reference
/etc/kubernetes/manifests in process arguments. That directory holds static pod manifests read by the kubelet;
interaction via editors, downloaders, kubectl, redirection helpers (tee, dd), or scripting runtimes may indicate
staging or tampering with manifests for persistence or privileged workload placement. Pairs with file-telemetry rules
that flag direct manifest creation on container workloads.
"""
false_positives = [
    """
    Cluster provisioning (kubeadm), configuration management, or administrators editing manifests during maintenance may
    match. Baseline approved automation and interactive admin sessions on control plane nodes.
    """,
]
from = "now-9m"
index = ["auditbeat-*", "logs-auditd_manager.auditd-*", "logs-endpoint.events.process*"]
language = "kuery"
license = "Elastic License v2"
name = "Kubernetes Static Pod Manifest File Access"
note = """## Triage and analysis

### Investigating Kubernetes Static Pod Manifest File Access

Review the full command line (process.args, process.command_line), user.id, user.name, process.parent, and whether the
session was interactive. Confirm if the host is a Kubernetes node or admin jump host where manifest edits are expected.

### Possible investigation steps

- Compare activity to change windows and identity baselines; prioritize events without matching change tickets.
- Inspect subsequent process and file events on the same host for writes under /etc/kubernetes/manifests or kubelet
  restarts.
- Correlate with Kubernetes audit logs and node/agent telemetry for related compromise indicators.

### Response and remediation

- If unauthorized, restore manifests from known-good sources, isolate the host, and review cluster integrity per incident
  policy.
"""
references = [
    "https://kubernetes.io/docs/tasks/configure-pod-container/static-pod/",
    "https://attack.mitre.org/techniques/T1053/007/",
]
risk_score = 47
rule_id = "a698a653-e144-4e40-bade-35135935be45"
setup = """## Setup

Requires **Elastic Defend** and/or **Auditd Manager** process telemetry (`logs-endpoint.events.process*`,
`logs-auditd_manager.auditd-*`, `auditbeat-*`) with command-line argument capture for exec events.

### Elastic Defend
Install the Elastic Defend integration via Fleet on Linux hosts and use a policy that collects process events with
arguments.

### Auditd Manager
Deploy Auditd Manager and ensure execve (or equivalent process) auditing is enabled so `process.args` and
`process.executable` populate for monitored binaries.

See https://docs.elastic.co/integrations/auditd_manager
"""
severity = "medium"
tags = [
    "Data Source: Auditd Manager",
    "Data Source: Elastic Defend",
    "Domain: Endpoint",
    "Domain: Kubernetes",
    "Domain: Container",
    "OS: Linux",
    "Use Case: Threat Detection",
    "Tactic: Persistence",
    "Tactic: Privilege Escalation",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "query"
query = '''
host.os.type:linux and event.category:process and event.action:(exec or executed) and 
process.name:(
  bash or sh or dash or zsh or 
  cat or cp or mv or touch or tee or dd or
  sed or awk or 
  curl or wget or scp or
  vi or vim or nano or echo or
  busybox or
  python* or perl* or ruby* or node or lua* or
  openssl or base64 or xxd or
  .*) and 
  process.args:(*/etc/kubernetes/manifests/* and not (/etc/kubernetes/manifests/etcd* or /etc/kubernetes/manifests/kube-apiserver* or /etc/kubernetes/manifests/kube-scheduler* or /etc/kubernetes/manifests/kube-controller-manager*)) and 
  not (process.args :printf* and process.working_directory :/home/*-svc-nessus) and 
  not process.parent.executable :("/opt/nessus/sbin/nessusd" or "/opt/nessus_agent/sbin/nessus-agent-module")
'''

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

[[rule.threat.technique]]
id = "T1053"
name = "Scheduled Task/Job"
reference = "https://attack.mitre.org/techniques/T1053/"

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

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

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

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

Stages and Predicates

Stage 1: query

host.os.type:linux and event.category:process and event.action:(exec or executed) and 
process.name:(
  bash or sh or dash or zsh or 
  cat or cp or mv or touch or tee or dd or
  sed or awk or 
  curl or wget or scp or
  vi or vim or nano or echo or
  busybox or
  python* or perl* or ruby* or node or lua* or
  openssl or base64 or xxd or
  .*) and 
  process.args:(*/etc/kubernetes/manifests/* and not (/etc/kubernetes/manifests/etcd* or /etc/kubernetes/manifests/kube-apiserver* or /etc/kubernetes/manifests/kube-scheduler* or /etc/kubernetes/manifests/kube-controller-manager*)) and 
  not (process.args :printf* and process.working_directory :/home/*-svc-nessus) and 
  not process.parent.executable :("/opt/nessus/sbin/nessusd" or "/opt/nessus_agent/sbin/nessus-agent-module")

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actionin
  • exec
  • executed
field:"EventType" kind:in
event.categoryeq
  • process
field:"event.category" kind:eq value:"process"
process.argswildcard
  • */etc/kubernetes/manifests/*
field:"process.args" kind:wildcard value:"*/etc/kubernetes/manifests/*"
process.nameeq
  • awk
  • base64
  • bash
  • busybox
  • cat
  • cp
  • curl
  • dash
  • dd
  • echo
  • mv
  • nano
  • node
  • openssl
  • scp
  • sed
  • sh
  • tee
  • touch
  • vi
  • vim
  • wget
  • xxd
  • zsh
field:"process_basename" kind:eq
process.namewildcard
  • .*
  • lua*
  • perl*
  • python*
  • ruby*
field:"process_basename" kind:wildcard

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.argsstarts_with/etc/kubernetes/manifests/etcdexcludes:process.args field:"process.args" value:"/etc/kubernetes/manifests/etcd"
process.argsstarts_with/etc/kubernetes/manifests/kube-apiserverexcludes:process.args field:"process.args" value:"/etc/kubernetes/manifests/kube-apiserver"
process.argsstarts_with/etc/kubernetes/manifests/kube-controller-managerexcludes:process.args field:"process.args" value:"/etc/kubernetes/manifests/kube-controller-manager"
process.argsstarts_with/etc/kubernetes/manifests/kube-schedulerexcludes:process.args field:"process.args" value:"/etc/kubernetes/manifests/kube-scheduler"
process.argsstarts_withprintfexcludes:process.args field:"process.args" value:"printf"
process.working_directorywildcard/home/*-svc-nessusexcludes:process.working_directory field:"process.working_directory" value:"/home/*-svc-nessus"
process.parent.executablein/opt/nessus/sbin/nessusd, /opt/nessus_agent/sbin/nessus-agent-moduleexcludes:process.parent.executable field:"process.parent.executable" value:"/opt/nessus/sbin/nessusd" field:"process.parent.executable" value:"/opt/nessus_agent/sbin/nessus-agent-module"

Library Loaded via a Worker Callback

#
Source
github.com/elastic/protections-artifacts

Identifies the load of a library indirectly via a callback function. This may be the result of an evasion attempt to hide the origin of the API call from the call stack such as unbacked memory region.

MITRE ATT&CK Coverage

TacticTechniques
Stealth

Rule Body

[rule]
description = """
Identifies the load of a library indirectly via a callback function. This may be the result of an evasion attempt to
hide the origin of the API call from the call stack such as unbacked memory region.
"""
id = "b2beb283-0a5c-4a7c-bd97-54b920392897"
license = "Elastic License v2"
name = "Library Loaded via a Worker Callback"
os_list = ["windows"]
reference = [
    "https://www.elastic.co/security-labs/doubling-down-etw-callstacks",
    "https://0xdarkvortex.dev/hiding-in-plainsight/",
]
version = "1.0.4"

query = '''
library where dll.name : ("ws2_32.dll", "winhttp.dll", "wininet.dll") and process.name != null and
 process.thread.Ext.call_stack_summary like "ntdll.dll|kernelbase.dll|*|ntdll.dll|kernel32.dll|ntdll.dll" and
 not process.thread.Ext.call_stack_summary like "ntdll.dll|kernelbase.dll|*|*|ntdll.dll|kernel32.dll|ntdll.dll" and
 not stringcontains~(process.thread.Ext.call_stack_summary, process.name) and
 not (user.id in ("S-1-5-18", "S-1-5-19", "S-1-5-20") and
      process.executable : ("C:\\Windows\\System32\\svchost.exe",
                            "C:\\Windows\\System32\\lsass.exe",
                            "C:\\Windows\\System32\\LogonUI.exe")) and
 not process.thread.Ext.call_stack_summary in ("ntdll.dll|kernelbase.dll|smartcardcredentialprovider.dll|ntdll.dll|kernel32.dll|ntdll.dll",
                                               "ntdll.dll|kernelbase.dll|hostshellextension.dll|ntdll.dll|kernel32.dll|ntdll.dll",
                                               "ntdll.dll|kernelbase.dll|wsmsvc.dll|ntdll.dll|kernel32.dll|ntdll.dll",
                                               "ntdll.dll|kernelbase.dll|ws2_32.dll|ntdll.dll|kernel32.dll|ntdll.dll",
                                               "ntdll.dll|kernelbase.dll|das.dll|ntdll.dll|kernel32.dll|ntdll.dll",
                                               "ntdll.dll|kernelbase.dll|lucanet.dll|ntdll.dll|kernel32.dll|ntdll.dll") and
 not (process.code_signature.trusted == true and process.code_signature.subject_name : ("SentinelOne Inc.", "Sentinelone, Inc.", "Sentinel Labs, Inc.", "Bitglass, LLC", "Adobe Inc.")) and
 not (process.code_signature.trusted == true and process.code_signature.subject_name == "LucaNet AG" and process.executable : "C:\\Program Files\\LucaNet\\Youniverse\\.bin\\LucaNet.exe") and
 _arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info : ("*ntdll.dll!TppWorkpExecuteCallback*", "*ntdll.dll!TppWorkerThread*", "*ntdll.dll!RtlClearThreadWorkOnBehalfTicket*"))
'''

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

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


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

[internal]
min_endpoint_version = "8.10.0"

Stages and Predicates

Stage 1: library

library where dll.name : ("ws2_32.dll", "winhttp.dll", "wininet.dll") and process.name != null and
 process.thread.Ext.call_stack_summary like "ntdll.dll|kernelbase.dll|*|ntdll.dll|kernel32.dll|ntdll.dll" and
 not process.thread.Ext.call_stack_summary like "ntdll.dll|kernelbase.dll|*|*|ntdll.dll|kernel32.dll|ntdll.dll" and
 not stringcontains~(process.thread.Ext.call_stack_summary, process.name) and
 not (user.id in ("S-1-5-18", "S-1-5-19", "S-1-5-20") and
      process.executable : ("C:\\Windows\\System32\\svchost.exe",
                            "C:\\Windows\\System32\\lsass.exe",
                            "C:\\Windows\\System32\\LogonUI.exe")) and
 not process.thread.Ext.call_stack_summary in ("ntdll.dll|kernelbase.dll|smartcardcredentialprovider.dll|ntdll.dll|kernel32.dll|ntdll.dll",
                                               "ntdll.dll|kernelbase.dll|hostshellextension.dll|ntdll.dll|kernel32.dll|ntdll.dll",
                                               "ntdll.dll|kernelbase.dll|wsmsvc.dll|ntdll.dll|kernel32.dll|ntdll.dll",
                                               "ntdll.dll|kernelbase.dll|ws2_32.dll|ntdll.dll|kernel32.dll|ntdll.dll",
                                               "ntdll.dll|kernelbase.dll|das.dll|ntdll.dll|kernel32.dll|ntdll.dll",
                                               "ntdll.dll|kernelbase.dll|lucanet.dll|ntdll.dll|kernel32.dll|ntdll.dll") and
 not (process.code_signature.trusted == true and process.code_signature.subject_name : ("SentinelOne Inc.", "Sentinelone, Inc.", "Sentinel Labs, Inc.", "Bitglass, LLC", "Adobe Inc.")) and
 not (process.code_signature.trusted == true and process.code_signature.subject_name == "LucaNet AG" and process.executable : "C:\\Program Files\\LucaNet\\Youniverse\\.bin\\LucaNet.exe") and
 _arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info : ("*ntdll.dll!TppWorkpExecuteCallback*", "*ntdll.dll!TppWorkerThread*", "*ntdll.dll!RtlClearThreadWorkOnBehalfTicket*"))

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
dll.namewildcard
  • winhttp.dll corpus 16 (elastic 16)
  • wininet.dll corpus 18 (elastic 18)
  • ws2_32.dll corpus 19 (elastic 19)
field:"dll.name" kind:wildcard
process.nameis_not_null
  • (no value, null check)
field:"process_basename" kind:is_not_null
process.thread.Ext.call_stack_summarywildcard
  • ntdll.dll|kernelbase.dll|*|ntdll.dll|kernel32.dll|ntdll.dll
field:"process.thread.Ext.call_stack_summary" kind:wildcard value:"ntdll.dll|kernelbase.dll|*|ntdll.dll|kernel32.dll|ntdll.dll"

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.code_signature.subject_nameeqLucaNet AGexcludes:process.code_signature.subject_name field:"process.code_signature.subject_name" value:"LucaNet AG"
process.code_signature.trustedeqtrueexcludes:process.code_signature.trusted field:"process.code_signature.trusted" value:"true"
process.executableeqC:\Program Files\LucaNet\Youniverse\.bin\LucaNet.exeexcludes:process.executable field:"process.executable" value:"C:\Program Files\LucaNet\Youniverse\.bin\LucaNet.exe"
process.code_signature.subject_nameeqSentinelOne Inc., Sentinelone, Inc., Sentinel Labs, Inc., Bitglass, LLC, Adobe Inc.excludes:process.code_signature.subject_name
process.executableeqC:\Windows\System32\svchost.exe, C:\Windows\System32\lsass.exe, C:\Windows\System32\LogonUI.exeexcludes:process.executable field:"process.executable" value:"C:\Windows\System32\svchost.exe" field:"process.executable" value:"C:\Windows\System32\lsass.exe" field:"process.executable" value:"C:\Windows\System32\LogonUI.exe"
user.idinS-1-5-18, S-1-5-19, S-1-5-20excludes:user.id field:"user.id" value:"S-1-5-18" field:"user.id" value:"S-1-5-19" field:"user.id" value:"S-1-5-20"
process.thread.Ext.call_stack_summarycontainsprocess.nameexcludes:process.thread.Ext.call_stack_summary field:"process.thread.Ext.call_stack_summary" value:"process.name"
process.thread.Ext.call_stack_summaryinntdll.dll|kernelbase.dll|das.dll|ntdll.dll|kernel32.dll|ntdll.dll, ntdll.dll|kernelbase.dll|hostshellextension.dll|ntdll.dll|kernel32.dll|ntdll.dll, ntdll.dll|kernelbase.dll|lucanet.dll|ntdll.dll|kernel32.dll|ntdll.dll, ntdll.dll|kernelbase.dll|smartcardcredentialprovider.dll|ntdll.dll|kernel32.dll|ntdll.dll, ntdll.dll|kernelbase.dll|ws2_32.dll|ntdll.dll|kernel32.dll|ntdll.dll, ntdll.dll|kernelbase.dll|wsmsvc.dll|ntdll.dll|kernel32.dll|ntdll.dllexcludes:process.thread.Ext.call_stack_summary
process.thread.Ext.call_stack_summarywildcardntdll.dll|kernelbase.dll|*|*|ntdll.dll|kernel32.dll|ntdll.dllexcludes:process.thread.Ext.call_stack_summary field:"process.thread.Ext.call_stack_summary" value:"ntdll.dll|kernelbase.dll|*|*|ntdll.dll|kernel32.dll|ntdll.dll"

Machine Learning Detected a DNS Request Predicted to be a DGA Domain

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

A supervised machine learning model has identified a DNS question name that is predicted to be the result of a Domain Generation Algorithm (DGA), which could indicate command and control network activity.

MITRE ATT&CK Coverage

Rule Body

[metadata]
creation_date = "2023/09/14"
integration = ["dga", "endpoint", "network_traffic"]
maturity = "production"
updated_date = "2026/03/24"

[rule]
author = ["Elastic"]
description = """
A supervised machine learning model has identified a DNS question name that is predicted to be the result of a Domain
Generation Algorithm (DGA), which could indicate command and control network activity.
"""
from = "now-10m"
index = ["logs-endpoint.events.*", "logs-network_traffic.*"]
language = "kuery"
license = "Elastic License v2"
name = "Machine Learning Detected a DNS Request Predicted to be a DGA Domain"
references = [
    "https://www.elastic.co/guide/en/security/current/prebuilt-ml-jobs.html",
    "https://docs.elastic.co/en/integrations/dga",
    "https://www.elastic.co/security-labs/detect-domain-generation-algorithm-activity-with-new-kibana-integration",
]
risk_score = 21
rule_id = "f3403393-1fd9-4686-8f6e-596c58bc00b4"
setup = """## Setup

The rule requires the Domain Generation Algorithm (DGA) Detection integration assets to be installed, as well as DNS events collected by integrations such as Elastic Defend, Network Packet Capture, or Packetbeat.

### DGA Detection Setup
The DGA Detection integration consists of an ML-based framework to detect DGA activity in DNS events.

#### Prerequisite Requirements:
- Fleet is required for DGA Detection.
- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).
- DNS events collected by the [Elastic Defend](https://docs.elastic.co/en/integrations/endpoint), [Network Packet Capture](https://docs.elastic.co/integrations/network_traffic) integration, or [Packetbeat](https://www.elastic.co/guide/en/beats/packetbeat/current/packetbeat-overview.html).
- To install Elastic Defend, refer to the [documentation](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
- To add the Network Packet Capture integration to an Elastic Agent policy, refer to [this](https://www.elastic.co/guide/en/fleet/current/add-integration-to-policy.html) guide.
- To set up and run Packetbeat, follow [this](https://www.elastic.co/guide/en/beats/packetbeat/current/setting-up-and-running.html) guide.

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

query = '''
ml_is_dga.malicious_prediction:1 and not dns.question.registered_domain:avsvmcloud.com
'''
note = """## Triage and analysis

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

### Investigating Machine Learning Detected a DNS Request Predicted to be a DGA Domain

Machine learning models can identify patterns in DNS requests that suggest the use of Domain Generation Algorithms (DGAs), which adversaries use to dynamically generate domain names for command and control (C2) communication. This detection rule leverages such models to flag DNS queries likely generated by DGAs, excluding known benign domains, thus helping to identify potential C2 activity.

### Possible investigation steps

- Review the DNS query logs to identify the specific domain flagged by the machine learning model as a potential DGA domain. Focus on the field ml_is_dga.malicious_prediction:1 to confirm the prediction.
- Cross-reference the flagged domain with threat intelligence sources to determine if it is associated with known malicious activity or threat actors.
- Investigate the source IP address of the DNS request to identify the device or user responsible for the query. This can help determine if the activity is isolated or part of a larger pattern.
- Analyze network traffic logs for any additional suspicious activity originating from the same source IP, such as unusual outbound connections or data transfers.
- Check for any recent changes or anomalies in the endpoint's behavior or configuration that could indicate compromise or unauthorized software installation.
- If the domain is confirmed to be malicious, initiate containment procedures to block further communication with the domain and prevent potential data exfiltration or further compromise.

### False positive analysis

- DNS requests to content delivery networks or cloud service providers can be flagged as DGA domains due to their dynamic nature. Users should review these domains and consider adding them to an exception list if they are verified as legitimate.
- Internal applications that generate dynamic DNS requests for load balancing or failover purposes might trigger false positives. Identify these applications and exclude their domains from the rule to prevent unnecessary alerts.
- Automated testing environments often generate numerous DNS requests that can appear suspicious. Regularly update the exception list with domains used by these environments to minimize false alerts.
- Frequent updates or patches from software vendors may involve dynamic DNS requests. Verify these domains and exclude them if they are confirmed to be part of legitimate update processes.
- Consider monitoring the frequency and pattern of flagged DNS requests. If a domain is consistently flagged but verified as non-threatening, it may be a candidate for exclusion from the rule.

### Response and remediation

- Isolate the affected system from the network to prevent further potential command and control communication.
- Conduct a thorough scan of the isolated system using updated antivirus and anti-malware tools to identify and remove any malicious software.
- Review and block the identified DGA domain and any associated IP addresses at the network perimeter to prevent further access.
- Analyze network traffic logs to identify any other systems that may have communicated with the DGA domain and apply similar containment measures.
- Escalate the incident to the security operations center (SOC) or incident response team for further investigation and to determine the scope of the compromise.
- Implement enhanced monitoring for similar DGA patterns and update detection capabilities to quickly identify future occurrences.
- Review and update firewall and intrusion detection/prevention system (IDS/IPS) rules to block known DGA patterns and suspicious DNS activity."""


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

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

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

[[rule.threat.technique]]
id = "T1568"
name = "Dynamic Resolution"
reference = "https://attack.mitre.org/techniques/T1568/"

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

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

Stages and Predicates

Stage 1: query

ml_is_dga.malicious_prediction:1 and not dns.question.registered_domain:avsvmcloud.com

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
dns.question.registered_domaineqavsvmcloud.comexcludes:dns.question.registered_domain field:"dns.question.registered_domain" value:"avsvmcloud.com"

Multiple DHCP Servers Responding to the Same Transaction

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

Identifies two or more distinct DHCP servers sending an OFFER or ACK for the same transaction ID (xid) within a short window, indicating a rogue DHCP server racing the legitimate one to win the client's handshake. This is the rogue-DHCP / adversary-in-the-middle precondition (T1557.003) and is operating-system agnostic, since it keys only on server behavior observed on the wire. Winning the race lets an attacker intercept traffic via a hostile gateway/DNS, bypass a VPN (TunnelVision), or deliver a malformed response that exploits the client's DHCP parser for code execution.

MITRE ATT&CK Coverage

Rule Body

[metadata]
creation_date = "2026/06/09"
integration = ["network_traffic"]
maturity = "production"
updated_date = "2026/06/09"

[rule]
author = ["Elastic"]
description = """
Identifies two or more distinct DHCP servers sending an OFFER or ACK for the same transaction ID (xid) within a short
window, indicating a rogue DHCP server racing the legitimate one to win the client's handshake. This is the rogue-DHCP /
adversary-in-the-middle precondition (T1557.003) and is operating-system agnostic, since it keys only on server behavior
observed on the wire. Winning the race lets an attacker intercept traffic via a hostile gateway/DNS, bypass a VPN
(TunnelVision), or deliver a malformed response that exploits the client's DHCP parser for code execution.
"""
from = "now-9m"
language = "esql"
license = "Elastic License v2"
name = "Multiple DHCP Servers Responding to the Same Transaction"
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 Multiple DHCP Servers Responding to the Same Transaction

DHCP is plaintext UDP and fully visible to any sensor on the broadcast segment. A rogue server (or an injected response
on the victim's L2 broadcast domain) that answers a transaction the legitimate server already owns is the defining
precondition for DHCP-based adversary-in-the-middle and for malformed-option client exploits. This rule flags exactly
that: two or more distinct server source IPs producing an OFFER/ACK for one transaction ID inside the same 30-second
window, and is operating-system agnostic, since it keys only on server behavior observed on the wire.

### Possible investigation steps

- Identify the server source IPs in `Esql.values_server_ips` and `Esql.values_server_identifiers`. Determine which is
  the sanctioned DHCP server and which is unexpected.
- Locate the rogue server on the segment (switch CAM/ARP tables, port, VLAN). It is on the same broadcast domain as the
  victim by definition.
- Inspect the rogue OFFER/ACK options for an oversized or malformed payload (the overflow trigger) and for hostile
  configuration such as an attacker-controlled default gateway (option 3), DNS server (option 6), WPAD/proxy
  auto-config (option 252), or classless static routes (option 121, TunnelVision-style VPN bypass).
- Identify the client(s) acquiring leases on the segment (any OS, including Windows, Linux, macOS, iOS, IoT) and review their
  endpoint telemetry for DHCP client service crashes, unexpected route/DNS/gateway changes, or follow-on code execution.
  Where the target OS and DHCP client are known, check whether they are unpatched for the relevant CVE (e.g.
  CVE-2026-44815 on Windows, CVE-2018-5732 on ISC dhclient).

### False positive analysis

- DHCP failover pairs (Microsoft or ISC) are designed so that, for a given transaction, only one peer answers; two
  peers answering the same xid within 30 seconds is not normal failover behavior. If a known active-active or
  load-balancing architecture genuinely does this, add its server IPs to an exception.
- DHCP relay agents forward responses but the relayed source is the relay, and a single server still owns each
  transaction. Anycast/VIP DHCP designs that present multiple real backend IPs on the wire are rare and would be a known
  architectural fact, which can be excepted by those IPs.

### Response and remediation

- Remove the rogue DHCP server from the segment, then patch the affected client DHCP stacks (e.g. June 2026 Patch
  Tuesday for CVE-2026-44815 on Windows, or the fixed ISC dhclient for CVE-2018-5732 on Linux/Unix).
- Enable DHCP snooping on managed switches and restrict DHCP server responses to authorized server ports/MACs as a
  compensating control, which protects clients of every OS and also mitigates TunnelVision-style route injection.
"""
references = [
    "https://nvd.nist.gov/vuln/detail/CVE-2026-44815",
    "https://nvd.nist.gov/vuln/detail/CVE-2024-3661",
    "https://www.leviathansecurity.com/blog/tunnelvision",
    "https://nvd.nist.gov/vuln/detail/CVE-2018-5732",
    "https://msrc.microsoft.com/update-guide",
]
risk_score = 73
rule_id = "44b8d933-8fed-485d-a0af-bd97d0093439"
setup = """## Setup

This rule requires the Elastic network_traffic (Packetbeat) integration capturing DHCP (UDP 67/68) on the broadcast
segment where clients acquire/renew leases, either Packetbeat running on the segment or a SPAN/mirror feeding it. A
sensor not on the same L2 broadcast domain (or not behind the relevant DHCP relay) will not observe competing OFFER/ACK
packets.

Zeek is intentionally not supported: the zeek.dhcp data stream does not expose a transaction ID and aggregates a full
DORA exchange into one record, so the per-transaction server-count comparison cannot be expressed on it.
"""
severity = "high"
tags = [
    "Domain: Network",
    "Domain: Endpoint",
    "Use Case: Threat Detection",
    "Use Case: Vulnerability",
    "Use Case: Network Security Monitoring",
    "Tactic: Credential Access",
    "Tactic: Execution",
    "Data Source: Network Traffic",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "esql"

query = '''
from logs-network_traffic.dhcpv4-*, packetbeat-*
| eval
    message_type = TO_LOWER(COALESCE(network_traffic.dhcpv4.option.message_type, dhcpv4.option.message_type)),
    Esql.transaction_id = COALESCE(network_traffic.dhcpv4.transaction_id, dhcpv4.transaction_id),
    server_identifier = COALESCE(network_traffic.dhcpv4.option.server_identifier, dhcpv4.option.server_identifier)
| where message_type in ("offer", "ack") and Esql.transaction_id is not null and source.ip is not null
| eval Esql.time_window = DATE_TRUNC(30 seconds, @timestamp)
| stats
    Esql.count_distinct_servers = COUNT_DISTINCT(source.ip),
    Esql.values_server_ips = VALUES(source.ip),
    Esql.values_server_identifiers = VALUES(server_identifier),
    Esql.count_replies = COUNT(*)
  by Esql.time_window, Esql.transaction_id
| where Esql.count_distinct_servers >= 2
| keep Esql.transaction_id, Esql.time_window, Esql.count_distinct_servers, Esql.values_server_ips, Esql.values_server_identifiers, Esql.count_replies
'''


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


[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 = "T1203"
name = "Exploitation for Client Execution"
reference = "https://attack.mitre.org/techniques/T1203/"


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

Stages and Predicates

Stage 1: from

from logs-network_traffic.dhcpv4-*, packetbeat-*

Stage 2: eval

| eval
    message_type = TO_LOWER(COALESCE(network_traffic.dhcpv4.option.message_type, dhcpv4.option.message_type)),
    Esql.transaction_id = COALESCE(network_traffic.dhcpv4.transaction_id, dhcpv4.transaction_id),
    server_identifier = COALESCE(network_traffic.dhcpv4.option.server_identifier, dhcpv4.option.server_identifier)

Stage 3: where

| where message_type in ("offer", "ack") and Esql.transaction_id is not null and source.ip is not null

Stage 4: eval

| eval Esql.time_window = DATE_TRUNC(30 seconds, @timestamp)

Stage 5: stats

| stats
    Esql.count_distinct_servers = COUNT_DISTINCT(source.ip),
    Esql.values_server_ips = VALUES(source.ip),
    Esql.values_server_identifiers = VALUES(server_identifier),
    Esql.count_replies = COUNT(*)
  by Esql.time_window, Esql.transaction_id

Stage 6: where

| where Esql.count_distinct_servers >= 2

Stage 7: keep

| keep Esql.transaction_id, Esql.time_window, Esql.count_distinct_servers, Esql.values_server_ips, Esql.values_server_identifiers, Esql.count_replies

Indicators

These rows show field, operator, and value matches.

Output Fields

These fields are emitted when the rule matches.

FieldSource
Esql.transaction_idKEEP Esql.transaction_id
Esql.time_windowKEEP Esql.time_window
Esql.count_distinct_serversKEEP Esql.count_distinct_servers
Esql.values_server_ipsKEEP Esql.values_server_ips
Esql.values_server_identifiersKEEP Esql.values_server_identifiers
Esql.count_repliesKEEP Esql.count_replies

Persistence via Microsoft Office AddIns

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

Detects attempts to establish persistence on an endpoint by abusing Microsoft Office add-ins.

MITRE ATT&CK Coverage

Rule Body

[metadata]
creation_date = "2020/10/16"
integration = ["endpoint", "windows", "m365_defender", "sentinel_one_cloud_funnel", "crowdstrike"]
maturity = "production"
updated_date = "2026/05/03"

[rule]
author = ["Elastic"]
description = "Detects attempts to establish persistence on an endpoint by abusing Microsoft Office add-ins."
from = "now-9m"
index = [
    "logs-endpoint.events.file-*",
    "winlogbeat-*",
    "logs-windows.sysmon_operational-*",
    "endgame-*",
    "logs-m365_defender.event-*",
    "logs-sentinel_one_cloud_funnel.*",
    "logs-crowdstrike.fdr*",
]
language = "eql"
license = "Elastic License v2"
name = "Persistence via Microsoft Office AddIns"
references = ["https://labs.withsecure.com/publications/add-in-opportunities-for-office-persistence"]
risk_score = 73
rule_id = "f44fa4b6-524c-4e87-8d9e-a32599e4fb7c"
severity = "high"
tags = [
    "Domain: Endpoint",
    "OS: Windows",
    "Use Case: Threat Detection",
    "Tactic: Persistence",
    "Data Source: Elastic Endgame",
    "Data Source: Elastic Defend",
    "Data Source: Sysmon",
    "Data Source: Microsoft Defender XDR",
    "Data Source: SentinelOne",
    "Data Source: Crowdstrike",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"

query = '''
file where host.os.type == "windows" and event.type != "deletion" and
 file.extension : ("wll","xll","ppa","ppam","xla","xlam") and
 file.path : (
    "C:\\Users\\*\\AppData\\Roaming\\Microsoft\\Word\\Startup\\*",
    "C:\\Users\\*\\AppData\\Roaming\\Microsoft\\AddIns\\*",
    "C:\\Users\\*\\AppData\\Roaming\\Microsoft\\Excel\\XLSTART\\*",

    /* Crowdstrike specific condition as it uses NT Object paths */
    "\\Device\\HarddiskVolume*\\Users\\*\\AppData\\Roaming\\Microsoft\\Word\\Startup\\*",
    "\\Device\\HarddiskVolume*\\Users\\*\\AppData\\Roaming\\Microsoft\\AddIns\\*",
    "\\Device\\HarddiskVolume*\\Users\\*\\AppData\\Roaming\\Microsoft\\Excel\\XLSTART\\*"
 ) and
 not (file.name : "~$*" and process.name : "excel.exe" and ?file.size in (0, 165))
'''

note = """## Triage and analysis

### Investigating Persistence via Microsoft Office AddIns

#### Possible investigation steps

- Which Office add-in autoload mechanism does the alert show?
  - Focus: alert `file.path`, `file.name`, `file.extension`, and `user.id` on `host.id`: "wll" maps to Word Startup, "xla"/"xlam" to Excel XLSTART, and "xll"/"ppa"/"ppam" to add-in locations that may need loader settings.
  - Implication: escalate when a user-profile Office startup or add-in path receives a one-off or user-initiated add-in; lower suspicion only when path, name, extension, writer, and provenance all fit the same recognized deployment or repair.

- Does the artifact identity or provenance look like a staged payload?
  - Why: DLL-style "wll"/"xll" and Office container add-ins have different expected headers, so rename and origin fields can expose payload staging.
  - Focus: `file.Ext.header_bytes`, `file.Ext.original.path`, `file.origin_url`, and `file.Ext.windows.zone_identifier`.
  - Implication: escalate when headers, rename history, internet-zone provenance, or archive/mail-cache origin conflict with the claimed add-in; lower suspicion when format and provenance align with the same recognized vendor package.

- Does the writer process fit an add-in installer or a dropper chain?
  - Focus: writer `process.executable`, `process.command_line`, `process.parent.executable`, and `process.code_signature.subject_name`.
  - Implication: escalate when browsers, mail clients, scripting engines, archive tools, or unsigned user-writable binaries write the add-in; lower suspicion when signer, path, command line, and parent all match the same recognized installer or managed integration. Signer trust alone never clears the placement.

- If registry telemetry is available, did the writer create loader settings required for this add-in type?
  - Why: the alert is a file write; loader settings, when visible, show whether Office was configured to consume the add-in rather than merely store it.
  - Focus: same `host.id` and writer `process.entity_id`; check `registry.path`, `registry.value`, `registry.data.type`, and `registry.data.strings` for Office loader values pointing to the alerted file. $investigate_0
  - Implication: escalate when loader values reference the alerted file or directory; do not require registry corroboration when path, provenance, or writer evidence is already suspicious. Missing registry telemetry is unresolved, not benign.

- Did Office later load the add-in or spawn follow-on activity from it?
  - Focus: later Office `process.name` values "WINWORD.EXE", "EXCEL.EXE", or "POWERPNT.EXE" on the same `host.id`, Office `process.entity_id`, child `process.parent.entity_id`, child `process.executable`, and, if library telemetry exists, `dll.path` matching the add-in.
    - $investigate_1
    - $investigate_2
  - Hint: missing library telemetry is unresolved, not benign; use those pivots and child process expansion from recovered Office instances as fallback execution evidence.
  - Implication: escalate when Office loads the add-in path, starts a child from the same session, or touches a payload dropped with the add-in; do not wait for library telemetry when file, writer, or loader evidence already warrants escalation.

- If local evidence is suspicious or unresolved, what related host activity changes scope?
  - Focus: related alerts on the same `host.id`, especially document delivery, script execution, suspicious file writes, Office child processes, or additional persistence activity. $investigate_3
  - Implication: expand scope when related host alerts connect the add-in write to delivery, execution, credential access, or another persistence mechanism; do not close solely because related alerts are absent.

- What disposition do the add-in mechanism, artifact identity, writer lineage, loader state, Office execution, and scope support?
  - Escalate on suspicious provenance, unexpected writer lineage, matching loader values, Office follow-on execution, or related host activity; close only when file, writer, provenance, loader state, and Office behavior align with one verified deployment or integration and no contradictions remain; preserve artifacts and escalate mixed or incomplete evidence.

### False positive analysis

- Managed Office add-in deployment, repair, and productivity, accessibility, or CRM first-use installs can place files in these paths. Close only when writer `process.executable`, `process.command_line`, signer `process.code_signature.subject_name`, parent `process.parent.executable`, final `file.path`, required loader state, provenance fields, later Office `process.name`, and child `process.executable` all align with one deployment or vendor workflow and no contradictory evidence remains. Use change or inventory records as corroboration, not as a telemetry substitute.
- Before creating an exception, build it from the minimum current-case pattern: `file.path`, writer `process.code_signature.subject_name`, writer `process.parent.executable`, required loader-state pattern, and `host.id` or `user.id` scope. Avoid exceptions on Office startup directories, file extensions, or Office process names alone.

### Response and remediation

- If confirmed benign, reverse temporary containment and document the verified workflow with `file.path`, `file.hash.sha256`, writer `process.executable`, signer `process.code_signature.subject_name`, and any recovered loader-state evidence. Create any exception from that exact workflow pattern and scope it narrowly to the confirmed host or user cohort.
- If suspicious but unconfirmed, preserve the alert export, the add-in file and hash from `file.path` and `file.hash.sha256`, writer `process.entity_id` and `process.command_line`, and any recovered loader-state, library-load, or child-process evidence before deleting anything. Apply reversible containment first, such as quarantining the add-in file, disabling the affected Office add-in path, or temporarily restricting Office execution on the host.
- If confirmed malicious, isolate the host if its role can tolerate interruption, then terminate responsible Office or loader processes only after preserving their entity IDs, command lines, and the add-in file evidence. Remove the malicious add-in, clear associated Office loader configuration, restore affected Office add-in settings, and remediate the delivery path that introduced the file. Reset credentials only if the investigation also shows account misuse.
- Review related hosts and users for the same `file.path`, `file.hash.sha256`, writer lineage, and loader-state pattern before eradication. For Word WLL cases, do not rely on the Office UI alone to prove the add-in is disabled; verify the file and supporting configuration are gone.
- Post-incident hardening: restrict write access to Office startup directories and add-in loader locations, prefer signed managed add-in deployment, retain process/file plus registry or library telemetry needed to confirm later Office execution, and document adjacent variants such as Word WLL autoload abuse or registry-backed Office add-in loading in the case record.
"""

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 11 - File Create](https://ela.st/sysmon-event-11-setup)
"""

[rule.investigation_fields]
field_names = [
    "@timestamp",
    "event.action",
    "host.id",
    "user.id",
    "process.entity_id",
    "process.pid",
    "process.executable",
    "process.command_line",
    "process.parent.executable",
    "process.code_signature.subject_name",
    "file.path",
    "file.extension",
    "file.hash.sha256",
    "file.origin_url",
]

[transform]

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

[[transform.investigate]]
label = "Office process starts on the host"
description = ""
providers = [
  [
    { excluded = false, field = "event.category", queryType = "phrase", value = "process", valueType = "string" },
    { excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" },
    { excluded = false, field = "process.name", queryType = "phrase", value = "WINWORD.EXE", valueType = "string" }
  ],
  [
    { excluded = false, field = "event.category", queryType = "phrase", value = "process", valueType = "string" },
    { excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" },
    { excluded = false, field = "process.name", queryType = "phrase", value = "EXCEL.EXE", valueType = "string" }
  ],
  [
    { excluded = false, field = "event.category", queryType = "phrase", value = "process", valueType = "string" },
    { excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" },
    { excluded = false, field = "process.name", queryType = "phrase", value = "POWERPNT.EXE", valueType = "string" }
  ]
]
relativeFrom = "now-24h/h"
relativeTo = "now"

[[transform.investigate]]
label = "Library loads for the add-in path"
description = ""
providers = [
  [
    { excluded = false, field = "event.category", queryType = "phrase", value = "library", valueType = "string" },
    { excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" },
    { excluded = false, field = "dll.path", queryType = "phrase", value = "{{file.path}}", valueType = "string" }
  ]
]
relativeFrom = "now-24h/h"
relativeTo = "now"

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

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

[[rule.threat.technique]]
id = "T1137"
name = "Office Application Startup"
reference = "https://attack.mitre.org/techniques/T1137/"

[[rule.threat.technique.subtechnique]]
id = "T1137.006"
name = "Add-ins"
reference = "https://attack.mitre.org/techniques/T1137/006/"

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

Stages and Predicates

Stage 1: file

file where host.os.type == "windows" and event.type != "deletion" and
 file.extension : ("wll","xll","ppa","ppam","xla","xlam") and
 file.path : (
    "C:\\Users\\*\\AppData\\Roaming\\Microsoft\\Word\\Startup\\*",
    "C:\\Users\\*\\AppData\\Roaming\\Microsoft\\AddIns\\*",
    "C:\\Users\\*\\AppData\\Roaming\\Microsoft\\Excel\\XLSTART\\*",
    "\\Device\\HarddiskVolume*\\Users\\*\\AppData\\Roaming\\Microsoft\\Word\\Startup\\*",
    "\\Device\\HarddiskVolume*\\Users\\*\\AppData\\Roaming\\Microsoft\\AddIns\\*",
    "\\Device\\HarddiskVolume*\\Users\\*\\AppData\\Roaming\\Microsoft\\Excel\\XLSTART\\*"
 ) and
 not (file.name : "~$*" and process.name : "excel.exe" and ?file.size in (0, 165))

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.typene
  • deletion corpus 33 (elastic 33)
field:"event.type" kind:ne value:"deletion"
file.extensionwildcard
  • ppa
  • ppam
  • wll
  • xla
  • xlam
  • xll
field:"file.extension" kind:wildcard
file.pathwildcard
  • C:\Users\*\AppData\Roaming\Microsoft\AddIns\*
  • C:\Users\*\AppData\Roaming\Microsoft\Excel\XLSTART\*
  • C:\Users\*\AppData\Roaming\Microsoft\Word\Startup\*
  • \Device\HarddiskVolume*\Users\*\AppData\Roaming\Microsoft\AddIns\*
  • \Device\HarddiskVolume*\Users\*\AppData\Roaming\Microsoft\Excel\XLSTART\*
  • \Device\HarddiskVolume*\Users\*\AppData\Roaming\Microsoft\Word\Startup\*
field:"TargetFilename" kind:wildcard

Exclusions

The rule actively suppresses these predicates.

Potential Access to Kerberos Cached Credentials

#
Source
github.com/elastic/protections-artifacts

Identifies the use of the Kerberos credential cache (kcc) utility to dump locally cached Kerberos tickets. Adversaries may attempt to dump credentials to obtain account login information in the form of a ticket. These tickets can be leveraged for lateral movement.

MITRE ATT&CK Coverage

Telemetry Coverage

Rule Body

[rule]
description = """
Identifies the use of the Kerberos credential cache (kcc) utility to dump locally cached Kerberos tickets. Adversaries
may attempt to dump credentials to obtain account login information in the form of a ticket. These tickets can be
leveraged for lateral movement.
"""
id = "dc8fa849-efb4-45d1-be1a-9472325ff746"
license = "Elastic License v2"
name = "Potential Access to Kerberos Cached Credentials"
os_list = ["macos"]
reference = [
    "https://github.com/EmpireProject/EmPyre/blob/master/lib/modules/collection/osx/kerberosdump.py",
    "https://opensource.apple.com/source/Heimdal/Heimdal-323.12/kuser/kcc-commands.in.auto.html",
]
version = "1.0.29"

query = '''
process where event.type == "start" and event.action == "exec" and
 process.name == "kcc" and process.command_line like~ "*copy_cred_cache*"
'''

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

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1558"
name = "Steal or Forge Kerberos Tickets"
reference = "https://attack.mitre.org/techniques/T1558/"
[[threat.technique.subtechnique]]
id = "T1558.005"
name = "Ccache Files"
reference = "https://attack.mitre.org/techniques/T1558/005/"



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

[internal]
min_endpoint_version = "8.10.2"

Stages and Predicates

Stage 1: process

process where event.type == "start" and event.action == "exec" and
 process.name == "kcc" and process.command_line like~ "*copy_cred_cache*"

Indicators

These rows show field, operator, and value matches.

Potential Privacy Control Bypass via Localhost Secure Copy

#
Source
github.com/elastic/protections-artifacts

Identifies use of the Secure Copy Protocol (SCP) to copy files locally by abusing the auto addition of the Secure Shell Daemon (sshd) to the authorized application list for Full Disk Access. This may indicate attempts to bypass macOS privacy controls to access sensitive files.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
Identifies use of the Secure Copy Protocol (SCP) to copy files locally by abusing the auto addition of the Secure Shell
Daemon (sshd) to the authorized application list for Full Disk Access. This may indicate attempts to bypass macOS
privacy controls to access sensitive files.
"""
id = "55df8e91-fd3c-4cc1-b36f-f01ded8c6da3"
license = "Elastic License v2"
name = "Potential Privacy Control Bypass via Localhost Secure Copy"
os_list = ["macos"]
reference = [
    "https://blog.trendmicro.com/trendlabs-security-intelligence/xcsset-mac-malware-infects-xcode-projects-performs-uxss-attack-on-safari-other-browsers-leverages-zero-day-exploits/",
]
version = "1.0.29"

query = '''
process where event.type == "start" and
 process.name == "scp" and
 process.args : "StrictHostKeyChecking=no" and
 process.command_line like~ ("*scp *localhost:/*", "*scp *127.0.0.?:/*") and not process.command_line like~ "*vagrant@*127.0.0.1*"
'''

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

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1548"
name = "Abuse Elevation Control Mechanism"
reference = "https://attack.mitre.org/techniques/T1548/"
[[threat.technique.subtechnique]]
id = "T1548.006"
name = "TCC Manipulation"
reference = "https://attack.mitre.org/techniques/T1548/006/"



[threat.tactic]
id = "TA0004"
name = "Privilege Escalation"
reference = "https://attack.mitre.org/tactics/TA0004/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1548"
name = "Abuse Elevation Control Mechanism"
reference = "https://attack.mitre.org/techniques/T1548/"
[[threat.technique.subtechnique]]
id = "T1548.006"
name = "TCC Manipulation"
reference = "https://attack.mitre.org/techniques/T1548/006/"



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

[internal]
min_endpoint_version = "8.10.2"

Stages and Predicates

Stage 1: process

process where event.type == "start" and
 process.name == "scp" and
 process.args : "StrictHostKeyChecking=no" and
 process.command_line like~ ("*scp *localhost:/*", "*scp *127.0.0.?:/*") and not process.command_line like~ "*vagrant@*127.0.0.1*"

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.command_linewildcard*vagrant@*127.0.0.1*excludes:process.command_line field:"process.command_line" value:"*vagrant@*127.0.0.1*"

Potential Shell Execution via NetCat

#
Source
github.com/elastic/protections-artifacts

Detects execution of a Windows command shell spawned as a result of connecting to or from a Netcat listener. Attackers often use Netcat to run commands on remote systems.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
Detects execution of a Windows command shell spawned as a result of connecting to or from a Netcat listener. Attackers
often use Netcat to run commands on remote systems.
"""
id = "2e80dd26-3966-4a16-9fad-ac643b5dd66e"
license = "Elastic License v2"
name = "Potential Shell Execution via NetCat"
os_list = ["windows"]
reference = ["https://github.coventry.ac.uk/pages/aa9863/5063CEM/3_LinuxAndShells/Netcat/"]
version = "1.0.2"

query = '''
process where event.action == "start" and
process.name : ("cmd.exe", "powershell.exe") and process.parent.args : "-e" and process.args_count == 1 and
 (
  (process.parent.args_count == 5 and process.parent.command_line regex~ """.*[0-9]{1,3}(\.[0-9]{1,3}){3}.*""") or
  (process.parent.args : "-*l*" and process.parent.args : "-*p*" and process.parent.args : ("cmd.exe", "powershell.exe") and
   not process.parent.name : ("cmd.exe", "powershell.exe") and process.parent.args_count <= 5)
  )
'''

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

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



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

[internal]
min_endpoint_version = "8.10.0"

Stages and Predicates

Stage 1: process

process where event.action == "start" and
process.name : ("cmd.exe", "powershell.exe") and process.parent.args : "-e" and process.args_count == 1 and
 (
  (process.parent.args_count == 5 and process.parent.command_line regex~ """.*[0-9]{1,3}(\.[0-9]{1,3}){3}.*""") or
  (process.parent.args : "-*l*" and process.parent.args : "-*p*" and process.parent.args : ("cmd.exe", "powershell.exe") and
   not process.parent.name : ("cmd.exe", "powershell.exe") and process.parent.args_count <= 5)
  )

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • start corpus 388 (elastic 388)
field:"EventType" kind:eq value:"start"
process.args_counteq
  • 1 transforms: number corpus 50 (elastic 50)
field:"process.args_count" kind:eq value:"1"
process.namewildcard
  • cmd.exe corpus 122 (elastic 93, splunk 29)
  • powershell.exe corpus 187 (elastic 140, splunk 44, kusto 3)
field:"process_basename" kind:wildcard
process.parent.argswildcard
  • -*l* corpus 2 (elastic 2)
  • -*p* corpus 2 (elastic 2)
  • -e corpus 2 (elastic 2)
  • cmd.exe corpus 2 (elastic 2)
  • powershell.exe corpus 2 (elastic 2)
field:"process.parent.args" kind:wildcard
process.parent.args_counteq
  • 5 transforms: number corpus 2 (elastic 2)
field:"process.parent.args_count" kind:eq value:"5"
process.parent.args_countle
  • 5 transforms: number
field:"process.parent.args_count" kind:le value:"5"
process.parent.command_lineregex_match
  • .*[0-9]{1,3}(.[0-9]{1,3}){3}.* corpus 2 (elastic 2)
field:"ParentCommandLine" kind:regex_match value:".*[0-9]{1,3}(.[0-9]{1,3}){3}.*"

Security Software Discovery via Grep

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

Identifies the use of the grep command to discover known third-party macOS and Linux security tools, such as Antivirus or Host Firewall details.

Known False Positives

  • Endpoint Security installers, updaters and post installation verification scripts.

MITRE ATT&CK Coverage

Rule Body

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

[rule]
author = ["Elastic"]
description = """
Identifies the use of the grep command to discover known third-party macOS and Linux security tools, such as Antivirus
or Host Firewall details.
"""
false_positives = ["Endpoint Security installers, updaters and post installation verification scripts."]
from = "now-9m"
index = ["logs-endpoint.events.*", "auditbeat-*"]
language = "eql"
license = "Elastic License v2"
name = "Security Software Discovery via Grep"
note = """## Triage and analysis

### Investigating Security Software Discovery via Grep

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

This rule looks for the execution of the `grep` utility with arguments compatible to the enumeration of the security software installed on the host. Attackers can use this information to decide whether or not to infect a system, disable protections, use bypasses, etc.

#### Possible investigation steps

- Investigate the process execution chain (parent process tree) for unknown processes. Examine their executable files for prevalence and whether they are located in expected locations.
- Investigate other alerts associated with the user/host during the past 48 hours.
- Investigate any abnormal account behavior, such as command executions, file creations or modifications, and network connections.
- Investigate any abnormal behavior by the subject process such as network connections, file modifications, and any spawned child processes.
- Inspect the host for suspicious or abnormal behavior in the alert timeframe.
- Validate the activity is not related to planned patches, updates, network administrator activity, or legitimate software installations.

### False positive analysis

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

### Response and remediation

- Initiate the incident response process based on the outcome of the triage.
- Isolate the involved hosts to prevent further post-compromise behavior.
- Investigate credential exposure on systems compromised or used by the attacker to ensure all compromised accounts are identified. Reset passwords for these accounts and other potentially compromised credentials, such as email, business systems, and web services.
- Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
- Determine the initial vector abused by the attacker and take action to prevent reinfection 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).
"""
risk_score = 47
rule_id = "870aecc0-cea4-4110-af3f-e02e9b373655"
setup = """## Setup

If enabling an EQL rule on a non-elastic-agent index (such as beats) for versions <8.2,
events will not define `event.ingested` and default fallback for EQL rules was not added until version 8.2.
Hence for this rule to work effectively, users will need to add a custom ingest pipeline to populate
`event.ingested` to @timestamp.
For more details on adding a custom ingest pipeline refer - https://www.elastic.co/guide/en/fleet/current/data-streams-pipeline-tutorial.html
"""
severity = "medium"
tags = [
    "Domain: Endpoint",
    "OS: macOS",
    "OS: Linux",
    "Use Case: Threat Detection",
    "Tactic: Discovery",
    "Resources: Investigation Guide",
    "Data Source: Elastic Defend",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
process where event.type == "start" and
process.name : ("grep", "egrep", "pgrep") and user.id != "0" and
 not process.parent.executable : ("/Library/Application Support/*", "/opt/McAfee/agent/scripts/ma") and
   process.args :
         ("Little Snitch*",
          "Avast*",
          "Avira*",
          "ESET*",
          "BlockBlock*",
          "360Sec*",
          "LuLu*",
          "KnockKnock*",
          "kav",
          "KIS",
          "RTProtectionDaemon*",
          "Malware*",
          "VShieldScanner*",
          "WebProtection*",
          "webinspectord*",
          "McAfee*",
          "isecespd*",
          "macmnsvc*",
          "masvc*",
          "kesl*",
          "avscan*",
          "guard*",
          "rtvscand*",
          "symcfgd*",
          "scmdaemon*",
          "symantec*",
          "sophos*",
          "osquery*",
          "elastic-endpoint*",
          "falcond*",
          "SentinelOne*",
          "CbOsxSensorService*",
          "CbDefense*",
          "WhatsYourSign*",
          "reikey*",
          "OverSight*",
          "KextViewr*",
          "Netiquette*",
          "processmonitor*",
          "filemonitor*"
          ) and
   not (
     (process.args : "Avast" and process.args : "Passwords") or
     (process.args == "osquery.conf") or 
     (process.parent.args : "/opt/McAfee/agent/scripts/ma" and process.parent.args : "checkhealth") or
     (process.command_line : (
       "grep ESET Command-line scanner, version %s -A2",
       "grep -i McAfee Web Gateway Core version:",
       "grep --color=auto ESET Command-line scanner, version %s -A2"
       )
     ) or
     (process.parent.command_line : (
       """sh -c printf "command_start_%s"*; perl -pe 's/[^ -~]/\n/g' < /opt/eset/esets/sbin/esets_scan | grep 'ESET Command-line scanner, version %s' -A2 | tail -1; printf "command_done_%s*""",
       """bash -c perl -pe 's/[^ -~]/\n/g' < /opt/eset/esets/sbin/esets_scan | grep 'ESET Command-line scanner, version %s' -A2 | tail -1"""
       )
     )
    )
'''

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

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

[[rule.threat.technique.subtechnique]]
id = "T1518.001"
name = "Security Software Discovery"
reference = "https://attack.mitre.org/techniques/T1518/001/"

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

Stages and Predicates

Stage 1: process

process where event.type == "start" and
process.name : ("grep", "egrep", "pgrep") and user.id != "0" and
 not process.parent.executable : ("/Library/Application Support/*", "/opt/McAfee/agent/scripts/ma") and
   process.args :
         ("Little Snitch*",
          "Avast*",
          "Avira*",
          "ESET*",
          "BlockBlock*",
          "360Sec*",
          "LuLu*",
          "KnockKnock*",
          "kav",
          "KIS",
          "RTProtectionDaemon*",
          "Malware*",
          "VShieldScanner*",
          "WebProtection*",
          "webinspectord*",
          "McAfee*",
          "isecespd*",
          "macmnsvc*",
          "masvc*",
          "kesl*",
          "avscan*",
          "guard*",
          "rtvscand*",
          "symcfgd*",
          "scmdaemon*",
          "symantec*",
          "sophos*",
          "osquery*",
          "elastic-endpoint*",
          "falcond*",
          "SentinelOne*",
          "CbOsxSensorService*",
          "CbDefense*",
          "WhatsYourSign*",
          "reikey*",
          "OverSight*",
          "KextViewr*",
          "Netiquette*",
          "processmonitor*",
          "filemonitor*"
          ) and
   not (
     (process.args : "Avast" and process.args : "Passwords") or
     (process.args == "osquery.conf") or 
     (process.parent.args : "/opt/McAfee/agent/scripts/ma" and process.parent.args : "checkhealth") or
     (process.command_line : (
       "grep ESET Command-line scanner, version %s -A2",
       "grep -i McAfee Web Gateway Core version:",
       "grep --color=auto ESET Command-line scanner, version %s -A2"
       )
     ) or
     (process.parent.command_line : (
       """sh -c printf "command_start_%s"*; perl -pe 's/[^ -~]/\n/g' < /opt/eset/esets/sbin/esets_scan | grep 'ESET Command-line scanner, version %s' -A2 | tail -1; printf "command_done_%s*""",
       """bash -c perl -pe 's/[^ -~]/\n/g' < /opt/eset/esets/sbin/esets_scan | grep 'ESET Command-line scanner, version %s' -A2 | tail -1"""
       )
     )
    )

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.typeeq
  • start
field:"event.type" kind:eq value:"start"
process.argswildcard
  • 360Sec*
  • Avast*
  • Avira*
  • BlockBlock*
  • CbDefense*
  • CbOsxSensorService*
  • ESET*
  • KIS
  • KextViewr*
  • KnockKnock*
  • Little Snitch*
  • LuLu*
  • Malware*
  • McAfee*
  • Netiquette*
  • OverSight*
  • RTProtectionDaemon*
  • SentinelOne*
  • VShieldScanner*
  • WebProtection*
  • WhatsYourSign*
  • avscan*
  • elastic-endpoint*
  • falcond*
  • filemonitor*
  • guard*
  • isecespd*
  • kav
  • kesl*
  • macmnsvc*
  • masvc*
  • osquery*
  • processmonitor*
  • reikey*
  • rtvscand*
  • scmdaemon*
  • sophos*
  • symantec*
  • symcfgd*
  • webinspectord*
field:"process.args" kind:wildcard
process.namewildcard
  • egrep
  • grep
  • pgrep
field:"process_basename" kind:wildcard
user.idne
  • 0
field:"user.id" kind:ne value:"0"

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.argseqAvastexcludes:process.args field:"process.args" value:"Avast"
process.argseqPasswordsexcludes:process.args field:"process.args" value:"Passwords"
process.parent.argseq/opt/McAfee/agent/scripts/maexcludes:process.parent.args field:"process.parent.args" value:"/opt/McAfee/agent/scripts/ma"
process.parent.argseqcheckhealthexcludes:process.parent.args field:"process.parent.args" value:"checkhealth"
process.argseqosquery.confexcludes:process.args field:"process.args" value:"osquery.conf"
process.command_lineeqgrep ESET Command-line scanner, version %s -A2, grep -i McAfee Web Gateway Core version:, grep --color=auto ESET Command-line scanner, version %s -A2excludes:process.command_line field:"process.command_line" value:"grep ESET Command-line scanner, version %s -A2" field:"process.command_line" value:"grep -i McAfee Web Gateway Core version:" field:"process.command_line" value:"grep --color=auto ESET Command-line scanner, version %s -A2"
process.parent.command_linewildcardsh -c printf "command_start_%s"*; perl -pe 's/[^ -~]/\n/g' < /opt/eset/esets/sbin/esets_scan | grep 'ESET Command-line scanner, version %s' -A2 | tail -1; printf "command_done_%s*, bash -c perl -pe 's/[^ -~]/\n/g' < /opt/eset/esets/sbin/esets_scan | grep 'ESET Command-line scanner, version %s' -A2 | tail -1excludes:process.parent.command_line
process.parent.executablewildcard/Library/Application Support/*, /opt/McAfee/agent/scripts/maexcludes:process.parent.executable field:"process.parent.executable" value:"/Library/Application Support/*" field:"process.parent.executable" value:"/opt/McAfee/agent/scripts/ma"

Shadow Copy Deletion via Windows Management Instrumentation

#
Source
github.com/elastic/protections-artifacts

Identifies suspicious processes using Windows Management Instrumentation (WMI) to delete shadow copies. Adversaries may delete shadow copies to prevent system recovery.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
Identifies suspicious processes using Windows Management Instrumentation (WMI) to delete shadow copies. Adversaries may
delete shadow copies to prevent system recovery.
"""
id = "c8591841-6b50-42ea-a6c2-7f88b19897f0"
license = "Elastic License v2"
name = "Shadow Copy Deletion via Windows Management Instrumentation"
os_list = ["windows"]
version = "1.0.7"

query = '''
api where
  process.Ext.api.name like "IWbemServices::DeleteInstance*" and
  process.Ext.api.parameters.operation like "Win32_ShadowCopy.*" and
  not (process.executable : ("?:\\Program Files\\Veeam\\Backup and Replication\\*.exe", "?:\\Program Files (x86)\\Veeam\\Backup and Replication\\*.exe") and
       process.code_signature.subject_name in ("Veeam Software Group GmbH", "Veeam Software AG") and process.code_signature.trusted == true) and
  not (process.executable : "C:\\Windows\\System32\\svchost.exe" and process.parent.executable : "C:\\Windows\\System32\\services.exe") and
  not (process.executable : "C:\\Windows\\System32\\svchost.exe" and process.parent.executable : "C:\\Windows\\System32\\services.exe") and
  not process.executable : "C:\\Program Files\\2BrightSparks\\SyncBackPro\\SyncBackPro.exe" and
  not (process.parent.executable : "C:\\Windows\\System32\\cmd.exe" and
      process.command_line : "powershell  -ExecutionPolicy ByPass -FILE \"C:\\WINDOWS\\system32\\config\\systemprofile\\AppData\\Local\\*.ps1\" ")
'''

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

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


[threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1490"
name = "Inhibit System Recovery"
reference = "https://attack.mitre.org/techniques/T1490/"


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

[internal]
min_endpoint_version = "8.15.0"

Stages and Predicates

Stage 1: api

api where
  process.Ext.api.name like "IWbemServices::DeleteInstance*" and
  process.Ext.api.parameters.operation like "Win32_ShadowCopy.*" and
  not (process.executable : ("?:\\Program Files\\Veeam\\Backup and Replication\\*.exe", "?:\\Program Files (x86)\\Veeam\\Backup and Replication\\*.exe") and
       process.code_signature.subject_name in ("Veeam Software Group GmbH", "Veeam Software AG") and process.code_signature.trusted == true) and
  not (process.executable : "C:\\Windows\\System32\\svchost.exe" and process.parent.executable : "C:\\Windows\\System32\\services.exe") and
  not (process.executable : "C:\\Windows\\System32\\svchost.exe" and process.parent.executable : "C:\\Windows\\System32\\services.exe") and
  not process.executable : "C:\\Program Files\\2BrightSparks\\SyncBackPro\\SyncBackPro.exe" and
  not (process.parent.executable : "C:\\Windows\\System32\\cmd.exe" and
      process.command_line : "powershell  -ExecutionPolicy ByPass -FILE \"C:\\WINDOWS\\system32\\config\\systemprofile\\AppData\\Local\\*.ps1\" ")

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.code_signature.subject_nameinVeeam Software AG, Veeam Software Group GmbHexcludes:process.code_signature.subject_name field:"process.code_signature.subject_name" value:"Veeam Software AG" field:"process.code_signature.subject_name" value:"Veeam Software Group GmbH"
process.code_signature.trustedeqtrueexcludes:process.code_signature.trusted field:"process.code_signature.trusted" value:"true"
process.executablewildcard?:\Program Files\Veeam\Backup and Replication\*.exe, ?:\Program Files (x86)\Veeam\Backup and Replication\*.exeexcludes:process.executable field:"process.executable" value:"?:\Program Files\Veeam\Backup and Replication\*.exe" field:"process.executable" value:"?:\Program Files (x86)\Veeam\Backup and Replication\*.exe"
process.command_linewildcardpowershell -ExecutionPolicy ByPass -FILE "C:\WINDOWS\system32\config\systemprofile\AppData\Local\*.ps1" excludes:process.command_line
process.parent.executableeqC:\Windows\System32\cmd.exeexcludes:process.parent.executable field:"process.parent.executable" value:"C:\Windows\System32\cmd.exe"
process.executableeqC:\Windows\System32\svchost.exeexcludes:process.executable field:"process.executable" value:"C:\Windows\System32\svchost.exe"
process.parent.executableeqC:\Windows\System32\services.exeexcludes:process.parent.executable field:"process.parent.executable" value:"C:\Windows\System32\services.exe"
process.executableeqC:\Program Files\2BrightSparks\SyncBackPro\SyncBackPro.exeexcludes:process.executable field:"process.executable" value:"C:\Program Files\2BrightSparks\SyncBackPro\SyncBackPro.exe"

Spike in Group Application Assignment Change Events

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

A machine learning job has identified an unusual spike in Okta group application assignment change events, indicating potential privileged access activity. Threat actors might be assigning applications to groups to escalate access, maintain persistence, or facilitate lateral movement within an organization’s environment.

MITRE ATT&CK Coverage

Rule Body

[metadata]
creation_date = "2025/02/18"
integration = ["pad", "okta"]
maturity = "production"
updated_date = "2026/07/27"
min_stack_version = "9.4.0"
min_stack_comments = "Use EA (Entity Analytics) fields"

[rule]
anomaly_threshold = 75
author = ["Elastic"]
description = """
A machine learning job has identified an unusual spike in Okta group application assignment change events, indicating
potential privileged access activity. Threat actors might be assigning applications to groups to escalate access,
maintain persistence, or facilitate lateral movement within an organization’s environment.
"""
from = "now-3h"
interval = "15m"
license = "Elastic License v2"
machine_learning_job_id = "pad_okta_spike_in_group_application_assignment_changes_ea"
name = "Spike in Group Application Assignment Change Events"
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 Spike in Group Application Assignment Change Events

In modern environments, identity and access management systems like Okta manage user access to applications. Adversaries may exploit these systems by altering group application assignments to gain unauthorized access or escalate privileges. The detection rule leverages machine learning to identify unusual spikes in these changes, signaling potential misuse and enabling timely investigation of privilege escalation activities.

### Possible investigation steps

- Review the specific group application assignment change events that triggered the alert to identify which groups and applications were involved.
- Analyze the timeline of the changes to determine if there is a pattern or specific time frame when the spike occurred.
- Investigate the user accounts associated with the changes to assess if they have a history of suspicious activity or if they belong to high-risk roles.
- Check for any recent changes in group membership or application access policies that could explain the spike in assignment changes.
- Correlate the events with other security alerts or logs to identify any concurrent suspicious activities, such as failed login attempts or unusual access patterns.
- Consult with the IT or security team to verify if there were any legitimate administrative activities or changes that could have caused the spike.

### False positive analysis

- Routine administrative changes in group application assignments can trigger false positives. Regularly review and document these changes to differentiate them from suspicious activities.
- Automated processes or scripts that frequently update group assignments may cause spikes. Identify and whitelist these processes to prevent unnecessary alerts.
- Organizational restructuring or onboarding/offboarding activities can lead to increased group assignment changes. Temporarily adjust the detection thresholds or exclude these events during known periods of high activity.
- Changes related to application updates or migrations might be flagged. Coordinate with IT teams to schedule these changes and exclude them from monitoring during the update window.
- Frequent changes by trusted users or administrators can be excluded by creating exceptions for specific user accounts or roles, ensuring that only unexpected changes trigger alerts.

### Response and remediation

- Immediately isolate affected user accounts and groups to prevent further unauthorized access or privilege escalation.
- Revert any unauthorized group application assignments to their previous state to mitigate potential misuse.
- Conduct a thorough review of recent changes in group application assignments to identify any additional unauthorized modifications.
- Escalate the incident to the security operations center (SOC) for further investigation and to determine if additional systems or accounts have been compromised.
- Implement additional monitoring on the affected accounts and groups to detect any further suspicious activity.
- Review and update access controls and group assignment policies to prevent similar unauthorized changes in the future.
- Coordinate with the IT and security teams to ensure that all affected systems and applications are patched and secured against known vulnerabilities."""
references = [
    "https://www.elastic.co/guide/en/security/current/prebuilt-ml-jobs.html",
    "https://docs.elastic.co/en/integrations/pad",
]
risk_score = 21
rule_id = "3278313c-d6cd-4d49-aa24-644e1da6623c"
setup = """## Setup

The rule requires the Privileged Access Detection integration assets to be installed, as well as Okta logs collected by integrations such as Okta.

### Privileged Access Detection Setup
The Privileged Access Detection integration detects privileged access activity by identifying abnormalities in Windows, Linux and Okta events. Anomalies are detected using Elastic's Anomaly Detection feature.

#### Prerequisite Requirements:
- Fleet is required for Privileged Access Detection.
- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).
- Okta events collected by [Okta](https://docs.elastic.co/en/integrations/okta) integration.
- To add the Okta integration to an Elastic Agent policy, refer to [this](https://www.elastic.co/guide/en/fleet/current/add-integration-to-policy.html) guide.

#### The following steps should be executed to install assets associated with the Privileged Access Detection integration:
- Go to the Kibana homepage. Under Management, click Integrations.
- In the query bar, search for Privileged Access Detection and select the integration to see more details about it.
- Follow the instructions under the **Installation** section.
- For this rule to work, complete the instructions through **Add preconfigured anomaly detection jobs**.
"""
severity = "low"
tags = [
    "Data Source: Okta",
    "Use Case: Privileged Access Detection",
    "Rule Type: ML",
    "Rule Type: Machine Learning",
    "Tactic: Privilege Escalation",
    "Resources: Investigation Guide",
]
type = "machine_learning"
[[rule.threat]]
framework = "MITRE ATT&CK"

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

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

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

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

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

Startup Persistence by a Low Reputation Process

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

Identifies when a process with low or unknown reputation is writing to commonly abused persistence locations (registry run keys and startup folder). Adversaries may use this technique to maintain persistence on an endpoint.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
Identifies when a process with low or unknown reputation is writing to commonly abused persistence locations (registry
run keys and startup folder). Adversaries may use this technique to maintain persistence on an endpoint.
"""
id = "45322752-e899-40ee-a0ba-b4d8d38ed151"
license = "Elastic License v2"
name = "Startup Persistence by a Low Reputation Process"
os_list = ["windows"]
reference = [
    "https://docs.microsoft.com/en-us/previous-versions/technet-magazine/ee851671(v=msdn.10)",
    "https://www.elastic.co/security-labs/dissecting-remcos-rat-part-four",
]
version = "1.0.13"

query = '''
sequence by process.entity_id with maxspan=5m
 [process where event.action == "start" and
 (process.Ext.relative_file_creation_time <= 1800 or process.Ext.relative_file_name_modify_time <= 1800) and
 (process.code_signature.trusted == false or process.code_signature.exists == false) and
 not process.code_signature.status like "errorCode_endpoint*" and
 not process.pe.imphash in ("952608687d343553fa2ebbe1a801044c",
                            "2ac0df3cb49d714c81e70b5b92c304f2",
                            "367254f4e83f62f5437681fde2e55f48",
                            "0d45614ce1da2206df8b743dab46d7e4") and
 not process.hash.sha256 :
                 ("933129e6153f10ed921d772467507389fc4f5d58846b89d3d7b5799cb23eb9b6",
                  "43eceb752381fc93992a317a3df6e3921f06ed5e45de808a75ffe3fe2e0afb89",
                  "f40b81f1d192c9494f35353df39072debe72c1284e3d16859979476ba1fad96f",
                  "d348833bf2d4666c5eff291d828d018bb70769dafdaf05347b63c5afcf5e2961",
                  "339a9a4b49467f9797204a5e27d73a8d72cc6c91ff1e9132a01910b20a64a48b",
                  "6a88b5179dd5560d3e11ba0962b23a414a9f26838a7a80472453437d821c8047",
                  "a9a5e36f77e5031436d8eaf16a01bdb27dc301a632eda8b0c0613d8508dca5c2",
                  "a748e17d33fe2dd47371c3c1d9a6625eeb871a262e508d15cb81de62e1cce7ac",
                  "035dfedcac91168ae84873a5eab6fc81cc914d2b8092babc162b019a885203e9",
                  "4f2629239477b651b96a456ec867ffb8f316bc7d87bab911f137bf5f74514268",
                  "901a1857c16856a3bf8854dbcd5813e15fc5cf5b13abee1ec9468c721977f415",
                  "756c03e14eeea5ce275fa4e5efd5b2af4c18deff55b2c7622ce6c21c7f226332",
                  "22ee08ed8c02358f994b5deba0940735b161f9a73ad60e4e57d10b9e1988ec83",
                  "4626fe6b05a7582fb3c824bae7b17f7418ec7796fb3e9ef22cb88af5516e084b",
                  "d57cdf9fe51debc65441be155eddb663cebfaec1c0c91161234dd3398ca71b76",
                  "04c9afe31fa9fd8340d19b0c0dd11ad9387f5f3e38045a04e4cdb97c8ebfa90b",
                  "d57cdf9fe51debc65441be155eddb663cebfaec1c0c91161234dd3398ca71b76",
                  "7428a9ceb04e588440d4847f3896ca2e024964e5e22111f2726cdd8c9445e1f4",
                  "a356832423f7fe4f2047daeefb33f968b8e2d6e87541e6d461baa4d0fc10fe76",
                  "ca7a8dabbd526f20bc0a947e9fb1e68d47c5aaf339c677d4f8d6bc90d07c1298",
                  "f1580a81a26f3b106f8c9169552191557037a019f4b6fd61ed86efc2ef2b0cc3",
                  "ce5576f49666f06fbb6798ce23b127075b66d45bb05affa55c2ab875adad2069",
                  "fb4e88e790fa47ba403b1142183e4288437963db487b56c7e02407fa2808cbec",
                  "7810ddb62441ed631136ed2e0d5c4a0f7ebe1fdb00b7db32f6952222ecef2b36",
                  "f112a55944329900e670033dc84560703fa4e271bf5be13cc5a14da603155548",
                  "a7bf2135d423ef1a84c35780bb8208a85df23c7228dbb2e3d5b9d5aec989ad2b",
                  "4997ec399b1292a8698366c605ebfaf72cb5089682a75c408978cb87c8d3a5a3",
                  "6680172392ee701a714d14bb010a00a054e102c664152bfc244dd74d0e32694d",
                  "2e2750ca395a0104571e97a77301d6332631592bd9062d6be425a2b32a049ed5") and
 not (process.executable : "C:\\Windows\\Temp\\AgentInstall.exe" and user.id : "S-1-5-18") and
 not process.executable : ("?:\\Windows\\ccmcache\\*.exe", "C:\\Windows\\SystemTemp\\*.exe") and
 not (process.executable : "C:\\Users\\*\\AppData\\Local\\Temp\\is-*.tmp\\*.tmp" and process.args : "/SL5=$*")]
 [any where event.category : ("registry", "file") and event.action != "deletion" and
   (
    (registry.data.strings != null and
     registry.path :
         ("H*\\Software\\Microsoft\\Windows\\CurrentVersion\\Run\\*",
		 "H*\\Software\\WOW6432Node\\Microsoft\\Windows\\CurrentVersion\\Run\\*",
		 "H*\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\\Run\\*",
		 "H*\\Software\\WOW6432Node\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\\Run\\*",
		 "HKEY_USERS\\*\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Windows\\Load",
		 "HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon\\Shell",
		 "HKEY_USERS\\*\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon\\Shell",
		 "HKEY_USERS\\*\\Environment\\UserInitMprLogonScript",
		 "HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon\\Userinit",
		 "HKEY_USERS\\*\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System\\Shell",
		 "HKEY_USERS\\*\\SOFTWARE\\Policies\\Microsoft\\Windows\\System\\Scripts\\Logoff\\Script",
		 "HKEY_USERS\\*\\SOFTWARE\\Policies\\Microsoft\\Windows\\System\\Scripts\\Logon\\Script",
		 "HKEY_USERS\\*\\SOFTWARE\\Policies\\Microsoft\\Windows\\System\\Scripts\\Shutdown\\Script",
		 "HKEY_USERS\\*\\SOFTWARE\\Policies\\Microsoft\\Windows\\System\\Scripts\\Startup\\Script",
		 "HKEY_USERS\\*\\SOFTWARE\\Microsoft\\Ctf\\LangBarAddin\\*\\FilePath",
		 "HKEY_USERS\\*\\SOFTWARE\\Microsoft\\Internet Explorer\\Extensions\\*\\Exec",
		 "HKEY_USERS\\*\\SOFTWARE\\Microsoft\\Command Processor\\Autorun",
		 "*\\Software\\Microsoft\\Windows\\CurrentVersion\\RunOnce\\*",
		 "*\\Software\\Microsoft\\Windows\\CurrentVersion\\RunOnceEx\\*",
		 "*\\Software\\WOW6432Node\\Microsoft\\Windows\\CurrentVersion\\RunOnce\\*",
		 "*\\exefile\\shell\\open\\command\\*") and
     not registry.data.strings : ("\"C:\\Program Files*", "C:\\Program Files*")
     ) or
    (file.name != null and file.path : "?:\\*\\Microsoft\\Windows\\Start Menu\\Programs\\Startup\\*")
   )]
'''

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

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

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "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/"

[internal]
min_endpoint_version = "8.10.0"

Stages and Predicates

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

Stage 1: process

[process where event.action == "start" and
 (process.Ext.relative_file_creation_time <= 1800 or process.Ext.relative_file_name_modify_time <= 1800) and
 (process.code_signature.trusted == false or process.code_signature.exists == false) and
 not process.code_signature.status like "errorCode_endpoint*" and
 not process.pe.imphash in ("952608687d343553fa2ebbe1a801044c",
                            "2ac0df3cb49d714c81e70b5b92c304f2",
                            "367254f4e83f62f5437681fde2e55f48",
                            "0d45614ce1da2206df8b743dab46d7e4") and
 not process.hash.sha256 :
                 ("933129e6153f10ed921d772467507389fc4f5d58846b89d3d7b5799cb23eb9b6",
                  "43eceb752381fc93992a317a3df6e3921f06ed5e45de808a75ffe3fe2e0afb89",
                  "f40b81f1d192c9494f35353df39072debe72c1284e3d16859979476ba1fad96f",
                  "d348833bf2d4666c5eff291d828d018bb70769dafdaf05347b63c5afcf5e2961",
                  "339a9a4b49467f9797204a5e27d73a8d72cc6c91ff1e9132a01910b20a64a48b",
                  "6a88b5179dd5560d3e11ba0962b23a414a9f26838a7a80472453437d821c8047",
                  "a9a5e36f77e5031436d8eaf16a01bdb27dc301a632eda8b0c0613d8508dca5c2",
                  "a748e17d33fe2dd47371c3c1d9a6625eeb871a262e508d15cb81de62e1cce7ac",
                  "035dfedcac91168ae84873a5eab6fc81cc914d2b8092babc162b019a885203e9",
                  "4f2629239477b651b96a456ec867ffb8f316bc7d87bab911f137bf5f74514268",
                  "901a1857c16856a3bf8854dbcd5813e15fc5cf5b13abee1ec9468c721977f415",
                  "756c03e14eeea5ce275fa4e5efd5b2af4c18deff55b2c7622ce6c21c7f226332",
                  "22ee08ed8c02358f994b5deba0940735b161f9a73ad60e4e57d10b9e1988ec83",
                  "4626fe6b05a7582fb3c824bae7b17f7418ec7796fb3e9ef22cb88af5516e084b",
                  "d57cdf9fe51debc65441be155eddb663cebfaec1c0c91161234dd3398ca71b76",
                  "04c9afe31fa9fd8340d19b0c0dd11ad9387f5f3e38045a04e4cdb97c8ebfa90b",
                  "d57cdf9fe51debc65441be155eddb663cebfaec1c0c91161234dd3398ca71b76",
                  "7428a9ceb04e588440d4847f3896ca2e024964e5e22111f2726cdd8c9445e1f4",
                  "a356832423f7fe4f2047daeefb33f968b8e2d6e87541e6d461baa4d0fc10fe76",
                  "ca7a8dabbd526f20bc0a947e9fb1e68d47c5aaf339c677d4f8d6bc90d07c1298",
                  "f1580a81a26f3b106f8c9169552191557037a019f4b6fd61ed86efc2ef2b0cc3",
                  "ce5576f49666f06fbb6798ce23b127075b66d45bb05affa55c2ab875adad2069",
                  "fb4e88e790fa47ba403b1142183e4288437963db487b56c7e02407fa2808cbec",
                  "7810ddb62441ed631136ed2e0d5c4a0f7ebe1fdb00b7db32f6952222ecef2b36",
                  "f112a55944329900e670033dc84560703fa4e271bf5be13cc5a14da603155548",
                  "a7bf2135d423ef1a84c35780bb8208a85df23c7228dbb2e3d5b9d5aec989ad2b",
                  "4997ec399b1292a8698366c605ebfaf72cb5089682a75c408978cb87c8d3a5a3",
                  "6680172392ee701a714d14bb010a00a054e102c664152bfc244dd74d0e32694d",
                  "2e2750ca395a0104571e97a77301d6332631592bd9062d6be425a2b32a049ed5") and
 not (process.executable : "C:\\Windows\\Temp\\AgentInstall.exe" and user.id : "S-1-5-18") and
 not process.executable : ("?:\\Windows\\ccmcache\\*.exe", "C:\\Windows\\SystemTemp\\*.exe") and
 not (process.executable : "C:\\Users\\*\\AppData\\Local\\Temp\\is-*.tmp\\*.tmp" and process.args : "/SL5=$*")]

Stage 2: any

[any where event.category : ("registry", "file") and event.action != "deletion" and
   (
    (registry.data.strings != null and
     registry.path :
         ("H*\\Software\\Microsoft\\Windows\\CurrentVersion\\Run\\*",
		 "H*\\Software\\WOW6432Node\\Microsoft\\Windows\\CurrentVersion\\Run\\*",
		 "H*\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\\Run\\*",
		 "H*\\Software\\WOW6432Node\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\\Run\\*",
		 "HKEY_USERS\\*\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Windows\\Load",
		 "HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon\\Shell",
		 "HKEY_USERS\\*\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon\\Shell",
		 "HKEY_USERS\\*\\Environment\\UserInitMprLogonScript",
		 "HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon\\Userinit",
		 "HKEY_USERS\\*\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System\\Shell",
		 "HKEY_USERS\\*\\SOFTWARE\\Policies\\Microsoft\\Windows\\System\\Scripts\\Logoff\\Script",
		 "HKEY_USERS\\*\\SOFTWARE\\Policies\\Microsoft\\Windows\\System\\Scripts\\Logon\\Script",
		 "HKEY_USERS\\*\\SOFTWARE\\Policies\\Microsoft\\Windows\\System\\Scripts\\Shutdown\\Script",
		 "HKEY_USERS\\*\\SOFTWARE\\Policies\\Microsoft\\Windows\\System\\Scripts\\Startup\\Script",
		 "HKEY_USERS\\*\\SOFTWARE\\Microsoft\\Ctf\\LangBarAddin\\*\\FilePath",
		 "HKEY_USERS\\*\\SOFTWARE\\Microsoft\\Internet Explorer\\Extensions\\*\\Exec",
		 "HKEY_USERS\\*\\SOFTWARE\\Microsoft\\Command Processor\\Autorun",
		 "*\\Software\\Microsoft\\Windows\\CurrentVersion\\RunOnce\\*",
		 "*\\Software\\Microsoft\\Windows\\CurrentVersion\\RunOnceEx\\*",
		 "*\\Software\\WOW6432Node\\Microsoft\\Windows\\CurrentVersion\\RunOnce\\*",
		 "*\\exefile\\shell\\open\\command\\*") and
     not registry.data.strings : ("\"C:\\Program Files*", "C:\\Program Files*")
     ) or
    (file.name != null and file.path : "?:\\*\\Microsoft\\Windows\\Start Menu\\Programs\\Startup\\*")
   )]

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • start corpus 388 (elastic 388)
field:"EventType" kind:eq value:"start"
event.actionne
  • deletion corpus 90 (elastic 90)
field:"EventType" kind:ne value:"deletion"
event.categorywildcard
  • file corpus 29 (elastic 29)
  • registry corpus 8 (elastic 8)
field:"event.category" kind:wildcard
file.nameis_not_null
  • (no value, null check)
field:"file.name" kind:is_not_null
file.pathwildcard
  • ?:\*\Microsoft\Windows\Start Menu\Programs\Startup\* corpus 9 (elastic 9)
field:"TargetFilename" kind:wildcard value:"?:\*\Microsoft\Windows\Start Menu\Programs\Startup\*"
process.Ext.relative_file_creation_timele
  • 1800 transforms: number corpus 6 (elastic 6)
field:"process.Ext.relative_file_creation_time" kind:le value:"1800"
process.Ext.relative_file_name_modify_timele
  • 1800 transforms: number corpus 6 (elastic 6)
field:"process.Ext.relative_file_name_modify_time" kind:le value:"1800"
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"
registry.data.stringsis_not_null
  • (no value, null check)
field:"Details" kind:is_not_null
registry.pathwildcard
  • *\Software\Microsoft\Windows\CurrentVersion\RunOnceEx\*
  • *\Software\Microsoft\Windows\CurrentVersion\RunOnce\*
  • *\Software\WOW6432Node\Microsoft\Windows\CurrentVersion\RunOnce\*
  • *\exefile\shell\open\command\*
  • H*\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\Run\* corpus 11 (elastic 11)
  • H*\Software\Microsoft\Windows\CurrentVersion\Run\* corpus 12 (elastic 12)
  • H*\Software\WOW6432Node\Microsoft\Windows\CurrentVersion\Policies\Explorer\Run\* corpus 11 (elastic 11)
  • H*\Software\WOW6432Node\Microsoft\Windows\CurrentVersion\Run\* corpus 11 (elastic 11)
  • HKEY_USERS\*\Environment\UserInitMprLogonScript corpus 12 (elastic 12)
  • HKEY_USERS\*\SOFTWARE\Microsoft\Command Processor\Autorun corpus 11 (elastic 11)
  • HKEY_USERS\*\SOFTWARE\Microsoft\Ctf\LangBarAddin\*\FilePath corpus 11 (elastic 11)
  • HKEY_USERS\*\SOFTWARE\Microsoft\Internet Explorer\Extensions\*\Exec corpus 11 (elastic 11)
  • HKEY_USERS\*\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows\Load corpus 12 (elastic 12)
  • HKEY_USERS\*\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\Shell corpus 12 (elastic 12)
  • HKEY_USERS\*\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\Shell corpus 11 (elastic 11)
  • HKEY_USERS\*\SOFTWARE\Policies\Microsoft\Windows\System\Scripts\Logoff\Script corpus 11 (elastic 11)
  • HKEY_USERS\*\SOFTWARE\Policies\Microsoft\Windows\System\Scripts\Logon\Script corpus 11 (elastic 11)
  • HKEY_USERS\*\SOFTWARE\Policies\Microsoft\Windows\System\Scripts\Shutdown\Script corpus 11 (elastic 11)
  • HKEY_USERS\*\SOFTWARE\Policies\Microsoft\Windows\System\Scripts\Startup\Script corpus 11 (elastic 11)
  • HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\Shell corpus 8 (elastic 8)
  • HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\Userinit corpus 8 (elastic 8)
field:"TargetObject" kind:wildcard

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.argsstarts_with/SL5=$excludes:process.args field:"process.args" value:"/SL5=$"
process.executablewildcardC:\Users\*\AppData\Local\Temp\is-*.tmp\*.tmpexcludes:process.executable field:"process.executable" value:"C:\Users\*\AppData\Local\Temp\is-*.tmp\*.tmp"
process.executableeqC:\Windows\Temp\AgentInstall.exeexcludes:process.executable field:"process.executable" value:"C:\Windows\Temp\AgentInstall.exe"
user.ideqS-1-5-18excludes:user.id field:"user.id" value:"S-1-5-18"
process.code_signature.statusstarts_witherrorCode_endpointexcludes:process.code_signature.status field:"process.code_signature.status" value:"errorCode_endpoint"
process.executablewildcard?:\Windows\ccmcache\*.exe, C:\Windows\SystemTemp\*.exeexcludes:process.executable field:"process.executable" value:"?:\Windows\ccmcache\*.exe" field:"process.executable" value:"C:\Windows\SystemTemp\*.exe"
process.hash.sha256eq933129e6153f10ed921d772467507389fc4f5d58846b89d3d7b5799cb23eb9b6, 43eceb752381fc93992a317a3df6e3921f06ed5e45de808a75ffe3fe2e0afb89, f40b81f1d192c9494f35353df39072debe72c1284e3d16859979476ba1fad96f, d348833bf2d4666c5eff291d828d018bb70769dafdaf05347b63c5afcf5e2961, 339a9a4b49467f9797204a5e27d73a8d72cc6c91ff1e9132a01910b20a64a48b, 6a88b5179dd5560d3e11ba0962b23a414a9f26838a7a80472453437d821c8047, a9a5e36f77e5031436d8eaf16a01bdb27dc301a632eda8b0c0613d8508dca5c2, a748e17d33fe2dd47371c3c1d9a6625eeb871a262e508d15cb81de62e1cce7ac, 035dfedcac91168ae84873a5eab6fc81cc914d2b8092babc162b019a885203e9, 4f2629239477b651b96a456ec867ffb8f316bc7d87bab911f137bf5f74514268, 901a1857c16856a3bf8854dbcd5813e15fc5cf5b13abee1ec9468c721977f415, 756c03e14eeea5ce275fa4e5efd5b2af4c18deff55b2c7622ce6c21c7f226332, 22ee08ed8c02358f994b5deba0940735b161f9a73ad60e4e57d10b9e1988ec83, 4626fe6b05a7582fb3c824bae7b17f7418ec7796fb3e9ef22cb88af5516e084b, d57cdf9fe51debc65441be155eddb663cebfaec1c0c91161234dd3398ca71b76, 04c9afe31fa9fd8340d19b0c0dd11ad9387f5f3e38045a04e4cdb97c8ebfa90b, d57cdf9fe51debc65441be155eddb663cebfaec1c0c91161234dd3398ca71b76, 7428a9ceb04e588440d4847f3896ca2e024964e5e22111f2726cdd8c9445e1f4, a356832423f7fe4f2047daeefb33f968b8e2d6e87541e6d461baa4d0fc10fe76, ca7a8dabbd526f20bc0a947e9fb1e68d47c5aaf339c677d4f8d6bc90d07c1298, f1580a81a26f3b106f8c9169552191557037a019f4b6fd61ed86efc2ef2b0cc3, ce5576f49666f06fbb6798ce23b127075b66d45bb05affa55c2ab875adad2069, fb4e88e790fa47ba403b1142183e4288437963db487b56c7e02407fa2808cbec, 7810ddb62441ed631136ed2e0d5c4a0f7ebe1fdb00b7db32f6952222ecef2b36, f112a55944329900e670033dc84560703fa4e271bf5be13cc5a14da603155548, a7bf2135d423ef1a84c35780bb8208a85df23c7228dbb2e3d5b9d5aec989ad2b, 4997ec399b1292a8698366c605ebfaf72cb5089682a75c408978cb87c8d3a5a3, 6680172392ee701a714d14bb010a00a054e102c664152bfc244dd74d0e32694d, 2e2750ca395a0104571e97a77301d6332631592bd9062d6be425a2b32a049ed5excludes:process.hash.sha256
process.pe.imphashin0d45614ce1da2206df8b743dab46d7e4, 2ac0df3cb49d714c81e70b5b92c304f2, 367254f4e83f62f5437681fde2e55f48, 952608687d343553fa2ebbe1a801044cexcludes:process.pe.imphash

Suspicious Bitsadmin Activity

#
Source
github.com/elastic/protections-artifacts

Identifies downloads, transfers, or job creations using Windows Background Intelligent Transfer Service (BITS) Admin Tool. This tactic may be indicative of malicious activity where malware is downloading second stage payloads using obscure methods.

MITRE ATT&CK Coverage

TacticTechniques
Stealth

Rule Body

[rule]
description = """
Identifies downloads, transfers, or job creations using Windows Background Intelligent Transfer Service (BITS) Admin
Tool. This tactic may be indicative of malicious activity where malware is downloading second stage payloads using
obscure methods.
"""
id = "676ac66c-4899-498f-ae21-ed5620af5477"
license = "Elastic License v2"
name = "Suspicious Bitsadmin Activity"
os_list = ["windows"]
reference = ["https://www.elastic.co/blog/hunting-for-persistence-using-elastic-security-part-2"]
version = "1.0.35"

query = '''
process where event.action == "start" and
  (process.name : "bitsadmin.exe" or process.pe.original_file_name : "bitsadmin.exe") and
  process.command_line : ("*download*", "*transfer*", "*create*", "*addfile*", "*SetNotifyCmdLine*") and
  (process.parent.name : (
      "winword.exe",
      "excel.exe",
      "outlook.exe",
      "powerpnt.exe",
      "eqnedt32.exe",
      "fltldr.exe",
      "mspub.exe",
      "msaccess.exe",
      "acrord32.exe",
      "rdrcef.exe",
      "foxitphantomPDF.exe",
      "foxitreader.exe",
      "firefox.exe",
      "chrome.exe",
      "iexplore.exe",
      "opera.exe",
      "plugin-container.exe",
      "safari.exe",
      "microsoftedge.exe",
      "w3wp.exe",
      "httpd.exe",
      "nginx.exe",
      "php.exe",
      "php-cgi.exe",
      "tomcat.exe",
      "wscript.exe",
      "cscript.exe",
      "powershell.exe",
      "pwsh.exe",
      "cmd.exe",
      "mshta.exe"
      ) or
  descendant of [process where event.action == "start" and
    process.parent.name : (
      "winword.exe",
      "excel.exe",
      "outlook.exe",
      "powerpnt.exe",
      "eqnedt32.exe",
      "fltldr.exe",
      "mspub.exe",
      "msaccess.exe",
      "acrord32.exe",
      "rdrcef.exe",
      "foxitphantomPDF.exe",
      "foxitreader.exe",
      "firefox.exe",
      "chrome.exe",
      "iexplore.exe",
      "opera.exe",
      "plugin-container.exe",
      "safari.exe",
      "microsoftedge.exe",
      "w3wp.exe",
      "httpd.exe",
      "nginx.exe",
      "php.exe",
      "php-cgi.exe",
      "tomcat.exe",
      "wscript.exe",
      "cscript.exe",
      "powershell.exe",
      "pwsh.exe",
      "cmd.exe",
      "mshta.exe"
    )]) and
    not (process.args : "https://dl.duosecurity.com/*" and process.parent.args : "?:\\ProgramData\\NinjaRMMAgent\\scripting\\*") and
    not process.command_line : "bitsadmin  /RawReturn /GetBytesTransferred mingw" and
    not process.args :
             ("https://opalrtwebsitedata.blob.core.windows.net/software/mingw/*",
              "C:\\EMES\\workspace\\1.9\\sim.properties",
              "C:\\EMES\\rsd\\run.bat",
              "C:\\EMES\\rsd\\sim.properties",
              "C:\\EMES\\tmp\\restart_rsd.bat") and
    not process.executable : "?:\\Program Files (x86)\\Bosch\\DownloadManager\\bin\\Bitsadmin*.exe" and
    not (process.parent.name : "cmd.exe" and
         process.parent.command_line : (
            "C:\\WINDOWS\\system32\\cmd.exe /c \"\"C:\\Program Files\\ATERA Networks\\AteraAgent\\Packages\\AgentPackageSystemTools\\*.bat\"\"",
            "C:\\Windows\\SYSTEM32\\cmd.exe /c \"\"C:\\Program files\\vuls-saas\\vuls-saas.bat\"\""
        ))
'''

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


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

[internal]
min_endpoint_version = "7.15.0"

Stages and Predicates

Stage 1: process

process where event.action == "start" and
  (process.name : "bitsadmin.exe" or process.pe.original_file_name : "bitsadmin.exe") and
  process.command_line : ("*download*", "*transfer*", "*create*", "*addfile*", "*SetNotifyCmdLine*") and
  (process.parent.name : (
      "winword.exe",
      "excel.exe",
      "outlook.exe",
      "powerpnt.exe",
      "eqnedt32.exe",
      "fltldr.exe",
      "mspub.exe",
      "msaccess.exe",
      "acrord32.exe",
      "rdrcef.exe",
      "foxitphantomPDF.exe",
      "foxitreader.exe",
      "firefox.exe",
      "chrome.exe",
      "iexplore.exe",
      "opera.exe",
      "plugin-container.exe",
      "safari.exe",
      "microsoftedge.exe",
      "w3wp.exe",
      "httpd.exe",
      "nginx.exe",
      "php.exe",
      "php-cgi.exe",
      "tomcat.exe",
      "wscript.exe",
      "cscript.exe",
      "powershell.exe",
      "pwsh.exe",
      "cmd.exe",
      "mshta.exe"
      ) or
  descendant of [process where event.action == "start" and
    process.parent.name : (
      "winword.exe",
      "excel.exe",
      "outlook.exe",
      "powerpnt.exe",
      "eqnedt32.exe",
      "fltldr.exe",
      "mspub.exe",
      "msaccess.exe",
      "acrord32.exe",
      "rdrcef.exe",
      "foxitphantomPDF.exe",
      "foxitreader.exe",
      "firefox.exe",
      "chrome.exe",
      "iexplore.exe",
      "opera.exe",
      "plugin-container.exe",
      "safari.exe",
      "microsoftedge.exe",
      "w3wp.exe",
      "httpd.exe",
      "nginx.exe",
      "php.exe",
      "php-cgi.exe",
      "tomcat.exe",
      "wscript.exe",
      "cscript.exe",
      "powershell.exe",
      "pwsh.exe",
      "cmd.exe",
      "mshta.exe"
    )]) and
    not (process.args : "https://dl.duosecurity.com/*" and process.parent.args : "?:\\ProgramData\\NinjaRMMAgent\\scripting\\*") and
    not process.command_line : "bitsadmin  /RawReturn /GetBytesTransferred mingw" and
    not process.args :
             ("https://opalrtwebsitedata.blob.core.windows.net/software/mingw/*",
              "C:\\EMES\\workspace\\1.9\\sim.properties",
              "C:\\EMES\\rsd\\run.bat",
              "C:\\EMES\\rsd\\sim.properties",
              "C:\\EMES\\tmp\\restart_rsd.bat") and
    not process.executable : "?:\\Program Files (x86)\\Bosch\\DownloadManager\\bin\\Bitsadmin*.exe" and
    not (process.parent.name : "cmd.exe" and
         process.parent.command_line : (
            "C:\\WINDOWS\\system32\\cmd.exe /c \"\"C:\\Program Files\\ATERA Networks\\AteraAgent\\Packages\\AgentPackageSystemTools\\*.bat\"\"",
            "C:\\Windows\\SYSTEM32\\cmd.exe /c \"\"C:\\Program files\\vuls-saas\\vuls-saas.bat\"\""
        ))

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
  • *SetNotifyCmdLine* corpus 2 (elastic 2)
  • *addfile* corpus 2 (elastic 2)
  • *create* corpus 29 (sigma 17, splunk 7, elastic 5)
  • *download* corpus 4 (elastic 3, sigma 1)
  • *transfer* corpus 3 (elastic 3)
field:"CommandLine" kind:wildcard
process.namewildcard
  • bitsadmin.exe corpus 25 (elastic 22, splunk 2, kusto 1)
field:"process_basename" kind:wildcard value:"bitsadmin.exe"
process.parent.namewildcard
  • acrord32.exe corpus 3 (elastic 3)
  • chrome.exe corpus 9 (elastic 9)
  • cmd.exe corpus 37 (elastic 32, splunk 4, kusto 1)
  • cscript.exe corpus 16 (elastic 15, splunk 1)
  • eqnedt32.exe corpus 9 (elastic 9)
  • excel.exe corpus 28 (elastic 27, splunk 1)
  • firefox.exe corpus 9 (elastic 9)
  • fltldr.exe corpus 7 (elastic 7)
  • foxitphantomPDF.exe corpus 3 (elastic 3)
  • foxitreader.exe corpus 3 (elastic 3)
  • httpd.exe corpus 2 (elastic 2)
  • iexplore.exe corpus 8 (elastic 8)
  • microsoftedge.exe corpus 2 (elastic 2)
  • msaccess.exe corpus 12 (elastic 12)
  • mshta.exe corpus 24 (elastic 22, splunk 2)
  • mspub.exe corpus 11 (elastic 11)
  • nginx.exe corpus 2 (elastic 2)
  • opera.exe corpus 4 (elastic 4)
  • outlook.exe corpus 10 (elastic 10)
  • php-cgi.exe corpus 2 (elastic 2)
  • php.exe corpus 2 (elastic 2)
  • plugin-container.exe corpus 2 (elastic 2)
  • powerpnt.exe corpus 23 (elastic 23)
  • powershell.exe corpus 37 (elastic 35, splunk 1, kusto 1)
  • pwsh.exe corpus 5 (elastic 5)
  • rdrcef.exe corpus 2 (elastic 2)
  • safari.exe corpus 3 (elastic 3)
  • tomcat.exe corpus 2 (elastic 2)
  • w3wp.exe corpus 8 (elastic 8)
  • winword.exe corpus 26 (elastic 26)
  • wscript.exe corpus 24 (elastic 23, splunk 1)
field:"parent_process_basename" kind:wildcard
process.pe.original_file_namewildcard
  • bitsadmin.exe corpus 19 (sigma 9, elastic 8, splunk 2)
field:"OriginalFileName" kind:wildcard value:"bitsadmin.exe"

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.argsstarts_withhttps://dl.duosecurity.com/excludes:process.args field:"process.args" value:"https://dl.duosecurity.com/"
process.parent.argsstarts_with?:\ProgramData\NinjaRMMAgent\scripting\excludes:process.parent.args field:"process.parent.args" value:"?:\ProgramData\NinjaRMMAgent\scripting\"
process.parent.command_linewildcardC:\WINDOWS\system32\cmd.exe /c ""C:\Program Files\ATERA Networks\AteraAgent\Packages\AgentPackageSystemTools\*.bat"", C:\Windows\SYSTEM32\cmd.exe /c ""C:\Program files\vuls-saas\vuls-saas.bat""excludes:process.parent.command_line
process.parent.nameeqcmd.exeexcludes:process.parent.name field:"process.parent.name" value:"cmd.exe"
process.argswildcardhttps://opalrtwebsitedata.blob.core.windows.net/software/mingw/*, C:\EMES\workspace\1.9\sim.properties, C:\EMES\rsd\run.bat, C:\EMES\rsd\sim.properties, C:\EMES\tmp\restart_rsd.batexcludes:process.args
process.command_lineeqbitsadmin /RawReturn /GetBytesTransferred mingwexcludes:process.command_line field:"process.command_line" value:"bitsadmin /RawReturn /GetBytesTransferred mingw"
process.executablewildcard?:\Program Files (x86)\Bosch\DownloadManager\bin\Bitsadmin*.exeexcludes:process.executable field:"process.executable" value:"?:\Program Files (x86)\Bosch\DownloadManager\bin\Bitsadmin*.exe"

Suspicious Image Load from a Stomped Module

#
Source
github.com/elastic/protections-artifacts

Identifies potential traces of module stomping where a Windows library is loaded from a suspicious call stack.

MITRE ATT&CK Coverage

TacticTechniques
Stealth

Rule Body

[rule]
description = "Identifies potential traces of module stomping where a Windows library is loaded from a suspicious call stack."
id = "27cb2961-ddd1-4f4c-89bd-715de642e71a"
license = "Elastic License v2"
name = "Suspicious Image Load from a Stomped Module"
os_list = ["windows"]
version = "1.0.3"

query = '''
library where dll.code_signature.subject_name == "Microsoft Windows" and
 process.thread.Ext.call_stack_summary regex """.*\|(wininet.dll|ws2_32.dll)\|[a-z]+\.dll""" and
 _arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info : ("C:\\Windows\\System32\\wininet.dll!InternetOpen*", "C:\\Windows\\System32\\ws2_32.dll!WSASocket*")) and
 _arraysearch(process.thread.Ext.call_stack, $entry, $entry.callsite_trailing_bytes : "?*" and not $entry.symbol_info : ("C:\\Windows\\System32\\ntdll.dll*", "C:\\Windows\\System32\\kernelbase.dll*", "C:\\Windows\\System32\\wininet.dll*", "C:\\Windows\\System32\\ws2_32.dll*", "Unbacked*")) and
 not process.thread.Ext.call_stack_summary like "ntdll.dll|*|kernelbase.dll|ws2_32.dll|libcef.dll" and
 not (process.name : ("msedge.exe", "msedgewebview2.exe") and process.thread.Ext.call_stack_summary like "ntdll.dll|*|ws2_32.dll|msedge.dll") and
 not dll.name in ("mswsock.dll", "bcrypt.dll") and
 not (dll.name : "FWPUCLNT.DLL" and process.thread.Ext.call_stack_summary like "ntdll.dll|*|wininet.dll|adal.dll") and
 not (dll.name : "dnsapi.dll" and process.thread.Ext.call_stack_summary like ("ntdll.dll|*|ws2_32.dll|wininet.dll", "ntdll.dll|*|wininet.dll|ntdll.dll"))
'''

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

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


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

[internal]
min_endpoint_version = "8.10.0"

Stages and Predicates

Stage 1: library

library where dll.code_signature.subject_name == "Microsoft Windows" and
 process.thread.Ext.call_stack_summary regex """.*\|(wininet.dll|ws2_32.dll)\|[a-z]+\.dll""" and
 _arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info : ("C:\\Windows\\System32\\wininet.dll!InternetOpen*", "C:\\Windows\\System32\\ws2_32.dll!WSASocket*")) and
 _arraysearch(process.thread.Ext.call_stack, $entry, $entry.callsite_trailing_bytes : "?*" and not $entry.symbol_info : ("C:\\Windows\\System32\\ntdll.dll*", "C:\\Windows\\System32\\kernelbase.dll*", "C:\\Windows\\System32\\wininet.dll*", "C:\\Windows\\System32\\ws2_32.dll*", "Unbacked*")) and
 not process.thread.Ext.call_stack_summary like "ntdll.dll|*|kernelbase.dll|ws2_32.dll|libcef.dll" and
 not (process.name : ("msedge.exe", "msedgewebview2.exe") and process.thread.Ext.call_stack_summary like "ntdll.dll|*|ws2_32.dll|msedge.dll") and
 not dll.name in ("mswsock.dll", "bcrypt.dll") and
 not (dll.name : "FWPUCLNT.DLL" and process.thread.Ext.call_stack_summary like "ntdll.dll|*|wininet.dll|adal.dll") and
 not (dll.name : "dnsapi.dll" and process.thread.Ext.call_stack_summary like ("ntdll.dll|*|ws2_32.dll|wininet.dll", "ntdll.dll|*|wininet.dll|ntdll.dll"))

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

Suspicious Network Connection from Microsoft Equation Editor

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

Identifies a suspicious network connection from the Microsoft Equation Editor process, which is frequently targeted by attackers using weaponized Microsoft Office documents. This behavior is consistent with the successful exploitation of Office applications via known vulnerabilities CVE-2017-1182 or CVE-2018-0798.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
Identifies a suspicious network connection from the Microsoft Equation Editor process, which is frequently targeted by
attackers using weaponized Microsoft Office documents. This behavior is consistent with the successful exploitation of
Office applications via known vulnerabilities CVE-2017-1182 or CVE-2018-0798.
"""
id = "365571bb-2b93-4ae8-8c39-0558f8a6c4cc"
license = "Elastic License v2"
name = "Suspicious Network Connection from Microsoft Equation Editor"
os_list = ["windows"]
reference = [
    "https://www.anomali.com/blog/multiple-chinese-threat-groups-exploiting-cve-2018-0798-equation-editor-vulnerability-since-late-2018",
    "https://nvd.nist.gov/vuln/detail/CVE-2017-11882",
    "https://nvd.nist.gov/vuln/detail/CVE-2018-0798",
]
version = "1.0.31"

query = '''
sequence by process.entity_id with maxspan=30s
  [process where event.action == "start" and process.name : "EQNEDT32.EXE" and process.args : "-Embedding"]
  [network where event.action == "connection_attempted" and process.name : "EQNEDT32.EXE"]
'''

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

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

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



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


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

[internal]
min_endpoint_version = "7.15.0"

Stages and Predicates

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

Stage 1: process

[process where event.action == "start" and process.name : "EQNEDT32.EXE" and process.args : "-Embedding"]

Stage 2: network

[network where event.action == "connection_attempted" and process.name : "EQNEDT32.EXE"]

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • connection_attempted corpus 72 (elastic 72)
  • start corpus 388 (elastic 388)
field:"EventType" kind:eq
process.argswildcard
  • -Embedding corpus 2 (elastic 2)
field:"process.args" kind:wildcard value:"-Embedding"
process.namewildcard
  • EQNEDT32.EXE corpus 8 (elastic 8)
field:"process_basename" kind:wildcard value:"EQNEDT32.EXE"

Suspicious Powershell Script

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

A machine learning job detected a PowerShell script with unusual data characteristics, such as obfuscation, that may be a characteristic of malicious PowerShell script text blocks.

Known False Positives

  • Certain kinds of security testing may trigger this alert. PowerShell scripts that use high levels of obfuscation or have unusual script block payloads may trigger this alert.

MITRE ATT&CK Coverage

Rule Body

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

[rule]
anomaly_threshold = 50
author = ["Elastic"]
description = """
A machine learning job detected a PowerShell script with unusual data characteristics, such as obfuscation, that may be
a characteristic of malicious PowerShell script text blocks.
"""
false_positives = [
    """
    Certain kinds of security testing may trigger this alert. PowerShell scripts that use high levels of obfuscation or
    have unusual script block payloads may trigger this alert.
    """,
]
from = "now-45m"
interval = "15m"
license = "Elastic License v2"
machine_learning_job_id = ["v3_windows_anomalous_script_ea"]
name = "Suspicious Powershell Script"
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 Powershell Script

PowerShell is a powerful scripting language used for task automation and configuration management in Windows environments. Adversaries often exploit its capabilities to execute malicious scripts, leveraging obfuscation to evade detection. The 'Suspicious Powershell Script' detection rule employs machine learning to identify unusual script characteristics, such as obfuscation, indicating potential threats. By analyzing these anomalies, the rule aids in early threat detection and mitigation.

### Possible investigation steps

- Review the alert details to identify the specific PowerShell script or command that triggered the detection, focusing on any obfuscated elements.
- Examine the source endpoint and user account associated with the alert to determine if the activity aligns with expected behavior or if it appears suspicious.
- Check the execution history on the affected endpoint for any other unusual or unauthorized PowerShell commands or scripts executed around the same time.
- Investigate the network activity from the source endpoint to identify any connections to known malicious IP addresses or domains.
- Correlate the alert with other security events or logs, such as antivirus alerts or firewall logs, to gather additional context and assess the potential impact.
- Consult threat intelligence sources to determine if the detected script or its components are associated with known malware or attack campaigns.

### False positive analysis

- Legitimate administrative scripts may trigger the rule due to obfuscation techniques used for efficiency or security. Review the script's purpose and source to determine its legitimacy.
- Automated deployment tools often use PowerShell scripts that appear obfuscated. Identify and whitelist these tools to prevent unnecessary alerts.
- Security software updates might use obfuscated scripts for protection against tampering. Verify the update source and add exceptions for known trusted vendors.
- Custom scripts developed in-house for specific tasks may use obfuscation for intellectual property protection. Document and exclude these scripts after confirming their safety.
- Regularly review and update the list of exceptions to ensure that only verified non-threatening scripts are excluded, maintaining the effectiveness of the detection rule.

### Response and remediation

- Isolate the affected system from the network to prevent further spread of the potential threat and to contain any malicious activity.
- Terminate any suspicious PowerShell processes identified on the affected system to halt the execution of potentially harmful scripts.
- Conduct a thorough review of the PowerShell script logs and execution history on the affected system to identify any unauthorized or malicious commands executed.
- Restore the affected system from a known good backup if any malicious activity is confirmed, ensuring that the backup is free from compromise.
- Update and patch the affected system to the latest security standards to close any vulnerabilities that may have been exploited.
- Implement enhanced monitoring for PowerShell activity across the network, focusing on detecting obfuscation and unusual script characteristics.
- Escalate the incident to the security operations center (SOC) or incident response team for further investigation and to determine if additional systems are affected."""
references = [
    "https://www.elastic.co/guide/en/security/current/prebuilt-ml-jobs.html",
    "https://www.elastic.co/security-labs/detecting-living-off-the-land-attacks-with-new-elastic-integration",
]
risk_score = 21
rule_id = "1781d055-5c66-4adf-9d60-fc0fa58337b6"
setup = """## Setup

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

### Anomaly Detection Setup

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

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

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

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

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

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

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

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

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

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

Suspicious Windows NT API Hooking

#
Source
github.com/elastic/protections-artifacts

Identifies attempts to hook certain memory section mapping related APIs with suspicious properties. This may indicate an attempt to evade defense leveraging API hooking.

MITRE ATT&CK Coverage

TacticTechniques
Stealth

Rule Body

[rule]
description = """
Identifies attempts to hook certain memory section mapping related APIs with suspicious properties. This may indicate an
attempt to evade defense leveraging API hooking.
"""
id = "63f3d1c5-7e19-48db-965d-cc2a52e96650"
license = "Elastic License v2"
name = "Suspicious Windows NT API Hooking"
os_list = ["windows"]
version = "1.0.5"

query = '''
api where process.Ext.api.name == "WriteProcessMemory" and process.Ext.api.behaviors == "hook_api" and
 process.Ext.api.summary : "* Self,*" and
 process.Ext.api.summary like
                           ("*ntdll.dll!??CreateSection*", "*ntdll.dll!??OpenSection*", "*ntdll.dll!??Close*", "*ntdll.dll!??MapViewOfSection*", "*ntdll.dll!??UnmapViewOfSection*") and
 process.Ext.api.parameters.size == 21  and
 not process.Ext.api.behaviors in ("cross-process", "parent-child") and process.thread.Ext.call_stack_final_user_module.name != "Kernel" and
 not (process.code_signature.status == "trusted" and startswith~(process.thread.Ext.call_stack_final_user_module.name, process.name)) and
 not process.thread.Ext.call_stack_final_user_module.path like
                              ("?:\\program files\\*.dll",
                               "?:\\program files (x86)\\*.dll",
                               "\\program files\\*.dll",
                               "\\program files (x86)\\*.dll",
                               "?:\\windows\\sys?????\\hmpalert.dll",
                               "?:\\windows\\system32\\*\\tmmon*.dll*",
                               "?:\\windows\\sys?????\\esensordbi.dll*",
                               "?:\\windows\\system32\\umppc*.dll*",
                               "?:\\windows\\fireeye\\appmonitordll*.dll*",
                               "?:\\windows\\apppatch\\apppatch*\\exploitblocker.dll*")
'''

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

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

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


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

[internal]
min_endpoint_version = "8.10.0"

Stages and Predicates

Stage 1: api

api where process.Ext.api.name == "WriteProcessMemory" and process.Ext.api.behaviors == "hook_api" and
 process.Ext.api.summary : "* Self,*" and
 process.Ext.api.summary like
                           ("*ntdll.dll!??CreateSection*", "*ntdll.dll!??OpenSection*", "*ntdll.dll!??Close*", "*ntdll.dll!??MapViewOfSection*", "*ntdll.dll!??UnmapViewOfSection*") and
 process.Ext.api.parameters.size == 21  and
 not process.Ext.api.behaviors in ("cross-process", "parent-child") and process.thread.Ext.call_stack_final_user_module.name != "Kernel" and
 not (process.code_signature.status == "trusted" and startswith~(process.thread.Ext.call_stack_final_user_module.name, process.name)) and
 not process.thread.Ext.call_stack_final_user_module.path like
                              ("?:\\program files\\*.dll",
                               "?:\\program files (x86)\\*.dll",
                               "\\program files\\*.dll",
                               "\\program files (x86)\\*.dll",
                               "?:\\windows\\sys?????\\hmpalert.dll",
                               "?:\\windows\\system32\\*\\tmmon*.dll*",
                               "?:\\windows\\sys?????\\esensordbi.dll*",
                               "?:\\windows\\system32\\umppc*.dll*",
                               "?:\\windows\\fireeye\\appmonitordll*.dll*",
                               "?:\\windows\\apppatch\\apppatch*\\exploitblocker.dll*")

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.code_signature.statuseqtrustedexcludes:process.code_signature.status field:"process.code_signature.status" value:"trusted"
process.thread.Ext.call_stack_final_user_module.namestarts_withprocess.nameexcludes:process.thread.Ext.call_stack_final_user_module.name field:"process.thread.Ext.call_stack_final_user_module.name" value:"process.name"
process.Ext.api.behaviorsincross-process, parent-childexcludes:process.Ext.api.behaviors field:"process.Ext.api.behaviors" value:"cross-process" field:"process.Ext.api.behaviors" value:"parent-child"
process.thread.Ext.call_stack_final_user_module.pathwildcard?:\program files\*.dll, ?:\program files (x86)\*.dll, \program files\*.dll, \program files (x86)\*.dll, ?:\windows\sys?????\hmpalert.dll, ?:\windows\system32\*\tmmon*.dll*, ?:\windows\sys?????\esensordbi.dll*, ?:\windows\system32\umppc*.dll*, ?:\windows\fireeye\appmonitordll*.dll*, ?:\windows\apppatch\apppatch*\exploitblocker.dll*excludes:process.thread.Ext.call_stack_final_user_module.path

UID Change to 0 from Unusual Process Executable

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

This rule detects a UID change event by an unusual process executable. Attackers may escalate privileges via an exploit located in a temporary directory, such as /tmp, /dev/shm, or /var/tmp, triggering a UID change event to 0 (root).

MITRE ATT&CK Coverage

TacticTechniques
Privilege Escalation

Rule Body

[rule]
description = """
This rule detects a UID change event by an unusual process executable. Attackers may escalate privileges via an exploit
located in a temporary directory, such as /tmp, /dev/shm, or /var/tmp, triggering a UID change event to 0 (root).
"""
id = "68cf34b4-0751-457a-b8fd-55208cdb42fe"
license = "Elastic License v2"
name = "UID Change to 0 from Unusual Process Executable"
os_list = ["linux"]
version = "1.0.7"

query = '''
sequence by process.entity_id with maxspan=15s
[process where event.type == "start" and event.action == "exec" and user.id != 0]
[process where event.type == "change" and event.action == "uid_change" and user.id == 0 and
process.executable like ("/tmp/*", "/dev/shm/*", "/var/tmp/*") and process.parent.executable != null and
not (
  process.executable like (
    "/tmp/ubuntu-release-upgrader-*", "/tmp/go-build*", "/tmp/newroot/*", "/tmp/CVU_*", "/tmp/usr/bin/bwrap",
    "/tmp/varonis*", "/tmp/usr/sbin/sshd", "/tmp/baum/easybuild/*", "/tmp/.mount_cursor*", "/var/tmp/foreman-ssh-cmd*",
    "/tmp/tmp.*/nix-installer", "/var/tmp/buildah*"
    ) or
  process.working_directory like ("/var/lib/rundeck", "/usr/sap/tmp", "/oracle/*/jobscheduler_agent", "/var/tmp/one/im/kvm-probes.d") or
  process.parent.executable like ("/tmp/newroot/*", "/usr/lib/systemd/systemd", "/tmp/.criu.mntns*", "/usr/libexec/gnome-session-service")
)]
'''

min_endpoint_version = "7.15.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 = "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 = "7.15.0"

Stages and Predicates

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

Stage 1: process

[process where event.type == "start" and event.action == "exec" and user.id != 0]

Stage 2: process

[process where event.type == "change" and event.action == "uid_change" and user.id == 0 and
process.executable like ("/tmp/*", "/dev/shm/*", "/var/tmp/*") and process.parent.executable != null and
not (
  process.executable like (
    "/tmp/ubuntu-release-upgrader-*", "/tmp/go-build*", "/tmp/newroot/*", "/tmp/CVU_*", "/tmp/usr/bin/bwrap",
    "/tmp/varonis*", "/tmp/usr/sbin/sshd", "/tmp/baum/easybuild/*", "/tmp/.mount_cursor*", "/var/tmp/foreman-ssh-cmd*",
    "/tmp/tmp.*/nix-installer", "/var/tmp/buildah*"
    ) or
  process.working_directory like ("/var/lib/rundeck", "/usr/sap/tmp", "/oracle/*/jobscheduler_agent", "/var/tmp/one/im/kvm-probes.d") or
  process.parent.executable like ("/tmp/newroot/*", "/usr/lib/systemd/systemd", "/tmp/.criu.mntns*", "/usr/libexec/gnome-session-service")
)]

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.executablewildcard/tmp/ubuntu-release-upgrader-*, /tmp/go-build*, /tmp/newroot/*, /tmp/CVU_*, /tmp/usr/bin/bwrap, /tmp/varonis*, /tmp/usr/sbin/sshd, /tmp/baum/easybuild/*, /tmp/.mount_cursor*, /var/tmp/foreman-ssh-cmd*, /tmp/tmp.*/nix-installer, /var/tmp/buildah*excludes:process.executable
process.parent.executablewildcard/tmp/newroot/*, /usr/lib/systemd/systemd, /tmp/.criu.mntns*, /usr/libexec/gnome-session-serviceexcludes:process.parent.executable
process.working_directorywildcard/var/lib/rundeck, /usr/sap/tmp, /oracle/*/jobscheduler_agent, /var/tmp/one/im/kvm-probes.dexcludes:process.working_directory

Windows Firewall Exception List Modified via Untrusted Process

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

Identifies the execution of the built-in Windows program, Netsh, to add a program to the Windows Firewall exception list via an untrusted parent process.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
Identifies the execution of the built-in Windows program, Netsh, to add a program to the Windows Firewall exception list
via an untrusted parent process.
"""
id = "5c01669c-e1cc-4acc-95b6-8b5e4a92c970"
license = "Elastic License v2"
name = "Windows Firewall Exception List Modified via Untrusted Process"
os_list = ["windows"]
reference = [
    "https://docs.microsoft.com/en-us/troubleshoot/windows-server/networking/netsh-advfirewall-firewall-control-firewall-behavior",
]
version = "1.0.33"

query = '''
sequence with maxspan=1m
  [process where event.action == "start" and
   process.executable : ("?:\\ProgramData\\*", "?:\\Users\\*", "?:\\Python*") and not process.code_signature.trusted == true] by process.entity_id
  [process where event.action == "start" and process.name : "netsh.exe" and
   process.command_line : "*add*allowedprogram*ENABLE*" and
   not process.args : ("program=*:\\Program Files\\*", "program=*:\\Program Files (x86)\\*") and
   not (process.args : "name=Free Download Manager" and process.parent.name : "fdm_x64_setup.tmp")
   ] by process.parent.entity_id
'''

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

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

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

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



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

[internal]
min_endpoint_version = "7.15.0"

Stages and Predicates

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

Stage 1: process

[process where event.action == "start" and
   process.executable : ("?:\\ProgramData\\*", "?:\\Users\\*", "?:\\Python*") and not process.code_signature.trusted == true] by process.entity_id

Stage 2: process

[process where event.action == "start" and process.name : "netsh.exe" and
   process.command_line : "*add*allowedprogram*ENABLE*" and
   not process.args : ("program=*:\\Program Files\\*", "program=*:\\Program Files (x86)\\*") and
   not (process.args : "name=Free Download Manager" and process.parent.name : "fdm_x64_setup.tmp")
   ] by process.parent.entity_id

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • start corpus 388 (elastic 388)
field:"EventType" kind:eq value:"start"
process.command_linewildcard
  • *add*allowedprogram*ENABLE*
field:"CommandLine" kind:wildcard value:"*add*allowedprogram*ENABLE*"
process.executablewildcard
  • ?:\ProgramData\* corpus 17 (elastic 17)
  • ?:\Python* corpus 2 (elastic 2)
  • ?:\Users\* corpus 17 (elastic 17)
field:"Image" kind:wildcard
process.namewildcard
  • netsh.exe corpus 21 (elastic 14, splunk 7)
field:"process_basename" kind:wildcard value:"netsh.exe"

Exclusions

The rule actively suppresses these predicates.

WMI Incoming Lateral Movement

#
Status
production
Severity
medium
Time window
20s
Sequence by
host.id
Author
Elastic
Source
github.com/elastic/detection-rules

Identifies processes executed via Windows Management Instrumentation (WMI) on a remote host. This could be indicative of adversary lateral movement, but could be noisy if administrators use WMI to remotely manage hosts.

MITRE ATT&CK Coverage

Telemetry Coverage

Rule Body

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

[rule]
author = ["Elastic"]
description = """
Identifies processes executed via Windows Management Instrumentation (WMI) on a remote host. This could be indicative of
adversary lateral movement, but could be noisy if administrators use WMI to remotely manage hosts.
"""
from = "now-9m"
index = [
    "logs-endpoint.events.process-*",
    "logs-endpoint.events.network-*",
    "logs-windows.sysmon_operational-*",
]
language = "eql"
license = "Elastic License v2"
name = "WMI Incoming Lateral Movement"
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 WMI Incoming Lateral Movement

Windows Management Instrumentation (WMI) is a core Windows feature enabling remote management and data collection. Adversaries exploit WMI for lateral movement by executing processes on remote hosts, often bypassing traditional security measures. The detection rule identifies suspicious WMI activity by monitoring specific network connections and process executions, filtering out common false positives to highlight potential threats.

### Possible investigation steps

- Review the source IP address of the incoming RPC connection to determine if it is from a known or trusted network segment, excluding localhost addresses like 127.0.0.1 and ::1.
- Check the process name and parent process name, specifically looking for svchost.exe and WmiPrvSE.exe, to confirm the execution context and identify any unusual parent-child process relationships.
- Investigate the user ID associated with the process execution to ensure it is not a system account (S-1-5-18, S-1-5-19, S-1-5-20) and assess if the user has legitimate reasons for remote WMI activity.
- Examine the process executable path to verify it is not one of the excluded common false positives, such as those related to HPWBEM, SCCM, or other specified system utilities.
- Analyze the network connection details, including source and destination ports, to identify any patterns or anomalies that could indicate malicious lateral movement.
- Correlate the alert with other security events or logs from the same host or network segment to gather additional context and identify potential patterns of compromise.

### False positive analysis

- Administrative use of WMI for remote management can trigger alerts. To manage this, create exceptions for known administrative accounts or specific IP addresses used by IT staff.
- Security tools like Nessus and SCCM may cause false positives. Exclude processes associated with these tools by adding their executables to the exception list.
- System processes running with high integrity levels might be flagged. Exclude processes with integrity levels marked as "System" to reduce noise.
- Specific executables such as msiexec.exe and appcmd.exe with certain arguments can be safely excluded if they are part of routine administrative tasks.
- Regularly review and update the exception list to ensure it aligns with current network management practices and tools.

### Response and remediation

- Isolate the affected host immediately from the network to prevent further lateral movement by the adversary. This can be done by disabling network interfaces or using network segmentation tools.
- Terminate any suspicious processes identified as being executed via WMI on the affected host. Use task management tools or scripts to stop these processes.
- Conduct a thorough review of the affected host's WMI logs and process execution history to identify any unauthorized changes or additional malicious activity.
- Reset credentials for any accounts that were used in the suspicious WMI activity, especially if they have administrative privileges, to prevent further unauthorized access.
- Apply patches and updates to the affected host and any other systems that may be vulnerable to similar exploitation methods, ensuring that all security updates are current.
- Enhance monitoring and logging for WMI activity across the network to detect and respond to similar threats more quickly in the future. This includes setting up alerts for unusual WMI usage patterns.
- If the threat is confirmed to be part of a larger attack, escalate the incident to the appropriate security team or authority for further investigation and potential legal action."""
risk_score = 47
rule_id = "f3475224-b179-4f78-8877-c2bd64c26b88"
severity = "medium"
tags = [
    "Domain: Endpoint",
    "OS: Windows",
    "Use Case: Threat Detection",
    "Tactic: Lateral Movement",
    "Data Source: Elastic Defend",
    "Data Source: Sysmon",
    "Resources: Investigation Guide",
]
type = "eql"

query = '''
sequence by host.id with maxspan = 20s

 /* Accepted Incoming RPC connection by Winmgmt service */

  [network where host.os.type == "windows" and process.name : "svchost.exe" and network.direction : ("incoming", "ingress") and
   source.ip != "127.0.0.1" and source.ip != "::1" and destination.port == 135]

  /* Excluding Common FPs Nessus and SCCM */

  [process where host.os.type == "windows" and event.type == "start" and process.parent.name : "WmiPrvSE.exe" and
   not (?process.Ext.token.integrity_level_name : "System" or ?winlog.event_data.IntegrityLevel : "System") and
   not (
         user.id : ("S-1-5-18", "S-1-5-19", "S-1-5-20") and
         /* Don't apply the user.id exclusion to Sysmon for compatibility */
         not data_stream.dataset : ("windows.sysmon_operational", "windows.sysmon")
   ) and
   not process.executable :
               ("?:\\Program Files\\HPWBEM\\Tools\\hpsum_swdiscovery.exe",
                "?:\\Windows\\CCM\\Ccm32BitLauncher.exe",
                "?:\\Windows\\System32\\wbem\\mofcomp.exe",
                "?:\\Windows\\Microsoft.NET\\Framework*\\csc.exe",
                "?:\\Windows\\System32\\powercfg.exe") and
   not (process.executable : "?:\\Windows\\System32\\msiexec.exe" and process.args : "REBOOT=ReallySuppress") and
   not (process.executable : "?:\\Windows\\System32\\inetsrv\\appcmd.exe" and process.args : "uninstall")
   ]
'''

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 3 - Network Connection](https://ela.st/sysmon-event-3-setup)
"""


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

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

[[rule.threat.technique.subtechnique]]
id = "T1021.003"
name = "Distributed Component Object Model"
reference = "https://attack.mitre.org/techniques/T1021/003/"

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

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

[[rule.threat.technique]]
id = "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 20s, correlated by host.id.

Stage 1: network

[network where host.os.type == "windows" and process.name : "svchost.exe" and network.direction : ("incoming", "ingress") and
   source.ip != "127.0.0.1" and source.ip != "::1" and destination.port == 135]

Stage 2: process

[process where host.os.type == "windows" and event.type == "start" and process.parent.name : "WmiPrvSE.exe" and
   not (?process.Ext.token.integrity_level_name : "System" or ?winlog.event_data.IntegrityLevel : "System") and
   not (
         user.id : ("S-1-5-18", "S-1-5-19", "S-1-5-20") and
         not data_stream.dataset : ("windows.sysmon_operational", "windows.sysmon")
   ) and
   not process.executable :
               ("?:\\Program Files\\HPWBEM\\Tools\\hpsum_swdiscovery.exe",
                "?:\\Windows\\CCM\\Ccm32BitLauncher.exe",
                "?:\\Windows\\System32\\wbem\\mofcomp.exe",
                "?:\\Windows\\Microsoft.NET\\Framework*\\csc.exe",
                "?:\\Windows\\System32\\powercfg.exe") and
   not (process.executable : "?:\\Windows\\System32\\msiexec.exe" and process.args : "REBOOT=ReallySuppress") and
   not (process.executable : "?:\\Windows\\System32\\inetsrv\\appcmd.exe" and process.args : "uninstall")
   ]

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
data_stream.datasetwildcard
  • windows.sysmon corpus 5 (elastic 5)
  • windows.sysmon_operational corpus 5 (elastic 5)
field:"data_stream.dataset" kind:wildcard
destination.porteq
  • 135 transforms: number corpus 2 (elastic 2)
field:"DestinationPort" kind:eq value:"135"
event.typeeq
  • start corpus 1036 (elastic 1036)
field:"event.type" kind:eq value:"start"
network.directionwildcard
  • incoming corpus 10 (elastic 10)
  • ingress corpus 12 (elastic 12)
field:"Initiated" kind:wildcard
process.namewildcard
  • svchost.exe corpus 21 (elastic 20, splunk 1)
field:"process_basename" kind:wildcard value:"svchost.exe"
process.parent.namewildcard
  • WmiPrvSE.exe corpus 24 (elastic 19, splunk 5)
field:"parent_process_basename" kind:wildcard value:"WmiPrvSE.exe"
source.ipne
  • 127.0.0.1 corpus 22 (elastic 22)
  • ::1 corpus 20 (elastic 20)
field:"src_ip" kind:ne

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
data_stream.dataseteqwindows.sysmon_operational, windows.sysmonexcludes:data_stream.dataset field:"data_stream.dataset" value:"windows.sysmon_operational" field:"data_stream.dataset" value:"windows.sysmon"
user.ideqS-1-5-18, S-1-5-19, S-1-5-20excludes:user.id field:"user.id" value:"S-1-5-18" field:"user.id" value:"S-1-5-19" field:"user.id" value:"S-1-5-20"
process.Ext.token.integrity_level_nameeqSystemexcludes:process.Ext.token.integrity_level_name field:"process.Ext.token.integrity_level_name" value:"System"
winlog.event_data.IntegrityLeveleqSystemexcludes:winlog.event_data.IntegrityLevel field:"winlog.event_data.IntegrityLevel" value:"System"
process.argseqREBOOT=ReallySuppressexcludes:process.args field:"process.args" value:"REBOOT=ReallySuppress"
process.executableeq?:\Windows\System32\msiexec.exeexcludes:process.executable field:"process.executable" value:"?:\Windows\System32\msiexec.exe"
process.argsequninstallexcludes:process.args field:"process.args" value:"uninstall"
process.executableeq?:\Windows\System32\inetsrv\appcmd.exeexcludes:process.executable field:"process.executable" value:"?:\Windows\System32\inetsrv\appcmd.exe"
process.executablewildcard?:\Program Files\HPWBEM\Tools\hpsum_swdiscovery.exe, ?:\Windows\CCM\Ccm32BitLauncher.exe, ?:\Windows\System32\wbem\mofcomp.exe, ?:\Windows\Microsoft.NET\Framework*\csc.exe, ?:\Windows\System32\powercfg.exeexcludes:process.executable

Back to all Elastic rules