Detection rules › Elastic
Elastic rules: 0f
Credential Manipulation - Prevented - Elastic Endgame
#Elastic Endgame prevented Credential Manipulation. Click the Elastic Endgame icon in the event.module column or the link in the rule.reference column for additional information.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Privilege Escalation |
Rule Body
[metadata]
creation_date = "2020/02/18"
maturity = "production"
promotion = true
updated_date = "2025/03/21"
[rule]
author = ["Elastic"]
description = """
Elastic Endgame prevented Credential Manipulation. Click the Elastic Endgame icon in the event.module column or the link
in the rule.reference column for additional information.
"""
from = "now-2m"
index = ["endgame-*"]
interval = "1m"
language = "kuery"
license = "Elastic License v2"
max_signals = 1000
name = "Credential Manipulation - Prevented - Elastic Endgame"
risk_score = 47
rule_id = "c9e38e64-3f4c-4bf3-ad48-0e61a60ea1fa"
setup = """## Setup
### Additional notes
For information on troubleshooting the maximum alerts warning please refer to this [guide](https://www.elastic.co/guide/en/security/current/alerts-ui-monitor.html#troubleshoot-max-alerts).
"""
severity = "medium"
tags = ["Data Source: Elastic Endgame", "Use Case: Threat Detection", "Tactic: Privilege Escalation", "Resources: Investigation Guide"]
timestamp_override = "event.ingested"
type = "query"
query = '''
event.kind:alert and event.module:endgame and endgame.metadata.type:prevention and (event.action:token_manipulation_event or endgame.event_subtype_full:token_manipulation_event)
'''
note = """## Triage and analysis
> **Disclaimer**:
> This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.
### Investigating Credential Manipulation - Prevented - Elastic Endgame
Elastic Endgame is a security solution that prevents unauthorized credential manipulation, a tactic often used by adversaries to escalate privileges by altering access tokens. Attackers exploit this to gain elevated access within a system. The detection rule identifies such attempts by monitoring alerts for token manipulation events, leveraging Elastic Endgame's prevention capabilities to thwart these threats effectively.
### Possible investigation steps
- Review the alert details to confirm the presence of event.kind:alert and event.module:endgame, ensuring the alert is related to Elastic Endgame's prevention capabilities.
- Examine the event.action and endgame.event_subtype_full fields to identify the specific type of token manipulation event that was prevented.
- Investigate the source and destination of the alert by analyzing associated IP addresses, user accounts, and hostnames to determine if the attempt was internal or external.
- Check for any related alerts or logs around the same timeframe to identify potential patterns or coordinated attempts at credential manipulation.
- Assess the impacted system's current security posture and review recent changes or anomalies in user behavior that might have led to the attempted manipulation.
- Consult the MITRE ATT&CK framework for additional context on Access Token Manipulation (T1134) to understand potential adversary techniques and improve defensive measures.
### False positive analysis
- Routine administrative tasks involving legitimate token manipulation can trigger alerts. Review the context of the event to determine if it aligns with expected administrative activities.
- Automated scripts or software updates that modify access tokens as part of their normal operation may cause false positives. Identify these processes and consider adding them to an exception list if they are verified as non-threatening.
- Security tools or monitoring solutions that interact with access tokens for legitimate purposes might be flagged. Validate these tools and exclude them from the rule if they are confirmed to be safe.
- User behavior that involves frequent token changes, such as developers testing applications, can lead to false positives. Monitor these activities and create exceptions for known users or groups performing these tasks regularly.
- Ensure that the rule is not overly broad by refining the query to focus on specific actions or contexts that are more indicative of malicious behavior, reducing the likelihood of false positives.
### Response and remediation
- Immediately isolate the affected system to prevent further unauthorized access or lateral movement within the network.
- Revoke and reset any potentially compromised credentials associated with the affected system to mitigate unauthorized access.
- Conduct a thorough review of access logs and token usage to identify any unauthorized access or privilege escalation attempts.
- Restore the affected system from a known good backup to ensure the integrity of the system and its credentials.
- Implement additional monitoring on the affected system and related accounts to detect any further suspicious activity.
- Escalate the incident to the security operations team for a detailed investigation and to assess the potential impact on other systems.
- Review and update access control policies to ensure that only necessary permissions are granted, reducing the risk of privilege escalation."""
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1134"
name = "Access Token Manipulation"
reference = "https://attack.mitre.org/techniques/T1134/"
[rule.threat.tactic]
id = "TA0004"
name = "Privilege Escalation"
reference = "https://attack.mitre.org/tactics/TA0004/"
Stages and Predicates
Stage 1: query
event.kind:alert and event.module:endgame and endgame.metadata.type:prevention and (event.action:token_manipulation_event or endgame.event_subtype_full:token_manipulation_event)
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
endgame.event_subtype_full | eq |
| field:"endgame.event_subtype_full" kind:eq value:"token_manipulation_event" |
endgame.metadata.type | eq |
| field:"endgame.metadata.type" kind:eq value:"prevention" |
event.action | eq |
| field:"EventType" kind:eq value:"token_manipulation_event" |
event.kind | eq |
| field:"event.kind" kind:eq value:"alert" |
event.module | eq |
| field:"event.module" kind:eq value:"endgame" |
Defense Evasion via Hidepid Mount
#Detects the use of the hidepid parameter in the mount process. This technique is used to hide processes from other users on the system, which in turn can be used to evade detection.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Execution | |
| Stealth |
Rule Body
[rule]
description = """
Detects the use of the hidepid parameter in the mount process. This technique is used to hide processes from other users
on the system, which in turn can be used to evade detection.
"""
id = "03195b53-de40-4a18-b727-6fb7ac3f94b7"
license = "Elastic License v2"
name = "Defense Evasion via Hidepid Mount"
os_list = ["linux"]
reference = ["https://linux-audit.com/linux-system-hardening-adding-hidepid-to-proc/"]
version = "1.0.5"
query = '''
process where event.type == "start" and event.action == "exec" and process.name == "mount" and
process.args in ("-o", "--options") and process.args : "*hidepid=2*" and
not process.parent.args == "/opt/cloudlinux/venv/bin/python3"
'''
min_endpoint_version = "7.15.0"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
[[actions]]
action = "kill_process"
field = "process.parent.entity_id"
state = 0
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1059"
name = "Command and Scripting Interpreter"
reference = "https://attack.mitre.org/techniques/T1059/"
[[threat.technique.subtechnique]]
id = "T1059.004"
name = "Unix Shell"
reference = "https://attack.mitre.org/techniques/T1059/004/"
[threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1564"
name = "Hide Artifacts"
reference = "https://attack.mitre.org/techniques/T1564/"
[threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
[internal]
min_endpoint_version = "7.15.0"
Stages and Predicates
Stage 1: process
process where event.type == "start" and event.action == "exec" and process.name == "mount" and
process.args in ("-o", "--options") and process.args : "*hidepid=2*" and
not process.parent.args == "/opt/cloudlinux/venv/bin/python3"
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | eq |
| field:"EventType" kind:eq value:"exec" |
event.type | eq |
| field:"event.type" kind:eq value:"start" |
process.args | in |
| field:"process.args" kind:in |
process.args | wildcard |
| field:"process.args" kind:wildcard value:"*hidepid=2*" |
process.name | eq |
| field:"process_basename" kind:eq value:"mount" |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.parent.args | eq | /opt/cloudlinux/venv/bin/python3 | excludes:process.parent.args field:"process.parent.args" value:"/opt/cloudlinux/venv/bin/python3" |
Enable Host Network Discovery via Netsh
#Identifies use of the netsh.exe program to enable host discovery via the network. Attackers can use this command-line tool to weaken the host firewall settings.
Known False Positives
- Host Windows Firewall planned system administration changes.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Defense Impairment |
Telemetry Coverage
| Provider | Record / event type |
|---|---|
| Sysmon | Event ID 1: Process creation |
| Security-Auditing | Event ID 4688: A new process has been created. |
Rule Body
[metadata]
creation_date = "2021/07/07"
integration = ["endpoint", "windows", "system", "m365_defender", "sentinel_one_cloud_funnel", "crowdstrike"]
maturity = "production"
updated_date = "2026/05/04"
[rule]
author = ["Elastic"]
description = """
Identifies use of the netsh.exe program to enable host discovery via the network. Attackers can use this command-line
tool to weaken the host firewall settings.
"""
false_positives = ["Host Windows Firewall planned system administration changes."]
from = "now-9m"
index = [
"endgame-*",
"logs-crowdstrike.fdr*",
"logs-endpoint.events.process-*",
"logs-m365_defender.event-*",
"logs-sentinel_one_cloud_funnel.*",
"logs-system.security*",
"logs-windows.forwarded*",
"logs-windows.sysmon_operational-*",
"winlogbeat-*",
]
language = "eql"
license = "Elastic License v2"
name = "Enable Host Network Discovery via Netsh"
note = """## Triage and analysis
### Investigating Enable Host Network Discovery via Netsh
The Windows Defender Firewall is a native component that provides host-based, two-way network traffic filtering for a device and blocks unauthorized network traffic flowing into or out of the local device.
Attackers can enable Network Discovery on the Windows firewall to find other systems present in the same network. Systems with this setting enabled will communicate with other systems using broadcast messages, which can be used to identify targets for lateral movement. This rule looks for the setup of this setting using the netsh utility.
#### 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.
- Contact the account owner and confirm whether they are aware of this activity.
- Investigate other alerts associated with the user/host during the past 48 hours.
- Inspect the host for suspicious or abnormal behavior in the alert timeframe.
### False positive analysis
- This mechanism can be used legitimately. Analysts can dismiss the alert if the Administrator is aware of the activity and there are justifications for this configuration.
### 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.
- Disable Network Discovery:
- Using netsh: `netsh advfirewall firewall set rule group="Network Discovery" new enable=No`
- 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.
- Review the privileges assigned to the involved users to ensure that the least privilege principle is being followed.
- Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
- Using the incident response data, update logging and audit policies to improve the mean time to detect (MTTD) and the mean time to respond (MTTR).
"""
setup = """## Setup
This rule is designed for data generated by [Elastic Defend](https://www.elastic.co/security/endpoint-security), which provides native endpoint detection and response, along with event enrichments designed to work with our detection rules.
Setup instructions: https://ela.st/install-elastic-defend
### Additional data sources
This rule also supports the following third-party data sources. For setup instructions, refer to the links below:
- [CrowdStrike](https://ela.st/crowdstrike-integration)
- [Microsoft Defender XDR](https://ela.st/m365-defender)
- [SentinelOne Cloud Funnel](https://ela.st/sentinel-one-cloud-funnel)
- [Sysmon Event ID 1 - Process Creation](https://ela.st/sysmon-event-1-setup)
- [Windows Process Creation Logs](https://ela.st/audit-process-creation)
"""
risk_score = 47
rule_id = "8b4f0816-6a65-4630-86a6-c21c179c0d09"
severity = "medium"
tags = [
"Domain: Endpoint",
"OS: Windows",
"Use Case: Threat Detection",
"Tactic: Defense Evasion",
"Resources: Investigation Guide",
"Data Source: Elastic Endgame",
"Data Source: Elastic Defend",
"Data Source: Windows Security Event Logs",
"Data Source: Microsoft Defender XDR",
"Data Source: Sysmon",
"Data Source: SentinelOne",
"Data Source: Crowdstrike",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
process where host.os.type == "windows" and event.type == "start" and
process.name : "netsh.exe" and
process.args : ("firewall", "advfirewall") and process.args : "group=Network Discovery" and process.args : "enable=Yes"
'''
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1562"
name = "Impair Defenses"
reference = "https://attack.mitre.org/techniques/T1562/"
[[rule.threat.technique.subtechnique]]
id = "T1562.004"
name = "Disable or Modify System Firewall"
reference = "https://attack.mitre.org/techniques/T1562/004/"
[rule.threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
Stages and Predicates
Stage 1: process
process where host.os.type == "windows" and event.type == "start" and
process.name : "netsh.exe" and
process.args : ("firewall", "advfirewall") and process.args : "group=Network Discovery" and process.args : "enable=Yes"
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.type | eq |
| field:"event.type" kind:eq value:"start" |
process.args | wildcard |
| field:"process.args" kind:wildcard |
process.name | wildcard |
| field:"process_basename" kind:wildcard value:"netsh.exe" |
Encrypting Files with WinRar or 7z
#Identifies the use of WinRAR or 7-Zip to create encrypted archives. Adversaries often compress and encrypt data in preparation for exfiltration.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Collection |
Telemetry Coverage
| Provider | Record / event type |
|---|---|
| Sysmon | Event ID 1: Process creation |
| Security-Auditing | Event ID 4688: A new process has been created. |
Rule Body
[metadata]
creation_date = "2020/12/04"
integration = ["endpoint", "windows", "m365_defender", "sentinel_one_cloud_funnel"]
maturity = "production"
updated_date = "2026/05/04"
[rule]
author = ["Elastic"]
description = """
Identifies the use of WinRAR or 7-Zip to create encrypted archives. Adversaries often compress and encrypt data
in preparation for exfiltration.
"""
from = "now-9m"
index = [
"logs-endpoint.events.process-*",
"winlogbeat-*",
"logs-windows.sysmon_operational-*",
"endgame-*",
"logs-m365_defender.event-*",
"logs-sentinel_one_cloud_funnel.*",
]
language = "eql"
license = "Elastic License v2"
name = "Encrypting Files with WinRar or 7z"
note = """## Triage and analysis
### Investigating Encrypting Files with WinRar or 7z
Attackers may compress and/or encrypt data collected before exfiltration. Compressing data can help stage and obfuscate content and may reduce the amount of data sent over the network. Encryption can be used to hide the contents of the archive and make the activity less apparent during review.
These steps are often performed in preparation for exfiltration, meaning the intrusion may be in its later stages.
#### Possible investigation steps
- Review the process ancestry (parent process tree) for the archiving command. Identify what launched WinRAR/7-Zip and whether the parent is expected in your environment.
- Validate the executable: check file path, signature, hash prevalence, and whether the binary is the expected vendor build.
- Identify the archive output location and name. Look for staging locations (e.g., user profile temp directories, public folders, removable media paths) and unusual naming patterns.
- Retrieve the created archive if policy allows. Determine whether the contents are sensitive or business-critical.
- Check whether the encryption password is present in the command line. If present, treat as high confidence data staging.
- If the password is not available and the archive format is `.zip` (or WinRAR is not using the `-hp` option), enumerate filenames within the archive to understand what was staged.
- Review other alerts and related activity for the same host/user over the last 48 hours (credential access, discovery, lateral movement, and outbound transfers).
- Investigate whether the archive was transferred off-host (e.g., browser uploads, cloud sync clients, RMM tools, SMB to unusual destinations, or other outbound network activity).
### False positive analysis
- Backup, packaging, and software distribution workflows may legitimately create password-protected archives.
- IT administrators and automation may use WinRAR/7-Zip for log collection, incident response packaging, or data transfer.
- Validate the parent process and context using `process.parent.executable` and `process.parent.command_line`, and confirm whether the archive destination and file set match an expected workflow.
### Response and remediation
- Initiate the incident response process based on the outcome of the triage.
- Prioritize cases that involve personally identifiable information (PII) or other classified data.
- 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:
- [Microsoft Defender XDR](https://ela.st/m365-defender)
- [SentinelOne Cloud Funnel](https://ela.st/sentinel-one-cloud-funnel)
- [Sysmon Event ID 1 - Process Creation](https://ela.st/sysmon-event-1-setup)
"""
references = [
"https://www.welivesecurity.com/2020/12/02/turla-crutch-keeping-back-door-open/",
"https://www.elastic.co/security-labs/siestagraph-new-implant-uncovered-in-asean-member-foreign-ministry",
]
risk_score = 47
rule_id = "45d273fb-1dca-457d-9855-bcb302180c21"
severity = "medium"
tags = [
"Domain: Endpoint",
"OS: Windows",
"Use Case: Threat Detection",
"Tactic: Collection",
"Resources: Investigation Guide",
"Data Source: Elastic Endgame",
"Data Source: Elastic Defend",
"Data Source: Sysmon",
"Data Source: Microsoft Defender XDR",
"Data Source: SentinelOne",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
process where host.os.type == "windows" and event.type == "start" and
(
(
(
process.name : ("rar.exe", "WinRAR.exe") or ?process.code_signature.subject_name == "win.rar GmbH" or
?process.pe.original_file_name == "WinRAR.exe"
) and
process.args == "a" and process.args : ("-hp*", "-p*", "/hp*", "/p*")
) or
(
(process.name : ("7z.exe", "7za.exe") or ?process.pe.original_file_name in ("7z.exe", "7za.exe")) and
process.args == "a" and process.args : "-p*"
)
) and
not process.parent.executable : (
"C:\\Program Files\\*.exe",
"C:\\Program Files (x86)\\*.exe",
"?:\\ManageEngine\\*\\jre\\bin\\java.exe",
"?:\\Nox\\bin\\Nox.exe",
"\\Device\\HarddiskVolume?\\Program Files\\*.exe",
"\\Device\\HarddiskVolume?\\Program Files (x86)\\*.exe",
"\\Device\\HarddiskVolume?\\ManageEngine\\*\\jre\\bin\\java.exe",
"\\Device\\HarddiskVolume?\\Nox\\bin\\Nox.exe"
)
'''
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1005"
name = "Data from Local System"
reference = "https://attack.mitre.org/techniques/T1005/"
[[rule.threat.technique]]
id = "T1560"
name = "Archive Collected Data"
reference = "https://attack.mitre.org/techniques/T1560/"
[[rule.threat.technique.subtechnique]]
id = "T1560.001"
name = "Archive via Utility"
reference = "https://attack.mitre.org/techniques/T1560/001/"
[rule.threat.tactic]
id = "TA0009"
name = "Collection"
reference = "https://attack.mitre.org/tactics/TA0009/"
Stages and Predicates
Stage 1: process
process where host.os.type == "windows" and event.type == "start" and
(
(
(
process.name : ("rar.exe", "WinRAR.exe") or ?process.code_signature.subject_name == "win.rar GmbH" or
?process.pe.original_file_name == "WinRAR.exe"
) and
process.args == "a" and process.args : ("-hp*", "-p*", "/hp*", "/p*")
) or
(
(process.name : ("7z.exe", "7za.exe") or ?process.pe.original_file_name in ("7z.exe", "7za.exe")) and
process.args == "a" and process.args : "-p*"
)
) and
not process.parent.executable : (
"C:\\Program Files\\*.exe",
"C:\\Program Files (x86)\\*.exe",
"?:\\ManageEngine\\*\\jre\\bin\\java.exe",
"?:\\Nox\\bin\\Nox.exe",
"\\Device\\HarddiskVolume?\\Program Files\\*.exe",
"\\Device\\HarddiskVolume?\\Program Files (x86)\\*.exe",
"\\Device\\HarddiskVolume?\\ManageEngine\\*\\jre\\bin\\java.exe",
"\\Device\\HarddiskVolume?\\Nox\\bin\\Nox.exe"
)
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.type | eq |
| field:"event.type" kind:eq value:"start" |
process.args | eq |
| field:"process.args" kind:eq value:"a" |
process.args | wildcard |
| field:"process.args" kind:wildcard |
process.code_signature.subject_name | eq |
| field:"Signature" kind:eq value:"win.rar GmbH" |
process.name | wildcard |
| field:"process_basename" kind:wildcard |
process.pe.original_file_name | eq |
| field:"OriginalFileName" kind:eq value:"WinRAR.exe" |
process.pe.original_file_name | in |
| field:"OriginalFileName" kind:in |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.parent.executable | wildcard | C:\Program Files\*.exe, C:\Program Files (x86)\*.exe, ?:\ManageEngine\*\jre\bin\java.exe, ?:\Nox\bin\Nox.exe, \Device\HarddiskVolume?\Program Files\*.exe, \Device\HarddiskVolume?\Program Files (x86)\*.exe, \Device\HarddiskVolume?\ManageEngine\*\jre\bin\java.exe, \Device\HarddiskVolume?\Nox\bin\Nox.exe | excludes:process.parent.executable |
File Staged in Root Folder of Recycle Bin
#Identifies files written to the root of the Recycle Bin folder instead of subdirectories. Adversaries may place files in the root of the Recycle Bin in preparation for exfiltration or to evade defenses.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Stealth | |
| Collection |
Telemetry Coverage
| Provider | Record / event type |
|---|---|
| Sysmon | Event ID 11: FileCreate |
Rule Body
[metadata]
creation_date = "2023/08/24"
integration = ["endpoint", "windows"]
maturity = "production"
updated_date = "2026/03/24"
[rule]
author = ["Elastic"]
building_block_type = "default"
description = """
Identifies files written to the root of the Recycle Bin folder instead of subdirectories. Adversaries may place files in
the root of the Recycle Bin in preparation for exfiltration or to evade defenses.
"""
from = "now-119m"
index = ["logs-endpoint.events.file-*", "logs-windows.sysmon_operational-*", "endgame-*", "winlogbeat-*"]
interval = "60m"
language = "eql"
license = "Elastic License v2"
name = "File Staged in Root Folder of Recycle Bin"
risk_score = 21
rule_id = "57bccf1d-daf5-4e1a-9049-ff79b5254704"
severity = "low"
tags = [
"Domain: Endpoint",
"OS: Windows",
"Use Case: Threat Detection",
"Tactic: Collection",
"Data Source: Elastic Defend",
"Rule Type: BBR",
"Data Source: Elastic Endgame",
"Data Source: Sysmon",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
file where host.os.type == "windows" and event.type == "creation" and
file.path : "?:\\$RECYCLE.BIN\\*" and
not file.path : "?:\\$RECYCLE.BIN\\*\\*" and
not file.name : "desktop.ini"
'''
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1074"
name = "Data Staged"
reference = "https://attack.mitre.org/techniques/T1074/"
[[rule.threat.technique.subtechnique]]
id = "T1074.001"
name = "Local Data Staging"
reference = "https://attack.mitre.org/techniques/T1074/001/"
[rule.threat.tactic]
id = "TA0009"
name = "Collection"
reference = "https://attack.mitre.org/tactics/TA0009/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1564"
name = "Hide Artifacts"
reference = "https://attack.mitre.org/techniques/T1564/"
[[rule.threat.technique.subtechnique]]
id = "T1564.001"
name = "Hidden Files and Directories"
reference = "https://attack.mitre.org/techniques/T1564/001/"
[rule.threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
Stages and Predicates
Stage 1: file
file where host.os.type == "windows" and event.type == "creation" and
file.path : "?:\\$RECYCLE.BIN\\*" and
not file.path : "?:\\$RECYCLE.BIN\\*\\*" and
not file.name : "desktop.ini"
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.type | eq |
| field:"event.type" kind:eq value:"creation" |
file.path | wildcard |
| field:"TargetFilename" kind:wildcard value:"?:\$RECYCLE.BIN\*" |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
file.name | eq | desktop.ini | excludes:file.name field:"file.name" value:"desktop.ini" |
file.path | wildcard | ?:\$RECYCLE.BIN\*\* | excludes:file.path field:"file.path" value:"?:\$RECYCLE.BIN\*\*" |
GitHub App Deleted
#Detects the deletion of a GitHub app either from a repo or an organization.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Execution | |
| Defense Impairment |
Telemetry Coverage
Rule Body
[metadata]
creation_date = "2023/10/11"
integration = ["github"]
maturity = "production"
updated_date = "2026/04/10"
[rule]
author = ["Elastic"]
description = "Detects the deletion of a GitHub app either from a repo or an organization.\n"
from = "now-9m"
index = ["logs-github.audit-*"]
language = "eql"
license = "Elastic License v2"
name = "GitHub App Deleted"
note = """## Triage and analysis
> **Disclaimer**:
> This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.
### Investigating GitHub App Deleted
GitHub Apps are integrations that extend GitHub's functionality, often used to automate workflows or manage repositories. Adversaries might delete these apps to disrupt operations or remove security controls. The detection rule monitors audit logs for app deletions, flagging potential unauthorized actions. By focusing on specific event types and categories, it helps identify suspicious deletions that could indicate malicious activity.
### Possible investigation steps
- Review the audit logs for the specific event type "deletion" within the "integration_installation" category to identify the exact GitHub app that was deleted.
- Determine the user or account responsible for the deletion by examining the associated user information in the audit logs.
- Check the timing of the deletion event to see if it coincides with any other suspicious activities or anomalies in the repository or organization.
- Investigate the role and permissions of the user who performed the deletion to assess if they had legitimate access and authorization to delete the app.
- Look into the history of the deleted GitHub app to understand its purpose, usage, and any dependencies it might have had within the organization or repository.
- Communicate with the team or organization members to verify if the deletion was intentional and authorized, or if it was unexpected and potentially malicious.
### False positive analysis
- Routine maintenance or updates by authorized personnel can trigger app deletions. Verify with the team responsible for GitHub app management to confirm if the deletion was planned.
- Automated scripts or tools used for managing GitHub apps might inadvertently delete apps during updates or reconfigurations. Review the scripts and ensure they have proper safeguards to prevent accidental deletions.
- Organizational policy changes might lead to the removal of certain apps. Check if there have been recent policy updates that could explain the deletion.
- Exclude specific users or service accounts known to perform legitimate app deletions regularly by creating exceptions in the detection rule.
- Monitor for patterns of deletions that align with scheduled maintenance windows and adjust the rule to ignore these timeframes if they consistently result in false positives.
### Response and remediation
- Immediately revoke any compromised credentials or tokens associated with the deleted GitHub app to prevent unauthorized access.
- Restore the deleted GitHub app from a backup or re-install it to ensure continuity of operations and security controls.
- Conduct a thorough review of recent changes and activities in the affected repositories or organization to identify any unauthorized actions or data alterations.
- Notify the security team and relevant stakeholders about the incident to ensure awareness and coordinated response efforts.
- Implement additional monitoring on the affected repositories or organization to detect any further suspicious activities or attempts to delete apps.
- Review and tighten permissions for GitHub apps to ensure only authorized personnel have the ability to delete or modify app installations.
- Escalate the incident to higher-level security management if there is evidence of a broader compromise or if the deletion is part of a larger attack campaign."""
risk_score = 21
rule_id = "fd01b949-81be-46d5-bcf8-284395d5f56d"
severity = "low"
tags = [
"Domain: Cloud",
"Use Case: Threat Detection",
"Tactic: Execution",
"Data Source: Github",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
configuration where data_stream.dataset == "github.audit" and github.category == "integration_installation" and event.type == "deletion"
'''
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1648"
name = "Serverless Execution"
reference = "https://attack.mitre.org/techniques/T1648/"
[rule.threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1562"
name = "Impair Defenses"
reference = "https://attack.mitre.org/techniques/T1562/"
[[rule.threat.technique.subtechnique]]
id = "T1562.001"
name = "Disable or Modify Tools"
reference = "https://attack.mitre.org/techniques/T1562/001/"
[rule.threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
Stages and Predicates
Stage 1: configuration
configuration where data_stream.dataset == "github.audit" and github.category == "integration_installation" and event.type == "deletion"
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
data_stream.dataset | eq |
| field:"data_stream.dataset" kind:eq value:"github.audit" |
event.type | eq |
| field:"event.type" kind:eq value:"deletion" |
github.category | eq |
| field:"github.category" kind:eq value:"integration_installation" |
High Command Line Entropy Detected for Privileged Commands
#A machine learning job has identified an unusually high median command line entropy for privileged commands executed by a user, suggesting possible privileged access activity through command lines. High entropy often indicates that the commands may be obfuscated or deliberately complex, which can be a sign of suspicious or unauthorized use of privileged access.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Privilege Escalation | |
| Stealth |
Rule Body
[metadata]
creation_date = "2025/02/18"
integration = ["pad", "endpoint", "sysmon_linux"]
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 unusually high median command line entropy for privileged commands executed by
a user, suggesting possible privileged access activity through command lines. High entropy often indicates that the
commands may be obfuscated or deliberately complex, which can be a sign of suspicious or unauthorized use of privileged
access.
"""
from = "now-3h"
interval = "15m"
license = "Elastic License v2"
machine_learning_job_id = "pad_linux_high_median_process_command_line_entropy_by_user_ea"
name = "High Command Line Entropy Detected for Privileged Commands"
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 High Command Line Entropy Detected for Privileged Commands
Machine learning models analyze command line inputs to identify high entropy, which may indicate obfuscation or complexity in privileged commands. Adversaries exploit this by using intricate or encoded commands to mask unauthorized activities. The detection rule leverages this analysis to flag potential privilege escalation attempts, aiding in early threat identification and response.
### Possible investigation steps
- Review the command line inputs flagged by the alert to identify any patterns or specific obfuscation techniques used.
- Cross-reference the user account associated with the alert against known valid accounts and recent access logs to determine if the activity aligns with expected behavior.
- Analyze the context of the commands executed, including the time of execution and the systems targeted, to assess the potential impact and scope of the activity.
- Check for any recent changes in user privileges or roles that might explain the execution of privileged commands.
- Investigate any related alerts or logs that might provide additional context or corroborate the suspicious activity, such as failed login attempts or unusual network connections.
- Consult with the user or relevant personnel to verify if the commands were part of legitimate administrative tasks or if they indicate unauthorized access.
### False positive analysis
- Legitimate administrative scripts may have high entropy due to complex or encoded commands. Review and whitelist these scripts to prevent unnecessary alerts.
- Automated deployment tools often use obfuscated commands for security reasons. Identify and exclude these tools from the rule to reduce false positives.
- Security software updates might execute encoded commands as part of their process. Monitor and create exceptions for these updates to avoid misclassification.
- Developers and IT staff may use complex command lines for testing or debugging. Establish a baseline of normal activity for these users and adjust the rule accordingly.
- Scheduled tasks or cron jobs with encoded commands can trigger alerts. Document and exclude these tasks if they are verified as non-threatening.
### Response and remediation
- Immediately isolate the affected system from the network to prevent further unauthorized access or lateral movement.
- Review and terminate any suspicious or unauthorized processes running under privileged accounts on the affected system.
- Reset passwords for all privileged accounts involved, ensuring they meet strong password policies to prevent unauthorized access.
- Conduct a thorough audit of recent privileged command executions to identify any unauthorized changes or data access, and revert any malicious modifications.
- Implement additional monitoring on the affected system and related accounts to detect any further suspicious activities.
- Escalate the incident to the security operations center (SOC) for a comprehensive investigation and to determine if other systems are affected.
- Update and reinforce endpoint protection measures to detect and block similar obfuscation or high-entropy command line activities in the future."""
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 = "0cbbb5e0-f93a-47fe-ab72-8213366c38f1"
setup = """## Setup
The rule requires the Privileged Access Detection integration assets to be installed, as well as Linux logs collected by integrations such as Elastic Defend and Sysmon Linux.
### 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).
- Linux events collected by [Elastic Defend](https://docs.elastic.co/en/integrations/endpoint) or [Sysmon Linux](https://docs.elastic.co/en/integrations/sysmon_linux) integration.
- To install Elastic Defend, refer to the [documentation](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
- To add Sysmon Linux 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: Elastic Defend",
"Data Source: Linux Sysmon Logs",
"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 = "T1078"
name = "Valid Accounts"
reference = "https://attack.mitre.org/techniques/T1078/"
[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 = "T1027"
name = "Obfuscated Files or Information"
reference = "https://attack.mitre.org/techniques/T1027/"
[rule.threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
Initial Access or Execution via Microsoft Office Application
#Identifies when a Microsoft Office process spawns a descendant process used for initial access or malicious code execution. This behavior is consistent with a user opening an Office document that contains malicious macros.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Initial Access | |
| Execution | |
| Persistence | |
| Stealth | |
| Defense Impairment | |
| Command & Control |
Telemetry Coverage
Rule Body
[rule]
description = """
Identifies when a Microsoft Office process spawns a descendant process used for initial access or malicious code
execution. This behavior is consistent with a user opening an Office document that contains malicious macros.
"""
id = "64021ef9-19d3-4797-ac3c-79e38d5e5a5a"
license = "Elastic License v2"
name = "Initial Access or Execution via Microsoft Office Application"
os_list = ["macos"]
reference = ["https://objective-see.com/blog/blog_0x4B.html"]
version = "1.0.41"
query = '''
process where event.action == "exec" and
descendant of [
process where event.action == "exec" and
process.name in (
"Microsoft Word",
"Microsoft Excel",
"Microsoft PowerPoint",
"Microsoft OneNote"
)
] and
process.name like~ (
"curl",
"nscurl",
"bash",
"sh",
"osascript",
"python*",
"perl*",
"mktemp",
"chmod",
"php",
"nohup",
"openssl",
"plutil",
"PlistBuddy",
"xattr",
"mktemp",
"sqlite3",
"funzip",
"popen"
) and
// Filter FPs related to product version discovery and Office error reporting behavior
not process.args like~
(
"ProductVersion",
"hw.model",
"ioreg",
"ProductName",
"ProductUserVisibleVersion",
"ProductBuildVersion",
"/Library/Application Support/Microsoft/MERP*/Microsoft Error Reporting.app/Contents/MacOS/Microsoft Error Reporting",
"open -a Safari *",
"defaults read *",
"sysctl hw.model*",
"ioreg -d2 -c IOPlatformExpertDevice *",
"ps aux | grep 'ToDesk_Desktop' | grep -v grep",
"PIPE=\"$CFFIXED_USER_HOME/.zoteroIntegrationPipe*",
"/Library/Management/super/com.macjutsu.super.plist",
"\"/Applications/Mendeley Desktop.app/Contents/MacOS/MendeleyWordPlugin.app/Contents/MacOS/MendeleyWordPlugin\" setPort *",
"http://127.0.0.1:23119/integration/macWordCommand?*",
"curl -s -o /dev/null -I -m 2 -w '%{http_code}' -X GET 'http://127.0.0.1:23119/integration/macWordCommand?agent=*'",
"*/Applications/XLSTAT.app/*"
) and
not process.parent.executable like~
(
"/Applications/ToDesk.app/Contents/MacOS/ToDesk_Service",
"/usr/local/Privacy-i/PISupervisor",
"/Library/Addigy/lan-cache",
"/Library/Elastic/Agent/*",
"/opt/jc/bin/jumpcloud-agent",
"/usr/sbin/networksetup"
) and
not (process.name == "sh" and process.command_line like~ "*$CFFIXED_USER_HOME/.zoteroIntegrationPipe*") and
not (process.name in ("sh", "bash", "curl") and process.command_line like~ "*http://127.0.0.1:6969/binary*ppShuttle_*.bin*") and
not process.Ext.effective_parent.executable like~ (
"/Applications/ToDesk.app/Contents/MacOS/ToDesk_Service",
"/Applications/Docker.app/Contents/MacOS/com.docker.backend",
"/Applications/FortiClient.app/Contents/Resources/runtime.helper/FortiClientAgent.app/Contents/MacOS/FortiClientAgent",
"/Library/Application Support/JAMF/Jamf.app/Contents/MacOS/JamfDaemon.app/Contents/MacOS/JamfDaemon",
"/Applications/Microsoft Defender.app/Contents/MacOS/wdavdaemon",
"/Library/Intune/Microsoft Intune Agent.app/Contents/MacOS/IntuneMdmDaemon",
"/usr/local/Privacy-i/PISupervisor",
"/usr/local/jamf/bin/jamf",
"/Library/Addigy/auditor",
"/Library/Elastic/Agent/*",
"/opt/jc/bin/jumpcloud-agent",
"/usr/sbin/networksetup"
)
'''
min_endpoint_version = "8.5.0"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1566"
name = "Phishing"
reference = "https://attack.mitre.org/techniques/T1566/"
[[threat.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 = "T1059"
name = "Command and Scripting Interpreter"
reference = "https://attack.mitre.org/techniques/T1059/"
[[threat.technique.subtechnique]]
id = "T1059.004"
name = "Unix Shell"
reference = "https://attack.mitre.org/techniques/T1059/004/"
[[threat.technique.subtechnique]]
id = "T1059.006"
name = "Python"
reference = "https://attack.mitre.org/techniques/T1059/006/"
[[threat.technique.subtechnique]]
id = "T1059.007"
name = "JavaScript"
reference = "https://attack.mitre.org/techniques/T1059/007/"
[[threat.technique]]
id = "T1204"
name = "User Execution"
reference = "https://attack.mitre.org/techniques/T1204/"
[[threat.technique.subtechnique]]
id = "T1204.002"
name = "Malicious File"
reference = "https://attack.mitre.org/techniques/T1204/002/"
[threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1547"
name = "Boot or Logon Autostart Execution"
reference = "https://attack.mitre.org/techniques/T1547/"
[threat.tactic]
id = "TA0003"
name = "Persistence"
reference = "https://attack.mitre.org/tactics/TA0003/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1027"
name = "Obfuscated Files or Information"
reference = "https://attack.mitre.org/techniques/T1027/"
[[threat.technique]]
id = "T1140"
name = "Deobfuscate/Decode Files or Information"
reference = "https://attack.mitre.org/techniques/T1140/"
[[threat.technique]]
id = "T1647"
name = "Plist File Modification"
reference = "https://attack.mitre.org/techniques/T1647/"
[threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1105"
name = "Ingress Tool Transfer"
reference = "https://attack.mitre.org/techniques/T1105/"
[threat.tactic]
id = "TA0011"
name = "Command and Control"
reference = "https://attack.mitre.org/tactics/TA0011/"
[internal]
min_endpoint_version = "8.5.0"
Stages and Predicates
Stage 1: process
process where event.action == "exec" and
descendant of [
process where event.action == "exec" and
process.name in (
"Microsoft Word",
"Microsoft Excel",
"Microsoft PowerPoint",
"Microsoft OneNote"
)
] and
process.name like~ (
"curl",
"nscurl",
"bash",
"sh",
"osascript",
"python*",
"perl*",
"mktemp",
"chmod",
"php",
"nohup",
"openssl",
"plutil",
"PlistBuddy",
"xattr",
"mktemp",
"sqlite3",
"funzip",
"popen"
) and
not process.args like~
(
"ProductVersion",
"hw.model",
"ioreg",
"ProductName",
"ProductUserVisibleVersion",
"ProductBuildVersion",
"/Library/Application Support/Microsoft/MERP*/Microsoft Error Reporting.app/Contents/MacOS/Microsoft Error Reporting",
"open -a Safari *",
"defaults read *",
"sysctl hw.model*",
"ioreg -d2 -c IOPlatformExpertDevice *",
"ps aux | grep 'ToDesk_Desktop' | grep -v grep",
"PIPE=\"$CFFIXED_USER_HOME/.zoteroIntegrationPipe*",
"/Library/Management/super/com.macjutsu.super.plist",
"\"/Applications/Mendeley Desktop.app/Contents/MacOS/MendeleyWordPlugin.app/Contents/MacOS/MendeleyWordPlugin\" setPort *",
"http://127.0.0.1:23119/integration/macWordCommand?*",
"curl -s -o /dev/null -I -m 2 -w '%{http_code}' -X GET 'http://127.0.0.1:23119/integration/macWordCommand?agent=*'",
"*/Applications/XLSTAT.app/*"
) and
not process.parent.executable like~
(
"/Applications/ToDesk.app/Contents/MacOS/ToDesk_Service",
"/usr/local/Privacy-i/PISupervisor",
"/Library/Addigy/lan-cache",
"/Library/Elastic/Agent/*",
"/opt/jc/bin/jumpcloud-agent",
"/usr/sbin/networksetup"
) and
not (process.name == "sh" and process.command_line like~ "*$CFFIXED_USER_HOME/.zoteroIntegrationPipe*") and
not (process.name in ("sh", "bash", "curl") and process.command_line like~ "*http://127.0.0.1:6969/binary*ppShuttle_*.bin*") and
not process.Ext.effective_parent.executable like~ (
"/Applications/ToDesk.app/Contents/MacOS/ToDesk_Service",
"/Applications/Docker.app/Contents/MacOS/com.docker.backend",
"/Applications/FortiClient.app/Contents/Resources/runtime.helper/FortiClientAgent.app/Contents/MacOS/FortiClientAgent",
"/Library/Application Support/JAMF/Jamf.app/Contents/MacOS/JamfDaemon.app/Contents/MacOS/JamfDaemon",
"/Applications/Microsoft Defender.app/Contents/MacOS/wdavdaemon",
"/Library/Intune/Microsoft Intune Agent.app/Contents/MacOS/IntuneMdmDaemon",
"/usr/local/Privacy-i/PISupervisor",
"/usr/local/jamf/bin/jamf",
"/Library/Addigy/auditor",
"/Library/Elastic/Agent/*",
"/opt/jc/bin/jumpcloud-agent",
"/usr/sbin/networksetup"
)
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | eq |
| field:"EventType" kind:eq value:"exec" |
process.name | wildcard |
| field:"process_basename" kind:wildcard |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.command_line | match | $CFFIXED_USER_HOME/.zoteroIntegrationPipe | excludes:process.command_line field:"process.command_line" value:"$CFFIXED_USER_HOME/.zoteroIntegrationPipe" |
process.name | eq | sh | excludes:process.name field:"process.name" value:"sh" |
process.command_line | wildcard | *http://127.0.0.1:6969/binary*ppShuttle_*.bin* | excludes:process.command_line field:"process.command_line" value:"*http://127.0.0.1:6969/binary*ppShuttle_*.bin*" |
process.name | in | bash, curl, sh | excludes:process.name field:"process.name" value:"bash" field:"process.name" value:"curl" field:"process.name" value:"sh" |
process.Ext.effective_parent.executable | wildcard | /Applications/ToDesk.app/Contents/MacOS/ToDesk_Service, /Applications/Docker.app/Contents/MacOS/com.docker.backend, /Applications/FortiClient.app/Contents/Resources/runtime.helper/FortiClientAgent.app/Contents/MacOS/FortiClientAgent, /Library/Application Support/JAMF/Jamf.app/Contents/MacOS/JamfDaemon.app/Contents/MacOS/JamfDaemon, /Applications/Microsoft Defender.app/Contents/MacOS/wdavdaemon, /Library/Intune/Microsoft Intune Agent.app/Contents/MacOS/IntuneMdmDaemon, /usr/local/Privacy-i/PISupervisor, /usr/local/jamf/bin/jamf, /Library/Addigy/auditor, /Library/Elastic/Agent/*, /opt/jc/bin/jumpcloud-agent, /usr/sbin/networksetup | excludes:process.Ext.effective_parent.executable |
process.args | wildcard | ProductVersion, hw.model, ioreg, ProductName, ProductUserVisibleVersion, ProductBuildVersion, /Library/Application Support/Microsoft/MERP*/Microsoft Error Reporting.app/Contents/MacOS/Microsoft Error Reporting, open -a Safari *, defaults read *, sysctl hw.model*, ioreg -d2 -c IOPlatformExpertDevice *, ps aux | grep 'ToDesk_Desktop' | grep -v grep, PIPE="$CFFIXED_USER_HOME/.zoteroIntegrationPipe*, /Library/Management/super/com.macjutsu.super.plist, "/Applications/Mendeley Desktop.app/Contents/MacOS/MendeleyWordPlugin.app/Contents/MacOS/MendeleyWordPlugin" setPort *, http://127.0.0.1:23119/integration/macWordCommand?*, curl -s -o /dev/null -I -m 2 -w '%{http_code}' -X GET 'http://127.0.0.1:23119/integration/macWordCommand?agent=*', */Applications/XLSTAT.app/* | excludes:process.args |
process.parent.executable | wildcard | /Applications/ToDesk.app/Contents/MacOS/ToDesk_Service, /usr/local/Privacy-i/PISupervisor, /Library/Addigy/lan-cache, /Library/Elastic/Agent/*, /opt/jc/bin/jumpcloud-agent, /usr/sbin/networksetup | excludes:process.parent.executable |
Linux User Account Creation
#Identifies attempts to create new users. Attackers may add new users to establish persistence on a system.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Persistence |
Rule Body
[metadata]
creation_date = "2023/02/13"
integration = ["system"]
maturity = "production"
updated_date = "2025/12/22"
[transform]
[[transform.osquery]]
label = "Osquery - Retrieve Information for a Specific User"
query = "SELECT * FROM users WHERE username = {{user.name}}"
[[transform.osquery]]
label = "Osquery - Investigate the Account Authentication Status"
query = "SELECT * FROM logged_in_users WHERE user = {{user.name}}"
[[transform.osquery]]
label = "Osquery - Retrieve Information for a Specific Group"
query = "SELECT * FROM groups WHERE groupname = {{group.name}}"
[[transform.osquery]]
label = "Osquery - Retrieve Running Processes by User"
query = "SELECT pid, username, name FROM processes p JOIN users u ON u.uid = p.uid ORDER BY username"
[rule]
author = ["Elastic"]
description = """
Identifies attempts to create new users. Attackers may add new users to establish persistence on a system.
"""
from = "now-9m"
index = ["filebeat-*", "logs-system.auth-*"]
language = "eql"
license = "Elastic License v2"
name = "Linux User Account Creation"
note = """## Triage and analysis
### Investigating Linux User Account Creation
The `useradd` and `adduser` commands are used to create new user accounts in Linux-based operating systems.
Attackers may create new accounts (both local and domain) to maintain access to victim systems.
This rule identifies the usage of `useradd` and `adduser` to create new accounts.
> **Note**:
> This investigation guide uses the [Osquery Markdown Plugin](https://www.elastic.co/guide/en/security/current/invest-guide-run-osquery.html) introduced in Elastic Stack version 8.5.0. Older Elastic Stack versions will display unrendered Markdown in this guide.
> This investigation guide uses [placeholder fields](https://www.elastic.co/guide/en/security/current/osquery-placeholder-fields.html) to dynamically pass alert data into Osquery queries. Placeholder fields were introduced in Elastic Stack version 8.7.0. If you're using Elastic Stack version 8.6.0 or earlier, you'll need to manually adjust this investigation guide's queries to ensure they properly run.
#### Possible investigation steps
- Investigate whether the user was created succesfully.
- $osquery_0
- Investigate whether the user is currently logged in and active.
- $osquery_1
- Identify if the account was added to privileged groups or assigned special privileges after creation.
- $osquery_2
- Identify the user account that performed the action and whether it should perform this kind of action.
- Investigate the process execution chain (parent process tree) for unknown processes. Examine their executable files for prevalence and whether they are located in expected locations.
- $osquery_3
- Investigate other alerts associated with the user/host during the past 48 hours.
### False positive analysis
- Account creation is a common administrative task, so there is a high chance of the activity being legitimate. Before investigating further, verify that this activity is not benign.
### Response and remediation
- Initiate the incident response process based on the outcome of the triage.
- Isolate the involved host to prevent further post-compromise behavior.
- If the triage identified malware, search the environment for additional compromised hosts.
- Implement temporary network rules, procedures, and segmentation to contain the malware.
- Stop suspicious processes.
- Immediately block the identified indicators of compromise (IoCs).
- Inspect the affected systems for additional malware backdoors like reverse shells, reverse proxies, or droppers that attackers could use to reinfect the system.
- Review the privileges assigned to the involved users to ensure that the least privilege principle is being followed.
- Delete the created account.
- Investigate credential exposure on systems compromised or used by the attacker to ensure all compromised accounts are identified. Reset passwords for these accounts and other potentially compromised credentials, such as email, business systems, and web services.
- Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
- Using the incident response data, update logging and audit policies to improve the mean time to detect (MTTD) and the mean time to respond (MTTR).
"""
references = ["https://www.elastic.co/security-labs/primer-on-persistence-mechanisms"]
risk_score = 21
rule_id = "edfd5ca9-9d6c-44d9-b615-1e56b920219c"
setup = """## Setup
This rule requires data coming in from Filebeat.
### Filebeat Setup
Filebeat is a lightweight shipper for forwarding and centralizing log data. Installed as an agent on your servers, Filebeat monitors the log files or locations that you specify, collects log events, and forwards them either to Elasticsearch or Logstash for indexing.
#### The following steps should be executed in order to add the Filebeat on a Linux System:
- Elastic provides repositories available for APT and YUM-based distributions. Note that we provide binary packages, but no source packages.
- To install the APT and YUM repositories follow the setup instructions in this [helper guide](https://www.elastic.co/guide/en/beats/filebeat/current/setup-repositories.html).
- To run Filebeat on Docker follow the setup instructions in the [helper guide](https://www.elastic.co/guide/en/beats/filebeat/current/running-on-docker.html).
- To run Filebeat on Kubernetes follow the setup instructions in the [helper guide](https://www.elastic.co/guide/en/beats/filebeat/current/running-on-kubernetes.html).
- For quick start information for Filebeat refer to the [helper guide](https://www.elastic.co/guide/en/beats/filebeat/8.11/filebeat-installation-configuration.html).
- For complete “Setup and Run Filebeat” information refer to the [helper guide](https://www.elastic.co/guide/en/beats/filebeat/current/setting-up-and-running.html).
#### Rule Specific Setup Note
- This rule requires the “Filebeat System Module” to be enabled.
- The system module collects and parses logs created by the system logging service of common Unix/Linux based distributions.
- To run the system module of Filebeat on Linux follow the setup instructions in the [helper guide](https://www.elastic.co/guide/en/beats/filebeat/current/filebeat-module-system.html).
"""
severity = "low"
tags = [
"Domain: Endpoint",
"OS: Linux",
"Use Case: Threat Detection",
"Tactic: Persistence",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
iam where host.os.type == "linux" and event.type == "user" and event.type == "creation" and event.outcome == "success"
'''
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1136"
name = "Create Account"
reference = "https://attack.mitre.org/techniques/T1136/"
[[rule.threat.technique.subtechnique]]
id = "T1136.001"
name = "Local Account"
reference = "https://attack.mitre.org/techniques/T1136/001/"
[rule.threat.tactic]
id = "TA0003"
name = "Persistence"
reference = "https://attack.mitre.org/tactics/TA0003/"
Stages and Predicates
Stage 1: iam
iam where host.os.type == "linux" and event.type == "user" and event.type == "creation" and event.outcome == "success"
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.outcome | eq |
| field:"event.outcome" kind:eq value:"success" |
event.type | eq |
| field:"event.type" kind:eq |
M365 Exchange Mailbox Accessed by Unusual Client
#Identifies suspicious Microsoft 365 mail access by ClientAppId. This rule detects when a user accesses their mailbox using a client application that is not typically used by the user, which may indicate potential compromise or unauthorized access attempts. Adversaries may use custom or third-party applications to access mailboxes, bypassing standard security controls. First-party Microsoft applications are also abused after OAuth tokens are compromised, allowing adversaries to access mailboxes without raising suspicion.
Known False Positives
- User using a new mail client or mobile application to access their mailbox.
- Users accessing their mailboxes using custom or third-party applications that are authorized by the organization, such as CRM or ERP systems.
- Users accessing their mailboxes using first-party Microsoft applications that are not typically used by the user, such as Outlook on the web or Outlook mobile app.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Collection |
Telemetry Coverage
| Platform | Record / event type |
|---|---|
| Microsoft 365 | MailItemsAccessed |
Rules Detecting the Same Action
These rules filter on the same operation.
Rule Body
[metadata]
creation_date = "2023/07/18"
integration = ["o365"]
maturity = "production"
updated_date = "2026/04/10"
[rule]
author = ["Elastic"]
description = """
Identifies suspicious Microsoft 365 mail access by ClientAppId. This rule detects when a user accesses their mailbox
using a client application that is not typically used by the user, which may indicate potential compromise or
unauthorized access attempts. Adversaries may use custom or third-party applications to access mailboxes, bypassing
standard security controls. First-party Microsoft applications are also abused after OAuth tokens are compromised,
allowing adversaries to access mailboxes without raising suspicion.
"""
false_positives = [
"User using a new mail client or mobile application to access their mailbox.",
"""
Users accessing their mailboxes using custom or third-party applications that are authorized by the organization,
such as CRM or ERP systems.
""",
"""
Users accessing their mailboxes using first-party Microsoft applications that are not typically used by the user,
such as Outlook on the web or Outlook mobile app.
""",
]
from = "now-9m"
index = ["filebeat-*", "logs-o365.audit-*"]
language = "kuery"
license = "Elastic License v2"
name = "M365 Exchange Mailbox Accessed by Unusual Client"
note = """## Triage and Analysis
### Investigating M365 Exchange Mailbox Accessed by Unusual Client
This rule detects when a user accesses their mailbox using a client application that is not typically used by the user, which may indicate potential compromise or unauthorized access attempts. Adversaries may use custom or third-party applications to access mailboxes, bypassing standard security controls. First-party Microsoft applications are also abused after OAuth tokens are compromised, allowing adversaries to access mailboxes without raising suspicion.
### Possible investigation steps
- Review the `o365.audit.UserId` field to identify the user associated with the mailbox access.
- Check the `o365.audit.ClientAppId` field to determine which client application was used for the mailbox access. Look for unusual or unexpected applications or determine which first-party Microsoft applications are being abused.
- Review `o365.audit.ClientInfoString` to gather additional information about the client application used for the mailbox access.
- Examine `o365.audit.Folders.Path` to identify the specific mailbox folders accessed by the client application. This can help determine if sensitive information was accessed or if the access was legitimate.
- Ensure that `o365.audit.MailboxOwnerUPN` matches the `o365.audit.UserId` to confirm that the mailbox accessed belongs to the user identified in the `o365.audit.UserId` field.
- Review geolocation information to identify the location from which the mailbox access occurred. Look for any anomalies or unexpected locations that may indicate suspicious activity.
- Examine `o365.audit.Folders.FolderItems.Id` to identify the specific items accessed within the mailbox folders. This can help determine if sensitive information was accessed or if the access was legitimate.
### False positive analysis
- Legitimate users may access their mailboxes using new or different client applications, such as when switching to a new email client or using a mobile application. If this is expected behavior, consider adjusting the rule or adding exceptions for specific users or client applications.
- Users may access their mailboxes using custom or third-party applications that are authorized by the organization, such as CRM or ERP systems. If this is expected behavior, consider adjusting the rule or adding exceptions for specific applications.
### Response and remediation
- If the mailbox access is confirmed to be suspicious or unauthorized, take immediate action to revoke the access token and prevent further access.
- Disable the user account temporarily to prevent any potential compromise or unauthorized access.
- Examine the sensitivity of the mailbox data accessed and determine if any sensitive information was compromised.
- Rotate the user's credentials and enforce multi-factor authentication (MFA) to prevent further unauthorized access.
- Review the conditional access policies in place to ensure they are sufficient to prevent unauthorized access to sensitive resources.
"""
references = [
"https://www.cisa.gov/news-events/cybersecurity-advisories/aa23-193a",
"https://trustedsec.com/blog/mailitemsaccessed-woes-m365-investigation-challenges",
"https://learn.microsoft.com/en-us/purview/audit-log-investigate-accounts",
]
risk_score = 47
rule_id = "48819484-9826-4083-9eba-1da74cd0eaf2"
severity = "medium"
tags = [
"Domain: Cloud",
"Domain: Email",
"Data Source: Microsoft 365",
"Data Source: Microsoft 365 Audit Logs",
"Use Case: Threat Detection",
"Tactic: Collection",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "new_terms"
query = '''
data_stream.dataset: "o365.audit" and
event.provider: "Exchange" and
event.category: "web" and
event.action: "MailItemsAccessed" and
event.outcome: "success" and
o365.audit.LogonType: ("0" or "1" or "6") and
o365.audit.UserType: ("0" or "2" or "3" or "10") and
o365.audit.OperationProperties.Value: "Bind" and
not o365.audit.ClientAppId : (
"00000002-0000-0000-c000-000000000000" or "00000002-0000-0ff1-ce00-000000000000" or
"00000003-0000-0ff1-ce00-000000000000" or "00000004-0000-0ff1-ce00-000000000000" or
"00000005-0000-0ff1-ce00-000000000000" or "00000006-0000-0ff1-ce00-000000000000" or
"00000007-0000-0000-c000-000000000000" or "00000007-0000-0ff1-ce00-000000000000" or
"00000009-0000-0000-c000-000000000000" or "0000000c-0000-0000-c000-000000000000" or
"00000012-0000-0000-c000-000000000000" or "00000015-0000-0000-c000-000000000000" or
"0000001a-0000-0000-c000-000000000000" or "00b41c95-dab0-4487-9791-b9d2c32c80f2" or
"022907d3-0f1b-48f7-badc-1ba6abab6d66" or "04b07795-8ddb-461a-bbee-02f9e1bf7b46" or
"08543e9e-5b1f-4af5-8228-cb5a5c9d4e24" or "08e18876-6177-487e-b8b5-cf950c1e598c" or
"0cb7b9ec-5336-483b-bc31-b15b5788de71" or "0cd196ee-71bf-4fd6-a57c-b491ffd4fb1e" or
"0f698dd4-f011-4d23-a33e-b36416dcb1e6" or "1150aefc-07de-4228-b2b2-042a536703c0" or
"11ba4a52-3159-44e1-93cd-d18e9443e3ef" or "13937bba-652e-4c46-b222-3003f4d1ff97" or
"13937bba-652e-4c46-b222-3003f4d1ff97" or "13937bba-652e-4c46-b222-3003f4d1ff97" or
"14d82eec-204b-4c2f-b7e8-296a70dab67e" or "157cdfbf-7398-4a56-96c3-e93e9ab309b5" or
"16aeb910-ce68-41d1-9ac3-9e1673ac9575" or "1786c5ed-9644-47b2-8aa0-7201292175b6" or
"17d5e35f-655b-4fb0-8ae6-86356e9a49f5" or "18fbca16-2224-45f6-85b0-f7bf2b39b3f3" or
"1950a258-227b-4e31-a9cf-717495945fc2" or "1b3c667f-cde3-4090-b60b-3d2abd0117f0" or
"1fec8e78-bce4-4aaf-ab1b-5451cc387264" or "1fec8e78-bce4-4aaf-ab1b-5451cc387264" or
"20a11fe0-faa8-4df5-baf2-f965f8f9972e" or "23523755-3a2b-41ca-9315-f81f3f566a95" or
"243c63a3-247d-41c5-9d83-7788c43f1c43" or "268761a2-03f3-40df-8a8b-c3db24145b6b" or
"26a7ee05-5602-4d76-a7ba-eae8b7b67941" or "26a7ee05-5602-4d76-a7ba-eae8b7b67941" or
"26abc9a8-24f0-4b11-8234-e86ede698878" or "27922004-5251-4030-b22d-91ecd9a37ea4" or
"27922004-5251-4030-b22d-91ecd9a37ea4" or "27b9c0f2-3d8e-4a1c-8b6f-5d7a0c6e1f2b" or
"28b567f6-162c-4f54-99a0-6887f387bbcc" or "29d9ed98-a469-4536-ade2-f981bc1d605e" or
"2abdc806-e091-4495-9b10-b04d93c3f040" or "2cee05de-2b8f-45a2-8289-2a06ca32c4c8" or
"2d4d3d8e-2be3-4bef-9f87-7875a61c29de" or "2d7f3606-b07d-41d1-b9d2-0d0c9296a6e8" or
"2fd64745-b008-3e7d-4903-15d43e60f62a" or "3090ab82-f1c1-4cdf-af2c-5d7a6f3e2cc7" or
"35d54a08-36c9-4847-9018-93934c62740c" or "37182072-3c9c-4f6a-a4b3-b3f91cacffce" or
"38049638-cc2c-4cde-abe4-4479d721ed44" or "3c896ded-22c5-450f-91f6-3d1ef0848f6e" or
"43375d74-c6a5-4d4e-a0a3-de139860ea75" or "4345a7b9-9a63-4910-a426-35363201d503" or
"45a330b1-b1ec-4cc1-9161-9f03992aa49f" or "464e0e4d-676a-4c3b-9f81-2ed9b2a9acd2" or
"4765445b-32c6-49b0-83e6-1d93765276ca" or "497effe9-df71-4043-a8bb-14cf78c4b63b" or
"4b233688-031c-404b-9a80-a4f3f2351f90" or "4d5c2d63-cf83-4365-853c-925fd1a64357" or
"51be292c-a17e-4f17-9a7e-4b661fb16dd2" or "5572c4c0-d078-44ce-b81c-6cbf8d3ed39e" or
"5d661950-3475-41cd-a2c3-d671a3162bc1" or "5e3ce6c0-2b1f-4285-8d4b-75ee78787346" or
"60c8bde5-3167-4f92-8fdb-059f6176dc0f" or "61109738-7d2b-4a0b-9fe3-660b1ff83505" or
"62256cef-54c0-4cb4-bcac-4c67989bdc40" or "6253bca8-faf2-4587-8f2f-b056d80998a7" or
"6326e366-9d6d-4c70-b22a-34c7ea72d73d" or "65d91a3d-ab74-42e6-8a2f-0add61688c74" or
"66a88757-258c-4c72-893c-3e8bed4d6899" or "67e3df25-268a-4324-a550-0de1c7f97287" or
"69893ee3-dd10-4b1c-832d-4870354be3d8" or "74658136-14ec-4630-ad9b-26e160ff0fc6" or
"74bcdadc-2fdc-4bb3-8459-76d06952a0e9" or "75efb5bc-18a1-4e7b-8a66-2ad2503d79c6" or
"75f31797-37c9-498e-8dc9-53c16a36afca" or "797f4846-ba00-4fd7-ba43-dac1f8f63013" or
"7ab7862c-4c57-491e-8a45-d52a7e023983" or "7ae974c5-1af7-4923-af3a-fb1fd14dcb7e" or
"7b7531ad-5926-4f2d-8a1d-38495ad33e17" or "7fba38f4-ec1f-458d-906c-f4e3c4f41335" or
"80ccca67-54bd-44ab-8625-4b79c4dc7775" or "82d8ab62-be52-a567-14ea-1616c4ee06c4" or
"835b2a73-6e10-4aa5-a979-21dfda45231c" or "871c010f-5e61-4fb1-83ac-98610a7e9110" or
"89bee1f7-5e6e-4d8a-9f3d-ecd601259da7" or "8acd33ea-7197-4a96-bc33-d7cc7101262f" or
"8edd93e1-2103-40b4-bd70-6e34e586362d" or "905fcf26-4eb7-48a0-9ff0-8dcc7194b5ba" or
"9199bf20-a13f-4107-85dc-02114787ef48" or "9199bf20-a13f-4107-85dc-02114787ef48" or
"91ca2ca5-3b3e-41dd-ab65-809fa3dffffa" or "93625bc8-bfe2-437a-97e0-3d0060024faa" or
"93d53678-613d-4013-afc1-62e9e444a0a5" or "944f0bd1-117b-4b1c-af26-804ed95e767e" or
"94c63fef-13a3-47bc-8074-75af8c65887a" or "95de633a-083e-42f5-b444-a4295d8e9314" or
"97cb1f73-50df-47d1-8fb0-0271f2728514" or "98db8bd6-0cc0-4e67-9de5-f187f1cd1b41" or
"99b904fd-a1fe-455c-b86c-2f9fb1da7687" or "9ea1ad79-fdb6-4f9a-8bc3-2b70f96e34c7" or
"9fd38622-d9b4-4401-b1b9-1ce14c5e435a" or "a3475900-ccec-4a69-98f5-a65cd5dc5306" or
"a3883eba-fbe9-48bd-9ed3-dca3e0e84250" or "a3883eba-fbe9-48bd-9ed3-dca3e0e84250" or
"a3b79187-70b2-4139-83f9-6016c58cd27b" or "a40d7d7d-59aa-447e-a655-679a4107e548" or
"a57aca87-cbc0-4f3c-8b9e-dc095fdc8978" or "a970bac6-63fe-4ec5-8884-8536862c42d4" or
"a9b49b65-0a12-430b-9540-c80b3332c127" or "ab9b8c07-8f02-4f72-87fa-80105867a763" or
"ae8e128e-080f-4086-b0e3-4c19301ada69" or "b23dd4db-9142-4734-867f-3577f640ad0c" or
"b4bddae8-ab25-483e-8670-df09b9f1d0ea" or "b669c6ea-1adf-453f-b8bc-6d526592b419" or
"b6e69c34-5f1f-4c34-8cdf-7fea120b8670" or "bb2a2e3a-c5e7-4f0a-88e0-8e01fd3fc1f4" or
"bdd48c81-3a58-4ea9-849c-ebea7f6b6360" or "c1c74fed-04c9-4704-80dc-9f79a2e515cb" or
"c35cb2ba-f88b-4d15-aa9d-37bd443522e1" or "c44b4083-3bb0-49c1-b47d-974e53cbdf3c" or
"c9a559d2-7aab-4f13-a6ed-e7e9c52aec87" or "cc15fd57-2c6c-4117-a88c-83b1d56b4bbe" or
"cf36b471-5b44-428c-9ce7-313bf84528de" or "cf53fce8-def6-4aeb-8d30-b158e7b1cf83" or
"d176f6e7-38e5-40c9-8a78-3998aab820e7" or "d34dcd43-8519-44e4-827c-de79b767da47" or
"d3590ed6-52b3-4102-aeff-aad2292ab01c" or "d3590ed6-52b3-4102-aeff-aad2292ab01c" or
"d3590ed6-52b3-4102-aeff-aad2292ab01c" or "d396de1f-10d4-4023-aae2-5bb3d724ba9a" or
"d71dfe16-1070-48f3-bd3a-c3ec919d34e7" or "d73f4b35-55c9-48c7-8b10-651f6f2acb2e" or
"d9b8ec3a-1e4e-4e08-b3c2-5baf00c0fcb0" or "de8bc8b5-d9f9-48b1-a8ad-b748da725064" or
"dfe74da8-9279-44ec-8fb2-2aed9e1c73d0" or "e1ef36fd-b883-4dbf-97f0-9ece4b576fc6" or
"e64aa8bc-8eb4-40e2-898b-cf261a25954f" or "e9b154d0-7658-433b-bb25-6b8e0a8a7c59" or
"e9f49c6b-5ce5-44c8-925d-015017e9f7ad" or "ee272b19-4411-433f-8f28-5c13cb6fd407" or
"eed83176-464d-48c7-a887-cc5cc534c7b8" or "f5eaa862-7f08-448c-9c4e-f4047d4d4521" or
"f8d98a96-0999-43f5-8af3-69971c7bb423" or "fb78d390-0c51-40cd-8e17-fdbfab77341b" or
"fc0f3af4-6835-4174-b806-f7db311fd2f3" or "fdf9885b-dd37-42bf-82e5-c3129ef5a302" or
"ffcb16e8-f789-467c-8ce9-f826a080d987"
)
'''
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1114"
name = "Email Collection"
reference = "https://attack.mitre.org/techniques/T1114/"
[[rule.threat.technique.subtechnique]]
id = "T1114.002"
name = "Remote Email Collection"
reference = "https://attack.mitre.org/techniques/T1114/002/"
[rule.threat.tactic]
id = "TA0009"
name = "Collection"
reference = "https://attack.mitre.org/tactics/TA0009/"
[rule.new_terms]
field = "new_terms_fields"
value = ["o365.audit.ClientAppId"]
[[rule.new_terms.history_window_start]]
field = "history_window_start"
value = "now-14d"
Stages and Predicates
Stage 1: new_terms
data_stream.dataset: "o365.audit" and
event.provider: "Exchange" and
event.category: "web" and
event.action: "MailItemsAccessed" and
event.outcome: "success" and
o365.audit.LogonType: ("0" or "1" or "6") and
o365.audit.UserType: ("0" or "2" or "3" or "10") and
o365.audit.OperationProperties.Value: "Bind" and
not o365.audit.ClientAppId : (
"00000002-0000-0000-c000-000000000000" or "00000002-0000-0ff1-ce00-000000000000" or
"00000003-0000-0ff1-ce00-000000000000" or "00000004-0000-0ff1-ce00-000000000000" or
"00000005-0000-0ff1-ce00-000000000000" or "00000006-0000-0ff1-ce00-000000000000" or
"00000007-0000-0000-c000-000000000000" or "00000007-0000-0ff1-ce00-000000000000" or
"00000009-0000-0000-c000-000000000000" or "0000000c-0000-0000-c000-000000000000" or
"00000012-0000-0000-c000-000000000000" or "00000015-0000-0000-c000-000000000000" or
"0000001a-0000-0000-c000-000000000000" or "00b41c95-dab0-4487-9791-b9d2c32c80f2" or
"022907d3-0f1b-48f7-badc-1ba6abab6d66" or "04b07795-8ddb-461a-bbee-02f9e1bf7b46" or
"08543e9e-5b1f-4af5-8228-cb5a5c9d4e24" or "08e18876-6177-487e-b8b5-cf950c1e598c" or
"0cb7b9ec-5336-483b-bc31-b15b5788de71" or "0cd196ee-71bf-4fd6-a57c-b491ffd4fb1e" or
"0f698dd4-f011-4d23-a33e-b36416dcb1e6" or "1150aefc-07de-4228-b2b2-042a536703c0" or
"11ba4a52-3159-44e1-93cd-d18e9443e3ef" or "13937bba-652e-4c46-b222-3003f4d1ff97" or
"13937bba-652e-4c46-b222-3003f4d1ff97" or "13937bba-652e-4c46-b222-3003f4d1ff97" or
"14d82eec-204b-4c2f-b7e8-296a70dab67e" or "157cdfbf-7398-4a56-96c3-e93e9ab309b5" or
"16aeb910-ce68-41d1-9ac3-9e1673ac9575" or "1786c5ed-9644-47b2-8aa0-7201292175b6" or
"17d5e35f-655b-4fb0-8ae6-86356e9a49f5" or "18fbca16-2224-45f6-85b0-f7bf2b39b3f3" or
"1950a258-227b-4e31-a9cf-717495945fc2" or "1b3c667f-cde3-4090-b60b-3d2abd0117f0" or
"1fec8e78-bce4-4aaf-ab1b-5451cc387264" or "1fec8e78-bce4-4aaf-ab1b-5451cc387264" or
"20a11fe0-faa8-4df5-baf2-f965f8f9972e" or "23523755-3a2b-41ca-9315-f81f3f566a95" or
"243c63a3-247d-41c5-9d83-7788c43f1c43" or "268761a2-03f3-40df-8a8b-c3db24145b6b" or
"26a7ee05-5602-4d76-a7ba-eae8b7b67941" or "26a7ee05-5602-4d76-a7ba-eae8b7b67941" or
"26abc9a8-24f0-4b11-8234-e86ede698878" or "27922004-5251-4030-b22d-91ecd9a37ea4" or
"27922004-5251-4030-b22d-91ecd9a37ea4" or "27b9c0f2-3d8e-4a1c-8b6f-5d7a0c6e1f2b" or
"28b567f6-162c-4f54-99a0-6887f387bbcc" or "29d9ed98-a469-4536-ade2-f981bc1d605e" or
"2abdc806-e091-4495-9b10-b04d93c3f040" or "2cee05de-2b8f-45a2-8289-2a06ca32c4c8" or
"2d4d3d8e-2be3-4bef-9f87-7875a61c29de" or "2d7f3606-b07d-41d1-b9d2-0d0c9296a6e8" or
"2fd64745-b008-3e7d-4903-15d43e60f62a" or "3090ab82-f1c1-4cdf-af2c-5d7a6f3e2cc7" or
"35d54a08-36c9-4847-9018-93934c62740c" or "37182072-3c9c-4f6a-a4b3-b3f91cacffce" or
"38049638-cc2c-4cde-abe4-4479d721ed44" or "3c896ded-22c5-450f-91f6-3d1ef0848f6e" or
"43375d74-c6a5-4d4e-a0a3-de139860ea75" or "4345a7b9-9a63-4910-a426-35363201d503" or
"45a330b1-b1ec-4cc1-9161-9f03992aa49f" or "464e0e4d-676a-4c3b-9f81-2ed9b2a9acd2" or
"4765445b-32c6-49b0-83e6-1d93765276ca" or "497effe9-df71-4043-a8bb-14cf78c4b63b" or
"4b233688-031c-404b-9a80-a4f3f2351f90" or "4d5c2d63-cf83-4365-853c-925fd1a64357" or
"51be292c-a17e-4f17-9a7e-4b661fb16dd2" or "5572c4c0-d078-44ce-b81c-6cbf8d3ed39e" or
"5d661950-3475-41cd-a2c3-d671a3162bc1" or "5e3ce6c0-2b1f-4285-8d4b-75ee78787346" or
"60c8bde5-3167-4f92-8fdb-059f6176dc0f" or "61109738-7d2b-4a0b-9fe3-660b1ff83505" or
"62256cef-54c0-4cb4-bcac-4c67989bdc40" or "6253bca8-faf2-4587-8f2f-b056d80998a7" or
"6326e366-9d6d-4c70-b22a-34c7ea72d73d" or "65d91a3d-ab74-42e6-8a2f-0add61688c74" or
"66a88757-258c-4c72-893c-3e8bed4d6899" or "67e3df25-268a-4324-a550-0de1c7f97287" or
"69893ee3-dd10-4b1c-832d-4870354be3d8" or "74658136-14ec-4630-ad9b-26e160ff0fc6" or
"74bcdadc-2fdc-4bb3-8459-76d06952a0e9" or "75efb5bc-18a1-4e7b-8a66-2ad2503d79c6" or
"75f31797-37c9-498e-8dc9-53c16a36afca" or "797f4846-ba00-4fd7-ba43-dac1f8f63013" or
"7ab7862c-4c57-491e-8a45-d52a7e023983" or "7ae974c5-1af7-4923-af3a-fb1fd14dcb7e" or
"7b7531ad-5926-4f2d-8a1d-38495ad33e17" or "7fba38f4-ec1f-458d-906c-f4e3c4f41335" or
"80ccca67-54bd-44ab-8625-4b79c4dc7775" or "82d8ab62-be52-a567-14ea-1616c4ee06c4" or
"835b2a73-6e10-4aa5-a979-21dfda45231c" or "871c010f-5e61-4fb1-83ac-98610a7e9110" or
"89bee1f7-5e6e-4d8a-9f3d-ecd601259da7" or "8acd33ea-7197-4a96-bc33-d7cc7101262f" or
"8edd93e1-2103-40b4-bd70-6e34e586362d" or "905fcf26-4eb7-48a0-9ff0-8dcc7194b5ba" or
"9199bf20-a13f-4107-85dc-02114787ef48" or "9199bf20-a13f-4107-85dc-02114787ef48" or
"91ca2ca5-3b3e-41dd-ab65-809fa3dffffa" or "93625bc8-bfe2-437a-97e0-3d0060024faa" or
"93d53678-613d-4013-afc1-62e9e444a0a5" or "944f0bd1-117b-4b1c-af26-804ed95e767e" or
"94c63fef-13a3-47bc-8074-75af8c65887a" or "95de633a-083e-42f5-b444-a4295d8e9314" or
"97cb1f73-50df-47d1-8fb0-0271f2728514" or "98db8bd6-0cc0-4e67-9de5-f187f1cd1b41" or
"99b904fd-a1fe-455c-b86c-2f9fb1da7687" or "9ea1ad79-fdb6-4f9a-8bc3-2b70f96e34c7" or
"9fd38622-d9b4-4401-b1b9-1ce14c5e435a" or "a3475900-ccec-4a69-98f5-a65cd5dc5306" or
"a3883eba-fbe9-48bd-9ed3-dca3e0e84250" or "a3883eba-fbe9-48bd-9ed3-dca3e0e84250" or
"a3b79187-70b2-4139-83f9-6016c58cd27b" or "a40d7d7d-59aa-447e-a655-679a4107e548" or
"a57aca87-cbc0-4f3c-8b9e-dc095fdc8978" or "a970bac6-63fe-4ec5-8884-8536862c42d4" or
"a9b49b65-0a12-430b-9540-c80b3332c127" or "ab9b8c07-8f02-4f72-87fa-80105867a763" or
"ae8e128e-080f-4086-b0e3-4c19301ada69" or "b23dd4db-9142-4734-867f-3577f640ad0c" or
"b4bddae8-ab25-483e-8670-df09b9f1d0ea" or "b669c6ea-1adf-453f-b8bc-6d526592b419" or
"b6e69c34-5f1f-4c34-8cdf-7fea120b8670" or "bb2a2e3a-c5e7-4f0a-88e0-8e01fd3fc1f4" or
"bdd48c81-3a58-4ea9-849c-ebea7f6b6360" or "c1c74fed-04c9-4704-80dc-9f79a2e515cb" or
"c35cb2ba-f88b-4d15-aa9d-37bd443522e1" or "c44b4083-3bb0-49c1-b47d-974e53cbdf3c" or
"c9a559d2-7aab-4f13-a6ed-e7e9c52aec87" or "cc15fd57-2c6c-4117-a88c-83b1d56b4bbe" or
"cf36b471-5b44-428c-9ce7-313bf84528de" or "cf53fce8-def6-4aeb-8d30-b158e7b1cf83" or
"d176f6e7-38e5-40c9-8a78-3998aab820e7" or "d34dcd43-8519-44e4-827c-de79b767da47" or
"d3590ed6-52b3-4102-aeff-aad2292ab01c" or "d3590ed6-52b3-4102-aeff-aad2292ab01c" or
"d3590ed6-52b3-4102-aeff-aad2292ab01c" or "d396de1f-10d4-4023-aae2-5bb3d724ba9a" or
"d71dfe16-1070-48f3-bd3a-c3ec919d34e7" or "d73f4b35-55c9-48c7-8b10-651f6f2acb2e" or
"d9b8ec3a-1e4e-4e08-b3c2-5baf00c0fcb0" or "de8bc8b5-d9f9-48b1-a8ad-b748da725064" or
"dfe74da8-9279-44ec-8fb2-2aed9e1c73d0" or "e1ef36fd-b883-4dbf-97f0-9ece4b576fc6" or
"e64aa8bc-8eb4-40e2-898b-cf261a25954f" or "e9b154d0-7658-433b-bb25-6b8e0a8a7c59" or
"e9f49c6b-5ce5-44c8-925d-015017e9f7ad" or "ee272b19-4411-433f-8f28-5c13cb6fd407" or
"eed83176-464d-48c7-a887-cc5cc534c7b8" or "f5eaa862-7f08-448c-9c4e-f4047d4d4521" or
"f8d98a96-0999-43f5-8af3-69971c7bb423" or "fb78d390-0c51-40cd-8e17-fdbfab77341b" or
"fc0f3af4-6835-4174-b806-f7db311fd2f3" or "fdf9885b-dd37-42bf-82e5-c3129ef5a302" or
"ffcb16e8-f789-467c-8ce9-f826a080d987"
)
Indicators
These rows show field, operator, and value matches.
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
o365.audit.ClientAppId | in | 00000002-0000-0000-c000-000000000000, 00000002-0000-0ff1-ce00-000000000000, 00000003-0000-0ff1-ce00-000000000000, 00000004-0000-0ff1-ce00-000000000000, 00000005-0000-0ff1-ce00-000000000000, 00000006-0000-0ff1-ce00-000000000000, 00000007-0000-0000-c000-000000000000, 00000007-0000-0ff1-ce00-000000000000, 00000009-0000-0000-c000-000000000000, 0000000c-0000-0000-c000-000000000000, 00000012-0000-0000-c000-000000000000, 00000015-0000-0000-c000-000000000000, 0000001a-0000-0000-c000-000000000000, 00b41c95-dab0-4487-9791-b9d2c32c80f2, 022907d3-0f1b-48f7-badc-1ba6abab6d66, 04b07795-8ddb-461a-bbee-02f9e1bf7b46, 08543e9e-5b1f-4af5-8228-cb5a5c9d4e24, 08e18876-6177-487e-b8b5-cf950c1e598c, 0cb7b9ec-5336-483b-bc31-b15b5788de71, 0cd196ee-71bf-4fd6-a57c-b491ffd4fb1e, 0f698dd4-f011-4d23-a33e-b36416dcb1e6, 1150aefc-07de-4228-b2b2-042a536703c0, 11ba4a52-3159-44e1-93cd-d18e9443e3ef, 13937bba-652e-4c46-b222-3003f4d1ff97, 14d82eec-204b-4c2f-b7e8-296a70dab67e, 157cdfbf-7398-4a56-96c3-e93e9ab309b5, 16aeb910-ce68-41d1-9ac3-9e1673ac9575, 1786c5ed-9644-47b2-8aa0-7201292175b6, 17d5e35f-655b-4fb0-8ae6-86356e9a49f5, 18fbca16-2224-45f6-85b0-f7bf2b39b3f3, 1950a258-227b-4e31-a9cf-717495945fc2, 1b3c667f-cde3-4090-b60b-3d2abd0117f0, 1fec8e78-bce4-4aaf-ab1b-5451cc387264, 20a11fe0-faa8-4df5-baf2-f965f8f9972e, 23523755-3a2b-41ca-9315-f81f3f566a95, 243c63a3-247d-41c5-9d83-7788c43f1c43, 268761a2-03f3-40df-8a8b-c3db24145b6b, 26a7ee05-5602-4d76-a7ba-eae8b7b67941, 26abc9a8-24f0-4b11-8234-e86ede698878, 27922004-5251-4030-b22d-91ecd9a37ea4, 27b9c0f2-3d8e-4a1c-8b6f-5d7a0c6e1f2b, 28b567f6-162c-4f54-99a0-6887f387bbcc, 29d9ed98-a469-4536-ade2-f981bc1d605e, 2abdc806-e091-4495-9b10-b04d93c3f040, 2cee05de-2b8f-45a2-8289-2a06ca32c4c8, 2d4d3d8e-2be3-4bef-9f87-7875a61c29de, 2d7f3606-b07d-41d1-b9d2-0d0c9296a6e8, 2fd64745-b008-3e7d-4903-15d43e60f62a, 3090ab82-f1c1-4cdf-af2c-5d7a6f3e2cc7, 35d54a08-36c9-4847-9018-93934c62740c, 37182072-3c9c-4f6a-a4b3-b3f91cacffce, 38049638-cc2c-4cde-abe4-4479d721ed44, 3c896ded-22c5-450f-91f6-3d1ef0848f6e, 43375d74-c6a5-4d4e-a0a3-de139860ea75, 4345a7b9-9a63-4910-a426-35363201d503, 45a330b1-b1ec-4cc1-9161-9f03992aa49f, 464e0e4d-676a-4c3b-9f81-2ed9b2a9acd2, 4765445b-32c6-49b0-83e6-1d93765276ca, 497effe9-df71-4043-a8bb-14cf78c4b63b, 4b233688-031c-404b-9a80-a4f3f2351f90, 4d5c2d63-cf83-4365-853c-925fd1a64357, 51be292c-a17e-4f17-9a7e-4b661fb16dd2, 5572c4c0-d078-44ce-b81c-6cbf8d3ed39e, 5d661950-3475-41cd-a2c3-d671a3162bc1, 5e3ce6c0-2b1f-4285-8d4b-75ee78787346, 60c8bde5-3167-4f92-8fdb-059f6176dc0f, 61109738-7d2b-4a0b-9fe3-660b1ff83505, 62256cef-54c0-4cb4-bcac-4c67989bdc40, 6253bca8-faf2-4587-8f2f-b056d80998a7, 6326e366-9d6d-4c70-b22a-34c7ea72d73d, 65d91a3d-ab74-42e6-8a2f-0add61688c74, 66a88757-258c-4c72-893c-3e8bed4d6899, 67e3df25-268a-4324-a550-0de1c7f97287, 69893ee3-dd10-4b1c-832d-4870354be3d8, 74658136-14ec-4630-ad9b-26e160ff0fc6, 74bcdadc-2fdc-4bb3-8459-76d06952a0e9, 75efb5bc-18a1-4e7b-8a66-2ad2503d79c6, 75f31797-37c9-498e-8dc9-53c16a36afca, 797f4846-ba00-4fd7-ba43-dac1f8f63013, 7ab7862c-4c57-491e-8a45-d52a7e023983, 7ae974c5-1af7-4923-af3a-fb1fd14dcb7e, 7b7531ad-5926-4f2d-8a1d-38495ad33e17, 7fba38f4-ec1f-458d-906c-f4e3c4f41335, 80ccca67-54bd-44ab-8625-4b79c4dc7775, 82d8ab62-be52-a567-14ea-1616c4ee06c4, 835b2a73-6e10-4aa5-a979-21dfda45231c, 871c010f-5e61-4fb1-83ac-98610a7e9110, 89bee1f7-5e6e-4d8a-9f3d-ecd601259da7, 8acd33ea-7197-4a96-bc33-d7cc7101262f, 8edd93e1-2103-40b4-bd70-6e34e586362d, 905fcf26-4eb7-48a0-9ff0-8dcc7194b5ba, 9199bf20-a13f-4107-85dc-02114787ef48, 91ca2ca5-3b3e-41dd-ab65-809fa3dffffa, 93625bc8-bfe2-437a-97e0-3d0060024faa, 93d53678-613d-4013-afc1-62e9e444a0a5, 944f0bd1-117b-4b1c-af26-804ed95e767e, 94c63fef-13a3-47bc-8074-75af8c65887a, 95de633a-083e-42f5-b444-a4295d8e9314, 97cb1f73-50df-47d1-8fb0-0271f2728514, 98db8bd6-0cc0-4e67-9de5-f187f1cd1b41, 99b904fd-a1fe-455c-b86c-2f9fb1da7687, 9ea1ad79-fdb6-4f9a-8bc3-2b70f96e34c7, 9fd38622-d9b4-4401-b1b9-1ce14c5e435a, a3475900-ccec-4a69-98f5-a65cd5dc5306, a3883eba-fbe9-48bd-9ed3-dca3e0e84250, a3b79187-70b2-4139-83f9-6016c58cd27b, a40d7d7d-59aa-447e-a655-679a4107e548, a57aca87-cbc0-4f3c-8b9e-dc095fdc8978, a970bac6-63fe-4ec5-8884-8536862c42d4, a9b49b65-0a12-430b-9540-c80b3332c127, ab9b8c07-8f02-4f72-87fa-80105867a763, ae8e128e-080f-4086-b0e3-4c19301ada69, b23dd4db-9142-4734-867f-3577f640ad0c, b4bddae8-ab25-483e-8670-df09b9f1d0ea, b669c6ea-1adf-453f-b8bc-6d526592b419, b6e69c34-5f1f-4c34-8cdf-7fea120b8670, bb2a2e3a-c5e7-4f0a-88e0-8e01fd3fc1f4, bdd48c81-3a58-4ea9-849c-ebea7f6b6360, c1c74fed-04c9-4704-80dc-9f79a2e515cb, c35cb2ba-f88b-4d15-aa9d-37bd443522e1, c44b4083-3bb0-49c1-b47d-974e53cbdf3c, c9a559d2-7aab-4f13-a6ed-e7e9c52aec87, cc15fd57-2c6c-4117-a88c-83b1d56b4bbe, cf36b471-5b44-428c-9ce7-313bf84528de, cf53fce8-def6-4aeb-8d30-b158e7b1cf83, d176f6e7-38e5-40c9-8a78-3998aab820e7, d34dcd43-8519-44e4-827c-de79b767da47, d3590ed6-52b3-4102-aeff-aad2292ab01c, d396de1f-10d4-4023-aae2-5bb3d724ba9a, d71dfe16-1070-48f3-bd3a-c3ec919d34e7, d73f4b35-55c9-48c7-8b10-651f6f2acb2e, d9b8ec3a-1e4e-4e08-b3c2-5baf00c0fcb0, de8bc8b5-d9f9-48b1-a8ad-b748da725064, dfe74da8-9279-44ec-8fb2-2aed9e1c73d0, e1ef36fd-b883-4dbf-97f0-9ece4b576fc6, e64aa8bc-8eb4-40e2-898b-cf261a25954f, e9b154d0-7658-433b-bb25-6b8e0a8a7c59, e9f49c6b-5ce5-44c8-925d-015017e9f7ad, ee272b19-4411-433f-8f28-5c13cb6fd407, eed83176-464d-48c7-a887-cc5cc534c7b8, f5eaa862-7f08-448c-9c4e-f4047d4d4521, f8d98a96-0999-43f5-8af3-69971c7bb423, fb78d390-0c51-40cd-8e17-fdbfab77341b, fc0f3af4-6835-4174-b806-f7db311fd2f3, fdf9885b-dd37-42bf-82e5-c3129ef5a302, ffcb16e8-f789-467c-8ce9-f826a080d987 | excludes:o365.audit.ClientAppId |
Malicious Homebrew Initial Access
#Detects attempts to trick users into installing a malicious version of Homebrew that spoofs the official Homebrew installation url. This has been observed several times in the wild as a method of gaining initial access by adversaries and red teams alike.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Execution | |
| Command & Control |
Telemetry Coverage
Rule Body
[rule]
description = """
Detects attempts to trick users into installing a malicious version of Homebrew that spoofs the official Homebrew
installation url. This has been observed several times in the wild as a method of gaining initial access by adversaries
and red teams alike.
"""
id = "88cb5440-a3fd-465a-8fbf-3769df14a577"
license = "Elastic License v2"
name = "Malicious Homebrew Initial Access"
os_list = ["macos"]
version = "1.0.4"
query = '''
process where event.type == "start" and event.action == "exec" and process.name == "curl" and
process.args like~ "http*/Homebrew/install/HEAD/install.sh" and
not process.args like~ "https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh"
'''
min_endpoint_version = "8.16.0"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.parent.entity_id"
state = 0
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1204"
name = "User Execution"
reference = "https://attack.mitre.org/techniques/T1204/"
[threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1105"
name = "Ingress Tool Transfer"
reference = "https://attack.mitre.org/techniques/T1105/"
[threat.tactic]
id = "TA0011"
name = "Command and Control"
reference = "https://attack.mitre.org/tactics/TA0011/"
[internal]
min_endpoint_version = "8.16.0"
Stages and Predicates
Stage 1: process
process where event.type == "start" and event.action == "exec" and process.name == "curl" and
process.args like~ "http*/Homebrew/install/HEAD/install.sh" and
not process.args like~ "https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh"
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | eq |
| field:"EventType" kind:eq value:"exec" |
event.type | eq |
| field:"event.type" kind:eq value:"start" |
process.args | wildcard |
| field:"process.args" kind:wildcard value:"http*/Homebrew/install/HEAD/install.sh" |
process.name | eq |
| field:"process_basename" kind:eq value:"curl" |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.args | eq | https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh | excludes:process.args field:"process.args" value:"https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh" |
Multiple Distinct Ptrace POKETEXT/POKEDATA Writes
#This rule detects three PTRACE_POKETEXT/PTRACE_POKEDATA requests from one process against distinct addresses in another process within one second. Rapid writes to multiple target addresses through ptrace can indicate shellcode being copied into a target process and may occur during process injection.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Stealth |
Rule Body
[rule]
description = """
This rule detects three PTRACE_POKETEXT/PTRACE_POKEDATA requests from one process against distinct addresses in another
process within one second. Rapid writes to multiple target addresses through ptrace can indicate shellcode being copied
into a target process and may occur during process injection.
"""
id = "051e67fd-62f5-4b25-bcb5-06351114c9a9"
license = "Elastic License v2"
name = "Multiple Distinct Ptrace POKETEXT/POKEDATA Writes"
os_list = ["linux"]
reference = [
"https://man7.org/linux/man-pages/man2/ptrace.2.html",
"https://www.akamai.com/blog/security-research/the-definitive-guide-to-linux-process-injection",
]
version = "1.0.3"
query = '''
sequence by process.entity_id, process.Ext.ptrace.child_pid with maxspan=1s
[process where event.type == "start" and event.action == "ptrace" and process.Ext.ptrace.request in (4, 5) and
process.Ext.ptrace.addr >= 4096 and process.executable != null and
not process.executable like (
"/opt/dynatrace/oneagent/agent/lib64/oneagenthelper", "/usr/libexec/platform-python*",
"/usr/imperva/ragent/bin/InjectionManager", "/usr/bin/reptyr"
)
] as event0
[process where event.type == "start" and event.action == "ptrace" and process.Ext.ptrace.request in (4, 5) and
(process.Ext.ptrace.addr - event0.process.Ext.ptrace.addr) in (4, 8)] as event1
[process where event.type == "start" and event.action == "ptrace" and process.Ext.ptrace.request in (4, 5) and
(process.Ext.ptrace.addr - event1.process.Ext.ptrace.addr) in (4, 8)]
'''
min_endpoint_version = "9.1.4"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 1
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 2
[[actions]]
action = "kill_process"
field = "process.parent.entity_id"
state = 0
[[actions]]
action = "kill_process"
field = "process.parent.entity_id"
state = 1
[[actions]]
action = "kill_process"
field = "process.parent.entity_id"
state = 2
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1055"
name = "Process Injection"
reference = "https://attack.mitre.org/techniques/T1055/"
[[threat.technique.subtechnique]]
id = "T1055.008"
name = "Ptrace System Calls"
reference = "https://attack.mitre.org/techniques/T1055/008/"
[threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
[internal]
min_endpoint_version = "9.1.4"
Stages and Predicates
Ordered sequence: each step below must occur in order within 1s, correlated by process.Ext.ptrace.child_pid, process.entity_id.
Stage 1: process
[process where event.type == "start" and event.action == "ptrace" and process.Ext.ptrace.request in (4, 5) and
process.Ext.ptrace.addr >= 4096 and process.executable != null and
not process.executable like (
"/opt/dynatrace/oneagent/agent/lib64/oneagenthelper", "/usr/libexec/platform-python*",
"/usr/imperva/ragent/bin/InjectionManager", "/usr/bin/reptyr"
)
] as event0
Stage 2: process
[process where event.type == "start" and event.action == "ptrace" and process.Ext.ptrace.request in (4, 5) and
(process.Ext.ptrace.addr - event0.process.Ext.ptrace.addr) in (4, 8)] as event1
Stage 3: process
[process where event.type == "start" and event.action == "ptrace" and process.Ext.ptrace.request in (4, 5) and
(process.Ext.ptrace.addr - event1.process.Ext.ptrace.addr) in (4, 8)]
Indicators
These rows show field, operator, and value matches.
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.executable | wildcard | /opt/dynatrace/oneagent/agent/lib64/oneagenthelper, /usr/libexec/platform-python*, /usr/imperva/ragent/bin/InjectionManager, /usr/bin/reptyr | excludes:process.executable |
Newly Observed Process Exhibiting High CPU Usage
#This rule alerts on processes exhibiting high CPU usage and that are observed for the first time in the previous 5 days. A previously unseen process consuming sustained CPU resources may indicate suspicious activity such as cryptomining, exploit payload execution, or other forms of resource abuse following host compromise. In some cases, this may also surface legitimate but unexpected software causing performance degradation.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Impact |
Rule Body
[metadata]
creation_date = "2026/01/27"
maturity = "production"
updated_date = "2026/01/27"
[rule]
author = ["Elastic"]
description = """
This rule alerts on processes exhibiting high CPU usage and that are observed for the first time in the previous 5 days.
A previously unseen process consuming sustained CPU resources may indicate suspicious activity such as cryptomining,
exploit payload execution, or other forms of resource abuse following host compromise. In some cases, this may also
surface legitimate but unexpected software causing performance degradation.
"""
from = "now-7205m"
interval = "5m"
language = "esql"
license = "Elastic License v2"
name = "Newly Observed Process Exhibiting High CPU Usage"
setup = """## Setup
This rule requires host CPU metrics collected via the Elastic Agent **System** integration.
### System Metrics Integration Setup
The System integration collects host-level metrics such as CPU usage, load, memory, and process statistics and sends them to Elasticsearch using Elastic Agent.
#### Prerequisite Requirements:
- Elastic Agent managed by Fleet
- A Fleet Server configured and reachable
Refer to the Fleet Server setup guide:
https://www.elastic.co/guide/en/fleet/current/fleet-server.html
#### The following steps should be executed in order to enable CPU metrics collection:
- Go to the Kibana home page and click **Add integrations**.
- In the search bar, enter **System** and select the **System** integration.
- Click **Add System**.
- Configure an integration name and optionally add a description.
- Under **Metrics**, ensure the following datasets are enabled:
- `system.cpu`
- `system.load` (optional but recommended)
- `system.process` (optional, if process-level CPU is required)
- Review optional and advanced settings as needed.
- Add the integration to an existing agent policy or create a new agent policy.
- Deploy the Elastic Agent to the hosts from which CPU metrics should be collected.
- Click **Save and Continue** to finalize the setup.
#### Validation
After deployment, verify CPU metrics ingestion by confirming the presence of documents in:
- `metrics-system.cpu-*`
- `metrics-system.load-*` (if enabled)
For more details on the System integration and available metrics, refer to the documentation:
https://docs.elastic.co/integrations/system
"""
risk_score = 73
rule_id = "f9de0949-94d8-441d-ae9a-8eb1e040acf2"
severity = "high"
tags = [
"Use Case: Threat Detection",
"Use Case: Observavility",
"Resources: Investigation Guide",
"Domain: Endpoint",
"Tactic: Impact"
]
timestamp_override = "event.ingested"
type = "esql"
query = '''
FROM metrics-*
// more than 90% CPU use
| WHERE system.process.cpu.total.norm.pct >= 0.9 and process.name is not null
| STATS Esql.total_count = count(*),
Esql.first_time_seen = MIN(@timestamp),
Esql.agent_id_values = COUNT_DISTINCT(agent.id),
Esql.system_process_cpu_total_norm_pct_values = MAX(system.process.cpu.total.norm.pct),
Esql.process_command_line_values = VALUES(process.command_line),
Esql.host_id_values = values(host.id),
Esql.user_name_values = VALUES(user.name) by process.name
| eval Esql.recent = DATE_DIFF("minute", Esql.first_time_seen, now())
// first time seen is within 6m of the rule execution time and first seen in the last 5 days as per the rule from schedule and limited to 1 unique hostg
| where Esql.recent <= 6 and Esql.agent_id_values == 1
// populate fields for rule exception
| eval host.id = MV_FIRST(Esql.host_id_values),
process.command_line = MV_FIRST(Esql.process_command_line_values)
| keep host.id, process.name, process.command_line, Esql.*
'''
note = """## Triage and analysis
### Investigating Newly Observed Process Exhibiting High CPU Usage
This rule alerts on processes exhibiting high CPU usage and that are observed for the first time in the previous 5 days.
### Possible investigation steps
- Examine the process name, command line, and SHA-256 hash to determine whether the process is expected or known to be malicious.
- Validate the observed CPU usage and duration to determine whether the spike is abnormal for this process and host.
- Check for related process activity such as parent/child processes, suspicious process spawning, or privilege escalation attempts.
- Review additional host telemetry including:
- Network connections initiated by the process
- File creation or modification events
- Persistence mechanisms (services, scheduled tasks, registry keys)
- Determine whether similar activity is observed on other hosts, which may indicate a broader compromise.
### False positive analysis
- Legitimate high-CPU processes such as software updates, backup agents, security scans, or system maintenance tasks.
- Resource-intensive but benign applications (e.g., compilers, video encoding, data processing jobs).
- Security tools or monitoring agents temporarily consuming high CPU.
### Related Rules
- Detection Alert on a Process Exhibiting CPU Spike - df9c0e92-5dee-4f1d-a760-3a5c039e4382
- Multiple Alerts on a Host Exhibiting CPU Spike - b7f77c3c-1bcb-4afc-9ace-49357007947b
### Response and remediation
- If malicious activity is confirmed, isolate the affected host to prevent further impact.
- Terminate the offending process if safe to do so.
- Remove any identified malicious binaries or artifacts and eliminate persistence mechanisms.
- Apply relevant patches or configuration changes to remediate the root cause.
- Monitor the environment for recurrence of similar high-CPU processes combined with security alerts.
- Escalate the incident if multiple hosts or indicators suggest coordinated or widespread activity."""
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1496"
name = "Resource Hijacking"
reference = "https://attack.mitre.org/techniques/T1496/"
[[rule.threat.technique.subtechnique]]
id = "T1496.001"
name = "Compute Hijacking"
reference = "https://attack.mitre.org/techniques/T1496/001/"
[rule.threat.tactic]
id = "TA0040"
name = "Impact"
reference = "https://attack.mitre.org/tactics/TA0040/"
Stages and Predicates
Stage 1: from
FROM metrics-*
Stage 2: where
| WHERE system.process.cpu.total.norm.pct >= 0.9 and process.name is not null
Stage 3: stats
| STATS Esql.total_count = count(*),
Esql.first_time_seen = MIN(@timestamp),
Esql.agent_id_values = COUNT_DISTINCT(agent.id),
Esql.system_process_cpu_total_norm_pct_values = MAX(system.process.cpu.total.norm.pct),
Esql.process_command_line_values = VALUES(process.command_line),
Esql.host_id_values = values(host.id),
Esql.user_name_values = VALUES(user.name) by process.name
Stage 4: eval
| eval Esql.recent = DATE_DIFF("minute", Esql.first_time_seen, now())
Stage 5: where
| where Esql.recent <= 6 and Esql.agent_id_values == 1
Stage 6: eval
| eval host.id = MV_FIRST(Esql.host_id_values),
process.command_line = MV_FIRST(Esql.process_command_line_values)
Stage 7: keep
| keep host.id, process.name, process.command_line, Esql.*
Indicators
These rows show field, operator, and value matches.
Output Fields
These fields are emitted when the rule matches.
| Field | Source |
|---|---|
host.id | KEEP host.id |
process.name | KEEP process.name |
process.command_line | KEEP process.command_line |
Esql.* | KEEP Esql.* |
Potential Cloud Credential Harvesting via Bun
#Detects execution of common cloud and DevOps CLI commands used to print or export access tokens, often as a child of a Bun process. This pattern may indicate supply chain compromise where a malicious npm or Bun package invokes host CLIs to harvest cloud credentials during install or runtime scripts.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Initial Access | |
| Credential Access |
Rule Body
[rule]
description = """
Detects execution of common cloud and DevOps CLI commands used to print or export access tokens, often as a child of a
Bun process. This pattern may indicate supply chain compromise where a malicious npm or Bun package invokes host CLIs to
harvest cloud credentials during install or runtime scripts.
"""
id = "a8c3e891-4f2d-4b7e-9c1a-6e5d8b2f0a43"
license = "Elastic License v2"
name = "Potential Cloud Credential Harvesting via Bun"
os_list = ["linux", "windows"]
reference = [
"https://futuresearch.ai/blog/litellm-pypi-supply-chain-attack/",
"https://socket.dev/blog/sandworm-mode-npm-worm-ai-toolchain-poisoning",
"https://www.koi.security/blog/postmark-mcp-npm-malicious-backdoor-email-theft",
]
version = "1.0.3"
query = '''
process where event.type == "start" and event.action in ("start", "exec") and
process.parent.name : ("bun", "bun.exe") and process.parent.command_line : ("*.js", "*.mjs", "*.ts") and
process.command_line like~ (
"*gcloud config config-helper --format json*",
"*gh auth token*",
"*az account get-access-token*",
"*kubectl*get*secret*"
) and
not process.args in ("az account get-access-token --output json --resource https://database.windows.net", "az account get-access-token --output json --resource https://storage.azure.com", "https://storage.azure.com")
'''
min_endpoint_version = "7.15.0"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.parent.entity_id"
state = 0
tree = true
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1195"
name = "Supply Chain Compromise"
reference = "https://attack.mitre.org/techniques/T1195/"
[[threat.technique.subtechnique]]
id = "T1195.001"
name = "Compromise Software Dependencies and Development Tools"
reference = "https://attack.mitre.org/techniques/T1195/001/"
[threat.tactic]
id = "TA0001"
name = "Initial Access"
reference = "https://attack.mitre.org/tactics/TA0001/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1528"
name = "Steal Application Access Token"
reference = "https://attack.mitre.org/techniques/T1528/"
[[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 = "7.15.0"
Stages and Predicates
Stage 1: process
process where event.type == "start" and event.action in ("start", "exec") and
process.parent.name : ("bun", "bun.exe") and process.parent.command_line : ("*.js", "*.mjs", "*.ts") and
process.command_line like~ (
"*gcloud config config-helper --format json*",
"*gh auth token*",
"*az account get-access-token*",
"*kubectl*get*secret*"
) and
not process.args in ("az account get-access-token --output json --resource https://database.windows.net", "az account get-access-token --output json --resource https://storage.azure.com", "https://storage.azure.com")
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | in |
| field:"EventType" kind:in |
event.type | eq |
| field:"event.type" kind:eq value:"start" |
process.command_line | wildcard |
| field:"CommandLine" kind:wildcard |
process.parent.command_line | wildcard |
| field:"ParentCommandLine" kind:wildcard |
process.parent.name | wildcard |
| field:"parent_process_basename" kind:wildcard |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.args | in | az account get-access-token --output json --resource https://database.windows.net, az account get-access-token --output json --resource https://storage.azure.com, https://storage.azure.com | excludes:process.args field:"process.args" value:"az account get-access-token --output json --resource https://database.windows.net" field:"process.args" value:"az account get-access-token --output json --resource https://storage.azure.com" field:"process.args" value:"https://storage.azure.com" |
Potential Memory Dumping via dd
#This rule detects the use of the "dd" command to read from the "/proc/<pid>/mem" file. This activity can be used to dump the memory of a running process, which can potentially include sensitive information such as credentials.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Credential Access |
Rule Body
[rule]
description = """
This rule detects the use of the "dd" command to read from the "/proc/<pid>/mem" file. This activity can be used to dump
the memory of a running process, which can potentially include sensitive information such as credentials.
"""
id = "966563fe-fabd-4e74-a20b-1dfca2218aa2"
license = "Elastic License v2"
name = "Potential Memory Dumping via dd"
os_list = ["linux"]
reference = ["https://github.com/huntergregal/mimipenguin"]
version = "1.0.3"
query = '''
process where event.type == "start" and event.action == "exec" and process.name == "dd" and process.args like "if=/proc/*/mem*"
'''
min_endpoint_version = "7.15.0"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
tree = true
[[actions]]
action = "kill_process"
field = "process.parent.entity_id"
state = 0
tree = true
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1003"
name = "OS Credential Dumping"
reference = "https://attack.mitre.org/techniques/T1003/"
[[threat.technique.subtechnique]]
id = "T1003.007"
name = "Proc Filesystem"
reference = "https://attack.mitre.org/techniques/T1003/007/"
[[threat.technique]]
id = "T1212"
name = "Exploitation for Credential Access"
reference = "https://attack.mitre.org/techniques/T1212/"
[threat.tactic]
id = "TA0006"
name = "Credential Access"
reference = "https://attack.mitre.org/tactics/TA0006/"
[internal]
min_endpoint_version = "7.15.0"
Stages and Predicates
Stage 1: process
process where event.type == "start" and event.action == "exec" and process.name == "dd" and process.args like "if=/proc/*/mem*"
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | eq |
| field:"EventType" kind:eq value:"exec" |
event.type | eq |
| field:"event.type" kind:eq value:"start" |
process.args | wildcard |
| field:"process.args" kind:wildcard value:"if=/proc/*/mem*" |
process.name | eq |
| field:"process_basename" kind:eq value:"dd" |
Potential Memory Seeking Activity
#Monitors for the execution of Unix utilities that may be leveraged as memory address seekers. Attackers may leverage built-in utilities to seek specific memory addresses, allowing for potential future manipulation/exploitation.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Discovery | |
| Collection |
Rule Body
[metadata]
bypass_bbr_timing = true
creation_date = "2024/02/01"
integration = ["endpoint"]
maturity = "production"
updated_date = "2026/03/24"
[rule]
author = ["Elastic"]
building_block_type = "default"
description = """
Monitors for the execution of Unix utilities that may be leveraged as memory address seekers. Attackers may leverage
built-in utilities to seek specific memory addresses, allowing for potential future manipulation/exploitation.
"""
from = "now-9m"
index = ["logs-endpoint.events.*", "endgame-*"]
language = "eql"
license = "Elastic License v2"
name = "Potential Memory Seeking Activity"
references = ["https://github.com/arget13/DDexec"]
risk_score = 21
rule_id = "035a6f21-4092-471d-9cda-9e379f459b1e"
severity = "low"
tags = [
"Domain: Endpoint",
"OS: Linux",
"Use Case: Threat Detection",
"Tactic: Discovery",
"Rule Type: BBR",
"Data Source: Elastic Defend",
"Data Source: Elastic Endgame",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
process where host.os.type == "linux" and event.type == "start" and event.action in ("exec", "exec_event") and (
(process.name == "tail" and process.args in ("-c", "--bytes")) or
(process.name == "cmp" and process.args == "-i") or
(process.name in ("hexdump", "xxd") and process.args == "-s") or
(process.name == "dd" and process.args : ("skip*", "seek*"))
) and not (
process.parent.args like ("/opt/error_monitor/error_monitor.sh", "printf*", "/sbin/dracut") or
process.parent.name in ("acme.sh", "dracut", "leapp") or
process.parent.executable like (
"/bin/cagefs_enter", "/opt/nessus_agent/sbin/nessus-service", "/usr/libexec/platform-python*",
"/usr/libexec/vdsm/vdsmd", "/usr/local/bin/docker-entrypoint.sh", "/usr/lib/module-init-tools/lsinitrd-quick",
"/usr/bin/unmkinitramfs", "/usr/bin/lsinitramfs", "/opt/msp-agent/msp-agent-core.run",
"/usr/local/cloudamize/bin/register.sh", "/usr/local/hestia/bin/v-log-action", "/usr/local/emps/bin/php"
) or
process.parent.command_line like "sh*acme.sh*" or
process.args like ("/var/tmp/dracut*", "/opt/bitdefender-security-tools/var/log/script_update.log") or
?process.working_directory like (
"/usr/local/nutanix/ngt/python/bin", "/var/lib/waagent/*", "/opt/Tychon/Endpoint/bin",
"/usr/local/cloudamize/bin", "/opt/sentinelone/bin"
) or
process.command_line in ("tail -c 1", "tail -c 2") or
(process.command_line == "dd ibs=18850 skip=1 count=1" and process.parent.args == "/opt/msp-agent/msp-agent-core.run")
)
'''
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1057"
name = "Process Discovery"
reference = "https://attack.mitre.org/techniques/T1057/"
[rule.threat.tactic]
id = "TA0007"
name = "Discovery"
reference = "https://attack.mitre.org/tactics/TA0007/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1005"
name = "Data from Local System"
reference = "https://attack.mitre.org/techniques/T1005/"
[rule.threat.tactic]
id = "TA0009"
name = "Collection"
reference = "https://attack.mitre.org/tactics/TA0009/"
Stages and Predicates
Stage 1: process
process where host.os.type == "linux" and event.type == "start" and event.action in ("exec", "exec_event") and (
(process.name == "tail" and process.args in ("-c", "--bytes")) or
(process.name == "cmp" and process.args == "-i") or
(process.name in ("hexdump", "xxd") and process.args == "-s") or
(process.name == "dd" and process.args : ("skip*", "seek*"))
) and not (
process.parent.args like ("/opt/error_monitor/error_monitor.sh", "printf*", "/sbin/dracut") or
process.parent.name in ("acme.sh", "dracut", "leapp") or
process.parent.executable like (
"/bin/cagefs_enter", "/opt/nessus_agent/sbin/nessus-service", "/usr/libexec/platform-python*",
"/usr/libexec/vdsm/vdsmd", "/usr/local/bin/docker-entrypoint.sh", "/usr/lib/module-init-tools/lsinitrd-quick",
"/usr/bin/unmkinitramfs", "/usr/bin/lsinitramfs", "/opt/msp-agent/msp-agent-core.run",
"/usr/local/cloudamize/bin/register.sh", "/usr/local/hestia/bin/v-log-action", "/usr/local/emps/bin/php"
) or
process.parent.command_line like "sh*acme.sh*" or
process.args like ("/var/tmp/dracut*", "/opt/bitdefender-security-tools/var/log/script_update.log") or
?process.working_directory like (
"/usr/local/nutanix/ngt/python/bin", "/var/lib/waagent/*", "/opt/Tychon/Endpoint/bin",
"/usr/local/cloudamize/bin", "/opt/sentinelone/bin"
) or
process.command_line in ("tail -c 1", "tail -c 2") or
(process.command_line == "dd ibs=18850 skip=1 count=1" and process.parent.args == "/opt/msp-agent/msp-agent-core.run")
)
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | in |
| field:"EventType" kind:in |
event.type | eq |
| field:"event.type" kind:eq value:"start" |
process.args | eq |
| field:"process.args" kind:eq |
process.args | in |
| field:"process.args" kind:in |
process.args | wildcard |
| field:"process.args" kind:wildcard |
process.name | eq |
| field:"process_basename" kind:eq |
process.name | in |
| field:"process_basename" kind:in |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.command_line | eq | dd ibs=18850 skip=1 count=1 | excludes:process.command_line field:"process.command_line" value:"dd ibs=18850 skip=1 count=1" |
process.parent.args | eq | /opt/msp-agent/msp-agent-core.run | excludes:process.parent.args field:"process.parent.args" value:"/opt/msp-agent/msp-agent-core.run" |
process.args | wildcard | /var/tmp/dracut*, /opt/bitdefender-security-tools/var/log/script_update.log | excludes:process.args field:"process.args" value:"/var/tmp/dracut*" field:"process.args" value:"/opt/bitdefender-security-tools/var/log/script_update.log" |
process.command_line | in | tail -c 1, tail -c 2 | excludes:process.command_line field:"process.command_line" value:"tail -c 1" field:"process.command_line" value:"tail -c 2" |
process.parent.args | wildcard | /opt/error_monitor/error_monitor.sh, printf*, /sbin/dracut | excludes:process.parent.args field:"process.parent.args" value:"/opt/error_monitor/error_monitor.sh" field:"process.parent.args" value:"printf*" field:"process.parent.args" value:"/sbin/dracut" |
process.parent.command_line | wildcard | sh*acme.sh* | excludes:process.parent.command_line field:"process.parent.command_line" value:"sh*acme.sh*" |
process.parent.executable | wildcard | /bin/cagefs_enter, /opt/nessus_agent/sbin/nessus-service, /usr/libexec/platform-python*, /usr/libexec/vdsm/vdsmd, /usr/local/bin/docker-entrypoint.sh, /usr/lib/module-init-tools/lsinitrd-quick, /usr/bin/unmkinitramfs, /usr/bin/lsinitramfs, /opt/msp-agent/msp-agent-core.run, /usr/local/cloudamize/bin/register.sh, /usr/local/hestia/bin/v-log-action, /usr/local/emps/bin/php | excludes:process.parent.executable |
process.parent.name | in | acme.sh, dracut, leapp | excludes:process.parent.name field:"process.parent.name" value:"acme.sh" field:"process.parent.name" value:"dracut" field:"process.parent.name" value:"leapp" |
process.working_directory | wildcard | /usr/local/nutanix/ngt/python/bin, /var/lib/waagent/*, /opt/Tychon/Endpoint/bin, /usr/local/cloudamize/bin, /opt/sentinelone/bin | excludes:process.working_directory |
Potential Persistence via Periodic Tasks
#Identifies the creation or modification of the default configuration for periodic tasks. Adversaries may abuse periodic tasks to execute malicious code or maintain persistence.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Persistence |
Telemetry Coverage
| Platform | Record / event type |
|---|---|
| macOS | ESF event write (NOTIFY): Fires after a process writes data to a file. |
Rule Body
[metadata]
creation_date = "2021/01/21"
integration = ["endpoint"]
maturity = "production"
updated_date = "2025/03/18"
[rule]
author = ["Elastic"]
description = """
Identifies the creation or modification of the default configuration for periodic tasks. Adversaries may abuse periodic
tasks to execute malicious code or maintain persistence.
"""
from = "now-9m"
index = ["logs-endpoint.events.*"]
language = "eql"
license = "Elastic License v2"
name = "Potential Persistence via Periodic Tasks"
references = [
"https://opensource.apple.com/source/crontabs/crontabs-13/private/etc/defaults/periodic.conf.auto.html",
"https://www.oreilly.com/library/view/mac-os-x/0596003706/re328.html",
"https://github.com/D00MFist/PersistentJXA/blob/master/PeriodicPersist.js",
]
risk_score = 21
rule_id = "48ec9452-e1fd-4513-a376-10a1a26d2c83"
setup = """## Setup
This rule requires data coming in from Elastic Defend.
### Elastic Defend Integration Setup
Elastic Defend is integrated into the Elastic Agent using Fleet. Upon configuration, the integration allows the Elastic Agent to monitor events on your host and send data to the Elastic Security app.
#### Prerequisite Requirements:
- Fleet is required for Elastic Defend.
- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).
#### The following steps should be executed in order to add the Elastic Defend integration on a macOS System:
- Go to the Kibana home page and click "Add integrations".
- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.
- Click "Add Elastic Defend".
- Configure the integration name and optionally add a description.
- Select the type of environment you want to protect, for MacOS it is recommended to select "Traditional Endpoints".
- Select a configuration preset. Each preset comes with different default settings for Elastic Agent, you can further customize these later by configuring the Elastic Defend integration policy. [Helper guide](https://www.elastic.co/guide/en/security/current/configure-endpoint-integration-policy.html).
- We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"
- Enter a name for the agent policy in "New agent policy name". If other agent policies already exist, you can click the "Existing hosts" tab and select an existing policy instead.
For more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/current/agent-policy.html).
- Click "Save and Continue".
- To complete the integration, select "Add Elastic Agent to your hosts" and continue to the next section to install the Elastic Agent on your hosts.
For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
"""
severity = "low"
tags = [
"Domain: Endpoint",
"OS: macOS",
"Use Case: Threat Detection",
"Tactic: Persistence",
"Data Source: Elastic Defend",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
file where host.os.type == "macos" and event.action == "modification" and
file.path like ("/private/etc/periodic/*", "/private/etc/defaults/periodic.conf", "/private/etc/periodic.conf")
'''
note = """## Triage and analysis
> **Disclaimer**:
> This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.
### Investigating Potential Persistence via Periodic Tasks
Periodic tasks in macOS are scheduled operations that automate system maintenance and other routine activities. Adversaries may exploit these tasks to execute unauthorized code or maintain persistence by altering task configurations. The detection rule identifies suspicious file activities related to periodic task configurations, excluding deletions, to flag potential misuse. This helps in early detection of persistence mechanisms employed by attackers.
### Possible investigation steps
- Review the file path specified in the alert to determine which configuration file was created or modified. Focus on paths like /private/etc/periodic/*, /private/etc/defaults/periodic.conf, or /private/etc/periodic.conf.
- Examine the contents of the modified or newly created configuration file to identify any unauthorized or suspicious entries that could indicate malicious activity.
- Check the timestamp of the file modification or creation to correlate with any known suspicious activities or other alerts in the same timeframe.
- Investigate the user account and process responsible for the file modification to determine if it aligns with expected behavior or if it indicates potential compromise.
- Look for any related events in the system logs that might provide additional context or evidence of unauthorized access or persistence attempts.
- Assess the risk and impact of the changes by determining if the modified periodic task could execute malicious code or provide persistence for an attacker.
### False positive analysis
- Routine system updates or maintenance scripts may trigger alerts when they modify periodic task configurations. Users can create exceptions for known update processes by identifying their specific file paths or process names.
- Administrative tools or scripts used by IT departments for legitimate system management might alter periodic task settings. To mitigate this, users should whitelist these tools by verifying their source and ensuring they are part of authorized IT operations.
- Custom user scripts for personal automation tasks could be flagged if they modify periodic task configurations. Users should document and exclude these scripts by adding them to an exception list, ensuring they are reviewed and approved for legitimate use.
- Security software or monitoring tools that adjust system settings for protection purposes might inadvertently trigger the rule. Users should verify these tools' activities and exclude them if they are confirmed to be part of the security infrastructure.
### Response and remediation
- Isolate the affected macOS system from the network to prevent potential lateral movement or further execution of unauthorized code.
- Review the identified periodic task configuration files for unauthorized modifications or additions. Restore any altered files to their original state using known good backups.
- Conduct a thorough scan of the affected system using updated antivirus and anti-malware tools to identify and remove any malicious code that may have been executed through the periodic tasks.
- Check for any additional persistence mechanisms that may have been established by the adversary, such as other scheduled tasks or startup items, and remove them.
- Monitor the system and network for any signs of continued unauthorized activity or attempts to re-establish persistence.
- Escalate the incident to the security operations team for further investigation and to determine if other systems may be affected.
- Implement enhanced monitoring and alerting for changes to periodic task configurations to quickly detect similar threats in the future."""
[[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.003"
name = "Cron"
reference = "https://attack.mitre.org/techniques/T1053/003/"
[rule.threat.tactic]
id = "TA0003"
name = "Persistence"
reference = "https://attack.mitre.org/tactics/TA0003/"
Stages and Predicates
Stage 1: file
file where host.os.type == "macos" and event.action == "modification" and
file.path like ("/private/etc/periodic/*", "/private/etc/defaults/periodic.conf", "/private/etc/periodic.conf")
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | eq |
| field:"EventType" kind:eq value:"modification" |
file.path | wildcard |
| field:"TargetFilename" kind:wildcard |
Potential Process Creation via Direct Syscall
#Identifies the creation of a process with parent call stack not starting with Windows NT syscall DLLs such as ntdll and win32u. This may indicate the use of direct system calls to evade endpoint security solutions hooking Windows APIs.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Stealth |
Rule Body
[rule]
description = """
Identifies the creation of a process with parent call stack not starting with Windows NT syscall DLLs such as ntdll and
win32u. This may indicate the use of direct system calls to evade endpoint security solutions hooking Windows APIs.
"""
id = "c1738eb3-e6dd-4e84-bc52-b4d48d1fca8f"
license = "Elastic License v2"
name = "Potential Process Creation via Direct Syscall"
os_list = ["windows"]
reference = [
"https://www.elastic.co/security-labs/upping-the-ante-detecting-in-memory-threats-with-kernel-call-stacks",
"https://www.ired.team/offensive-security/defense-evasion/using-syscalls-directly-from-visual-studio-to-bypass-avs-edrs",
]
version = "1.0.23"
query = '''
process where event.action == "start" and
process.parent.thread.Ext.call_stack_summary : "Unbacked|?*" and
not (process.parent.thread.Ext.call_stack_summary : "Unbacked|embeddedbrowserwebview.dll|Unbacked" and
_arraysearch(process.parent.thread.Ext.call_stack, $entry, $entry.symbol_info : "?:\\Program Files*\\Microsoft\\EdgeWebView\\*\\EmbeddedBrowserWebView.dll*")) and
not (process.code_signature.subject_name in~ ("BYFRON TECHNOLOGIES LLC", "Valve Corp.", "Sony Interactive Entertainment LLC", "Roblox Corporation") and process.code_signature.trusted == true) and
not process.parent.executable : "?:\\Program Files\\WindowsApps\\ROBLOXCORPORATION.ROBLOX_*\\Windows10Universal.exe" and
not (process.parent.code_signature.subject_name == "Roblox Corporation" and process.parent.code_signature.trusted == true) and
not (process.code_signature.subject_name == "Roblox Corporation" and process.code_signature.trusted == true) and
not (process.parent.thread.Ext.call_stack_summary like "Unbacked|cymemdef64.dll|*" and
_arraysearch(process.parent.thread.Ext.call_stack, $entry, $entry.symbol_info like "C:\\Program Files\\Cylance\\Desktop\\CyMemDef64.dll*")) and
not (process.executable : "C:\\ProgramData\\Sony Interactive Entertainment Inc\\PSPC_SDK\\*\\crashpad_handler.exe" and
process.parent.thread.Ext.call_stack_summary == "Unbacked|kernelbase.dll|kernel32.dll|gameoverlayrenderer64.dll|Unbacked")
'''
min_endpoint_version = "8.10.0"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1055"
name = "Process Injection"
reference = "https://attack.mitre.org/techniques/T1055/"
[threat.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: process
process where event.action == "start" and
process.parent.thread.Ext.call_stack_summary : "Unbacked|?*" and
not (process.parent.thread.Ext.call_stack_summary : "Unbacked|embeddedbrowserwebview.dll|Unbacked" and
_arraysearch(process.parent.thread.Ext.call_stack, $entry, $entry.symbol_info : "?:\\Program Files*\\Microsoft\\EdgeWebView\\*\\EmbeddedBrowserWebView.dll*")) and
not (process.code_signature.subject_name in~ ("BYFRON TECHNOLOGIES LLC", "Valve Corp.", "Sony Interactive Entertainment LLC", "Roblox Corporation") and process.code_signature.trusted == true) and
not process.parent.executable : "?:\\Program Files\\WindowsApps\\ROBLOXCORPORATION.ROBLOX_*\\Windows10Universal.exe" and
not (process.parent.code_signature.subject_name == "Roblox Corporation" and process.parent.code_signature.trusted == true) and
not (process.code_signature.subject_name == "Roblox Corporation" and process.code_signature.trusted == true) and
not (process.parent.thread.Ext.call_stack_summary like "Unbacked|cymemdef64.dll|*" and
_arraysearch(process.parent.thread.Ext.call_stack, $entry, $entry.symbol_info like "C:\\Program Files\\Cylance\\Desktop\\CyMemDef64.dll*")) and
not (process.executable : "C:\\ProgramData\\Sony Interactive Entertainment Inc\\PSPC_SDK\\*\\crashpad_handler.exe" and
process.parent.thread.Ext.call_stack_summary == "Unbacked|kernelbase.dll|kernel32.dll|gameoverlayrenderer64.dll|Unbacked")
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | eq |
| field:"EventType" kind:eq value:"start" |
process.parent.thread.Ext.call_stack_summary | wildcard |
| field:"process.parent.thread.Ext.call_stack_summary" kind:wildcard value:"Unbacked|?*" |
Exclusions
The rule actively suppresses these predicates.
Potential Protocol Tunneling via Cloudflared
#Identifies the use of Cloudflare Tunnel (cloudflared) to expose a local service or create an outbound tunnel. Adversaries may abuse quick tunnels (e.g. tunnel --url http://127.0.0.1:80) or named tunnels to proxy C2 traffic or exfiltrate data through Cloudflare's edge while evading direct connection blocking.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Command & Control |
Telemetry Coverage
| Provider | Record / event type |
|---|---|
| Sysmon | Event ID 1: Process creation |
| Security-Auditing | Event ID 4688: A new process has been created. |
Rule Body
[metadata]
creation_date = "2026/03/18"
integration = ["endpoint", "windows", "sentinel_one_cloud_funnel", "m365_defender", "system", "crowdstrike"]
maturity = "production"
updated_date = "2026/05/04"
[rule]
author = ["Elastic"]
description = """
Identifies the use of Cloudflare Tunnel (cloudflared) to expose a local service or create an outbound tunnel. Adversaries
may abuse quick tunnels (e.g. tunnel --url http://127.0.0.1:80) or named tunnels to proxy C2 traffic or exfiltrate data
through Cloudflare's edge while evading direct connection blocking.
"""
from = "now-9m"
index = [
"endgame-*",
"logs-crowdstrike.fdr*",
"logs-endpoint.events.process-*",
"logs-m365_defender.event-*",
"logs-sentinel_one_cloud_funnel.*",
"logs-system.security*",
"logs-windows.sysmon_operational-*",
"winlogbeat-*",
]
language = "eql"
license = "Elastic License v2"
name = "Potential Protocol Tunneling via Cloudflared"
note = """## Triage and analysis
### Investigating Potential Protocol Tunneling via Cloudflared
Cloudflare Tunnel (cloudflared) is a legitimate tool for exposing local services through Cloudflare's edge. Adversaries abuse it to create quick or named tunnels for C2, data exfiltration, or ingress tool transfer while evading direct connection blocking.
### Possible investigation steps
- Confirm the process command line for `tunnel`, `--url`, or `tunnel run` to validate cloudflared tunnel usage.
- Identify the parent process and process executable path; cloudflared run from temp or user writable locations is more suspicious than from Program Files.
- For quick tunnel (`--url http://...`), identify the local URL and whether it could be a C2 callback or proxy.
- Correlate with network data for outbound connections to Cloudflare IPs or trycloudflare.com-style hostnames around the same time.
- Review the user and session that started the tunnel; look for other suspicious logon or execution from the same context.
### False positive analysis
- Legitimate use of Cloudflare Tunnel for development or internal services may trigger this rule; consider allowlisting by path or user for approved use cases.
### Response and remediation
- If unauthorized tunnel use is confirmed: isolate the host, terminate the cloudflared process, and block cloudflared or Cloudflare tunnel domains at DNS/firewall where policy permits.
- Rotate credentials for any accounts that may have been exposed over the tunnel.
"""
setup = """## Setup
This rule is designed for data generated by [Elastic Defend](https://www.elastic.co/security/endpoint-security), which provides native endpoint detection and response, along with event enrichments designed to work with our detection rules.
Setup instructions: https://ela.st/install-elastic-defend
### Additional data sources
This rule also supports the following third-party data sources. For setup instructions, refer to the links below:
- [CrowdStrike](https://ela.st/crowdstrike-integration)
- [Microsoft Defender XDR](https://ela.st/m365-defender)
- [SentinelOne Cloud Funnel](https://ela.st/sentinel-one-cloud-funnel)
- [Sysmon Event ID 1 - Process Creation](https://ela.st/sysmon-event-1-setup)
- [Windows Process Creation Logs](https://ela.st/audit-process-creation)
"""
references = [
"https://developers.cloudflare.com/cloudflare-one/connections/connect-apps/install-and-setup/tunnel-useful-commands/",
"https://attack.mitre.org/techniques/T1572/",
]
risk_score = 47
rule_id = "d6e1b3f0-8a2c-4e7d-b5f9-1c0e3a6d8b2f"
severity = "medium"
tags = [
"Domain: Endpoint",
"OS: Windows",
"Use Case: Threat Detection",
"Tactic: Command and Control",
"Resources: Investigation Guide",
"Data Source: Elastic Defend",
"Data Source: Sysmon",
"Data Source: SentinelOne",
"Data Source: Microsoft Defender XDR",
"Data Source: Crowdstrike",
"Data Source: Elastic Endgame",
"Data Source: Windows Security Event Logs"
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
process where host.os.type == "windows" and event.type == "start" and
(process.name : "cloudflared.exe" or ?process.pe.original_file_name == "cloudflared.exe" or ?process.code_signature.subject_name : "Cloudflare, Inc.") and process.args : "tunnel"
'''
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1090"
name = "Proxy"
reference = "https://attack.mitre.org/techniques/T1090/"
[[rule.threat.technique.subtechnique]]
id = "T1090.002"
name = "External Proxy"
reference = "https://attack.mitre.org/techniques/T1090/002/"
[[rule.threat.technique]]
id = "T1572"
name = "Protocol Tunneling"
reference = "https://attack.mitre.org/techniques/T1572/"
[rule.threat.tactic]
id = "TA0011"
name = "Command and Control"
reference = "https://attack.mitre.org/tactics/TA0011/"
Stages and Predicates
Stage 1: process
process where host.os.type == "windows" and event.type == "start" and
(process.name : "cloudflared.exe" or ?process.pe.original_file_name == "cloudflared.exe" or ?process.code_signature.subject_name : "Cloudflare, Inc.") and process.args : "tunnel"
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.type | eq |
| field:"event.type" kind:eq value:"start" |
process.args | wildcard |
| field:"process.args" kind:wildcard value:"tunnel" |
process.code_signature.subject_name | wildcard |
| field:"Signature" kind:wildcard value:"Cloudflare, Inc." |
process.name | wildcard |
| field:"process_basename" kind:wildcard value:"cloudflared.exe" |
process.pe.original_file_name | eq |
| field:"OriginalFileName" kind:eq value:"cloudflared.exe" |
PowerShell Script with Log Clear Capabilities
#Identifies PowerShell script block content that clears Windows event logs using Clear-EventLog, Remove-EventLog, or EventLogSession/EventLog Clear methods. Attackers clear local logs to evade detection and destroy forensic evidence.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Execution | |
| Stealth | |
| Defense Impairment |
Rule Body
[metadata]
creation_date = "2023/07/06"
integration = ["windows"]
maturity = "production"
updated_date = "2026/02/09"
[rule]
author = ["Elastic"]
building_block_type = "default"
description = """
Identifies PowerShell script block content that clears Windows event logs using Clear-EventLog, Remove-EventLog, or
EventLogSession/EventLog Clear methods. Attackers clear local logs to evade detection and destroy forensic evidence.
"""
from = "now-119m"
index = ["winlogbeat-*", "logs-windows.powershell*"]
interval = "60m"
language = "kuery"
license = "Elastic License v2"
name = "PowerShell Script with Log Clear Capabilities"
note = """## Triage and analysis
> **Disclaimer**:
> This guide was created by humans with the assistance of generative AI. While its contents have been manually curated to include the most valuable information, always validate assumptions and adjust procedures to match your internal runbooks and incident triage and response policies.
### Investigating PowerShell Script with Log Clear Capabilities
This alert identifies PowerShell script block content associated with clearing Windows event logs through cmdlets or .NET methods. Clearing local logs can reduce forensic visibility and interrupt security monitoring. Because script block logging records executed content, confirm whether log clearing occurred and identify the broader activity that led to this action.
#### Key alert fields to review
- `user.name`, `user.domain`, `user.id`: Account execution context for correlation, prioritization, and scoping.
- `host.name`, `host.id`: Host execution context for correlation, prioritization, and scoping.
- `powershell.file.script_block_text`: Script block content that matched the detection logic.
- `powershell.file.script_block_id`, `powershell.sequence`, `powershell.total`: Script block metadata to pivot to other fragments or reconstruct full script content when split across multiple events.
- `file.path`, `file.directory`, `file.name`: File-origin context when the script block is sourced from an on-disk file.
- `powershell.file.script_block_length`: Script block length (size) context.
#### Possible investigation steps
- Analyze `powershell.file.script_block_text` to determine intent and scope:
- Identify the clearing technique used (for example, `Clear-EventLog`, `Remove-EventLog`, `EventLogSession.ClearLog`, or `Diagnostics.EventLog.Clear`).
- Extract referenced log names/channels and any values that indicate breadth (single log vs multiple logs, loops, or log enumeration).
- Note any remote targets, session objects, or hostnames that suggest log clearing on other systems.
- If `Remove-EventLog` is used, treat it as higher impact and determine whether it targets built-in logs or custom logs/event sources.
- Reconstruct full content when the script block is split:
- Pivot on `powershell.file.script_block_id` to collect all fragments.
- Order by `powershell.sequence` and confirm completeness using `powershell.total`.
- Use `powershell.file.script_block_length` to identify unusually large content that may include additional actions beyond log clearing.
- Establish execution context and likely origin:
- Review `user.name`, `user.domain`, and `user.id` to determine whether the account is expected to perform log maintenance and whether the timing is consistent with approved activity.
- Review `host.name` and `host.id` to determine whether the affected system is high value (for example, servers or shared systems) and to scope other alerts on the same host.
- If `file.path`, `file.directory`, or `file.name` are present, capture the script location/name and evaluate whether it aligns with known administrative scripts or automation.
- If file context is absent, treat the activity as inline or dynamically generated and prioritize identifying how PowerShell was launched (interactive session, scheduled execution, service, or parent process) using adjacent endpoint telemetry.
- Confirm whether logs were actually cleared and identify what was impacted:
- Review available Windows logging for records indicating event logs were cleared around `@timestamp`, and document which logs were affected.
- Look for gaps in event coverage or abrupt changes in event volume beginning at or shortly after the alert time on the same `host.id`.
- Correlate with adjacent activity around `@timestamp` (as available in your environment):
- Process execution: identify the PowerShell host process, its parent process, and any related automation that triggered the script.
- Authentication and remote access: identify new or unusual logons, session establishment, or privilege changes leading up to the event.
- Network activity: review connections consistent with remote administration or lateral movement preceding the log clearing.
- Additional PowerShell activity: review other script block events for the same `host.id` and `user.id` before and after the alert to identify precursor actions and follow-on cleanup.
- Scope across the environment:
- Search for the same or similar `powershell.file.script_block_text` patterns on other hosts to determine whether this is isolated behavior, shared tooling, or coordinated activity.
- Pivot on `user.id` to identify whether the same account performed similar activity on multiple hosts within a short time window.
### False positive analysis
- Authorized administrators may clear logs during troubleshooting, controlled testing, or specific maintenance procedures. Validate against change records, maintenance windows, and documented responsibilities for the account in `user.name`.
- Endpoint provisioning, imaging, or environment resets (for example, labs or short-lived systems) can include log clearing as part of baseline preparation. Validate whether `host.name` is part of an expected rebuild or reset workflow.
- Operational scripts may clear specific logs to address performance or retention constraints. Benign activity is more likely when `file.path` and `file.name` are from a controlled script repository and no additional suspicious activity is present for the same `user.id` and `host.id`.
### Response and remediation
- If activity is unauthorized or suspicious:
- Treat this as potential evidence destruction. Preserve remaining forensic data and collect relevant telemetry from the affected host.
- Preserve the full script content by capturing all fragments linked by `powershell.file.script_block_id` (use `powershell.sequence` and `powershell.total` for ordering) and retain it with the case record.
- Contain the involved account and host according to incident response procedures (for example, restrict access, reset credentials, and isolate the endpoint if required).
- Investigate for additional post-compromise activity on the same `host.id` and by the same `user.id`, prioritizing persistence, credential access, and lateral movement around the alert time.
- Assess logging resilience: verify critical logs are centrally forwarded and retained, and review access controls that allow event log clearing to ensure they are limited to necessary administrative roles.
- If activity is confirmed benign:
- Document the authorized workflow (who, what, where, and when), including expected `host.name`, `user.name`, and any associated script identifiers (`file.name`/`file.path`).
- Maintain monitoring for deviations from the approved pattern (unexpected accounts, hosts, timing, or expanded targeting) to reduce noise without losing coverage.
"""
references = [
"https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.eventlog.clear",
"https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.eventing.reader.eventlogsession.clearlog",
]
risk_score = 21
rule_id = "3d3aa8f9-12af-441f-9344-9f31053e316d"
setup = """## Setup
PowerShell Script Block Logging must be enabled to generate the events used by this rule (e.g., 4104).
Setup instructions: https://ela.st/powershell-logging-setup
"""
severity = "low"
tags = [
"Domain: Endpoint",
"OS: Windows",
"Use Case: Threat Detection",
"Tactic: Defense Evasion",
"Data Source: PowerShell Logs",
"Rule Type: BBR",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "query"
query = '''
event.category:process and host.os.type:windows and
powershell.file.script_block_text : (
"Clear-EventLog" or
"Remove-EventLog" or
("Eventing.Reader.EventLogSession" and ".ClearLog") or
("Diagnostics.EventLog" and ".Clear")
) and
not powershell.file.script_block_text : (
"CmdletsToExport=@(\"Add-Content\""
) and
not file.directory : "C:\Program Files\WindowsAdminCenter\PowerShellModules\Microsoft.WindowsAdminCenter.Configuration"
'''
[[rule.filters]]
[rule.filters.meta]
negate = true
[rule.filters.query.wildcard."file.path"]
case_insensitive = true
value = "?:\\\\Windows\\\\system32\\\\WindowsPowerShell\\\\v1.0\\\\Modules\\\\Microsoft.PowerShell.Management\\\\*.psd1"
[[rule.filters]]
[rule.filters.meta]
negate = true
[rule.filters.query.wildcard."file.path"]
case_insensitive = true
value = "?:\\\\Program Files\\\\Microsoft Monitoring Agent\\\\Agent\\\\Health Service State\\\\Resources\\\\*\\\\M365Library.ps1"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1070"
name = "Indicator Removal"
reference = "https://attack.mitre.org/techniques/T1070/"
[[rule.threat.technique.subtechnique]]
id = "T1070.001"
name = "Clear Windows Event Logs"
reference = "https://attack.mitre.org/techniques/T1070/001/"
[rule.threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1059"
name = "Command and Scripting Interpreter"
reference = "https://attack.mitre.org/techniques/T1059/"
[[rule.threat.technique.subtechnique]]
id = "T1059.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.investigation_fields]
field_names = [
"@timestamp",
"user.name",
"user.id",
"user.domain",
"powershell.file.script_block_text",
"powershell.file.script_block_id",
"powershell.sequence",
"powershell.total",
"file.path",
"file.directory",
"file.name",
"process.pid",
"host.name",
"host.id",
"powershell.file.script_block_length"
]
Stages and Predicates
Stage 1: query
event.category:process and host.os.type:windows and
powershell.file.script_block_text : (
"Clear-EventLog" or
"Remove-EventLog" or
("Eventing.Reader.EventLogSession" and ".ClearLog") or
("Diagnostics.EventLog" and ".Clear")
) and
not powershell.file.script_block_text : (
"CmdletsToExport=@(\"Add-Content\""
) and
not file.directory : "C:\Program Files\WindowsAdminCenter\PowerShellModules\Microsoft.WindowsAdminCenter.Configuration"
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.category | eq |
| field:"event.category" kind:eq value:"process" |
powershell.file.script_block_text | eq |
| field:"ScriptBlockText" kind:eq |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
file.directory | eq | C:\Program Files\WindowsAdminCenter\PowerShellModules\Microsoft.WindowsAdminCenter.Configuration | excludes:file.directory field:"file.directory" value:"C:\Program Files\WindowsAdminCenter\PowerShellModules\Microsoft.WindowsAdminCenter.Configuration" |
powershell.file.script_block_text | eq | CmdletsToExport=@("Add-Content" | excludes:powershell.file.script_block_text |
Privilege Escalation via Windows Installer Hijack
#Identifies the creation or modification of a Windows Installer rollback script (rbs) by an unusual process followed by the execution of process as SYSTEM. rbs files instruct the MSI service to rollback all the modification in the case of a failed installation. This behavior can be abused by an adversary to replace a legit rbs file with a rogue one via a file system oplock and race condition, then triggering an MSI rollback operation leading potentially to a privilege escalation.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Privilege Escalation | |
| Stealth |
Rule Body
[rule]
description = """
Identifies the creation or modification of a Windows Installer rollback script (rbs) by an unusual process followed by
the execution of process as SYSTEM. rbs files instruct the MSI service to rollback all the modification in the case of a
failed installation. This behavior can be abused by an adversary to replace a legit rbs file with a rogue one via a file
system oplock and race condition, then triggering an MSI rollback operation leading potentially to a privilege
escalation.
"""
id = "c34302d9-72ea-4d0b-8604-eec33d788448"
license = "Elastic License v2"
name = "Privilege Escalation via Windows Installer Hijack"
os_list = ["windows"]
reference = [
"https://www.zerodayinitiative.com/blog/2022/3/16/abusing-arbitrary-file-deletes-to-escalate-privilege-and-other-great-tricks",
"https://github.com/thezdi/PoC/tree/master/FilesystemEoPs",
"https://github.com/Wh04m1001/IFaultrepElevatedDataCollectionUAC",
"https://foolsofsecurity.com/blog/Windows_Installer_bypass_using_rollback_script/",
]
version = "1.0.22"
query = '''
sequence with maxspan=5m
[file where event.action != "deletion" and
file.extension : "rbs" and file.path : "?:\\Config.msi\\*" and
not user.id : "S-1-5-18" and
not process.executable : ("?:\\Windows\\system32\\msiexec.exe", "?:\\Windows\\syswow64\\msiexec.exe")] by process.entity_id
[process where event.action == "start" and
process.Ext.token.integrity_level_name : "system" and
process.parent.name : "msiexec.exe" and process.parent.args : "/V"] by process.Ext.effective_parent.entity_id
'''
min_endpoint_version = "8.4.0"
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 1
[[optional_actions]]
action = "rollback"
field = "process.entity_id"
state = 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/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1218"
name = "System Binary Proxy Execution"
reference = "https://attack.mitre.org/techniques/T1218/"
[[threat.technique.subtechnique]]
id = "T1218.007"
name = "Msiexec"
reference = "https://attack.mitre.org/techniques/T1218/007/"
[threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
[internal]
min_endpoint_version = "8.4.0"
Stages and Predicates
Ordered sequence: each step below must occur in order within 5m, correlated by process.Ext.effective_parent.entity_id, process.entity_id.
Stage 1: file
[file where event.action != "deletion" and
file.extension : "rbs" and file.path : "?:\\Config.msi\\*" and
not user.id : "S-1-5-18" and
not process.executable : ("?:\\Windows\\system32\\msiexec.exe", "?:\\Windows\\syswow64\\msiexec.exe")] by process.entity_id
Stage 2: process
[process where event.action == "start" and
process.Ext.token.integrity_level_name : "system" and
process.parent.name : "msiexec.exe" and process.parent.args : "/V"] by process.Ext.effective_parent.entity_id
Indicators
These rows show field, operator, and value matches.
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.executable | eq | ?:\Windows\system32\msiexec.exe, ?:\Windows\syswow64\msiexec.exe | excludes:process.executable field:"process.executable" value:"?:\Windows\system32\msiexec.exe" field:"process.executable" value:"?:\Windows\syswow64\msiexec.exe" |
user.id | eq | S-1-5-18 | excludes:user.id field:"user.id" value:"S-1-5-18" |
Privileged Accounts Brute Force
#Identifies multiple consecutive logon failures targeting more than one Admin account from the same source address and within a short time interval. Adversaries will often brute force login attempts across multiple users with a common or known password, in an attempt to gain access to accounts.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Credential Access |
Telemetry Coverage
| Provider | Record / event type |
|---|---|
| Security-Auditing | Event ID 4625: An account failed to log on. |
Rule Body
[metadata]
creation_date = "2020/08/29"
integration = ["system", "windows"]
maturity = "production"
updated_date = "2026/05/04"
[transform]
[[transform.osquery]]
label = "Osquery - Retrieve DNS Cache"
query = "SELECT * FROM dns_cache"
[[transform.osquery]]
label = "Osquery - Retrieve All Services"
query = "SELECT description, display_name, name, path, pid, service_type, start_type, status, user_account FROM services"
[[transform.osquery]]
label = "Osquery - Retrieve Services Running on User Accounts"
query = """
SELECT description, display_name, name, path, pid, service_type, start_type, status, user_account FROM services WHERE
NOT (user_account LIKE '%LocalSystem' OR user_account LIKE '%LocalService' OR user_account LIKE '%NetworkService' OR
user_account == null)
"""
[[transform.osquery]]
label = "Osquery - Retrieve Service Unsigned Executables with Virustotal Link"
query = """
SELECT concat('https://www.virustotal.com/gui/file/', sha1) AS VtLink, name, description, start_type, status, pid,
services.path FROM services JOIN authenticode ON services.path = authenticode.path OR services.module_path =
authenticode.path JOIN hash ON services.path = hash.path WHERE authenticode.result != 'trusted'
"""
[rule]
author = ["Elastic"]
description = """
Identifies multiple consecutive logon failures targeting more than one Admin account from the same source address and within a
short time interval. Adversaries will often brute force login attempts across multiple users with a common or known
password, in an attempt to gain access to accounts.
"""
from = "now-9m"
language = "esql"
license = "Elastic License v2"
name = "Privileged Accounts Brute Force"
note = """## Triage and analysis
### Investigating Privileged Accounts Brute Force
Adversaries with no prior knowledge of legitimate credentials within the system or environment may guess passwords to attempt access to accounts. Without knowledge of the password for an account, an adversary may opt to guess the password using a repetitive or iterative mechanism systematically. More details can be found [here](https://attack.mitre.org/techniques/T1110/001/).
This rule identifies potential password guessing/brute force activity from a single address against multiple accounts that contains the `admin` pattern on its name, which is likely a highly privileged account.
> **Note**:
> This investigation guide uses the [Osquery Markdown Plugin](https://www.elastic.co/guide/en/security/current/invest-guide-run-osquery.html) introduced in Elastic Stack version 8.5.0. Older Elastic Stack versions will display unrendered Markdown in this guide.
#### Possible investigation steps
- Investigate the logon failure reason code and the targeted user name.
- Prioritize the investigation if the account is critical or has administrative privileges over the domain.
- Investigate the source IP address of the failed Network Logon attempts.
- Identify whether these attempts are coming from the internet or are internal.
- Investigate other alerts associated with the involved users and source host during the past 48 hours.
- Identify the source and the target computer and their roles in the IT environment.
- Check whether the involved credentials are used in automation or scheduled tasks.
- If this activity is suspicious, contact the account owner and confirm whether they are aware of it.
- Examine the source host for derived artifacts that indicate compromise:
- Observe and collect information about the following activities in the alert source host:
- Attempts to contact external domains and addresses.
- Examine the DNS cache for suspicious or anomalous entries.
- $osquery_0
- Examine the host services for suspicious or anomalous entries.
- $osquery_1
- $osquery_2
- $osquery_3
- Investigate potentially compromised accounts. Analysts can do this by searching for login events (for example, 4624) to the host which is the source of this activity.
### False positive analysis
- Authentication misconfiguration or obsolete credentials.
- Service account password expired.
- Domain trust relationship issues.
- Infrastructure or availability issues.
### Response and remediation
- Initiate the incident response process based on the outcome of the triage.
- Isolate the source host to prevent further post-compromise behavior.
- If the asset is exposed to the internet with RDP or other remote services available, take the necessary measures to restrict access to the asset. If not possible, limit the access via the firewall to only the needed IP addresses. Also, ensure the system uses robust authentication mechanisms and is patched regularly.
- 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
Audit Logon must be enabled to generate the events used by this rule.
Setup instructions: https://ela.st/audit-logon
"""
references = ["https://docs.microsoft.com/en-us/windows/security/threat-protection/auditing/event-4625"]
risk_score = 47
rule_id = "f9790abf-bd0c-45f9-8b5f-d0b74015e029"
severity = "medium"
tags = [
"Domain: Endpoint",
"OS: Windows",
"Use Case: Threat Detection",
"Tactic: Credential Access",
"Resources: Investigation Guide",
"Data Source: Windows Security Event Logs",
]
type = "esql"
query = '''
from logs-system.security*, logs-windows.forwarded*, winlogbeat-* metadata _id, _version, _index
| where event.category == "authentication" and host.os.type == "windows" and event.action == "logon-failed" and
winlog.logon.type == "Network" and source.ip is not null and winlog.computer_name is not null and
not cidr_match(TO_IP(source.ip), "127.0.0.0/8", "::1") and
to_lower(winlog.event_data.TargetUserName) like "*admin*" and
/*
noisy failure status codes often associated to authentication misconfiguration
0xC000015B - The user has not been granted the requested logon type (also called the logon right) at this machine.
0XC000005E - There are currently no logon servers available to service the logon request.
0XC0000133 - Clocks between DC and other computer too far out of sync.
0XC0000192 An attempt was made to logon, but the Netlogon service was not started.
0xc00000dc - DC is in shutdown phase, it will normally tell current clients to use another DC for authentication.
*/
not winlog.event_data.Status in ("0xc000015b", "0xc000005e", "0xc0000133", "0xc0000192", "0xc00000dc")
// truncate the timestamp to a 60-second window
| eval Esql.time_window = date_trunc(60 seconds, @timestamp)
| stats Esql.failed_auth_count = COUNT(*),
Esql.target_user_name_values = VALUES(winlog.event_data.TargetUserName),
Esql.count_distinct_user_name = count_distinct(winlog.event_data.TargetUserName),
Esql.user_domain_values = VALUES(user.domain),
Esql.error_codes = VALUES(winlog.event_data.Status),
Esql.data_stream_namespace.values = VALUES(data_stream.namespace) by winlog.computer_name, source.ip, Esql.time_window, winlog.logon.type
| where Esql.failed_auth_count >= 50 and Esql.count_distinct_user_name >= 2
| eval user.name = mv_first(Esql.target_user_name_values)
| KEEP winlog.computer_name, source.ip, user.name, Esql.time_window, winlog.logon.type, Esql.*
'''
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1110"
name = "Brute Force"
reference = "https://attack.mitre.org/techniques/T1110/"
[[rule.threat.technique.subtechnique]]
id = "T1110.001"
name = "Password Guessing"
reference = "https://attack.mitre.org/techniques/T1110/001/"
[[rule.threat.technique.subtechnique]]
id = "T1110.003"
name = "Password Spraying"
reference = "https://attack.mitre.org/techniques/T1110/003/"
[rule.threat.tactic]
id = "TA0006"
name = "Credential Access"
reference = "https://attack.mitre.org/tactics/TA0006/"
Stages and Predicates
Stage 1: from
from logs-system.security*, logs-windows.forwarded*, winlogbeat-* metadata _id, _version, _index
Stage 2: where
| where event.category == "authentication" and host.os.type == "windows" and event.action == "logon-failed" and
winlog.logon.type == "Network" and source.ip is not null and winlog.computer_name is not null and
not cidr_match(TO_IP(source.ip), "127.0.0.0/8", "::1") and
to_lower(winlog.event_data.TargetUserName) like "*admin*" and
/*
noisy failure status codes often associated to authentication misconfiguration
0xC000015B - The user has not been granted the requested logon type (also called the logon right) at this machine.
0XC000005E - There are currently no logon servers available to service the logon request.
0XC0000133 - Clocks between DC and other computer too far out of sync.
0XC0000192 An attempt was made to logon, but the Netlogon service was not started.
0xc00000dc - DC is in shutdown phase, it will normally tell current clients to use another DC for authentication.
*/
not winlog.event_data.Status in ("0xc000015b", "0xc000005e", "0xc0000133", "0xc0000192", "0xc00000dc")
Stage 3: eval
| eval Esql.time_window = date_trunc(60 seconds, @timestamp)
Stage 4: stats
| stats Esql.failed_auth_count = COUNT(*),
Esql.target_user_name_values = VALUES(winlog.event_data.TargetUserName),
Esql.count_distinct_user_name = count_distinct(winlog.event_data.TargetUserName),
Esql.user_domain_values = VALUES(user.domain),
Esql.error_codes = VALUES(winlog.event_data.Status),
Esql.data_stream_namespace.values = VALUES(data_stream.namespace) by winlog.computer_name, source.ip, Esql.time_window, winlog.logon.type
Stage 5: where
| where Esql.failed_auth_count >= 50 and Esql.count_distinct_user_name >= 2
Stage 6: eval
| eval user.name = mv_first(Esql.target_user_name_values)
Stage 7: keep
| KEEP winlog.computer_name, source.ip, user.name, Esql.time_window, winlog.logon.type, Esql.*
Indicators
These rows show field, operator, and value matches.
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
TO_IP(source.ip) | cidr_match | 127.0.0.0/8, ::1 | excludes:TO_IP(source.ip) field:"TO_IP(source.ip)" value:"127.0.0.0/8" field:"TO_IP(source.ip)" value:"::1" |
winlog.event_data.Status | in | 0xc000005e, 0xc00000dc, 0xc0000133, 0xc000015b, 0xc0000192 | excludes:winlog.event_data.Status |
Output Fields
These fields are emitted when the rule matches.
| Field | Source |
|---|---|
winlog.computer_name | KEEP winlog.computer_name |
source.ip | KEEP source.ip |
user.name | KEEP user.name |
Esql.time_window | KEEP Esql.time_window |
winlog.logon.type | KEEP winlog.logon.type |
Esql.* | KEEP Esql.* |
Processes with Trailing Spaces
#Identify instances where adversaries include trailing space characters to mimic regular files, disguising their activity to evade default file handling mechanisms.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Stealth |
Telemetry Coverage
Rule Body
[metadata]
creation_date = "2023/08/24"
integration = ["endpoint", "auditd_manager"]
maturity = "production"
updated_date = "2026/01/12"
[rule]
author = ["Elastic"]
description = """
Identify instances where adversaries include trailing space characters to mimic regular files, disguising their activity
to evade default file handling mechanisms.
"""
from = "now-9m"
index = ["logs-endpoint.events.*", "endgame-*", "auditbeat-*", "logs-auditd_manager.auditd-*"]
language = "eql"
license = "Elastic License v2"
name = "Processes with Trailing Spaces"
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 Processes with Trailing Spaces
This rule detects execution of binaries whose names end with a space, a Unix-style masquerade that makes a malicious tool visually indistinguishable from a legitimate one and evades default file handling. An attacker pattern is a trojanized clone of ssh, curl, or ps with a trailing space placed in a user-writable PATH directory, then invoked by cron, shell scripts, or launch agents to harvest credentials or stage payloads while blending in.
### Possible investigation steps
- Confirm the binary's presence and trailing space on disk using commands that reveal whitespace (ls -b, find -print0, stat), and compare inode, size, permissions, and mtime against the non-spaced counterpart in the same directory.
- Correlate the event with parent process, effective user, environment (PATH, IFS, aliases), and working directory to determine whether PATH hijacking or script misresolution is being exploited.
- Hash the suspicious executable, check code signing and compiler metadata where applicable, and pivot in threat intel and internal repositories to identify known implants or unauthorized builds.
- Enumerate all directories in PATH for lookalike binaries with whitespace or Unicode homographs, review recent file creations and chmod/chown activity in those paths, and identify the account and host that introduced them.
- Investigate follow-on activity from the same process tree, including network connections, credential access attempts, file writes, and persistence artifacts such as cron entries or macOS LaunchAgents, to determine scope and containment actions.
### False positive analysis
- A legitimate wrapper or init script may use exec -a or setproctitle to set a custom argv[0] with a trailing space for labeling or formatting, causing process.name to end with a space even though the underlying binary is trusted.
- Build or maintenance scripts that fail to trim variables can create and run an executable or symlink whose name includes a trailing space (e.g., when an optional suffix is empty), producing benign events that match this detection.
### Response and remediation
- Terminate the spaced-name process and its parent, stop any cron job or macOS LaunchAgent invoking the spaced executable (e.g., "ssh "), and isolate the host if it initiated outbound connections or prompted for credentials.
- Find and remove or quarantine all executables and symlinks whose filenames end with a space in PATH directories such as ~/bin, /tmp, and project bin paths, using rm -- with exact quoting or null-delimited tools to avoid clobbering the legitimate counterpart.
- Remove persistence and PATH hijacks by deleting cron entries and LaunchAgents referencing the spaced name, restoring PATH for affected users and services to a vetted list, and resetting file ownership and permissions on altered directories.
- Reinstall or restore the legitimate binary from trusted packages or gold images, verify checksums and code signing, update scripts to use absolute paths and trimmed variables, and rotate credentials if the lookalike was a trojan of ssh, curl, or ps.
- Escalate to incident response if the spaced executable resides in system directories (/bin, /usr/bin, /usr/local/bin), runs as root or via sudo, repeatedly respawns after removal, or opens external network connections.
- Harden by enabling file integrity monitoring for filenames with trailing whitespace or Unicode confusables, removing user-writable directories from global PATH and enforcing write protections, configuring cron/launchd with sanitized PATH, and applying noexec or sticky-bit policies on shared temp directories.
"""
risk_score = 21
rule_id = "0c093569-dff9-42b6-87b1-0242d9f7d9b4"
severity = "low"
tags = [
"Domain: Endpoint",
"OS: Linux",
"OS: macOS",
"Use Case: Threat Detection",
"Tactic: Defense Evasion",
"Data Source: Elastic Defend",
"Data Source: Elastic Endgame",
"Data Source: Auditd Manager",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
process where event.type == "start" and event.action in ("exec", "exec_event", "executed", "process_started") and
process.name : "* "
'''
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1036"
name = "Masquerading"
reference = "https://attack.mitre.org/techniques/T1036/"
[[rule.threat.technique.subtechnique]]
id = "T1036.006"
name = "Space after Filename"
reference = "https://attack.mitre.org/techniques/T1036/006/"
[rule.threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
Stages and Predicates
Stage 1: process
process where event.type == "start" and event.action in ("exec", "exec_event", "executed", "process_started") and
process.name : "* "
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | in |
| field:"EventType" kind:in |
event.type | eq |
| field:"event.type" kind:eq value:"start" |
process.name | wildcard |
| field:"process_basename" kind:wildcard value:"* " |
Shlayer Malware Infection
#Identifies the execution of curl to download a payload for execution. This behavior is consistent with Shlayer malware. Shlayer is a macOS malware family associated with ad fraud activity. Shlayer masquerades typically as an installer for applications like Adobe Flash Player and executes numerous macOS commands to deobfuscate code and install adware with persistence mechanisms.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Command & Control |
Telemetry Coverage
Rule Body
[rule]
description = """
Identifies the execution of curl to download a payload for execution. This behavior is consistent with Shlayer malware.
Shlayer is a macOS malware family associated with ad fraud activity. Shlayer masquerades typically as an installer for
applications like Adobe Flash Player and executes numerous macOS commands to deobfuscate code and install adware with
persistence mechanisms.
"""
id = "3dda1ac2-86ef-41f5-ad3b-d9396383e104"
license = "Elastic License v2"
name = "Shlayer Malware Infection"
os_list = ["macos"]
reference = [
"https://attack.mitre.org/software/S0402/",
"https://redcanary.com/threat-detection-report/threats/shlayer/",
"https://securelist.com/shlayer-for-macos/95724/",
]
version = "1.0.29"
query = '''
process where event.action == "exec" and process.name in ("curl", "nscurl") and process.args like "-f0L"
'''
min_endpoint_version = "8.10.2"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
[[actions]]
action = "kill_process"
field = "process.parent.entity_id"
state = 0
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1105"
name = "Ingress Tool Transfer"
reference = "https://attack.mitre.org/techniques/T1105/"
[threat.tactic]
id = "TA0011"
name = "Command and Control"
reference = "https://attack.mitre.org/tactics/TA0011/"
[internal]
min_endpoint_version = "8.10.2"
Stages and Predicates
Stage 1: process
process where event.action == "exec" and process.name in ("curl", "nscurl") and process.args like "-f0L"
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | eq |
| field:"EventType" kind:eq value:"exec" |
process.args | wildcard |
| field:"process.args" kind:wildcard value:"-f0L" |
process.name | in |
| field:"process_basename" kind:in |
Suspicious Codesign Execution via Osacompile
#Detects the abnormal execution of the codesign binary via Osacompile to forcefully sign all contents of a bundle. Threat actors may use this technique to bypass code signing requirements.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Execution |
Telemetry Coverage
Rule Body
[rule]
description = """
Detects the abnormal execution of the codesign binary via Osacompile to forcefully sign all contents of a bundle. Threat
actors may use this technique to bypass code signing requirements.
"""
id = "7d2a993e-967f-4abd-b53e-ac14fdd66ddb"
license = "Elastic License v2"
name = "Suspicious Codesign Execution via Osacompile"
os_list = ["macos"]
version = "1.0.9"
query = '''
process where event.type == "start" and event.action == "exec" and
process.name == "codesign" and
process.args in ("--sign", "-s") and
process.args in ("--force", "-f") and
process.args in ("--deep") and
((process.parent.name == "osacompile") or (process.parent.name in ("bash", "sh", "zsh") and process.Ext.effective_parent.name like~ ("terminal", "codesign"))) and
not process.Ext.effective_parent.executable like~ "/Volumes/PostgreSQL*/postgresql*.app/Contents/MacOS/PostgreSQL"
'''
min_endpoint_version = "8.16.0"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
[[actions]]
action = "kill_process"
field = "process.parent.entity_id"
state = 0
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1059"
name = "Command and Scripting Interpreter"
reference = "https://attack.mitre.org/techniques/T1059/"
[[threat.technique.subtechnique]]
id = "T1059.004"
name = "Unix Shell"
reference = "https://attack.mitre.org/techniques/T1059/004/"
[threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
[internal]
min_endpoint_version = "8.16.0"
Stages and Predicates
Stage 1: process
process where event.type == "start" and event.action == "exec" and
process.name == "codesign" and
process.args in ("--sign", "-s") and
process.args in ("--force", "-f") and
process.args in ("--deep") and
((process.parent.name == "osacompile") or (process.parent.name in ("bash", "sh", "zsh") and process.Ext.effective_parent.name like~ ("terminal", "codesign"))) and
not process.Ext.effective_parent.executable like~ "/Volumes/PostgreSQL*/postgresql*.app/Contents/MacOS/PostgreSQL"
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | eq |
| field:"EventType" kind:eq value:"exec" |
event.type | eq |
| field:"event.type" kind:eq value:"start" |
process.Ext.effective_parent.name | wildcard |
| field:"process.Ext.effective_parent.name" kind:wildcard |
process.args | in |
| field:"process.args" kind:in |
process.name | eq |
| field:"process_basename" kind:eq value:"codesign" |
process.parent.name | eq |
| field:"parent_process_basename" kind:eq value:"osacompile" |
process.parent.name | in |
| field:"parent_process_basename" kind:in |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.Ext.effective_parent.executable | wildcard | /Volumes/PostgreSQL*/postgresql*.app/Contents/MacOS/PostgreSQL | excludes:process.Ext.effective_parent.executable field:"process.Ext.effective_parent.executable" value:"/Volumes/PostgreSQL*/postgresql*.app/Contents/MacOS/PostgreSQL" |
Suspicious Execution from INET Cache
#Identifies the execution of a process with arguments pointing to the INetCache Folder. Adversaries may deliver malicious content via WININET during initial access.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Initial Access | |
| Execution | |
| Command & Control |
Telemetry Coverage
| Provider | Record / event type |
|---|---|
| Sysmon | Event ID 1: Process creation |
| Security-Auditing | Event ID 4688: A new process has been created. |
Rule Body
[metadata]
creation_date = "2024/02/14"
integration = ["endpoint", "windows", "system", "m365_defender", "sentinel_one_cloud_funnel", "crowdstrike"]
maturity = "production"
updated_date = "2026/05/03"
[rule]
author = ["Elastic"]
description = """
Identifies the execution of a process with arguments pointing to the INetCache Folder. Adversaries may deliver malicious
content via WININET during initial access.
"""
from = "now-9m"
index = [
"endgame-*",
"logs-crowdstrike.fdr*",
"logs-endpoint.events.process-*",
"logs-m365_defender.event-*",
"logs-sentinel_one_cloud_funnel.*",
"logs-system.security*",
"logs-windows.forwarded*",
"logs-windows.sysmon_operational-*",
"winlogbeat-*",
]
language = "eql"
license = "Elastic License v2"
name = "Suspicious Execution from INET Cache"
references = [
"https://www.trendmicro.com/en_us/research/24/b/cve202421412-water-hydra-targets-traders-with-windows-defender-s.html",
]
risk_score = 73
rule_id = "dca6b4b0-ae70-44eb-bb7a-ce6db502ee78"
severity = "high"
tags = [
"Domain: Endpoint",
"OS: Windows",
"Use Case: Threat Detection",
"Tactic: Initial Access",
"Data Source: Elastic Endgame",
"Data Source: Elastic Defend",
"Data Source: Windows Security Event Logs",
"Data Source: Microsoft Defender XDR",
"Data Source: Sysmon",
"Data Source: SentinelOne",
"Data Source: Crowdstrike",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
process where host.os.type == "windows" and event.type == "start" and
process.parent.name : ("explorer.exe", "winrar.exe", "7zFM.exe", "Bandizip.exe") and
(
process.args : "*\\AppData\\Local\\Microsoft\\Windows\\INetCache\\IE\\*" or
process.executable : (
"?:\\Users\\*\\AppData\\Local\\Microsoft\\Windows\\INetCache\\IE\\*",
/* Crowdstrike specific condition as it uses NT Object paths */
"\\Device\\HarddiskVolume*\\Users\\*\\AppData\\Local\\Microsoft\\Windows\\INetCache\\IE\\*"
)
) and
not process.executable : (
"?:\\Program Files\\*.exe",
"?:\\Program Files (x86)\\*.exe",
"?:\\Windows\\System32\\mspaint.exe",
"?:\\Windows\\System32\\notepad.exe",
/* Crowdstrike specific exclusion as it uses NT Object paths */
"\\Device\\HarddiskVolume*\\Program Files\\*.exe",
"\\Device\\HarddiskVolume*\\Program Files (x86)\\*.exe",
"\\Device\\HarddiskVolume*\\Windows\\System32\\mspaint.exe",
"\\Device\\HarddiskVolume*\\Windows\\System32\\notepad.exe"
)
'''
note = """## Triage and analysis
### Investigating Suspicious Execution from INET Cache
#### Possible investigation steps
- Did the alert execute a payload from INetCache, or did another process only reference cached content?
- Focus: `process.executable` and `process.command_line`, checking whether `AppData\\Local\\Microsoft\\Windows\\INetCache\\IE` or `\\Device\\HarddiskVolume*\\Users\\*\\INetCache\\IE` is the image path, loader input, or only a document/image argument.
- Implication: escalate faster when the image runs from cache or feeds cached script, archive, shortcut, or DLL content to a loader; lower suspicion when the cache path is only a file argument to a recognized viewer and later lineage shows no execution.
- Does identity and launch context fit a recognized file-opening, archive, or installer workflow?
- Focus: `process.hash.sha256`, `process.code_signature.subject_name`, `process.code_signature.trusted`, `process.parent.executable`, and `process.parent.command_line`.
- Implication: escalate when identity, signer, path, or parent command line conflicts with Explorer/archive-manager file handling; lower suspicion only when identity and launcher context fit one coherent workflow. Identity alone does not clear cache execution.
- Do launcher-scoped file events show a downloaded or disguised lure chain?
- Why: parent-scoped provenance distinguishes routine cache use from shortcut, archive, script, or DLL handoff.
- Focus: file events from the parent launcher via `process.parent.entity_id`; fallback to `host.id` plus parent PID and alert time, checking `file.path`, `file.origin_url`, `file.origin_referrer_url`, `file.Ext.windows.zone_identifier`, and `file.Ext.original.extension`. $investigate_0
- Implication: escalate when provenance shows internet delivery, deceptive extensions, shortcut-to-archive/script transitions, or renamed cache payloads. Missing file telemetry is unresolved, not benign.
- Do process-scoped DNS or connection events show delivery or follow-on infrastructure?
- Why: network evidence separates local file-opening from remote retrieval, payload transfer, or follow-on command and control.
- Focus: DNS and connection events from `process.entity_id`; fallback to `host.id` plus `process.pid` and alert time, checking DNS `dns.question.name` and `dns.resolved_ip` plus connection `destination.ip` and `destination.port`. $investigate_1
- Hint: compare `lookup_result` DNS `dns.resolved_ip` values to connection `destination.ip` before judging infrastructure.
- Implication: escalate when the process reaches rare external, WebDAV-like, dotted-quad, or payload-transfer destinations that do not match file provenance; lower suspicion when destinations align with the same recognized vendor workflow. Missing network telemetry is unresolved, not benign.
- Did the cached content lead to script, archive, DLL, or staged executable execution?
- Focus: child starts where `process.parent.entity_id` matches `process.entity_id`, checking child `process.name`, `process.executable`, and `process.command_line`. $investigate_2
- Hint: if entity IDs are unavailable, use parent PID plus alert time as a weaker fallback.
- Implication: escalate when the chain quickly launches "cmd.exe", "powershell.exe", "rundll32.exe", "mshta.exe", "wscript.exe", "cscript.exe", or another staged executable; lower suspicion when the lineage stops at the original viewer, archiver, or installer.
- If local evidence remains suspicious or unresolved after lineage review, is the same user or host part of broader delivery activity?
- Focus: `host.id`, `user.id`, and related alerts that repeat the same cache-path role, parent launcher, child-process family, recovered destination, or provenance pattern.
- Hint: pivot same-user alerts. $investigate_3
- Hint: pivot same-host alerts. $investigate_4
- Implication: broaden containment when related alerts show the same lure or delivery pattern across the user or host; skip broadening when local evidence supports a coherent benign workflow or single-host containment.
- Escalate on disguised/downloaded cache execution, loader handoff, suspicious infrastructure, or broader delivery; close only when process evidence and recovery bind one coherent benign workflow with no contradictions; when evidence is mixed or visibility incomplete, preserve artifacts and escalate.
### False positive analysis
- Browser-driven installers, vendor updaters, and archive-based delivery can launch signed helpers from cache or reference cached installer content. Confirm `process.executable`, hash/signer, parent executable/command line, `user.id`, and `host.id` align with one recognized vendor workflow, and recovered provenance/destinations do not contradict it. Without deployment records, require recurring signer or hash, parent workflow, account, and host pattern without loader children or unrelated external delivery.
- Archive preview, document viewing, or browser-open workflows can reference cached paths without executing a cached payload. Confirm `process.command_line` uses the cache path as a document, image, or shortcut argument, the parent workflow is stable for `user.id` and `host.id`, and recovered file, network, and child-process evidence lacks `.url/.lnk`, `.cmd/.bat/.js/.hta`, archive-to-script, or DLL-loader transitions.
- Before creating an exception, validate recurrence across prior alerts from this rule with stable `process.executable`, signer or hash, `process.parent.executable`, cache-path role, `user.id`, and `host.id`. Avoid exceptions on INetCache alone, Explorer alone, archive-manager name alone, or a user alone.
### Response and remediation
- If confirmed benign, reverse temporary containment and record the process identity, command line, parent workflow, account, host, and any recovered provenance or destination evidence that proved the benign workflow. Create an exception only for the recurring signer or hash, cache-path role, parent workflow, `user.id`, and `host.id` combination.
- If suspicious but unconfirmed, preserve `process.entity_id`, `process.command_line`, parent/child lineage, runtime hash and signer, payload files, origin/referrer URLs, DNS names, destination IPs/ports, and related alert IDs before containment. Apply reversible containment first, such as temporary destination blocking or heightened monitoring for the affected `host.id` and `user.id`; isolate only when loader execution or network evidence suggests active payload delivery or command and control.
- If confirmed malicious, preserve the same process, file, and network artifacts before destructive action. Isolate the endpoint when host criticality permits, block confirmed malicious domains, destinations, and hashes, collect suspicious payloads, then terminate processes or delete files only after scope and evidence capture are complete.
- Eradicate only the shortcut, script, archive, DLL, extracted payload, startup item, or persistence artifact identified during the investigation. Verify the original browser-download, archive, WebDAV-like, or cache delivery path no longer reaches the host.
- Post-incident hardening: retain the evidence set that proved the case, review SmartScreen, Mark-of-the-Web, WebDAV, archive-handling, and web-download controls for the affected host class, and record adjacent variants such as disguised `.url` lures, archive-extracted scripts, or cache-based DLL launchers in the case notes.
"""
setup = """## Setup
This rule is designed for data generated by [Elastic Defend](https://www.elastic.co/security/endpoint-security), which provides native endpoint detection and response, along with event enrichments designed to work with our detection rules.
Setup instructions: https://ela.st/install-elastic-defend
### Additional data sources
This rule also supports the following third-party data sources. For setup instructions, refer to the links below:
- [CrowdStrike](https://ela.st/crowdstrike-integration)
- [Microsoft Defender XDR](https://ela.st/m365-defender)
- [SentinelOne Cloud Funnel](https://ela.st/sentinel-one-cloud-funnel)
- [Sysmon Event ID 1 - Process Creation](https://ela.st/sysmon-event-1-setup)
- [Windows Process Creation Logs](https://ela.st/audit-process-creation)
"""
[rule.investigation_fields]
field_names = [
"@timestamp",
"host.id",
"user.id",
"process.entity_id",
"process.pid",
"process.executable",
"process.command_line",
"process.hash.sha256",
"process.code_signature.subject_name",
"process.code_signature.trusted",
"process.parent.entity_id",
"process.parent.pid",
"process.parent.executable",
"process.parent.command_line",
"process.parent.args",
]
[transform]
[[transform.investigate]]
label = "File events for the launcher 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.parent.entity_id}}", valueType = "string" },
{ excluded = false, field = "event.category", queryType = "phrase", value = "file", valueType = "string" }
],
[
{ excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" },
{ excluded = false, field = "process.pid", queryType = "phrase", value = "{{process.parent.pid}}", valueType = "string" },
{ excluded = false, field = "event.category", queryType = "phrase", value = "file", valueType = "string" }
]
]
relativeFrom = "now-1h"
relativeTo = "now"
[[transform.investigate]]
label = "Network events for the executed process"
description = ""
providers = [
[
{ excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" },
{ excluded = false, field = "process.entity_id", queryType = "phrase", value = "{{process.entity_id}}", valueType = "string" },
{ excluded = false, field = "event.category", queryType = "phrase", value = "network", valueType = "string" }
],
[
{ 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 = "network", valueType = "string" }
]
]
relativeFrom = "now-1h"
relativeTo = "now"
[[transform.investigate]]
label = "Child process starts from the cached-content process"
description = ""
providers = [
[
{ excluded = false, field = "event.category", queryType = "phrase", value = "process", valueType = "string" },
{ excluded = false, field = "event.type", queryType = "phrase", value = "start", valueType = "string" },
{ excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" },
{ excluded = false, field = "process.parent.entity_id", queryType = "phrase", value = "{{process.entity_id}}", valueType = "string" }
],
[
{ excluded = false, field = "event.category", queryType = "phrase", value = "process", valueType = "string" },
{ excluded = false, field = "event.type", queryType = "phrase", value = "start", valueType = "string" },
{ excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" },
{ excluded = false, field = "process.parent.pid", queryType = "phrase", value = "{{process.pid}}", valueType = "string" }
]
]
relativeFrom = "now-1h"
relativeTo = "now"
[[transform.investigate]]
label = "Alerts associated with the user"
description = ""
providers = [
[
{ excluded = false, field = "event.kind", queryType = "phrase", value = "signal", valueType = "string" },
{ excluded = false, field = "user.id", queryType = "phrase", value = "{{user.id}}", valueType = "string" }
]
]
relativeFrom = "now-48h/h"
relativeTo = "now"
[[transform.investigate]]
label = "Alerts associated with the host"
description = ""
providers = [
[
{ excluded = false, field = "event.kind", queryType = "phrase", value = "signal", valueType = "string" },
{ excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" }
]
]
relativeFrom = "now-48h/h"
relativeTo = "now"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1566"
name = "Phishing"
reference = "https://attack.mitre.org/techniques/T1566/"
[[rule.threat.technique.subtechnique]]
id = "T1566.001"
name = "Spearphishing Attachment"
reference = "https://attack.mitre.org/techniques/T1566/001/"
[rule.threat.tactic]
id = "TA0001"
name = "Initial Access"
reference = "https://attack.mitre.org/tactics/TA0001/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1105"
name = "Ingress Tool Transfer"
reference = "https://attack.mitre.org/techniques/T1105/"
[rule.threat.tactic]
id = "TA0011"
name = "Command and Control"
reference = "https://attack.mitre.org/tactics/TA0011/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1204"
name = "User Execution"
reference = "https://attack.mitre.org/techniques/T1204/"
[[rule.threat.technique.subtechnique]]
id = "T1204.002"
name = "Malicious File"
reference = "https://attack.mitre.org/techniques/T1204/002/"
[rule.threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
Stages and Predicates
Stage 1: process
process where host.os.type == "windows" and event.type == "start" and
process.parent.name : ("explorer.exe", "winrar.exe", "7zFM.exe", "Bandizip.exe") and
(
process.args : "*\\AppData\\Local\\Microsoft\\Windows\\INetCache\\IE\\*" or
process.executable : (
"?:\\Users\\*\\AppData\\Local\\Microsoft\\Windows\\INetCache\\IE\\*",
"\\Device\\HarddiskVolume*\\Users\\*\\AppData\\Local\\Microsoft\\Windows\\INetCache\\IE\\*"
)
) and
not process.executable : (
"?:\\Program Files\\*.exe",
"?:\\Program Files (x86)\\*.exe",
"?:\\Windows\\System32\\mspaint.exe",
"?:\\Windows\\System32\\notepad.exe",
"\\Device\\HarddiskVolume*\\Program Files\\*.exe",
"\\Device\\HarddiskVolume*\\Program Files (x86)\\*.exe",
"\\Device\\HarddiskVolume*\\Windows\\System32\\mspaint.exe",
"\\Device\\HarddiskVolume*\\Windows\\System32\\notepad.exe"
)
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.type | eq |
| field:"event.type" kind:eq value:"start" |
process.args | wildcard |
| field:"process.args" kind:wildcard value:"*\AppData\Local\Microsoft\Windows\INetCache\IE\*" |
process.executable | wildcard |
| field:"Image" kind:wildcard |
process.parent.name | wildcard |
| field:"parent_process_basename" kind:wildcard |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.executable | wildcard | ?:\Program Files\*.exe, ?:\Program Files (x86)\*.exe, ?:\Windows\System32\mspaint.exe, ?:\Windows\System32\notepad.exe, \Device\HarddiskVolume*\Program Files\*.exe, \Device\HarddiskVolume*\Program Files (x86)\*.exe, \Device\HarddiskVolume*\Windows\System32\mspaint.exe, \Device\HarddiskVolume*\Windows\System32\notepad.exe | excludes:process.executable |
Suspicious Unload of Elastic Agent via Launchctl
#Detects the abnormal unload of the Elastic Agent plist via the launchctl system binary. This activity can indicate an attempt to disable or destroy the agent's ability to continuously monitor system activity and may indicate a threat actors attempt to evade defenses and remain undetected or not be recorded while performing actions on their objective.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Defense Impairment |
Rule Body
[rule]
description = """
Detects the abnormal unload of the Elastic Agent plist via the launchctl system binary. This activity can indicate an
attempt to disable or destroy the agent's ability to continuously monitor system activity and may indicate a threat
actors attempt to evade defenses and remain undetected or not be recorded while performing actions on their objective.
"""
id = "4abdbb10-6653-4a3b-8e7a-9c4f9382f03b"
license = "Elastic License v2"
name = "Suspicious Unload of Elastic Agent via Launchctl"
os_list = ["macos"]
version = "1.0.24"
query = '''
process where event.type == "start" and
(
(
process.name == "launchctl" and
process.args : "unload" and
process.args like~ "*co.elastic.elastic-agent.plist"
) or
(
(process.name in ("sh", "zsh", "bash", "dash", "csh", "tcsh", "ksh", "tclsh", "fish") or process.name like "tclsh*") and
process.args == "-c" and
process.command_line like~ "*unload*co.elastic.elastic-agent.plist*"
)
) and not
process.parent.name == "elastic-agent" and not
process.parent.executable like~ ("/sbin/launchd",
"/Library/PrivilegedHelperTools/*",
"/Library/Application Support/Mosyle/MosyleMDM.app/Contents/MacOS/MosyleMDM",
"/usr/local/jamf/bin/jamf",
"/usr/bin/sudo") and not
process.Ext.effective_parent.executable like~ ("/System/Applications/Utilities/Terminal.app/Contents/MacOS/Terminal",
"/usr/local/jamf/bin/jamf",
"/usr/libexec/xpcproxy",
"/Library/Kandji/Kandji Agent.app/Contents/Helpers/Kandji Library Manager.app/Contents/MacOS/kandji-library-manager",
"/Library/PrivilegedHelperTools/com.todyl.SGNCoreHelper",
"/Library/Application Support/JAMF/Jamf.app/Contents/MacOS/JamfManagementService.app/Contents/MacOS/JamfManagementService",
"/Library/Elastic/Agent/data/elastic-agent*/elastic-agent.app/Contents/MacOS/elastic-agent",
"/Library/Application Support/JAMF/Jamf.app/Contents/MacOS/JamfDaemon.app/Contents/MacOS/JamfDaemon",
"/opt/jc/bin/jumpcloud-agent",
"/Library/Elastic/Agent/*",
"/Library/PrivilegedHelperTools/com.todyl.SGNCoreHelper",
"/Applications/NinjaRMMAgent/programfiles/ninjarmm-macagent",
"/Library/Intune/Microsoft Intune Agent.app/Contents/MacOS/IntuneMdmDaemon",
"/Library/Endgame/esensor",
"/Library/Application Support/Mosyle/MosyleMDM.app/Contents/MacOS/MosyleMDM",
"/Applications/iTerm.app/Contents/MacOS/iTerm2")
'''
min_endpoint_version = "8.11.0"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
[[actions]]
action = "kill_process"
field = "process.parent.entity_id"
state = 0
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1562"
name = "Impair Defenses"
reference = "https://attack.mitre.org/techniques/T1562/"
[[threat.technique.subtechnique]]
id = "T1562.001"
name = "Disable or Modify Tools"
reference = "https://attack.mitre.org/techniques/T1562/001/"
[threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
[internal]
min_endpoint_version = "8.11.0"
Stages and Predicates
Stage 1: process
process where event.type == "start" and
(
(
process.name == "launchctl" and
process.args : "unload" and
process.args like~ "*co.elastic.elastic-agent.plist"
) or
(
(process.name in ("sh", "zsh", "bash", "dash", "csh", "tcsh", "ksh", "tclsh", "fish") or process.name like "tclsh*") and
process.args == "-c" and
process.command_line like~ "*unload*co.elastic.elastic-agent.plist*"
)
) and not
process.parent.name == "elastic-agent" and not
process.parent.executable like~ ("/sbin/launchd",
"/Library/PrivilegedHelperTools/*",
"/Library/Application Support/Mosyle/MosyleMDM.app/Contents/MacOS/MosyleMDM",
"/usr/local/jamf/bin/jamf",
"/usr/bin/sudo") and not
process.Ext.effective_parent.executable like~ ("/System/Applications/Utilities/Terminal.app/Contents/MacOS/Terminal",
"/usr/local/jamf/bin/jamf",
"/usr/libexec/xpcproxy",
"/Library/Kandji/Kandji Agent.app/Contents/Helpers/Kandji Library Manager.app/Contents/MacOS/kandji-library-manager",
"/Library/PrivilegedHelperTools/com.todyl.SGNCoreHelper",
"/Library/Application Support/JAMF/Jamf.app/Contents/MacOS/JamfManagementService.app/Contents/MacOS/JamfManagementService",
"/Library/Elastic/Agent/data/elastic-agent*/elastic-agent.app/Contents/MacOS/elastic-agent",
"/Library/Application Support/JAMF/Jamf.app/Contents/MacOS/JamfDaemon.app/Contents/MacOS/JamfDaemon",
"/opt/jc/bin/jumpcloud-agent",
"/Library/Elastic/Agent/*",
"/Library/PrivilegedHelperTools/com.todyl.SGNCoreHelper",
"/Applications/NinjaRMMAgent/programfiles/ninjarmm-macagent",
"/Library/Intune/Microsoft Intune Agent.app/Contents/MacOS/IntuneMdmDaemon",
"/Library/Endgame/esensor",
"/Library/Application Support/Mosyle/MosyleMDM.app/Contents/MacOS/MosyleMDM",
"/Applications/iTerm.app/Contents/MacOS/iTerm2")
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.type | eq |
| field:"event.type" kind:eq value:"start" |
process.args | eq |
| field:"process.args" kind:eq value:"-c" |
process.args | wildcard |
| field:"process.args" kind:wildcard |
process.command_line | wildcard |
| field:"CommandLine" kind:wildcard value:"*unload*co.elastic.elastic-agent.plist*" |
process.name | eq |
| field:"process_basename" kind:eq value:"launchctl" |
process.name | in |
| field:"process_basename" kind:in |
process.name | wildcard |
| field:"process_basename" kind:wildcard value:"tclsh*" |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.Ext.effective_parent.executable | wildcard | /System/Applications/Utilities/Terminal.app/Contents/MacOS/Terminal, /usr/local/jamf/bin/jamf, /usr/libexec/xpcproxy, /Library/Kandji/Kandji Agent.app/Contents/Helpers/Kandji Library Manager.app/Contents/MacOS/kandji-library-manager, /Library/PrivilegedHelperTools/com.todyl.SGNCoreHelper, /Library/Application Support/JAMF/Jamf.app/Contents/MacOS/JamfManagementService.app/Contents/MacOS/JamfManagementService, /Library/Elastic/Agent/data/elastic-agent*/elastic-agent.app/Contents/MacOS/elastic-agent, /Library/Application Support/JAMF/Jamf.app/Contents/MacOS/JamfDaemon.app/Contents/MacOS/JamfDaemon, /opt/jc/bin/jumpcloud-agent, /Library/Elastic/Agent/*, /Library/PrivilegedHelperTools/com.todyl.SGNCoreHelper, /Applications/NinjaRMMAgent/programfiles/ninjarmm-macagent, /Library/Intune/Microsoft Intune Agent.app/Contents/MacOS/IntuneMdmDaemon, /Library/Endgame/esensor, /Library/Application Support/Mosyle/MosyleMDM.app/Contents/MacOS/MosyleMDM, /Applications/iTerm.app/Contents/MacOS/iTerm2 | excludes:process.Ext.effective_parent.executable |
process.parent.executable | wildcard | /sbin/launchd, /Library/PrivilegedHelperTools/*, /Library/Application Support/Mosyle/MosyleMDM.app/Contents/MacOS/MosyleMDM, /usr/local/jamf/bin/jamf, /usr/bin/sudo | excludes:process.parent.executable |
process.parent.name | eq | elastic-agent | excludes:process.parent.name field:"process.parent.name" value:"elastic-agent" |
UAC Bypass Attempt with IEditionUpgradeManager Elevated COM Interface
#Identifies attempts to bypass User Account Control (UAC) by abusing an elevated COM Interface to launch a rogue Windows ClipUp program. Attackers may attempt to bypass UAC to stealthily execute code with elevated permissions.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Execution | |
| Privilege Escalation |
Telemetry Coverage
| Provider | Record / event type |
|---|---|
| Sysmon | Event ID 1: Process creation |
| Security-Auditing | Event ID 4688: A new process has been created. |
Rule Body
[metadata]
creation_date = "2020/10/28"
integration = ["endpoint", "windows", "m365_defender", "sentinel_one_cloud_funnel"]
maturity = "production"
updated_date = "2026/05/03"
[rule]
author = ["Elastic"]
description = """
Identifies attempts to bypass User Account Control (UAC) by abusing an elevated COM Interface to launch a rogue Windows
ClipUp program. Attackers may attempt to bypass UAC to stealthily execute code with elevated permissions.
"""
from = "now-9m"
index = [
"winlogbeat-*",
"logs-endpoint.events.process-*",
"logs-windows.sysmon_operational-*",
"endgame-*",
"logs-m365_defender.event-*",
"logs-sentinel_one_cloud_funnel.*",
]
language = "eql"
license = "Elastic License v2"
name = "UAC Bypass Attempt with IEditionUpgradeManager Elevated COM Interface"
references = ["https://github.com/hfiref0x/UACME"]
risk_score = 73
rule_id = "b90cdde7-7e0d-4359-8bf0-2c112ce2008a"
severity = "high"
tags = [
"Domain: Endpoint",
"OS: Windows",
"Use Case: Threat Detection",
"Tactic: Privilege Escalation",
"Data Source: Elastic Endgame",
"Data Source: Elastic Defend",
"Data Source: Sysmon",
"Data Source: Microsoft Defender XDR",
"Data Source: SentinelOne",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
process where host.os.type == "windows" and event.type == "start" and process.name : "Clipup.exe" and
not process.executable : "C:\\Windows\\System32\\ClipUp.exe" and process.parent.name : "dllhost.exe" and
/* CLSID of the Elevated COM Interface IEditionUpgradeManager */
process.parent.args : "/Processid:{BD54C901-076B-434E-B6C7-17C531F4AB41}"
'''
note = """## Triage and analysis
### Investigating UAC Bypass Attempt with IEditionUpgradeManager Elevated COM Interface
#### Possible investigation steps
- Does the alert show the IEditionUpgradeManager ClipUp bypass path?
- Focus: `process.name`, `process.executable`, `process.parent.name`, `process.parent.args`, and `process.Ext.token.elevation_level`.
- Hint: absent token metadata does not lower suspicion; the path and COM parent args still define the bypass path.
- Implication: a "dllhost.exe" broker, IEditionUpgradeManager CLSID, "ClipUp.exe" name, and non-System32 path warrant UAC bypass investigation; high or full elevation raises priority. Concern drops only when later identity and child checks bind to exact servicing or authorized testing.
- Is the non-system ClipUp image a genuine Microsoft servicing component or an attacker-defined payload?
- Focus: `process.executable`, `process.hash.sha256`, `process.pe.original_file_name`, `process.code_signature.subject_name`, and `process.code_signature.trusted`.
- Hint: absent hash, signature, or PE metadata does not lower suspicion; fall back to path, COM args, command line, and child behavior.
- Implication: treat the image as attacker-controlled when unsigned, not Microsoft-signed, mismatched to "ClipUp.exe", or in a user-writable root. A Microsoft signer, matching original name, and stable hash reduce suspicion only when the same path ties to the servicing package under review.
- Does the path or runtime metadata fit system-directory spoofing or lookalike staging?
- Why: the alert already proves ClipUp ran outside genuine System32; a writable root ending in "\\system32\\clipup.exe" is the staging clue.
- Focus: `process.executable`, `process.Ext.relative_file_creation_time`, `process.Ext.relative_file_name_modify_time`, and `process.command_line`.
- Hint: absent relative timing fields leave the issue unresolved; use path root, command line, signer/hash, and local process history.
- Implication: temp, profile, writable-share, or other non-Windows roots ending in "\\system32\\clipup.exe" indicate system-directory spoofing, especially with recent create or rename timing. Stable path age and servicing arguments reduce concern only after image identity also fits.
- Did the elevated ClipUp instance start follow-on tooling?
- Focus: child process starts where `process.parent.entity_id` matches `process.entity_id`, reviewing `process.name`, `process.executable`, `process.command_line`, and `process.Ext.token.integrity_level_name`. $investigate_0
- Hint: if `process.entity_id` is absent, recover children with `host.id` + `process.pid` in a tight alert-time window; an empty child search is unresolved, not benign.
- Implication: shells, script hosts, LOLBins, installers, or security-control tooling turn the alert into post-elevation execution. No visible child keeps the case scoped to the bypass launch, not closed.
- Where else did this exact ClipUp pattern run?
- Focus: matching process starts by `process.hash.sha256`, `process.executable`, `process.parent.args`, and `process.Ext.token.elevation_level`, scoped by `host.id` and `user.id`.
- Hint: if the hash or elevation field is absent, pivot on the exact `process.executable` + `process.parent.args` pair and keep the time window tight. $investigate_1
- Implication: after local evidence remains suspicious or unresolved, use matching path, hash, COM args, and elevation state to scope hosts or users; recurrence is supporting context, not a reason to close over contradictory local evidence.
- Escalate when the COM-brokered non-system ClipUp launch pairs with attacker-defined identity, system-directory spoofing clues, unexpected elevation, or suspicious children. Close only when alert-local process evidence and supported child/history recovery bind to one confirmed servicing package or authorized OS-image test; require external confirmation when telemetry cannot prove that exact activity. Preserve evidence and escalate when answers remain mixed or incomplete.
### False positive analysis
- Windows edition upgrade, activation, or repair servicing can explain ClipUp activity only when evidence converges on one workflow: Microsoft-signed `process.hash.sha256`, expected `process.executable`, IEditionUpgradeManager `process.parent.args`, compatible `process.Ext.token.integrity_level_name` when present, and no suspicious children. If change records are unavailable, require telemetry confirmation from the same signed hash, path, parent args, `host.id`, and `user.id` pattern on the same host.
- Treat non-System32 ClipUp as an operational anti-pattern outside servicing. The only other benign path is an authorized OS-image or lab test where `process.executable`, `process.hash.sha256`, `process.command_line`, `process.parent.executable`, `process.parent.args`, and `user.id` all match the exact test case. Any unsigned image, writable-profile path, or elevated child tooling contradicts this explanation.
- Before creating an exception, require a stable benign pattern for `process.executable`, `process.hash.sha256`, `process.parent.args`, `process.Ext.token.integrity_level_name`, and relevant `host.id` or `user.id`. Avoid exceptions on `process.name`, `process.parent.name`, or the COM CLSID alone.
### Response and remediation
- If confirmed benign, reverse temporary containment and record the image identity, broker context, token state, `host.id`, and `user.id` that proved the servicing or deployment workflow. Create an exception only after the same full pattern repeats benignly.
- If suspicious but unconfirmed, preserve the alert, endpoint timeline export, process tree, non-system ClipUp path and hash, IEditionUpgradeManager parent context, token details, and recovered child-process evidence before containment.
- If suspicious but unconfirmed, apply reversible containment tied to the findings: block the non-system ClipUp path or hash, end the associated user session when needed, or raise monitoring on the affected `host.id`. Isolate the host only if elevated children, control tampering, or broader suspicious process history raises impact.
- If confirmed malicious, isolate the host, terminate the rogue ClipUp instance and elevated children after recording their process identifiers, and block the confirmed path or hash. Review the same hash, path, COM parent args, and user across other hosts before deleting artifacts.
- Eradicate only the staged ClipUp copy, launched payloads, persistence, or launcher artifacts identified during the investigation, then restore affected controls and validate that the Windows servicing path uses the genuine System32 binary.
- Post-incident hardening: restrict system-binary lookalikes from user-writable paths with WDAC or AppLocker, retain process lineage and token telemetry for elevated COM abuse, and document any missing telemetry or uncovered variant with the preserved evidence set.
"""
setup = """## Setup
This rule is designed for data generated by [Elastic Defend](https://www.elastic.co/security/endpoint-security), which provides native endpoint detection and response, along with event enrichments designed to work with our detection rules.
Setup instructions: https://ela.st/install-elastic-defend
### Additional data sources
This rule also supports the following third-party data sources. For setup instructions, refer to the links below:
- [Microsoft Defender XDR](https://ela.st/m365-defender)
- [SentinelOne Cloud Funnel](https://ela.st/sentinel-one-cloud-funnel)
- [Sysmon Event ID 1 - Process Creation](https://ela.st/sysmon-event-1-setup)
"""
[rule.investigation_fields]
field_names = [
"@timestamp",
"host.id",
"user.id",
"process.pid",
"process.entity_id",
"process.executable",
"process.command_line",
"process.pe.original_file_name",
"process.code_signature.subject_name",
"process.code_signature.trusted",
"process.hash.sha256",
"process.parent.executable",
"process.parent.args",
"process.Ext.token.elevation_level",
"process.Ext.token.integrity_level_name",
]
[transform]
[[transform.investigate]]
label = "Child processes launched by the rogue ClipUp instance"
description = ""
providers = [
[
{ excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" },
{ excluded = false, field = "process.parent.entity_id", queryType = "phrase", value = "{{process.entity_id}}", valueType = "string" },
{ excluded = false, field = "event.category", queryType = "phrase", value = "process", valueType = "string" }
],
[
{ excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" },
{ excluded = false, field = "process.parent.pid", queryType = "phrase", value = "{{process.pid}}", valueType = "string" },
{ excluded = false, field = "event.category", queryType = "phrase", value = "process", valueType = "string" }
]
]
relativeFrom = "now-1h"
relativeTo = "now"
[[transform.investigate]]
label = "Process events for the same ClipUp path and COM interface"
description = ""
providers = [
[
{ excluded = false, field = "event.category", queryType = "phrase", value = "process", valueType = "string" },
{ excluded = false, field = "process.executable", queryType = "phrase", value = "{{process.executable}}", valueType = "string" },
{ excluded = false, field = "process.parent.args", queryType = "phrase", value = "{{process.parent.args}}", valueType = "string" }
]
]
relativeFrom = "now-48h/h"
relativeTo = "now"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1548"
name = "Abuse Elevation Control Mechanism"
reference = "https://attack.mitre.org/techniques/T1548/"
[[rule.threat.technique.subtechnique]]
id = "T1548.002"
name = "Bypass User Account Control"
reference = "https://attack.mitre.org/techniques/T1548/002/"
[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 = "T1548"
name = "Abuse Elevation Control Mechanism"
reference = "https://attack.mitre.org/techniques/T1548/"
[[rule.threat.technique.subtechnique]]
id = "T1548.002"
name = "Bypass User Account Control"
reference = "https://attack.mitre.org/techniques/T1548/002/"
[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 = "T1559"
name = "Inter-Process Communication"
reference = "https://attack.mitre.org/techniques/T1559/"
[[rule.threat.technique.subtechnique]]
id = "T1559.001"
name = "Component Object Model"
reference = "https://attack.mitre.org/techniques/T1559/001/"
[rule.threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
Stages and Predicates
Stage 1: process
process where host.os.type == "windows" and event.type == "start" and process.name : "Clipup.exe" and
not process.executable : "C:\\Windows\\System32\\ClipUp.exe" and process.parent.name : "dllhost.exe" and
process.parent.args : "/Processid:{BD54C901-076B-434E-B6C7-17C531F4AB41}"
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.type | eq |
| field:"event.type" kind:eq value:"start" |
process.name | wildcard |
| field:"process_basename" kind:wildcard value:"Clipup.exe" |
process.parent.args | wildcard |
| field:"process.parent.args" kind:wildcard value:"/Processid:{BD54C901-076B-434E-B6C7-17C531F4AB41}" |
process.parent.name | wildcard |
| field:"parent_process_basename" kind:wildcard value:"dllhost.exe" |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.executable | eq | C:\Windows\System32\ClipUp.exe | excludes:process.executable field:"process.executable" value:"C:\Windows\System32\ClipUp.exe" |
Unusual Network Connection to Suspicious Web Service
#This rule monitors for the unusual occurrence of outbound network connections to suspicious webservice domains.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Command & Control | |
| Exfiltration |
Rule Body
[metadata]
creation_date = "2025/03/26"
integration = ["endpoint"]
maturity = "production"
updated_date = "2026/09/11"
[rule]
author = ["Elastic"]
description = """
This rule monitors for the unusual occurrence of outbound network connections to suspicious webservice domains.
"""
from = "now-9m"
index = ["logs-endpoint.events.network-*"]
language = "kuery"
license = "Elastic License v2"
name = "Unusual Network Connection to Suspicious Web Service"
note = """ ## Triage and analysis
> **Disclaimer**:
> This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.
### Investigating Unusual Network Connection to Suspicious Web Service
In macOS environments, network connections to web services are routine for data sharing and collaboration. However, adversaries exploit these services for command and control by disguising malicious traffic as legitimate. The detection rule identifies unusual outbound connections to known suspicious domains, flagging potential misuse by monitoring specific domain patterns and connection events, thus aiding in early threat detection.
### Possible investigation steps
- Review the destination domain and process executable from the alert to determine if it matches any expected web service communication.
- Check the event.category and event.type fields to confirm the nature of the network connection and ensure it aligns with the expected behavior of a macOS system.
- Investigate the source host identified by host.os.type to gather information about its recent activities, installed applications, and any potential indicators of compromise.
- Analyze network traffic logs for the source host to identify any other unusual or suspicious outbound connections that may indicate a broader compromise.
- Correlate the alert with other security events or alerts from the same host or network segment to identify patterns or related incidents.
- Consult threat intelligence sources to gather additional context on the flagged domain and assess its reputation and history of malicious activity.
### False positive analysis
- Frequent access to legitimate cloud storage services like Google Drive or Dropbox for routine file sharing can trigger false positives. Users can create exceptions for specific domains or IP addresses known to be safe and frequently accessed by their organization.
- Automated backup services that use domains such as OneDrive or SharePoint may be flagged. To mitigate this, identify and whitelist the specific services or applications that are part of regular backup operations.
- Collaboration tools like Slack or Discord, used for legitimate communication, might be mistakenly flagged. Users should review and whitelist these domains if they are part of standard business operations.
- URL shorteners like bit.ly or tinyurl.com used in marketing or communication campaigns can cause false alerts. Establish a list of trusted shortener services and exclude them from monitoring if they are regularly used by the organization.
- Development and testing environments using services like ngrok or localtunnel for temporary public URLs can be misidentified. Ensure these environments are documented and excluded from the rule if they are part of normal development workflows.
### Response and remediation
- Immediately isolate the affected macOS device from the network to prevent further communication with the suspicious domains.
- Conduct a thorough review of the network logs to identify any data exfiltration attempts or additional suspicious connections originating from the isolated device.
- Remove any unauthorized or suspicious applications or scripts found on the device that may be facilitating the outbound connections.
- Update the device's security software and perform a full system scan to detect and remove any malware or unauthorized software.
- Reset credentials and review access permissions for the affected user accounts to prevent unauthorized access.
- Monitor the network for any further attempts to connect to the flagged domains and ensure that alerts are configured to notify security teams of any recurrence.
- Escalate the incident to the security operations center (SOC) or relevant cybersecurity team for further investigation and to determine if the threat is part of a larger attack campaign.
"""
references = [
"https://specterops.io/blog/2026/01/30/weaponizing-whitelists-an-azure-blob-storage-mythic-c2-profile/"
]
risk_score = 47
rule_id = "b07f0fba-0a78-11f0-8311-b66272739ecb"
severity = "medium"
tags = [
"Domain: Endpoint",
"OS: macOS",
"Use Case: Threat Detection",
"Tactic: Command and Control",
"Data Source: Elastic Defend",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "new_terms"
query = '''
event.category : "network" and host.os.type : "macos" and event.type : "start" and
destination.domain : (
pastebin.* or
paste.ee or
ghostbin.com or
drive.google.com or
?.docs.live.net or
api.dropboxapi.* or
content.dropboxapi.* or
*dl.dropboxusercontent.* or
api.onedrive.com or
*.onedrive.org or
onedrive.live.com or
filebin.net or
*.ngrok.io or
ngrok.com or
*.portmap.* or
*serveo.net or
*localtunnel.me or
*pagekite.me or
*localxpose.io or
*notabug.org or
rawcdn.githack.* or
paste.nrecom.net or
zerobin.net or
controlc.com or
requestbin.net or
api.slack.com or
slack-redir.net or
slack-files.com or
cdn.discordapp.com or
discordapp.com or
discord.com or
apis.azureedge.net or
cdn.sql.gg or
?.top4top.io or
top4top.io or
uplooder.net or
*.cdnmegafiles.com or
transfer.sh or
updates.peer2profit.com or
api.telegram.org or
t.me or
meacz.gq or
rwrd.org or
*.publicvm.com or
*.blogspot.com or
api.mylnikov.org or
script.google.com or
script.googleusercontent.com or
paste4btc.com or
workupload.com or
temp.sh or
filetransfer.io or
gofile.io or
store?.gofile.io or
tiny.one or
api.notion.com or
*.sharepoint.com or
*upload.ee or
bit.ly or
t.ly or
cutt.ly or
mbasic.facebook.com or
api.gofile.io or
file.io or
api.anonfiles.com or
api.trello.com or
gist.githubusercontent.com or
dpaste.com or
*azurewebsites.net or
*.zulipchat.com or
*.4shared.com or
filecloud.me or
i.ibb.co or
files.catbox.moe or
*.getmyip.com or
mockbin.org or
webhook.site or
run.mocky.io or
*infinityfreeapp.com or
free.keep.sh or
tinyurl.com or
ftpupload.net or
lobfile.com or
*.ngrok-free.app or
myexternalip.com or
yandex.ru or
*.yandex.ru or
*.aternos.me or
cdn??.space or
*.pcloud.com or
mediafire.zip or
urlz.fr or
rentry.co or
*.b-cdn.net or
pastecode.dev or
i.imgur.com or
the.earth.li or
*.trycloudflare.com or
*.blob.core.windows.net or
*.blob.storage.azure.net
) and
not (destination.domain : (*.sharepoint.com or *.azurewebsites.net or "onedrive.live.com" or *.b-cdn.net or api.onedrive.com or "drive.google.com" or *.blogspot.com or *.blob.core.windows.net or *.blob.storage.azure.net) and process.code_signature.subject_name:(*Microsoft* or "Software Signing" or "Apple Mac OS Application Signing" or *VMware*) and process.code_signature.trusted:true) and
not (process.code_signature.subject_name:(*Mozilla* or *Google* or *Brave* or *Opera* or "Software Signing" or "macOS Software Signing" or *Zscaler* or *Browser*) and process.code_signature.trusted:true) and
not (destination.domain :("discord.com" or cdn.discordapp.com or "content.dropboxapi.com" or "dl.dropboxusercontent.com") and process.code_signature.subject_name :(*Discord* or *Dropbox*) and process.code_signature.trusted:true)
'''
[[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.001"
name = "Web Protocols"
reference = "https://attack.mitre.org/techniques/T1071/001/"
[[rule.threat.technique]]
id = "T1102"
name = "Web Service"
reference = "https://attack.mitre.org/techniques/T1102/"
[rule.threat.tactic]
id = "TA0011"
name = "Command and Control"
reference = "https://attack.mitre.org/tactics/TA0011/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1567"
name = "Exfiltration Over Web Service"
reference = "https://attack.mitre.org/techniques/T1567/"
[[rule.threat.technique.subtechnique]]
id = "T1567.002"
name = "Exfiltration to Cloud Storage"
reference = "https://attack.mitre.org/techniques/T1567/002/"
[[rule.threat.technique.subtechnique]]
id = "T1567.003"
name = "Exfiltration to Text Storage Sites"
reference = "https://attack.mitre.org/techniques/T1567/003/"
[[rule.threat.technique.subtechnique]]
id = "T1567.004"
name = "Exfiltration Over Webhook"
reference = "https://attack.mitre.org/techniques/T1567/004/"
[rule.threat.tactic]
id = "TA0010"
name = "Exfiltration"
reference = "https://attack.mitre.org/tactics/TA0010/"
[rule.new_terms]
field = "new_terms_fields"
value = ["host.id", "process.executable", "destination.domain"]
[[rule.new_terms.history_window_start]]
field = "history_window_start"
value = "now-7d"
Stages and Predicates
Stage 1: new_terms
event.category : "network" and host.os.type : "macos" and event.type : "start" and
destination.domain : (
pastebin.* or
paste.ee or
ghostbin.com or
drive.google.com or
?.docs.live.net or
api.dropboxapi.* or
content.dropboxapi.* or
*dl.dropboxusercontent.* or
api.onedrive.com or
*.onedrive.org or
onedrive.live.com or
filebin.net or
*.ngrok.io or
ngrok.com or
*.portmap.* or
*serveo.net or
*localtunnel.me or
*pagekite.me or
*localxpose.io or
*notabug.org or
rawcdn.githack.* or
paste.nrecom.net or
zerobin.net or
controlc.com or
requestbin.net or
api.slack.com or
slack-redir.net or
slack-files.com or
cdn.discordapp.com or
discordapp.com or
discord.com or
apis.azureedge.net or
cdn.sql.gg or
?.top4top.io or
top4top.io or
uplooder.net or
*.cdnmegafiles.com or
transfer.sh or
updates.peer2profit.com or
api.telegram.org or
t.me or
meacz.gq or
rwrd.org or
*.publicvm.com or
*.blogspot.com or
api.mylnikov.org or
script.google.com or
script.googleusercontent.com or
paste4btc.com or
workupload.com or
temp.sh or
filetransfer.io or
gofile.io or
store?.gofile.io or
tiny.one or
api.notion.com or
*.sharepoint.com or
*upload.ee or
bit.ly or
t.ly or
cutt.ly or
mbasic.facebook.com or
api.gofile.io or
file.io or
api.anonfiles.com or
api.trello.com or
gist.githubusercontent.com or
dpaste.com or
*azurewebsites.net or
*.zulipchat.com or
*.4shared.com or
filecloud.me or
i.ibb.co or
files.catbox.moe or
*.getmyip.com or
mockbin.org or
webhook.site or
run.mocky.io or
*infinityfreeapp.com or
free.keep.sh or
tinyurl.com or
ftpupload.net or
lobfile.com or
*.ngrok-free.app or
myexternalip.com or
yandex.ru or
*.yandex.ru or
*.aternos.me or
cdn??.space or
*.pcloud.com or
mediafire.zip or
urlz.fr or
rentry.co or
*.b-cdn.net or
pastecode.dev or
i.imgur.com or
the.earth.li or
*.trycloudflare.com or
*.blob.core.windows.net or
*.blob.storage.azure.net
) and
not (destination.domain : (*.sharepoint.com or *.azurewebsites.net or "onedrive.live.com" or *.b-cdn.net or api.onedrive.com or "drive.google.com" or *.blogspot.com or *.blob.core.windows.net or *.blob.storage.azure.net) and process.code_signature.subject_name:(*Microsoft* or "Software Signing" or "Apple Mac OS Application Signing" or *VMware*) and process.code_signature.trusted:true) and
not (process.code_signature.subject_name:(*Mozilla* or *Google* or *Brave* or *Opera* or "Software Signing" or "macOS Software Signing" or *Zscaler* or *Browser*) and process.code_signature.trusted:true) and
not (destination.domain :("discord.com" or cdn.discordapp.com or "content.dropboxapi.com" or "dl.dropboxusercontent.com") and process.code_signature.subject_name :(*Discord* or *Dropbox*) and process.code_signature.trusted:true)
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
destination.domain | eq |
| field:"DestinationHostname" kind:eq |
destination.domain | wildcard |
| field:"DestinationHostname" kind:wildcard |
event.category | eq |
| field:"event.category" kind:eq value:"network" |
event.type | eq |
| field:"event.type" kind:eq value:"start" |
Exclusions
The rule actively suppresses these predicates.