Detection rules › Elastic
Elastic rules: 1f
AMSI Bypass from Suspicious Module
#Identifies attempts to modify the permissions or write to Microsoft Anti Malware Scan Interface DLL from unsigned module.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Defense Impairment |
Rule Body
[rule]
description = """
Identifies attempts to modify the permissions or write to Microsoft Anti Malware Scan Interface DLL from unsigned
module.
"""
id = "64043824-bd8f-408d-a92b-3e552b6ecd20"
license = "Elastic License v2"
name = "AMSI Bypass from Suspicious Module"
os_list = ["windows"]
reference = [
"https://aidenpearce369.github.io/offsec/AMSI-Memory-Bypass/",
"https://modexp.wordpress.com/2019/06/03/disable-amsi-wldp-dotnet/",
]
version = "1.0.8"
query = '''
api where process.Ext.api.metadata.target_address_name like "amsi.dll*" and
((process.Ext.api.name in ("VirtualProtect", "VirtualProtectEx") and process.Ext.api.parameters.protection like "?W*") or
process.Ext.api.name == "WriteProcessMemory") and
not process.thread.Ext.call_stack_final_user_module.protection_provenance like "Kernel*" and
not process.thread.Ext.call_stack_final_user_module.name in ("Kernel", "Unknown", "Undetermined") and
not process.thread.Ext.call_stack_final_user_module.hash.sha256 in
("2ef4add3ecdc20e1234b0c3fa034cf110f5dfc01355f81ed773f797fcdc6a375",
"c2710daef53ff962522ec1e7e05cdc7147db3371dfbc71cb1cf7afe6382451e5",
"15dd664aee6bfd3cbe0a967d160f4f4b37fe3e8aef88dfb4547e77292226c0c4",
"a121de30d1b8cdf66d886f8cd02b4a35d477f2638d616673da76716a9466cae7",
"ce0644768cd505a8975d897a560186011fbcd2cbd6b309eb0688fc4d816a3451",
"23217cdb3ff108ee4e099f61afa6e33f65675ae0c25d7cc0a30554deca1b33dc",
"d0c7983d45bbbe52e10aa461226cef4049d30778a5d03c9663251edbcea5bd6e",
"b6f6b9f49c60a2230cbf1a3449c85434b70a3b46cc3727da3ef265ba46ac4967",
"902080ae0b0348dca5d526b8cefee280fec0e4eb7299af211ad522e6644032f4",
"5eea4cecd56c5c12f748a2c06729448419ca4deec2410314b6e9d184ecf64bad",
"384c31b964bac7f60c637ed032d735537adebf3611f78637887d042330655f24",
"4776e752dab37e0540f4f3b66a6686e549a9eba42ddfe2f22ee8bcd8e11d215e",
"3505e9318d1ca3472c7708ebaa1753b5cc0eda43c6f5210807a9e7ca8673a227",
"1ee57272a271e82eee1aebaab306c403b30a2e9df94ede777f17fe84670e5033") and
(
_arraysearch(process.thread.Ext.call_stack_final_user_module.code_signature, $entry, $entry.trusted == false or $entry.exists == false) or
_arraysearch(process.thread.Ext.call_stack_final_user_module.code_signature, $entry, $entry.subject_name in ("Microsoft Corporation", "Microsoft Windows", ".NET", "Python Software Foundation"))
) and
not _arraysearch(process.thread.Ext.call_stack_final_user_module.code_signature, $entry, $entry.trusted == true and
$entry.subject_name in ("Microsoft Windows Hardware Compatibility Publisher",
"Microsoft Windows Software Compatibility Publisher",
"MUSARUBRA US LLC")) and
not process.thread.Ext.call_stack_final_user_module.path like
("c:\\windows\\system32\\apphelp.dll",
"c:\\windows\\system32\\lsasrv.dll",
"c:\\windows\\system32\\combase.dll",
"c:\\windows\\system32\\ieadvpack.dll",
"c:\\windows\\syswow64\\*.dll",
"c:\\windows\\microsoft.net\\framework*.dll",
"c:\\windows\\assembly\\nativeimages_*.ni.dll",
"c:\\windows\\winsxs\\temp\\pendingdeletes\\$$deleteme*",
"c:\\windows\\system32\\mrt\\*\\mpengine.dll",
"c:\\windows\\system32\\wbem\\fastprox.dll",
"c:\\windows\\winsxs\\*.dll",
"c:\\program files (x86)\\*",
"c:\\program files\\*",
"c:\\windows\\syswow64\\werfault.exe") and
not process.thread.Ext.call_stack_final_user_module.protection_provenance_path like
("c:\\windows\\microsoft.net\\framework*\\clr.dll",
"c:\\windows\\syswow64\\combase.dll",
"c:\\windows\\system32\\combase.dll") and
not (process.executable : "C:\\Windows\\ccmsetup\\cache\\ccmsetup.exe" and
process.parent.executable : ("C:\\Windows\\CCM\\CcmEval.exe", "C:\\Program Files\\SMS_CCM\\CcmEval.exe", "C:\\Windows\\CCM\\ccmrepair.exe")) and
not (process.Ext.api.name == "VirtualProtect" and
_arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info like ("c:\\windows\\sys?????\\ntdll.dll!LdrLoadDll*", "c:\\windows\\sys?????\\kernelbase.dll!LoadLibrary*")))
'''
min_endpoint_version = "8.14.2"
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
tree = true
[[optional_actions]]
action = "rollback"
field = "process.entity_id"
state = 0
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1562"
name = "Impair Defenses"
reference = "https://attack.mitre.org/techniques/T1562/"
[[threat.technique.subtechnique]]
id = "T1562.001"
name = "Disable or Modify Tools"
reference = "https://attack.mitre.org/techniques/T1562/001/"
[threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
[internal]
min_endpoint_version = "8.14.2"
Stages and Predicates
Stage 1: api
api where process.Ext.api.metadata.target_address_name like "amsi.dll*" and
((process.Ext.api.name in ("VirtualProtect", "VirtualProtectEx") and process.Ext.api.parameters.protection like "?W*") or
process.Ext.api.name == "WriteProcessMemory") and
not process.thread.Ext.call_stack_final_user_module.protection_provenance like "Kernel*" and
not process.thread.Ext.call_stack_final_user_module.name in ("Kernel", "Unknown", "Undetermined") and
not process.thread.Ext.call_stack_final_user_module.hash.sha256 in
("2ef4add3ecdc20e1234b0c3fa034cf110f5dfc01355f81ed773f797fcdc6a375",
"c2710daef53ff962522ec1e7e05cdc7147db3371dfbc71cb1cf7afe6382451e5",
"15dd664aee6bfd3cbe0a967d160f4f4b37fe3e8aef88dfb4547e77292226c0c4",
"a121de30d1b8cdf66d886f8cd02b4a35d477f2638d616673da76716a9466cae7",
"ce0644768cd505a8975d897a560186011fbcd2cbd6b309eb0688fc4d816a3451",
"23217cdb3ff108ee4e099f61afa6e33f65675ae0c25d7cc0a30554deca1b33dc",
"d0c7983d45bbbe52e10aa461226cef4049d30778a5d03c9663251edbcea5bd6e",
"b6f6b9f49c60a2230cbf1a3449c85434b70a3b46cc3727da3ef265ba46ac4967",
"902080ae0b0348dca5d526b8cefee280fec0e4eb7299af211ad522e6644032f4",
"5eea4cecd56c5c12f748a2c06729448419ca4deec2410314b6e9d184ecf64bad",
"384c31b964bac7f60c637ed032d735537adebf3611f78637887d042330655f24",
"4776e752dab37e0540f4f3b66a6686e549a9eba42ddfe2f22ee8bcd8e11d215e",
"3505e9318d1ca3472c7708ebaa1753b5cc0eda43c6f5210807a9e7ca8673a227",
"1ee57272a271e82eee1aebaab306c403b30a2e9df94ede777f17fe84670e5033") and
(
_arraysearch(process.thread.Ext.call_stack_final_user_module.code_signature, $entry, $entry.trusted == false or $entry.exists == false) or
_arraysearch(process.thread.Ext.call_stack_final_user_module.code_signature, $entry, $entry.subject_name in ("Microsoft Corporation", "Microsoft Windows", ".NET", "Python Software Foundation"))
) and
not _arraysearch(process.thread.Ext.call_stack_final_user_module.code_signature, $entry, $entry.trusted == true and
$entry.subject_name in ("Microsoft Windows Hardware Compatibility Publisher",
"Microsoft Windows Software Compatibility Publisher",
"MUSARUBRA US LLC")) and
not process.thread.Ext.call_stack_final_user_module.path like
("c:\\windows\\system32\\apphelp.dll",
"c:\\windows\\system32\\lsasrv.dll",
"c:\\windows\\system32\\combase.dll",
"c:\\windows\\system32\\ieadvpack.dll",
"c:\\windows\\syswow64\\*.dll",
"c:\\windows\\microsoft.net\\framework*.dll",
"c:\\windows\\assembly\\nativeimages_*.ni.dll",
"c:\\windows\\winsxs\\temp\\pendingdeletes\\$$deleteme*",
"c:\\windows\\system32\\mrt\\*\\mpengine.dll",
"c:\\windows\\system32\\wbem\\fastprox.dll",
"c:\\windows\\winsxs\\*.dll",
"c:\\program files (x86)\\*",
"c:\\program files\\*",
"c:\\windows\\syswow64\\werfault.exe") and
not process.thread.Ext.call_stack_final_user_module.protection_provenance_path like
("c:\\windows\\microsoft.net\\framework*\\clr.dll",
"c:\\windows\\syswow64\\combase.dll",
"c:\\windows\\system32\\combase.dll") and
not (process.executable : "C:\\Windows\\ccmsetup\\cache\\ccmsetup.exe" and
process.parent.executable : ("C:\\Windows\\CCM\\CcmEval.exe", "C:\\Program Files\\SMS_CCM\\CcmEval.exe", "C:\\Windows\\CCM\\ccmrepair.exe")) and
not (process.Ext.api.name == "VirtualProtect" and
_arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info like ("c:\\windows\\sys?????\\ntdll.dll!LdrLoadDll*", "c:\\windows\\sys?????\\kernelbase.dll!LoadLibrary*")))
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
process.Ext.api.metadata.target_address_name | wildcard |
| field:"process.Ext.api.metadata.target_address_name" kind:wildcard value:"amsi.dll*" |
process.Ext.api.name | eq |
| field:"process.Ext.api.name" kind:eq value:"WriteProcessMemory" |
process.Ext.api.name | in |
| field:"process.Ext.api.name" kind:in |
process.Ext.api.parameters.protection | wildcard |
| field:"process.Ext.api.parameters.protection" kind:wildcard value:"?W*" |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.thread.Ext.call_stack | array_any | excludes:process.thread.Ext.call_stack | |
process.Ext.api.name | eq | VirtualProtect | excludes:process.Ext.api.name field:"process.Ext.api.name" value:"VirtualProtect" |
process.thread.Ext.call_stack_final_user_module.code_signature | array_any | excludes:process.thread.Ext.call_stack_final_user_module.code_signature | |
process.executable | eq | C:\Windows\ccmsetup\cache\ccmsetup.exe | excludes:process.executable field:"process.executable" value:"C:\Windows\ccmsetup\cache\ccmsetup.exe" |
process.parent.executable | eq | C:\Windows\CCM\CcmEval.exe, C:\Program Files\SMS_CCM\CcmEval.exe, C:\Windows\CCM\ccmrepair.exe | excludes:process.parent.executable field:"process.parent.executable" value:"C:\Windows\CCM\CcmEval.exe" field:"process.parent.executable" value:"C:\Program Files\SMS_CCM\CcmEval.exe" field:"process.parent.executable" value:"C:\Windows\CCM\ccmrepair.exe" |
process.thread.Ext.call_stack_final_user_module.hash.sha256 | in | 15dd664aee6bfd3cbe0a967d160f4f4b37fe3e8aef88dfb4547e77292226c0c4, 1ee57272a271e82eee1aebaab306c403b30a2e9df94ede777f17fe84670e5033, 23217cdb3ff108ee4e099f61afa6e33f65675ae0c25d7cc0a30554deca1b33dc, 2ef4add3ecdc20e1234b0c3fa034cf110f5dfc01355f81ed773f797fcdc6a375, 3505e9318d1ca3472c7708ebaa1753b5cc0eda43c6f5210807a9e7ca8673a227, 384c31b964bac7f60c637ed032d735537adebf3611f78637887d042330655f24, 4776e752dab37e0540f4f3b66a6686e549a9eba42ddfe2f22ee8bcd8e11d215e, 5eea4cecd56c5c12f748a2c06729448419ca4deec2410314b6e9d184ecf64bad, 902080ae0b0348dca5d526b8cefee280fec0e4eb7299af211ad522e6644032f4, a121de30d1b8cdf66d886f8cd02b4a35d477f2638d616673da76716a9466cae7, b6f6b9f49c60a2230cbf1a3449c85434b70a3b46cc3727da3ef265ba46ac4967, c2710daef53ff962522ec1e7e05cdc7147db3371dfbc71cb1cf7afe6382451e5, ce0644768cd505a8975d897a560186011fbcd2cbd6b309eb0688fc4d816a3451, d0c7983d45bbbe52e10aa461226cef4049d30778a5d03c9663251edbcea5bd6e | excludes:process.thread.Ext.call_stack_final_user_module.hash.sha256 |
process.thread.Ext.call_stack_final_user_module.name | in | Kernel, Undetermined, Unknown | excludes:process.thread.Ext.call_stack_final_user_module.name field:"process.thread.Ext.call_stack_final_user_module.name" value:"Kernel" field:"process.thread.Ext.call_stack_final_user_module.name" value:"Undetermined" field:"process.thread.Ext.call_stack_final_user_module.name" value:"Unknown" |
process.thread.Ext.call_stack_final_user_module.path | wildcard | c:\windows\system32\apphelp.dll, c:\windows\system32\lsasrv.dll, c:\windows\system32\combase.dll, c:\windows\system32\ieadvpack.dll, c:\windows\syswow64\*.dll, c:\windows\microsoft.net\framework*.dll, c:\windows\assembly\nativeimages_*.ni.dll, c:\windows\winsxs\temp\pendingdeletes\$$deleteme*, c:\windows\system32\mrt\*\mpengine.dll, c:\windows\system32\wbem\fastprox.dll, c:\windows\winsxs\*.dll, c:\program files (x86)\*, c:\program files\*, c:\windows\syswow64\werfault.exe | excludes:process.thread.Ext.call_stack_final_user_module.path |
process.thread.Ext.call_stack_final_user_module.protection_provenance | starts_with | Kernel | excludes:process.thread.Ext.call_stack_final_user_module.protection_provenance field:"process.thread.Ext.call_stack_final_user_module.protection_provenance" value:"Kernel" |
process.thread.Ext.call_stack_final_user_module.protection_provenance_path | wildcard | c:\windows\microsoft.net\framework*\clr.dll, c:\windows\syswow64\combase.dll, c:\windows\system32\combase.dll | excludes:process.thread.Ext.call_stack_final_user_module.protection_provenance_path field:"process.thread.Ext.call_stack_final_user_module.protection_provenance_path" value:"c:\windows\microsoft.net\framework*\clr.dll" field:"process.thread.Ext.call_stack_final_user_module.protection_provenance_path" value:"c:\windows\syswow64\combase.dll" field:"process.thread.Ext.call_stack_final_user_module.protection_provenance_path" value:"c:\windows\system32\combase.dll" |
AWS EC2 Network Access Control List Deletion
#Identifies the deletion of an Amazon Elastic Compute Cloud (EC2) network access control list (ACL) or one of its ingress/egress entries.
Known False Positives
- Network ACL's may be deleted by a network administrator. Verify whether the user identity, user agent, and/or hostname should be making changes in your environment. Network ACL deletions by unfamiliar users or hosts should be investigated. If known behavior is causing false positives, it can be exempted from the rule.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Defense Impairment |
Telemetry Coverage
Rule Body
[metadata]
creation_date = "2020/05/26"
integration = ["aws"]
maturity = "production"
updated_date = "2026/08/05"
[rule]
author = ["Elastic"]
description = """
Identifies the deletion of an Amazon Elastic Compute Cloud (EC2) network access control list (ACL) or one of its ingress/egress entries.
"""
false_positives = [
"""
Network ACL's may be deleted by a network administrator. Verify whether the user identity, user agent, and/or hostname should be making changes in your environment. Network ACL deletions by unfamiliar users or hosts should be investigated. If known behavior is causing false positives, it can be exempted from the rule.
""",
]
from = "now-6m"
index = ["filebeat-*", "logs-aws.cloudtrail-*"]
interval = "5m"
language = "kuery"
license = "Elastic License v2"
name = "AWS EC2 Network Access Control List Deletion"
note = """## Triage and analysis
### Investigating AWS EC2 Network Access Control List Deletion
AWS EC2 Network ACLs are essential for controlling inbound and outbound traffic to subnets, acting as a firewall layer. Adversaries may delete these ACLs to disable security controls, facilitating unauthorized access or data exfiltration. The detection rule monitors AWS CloudTrail logs for successful deletion events of ACLs or their entries, signaling potential defense evasion attempts.
### Possible investigation steps
- Review the AWS CloudTrail logs to identify the specific user or role associated with the deletion event by examining the user identity information in the logs.
- Check the time and date of the deletion event to determine if it coincides with any other suspicious activities or known maintenance windows.
- Investigate the source IP address and location from which the deletion request was made to assess if it aligns with expected access patterns or if it appears anomalous.
- Examine the AWS account activity around the time of the event to identify any other unusual actions or changes, such as the creation of new resources or modifications to existing ones.
- Assess the impact of the deleted Network ACL or entries by identifying the affected subnets and evaluating the potential exposure or risk to the network.
- Review any recent changes to IAM policies or roles that might have inadvertently granted excessive permissions to users or services, allowing them to delete Network ACLs.
### False positive analysis
- Routine maintenance or updates by authorized personnel may trigger deletion events. Verify if the deletion aligns with scheduled maintenance activities and consider excluding these events from alerts.
- Automated scripts or infrastructure-as-code tools like Terraform or CloudFormation might delete and recreate ACLs as part of normal operations. Identify these tools and exclude their actions from triggering alerts.
- Changes in network architecture or security policy updates can lead to legitimate ACL deletions. Document these changes and adjust the detection rule to ignore such planned modifications.
- Ensure that the AWS accounts involved in the deletion events are recognized and trusted. Exclude actions from these accounts if they are part of regular administrative tasks.
- Collaborate with the security team to establish a baseline of normal ACL deletion activities and refine the detection rule to minimize false positives based on this baseline.
### Response and remediation
- Immediately isolate the affected subnet to prevent further unauthorized access or data exfiltration. This can be done by applying a restrictive security group or temporarily removing the subnet from the VPC.
- Review AWS CloudTrail logs to identify the source of the deletion event, including the IAM user or role responsible, and assess whether the action was authorized or part of a larger compromise.
- Recreate the deleted Network ACL or its entries using the most recent backup or configuration documentation to restore intended security controls.
- Implement a temporary monitoring solution to track any further unauthorized changes to network ACLs or related security configurations.
- Escalate the incident to the security operations team for a comprehensive investigation to determine the root cause and scope of the breach, including potential lateral movement or data exfiltration.
- Revoke or rotate credentials for any compromised IAM users or roles involved in the deletion event to prevent further unauthorized actions.
- Enhance detection capabilities by configuring alerts for any future unauthorized changes to network ACLs, ensuring rapid response to similar threats.
## Setup
The AWS Fleet integration, Filebeat module, or similarly structured data is required to be compatible with this rule."""
references = [
"https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ec2/delete-network-acl.html",
"https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DeleteNetworkAcl.html",
"https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ec2/delete-network-acl-entry.html",
"https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DeleteNetworkAclEntry.html",
]
risk_score = 47
rule_id = "8623535c-1e17-44e1-aa97-7a0699c3037d"
severity = "medium"
tags = [
"Domain: Cloud",
"Platform: AWS",
"Data Source: AWS CloudTrail",
"Service: AWS EC2",
"Tactic: Defense Evasion",
"Rule Type: Custom Query (KQL)",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "query"
query = '''
data_stream.dataset:aws.cloudtrail and event.provider:ec2.amazonaws.com and event.action:(DeleteNetworkAcl or DeleteNetworkAclEntry) and event.outcome:success
and not user_agent.original: (*Terraform* or *Pulumi* or *Ansible*)
'''
[rule.investigation_fields]
field_names = [
"@timestamp",
"user.name",
"user_agent.original",
"source.address",
"aws.cloudtrail.user_identity.arn",
"aws.cloudtrail.user_identity.type",
"aws.cloudtrail.user_identity.access_key_id",
"event.action",
"event.outcome",
"cloud.account.id",
"cloud.region",
"aws.cloudtrail.request_parameters",
"aws.cloudtrail.response_elements"
]
[[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.007"
name = "Disable or Modify Cloud Firewall"
reference = "https://attack.mitre.org/techniques/T1562/007/"
[rule.threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
Stages and Predicates
Stage 1: query
data_stream.dataset:aws.cloudtrail and event.provider:ec2.amazonaws.com and event.action:(DeleteNetworkAcl or DeleteNetworkAclEntry) and event.outcome:success
and not user_agent.original: (*Terraform* or *Pulumi* or *Ansible*)
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
data_stream.dataset | eq |
| field:"data_stream.dataset" kind:eq value:"aws.cloudtrail" |
event.action | in |
| field:"EventType" kind:in |
event.outcome | eq |
| field:"event.outcome" kind:eq value:"success" |
event.provider | eq |
| field:"Provider_Name" kind:eq value:"ec2.amazonaws.com" |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
user_agent.original | match | Ansible | excludes:user_agent.original field:"user_agent.original" value:"Ansible" |
user_agent.original | match | Pulumi | excludes:user_agent.original field:"user_agent.original" value:"Pulumi" |
user_agent.original | match | Terraform | excludes:user_agent.original field:"user_agent.original" value:"Terraform" |
AWS Sensitive IAM Operations Performed via CloudShell
#Identifies sensitive AWS IAM operations performed via AWS CloudShell based on the user agent string. CloudShell is a browser-based shell that provides command-line access to AWS resources directly from the AWS Management Console. While convenient for administrators, CloudShell access from compromised console sessions can enable attackers to perform privileged operations without installing tools or using programmatic credentials. This rule detects high-risk actions such as creating IAM users, access keys, roles, or attaching policies when initiated from CloudShell, which may indicate post-compromise credential harvesting or privilege escalation activity.
Known False Positives
- Administrators may legitimately use CloudShell for IAM management tasks during routine operations or troubleshooting. Verify whether the user, source IP, and specific actions align with expected administrative workflows. Establish a baseline of normal CloudShell usage patterns to reduce false positives.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Persistence | |
| Privilege Escalation |
Telemetry Coverage
Rules Detecting the Same Action
These rules filter on the same operation.
- AWS Compromised IAM Key Quarantine (Panther)
- AWS IAM AdministratorAccess Policy Attached to Role (Elastic)
- AWS IAM AdministratorAccess Policy Attached to User (Elastic)
- AWS IAM Backdoor Users Keys (Sigma)
- AWS IAM Create User via Assumed Role on EC2 Instance (Elastic)
- AWS IAM Credentials Added to a Bedrock API Key Phantom User (Elastic)
- AWS IAM Customer-Managed Policy Attached to Role by Rare User (Elastic)
- AWS IAM S3Browser Templated S3 Bucket Policy Creation (Sigma)
Rule Body
[metadata]
creation_date = "2026/02/10"
integration = ["aws"]
maturity = "production"
updated_date = "2026/07/08"
[rule]
author = ["Elastic"]
description = """
Identifies sensitive AWS IAM operations performed via AWS CloudShell based on the user agent string. CloudShell is a
browser-based shell that provides command-line access to AWS resources directly from the AWS Management Console. While
convenient for administrators, CloudShell access from compromised console sessions can enable attackers to perform
privileged operations without installing tools or using programmatic credentials. This rule detects high-risk actions
such as creating IAM users, access keys, roles, or attaching policies when initiated from CloudShell, which may indicate
post-compromise credential harvesting or privilege escalation activity.
"""
false_positives = [
"""
Administrators may legitimately use CloudShell for IAM management tasks during routine operations or
troubleshooting. Verify whether the user, source IP, and specific actions align with expected administrative
workflows. Establish a baseline of normal CloudShell usage patterns to reduce false positives.
""",
]
from = "now-6m"
index = ["logs-aws.cloudtrail-*"]
language = "kuery"
license = "Elastic License v2"
name = "AWS Sensitive IAM Operations Performed via CloudShell"
note = """## Triage and analysis
### Investigating AWS Sensitive IAM Operations Performed via CloudShell
AWS CloudShell is a browser-based shell environment that provides instant command-line access to AWS resources without requiring local CLI installation or credential configuration. While this is convenient for legitimate administrators, it also provides adversaries with a powerful tool if they gain access to a compromised AWS console session. Attackers can use CloudShell to perform sensitive operations without leaving artifacts on their local systems.
This rule detects high-risk IAM operations performed via CloudShell, including credential creation, user management, and policy attachment. These actions are commonly seen in post-compromise scenarios where attackers establish persistence or escalate privileges.
### Possible investigation steps
- **Identify the actor**
- Review `aws.cloudtrail.user_identity.arn` to determine which IAM principal performed the action.
- Check `source.ip` and `source.geo` fields to verify the request origin matches expected administrator locations.
- Investigate the console login event that established the CloudShell session.
- **Analyze the specific action**
- Review `event.action` to understand exactly what operation was performed.
- For `CreateAccessKey` or `CreateUser`, identify the target principal and assess whether this was authorized.
- For policy attachments, review which policies were attached and to which entities.
- **Review request and response details**
- Examine `aws.cloudtrail.request_parameters` for specifics like user names, policy ARNs, or role configurations.
- Check `aws.cloudtrail.response_elements` for created resource identifiers.
- **Correlate with surrounding activity**
- Search for preceding events such as `ConsoleLogin` from the same session or IP address.
- Look for MFA bypass indicators or unusual login patterns before CloudShell usage.
- Check for subsequent use of any created credentials or roles.
- **Assess the broader context**
- Determine if this CloudShell usage pattern is typical for this user.
- Review recent access patterns for the console session that initiated CloudShell.
### False positive analysis
- Routine administrative tasks using CloudShell are common in some organizations. Create baseline profiles for users who regularly use CloudShell.
- Infrastructure automation testing may involve CloudShell for quick validation. Verify with the user.
### Response and remediation
- If unauthorized, immediately terminate the console session and revoke any created credentials.
- Rotate credentials for any IAM users or roles that may have been compromised.
- Review and remove any unauthorized users, access keys, roles, or policy attachments.
- Consider restricting CloudShell access via SCPs or IAM policies for sensitive accounts.
- Implement session duration limits to reduce the window of opportunity for console session abuse.
### Additional information
- **[AWS IR Playbooks](https://github.com/aws-samples/aws-incident-response-playbooks/blob/c151b0dc091755fffd4d662a8f29e2f6794da52c/playbooks/)**
- **[AWS Customer Playbook Framework](https://github.com/aws-samples/aws-customer-playbook-framework/tree/a8c7b313636b406a375952ac00b2d68e89a991f2/docs)**
"""
references = [
"https://docs.aws.amazon.com/cloudshell/latest/userguide/welcome.html",
"https://permiso.io/blog/lucr-3-scattered-spider-getting-saas-y-in-the-cloud",
"https://www.cisa.gov/news-events/cybersecurity-advisories/aa23-320a",
]
risk_score = 73
rule_id = "41554afd-d839-4cc2-b185-170ac01cbefc"
severity = "high"
tags = [
"Domain: Cloud",
"Data Source: AWS",
"Data Source: Amazon Web Services",
"Data Source: AWS CloudTrail",
"Data Source: AWS IAM",
"Tactic: Persistence",
"Tactic: Privilege Escalation",
"Use Case: Threat Detection",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "query"
query = '''
data_stream.dataset: "aws.cloudtrail"
and event.provider: "iam.amazonaws.com"
and event.action: (
"CreateAccessKey" or
"CreateUser" or
"AttachUserPolicy" or
"PutUserPolicy" or
"CreateRole" or
"AttachRolePolicy" or
"PutRolePolicy" or
"CreateInstanceProfile" or
"AddRoleToInstanceProfile"
)
and event.outcome: "success"
and user_agent.original: *CloudShell*
'''
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1098"
name = "Account Manipulation"
reference = "https://attack.mitre.org/techniques/T1098/"
[[rule.threat.technique.subtechnique]]
id = "T1098.001"
name = "Additional Cloud Credentials"
reference = "https://attack.mitre.org/techniques/T1098/001/"
[[rule.threat.technique]]
id = "T1136"
name = "Create Account"
reference = "https://attack.mitre.org/techniques/T1136/"
[[rule.threat.technique.subtechnique]]
id = "T1136.003"
name = "Cloud Account"
reference = "https://attack.mitre.org/techniques/T1136/003/"
[rule.threat.tactic]
id = "TA0003"
name = "Persistence"
reference = "https://attack.mitre.org/tactics/TA0003/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1098"
name = "Account Manipulation"
reference = "https://attack.mitre.org/techniques/T1098/"
[[rule.threat.technique.subtechnique]]
id = "T1098.001"
name = "Additional Cloud Credentials"
reference = "https://attack.mitre.org/techniques/T1098/001/"
[[rule.threat.technique.subtechnique]]
id = "T1098.003"
name = "Additional Cloud Roles"
reference = "https://attack.mitre.org/techniques/T1098/003/"
[rule.threat.tactic]
id = "TA0004"
name = "Privilege Escalation"
reference = "https://attack.mitre.org/tactics/TA0004/"
[rule.investigation_fields]
field_names = [
"@timestamp",
"user.name",
"user_agent.original",
"source.ip",
"aws.cloudtrail.user_identity.arn",
"aws.cloudtrail.user_identity.type",
"aws.cloudtrail.user_identity.access_key_id",
"event.action",
"event.outcome",
"cloud.account.id",
"cloud.region",
"aws.cloudtrail.request_parameters",
"aws.cloudtrail.response_elements",
]
Stages and Predicates
Stage 1: query
data_stream.dataset: "aws.cloudtrail"
and event.provider: "iam.amazonaws.com"
and event.action: (
"CreateAccessKey" or
"CreateUser" or
"AttachUserPolicy" or
"PutUserPolicy" or
"CreateRole" or
"AttachRolePolicy" or
"PutRolePolicy" or
"CreateInstanceProfile" or
"AddRoleToInstanceProfile"
)
and event.outcome: "success"
and user_agent.original: *CloudShell*
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
data_stream.dataset | eq |
| field:"data_stream.dataset" kind:eq value:"aws.cloudtrail" |
event.action | in |
| field:"EventType" kind:in |
event.outcome | eq |
| field:"event.outcome" kind:eq value:"success" |
event.provider | eq |
| field:"Provider_Name" kind:eq value:"iam.amazonaws.com" |
user_agent.original | wildcard |
| field:"aws::userAgent" kind:wildcard value:"*CloudShell*" |
Base16 or Base32 Encoding/Decoding Activity
#Base16 and Base32 are encoding schemes that convert binary data into text, making it easier to transmit and store. This rule monitors for Base16 or Base32 encoding and decoding activity on Linux systems. Attackers may use these encoding schemes to obfuscate malicious payloads, evade detection, and facilitate data exfiltration.
Known False Positives
- Automated tools such as Jenkins may encode or decode files as part of their normal behavior. These events can be filtered by the process executable or username values.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Stealth | |
| Command & Control |
Rule Body
[metadata]
creation_date = "2020/04/17"
integration = ["endpoint", "auditd_manager", "crowdstrike", "sentinel_one_cloud_funnel"]
maturity = "production"
updated_date = "2026/03/24"
[rule]
author = ["Elastic"]
description = """
Base16 and Base32 are encoding schemes that convert binary data into text, making it easier to transmit and store. This rule
monitors for Base16 or Base32 encoding and decoding activity on Linux systems. Attackers may use these encoding schemes to
obfuscate malicious payloads, evade detection, and facilitate data exfiltration.
"""
false_positives = [
"""
Automated tools such as Jenkins may encode or decode files as part of their normal behavior. These events can be
filtered by the process executable or username values.
""",
]
from = "now-9m"
index = [
"auditbeat-*",
"endgame-*",
"logs-auditd_manager.auditd-*",
"logs-crowdstrike.fdr*",
"logs-endpoint.events.process*",
"logs-sentinel_one_cloud_funnel.*",
]
language = "eql"
license = "Elastic License v2"
name = "Base16 or Base32 Encoding/Decoding Activity"
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 Base16 or Base32 Encoding/Decoding Activity
Base16 and Base32 are encoding schemes used to convert binary data into text, facilitating data transmission and storage. Adversaries exploit these encodings to obfuscate malicious payloads, evading detection by security systems. The detection rule identifies suspicious encoding/decoding activities on Linux systems by monitoring specific processes and actions, excluding benign uses like help or version checks.
### Possible investigation steps
- Review the process name and arguments to confirm if the activity is related to encoding/decoding using base16 or base32, ensuring it is not a benign use case like help or version checks.
- Examine the user account associated with the process to determine if the activity aligns with their typical behavior or if it appears suspicious.
- Check the parent process of the encoding/decoding activity to identify if it was initiated by a legitimate application or a potentially malicious script or program.
- Investigate the timing and frequency of the encoding/decoding events to assess if they coincide with other suspicious activities or known attack patterns.
- Correlate the event with network activity logs to see if there is any data exfiltration attempt or communication with known malicious IP addresses or domains.
- Look into any recent changes or anomalies in the system that might indicate a compromise, such as unauthorized file modifications or new user accounts.
### False positive analysis
- Routine administrative tasks may trigger the rule if administrators use base16 or base32 commands for legitimate data encoding or decoding. To manage this, create exceptions for specific user accounts or scripts known to perform these tasks regularly.
- Automated backup or data transfer processes might use base16 or base32 encoding as part of their operations. Identify these processes and exclude them by specifying their unique process arguments or execution paths.
- Development and testing environments often involve encoding and decoding operations for debugging or data manipulation. Exclude these environments by filtering based on hostnames or IP addresses associated with non-production systems.
- Security tools or scripts that perform regular encoding checks for data integrity or compliance purposes can also trigger false positives. Whitelist these tools by their process names or execution contexts to prevent unnecessary alerts.
- Educational or research activities involving encoding techniques may inadvertently match the rule criteria. Consider excluding known educational user groups or specific research project identifiers to reduce false positives.
### Response and remediation
- Isolate the affected system from the network to prevent potential lateral movement or data exfiltration by the adversary.
- Terminate any suspicious processes identified by the detection rule, specifically those involving base16 or base32 encoding/decoding without benign arguments.
- Conduct a thorough review of recent system logs and process execution history to identify any additional suspicious activities or related processes.
- Remove any malicious files or payloads that have been identified as part of the encoding/decoding activity.
- Restore any affected files or systems from known good backups to ensure system integrity and data accuracy.
- Update and patch the affected system to close any vulnerabilities that may have been exploited by the adversary.
- Escalate the incident to the security operations center (SOC) or incident response team for further analysis and to determine if additional systems are affected."""
risk_score = 47
rule_id = "debff20a-46bc-4a4d-bae5-5cdd14222795"
setup = """## Setup
This rule requires data coming in from one of the following integrations:
- Elastic Defend
- Auditbeat
### Elastic Defend Integration Setup
Elastic Defend is integrated into the Elastic Agent using Fleet. Upon configuration, the integration allows the Elastic Agent to monitor events on your host and send data to the Elastic Security app.
#### Prerequisite Requirements:
- Fleet is required for Elastic Defend.
- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).
#### The following steps should be executed in order to add the Elastic Defend integration on a Linux System:
- Go to the Kibana home page and click "Add integrations".
- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.
- Click "Add Elastic Defend".
- Configure the integration name and optionally add a description.
- Select the type of environment you want to protect, either "Traditional Endpoints" or "Cloud Workloads".
- Select a configuration preset. Each preset comes with different default settings for Elastic Agent, you can further customize these later by configuring the Elastic Defend integration policy. [Helper guide](https://www.elastic.co/guide/en/security/current/configure-endpoint-integration-policy.html).
- We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"
- Enter a name for the agent policy in "New agent policy name". If other agent policies already exist, you can click the "Existing hosts" tab and select an existing policy instead.
For more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/8.10/agent-policy.html).
- Click "Save and Continue".
- To complete the integration, select "Add Elastic Agent to your hosts" and continue to the next section to install the Elastic Agent on your hosts.
For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
### Auditbeat Setup
Auditbeat is a lightweight shipper that you can install on your servers to audit the activities of users and processes on your systems. For example, you can use Auditbeat to collect and centralize audit events from the Linux Audit Framework. You can also use Auditbeat to detect changes to critical files, like binaries and configuration files, and identify potential security policy violations.
#### The following steps should be executed in order to add the Auditbeat on a Linux System:
- Elastic provides repositories available for APT and YUM-based distributions. Note that we provide binary packages, but no source packages.
- To install the APT and YUM repositories follow the setup instructions in this [helper guide](https://www.elastic.co/guide/en/beats/auditbeat/current/setup-repositories.html).
- To run Auditbeat on Docker follow the setup instructions in the [helper guide](https://www.elastic.co/guide/en/beats/auditbeat/current/running-on-docker.html).
- To run Auditbeat on Kubernetes follow the setup instructions in the [helper guide](https://www.elastic.co/guide/en/beats/auditbeat/current/running-on-kubernetes.html).
- For complete “Setup and Run Auditbeat” information refer to the [helper guide](https://www.elastic.co/guide/en/beats/auditbeat/current/setting-up-and-running.html).
"""
severity = "medium"
tags = [
"Domain: Endpoint",
"OS: Linux",
"Use Case: Threat Detection",
"Tactic: Defense Evasion",
"Data Source: Elastic Endgame",
"Data Source: Elastic Defend",
"Data Source: Auditd Manager",
"Data Source: Crowdstrike",
"Data Source: SentinelOne",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
process where host.os.type == "linux" and event.type == "start" and
event.action in ("exec", "exec_event", "start", "ProcessRollup2", "executed", "process_started") and
process.name in ("base16", "base32", "base32plain", "base32hex") and
not process.args in ("--help", "--version")
'''
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1027"
name = "Obfuscated Files or Information"
reference = "https://attack.mitre.org/techniques/T1027/"
[[rule.threat.technique]]
id = "T1140"
name = "Deobfuscate/Decode Files or Information"
reference = "https://attack.mitre.org/techniques/T1140/"
[rule.threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1132"
name = "Data Encoding"
reference = "https://attack.mitre.org/techniques/T1132/"
[[rule.threat.technique.subtechnique]]
id = "T1132.001"
name = "Standard Encoding"
reference = "https://attack.mitre.org/techniques/T1132/001/"
[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 == "linux" and event.type == "start" and
event.action in ("exec", "exec_event", "start", "ProcessRollup2", "executed", "process_started") and
process.name in ("base16", "base32", "base32plain", "base32hex") and
not process.args in ("--help", "--version")
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 | in |
| field:"process_basename" kind:in |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.args | in | --help, --version | excludes:process.args field:"process.args" value:"--help" field:"process.args" value:"--version" |
Deprecated - M365 Security Compliance Potential Ransomware Activity
#Identifies when Microsoft Cloud App Security flags potential ransomware activity in Microsoft 365. This rule detects events where the Security Compliance Center reports a "Ransomware activity" or "Potential ransomware activity" alert, which may indicate file encryption, mass file modifications, or uploads of ransomware-infected files to cloud services such as SharePoint or OneDrive.
Known False Positives
- If Cloud App Security identifies, for example, a high rate of file uploads or file deletion activities it may represent an adverse encryption process.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Impact |
Rules Detecting the Same Action
These rules filter on the same operation.
Rule Body
[metadata]
creation_date = "2021/07/15"
integration = ["o365"]
maturity = "production"
updated_date = "2026/04/10"
[rule]
author = ["Elastic", "Austin Songer"]
description = """
Identifies when Microsoft Cloud App Security flags potential ransomware activity in Microsoft 365. This rule detects
events where the Security Compliance Center reports a "Ransomware activity" or "Potential ransomware activity" alert,
which may indicate file encryption, mass file modifications, or uploads of ransomware-infected files to cloud services
such as SharePoint or OneDrive.
"""
false_positives = [
"""
If Cloud App Security identifies, for example, a high rate of file uploads or file deletion activities it may
represent an adverse encryption process.
""",
]
from = "now-9m"
index = ["logs-o365.audit-*", "filebeat-*"]
language = "kuery"
license = "Elastic License v2"
name = "Deprecated - M365 Security Compliance Potential Ransomware Activity"
note = """## Triage and analysis
### Investigating Deprecated - M365 Security Compliance Potential Ransomware Activity
Microsoft 365's cloud services can be exploited by adversaries to distribute ransomware by uploading infected files. This detection rule leverages Microsoft Cloud App Security to identify suspicious uploads, focusing on successful events flagged as potential ransomware activity. By monitoring specific event datasets and actions, it helps security analysts pinpoint and mitigate ransomware threats, aligning with MITRE ATT&CK's impact tactics.
### Possible investigation steps
- Identify the affected user account and review their recent file activity in Microsoft 365 for signs of mass file encryption, renaming with unusual extensions, or rapid file modifications.
- Examine the file names, extensions, and metadata of the flagged uploads to determine if they match known ransomware patterns (e.g., `.encrypted`, `.locked`, or ransom note files like `README.txt` or `DECRYPT_INSTRUCTIONS.html`).
- Correlate this alert with other security events from the same user or source IP, such as impossible travel, failed login attempts, or suspicious inbox rules, to identify potential account compromise.
- Check whether the affected user's endpoint shows signs of ransomware execution, such as high CPU usage, mass file system changes, or known ransomware process names.
- Review SharePoint or OneDrive file version history to determine the scope of encrypted or modified files and whether recovery via version rollback is possible.
- Contact the user to verify whether the activity is legitimate or if their account or device may have been compromised.
### False positive analysis
- Legitimate file uploads by trusted users may trigger alerts if the files are mistakenly flagged as ransomware. To manage this, create exceptions for specific users or groups who frequently upload large volumes of files.
- Automated backup processes that upload encrypted files to the cloud can be misidentified as ransomware activity. Exclude these processes by identifying and whitelisting the associated service accounts or IP addresses.
- Certain file types or extensions commonly used in business operations might be flagged. Review and adjust the detection rule to exclude these file types if they are consistently identified as false positives.
- Collaborative tools that sync files across devices may cause multiple uploads that appear suspicious. Monitor and exclude these tools by recognizing their typical behavior patterns and adjusting the rule settings accordingly.
### Response and remediation
- Immediately isolate the affected user account to prevent further uploads and potential spread of ransomware within the cloud environment.
- Quarantine the uploaded files flagged as potential ransomware to prevent access and further distribution.
- Conduct a thorough scan of the affected user's devices and cloud storage for additional signs of ransomware or other malicious activity.
- Notify the security operations team to initiate a deeper investigation into the source and scope of the ransomware activity.
- Restore any affected files from secure backups, ensuring that the backups are clean and free from ransomware.
- Review and update access controls and permissions for the affected user and related accounts to minimize the risk of future incidents.
- Escalate the incident to senior security management and, if necessary, involve legal or compliance teams to assess any regulatory implications.
"""
references = [
"https://docs.microsoft.com/en-us/cloud-app-security/anomaly-detection-policy",
"https://docs.microsoft.com/en-us/cloud-app-security/policy-template-reference",
"https://www.microsoft.com/en-us/security/blog/threat-intelligence/ransomware/",
]
risk_score = 47
rule_id = "721999d0-7ab2-44bf-b328-6e63367b9b29"
severity = "medium"
tags = [
"Domain: Cloud",
"Domain: SaaS",
"Data Source: Microsoft 365",
"Data Source: Microsoft 365 Audit Logs",
"Use Case: Threat Detection",
"Tactic: Impact",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "query"
query = '''
data_stream.dataset:o365.audit and
event.provider:SecurityComplianceCenter and
event.category:web and
rule.name:("Ransomware activity" or "Potential ransomware activity") and
event.outcome:success
'''
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1486"
name = "Data Encrypted for Impact"
reference = "https://attack.mitre.org/techniques/T1486/"
[[rule.threat.technique]]
id = "T1565"
name = "Data Manipulation"
reference = "https://attack.mitre.org/techniques/T1565/"
[[rule.threat.technique.subtechnique]]
id = "T1565.001"
name = "Stored Data Manipulation"
reference = "https://attack.mitre.org/techniques/T1565/001/"
[rule.threat.tactic]
id = "TA0040"
name = "Impact"
reference = "https://attack.mitre.org/tactics/TA0040/"
Stages and Predicates
Stage 1: query
data_stream.dataset:o365.audit and
event.provider:SecurityComplianceCenter and
event.category:web and
rule.name:("Ransomware activity" or "Potential ransomware activity") and
event.outcome:success
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
data_stream.dataset | eq |
| field:"data_stream.dataset" kind:eq value:"o365.audit" |
event.category | eq |
| field:"event.category" kind:eq value:"web" |
event.outcome | eq |
| field:"event.outcome" kind:eq value:"success" |
event.provider | eq |
| field:"Provider_Name" kind:eq value:"SecurityComplianceCenter" |
rule.name | in |
| field:"rule.name" kind:in |
DNS Global Query Block List Modified or Disabled
#Identifies changes to the DNS Global Query Block List (GQBL), a security feature that prevents the resolution of certain DNS names often exploited in attacks like WPAD spoofing. Attackers with certain privileges, such as DNSAdmins, can modify or disable the GQBL, allowing exploitation of hosts running WPAD with default settings for privilege escalation and lateral movement.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Persistence | |
| Defense Impairment | |
| Credential Access |
Telemetry Coverage
Rule Body
[metadata]
creation_date = "2024/05/31"
integration = ["endpoint", "windows", "m365_defender", "sentinel_one_cloud_funnel", "crowdstrike"]
maturity = "production"
updated_date = "2026/05/04"
[rule]
author = ["Elastic"]
description = """
Identifies changes to the DNS Global Query Block List (GQBL), a security feature that prevents the resolution of certain
DNS names often exploited in attacks like WPAD spoofing. Attackers with certain privileges, such as DNSAdmins, can
modify or disable the GQBL, allowing exploitation of hosts running WPAD with default settings for privilege escalation
and lateral movement.
"""
from = "now-9m"
index = [
"logs-endpoint.events.registry-*",
"logs-windows.sysmon_operational-*",
"winlogbeat-*",
"logs-m365_defender.event-*",
"logs-sentinel_one_cloud_funnel.*",
"endgame-*",
"logs-crowdstrike.fdr*",
]
language = "eql"
license = "Elastic License v2"
name = "DNS Global Query Block List Modified or Disabled"
note = """## Triage and analysis
> **Disclaimer**:
> This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.
### Investigating DNS Global Query Block List Modified or Disabled
The DNS Global Query Block List (GQBL) is a security feature in Windows environments that blocks the resolution of specific DNS names, such as WPAD, to prevent attacks like spoofing. Adversaries with elevated privileges can alter or disable the GQBL, enabling them to exploit default settings for privilege escalation. The detection rule monitors registry changes indicating such modifications, flagging potential defense evasion attempts.
### Possible investigation steps
- Review the registry event logs to confirm the specific changes made to the DNS Global Query Block List, focusing on the registry values "EnableGlobalQueryBlockList" and "GlobalQueryBlockList".
- Identify the user account associated with the registry change event to determine if the account has elevated privileges, such as DNSAdmins, which could indicate potential misuse.
- Check for any recent changes in user permissions or group memberships that might have granted the necessary privileges to modify the GQBL.
- Investigate any other suspicious activities or alerts related to the same user or host around the time of the registry change to identify potential lateral movement or privilege escalation attempts.
- Correlate the event with network traffic logs to detect any unusual DNS queries or attempts to resolve WPAD or other blocked names, which could suggest exploitation attempts.
- Review system and security logs for any signs of unauthorized access or other indicators of compromise on the affected host.
### False positive analysis
- Legitimate administrative changes to DNS settings by IT staff can trigger the rule. To manage this, create exceptions for known maintenance windows or authorized personnel making these changes.
- Automated scripts or software updates that modify DNS settings might be flagged. Identify and whitelist these processes if they are verified as safe and necessary for system operations.
- Changes made by security tools or network management software that adjust DNS settings for legitimate reasons can be mistaken for threats. Review and exclude these tools from monitoring if they are part of the organization's approved security infrastructure.
- In environments where WPAD is intentionally used, the absence of "wpad" in the GlobalQueryBlockList might be a normal configuration. Document and exclude these cases if they align with the organization's network design and security policies.
### Response and remediation
- Immediately isolate the affected system from the network to prevent further exploitation or lateral movement.
- Revert any unauthorized changes to the DNS Global Query Block List by restoring the registry settings to their default state, ensuring WPAD and other critical entries are included.
- Conduct a thorough review of user accounts with elevated privileges, such as DNSAdmins, to identify any unauthorized access or privilege escalation. Revoke unnecessary privileges and reset credentials as needed.
- Deploy endpoint detection and response (EDR) tools to scan the affected system for additional indicators of compromise or malicious activity, focusing on defense evasion techniques.
- Monitor network traffic for signs of WPAD spoofing or other related attacks, and implement network segmentation to limit the impact of potential threats.
- Escalate the incident to the security operations center (SOC) or incident response team for further investigation and to determine if additional systems are affected.
- Update security policies and procedures to include specific measures for monitoring and protecting the DNS Global Query Block List, ensuring rapid detection and response to similar threats in the future."""
references = [
"https://cube0x0.github.io/Pocing-Beyond-DA/",
"https://www.thehacker.recipes/ad/movement/mitm-and-coerced-authentications/wpad-spoofing",
"https://www.netspi.com/blog/technical-blog/network-penetration-testing/adidns-revisited/",
]
risk_score = 47
rule_id = "57bfa0a9-37c0-44d6-b724-54bf16787492"
severity = "medium"
tags = [
"Domain: Endpoint",
"OS: Windows",
"Use Case: Threat Detection",
"Tactic: Defense Evasion",
"Data Source: Elastic Defend",
"Data Source: Sysmon",
"Data Source: Microsoft Defender XDR",
"Data Source: SentinelOne",
"Data Source: Elastic Endgame",
"Data Source: Crowdstrike",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
registry where host.os.type == "windows" and event.type == "change" and registry.data.strings != null and
(
(registry.value : "EnableGlobalQueryBlockList" and registry.data.strings : ("0", "0x00000000")) or
(registry.value : "GlobalQueryBlockList" and not registry.data.strings : "wpad")
)
'''
setup = """## Setup
This rule is designed for data generated by [Elastic Defend](https://www.elastic.co/security/endpoint-security), which provides native endpoint detection and response, along with event enrichments designed to work with our detection rules.
Setup instructions: https://ela.st/install-elastic-defend
### Additional data sources
This rule also supports the following third-party data sources. For setup instructions, refer to the links below:
- [CrowdStrike](https://ela.st/crowdstrike-integration)
- [Microsoft Defender XDR](https://ela.st/m365-defender)
- [SentinelOne Cloud Funnel](https://ela.st/sentinel-one-cloud-funnel)
- [Sysmon Registry Events](https://ela.st/sysmon-event-reg-setup)
"""
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1112"
name = "Modify Registry"
reference = "https://attack.mitre.org/techniques/T1112/"
[[rule.threat.technique]]
id = "T1562"
name = "Impair Defenses"
reference = "https://attack.mitre.org/techniques/T1562/"
[[rule.threat.technique.subtechnique]]
id = "T1562.001"
name = "Disable or Modify Tools"
reference = "https://attack.mitre.org/techniques/T1562/001/"
[rule.threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1557"
name = "Adversary-in-the-Middle"
reference = "https://attack.mitre.org/techniques/T1557/"
[rule.threat.tactic]
id = "TA0006"
name = "Credential Access"
reference = "https://attack.mitre.org/tactics/TA0006/"
Stages and Predicates
Stage 1: registry
registry where host.os.type == "windows" and event.type == "change" and registry.data.strings != null and
(
(registry.value : "EnableGlobalQueryBlockList" and registry.data.strings : ("0", "0x00000000")) or
(registry.value : "GlobalQueryBlockList" and not registry.data.strings : "wpad")
)
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.type | eq |
| field:"event.type" kind:eq value:"change" |
registry.data.strings | is_not_null | field:"Details" kind:is_not_null | |
registry.data.strings | wildcard |
| field:"Details" kind:wildcard |
registry.value | wildcard |
| field:"registry_value_name" kind:wildcard |
Execution via MsiExec DownloadAndExecute CustomAction
#Detects attempts to download and execute a file via a Windows Installer CustomAction.
MITRE ATT&CK Coverage
Rule Body
[rule]
description = "Detects attempts to download and execute a file via a Windows Installer CustomAction."
id = "70c01e6b-bc59-411e-9bf7-6a46e08d953b"
license = "Elastic License v2"
name = "Execution via MsiExec DownloadAndExecute CustomAction"
os_list = ["windows"]
version = "1.0.3"
query = '''
sequence with maxspan=1m
[process where event.action == "start" and process.name : "rundll32.exe" and
process.command_line : "*!CustomActions.DownloadAndExecute*"] by process.entity_id
[dns where event.action == "lookup_requested" and
process.name : "rundll32.exe" and dns.question.name : "?*"] by process.entity_id
[process where event.action == "start" and process.parent.name : "rundll32.exe"] by process.parent.entity_id
'''
min_endpoint_version = "8.10.0"
reputation = true
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 2
[[optional_actions]]
action = "rollback"
field = "process.entity_id"
state = 0
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1218"
name = "System Binary Proxy Execution"
reference = "https://attack.mitre.org/techniques/T1218/"
[[threat.technique.subtechnique]]
id = "T1218.007"
name = "Msiexec"
reference = "https://attack.mitre.org/techniques/T1218/007/"
[[threat.technique.subtechnique]]
id = "T1218.011"
name = "Rundll32"
reference = "https://attack.mitre.org/techniques/T1218/011/"
[threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
[internal]
min_endpoint_version = "8.10.0"
Stages and Predicates
Ordered sequence: each step below must occur in order within 1m, correlated by process.entity_id, process.parent.entity_id.
Stage 1: process
[process where event.action == "start" and process.name : "rundll32.exe" and
process.command_line : "*!CustomActions.DownloadAndExecute*"] by process.entity_id
Stage 2: dns
[dns where event.action == "lookup_requested" and
process.name : "rundll32.exe" and dns.question.name : "?*"] by process.entity_id
Stage 3: process
[process where event.action == "start" and process.parent.name : "rundll32.exe"] by process.parent.entity_id
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
dns.question.name | wildcard |
| field:"QueryName" kind:wildcard value:"?*" |
event.action | eq |
| field:"EventType" kind:eq |
process.command_line | wildcard |
| field:"CommandLine" kind:wildcard value:"*!CustomActions.DownloadAndExecute*" |
process.name | wildcard |
| field:"process_basename" kind:wildcard value:"rundll32.exe" |
process.parent.name | wildcard |
| field:"parent_process_basename" kind:wildcard value:"rundll32.exe" |
Kubernetes Sensitive RBAC Change Followed by Workload Modification
#Detects a sequence where a principal creates or modifies a Role/ClusterRole to include high-risk permissions (e.g., wildcard access or escalation verbs) and then creates or patches a workload resource (DaemonSet, Deployment, or CronJob) shortly after, which may indicate RBAC-based privilege escalation followed by payload deployment. This pattern is often used by adversaries to gain unauthorized access to sensitive resources and deploy malicious payloads.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Persistence | |
| Privilege Escalation |
Telemetry Coverage
Rules Detecting the Same Action
These rules filter on the same operation.
- Direct Interactive Kubernetes API Request by Unusual Utilities (Elastic)
- GKE Creation or Modification of Sensitive Role (Elastic)
- GKE RBAC Wildcard Elevation on Existing Role (Elastic)
- GKE Sensitive RBAC Change Followed by Workload Modification (Elastic)
- GKE Service Account Modified RBAC Objects (Elastic)
- GKE Unusual Sensitive Workload Modification (Elastic)
- Kubernetes Creation or Modification of Sensitive Role (Elastic)
- Kubernetes Cron Job Created or Modified (Panther)
Rule Body
[metadata]
creation_date = "2026/02/04"
integration = ["kubernetes"]
maturity = "production"
updated_date = "2026/08/25"
[rule]
author = ["Elastic"]
description = """
Detects a sequence where a principal creates or modifies a Role/ClusterRole to include high-risk permissions
(e.g., wildcard access or escalation verbs) and then creates or patches a workload resource (DaemonSet,
Deployment, or CronJob) shortly after, which may indicate RBAC-based privilege escalation followed by payload
deployment. This pattern is often used by adversaries to gain unauthorized access to sensitive resources and
deploy malicious payloads.
"""
index = ["logs-kubernetes.audit_logs-*"]
language = "eql"
license = "Elastic License v2"
name = "Kubernetes Sensitive RBAC Change Followed by Workload Modification"
note = """ ## Triage and analysis
> **Disclaimer**:
> This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.
### Investigating Kubernetes Sensitive RBAC Change Followed by Workload Modification
This rule detects when a user grants or broadens high-risk permissions in a Role/ClusterRole and then quickly creates or patches a DaemonSet, Deployment, or CronJob, a strong signal of RBAC-driven privilege escalation followed by payload deployment. Attackers often add wildcard access or escalation verbs to a new role, bind it to their identity, then patch a workload to run a malicious container across nodes or on a schedule to establish persistence.
### Possible investigation steps
- Review the Role/ClusterRole change diff to identify newly granted wildcard resources/verbs or escalation permissions (e.g., bind, impersonate, escalate) and determine the effective access increase for the actor.
- Identify any RoleBinding/ClusterRoleBinding creations or updates around the same time to see whether the modified role was bound to the same principal or a newly created service account.
- Inspect the subsequent DaemonSet/Deployment/CronJob spec changes for malicious indicators such as new images, added initContainers, elevated securityContext (privileged/hostPID/hostNetwork), hostPath mounts, or suspicious command/args.
- Correlate pod runtime activity from the modified workload (image pulls, container starts, outbound connections, and access to secrets/configmaps) to confirm execution and scope of impact.
- Validate the actor’s legitimacy by checking whether the request originated from expected IP/user-agent and whether the identity is associated with approved CI/CD automation or an unusual interactive session.
### False positive analysis
- A platform engineer performing an urgent, legitimate RBAC adjustment (e.g., expanding a Role/ClusterRole for a new feature rollout) and then immediately patching or deploying a DaemonSet/Deployment/CronJob as part of the same change window can match this sequence.
- A CI/CD pipeline or GitOps-style workflow using a non-system:masters identity may update RBAC manifests and then apply workload updates within minutes during routine releases, producing this pattern without malicious intent.
### Response and remediation
- Immediately revoke or roll back the risky Role/ClusterRole changes and remove any new/updated RoleBinding/ClusterRoleBinding that ties the elevated permissions to the triggering user or service account.
- Quarantine the modified Deployment/DaemonSet/CronJob by scaling it to zero or deleting it and cordon/drain affected nodes if pods ran privileged, used hostPath mounts, or executed on many nodes.
- Rotate credentials and access paths exposed through the workload (service account tokens, kubeconfig files, mounted secrets, cloud keys) and invalidate any newly issued tokens tied to the actor.
- For eradication and recovery, redeploy workloads from trusted Git/registry sources, block the suspicious images/digests in admission controls, and verify no persistence remains via CronJobs, DaemonSets, webhook configurations, or additional RBAC bindings.
- Escalate to incident response and platform leadership if the RBAC change included wildcard permissions or escalation verbs, if the workload ran privileged/hostNetwork/hostPID, or if sensitive secrets were accessed or exfiltration is suspected.
- Harden by enforcing least-privilege RBAC, requiring peer approval for RBAC changes, restricting workload mutations via GitOps-only service accounts, and using admission policies to deny privileged pods, hostPath mounts, and unapproved registries.
"""
references = [
"https://heilancoos.github.io/research/2025/12/16/kubernetes.html#overly-permissive-role-based-access-control",
]
risk_score = 47
rule_id = "3c82bf84-5941-495b-ac41-0302f28e1a90"
severity = "medium"
tags = [
"Data Source: Kubernetes",
"Data Source: Kubernetes API Server Audit Logs",
"Domain: Containers",
"Domain: Kubernetes",
"Platform: Kubernetes",
"Use Case: Threat Detection",
"Tactic: Privilege Escalation",
"Tactic: Persistence",
"Resources: Investigation Guide",
"Rule Type: Event Correlation (EQL)",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
sequence by user.name with maxspan=5m
[any where data_stream.dataset == "kubernetes.audit_logs" and
`kubernetes.audit.annotations.authorization_k8s_io/decision` == "allow" and
kubernetes.audit.objectRef.resource in ("roles", "clusterroles") and
kubernetes.audit.verb in ("create", "update", "patch") and
/* GitOps controllers reconcile RBAC then workloads in the same window */
not user.name in (
"system:serviceaccount:flux-system:kustomize-controller",
"system:serviceaccount:flux-system:helm-controller",
"system:serviceaccount:flux-system:source-controller"
)]
[any where data_stream.dataset == "kubernetes.audit_logs" and
`kubernetes.audit.annotations.authorization_k8s_io/decision` == "allow" and
kubernetes.audit.objectRef.resource in ("daemonsets", "deployments", "cronjobs") and
kubernetes.audit.verb in ("create", "patch") and
/* reduce control-plane / bootstrap noise */
not kubernetes.audit.user.groups == "system:masters"
]
'''
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1098"
name = "Account Manipulation"
reference = "https://attack.mitre.org/techniques/T1098/"
[[rule.threat.technique.subtechnique]]
id = "T1098.006"
name = "Additional Container Cluster Roles"
reference = "https://attack.mitre.org/techniques/T1098/006/"
[rule.threat.tactic]
id = "TA0004"
name = "Privilege Escalation"
reference = "https://attack.mitre.org/tactics/TA0004/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1098"
name = "Account Manipulation"
reference = "https://attack.mitre.org/techniques/T1098/"
[[rule.threat.technique.subtechnique]]
id = "T1098.006"
name = "Additional Container Cluster Roles"
reference = "https://attack.mitre.org/techniques/T1098/006/"
[rule.threat.tactic]
id = "TA0003"
name = "Persistence"
reference = "https://attack.mitre.org/tactics/TA0003/"
Stages and Predicates
Ordered sequence: each step below must occur in order within 5m, correlated by user.name.
Stage 1: any
[any where data_stream.dataset == "kubernetes.audit_logs" and
`kubernetes.audit.annotations.authorization_k8s_io/decision` == "allow" and
kubernetes.audit.objectRef.resource in ("roles", "clusterroles") and
kubernetes.audit.verb in ("create", "update", "patch") and
not user.name in (
"system:serviceaccount:flux-system:kustomize-controller",
"system:serviceaccount:flux-system:helm-controller",
"system:serviceaccount:flux-system:source-controller"
)]
Stage 2: any
[any where data_stream.dataset == "kubernetes.audit_logs" and
`kubernetes.audit.annotations.authorization_k8s_io/decision` == "allow" and
kubernetes.audit.objectRef.resource in ("daemonsets", "deployments", "cronjobs") and
kubernetes.audit.verb in ("create", "patch") and
not kubernetes.audit.user.groups == "system:masters"
]
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
data_stream.dataset | eq |
| field:"data_stream.dataset" kind:eq value:"kubernetes.audit_logs" |
kubernetes.audit.annotations.authorization_k8s_io/decision | eq |
| field:"kubernetes.audit.annotations.authorization_k8s_io/decision" kind:eq value:"allow" |
kubernetes.audit.objectRef.resource | in |
| field:"kubernetes.audit.objectRef.resource" kind:in |
kubernetes.audit.verb | in |
| field:"kubernetes.audit.verb" kind:in |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
user.name | in | system:serviceaccount:flux-system:helm-controller, system:serviceaccount:flux-system:kustomize-controller, system:serviceaccount:flux-system:source-controller | excludes:user.name field:"user.name" value:"system:serviceaccount:flux-system:helm-controller" field:"user.name" value:"system:serviceaccount:flux-system:kustomize-controller" field:"user.name" value:"system:serviceaccount:flux-system:source-controller" |
kubernetes.audit.user.groups | eq | system:masters | excludes:kubernetes.audit.user.groups field:"kubernetes.audit.user.groups" value:"system:masters" |
M365 Exchange Anti-Phish Policy Deleted
#Identifies the deletion of an anti-phishing policy in Microsoft 365. By default, Microsoft 365 includes built-in features that help protect users from phishing attacks. Anti-phishing polices increase this protection by refining settings to better detect and prevent attacks.
Known False Positives
- An anti-phishing policy may be deleted by a system or network administrator. Verify that the configuration change was expected. Exceptions can be added to this rule to filter expected behavior.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Privilege Escalation | |
| Defense Impairment |
Telemetry Coverage
| Platform | Record / event type |
|---|---|
| Microsoft 365 | Exchange audit operation Remove-AntiPhishPolicy: Federated domain added |
Rule Body
[metadata]
creation_date = "2020/11/19"
integration = ["o365"]
maturity = "production"
updated_date = "2026/04/10"
[rule]
author = ["Elastic"]
description = """
Identifies the deletion of an anti-phishing policy in Microsoft 365. By default, Microsoft 365 includes built-in
features that help protect users from phishing attacks. Anti-phishing polices increase this protection by refining
settings to better detect and prevent attacks.
"""
false_positives = [
"""
An anti-phishing policy may be deleted by a system or network administrator. Verify that the configuration change
was expected. Exceptions can be added to this rule to filter expected behavior.
""",
]
from = "now-9m"
index = ["logs-o365.audit-*", "filebeat-*"]
language = "kuery"
license = "Elastic License v2"
name = "M365 Exchange Anti-Phish Policy 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 M365 Exchange Anti-Phish Policy Deleted
Microsoft 365's anti-phishing policies enhance security by fine-tuning detection settings to thwart phishing attacks. Adversaries may delete these policies to weaken defenses, facilitating unauthorized access. The detection rule monitors audit logs for successful deletions of anti-phishing policies, signaling potential malicious activity by identifying specific actions and outcomes associated with policy removal.
### Possible investigation steps
- Review the audit logs for the specific event.action "Remove-AntiPhishPolicy" to identify the user account responsible for the deletion.
- Check the event.outcome field to confirm the success of the policy deletion and gather additional context from related logs around the same timestamp.
- Investigate the user account's recent activities in Microsoft 365 to identify any other suspicious actions or anomalies, such as unusual login locations or times.
- Assess whether the user account has been compromised by checking for any unauthorized access attempts or changes in account settings.
- Evaluate the impact of the deleted anti-phishing policy by reviewing the organization's current phishing protection measures and any recent phishing incidents.
- Coordinate with the IT security team to determine if the policy deletion was authorized or part of a legitimate change management process.
### False positive analysis
- Routine administrative actions may trigger the rule if IT staff regularly update or remove outdated anti-phishing policies. To manage this, create exceptions for known administrative accounts performing these actions.
- Scheduled policy reviews might involve the removal of policies as part of a legitimate update process. Document these schedules and exclude them from triggering alerts by setting time-based exceptions.
- Automated scripts used for policy management can inadvertently cause false positives. Identify and whitelist these scripts to prevent unnecessary alerts.
- Changes in organizational policy that require the removal of certain anti-phishing policies can be mistaken for malicious activity. Ensure that such changes are communicated and logged, and adjust the rule to recognize these legitimate actions.
- Test environments where policies are frequently added and removed for validation purposes can generate false positives. Exclude these environments from the rule to avoid confusion.
### Response and remediation
- Immediately isolate the affected user accounts and systems to prevent further unauthorized access or data exfiltration.
- Recreate the deleted anti-phishing policy using the latest security guidelines and ensure it is applied across all relevant user groups.
- Conduct a thorough review of recent email activity and logs for the affected accounts to identify any phishing emails that may have bypassed security measures.
- Reset passwords for affected accounts and enforce multi-factor authentication (MFA) to enhance account security.
- Notify the security team and relevant stakeholders about the incident for awareness and further investigation.
- Escalate the incident to the incident response team if there is evidence of broader compromise or if sensitive data has been accessed.
- Implement enhanced monitoring and alerting for similar actions in the future to quickly detect and respond to any further attempts to delete security policies.
## Setup
The Office 365 Logs Fleet integration, Filebeat module, or similarly structured data is required to be compatible with this rule."""
references = [
"https://docs.microsoft.com/en-us/powershell/module/exchange/remove-antiphishpolicy?view=exchange-ps",
"https://docs.microsoft.com/en-us/microsoft-365/security/office-365-security/set-up-anti-phishing-policies?view=o365-worldwide",
]
risk_score = 47
rule_id = "d68eb1b5-5f1c-4b6d-9e63-5b6b145cd4aa"
severity = "medium"
tags = [
"Domain: Cloud",
"Data Source: Microsoft 365",
"Use Case: Configuration Audit",
"Tactic: Defense Evasion",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "query"
query = '''
data_stream.dataset:o365.audit and event.provider:Exchange and event.category:web and event.action:"Remove-AntiPhishPolicy" and event.outcome:success
'''
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1484"
name = "Domain or Tenant Policy Modification"
reference = "https://attack.mitre.org/techniques/T1484/"
[[rule.threat.technique]]
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: query
data_stream.dataset:o365.audit and event.provider:Exchange and event.category:web and event.action:"Remove-AntiPhishPolicy" and event.outcome:success
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
data_stream.dataset | eq |
| field:"data_stream.dataset" kind:eq value:"o365.audit" |
event.action | eq |
| field:"EventType" kind:eq value:"Remove-AntiPhishPolicy" |
event.category | eq |
| field:"event.category" kind:eq value:"web" |
event.outcome | eq |
| field:"event.outcome" kind:eq value:"success" |
event.provider | eq |
| field:"Provider_Name" kind:eq value:"Exchange" |
Multiple Vulnerabilities by Asset via Wiz
#This alert identifies assets with an elevated number of vulnerabilities reported by Wiz, potentially indicating weak security posture, missed patching, or active exposure. The rule highlights assets with a high volume of distinct vulnerabilities, the presence of exploitable vulnerabilities, or a combination of multiple severities, helping prioritize assets that pose increased risk.
Rule Body
[metadata]
creation_date = "2026/01/22"
integration = ["wiz"]
maturity = "production"
updated_date = "2026/04/10"
[rule]
author = ["Elastic"]
description = """
This alert identifies assets with an elevated number of vulnerabilities reported by Wiz, potentially indicating weak security posture,
missed patching, or active exposure. The rule highlights assets with a high volume of distinct vulnerabilities, the presence of exploitable
vulnerabilities, or a combination of multiple severities, helping prioritize assets that pose increased risk.
"""
from = "now-24h"
interval = "5m"
language = "esql"
license = "Elastic License v2"
name = "Multiple Vulnerabilities by Asset via Wiz"
note = """## Triage and analysis
> **Disclaimer**:
> This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.
### Investigating Multiple Vulnerabilities by Asset via Wiz
This alert identifies assets with an elevated number of vulnerabilities reported by Wiz, potentially indicating weak security posture, missed patching, or active exposure. The rule highlights assets with a high volume of distinct vulnerabilities, the presence of exploitable vulnerabilities, or a combination of multiple severities, helping prioritize assets that pose increased risk.
### Possible investigation steps
- Review the affected asset details using `wiz.vulnerability.vulnerable_asset.name` and `wiz.vulnerability.vulnerable_asset.id` to confirm asset ownership, criticality, and exposure (e.g., internet-facing, production).
- Examine the list of detected vulnerabilities using `Esql.vuln_id_values` to identify known high-risk or widely exploited CVEs.
- Assess vulnerability severity distribution via `Esql.vuln_severity_values`, focusing on assets with multiple severity levels or repeated high/critical findings.
- Determine whether any vulnerabilities have known exploits by validating `wiz.vulnerability.has_exploit`, prioritizing those assets for immediate remediation.
- Cross-check recent patching, configuration changes, or deployment activity on the asset to identify potential gaps or misconfigurations.
### False positive analysis
- Assets undergoing initial onboarding, scanning expansion, or configuration changes may temporarily report a high volume of findings.
- Vulnerability aggregation may include informational or low-impact findings that inflate counts without representing immediate risk.
- Duplicate or closely related vulnerabilities affecting shared packages or libraries may appear as multiple findings for the same root cause.
- Test, lab, or non-production assets may legitimately tolerate higher vulnerability counts depending on risk acceptance.
### Response and remediation
- Prioritize remediation for assets with exploitable vulnerabilities or multiple high/critical severity findings.
- Apply missing patches, updates, or configuration fixes according to asset criticality and exposure.
- Implement compensating controls (e.g., network segmentation, access restrictions) if immediate patching is not feasible.
- Validate remediation by re-scanning the asset in Wiz to confirm vulnerability reduction.
- Review vulnerability management processes to prevent recurrence, including patch SLAs, asset ownership, and exposure monitoring."""
risk_score = 99
rule_id = "6fcb4fe4-ac74-449d-855b-2bbd5c51c476"
severity = "critical"
tags = ["Use Case: Vulnerability", "Rule Type: Higher-Order Rule", "Resources: Investigation Guide", "Data Source: Wiz"]
timestamp_override = "event.ingested"
type = "esql"
query = '''
FROM logs-wiz.vulnerability-*
| WHERE data_stream.dataset == "wiz.vulnerability" and event.category == "vulnerability" and
wiz.vulnerability.vulnerable_asset.name is not null and
wiz.vulnerability.vulnerable_asset.id is not null
| stats Esql.count_distinct_vuln_id = COUNT_DISTINCT(wiz.vulnerability.id),
Esql.count_distinct_vuln_severity = COUNT_DISTINCT(wiz.vulnerability.cvss_severity),
Esql.count_has_exploit = COUNT(wiz.vulnerability.has_exploit),
Esql.vuln_id_values = VALUES(wiz.vulnerability.id),
Esql.vuln_severity_values = VALUES(wiz.vulnerability.cvss_severity) by wiz.vulnerability.vulnerable_asset.name, wiz.vulnerability.vulnerable_asset.id
| eval concat_vuln_severity_values = MV_CONCAT(Esql.vuln_severity_values, ",")
| where Esql.count_distinct_vuln_id >= 10 or
(Esql.count_has_exploit >= 1 and Esql.count_distinct_vuln_id >= 3) or
(concat_vuln_severity_values like "*High*" and Esql.count_distinct_vuln_id >= 3) or
(concat_vuln_severity_values like "*Critical*" and Esql.count_distinct_vuln_id >= 3)
| Keep wiz.vulnerability.vulnerable_asset.name, wiz.vulnerability.vulnerable_asset.id, Esql.*
'''
references = ["https://www.elastic.co/docs/reference/integrations/wiz#vulnerability"]
Stages and Predicates
Stage 1: from
FROM logs-wiz.vulnerability-*
Stage 2: where
| WHERE data_stream.dataset == "wiz.vulnerability" and event.category == "vulnerability" and
wiz.vulnerability.vulnerable_asset.name is not null and
wiz.vulnerability.vulnerable_asset.id is not null
Stage 3: stats
| stats Esql.count_distinct_vuln_id = COUNT_DISTINCT(wiz.vulnerability.id),
Esql.count_distinct_vuln_severity = COUNT_DISTINCT(wiz.vulnerability.cvss_severity),
Esql.count_has_exploit = COUNT(wiz.vulnerability.has_exploit),
Esql.vuln_id_values = VALUES(wiz.vulnerability.id),
Esql.vuln_severity_values = VALUES(wiz.vulnerability.cvss_severity) by wiz.vulnerability.vulnerable_asset.name, wiz.vulnerability.vulnerable_asset.id
Stage 4: eval
| eval concat_vuln_severity_values = MV_CONCAT(Esql.vuln_severity_values, ",")
Stage 5: where
| where Esql.count_distinct_vuln_id >= 10 or
(Esql.count_has_exploit >= 1 and Esql.count_distinct_vuln_id >= 3) or
(concat_vuln_severity_values like "*High*" and Esql.count_distinct_vuln_id >= 3) or
(concat_vuln_severity_values like "*Critical*" and Esql.count_distinct_vuln_id >= 3)
Stage 6: keep
| Keep wiz.vulnerability.vulnerable_asset.name, wiz.vulnerability.vulnerable_asset.id, Esql.*
Indicators
These rows show field, operator, and value matches.
Output Fields
These fields are emitted when the rule matches.
| Field | Source |
|---|---|
wiz.vulnerability.vulnerable_asset.name | KEEP wiz.vulnerability.vulnerable_asset.name |
wiz.vulnerability.vulnerable_asset.id | KEEP wiz.vulnerability.vulnerable_asset.id |
Esql.* | KEEP Esql.* |
Network Connection Followed by File Creation
#Detects network connections originating from a binary located in a potentially suspicious location, followed by a file creation event. This behavior is consistent with C2 agents such as Poseidon and Athena, connecting to a C2 framework such as Mythic. The agent polls the C2 for commands through a web request, after which the command gets executed.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Execution | |
| Command & Control |
Rule Body
[metadata]
creation_date = "2026/07/02"
integration = ["endpoint"]
maturity = "production"
updated_date = "2026/07/06"
[rule]
author = ["Elastic"]
description = """
Detects network connections originating from a binary located in a potentially suspicious location, followed by a file
creation event. This behavior is consistent with C2 agents such as Poseidon and Athena, connecting to a C2 framework
such as Mythic. The agent polls the C2 for commands through a web request, after which the command gets executed.
"""
from = "now-9m"
index = ["logs-endpoint.events.network*", "logs-endpoint.events.file*"]
language = "eql"
license = "Elastic License v2"
name = "Network Connection Followed by File Creation"
note = """ ## Triage and analysis
> **Disclaimer**:
> This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.
### Investigating Network Connection Followed by File Creation
This rule spots a Linux process running from an unusual writable directory that makes an outbound connection and then creates a file within seconds, a pattern that often marks an active implant receiving tasks and staging follow-on activity. Attackers launch a loader from /dev/shm or /tmp, poll a remote web-based command server, and immediately drop a script or renamed payload for execution or persistence.
### Possible investigation steps
- Review the process ancestry and launch context for the binary in the writable directory to determine whether it originated from a user session, script, scheduled task, package operation, or remote execution mechanism.
- Inspect the external destination's reputation, ownership, protocol details, and whether other hosts contacted it at similar times to distinguish approved software behavior from likely command-and-control traffic.
- Examine the created file's location, type, hash, contents, permissions, and any immediate chmod, rename, or execution activity to assess whether it is a staged payload, script, or persistence artifact.
- Build a concise timeline around the alert to identify preceding download, decode, or unpack actions and any follow-on child processes, credential access attempts, or lateral movement from the same host.
- Search the environment for the same executable hash, destination, or dropped artifact on other systems and contain the host if you observe repeated beaconing, additional suspicious file creation, or evidence of execution.
### False positive analysis
- A legitimate software installer, updater, or bootstrap script launched from /tmp or /var/tmp can contact an external repository and immediately create unpacked files; verify the parent process, initiating user, shell history, and whether the destination IP and dropped files align with an approved installation or update at that time.
- An administrator or automation job may execute a temporary script from /dev/shm or /run/user to fetch remote content and write logs, configuration, or cache files; confirm the activity matches a scheduled task or provisioning change and inspect the created file paths and script contents for expected benign output.
### Response and remediation
- Isolate the affected Linux host from the network except for approved management access, kill the suspicious process running from the writable directory, quarantine the binary and any files it created, and block the contacted external IP or domain at the firewall, proxy, and DNS layers.
- Remove attacker footholds by deleting malicious systemd services, cron jobs, shell profile modifications, SSH authorized_keys entries, and any copied or renamed payloads the implant placed under writable paths or startup locations, after preserving forensic copies.
- Reset potentially exposed access by rotating passwords, SSH keys, API tokens, and service credentials used on the host, especially if the process ran as root, touched authentication files, or dropped scripts and configuration files that may contain secrets.
- Restore the system to a known-good state by reimaging or rebuilding the host from a trusted baseline when the binary or dropped files executed, then validate package integrity, startup items, and critical application data before reconnecting it to production.
- Escalate immediately to incident response if the same executable hash, outbound destination, or dropped artifact appears on additional hosts, or if you identify privilege escalation, credential theft, persistence in multiple locations, or attempted lateral movement.
- Harden the environment by blocking execution from /tmp, /dev/shm, and other writable directories where feasible, tightening egress rules to approved destinations, enforcing application allowlisting, and improving monitoring for new outbound beacons followed by file creation.
"""
risk_score = 21
rule_id = "01c1e353-9d86-4344-abdf-523ab80c6f08"
setup = """## Setup
This rule requires data coming in from Elastic Defend.
### Elastic Defend Integration Setup
Elastic Defend is integrated into the Elastic Agent using Fleet. Upon configuration, the integration allows the Elastic Agent to monitor events on your host and send data to the Elastic Security app.
#### Prerequisite Requirements:
- Fleet is required for Elastic Defend.
- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).
#### The following steps should be executed in order to add the Elastic Defend integration on a Linux System:
- Go to the Kibana home page and click "Add integrations".
- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.
- Click "Add Elastic Defend".
- Configure the integration name and optionally add a description.
- Select the type of environment you want to protect, either "Traditional Endpoints" or "Cloud Workloads".
- Select a configuration preset. Each preset comes with different default settings for Elastic Agent, you can further customize these later by configuring the Elastic Defend integration policy. [Helper guide](https://www.elastic.co/guide/en/security/current/configure-endpoint-integration-policy.html).
- We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"
- Enter a name for the agent policy in "New agent policy name". If other agent policies already exist, you can click the "Existing hosts" tab and select an existing policy instead.
For more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/8.10/agent-policy.html).
- Click "Save and Continue".
- To complete the integration, select "Add Elastic Agent to your hosts" and continue to the next section to install the Elastic Agent on your hosts.
For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
"""
severity = "low"
tags = [
"Domain: Endpoint",
"OS: Linux",
"Use Case: Threat Detection",
"Tactic: Command and Control",
"Tactic: Execution",
"Data Source: Elastic Defend",
"Resources: Investigation Guide",
]
type = "eql"
query = '''
sequence by host.id, process.entity_id with maxspan=5s
[network where host.os.type == "linux" and event.type == "start" and event.action == "connection_attempted" and
process.executable like (
"/boot/*", "/dev/shm/*", "/tmp/*", "/var/tmp/*", "/var/log/*", "/var/run/user/*", "/run/user/*"
) and
not (
destination.ip == null or
destination.ip == "0.0.0.0" or
cidrmatch(
destination.ip, "10.0.0.0/8", "127.0.0.0/8", "169.254.0.0/16", "172.16.0.0/12",
"192.0.0.0/24", "192.0.0.0/29","192.0.0.8/32", "192.0.0.9/32", "192.0.0.10/32",
"192.0.0.170/32", "192.0.0.171/32", "192.0.2.0/24", "192.31.196.0/24", "192.52.193.0/24",
"192.168.0.0/16", "192.88.99.0/24", "224.0.0.0/4", "100.64.0.0/10", "192.175.48.0/24",
"198.18.0.0/15", "198.51.100.0/24", "203.0.113.0/24", "240.0.0.0/4", "::1", "FE80::/10",
"FF00::/8", "FC00::/7"
)
)]
[file where host.os.type == "linux" and event.type == "creation" and process.executable like (
"/boot/*", "/dev/shm/*", "/tmp/*", "/var/tmp/*", "/var/log/*", "/boot/*", "/var/run/user/*", "/run/user/*"
) and
not (
file.name like "tmp*" or file.extension in ("sqlite-journal", "db-journal", "lockfile", "tmp") or
file.path like (
"/loki/wal/*", "/dev/shm/.org.chromium.Chromium.*", "/opt/rapid7/nexpose/*",
"/usr/local/ltechagent*", "/var/lib/cloudendure/agent_keystore_temp", "/var/cache/yum/*",
"/run/aws-node/ipam.json.tmp*", "/run/systemd/journal/streams/.*"
) or
(process.executable == "/tmp/terraform" and file.path like "/tmp/terraform-provider*") or
process.name in ("podman", "minikube", "logrotate", "java", "aws-k8s-agent", "grafana", "postman") or
process.executable : (
"/etc/cron.daily/logrotate", "/etc/update-motd.d/50-motd-news", "/etc/cron.hourly/0yum-hourly.cron",
"/etc/cron.hourly/BitdefenderRedline", "/tmp/token_handler", "/tmp/.sentry-cli*.exe",
"/etc/cron.daily/0yum-daily.cron", "/etc/init.d/fortiedr"
)
)]
'''
[[rule.threat]]
framework = "MITRE ATT&CK"
[rule.threat.tactic]
name = "Command and Control"
id = "TA0011"
reference = "https://attack.mitre.org/tactics/TA0011/"
[[rule.threat.technique]]
name = "Application Layer Protocol"
id = "T1071"
reference = "https://attack.mitre.org/techniques/T1071/"
[[rule.threat.technique.subtechnique]]
name = "Web Protocols"
id = "T1071.001"
reference = "https://attack.mitre.org/techniques/T1071/001/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[rule.threat.tactic]
name = "Execution"
id = "TA0002"
reference = "https://attack.mitre.org/tactics/TA0002/"
[[rule.threat.technique]]
id = "T1059"
name = "Command and Scripting Interpreter"
reference = "https://attack.mitre.org/techniques/T1059/"
[[rule.threat.technique.subtechnique]]
name = "Unix Shell"
id = "T1059.004"
reference = "https://attack.mitre.org/techniques/T1059/004/"
Stages and Predicates
Ordered sequence: each step below must occur in order within 5s, correlated by host.id, process.entity_id.
Stage 1: network
[network where host.os.type == "linux" and event.type == "start" and event.action == "connection_attempted" and
process.executable like (
"/boot/*", "/dev/shm/*", "/tmp/*", "/var/tmp/*", "/var/log/*", "/var/run/user/*", "/run/user/*"
) and
not (
destination.ip == null or
destination.ip == "0.0.0.0" or
cidrmatch(
destination.ip, "10.0.0.0/8", "127.0.0.0/8", "169.254.0.0/16", "172.16.0.0/12",
"192.0.0.0/24", "192.0.0.0/29","192.0.0.8/32", "192.0.0.9/32", "192.0.0.10/32",
"192.0.0.170/32", "192.0.0.171/32", "192.0.2.0/24", "192.31.196.0/24", "192.52.193.0/24",
"192.168.0.0/16", "192.88.99.0/24", "224.0.0.0/4", "100.64.0.0/10", "192.175.48.0/24",
"198.18.0.0/15", "198.51.100.0/24", "203.0.113.0/24", "240.0.0.0/4", "::1", "FE80::/10",
"FF00::/8", "FC00::/7"
)
)]
Stage 2: file
[file where host.os.type == "linux" and event.type == "creation" and process.executable like (
"/boot/*", "/dev/shm/*", "/tmp/*", "/var/tmp/*", "/var/log/*", "/boot/*", "/var/run/user/*", "/run/user/*"
) and
not (
file.name like "tmp*" or file.extension in ("sqlite-journal", "db-journal", "lockfile", "tmp") or
file.path like (
"/loki/wal/*", "/dev/shm/.org.chromium.Chromium.*", "/opt/rapid7/nexpose/*",
"/usr/local/ltechagent*", "/var/lib/cloudendure/agent_keystore_temp", "/var/cache/yum/*",
"/run/aws-node/ipam.json.tmp*", "/run/systemd/journal/streams/.*"
) or
(process.executable == "/tmp/terraform" and file.path like "/tmp/terraform-provider*") or
process.name in ("podman", "minikube", "logrotate", "java", "aws-k8s-agent", "grafana", "postman") or
process.executable : (
"/etc/cron.daily/logrotate", "/etc/update-motd.d/50-motd-news", "/etc/cron.hourly/0yum-hourly.cron",
"/etc/cron.hourly/BitdefenderRedline", "/tmp/token_handler", "/tmp/.sentry-cli*.exe",
"/etc/cron.daily/0yum-daily.cron", "/etc/init.d/fortiedr"
)
)]
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | eq |
| field:"EventType" kind:eq value:"connection_attempted" |
event.type | eq |
| field:"event.type" kind:eq |
process.executable | wildcard |
| field:"Image" kind:wildcard |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
destination.ip | cidr_match | 10.0.0.0/8, 127.0.0.0/8, 169.254.0.0/16, 172.16.0.0/12, 192.0.0.0/24, 192.0.0.0/29, 192.0.0.8/32, 192.0.0.9/32, 192.0.0.10/32, 192.0.0.170/32, 192.0.0.171/32, 192.0.2.0/24, 192.31.196.0/24, 192.52.193.0/24, 192.168.0.0/16, 192.88.99.0/24, 224.0.0.0/4, 100.64.0.0/10, 192.175.48.0/24, 198.18.0.0/15, 198.51.100.0/24, 203.0.113.0/24, 240.0.0.0/4, ::1, FE80::/10, FF00::/8, FC00::/7 | excludes:destination.ip |
destination.ip | eq | 0.0.0.0 | excludes:destination.ip field:"destination.ip" value:"0.0.0.0" |
destination.ip | is_null | excludes:destination.ip | |
file.path | starts_with | /tmp/terraform-provider | excludes:file.path field:"file.path" value:"/tmp/terraform-provider" |
process.executable | eq | /tmp/terraform | excludes:process.executable field:"process.executable" value:"/tmp/terraform" |
file.extension | in | db-journal, lockfile, sqlite-journal, tmp | excludes:file.extension |
file.name | starts_with | tmp | excludes:file.name field:"file.name" value:"tmp" |
file.path | wildcard | /loki/wal/*, /dev/shm/.org.chromium.Chromium.*, /opt/rapid7/nexpose/*, /usr/local/ltechagent*, /var/lib/cloudendure/agent_keystore_temp, /var/cache/yum/*, /run/aws-node/ipam.json.tmp*, /run/systemd/journal/streams/.* | excludes:file.path |
process.executable | wildcard | /etc/cron.daily/logrotate, /etc/update-motd.d/50-motd-news, /etc/cron.hourly/0yum-hourly.cron, /etc/cron.hourly/BitdefenderRedline, /tmp/token_handler, /tmp/.sentry-cli*.exe, /etc/cron.daily/0yum-daily.cron, /etc/init.d/fortiedr | excludes:process.executable |
process.name | in | aws-k8s-agent, grafana, java, logrotate, minikube, podman, postman | excludes:process.name |
Office Test Registry Persistence
#Identifies the modification of the Microsoft Office "Office Test" Registry key, a registry location that can be used to specify a DLL which will be executed every time an MS Office application is started. Attackers can abuse this to gain persistence on a compromised host.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Persistence |
Rules Detecting the Same Action
These rules filter on the same operation.
- LSASS Memory Dump Creation (Elastic)
- Network-Level Authentication (NLA) Disabled (Elastic)
- Outlook Home Page Registry Modification (Elastic)
- Potential NetNTLMv1 Downgrade Attack (Elastic)
- Potential RemoteMonologue Attack (Elastic)
- WDAC Policy File by an Unusual Process (Elastic)
Rule Body
[metadata]
creation_date = "2023/08/22"
integration = ["endpoint", "m365_defender", "sentinel_one_cloud_funnel", "crowdstrike", "windows"]
maturity = "production"
updated_date = "2026/05/04"
[rule]
author = ["Elastic"]
description = """
Identifies the modification of the Microsoft Office "Office Test" Registry key, a registry location that can be used to
specify a DLL which will be executed every time an MS Office application is started. Attackers can abuse this to gain
persistence on a compromised host.
"""
from = "now-9m"
index = [
"logs-endpoint.events.registry-*",
"logs-m365_defender.event-*",
"endgame-*",
"logs-sentinel_one_cloud_funnel.*",
"logs-crowdstrike.fdr*",
"logs-windows.sysmon_operational-*",
]
language = "eql"
license = "Elastic License v2"
name = "Office Test Registry Persistence"
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 Office Test Registry Persistence
The Office Test Registry key in Windows environments allows specifying a DLL to execute whenever an Office application starts, providing a mechanism for legitimate customization. However, adversaries can exploit this for persistence by loading malicious DLLs. The detection rule monitors modifications to this registry path, excluding deletions, to identify potential abuse, leveraging data from various security sources to flag suspicious activity.
### Possible investigation steps
- Review the registry event details to identify the specific DLL path that was added or modified in the Office Test Registry key.
- Check the file properties and digital signature of the DLL specified in the registry modification to determine its legitimacy.
- Investigate the source of the registry modification by correlating with user activity logs to identify which user account made the change.
- Analyze recent process execution logs for any Office applications to detect if the suspicious DLL has been loaded or executed.
- Cross-reference the DLL and associated registry modification with threat intelligence sources to check for known malicious indicators.
- Examine the system for additional signs of compromise, such as unusual network connections or other persistence mechanisms, to assess the scope of potential intrusion.
### False positive analysis
- Legitimate software installations or updates may modify the Office Test Registry key as part of their setup process. Users can create exceptions for known software vendors or specific applications that are frequently updated.
- System administrators might use scripts or management tools that modify the registry for configuration purposes. Identify and exclude these trusted scripts or tools from triggering alerts.
- Customization by IT departments for legitimate business needs can lead to registry modifications. Document and whitelist these customizations to prevent false positives.
- Security software or monitoring tools might interact with the registry as part of their normal operations. Verify and exclude these interactions if they are known to be safe and necessary for system functionality.
### Response and remediation
- Immediately isolate the affected host from the network to prevent further spread or communication with potential command and control servers.
- Use endpoint detection and response (EDR) tools to terminate any suspicious processes associated with the malicious DLL identified in the registry path.
- Remove the malicious DLL entry from the Office Test Registry key to prevent it from executing on future Office application startups.
- Conduct a thorough scan of the affected system using updated antivirus and anti-malware tools to identify and remove any additional malicious files or remnants.
- Review recent user activity and system logs to identify any unauthorized access or changes that may have led to the registry modification, and reset credentials if necessary.
- Escalate the incident to the security operations center (SOC) or incident response team for further investigation and to determine if additional systems are affected.
- Implement enhanced monitoring and alerting for similar registry modifications across the network to detect and respond to future attempts promptly."""
references = [
"https://unit42.paloaltonetworks.com/unit42-technical-walkthrough-office-test-persistence-method-used-in-recent-sofacy-attacks/",
]
risk_score = 21
rule_id = "14dab405-5dd9-450c-8106-72951af2391f"
severity = "low"
tags = [
"Domain: Endpoint",
"OS: Windows",
"Use Case: Threat Detection",
"Tactic: Persistence",
"Tactic: Defense Evasion",
"Data Source: Elastic Defend",
"Data Source: Elastic Endgame",
"Data Source: Microsoft Defender XDR",
"Data Source: SentinelOne",
"Data Source: Crowdstrike",
"Data Source: Sysmon",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
registry where host.os.type == "windows" and event.action != "deletion" and
registry.path : "*\\Software\\Microsoft\\Office Test\\Special\\Perf\\*"
'''
setup = """## Setup
This rule is designed for data generated by [Elastic Defend](https://www.elastic.co/security/endpoint-security), which provides native endpoint detection and response, along with event enrichments designed to work with our detection rules.
Setup instructions: https://ela.st/install-elastic-defend
### Additional data sources
This rule also supports the following third-party data sources. For setup instructions, refer to the links below:
- [CrowdStrike](https://ela.st/crowdstrike-integration)
- [Microsoft Defender XDR](https://ela.st/m365-defender)
- [SentinelOne Cloud Funnel](https://ela.st/sentinel-one-cloud-funnel)
- [Sysmon Registry Events](https://ela.st/sysmon-event-reg-setup)
"""
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1137"
name = "Office Application Startup"
reference = "https://attack.mitre.org/techniques/T1137/"
[[rule.threat.technique.subtechnique]]
id = "T1137.002"
name = "Office Test"
reference = "https://attack.mitre.org/techniques/T1137/002/"
[rule.threat.tactic]
id = "TA0003"
name = "Persistence"
reference = "https://attack.mitre.org/tactics/TA0003/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1112"
name = "Modify Registry"
reference = "https://attack.mitre.org/techniques/T1112/"
[rule.threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
Stages and Predicates
Stage 1: registry
registry where host.os.type == "windows" and event.action != "deletion" and
registry.path : "*\\Software\\Microsoft\\Office Test\\Special\\Perf\\*"
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | ne |
| field:"EventType" kind:ne value:"deletion" |
registry.path | wildcard |
| field:"TargetObject" kind:wildcard value:"*\Software\Microsoft\Office Test\Special\Perf\*" |
OsaScript Download Cradle Spawned
#Detects when a new OsaScript download cradle is spawned as a backgrounded process to launch a new callback. The Apfell agent payload utilizes this method in order to spawn additional payload callbacks.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Command & Control |
Telemetry Coverage
Rule Body
[rule]
description = """
Detects when a new OsaScript download cradle is spawned as a backgrounded process to launch a new callback. The Apfell
agent payload utilizes this method in order to spawn additional payload callbacks.
"""
id = "c8e816ab-360f-4608-aebf-a056437c7df0"
license = "Elastic License v2"
name = "OsaScript Download Cradle Spawned"
os_list = ["macos"]
reference = [
"https://github.com/MythicAgents/apfell/blob/master/documentation-payload/apfell/commands/spawn_download_cradle.md",
"https://github.com/MythicAgents/apfell/",
]
version = "1.0.9"
query = '''
sequence by process.entity_id with maxspan=15s
[process where event.type == "start" and event.action == "exec" and
process.name == "osascript" and process.args == "-l" and
process.args like~ "JavaScript" and process.args == "-e" and
process.parent.name == "osascript"]
[network where event.type == "start" and process.name == "osascript"]
'''
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 = "T1008"
name = "Fallback Channels"
reference = "https://attack.mitre.org/techniques/T1008/"
[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
Ordered sequence: each step below must occur in order within 15s, correlated by process.entity_id.
Stage 1: process
[process where event.type == "start" and event.action == "exec" and
process.name == "osascript" and process.args == "-l" and
process.args like~ "JavaScript" and process.args == "-e" and
process.parent.name == "osascript"]
Stage 2: network
[network where event.type == "start" and process.name == "osascript"]
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 | eq |
| field:"process.args" kind:eq |
process.args | wildcard |
| field:"process.args" kind:wildcard value:"JavaScript" |
process.name | eq |
| field:"process_basename" kind:eq value:"osascript" |
process.parent.name | eq |
| field:"parent_process_basename" kind:eq value:"osascript" |
Port Forwarding Rule Addition
#Identifies the creation of a new port forwarding rule. An adversary may abuse this technique to bypass network segmentation restrictions.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Persistence | |
| Defense Impairment | |
| Command & Control |
Telemetry Coverage
Rule Body
[metadata]
creation_date = "2020/11/25"
integration = ["endpoint", "windows", "sentinel_one_cloud_funnel", "m365_defender", "crowdstrike"]
maturity = "production"
updated_date = "2026/05/04"
[rule]
author = ["Elastic"]
description = """
Identifies the creation of a new port forwarding rule. An adversary may abuse this technique to bypass network
segmentation restrictions.
"""
from = "now-9m"
index = [
"winlogbeat-*",
"logs-endpoint.events.registry-*",
"logs-windows.sysmon_operational-*",
"endgame-*",
"logs-sentinel_one_cloud_funnel.*",
"logs-m365_defender.event-*",
"logs-crowdstrike.fdr*",
]
language = "eql"
license = "Elastic License v2"
name = "Port Forwarding Rule Addition"
note = """## Triage and analysis
### Investigating Port Forwarding Rule Addition
Network port forwarding is a mechanism to redirect incoming TCP connections (IPv4 or IPv6) from the local TCP port to any other port number, or even to a port on a remote computer.
Attackers may configure port forwarding rules to bypass network segmentation restrictions, using the host as a jump box to access previously unreachable systems.
This rule monitors the modifications to the `HKLM\\SYSTEM\\*ControlSet*\\Services\\PortProxy\\v4tov4\\` subkeys.
#### 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 and system owners and confirm whether they are aware of this activity.
- Investigate other alerts associated with the user/host during the past 48 hours.
- Assess whether this behavior is prevalent in the environment by looking for similar occurrences across hosts.
- Identify the target host IP address, check the connections originating from the host where the modification occurred, and inspect the credentials used.
- Investigate suspicious login activity, such as unauthorized access and logins from outside working hours and unusual locations.
### 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.
- If this rule is noisy in your environment due to expected activity, consider adding exceptions — preferably with a combination of user and command line conditions.
### Response and remediation
- Initiate the incident response process based on the outcome of the triage.
- Delete the port forwarding rule.
- Isolate the involved host to prevent further post-compromise behavior.
- If the triage identified malware, search the environment for additional compromised hosts.
- Implement temporary network rules, procedures, and segmentation to contain the malware.
- Stop suspicious processes.
- Immediately block the identified indicators of compromise (IoCs).
- Inspect the affected systems for additional malware backdoors like reverse shells, reverse proxies, or droppers that attackers could use to reinfect the system.
- Remove and block malicious artifacts identified during triage.
- Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
- Investigate credential exposure on systems compromised or used by the attacker to ensure all compromised accounts are identified. Reset passwords for these accounts and other potentially compromised credentials, such as email, business systems, and web services.
- Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
- Using the incident response data, update logging and audit policies to improve the mean time to detect (MTTD) and the mean time to respond (MTTR).
"""
setup = """## Setup
This rule is designed for data generated by [Elastic Defend](https://www.elastic.co/security/endpoint-security), which provides native endpoint detection and response, along with event enrichments designed to work with our detection rules.
Setup instructions: https://ela.st/install-elastic-defend
### Additional data sources
This rule also supports the following third-party data sources. For setup instructions, refer to the links below:
- [CrowdStrike](https://ela.st/crowdstrike-integration)
- [Microsoft Defender XDR](https://ela.st/m365-defender)
- [SentinelOne Cloud Funnel](https://ela.st/sentinel-one-cloud-funnel)
- [Sysmon Registry Events](https://ela.st/sysmon-event-reg-setup)
"""
references = [
"https://www.fireeye.com/blog/threat-research/2019/01/bypassing-network-restrictions-through-rdp-tunneling.html",
]
risk_score = 47
rule_id = "3535c8bb-3bd5-40f4-ae32-b7cd589d5372"
severity = "medium"
tags = [
"Domain: Endpoint",
"OS: Windows",
"Use Case: Threat Detection",
"Tactic: Command and Control",
"Tactic: Defense Evasion",
"Resources: Investigation Guide",
"Data Source: Elastic Endgame",
"Data Source: Elastic Defend",
"Data Source: Sysmon",
"Data Source: SentinelOne",
"Data Source: Microsoft Defender XDR",
"Data Source: Crowdstrike",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
registry where host.os.type == "windows" and event.type == "change" and
registry.path : "*\\SYSTEM\\*ControlSet*\\Services\\PortProxy\\v4tov4\\*" and registry.data.strings != null
'''
[[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.001"
name = "Internal Proxy"
reference = "https://attack.mitre.org/techniques/T1090/001/"
[[rule.threat.technique]]
id = "T1572"
name = "Protocol Tunneling"
reference = "https://attack.mitre.org/techniques/T1572/"
[rule.threat.tactic]
id = "TA0011"
name = "Command and Control"
reference = "https://attack.mitre.org/tactics/TA0011/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1112"
name = "Modify Registry"
reference = "https://attack.mitre.org/techniques/T1112/"
[rule.threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
Stages and Predicates
Stage 1: registry
registry where host.os.type == "windows" and event.type == "change" and
registry.path : "*\\SYSTEM\\*ControlSet*\\Services\\PortProxy\\v4tov4\\*" and registry.data.strings != null
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.type | eq |
| field:"event.type" kind:eq value:"change" |
registry.data.strings | is_not_null | field:"Details" kind:is_not_null | |
registry.path | wildcard |
| field:"TargetObject" kind:wildcard value:"*\SYSTEM\*ControlSet*\Services\PortProxy\v4tov4\*" |
Potential Data Exfiltration Through Curl
#Detects the use of curl to upload files to an internet server. Threat actors often will collect and exfiltrate data on a system to their C2 server for review. Many threat actors have been observed using curl to upload the collected data. Use of curl in this way, while not inherently malicious, should be considered highly abnormal and suspicious activity.
MITRE ATT&CK Coverage
Telemetry Coverage
Rule Body
[metadata]
creation_date = "2025/04/29"
integration = ["endpoint", "windows", "system", "sentinel_one_cloud_funnel", "crowdstrike", "auditd_manager"]
maturity = "production"
updated_date = "2026/07/29"
[rule]
author = ["Elastic"]
description = """
Detects the use of curl to upload files to an internet server. Threat actors often will collect and exfiltrate data on a
system to their C2 server for review. Many threat actors have been observed using curl to upload the collected data. Use
of curl in this way, while not inherently malicious, should be considered highly abnormal and suspicious activity.
"""
from = "now-9m"
index = [
"logs-crowdstrike.fdr*",
"logs-endpoint.events.process-*",
"logs-sentinel_one_cloud_funnel.*",
"logs-system.security*",
"logs-windows.forwarded*",
"logs-windows.sysmon_operational-*",
"winlogbeat-*",
"auditbeat-*",
"logs-auditd_manager.auditd-*"
]
language = "eql"
license = "Elastic License v2"
name = "Potential Data Exfiltration Through Curl"
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 Data Exfiltration Through Curl
Curl is a command-line tool used for transferring data with URLs, commonly employed for legitimate data exchange tasks. However, adversaries can exploit curl to exfiltrate sensitive data by uploading compressed files to remote servers. The detection rule identifies suspicious curl usage by monitoring for specific command patterns and arguments indicative of data uploads, flagging abnormal activities for further investigation.
### Possible investigation steps
- Review the process command line to confirm the presence of suspicious arguments such as "-F", "-T", "-d", or "--data*" and check for any compressed file extensions like .zip, .gz, or .tgz being uploaded to an external server.
- Investigate the parent process of the curl command to understand the context in which curl was executed, including the parent executable and its purpose.
- Examine network logs to identify the destination IP address or domain to which the data was being uploaded, and assess whether it is a known or suspicious entity.
- Check for any recent file creation or modification events on the host that match the compressed file types mentioned in the query, which could indicate data collection prior to exfiltration.
- Correlate this event with other security alerts or logs from the same host to identify any patterns of behavior that might suggest a broader compromise or data exfiltration attempt.
### False positive analysis
- Legitimate data transfers using curl for system backups or data synchronization can trigger the rule. To manage this, identify and whitelist specific processes or scripts that are known to perform these tasks regularly.
- Automated system updates or software installations that use curl to download and upload data might be flagged. Exclude these processes by verifying their source and adding them to an exception list if they are from trusted vendors.
- Internal data transfers within a secure network that use curl for efficiency can be mistaken for exfiltration. Monitor the destination IP addresses and exclude those that are internal or known safe endpoints.
- Developers or system administrators using curl for testing or development purposes may inadvertently trigger the rule. Educate these users on the potential alerts and establish a process for them to notify security teams of their activities to prevent unnecessary investigations.
- Scheduled tasks or cron jobs that use curl for routine data uploads should be reviewed and, if deemed safe, added to an exception list to avoid repeated false positives.
### Response and remediation
- Immediately isolate the affected system from the network to prevent further data exfiltration and contain the threat.
- Terminate any suspicious curl processes identified by the detection rule to stop ongoing data transfers.
- Conduct a forensic analysis of the affected system to identify any additional malicious activities or compromised data.
- Change credentials and access keys that may have been exposed or used during the incident to prevent unauthorized access.
- Notify the security operations team and relevant stakeholders about the incident for awareness and further action.
- Review and update firewall and network security rules to block unauthorized outbound traffic, especially to suspicious or unknown external servers.
- Implement enhanced monitoring and logging for curl usage and similar data transfer tools to detect and respond to future exfiltration attempts promptly.
"""
references = [
"https://everything.curl.dev/usingcurl/uploads",
"https://cloud.google.com/blog/topics/threat-intelligence/disrupting-gridtide-global-espionage-campaign?hl=en"
]
risk_score = 47
rule_id = "be70614d-4295-473c-a953-582aef41c865"
setup = """## Setup
This rule requires data coming in from Elastic Defend.
### Elastic Defend Integration Setup
Elastic Defend is integrated into the Elastic Agent using Fleet. Upon configuration, the integration allows the Elastic Agent to monitor events on your host and send data to the Elastic Security app.
#### Prerequisite Requirements:
- Fleet is required for Elastic Defend.
- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).
#### The following steps should be executed in order to add the Elastic Defend integration on a Linux System:
- Go to the Kibana home page and click "Add integrations".
- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.
- Click "Add Elastic Defend".
- Configure the integration name and optionally add a description.
- Select the type of environment you want to protect, either "Traditional Endpoints" or "Cloud Workloads".
- Select a configuration preset. Each preset comes with different default settings for Elastic Agent, you can further customize these later by configuring the Elastic Defend integration policy. [Helper guide](https://www.elastic.co/guide/en/security/current/configure-endpoint-integration-policy.html).
- We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"
- Enter a name for the agent policy in "New agent policy name". If other agent policies already exist, you can click the "Existing hosts" tab and select an existing policy instead.
For more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/8.10/agent-policy.html).
- Click "Save and Continue".
- To complete the integration, select "Add Elastic Agent to your hosts" and continue to the next section to install the Elastic Agent on your hosts.
For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
"""
severity = "medium"
tags = [
"Domain: Endpoint",
"OS: Linux",
"OS: Windows",
"OS: macOS",
"Use Case: Threat Detection",
"Tactic: Exfiltration",
"Resources: Investigation Guide",
"Data Source: Elastic Defend",
"Data Source: Crowdstrike",
"Data Source: SentinelOne",
"Data Source: Sysmon",
"Data Source: Auditd Manager",
"Data Source: Windows Security Event Logs"
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
process where event.type == "start" and
event.action in ("exec", "exec_event", "start", "ProcessRollup2", "executed", "process_started") and
process.name : ("curl", "curl.exe") and
(
process.args in ("-T", "--upload-file") or
(
(process.args in ("-F", "-d", "--form") or process.args like "--data*") and process.command_line like "*@*"
)
) and
(
process.command_line like ("*http:*", "*https:*", "*ftp:*", "*ftps:*") or
process.command_line regex ".*[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}.*"
) and
not (
process.args : (
"https://*/ap/fleet/*", "https://*/api/saved_objects/*", "http*localhost:*", "http*127.0.0.*", "*ApiKey*", "http*.us-central1.run.app/*",
"*Authorization*", "*session.id*", "http*.elastic-cloud.com*", "http*.elastic.dev*", "http*.elastic.cloud*", "http*.aws.found.io*",
"http*.gcp.cloud.es.io*", "http*.cisco.com/api/*", "-u", "http://192.168*",
"*incoming.telemetry.mozilla.org*", "*cloudamize.com*"
) or
process.args == "--unix-socket" or
process.parent.name like "clevis*" or
process.parent.executable in ("/usr/bin/clevis-decrypt-tang", "/bin/clevis-decrypt-tang") or
(
process.parent.command_line like "*oracle/retina/vvaa-*" and
process.working_directory == "/home/oracle"
) or
(
process.working_directory == "/home/oracle" and
process.args == "--trace" and
process.parent.executable like "/home/oracle/retina/vvaa-*-oracle/app/*.sh"
) or
(
process.working_directory == "/home/service/common/system.check" and
process.parent.command_line == "/bin/bash ./check.sh"
) or
(
process.parent.executable == "C:\\Windows\\SysWOW64\\cmd.exe" and
process.parent.args like "?:\\*\\temp-app\\caller_batch_*.bat"
) or
(
process.parent.executable == "/opt/rudder/share/commands/agent-run" and
process.parent.command_line == "/bin/sh /opt/rudder/share/commands/agent-run -uRN" and
process.args like "/var/rudder/reports/ready/*"
) or
(
process.parent.executable like "/var/lib/docker/overlay2/*/merged/usr/bin/bash" and
process.parent.command_line like "bash /home/*/old/scripts/crawler.sh start"
)
)
'''
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1048"
name = "Exfiltration Over Alternative Protocol"
reference = "https://attack.mitre.org/techniques/T1048/"
[[rule.threat.technique.subtechnique]]
id = "T1048.001"
name = "Exfiltration Over Symmetric Encrypted Non-C2 Protocol"
reference = "https://attack.mitre.org/techniques/T1048/001/"
[[rule.threat.technique.subtechnique]]
id = "T1048.003"
name = "Exfiltration Over Unencrypted Non-C2 Protocol"
reference = "https://attack.mitre.org/techniques/T1048/003/"
[rule.threat.tactic]
id = "TA0010"
name = "Exfiltration"
reference = "https://attack.mitre.org/tactics/TA0010/"
Stages and Predicates
Stage 1: process
process where event.type == "start" and
event.action in ("exec", "exec_event", "start", "ProcessRollup2", "executed", "process_started") and
process.name : ("curl", "curl.exe") and
(
process.args in ("-T", "--upload-file") or
(
(process.args in ("-F", "-d", "--form") or process.args like "--data*") and process.command_line like "*@*"
)
) and
(
process.command_line like ("*http:*", "*https:*", "*ftp:*", "*ftps:*") or
process.command_line regex ".*[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}.*"
) and
not (
process.args : (
"https://*/ap/fleet/*", "https://*/api/saved_objects/*", "http*localhost:*", "http*127.0.0.*", "*ApiKey*", "http*.us-central1.run.app/*",
"*Authorization*", "*session.id*", "http*.elastic-cloud.com*", "http*.elastic.dev*", "http*.elastic.cloud*", "http*.aws.found.io*",
"http*.gcp.cloud.es.io*", "http*.cisco.com/api/*", "-u", "http://192.168*",
"*incoming.telemetry.mozilla.org*", "*cloudamize.com*"
) or
process.args == "--unix-socket" or
process.parent.name like "clevis*" or
process.parent.executable in ("/usr/bin/clevis-decrypt-tang", "/bin/clevis-decrypt-tang") or
(
process.parent.command_line like "*oracle/retina/vvaa-*" and
process.working_directory == "/home/oracle"
) or
(
process.working_directory == "/home/oracle" and
process.args == "--trace" and
process.parent.executable like "/home/oracle/retina/vvaa-*-oracle/app/*.sh"
) or
(
process.working_directory == "/home/service/common/system.check" and
process.parent.command_line == "/bin/bash ./check.sh"
) or
(
process.parent.executable == "C:\\Windows\\SysWOW64\\cmd.exe" and
process.parent.args like "?:\\*\\temp-app\\caller_batch_*.bat"
) or
(
process.parent.executable == "/opt/rudder/share/commands/agent-run" and
process.parent.command_line == "/bin/sh /opt/rudder/share/commands/agent-run -uRN" and
process.args like "/var/rudder/reports/ready/*"
) or
(
process.parent.executable like "/var/lib/docker/overlay2/*/merged/usr/bin/bash" and
process.parent.command_line like "bash /home/*/old/scripts/crawler.sh start"
)
)
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 | in |
| field:"process.args" kind:in |
process.args | wildcard |
| field:"process.args" kind:wildcard value:"--data*" |
process.command_line | regex_match |
| field:"CommandLine" kind:regex_match value:".*[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.*" |
process.command_line | wildcard |
| field:"CommandLine" kind:wildcard |
process.name | wildcard |
| field:"process_basename" kind:wildcard |
Exclusions
The rule actively suppresses these predicates.
Potential Execution via Token Theft
#Identifies the creation of a process running with a token duplicate and from unbacked memory. Adversaries may create a new process with a different token to escalate privileges and bypass access controls.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Privilege Escalation |
Rule Body
[rule]
description = """
Identifies the creation of a process running with a token duplicate and from unbacked memory. Adversaries may create a
new process with a different token to escalate privileges and bypass access controls.
"""
id = "a2d5bdc0-b6e8-4d09-8bfe-ea22b7966141"
license = "Elastic License v2"
name = "Potential Execution via Token Theft"
os_list = ["windows"]
reference = [
"https://lengjibo.github.io/token/",
"https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-createprocesswithtokenw",
]
version = "1.0.20"
query = '''
process where event.action == "start" and process.executable != null and
process.Ext.effective_parent.name : "?*" and process.Ext.session_info.user_flags : "LOGON_EXTRA_SIDS" and
process.parent.thread.Ext.call_stack_summary :
("ntdll.dll|kernelbase.dll|advapi32.dll|Unbacked",
"ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|kernelbase.dll|advapi32.dll|Unbacked",
"ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|kernelbase.dll|Unbacked|kernel32.dll",
"ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|kernelbase.dll|Unbacked",
"ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|kernelbase.dll|kernel32.dll|Unbacked",
"ntdll.dll|kernelbase.dll|kernel32.dll|Unbacked",
"*|seclogon.dll|*") and
not (process.Ext.effective_parent.executable : "?:\\Program Files*\\Dell\\SARemediation\\agent\\DellSupportAssistRemedationService.exe" and
process.executable : "?:\\Program Files*\\Dell\\SARemediation\\*.exe") and
not (process.code_signature.status : "trusted" and
process.code_signature.subject_name : ("LENOVO", "Dell Inc", "Citrix Systems, Inc.", "Docker Inc", "Solarwinds Worldwide, LLC",
"Binary Fortress Software Ltd", "Seagull Scientific Inc.", "Zoom Video Communications, Inc.",
"Sangfor Technologies Inc.", "N-ABLE TECHNOLOGIES LTD", "LIGHT STAR INFORMATION CO.,LTD.", "Adobe Inc.")) and
not (process.Ext.effective_parent.executable : ("?:\\Windows\\explorer.exe", "?:\\Windows\\Sys*\\sdiagnhost.exe") and
process.parent.thread.Ext.call_stack_summary : "*|seclogon.dll|*") and
not (startswith~(process.Ext.effective_parent.executable, process.executable) and process.executable : "?:\\Program Files*") and
not (startswith~(process.Ext.effective_parent.executable, process.parent.executable) and process.code_signature.status : "trusted" and
not process.code_signature.subject_name : "Microsoft*") and
not (process.Ext.effective_parent.name : ("dllhost.exe", "powershell.exe") and process.name : "powershell.exe" and
process.command_line : "*CQAZQB4AGUAYwBfAHcAcgBhAHAAcABlAHIAIAA9*") and
not (process.parent.executable : "?:\\Windows\\System32\\wsmprovhost.exe" and process.Ext.effective_parent.executable : "?:\\Windows\\System32\\wsmprovhost.exe") and
not (process.parent.executable : "?:\\windows\\system32\\inetsrv\\w3wp.exe" and
process.Ext.effective_parent.executable : "?:\\windows\\system32\\inetsrv\\w3wp.exe") and
not (process.parent.name : "powershell.exe" and process.parent.thread.Ext.call_stack_summary : "ntdll.dll|kernelbase.dll|kernel32.dll|Unbacked") and
not process.Ext.effective_parent.executable :
("?:\\Program Files*\\Dell\\Dell Peripheral Manager\\DPM.exe",
"?:\\Windows\\System32\\DriverStore\\FileRepository\\*.exe",
"?:\\Windows\\System32\\sihost.exe",
"?:\\Windows\\System32\\ServerManager.exe",
"C:\\Windows\\System32\\CustomShellHost.exe",
"?:\\Program Files\\UniGetUI\\UniGetUI.exe",
"C:\\Program Files\\AcerQAAgent\\AQAUserPS.exe",
"?:\\Program Files\\Microsoft\\Azure Functions Core Tools\\func.exe",
"?:\\Windows\\System32\\oobe\\FirstLogonAnim.exe",
"?:\\Program Files (x86)\\vdogServer\\VDogMasterService.exe",
"C:\\Program Files (x86)\\Outbyte\\Driver Updater\\DriverUpdater.exe") and
not process.executable : "?:\\Program Files (x86)\\Alternative\\QuickBooks-connector\\QuickbooksDesktopSync.exe" and
not process.hash.sha256 :
("7b36e127e1fa53e0c6462312777c5d004ea83bde67e6df32fb8920b6c001d664",
"61d372863c9cb2d83b22358c1f269b153927316b59df8093df82a497fcc40149",
"c42b1cdba6020d3858ce47c6a0d279045a741f21263bb417742371d0c04ae79a",
"90862d8b1dfc276244bcf321290388bfa56ec8102b460536286704a0e970c057",
"a6913e854629c944dbe43ca15fb85a56b280b0a609b323fa57154d0545b2371a",
"27cf7476aef249d50a205d74d5a8186187fc6447c9762c69bf1c4c9f5327db22") and
not (process.parent.executable : ("?:\\Program Files\\PowerShell\\*\\pwsh.exe", "?:\\Program Files (x86)\\PowerShell\\*\\pwsh.exe") and
process.Ext.effective_parent.executable : ("?:\\Program Files\\PowerShell\\*\\pwsh.exe", "?:\\Program Files (x86)\\PowerShell\\*\\pwsh.exe")) and
not _arraysearch(process.parent.thread.Ext.call_stack, $entry, $entry.callsite_trailing_bytes : "488b5560c6420c01833d*") and
not process.Ext.effective_parent.executable :
("C:\\Program Files\\WingetUI\\UniGetUI.exe",
"C:\\Program Files\\Synaptics\\SynTP\\SynTPEnh.exe",
"C:\\Program Files\\Pulseway\\pcmonusertask.exe",
"C:\\Program Files\\Seagull\\BarTender Suite\\PrintStation.exe",
"C:\\Program Files\\UniGetUI\\UniGetUI.exe",
"C:\\Program Files (x86)\\Scalefusion\\Scalefusion MDM Agent\\bin\\OnlineClientService.exe",
"C:\\Program Files\\Veeam\\Endpoint Backup\\Veeam.Endpoint.RecoveryMedia.exe") and
not (process.Ext.effective_parent.executable : "C:\\LeanServer\\SentinelRecorder\\RecordingService.exe" and
process.executable : "C:\\Windows\\System32\\netsh.exe") and
not process.executable : "C:\\Program Files\\WindowsApps\\Microsoft.DesktopAppInstaller_*\\winget.exe" and
not (process.executable : "C:\\Program Files\\Common Files\\microsoft shared\\ClickToRun\\MavInject32.exe" and
process.parent.executable : "C:\\Program Files\\Common Files\\microsoft shared\\ClickToRun\\OfficeClickToRun.exe") and
not process.parent.executable :
("C:\\Program Files\\IIS\\Microsoft Web Deploy\\MsDepSvc.exe",
"C:\\Program Files\\ASUS\\ARMOURY CRATE Lite Service\\ArmouryCrate.UserSessionHelper.exe") and
not (process.parent.executable : "C:\\Windows\\highsystem.NET\\Client\\hdnClSvc.NET.exe" and process.Ext.effective_parent.executable : "C:\\Windows\\explorer.exe") and
not (process.name : "powershell.exe" and
process.parent.command_line : "*AkAHMAcABsAGkAdABfAHAAYQByAHQAcwAgAD0AIAAkAGUAeABlAGMAXwB3AHIAYQBwAHAAZQByAF8AcwB0AHIALgBTAHAAbABpAHQAKABAACgAIgBgADAAYAAwAGAAMABgADAAIgApACwAIAAyACwA*" and
process.Ext.effective_parent.executable : "C:\\Windows\\System32\\conhost.exe") and
not (process.executable : "C:\\Program Files (x86)\\Common Files\\Adobe\\ARM\\?.?\\AdobeARM.exe" and
process.parent.executable : "C:\\Program Files (x86)\\Common Files\\Adobe\\ARM\\?.?\\AdobeARM.exe" and process.Ext.effective_parent.executable : "C:\\Windows\\System32\\explorer.exe") and
not (process.name : "powershell.exe" and process.command_line : "*JABlAHgAZQBjAF8AdwByAGEAcABwAGUAcgBfAHMAdAByAC4AUwBwAGwAaQB0ACgAQAAoACIAYAAwAGAAMABgADAAYAAwACIAKQ*" and
process.Ext.effective_parent.executable : "C:\\Windows\\SoftwareDistribution\\Download\\Install\\AM_Delta_Patch_*.exe") and
not (process.executable : "C:\\Program Files\\WindowsApps\\Microsoft.DesktopAppInstaller_*\\winget.exe" and
process.parent.executable : "C:\\Users\\*\\AppData\\Local\\Programs\\UniGetUI\\UniGetUI.exe" and
process.Ext.effective_parent.executable : "C:\\Users\\*\\AppData\\Local\\Programs\\UniGetUI\\UniGetUI.exe")
'''
min_endpoint_version = "8.8.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 = "T1134"
name = "Access Token Manipulation"
reference = "https://attack.mitre.org/techniques/T1134/"
[[threat.technique.subtechnique]]
id = "T1134.001"
name = "Token Impersonation/Theft"
reference = "https://attack.mitre.org/techniques/T1134/001/"
[[threat.technique.subtechnique]]
id = "T1134.002"
name = "Create Process with Token"
reference = "https://attack.mitre.org/techniques/T1134/002/"
[threat.tactic]
id = "TA0004"
name = "Privilege Escalation"
reference = "https://attack.mitre.org/tactics/TA0004/"
[internal]
min_endpoint_version = "8.8.0"
Stages and Predicates
Stage 1: process
process where event.action == "start" and process.executable != null and
process.Ext.effective_parent.name : "?*" and process.Ext.session_info.user_flags : "LOGON_EXTRA_SIDS" and
process.parent.thread.Ext.call_stack_summary :
("ntdll.dll|kernelbase.dll|advapi32.dll|Unbacked",
"ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|kernelbase.dll|advapi32.dll|Unbacked",
"ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|kernelbase.dll|Unbacked|kernel32.dll",
"ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|kernelbase.dll|Unbacked",
"ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|kernelbase.dll|kernel32.dll|Unbacked",
"ntdll.dll|kernelbase.dll|kernel32.dll|Unbacked",
"*|seclogon.dll|*") and
not (process.Ext.effective_parent.executable : "?:\\Program Files*\\Dell\\SARemediation\\agent\\DellSupportAssistRemedationService.exe" and
process.executable : "?:\\Program Files*\\Dell\\SARemediation\\*.exe") and
not (process.code_signature.status : "trusted" and
process.code_signature.subject_name : ("LENOVO", "Dell Inc", "Citrix Systems, Inc.", "Docker Inc", "Solarwinds Worldwide, LLC",
"Binary Fortress Software Ltd", "Seagull Scientific Inc.", "Zoom Video Communications, Inc.",
"Sangfor Technologies Inc.", "N-ABLE TECHNOLOGIES LTD", "LIGHT STAR INFORMATION CO.,LTD.", "Adobe Inc.")) and
not (process.Ext.effective_parent.executable : ("?:\\Windows\\explorer.exe", "?:\\Windows\\Sys*\\sdiagnhost.exe") and
process.parent.thread.Ext.call_stack_summary : "*|seclogon.dll|*") and
not (startswith~(process.Ext.effective_parent.executable, process.executable) and process.executable : "?:\\Program Files*") and
not (startswith~(process.Ext.effective_parent.executable, process.parent.executable) and process.code_signature.status : "trusted" and
not process.code_signature.subject_name : "Microsoft*") and
not (process.Ext.effective_parent.name : ("dllhost.exe", "powershell.exe") and process.name : "powershell.exe" and
process.command_line : "*CQAZQB4AGUAYwBfAHcAcgBhAHAAcABlAHIAIAA9*") and
not (process.parent.executable : "?:\\Windows\\System32\\wsmprovhost.exe" and process.Ext.effective_parent.executable : "?:\\Windows\\System32\\wsmprovhost.exe") and
not (process.parent.executable : "?:\\windows\\system32\\inetsrv\\w3wp.exe" and
process.Ext.effective_parent.executable : "?:\\windows\\system32\\inetsrv\\w3wp.exe") and
not (process.parent.name : "powershell.exe" and process.parent.thread.Ext.call_stack_summary : "ntdll.dll|kernelbase.dll|kernel32.dll|Unbacked") and
not process.Ext.effective_parent.executable :
("?:\\Program Files*\\Dell\\Dell Peripheral Manager\\DPM.exe",
"?:\\Windows\\System32\\DriverStore\\FileRepository\\*.exe",
"?:\\Windows\\System32\\sihost.exe",
"?:\\Windows\\System32\\ServerManager.exe",
"C:\\Windows\\System32\\CustomShellHost.exe",
"?:\\Program Files\\UniGetUI\\UniGetUI.exe",
"C:\\Program Files\\AcerQAAgent\\AQAUserPS.exe",
"?:\\Program Files\\Microsoft\\Azure Functions Core Tools\\func.exe",
"?:\\Windows\\System32\\oobe\\FirstLogonAnim.exe",
"?:\\Program Files (x86)\\vdogServer\\VDogMasterService.exe",
"C:\\Program Files (x86)\\Outbyte\\Driver Updater\\DriverUpdater.exe") and
not process.executable : "?:\\Program Files (x86)\\Alternative\\QuickBooks-connector\\QuickbooksDesktopSync.exe" and
not process.hash.sha256 :
("7b36e127e1fa53e0c6462312777c5d004ea83bde67e6df32fb8920b6c001d664",
"61d372863c9cb2d83b22358c1f269b153927316b59df8093df82a497fcc40149",
"c42b1cdba6020d3858ce47c6a0d279045a741f21263bb417742371d0c04ae79a",
"90862d8b1dfc276244bcf321290388bfa56ec8102b460536286704a0e970c057",
"a6913e854629c944dbe43ca15fb85a56b280b0a609b323fa57154d0545b2371a",
"27cf7476aef249d50a205d74d5a8186187fc6447c9762c69bf1c4c9f5327db22") and
not (process.parent.executable : ("?:\\Program Files\\PowerShell\\*\\pwsh.exe", "?:\\Program Files (x86)\\PowerShell\\*\\pwsh.exe") and
process.Ext.effective_parent.executable : ("?:\\Program Files\\PowerShell\\*\\pwsh.exe", "?:\\Program Files (x86)\\PowerShell\\*\\pwsh.exe")) and
not _arraysearch(process.parent.thread.Ext.call_stack, $entry, $entry.callsite_trailing_bytes : "488b5560c6420c01833d*") and
not process.Ext.effective_parent.executable :
("C:\\Program Files\\WingetUI\\UniGetUI.exe",
"C:\\Program Files\\Synaptics\\SynTP\\SynTPEnh.exe",
"C:\\Program Files\\Pulseway\\pcmonusertask.exe",
"C:\\Program Files\\Seagull\\BarTender Suite\\PrintStation.exe",
"C:\\Program Files\\UniGetUI\\UniGetUI.exe",
"C:\\Program Files (x86)\\Scalefusion\\Scalefusion MDM Agent\\bin\\OnlineClientService.exe",
"C:\\Program Files\\Veeam\\Endpoint Backup\\Veeam.Endpoint.RecoveryMedia.exe") and
not (process.Ext.effective_parent.executable : "C:\\LeanServer\\SentinelRecorder\\RecordingService.exe" and
process.executable : "C:\\Windows\\System32\\netsh.exe") and
not process.executable : "C:\\Program Files\\WindowsApps\\Microsoft.DesktopAppInstaller_*\\winget.exe" and
not (process.executable : "C:\\Program Files\\Common Files\\microsoft shared\\ClickToRun\\MavInject32.exe" and
process.parent.executable : "C:\\Program Files\\Common Files\\microsoft shared\\ClickToRun\\OfficeClickToRun.exe") and
not process.parent.executable :
("C:\\Program Files\\IIS\\Microsoft Web Deploy\\MsDepSvc.exe",
"C:\\Program Files\\ASUS\\ARMOURY CRATE Lite Service\\ArmouryCrate.UserSessionHelper.exe") and
not (process.parent.executable : "C:\\Windows\\highsystem.NET\\Client\\hdnClSvc.NET.exe" and process.Ext.effective_parent.executable : "C:\\Windows\\explorer.exe") and
not (process.name : "powershell.exe" and
process.parent.command_line : "*AkAHMAcABsAGkAdABfAHAAYQByAHQAcwAgAD0AIAAkAGUAeABlAGMAXwB3AHIAYQBwAHAAZQByAF8AcwB0AHIALgBTAHAAbABpAHQAKABAACgAIgBgADAAYAAwAGAAMABgADAAIgApACwAIAAyACwA*" and
process.Ext.effective_parent.executable : "C:\\Windows\\System32\\conhost.exe") and
not (process.executable : "C:\\Program Files (x86)\\Common Files\\Adobe\\ARM\\?.?\\AdobeARM.exe" and
process.parent.executable : "C:\\Program Files (x86)\\Common Files\\Adobe\\ARM\\?.?\\AdobeARM.exe" and process.Ext.effective_parent.executable : "C:\\Windows\\System32\\explorer.exe") and
not (process.name : "powershell.exe" and process.command_line : "*JABlAHgAZQBjAF8AdwByAGEAcABwAGUAcgBfAHMAdAByAC4AUwBwAGwAaQB0ACgAQAAoACIAYAAwAGAAMABgADAAYAAwACIAKQ*" and
process.Ext.effective_parent.executable : "C:\\Windows\\SoftwareDistribution\\Download\\Install\\AM_Delta_Patch_*.exe") and
not (process.executable : "C:\\Program Files\\WindowsApps\\Microsoft.DesktopAppInstaller_*\\winget.exe" and
process.parent.executable : "C:\\Users\\*\\AppData\\Local\\Programs\\UniGetUI\\UniGetUI.exe" and
process.Ext.effective_parent.executable : "C:\\Users\\*\\AppData\\Local\\Programs\\UniGetUI\\UniGetUI.exe")
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | eq |
| field:"EventType" kind:eq value:"start" |
process.Ext.effective_parent.name | wildcard |
| field:"process.Ext.effective_parent.name" kind:wildcard value:"?*" |
process.Ext.session_info.user_flags | wildcard |
| field:"process.Ext.session_info.user_flags" kind:wildcard value:"LOGON_EXTRA_SIDS" |
process.code_signature.subject_name | wildcard |
| field:"Signature" kind:wildcard value:"Microsoft*" |
process.executable | is_not_null | field:"Image" kind:is_not_null | |
process.parent.thread.Ext.call_stack_summary | wildcard |
| field:"process.parent.thread.Ext.call_stack_summary" kind:wildcard |
Exclusions
The rule actively suppresses these predicates.
Potential Kerberos SPN Spoofing via Suspicious DNS Query
#Identifies queries for a DNS name containing a base64-encoded blob matching the pattern "UWhRCA...BAAAA". This pattern corresponds to a marshaled CREDENTIAL_TARGET_INFORMATION structure, commonly used in Kerberos coercion attacks. It is associated with tools and techniques that exploit SPN spoofing via DNS. Adversaries may abuse such names to coerce victim systems into authenticating to attacker-controlled hosts while requesting Kerberos tickets for legitimate services (often the victim's own identity). Depending on the coerced service and negotiated authentication, this can support Kerberos relay or NTLM reflection/relay paths without relying on normal NTLM fallback behavior.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Credential Access |
Telemetry Coverage
| Provider | Record / event type |
|---|---|
| Sysmon | Event ID 3: Network connection |
Rule Body
[metadata]
creation_date = "2025/06/14"
integration = ["endpoint", "windows", "sentinel_one_cloud_funnel", "crowdstrike"]
maturity = "production"
updated_date = "2026/04/24"
[rule]
author = ["Elastic"]
description = """
Identifies queries for a DNS name containing a base64-encoded blob matching the pattern "UWhRCA...BAAAA". This pattern
corresponds to a marshaled CREDENTIAL_TARGET_INFORMATION structure, commonly used in Kerberos coercion attacks. It is
associated with tools and techniques that exploit SPN spoofing via DNS. Adversaries may abuse such names to coerce
victim systems into authenticating to attacker-controlled hosts while requesting Kerberos tickets for legitimate
services (often the victim's own identity). Depending on the coerced service and negotiated authentication, this can
support Kerberos relay or NTLM reflection/relay paths without relying on normal NTLM fallback behavior.
"""
from = "now-9m"
index = [
"endgame-*",
"logs-crowdstrike.fdr*",
"logs-endpoint.events.network-*",
"logs-sentinel_one_cloud_funnel.*",
"logs-windows.sysmon_operational-*",
]
language = "eql"
license = "Elastic License v2"
name = "Potential Kerberos SPN Spoofing via Suspicious DNS Query"
references = [
"https://www.synacktiv.com/en/publications/ntlm-reflection-is-dead-long-live-ntlm-reflection-an-in-depth-analysis-of-cve-2025.html",
"https://blog.redteam-pentesting.de/2025/reflective-kerberos-relay-attack/",
"https://googleprojectzero.blogspot.com/2021/10/using-kerberos-for-authentication-relay.html",
"https://github.com/CICADA8-Research/RemoteKrbRelay/blob/main/README.md",
"https://github.com/Orange-Cyberdefense/ocd-mindmaps/blob/main/excalimap/mindmap/ad/authenticated.md",
]
risk_score = 73
rule_id = "99ac5005-8a9e-4625-a0af-5f7bb447204b"
severity = "high"
tags = [
"Domain: Endpoint",
"OS: Windows",
"Use Case: Threat Detection",
"Tactic: Credential Access",
"Data Source: Elastic Defend",
"Data Source: Elastic Endgame",
"Data Source: Crowdstrike",
"Data Source: SentinelOne",
"Data Source: Sysmon",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
network where host.os.type == "windows" and dns.question.name : "*UWhRC*BAAAA*"
'''
note = """## Triage and analysis
### Investigating Potential Kerberos SPN Spoofing via Suspicious DNS Query
#### Possible investigation steps
- What exact marshaled-target DNS name did the host query, and did it resolve?
- Focus: DNS event subtype and status: `event.action`, `dns.question.name`, `dns.question.type`, `dns.Ext.status`, and `dns.resolved_ip`.
- Hint: record the full case-preserved `dns.question.name`; the UWhRC...BAAAA marker is the marshaled CREDENTIAL_TARGET_INFORMATION SPN-spoofing anchor.
- Implication: escalate when the marker is intact and a successful result returns one or more `dns.resolved_ip` values; treat failed or request-only lookups as unresolved, not benign. Lower suspicion only after FP criteria confirm authorized testing for the exact name and host.
- Which local process or Windows component generated the DNS lookup?
- Focus: alert event and same-process start event for `host.id` and `process.entity_id`: `process.executable`, `process.command_line`, `process.pe.original_file_name`, `process.code_signature.subject_name`, and `process.parent.executable`.
- Hint: if these fields are sparse on the DNS event, query process events for the same `host.id` and `process.entity_id` around `@timestamp` before judging lineage. $investigate_3
- Implication: escalate when a normal Windows service, browser, RPC client, SMB client, or WebDAV component resolves the marker without test context because it may be a coerced victim; also escalate when `process.command_line` exposes relay or coercion tooling such as RemoteKrbRelay, PetitPotam, krbrelayx, dnstool, Pretender, or wspcoerce. Lower suspicion only when identity and lineage match the same recognized test workflow.
- Which host and principal anchors define containment and scope?
- Focus: alert host and principal anchors: `host.id`, `host.name`, `user.id`, `user.name`, and `user.domain`.
- Implication: use these anchors to scope related alerts, connection events, containment, and testing confirmation; do not lower suspicion on a familiar host or user without DNS, process, and destination alignment. Escalate priority when later connection or related-alert evidence uses the same anchors.
- Did the host connect to an IP returned by the suspicious DNS lookup?
- Focus: process-scoped network events for `host.id` and `process.entity_id`, correlating `dns.resolved_ip` from DNS results to connection-event `destination.ip`, `destination.port`, and `network.direction`. $investigate_0
- Hint: if a resolver helper, proxy, or service split separates lookup and connection, widen to same-host connections for the recovered IPs after the DNS result.
- Implication: escalate when the same process or host reaches a recovered IP, especially on relay-relevant services such as SMB, LDAP/LDAPS, HTTP/ADCS, RPC, or WinRM. Missing network telemetry is unresolved, not benign; DNS-only evidence still requires process and host explanation.
- Does the resolved destination fit a relay path rather than recognized test infrastructure?
- Focus: connection-event `destination.ip`, `destination.port`, `destination.as.organization.name`, and `destination.geo.country_iso_code` for IPs recovered from the prior DNS result.
- Hint: ASN and geo enrichment are expected mainly for public destinations; missing enrichment on private or loopback IPs is unresolved, not benign.
- Implication: escalate when the recovered IP is public or paired with relay-relevant ports that do not match confirmed testing evidence; if enrichment points to private, internal, or familiar infrastructure, carry it into FP validation instead of closing on ownership alone.
- If local evidence remains suspicious or unresolved, where else does the same activity appear?
- Focus: related alerts for `host.id` covering credential access, forced authentication, relay, lateral movement, or staging. $investigate_1
- Hint: then check whether the same `dns.question.name` appears on other hosts to separate one-host testing from shared relay infrastructure. $investigate_2
- Implication: broaden scope when the same host shows coercion or staging alerts, or when the exact encoded hostname appears on unrelated hosts; keep the case bounded when recurrence stays inside one confirmed test cohort.
- Escalate when the marshaled DNS marker plus process, host, destination, connection, or related-alert evidence indicates unauthorized relay or coercion; close only when DNS, process, host, destination, and scope evidence all align with one confirmed authorized security-testing workflow; preserve evidence and escalate when evidence is mixed or incomplete.
### False positive analysis
- Authorized red-team, purple-team, relay-lab validation, or security-research harnesses can generate this marker. Confirm only when the exact `dns.question.name`, process identity, parent context, `host.id`, user context, resolved destination, and related-alert scope all align with the same exercise. Use exercise records or owner confirmation as corroboration when telemetry alone cannot prove authorization; do not close solely on recurrence unless it stays inside a confirmed test cohort.
- Build exceptions from the minimum confirmed workflow pattern: `process.executable`, `process.pe.original_file_name`, `process.parent.executable`, `host.id`, user or test cohort, and recognized destination pattern. Avoid exceptions on `dns.question.name` alone, host alone, destination ownership alone, or broad tool names.
### Response and remediation
- If confirmed benign, reverse temporary containment and document the exact DNS marker, tool identity, parent context, host scope, user or test cohort, and destination pattern. Create an exception only after the same confirmed workflow proves stable across prior alerts.
- If suspicious but unconfirmed, preserve the alert and DNS events, exact `dns.question.name`, recovered `dns.resolved_ip` values, process tree, host and user context, connection events, and linked alert IDs before containment. Apply reversible containment tied to the findings, such as temporarily blocking the encoded hostname or recovered IPs, tightening outbound access from the affected host, or increasing monitoring; escalate to host isolation only when follow-on connectivity, relay evidence, or privileged-host exposure makes the risk unacceptable.
- If confirmed malicious, capture volatile endpoint state and process details before termination or cleanup, then isolate the host when identity, destination, or follow-on connection evidence confirms relay or coercion. Block or sinkhole the malicious hostname and recovered IPs, and remove malicious AD DNS records only after confirming record ownership or tampering evidence.
- If separate asset or incident context confirms the affected host or principal is identity infrastructure or privileged administration scope, activate the identity or Active Directory compromise response plan, scope machine-account or service-account exposure tied to the preserved host, user, destination, and related-alert evidence, and review related relay or forced-authentication activity on surrounding systems.
- Eradicate only the unauthorized tooling, scripts, scheduled tasks, service changes, or DNS records uncovered during the investigation, then remediate the access path or permissions that allowed the coercion record or tool to be introduced.
- After containment, hunt for the same encoded hostname pattern, recovered IPs, and process lineage across other hosts.
"""
setup = """## Setup
This rule is designed for data generated by [Elastic Defend](https://www.elastic.co/security/endpoint-security), which provides native endpoint detection and response, along with event enrichments designed to work with our detection rules.
Setup instructions: https://ela.st/install-elastic-defend
### Additional data sources
This rule also supports the following third-party data sources. For setup instructions, refer to the links below:
- [CrowdStrike](https://ela.st/crowdstrike-integration)
- [SentinelOne Cloud Funnel](https://ela.st/sentinel-one-cloud-funnel)
- [Sysmon Event ID 22 - DNS Query](https://ela.st/sysmon-event-22-setup)
"""
[rule.investigation_fields]
field_names = [
"@timestamp",
"host.id",
"user.name",
"process.entity_id",
"process.executable",
"process.command_line",
"process.pe.original_file_name",
"process.code_signature.subject_name",
"process.parent.executable",
"dns.question.name",
"dns.Ext.status",
"dns.resolved_ip",
"destination.ip",
"destination.port",
"network.direction",
]
[[transform.investigate]]
label = "Network events for the same process"
description = ""
providers = [
[
{ 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.entity_id", queryType = "phrase", value = "{{process.entity_id}}", valueType = "string" }
]
]
relativeFrom = "now-1h"
relativeTo = "now"
[[transform.investigate]]
label = "Alerts associated with the host"
description = ""
providers = [
[
{ excluded = false, field = "event.kind", queryType = "phrase", value = "signal", valueType = "string" },
{ excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" }
]
]
relativeFrom = "now-48h/h"
relativeTo = "now"
[[transform.investigate]]
label = "DNS and network events involving the same DNS name"
description = ""
providers = [
[
{ excluded = false, field = "event.category", queryType = "phrase", value = "network", valueType = "string" },
{ excluded = false, field = "dns.question.name", queryType = "phrase", value = "{{dns.question.name}}", valueType = "string" }
]
]
relativeFrom = "now-48h/h"
relativeTo = "now"
[[transform.investigate]]
label = "Process events for the DNS lookup process"
description = ""
providers = [
[
{ excluded = false, field = "event.category", queryType = "phrase", value = "process", valueType = "string" },
{ excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" },
{ excluded = false, field = "process.entity_id", queryType = "phrase", value = "{{process.entity_id}}", valueType = "string" }
]
]
relativeFrom = "now-1h"
relativeTo = "now"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1557"
name = "Adversary-in-the-Middle"
reference = "https://attack.mitre.org/techniques/T1557/"
[[rule.threat.technique.subtechnique]]
id = "T1557.001"
name = "LLMNR/NBT-NS Poisoning and SMB Relay"
reference = "https://attack.mitre.org/techniques/T1557/001/"
[[rule.threat.technique]]
id = "T1187"
name = "Forced Authentication"
reference = "https://attack.mitre.org/techniques/T1187/"
[rule.threat.tactic]
id = "TA0006"
name = "Credential Access"
reference = "https://attack.mitre.org/tactics/TA0006/"
Stages and Predicates
Stage 1: network
network where host.os.type == "windows" and dns.question.name : "*UWhRC*BAAAA*"
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
dns.question.name | wildcard |
| field:"QueryName" kind:wildcard value:"*UWhRC*BAAAA*" |
Potential Shellcode Injection via CLR
#Identifies attempts to allocate or execute shellcode from unbacked memory and where the protection provenance of the unbacked region is coming from the Microsoft Common Language Runtime DLL.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Stealth |
Rule Body
[rule]
description = """
Identifies attempts to allocate or execute shellcode from unbacked memory and where the protection provenance of the
unbacked region is coming from the Microsoft Common Language Runtime DLL.
"""
id = "1370f164-1809-4668-ad6c-dbf5bd278120"
license = "Elastic License v2"
name = "Potential Shellcode Injection via CLR"
os_list = ["windows"]
version = "1.0.12"
query = '''
api where
process.executable != null and process.parent.executable != null and
process.Ext.api.behaviors in ("shellcode", "allocate_shellcode", "execute_shellcode") and
process.Ext.api.name in ("VirtualAlloc", "VirtualProtect", "WriteProcessMemory", "VirtualProtectEx", "VirtualAllocEx",
"MapViewOfFile", "MapViewOfFile2", "SetThreadContext", "SuspendThread", "ReadProcessMemory", "connect") and
process.thread.Ext.call_stack_final_user_module.name == "Unbacked" and
process.thread.Ext.call_stack_final_user_module.protection_provenance like ("Unbacked*", "clr.dll", "mscorwks.dll", "coreclr.dll", "*.exe*") and
(
process.thread.Ext.call_stack_final_user_module.protection_provenance in ("clr.dll", "mscorwks.dll", "coreclr.dll") or
process.thread.Ext.call_stack_final_user_module.protection_provenance_path like
("c:\\windows\\microsoft.net\\framework*\\clr.dll",
"c:\\program files*\\dotnet\\shared\\microsoft.netcore.app\\*\\coreclr.dll",
"c:\\windows\\microsoft.net\\framework*\\mscorwks.dll")
) and
_arraysearch(process.thread.Ext.call_stack_final_user_module.code_signature, $entry,
$entry.trusted == true and $entry.subject_name in ("Microsoft Corporation", "Microsoft Windows", ".NET")) and
process.thread.Ext.call_stack_summary :
("ntdll.dll|Unbacked",
"ntdll.dll|kernelbase.dll|Unbacked",
"ntdll.dll|kernelbase.dll|kernel32.dll|Unbacked",
"ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|Unbacked",
"ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|kernelbase.dll|Unbacked",
"ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|Unbacked|kernel32.dll|ntdll.dll",
"ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|kernelbase.dll|Unbacked|kernel32.dll|ntdll.dll",
"ntdll.dll|mswsock.dll|ws2_32.dll|Unbacked",
"wow64cpu.dll|wow64.dll|ntdll.dll|mswsock.dll|ws2_32.dll|Unbacked|kernel32.dll|ntdll.dll") and
not process.Ext.api.parameters.size < 1000 and
/* trailing bytes are not null */
_arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info : "Unbacked*" and $entry.callsite_trailing_bytes : "?*") and
/* EOIM FPs */
not _arraysearch(process.thread.Ext.call_stack, $entry,
$entry.callsite_trailing_bytes : ("85c07472ff15942c*3d33270000747989c76a02e84a4359ff*",
"c9c3558bec51894dfc8b4dfce8b9ffffff8*",
"c9c20400558bec51894dfc8b45f*",
"e9fefdffffb001c9c20800558bec81e*",
"e9e8fdffffb0018be55dc20400*",
"85c00f95c05e5dc3cccccc5589e5535*",
"85c0740533c040eb3b837d10047516*",
"41c6470c01833*5f007406ff15*49895710488d65c85b5e5f415c415d415e415f5dc*",
"41c6470c01*41c6470c01488b55*",
"41c64*f007406ff15*",
"*10488d65c85b5e5f415c415d415e415f5dc3*",
"488b5560c6420c*48894570488b4d00e84300000090488b4570488b5560c642*",
"488b558*c6420c*007406ff15*",
"c6470c01*007406ff15*",
"85c00f95c05*",
"8be55dc3cccccccccccc558bec*",
"41c6470c01833d*",
"c6470c0148ba*7f0000ff11488bf0e8*",
"41c6460c0148ba4810*7f0000833a00740c48b9d819*",
"*48894e104883c4785b5e5f415c415d415e415f5dc*",
"488b5560c6420c01833d*7406ff15*",
"41c6460c0148ba*7f0000833a00740c48b9*",
"c6470c0148ba48*833a00740c48b9*",
"c6470c0148ba*833a00740c48b9*",
"488b957*ffffffc6420c01833d*",
"488b5560c6420c01*833a00740c*",
"488b55*7f0000833a00740c48b928f2*",
"41c6460c01833d*",
"c2140090b851000000ba*",
"c2140090b851000000ba5091*77ffd2c2140090b852000700ba509*",
"883c438c3cccccc8954241048894c24084883ec28488b4c24*",
"4883c438c3cccccc44884c24204489*",
"488b4c246048894108488b44246048837808007529*",
"41c644240c0148ba48202f12f87f0000833a00740c48b9f8292f12f87f0000ff118bf0e816b4ed5e85f60f95c00fb6c00fb6c041c644240c01488b5588498954",
"41c644240c01*85f60f95c00fb6c00fb6c041c644240c01488b55884989542410488d65c85b5e5f415c41",
"8bf04785f674a48bc65f5e5b8be55dc385f675f353ff75f8ff75f46a00ff150c07840a5f5e5b8be55dc3558beca11c45290b83ec2456578bfa85c075368d45dc",
"8d4c2410e8ba2cb2ff8b8c240c0100008bc75f5e33cce824b020028be55dc3cccccccc558bec83ec18a1fc55310b33c58945f8538b5d18568b7508578bf983fa",
"85c00f848f000000ff15f2a3cc0a3d332700000f859f000000488bb698000000488d7e78488d15d8264f0a4c8d059a284f0a488d5c24304889d941b9d2000000",
"85c07407b801000000eb4e837c2440047520e8960000004c8b4c244841b808000000488b542438488b4c2430ffd0eb29eb25837c244040751ee86f0000004c8b",
"488b55??c6420c0148ba14d536dbf97f0000833a00740c48b928f235dbf97f0000ff114*",
"488b9570ffffffc6420c01833d*488b458048894590488b45904889459890909090909090488b*",
"85c0746bff1528c2900f3d33270000747289c76a02e86d3378ff83c40484c0743a8d5c240489d96a0268600300006838a6320fe82f3478ff8d4424086a106838",
"488b9570ffffffc6420c01833de9835d5a007406ff15718d5d5a48894580e8a0ddb45990488b458048894590488b45904889459890909090909090488b459848",
"8985271f001056e8f60300008d8dbd1d001085c00f859400000056e84003000056e85502000056e85301000090909090909090908b4e3485c90f848900000003",
"488b5560c6420c01833d6a70c85f007406ff15768dc75f488bf0e8165a4a5f48897570488b4d00e84300000090488b4570488b5560c6420c01488b5560488b4d",
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"488b454833c9394804742a48894c24284533c94c8bc3894c242033d2ff97900000004885c0741083caff488bc8ff9788000000eb02ffd3488b4d504c8d4d4041",
"488b4d50458bc433d2e82019000041807d00007429488d46ff4883f8fd771fff97b8000000488b5550488bc8ff9750020000488b4df8ff97f8000000eb0f488b",
"0fb747064503f44883c628443bf00f826bffffff448badb80000004533c033d24883c9ffff55084439bfd400000074248b87d0000000488b741818eb0f4533c0",
"85c074*33270000747*89c76a02e8*ff83c40484c074*",
"85c074508b45146a0168001000000500f0ffff680010000003c650ffd785c08b4510741c8b4dfc050010000003c65056e8e8e6ffff5f5eb0015b8be55dc21000")) and
not (process.thread.Ext.call_stack_final_user_module.protection_provenance in ("tiptsf.dll", "mscms.dll") and
process.thread.Ext.call_stack_final_user_module.protection_provenance_path like "c:\\windows\\microsoft.net\\framework*\\mscorwks.dll") and
not process.thread.Ext.call_stack_final_user_module.protection_provenance_path like
("c:\\windows\\assembly\\nativeimages_*\\smdiagnostics.ni.dll",
"c:\\program files (x86)\\ibm\\client access\\*\\cwbsomri.dll",
"c:\\program files (x86)\\panasonic\\idrengine\\idrjchar.dll",
"c:\\windows\\assembly\\nativeimages_*\\newtonsoft.json\\*\\newtonsoft.json.ni.dll") and
not (process.Ext.api.name == "VirtualProtect" and
_arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info like ("c:\\windows\\sys?????\\ntdll.dll!LdrLoadDll*", "c:\\windows\\sys?????\\kernelbase.dll!LoadLibrary*"))) and
not process.Ext.api.metadata.target_address_path :
("?:\\program files\\sap businessobjects\\office addin\\plugins\\analysisoffice\\bixllfunctions.dll",
"?:\\program files (x86)\\viewplus\\tss?\\lib64\\htbrl.dll",
"?:\\program files (x86)\\vyaire\\sentrysuite\\vasservicedataclient.dll") and
not process.executable : ("?:\\Program Files (x86)\\CrystalScheduler\\crexport.exe",
"?:\\Program Files (x86)\\Bus\\Buscube64.exe",
"?:\\Program Files (x86)\\ETS5\\ETS5N.exe",
"?:\\Program Files (x86)\\ATAS Platform\\OFT.Platform.exe",
"?:\\Program Files\\Aseproda\\VirtusTPV Net\\VirtusTPVNet.exe",
"?:\\Program Files (x86)\\VisualCron\\VisualCronClient.exe",
"?:\\Program Files (x86)\\Citrix\\ICA Client\\Receiver\\Receiver.exe",
"C:\\Program Files\\Magnet Forensics\\Magnet AXIOM\\AXIOM Process\\AXIOMProcess.exe",
"?:\\Program Files (x86)\\SquareEnix\\FINAL FANTASY XIV - A Realm Reborn\\game\\ffxiv_dx11.exe",
"C:\\Program Files (x86)\\Mitel\\MiContact Center\\Applications\\Ignite\\Ignite.exe",
"C:\\Program Files (x86)\\SolarWinds\\Orion\\ExportToPdfCmd.exe",
"C:\\Program Files (x86)\\SolarWinds\\Orion\\WebsiteMaintenance.exe",
"C:\\Program Files (x86)\\QSR Automations\\ConnectSmart\\KitchenReportViewer\\Bin\\ReportViewer.exe") and
not (process.code_signature.trusted == true and
process.code_signature.subject_name in ("Ro-ot Service AG", "Connectwise, LLC", "SQUARE ENIX CO., LTD.", "Bluebeam, Inc.", "ANSYS Inc.", "Trimble Solutions Corporation", "Environmental Systems Research Institute, Inc.", "Acuant, Inc", "GB Group plc", "FUJIFILM Healthcare Americas Corporation", "Anego Studios SIA")) and
not (process.parent.executable : "C:\\Windows\\SysWOW64\\rundll32.exe" and process.executable : "C:\\Windows\\SysWOW64\\rundll32.exe" and
process.command_line : "* --enable-speech-input *")
'''
min_endpoint_version = "8.14.2"
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
tree = true
[[optional_actions]]
action = "rollback"
field = "process.entity_id"
state = 0
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1055"
name = "Process Injection"
reference = "https://attack.mitre.org/techniques/T1055/"
[threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
[internal]
min_endpoint_version = "8.14.2"
Stages and Predicates
Stage 1: api
api where
process.executable != null and process.parent.executable != null and
process.Ext.api.behaviors in ("shellcode", "allocate_shellcode", "execute_shellcode") and
process.Ext.api.name in ("VirtualAlloc", "VirtualProtect", "WriteProcessMemory", "VirtualProtectEx", "VirtualAllocEx",
"MapViewOfFile", "MapViewOfFile2", "SetThreadContext", "SuspendThread", "ReadProcessMemory", "connect") and
process.thread.Ext.call_stack_final_user_module.name == "Unbacked" and
process.thread.Ext.call_stack_final_user_module.protection_provenance like ("Unbacked*", "clr.dll", "mscorwks.dll", "coreclr.dll", "*.exe*") and
(
process.thread.Ext.call_stack_final_user_module.protection_provenance in ("clr.dll", "mscorwks.dll", "coreclr.dll") or
process.thread.Ext.call_stack_final_user_module.protection_provenance_path like
("c:\\windows\\microsoft.net\\framework*\\clr.dll",
"c:\\program files*\\dotnet\\shared\\microsoft.netcore.app\\*\\coreclr.dll",
"c:\\windows\\microsoft.net\\framework*\\mscorwks.dll")
) and
_arraysearch(process.thread.Ext.call_stack_final_user_module.code_signature, $entry,
$entry.trusted == true and $entry.subject_name in ("Microsoft Corporation", "Microsoft Windows", ".NET")) and
process.thread.Ext.call_stack_summary :
("ntdll.dll|Unbacked",
"ntdll.dll|kernelbase.dll|Unbacked",
"ntdll.dll|kernelbase.dll|kernel32.dll|Unbacked",
"ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|Unbacked",
"ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|kernelbase.dll|Unbacked",
"ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|Unbacked|kernel32.dll|ntdll.dll",
"ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|kernelbase.dll|Unbacked|kernel32.dll|ntdll.dll",
"ntdll.dll|mswsock.dll|ws2_32.dll|Unbacked",
"wow64cpu.dll|wow64.dll|ntdll.dll|mswsock.dll|ws2_32.dll|Unbacked|kernel32.dll|ntdll.dll") and
not process.Ext.api.parameters.size < 1000 and
_arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info : "Unbacked*" and $entry.callsite_trailing_bytes : "?*") and
not _arraysearch(process.thread.Ext.call_stack, $entry,
$entry.callsite_trailing_bytes : ("85c07472ff15942c*3d33270000747989c76a02e84a4359ff*",
"c9c3558bec51894dfc8b4dfce8b9ffffff8*",
"c9c20400558bec51894dfc8b45f*",
"e9fefdffffb001c9c20800558bec81e*",
"e9e8fdffffb0018be55dc20400*",
"85c00f95c05e5dc3cccccc5589e5535*",
"85c0740533c040eb3b837d10047516*",
"41c6470c01833*5f007406ff15*49895710488d65c85b5e5f415c415d415e415f5dc*",
"41c6470c01*41c6470c01488b55*",
"41c64*f007406ff15*",
"*10488d65c85b5e5f415c415d415e415f5dc3*",
"488b5560c6420c*48894570488b4d00e84300000090488b4570488b5560c642*",
"488b558*c6420c*007406ff15*",
"c6470c01*007406ff15*",
"85c00f95c05*",
"8be55dc3cccccccccccc558bec*",
"41c6470c01833d*",
"c6470c0148ba*7f0000ff11488bf0e8*",
"41c6460c0148ba4810*7f0000833a00740c48b9d819*",
"*48894e104883c4785b5e5f415c415d415e415f5dc*",
"488b5560c6420c01833d*7406ff15*",
"41c6460c0148ba*7f0000833a00740c48b9*",
"c6470c0148ba48*833a00740c48b9*",
"c6470c0148ba*833a00740c48b9*",
"488b957*ffffffc6420c01833d*",
"488b5560c6420c01*833a00740c*",
"488b55*7f0000833a00740c48b928f2*",
"41c6460c01833d*",
"c2140090b851000000ba*",
"c2140090b851000000ba5091*77ffd2c2140090b852000700ba509*",
"883c438c3cccccc8954241048894c24084883ec28488b4c24*",
"4883c438c3cccccc44884c24204489*",
"488b4c246048894108488b44246048837808007529*",
"41c644240c0148ba48202f12f87f0000833a00740c48b9f8292f12f87f0000ff118bf0e816b4ed5e85f60f95c00fb6c00fb6c041c644240c01488b5588498954",
"41c644240c01*85f60f95c00fb6c00fb6c041c644240c01488b55884989542410488d65c85b5e5f415c41",
"8bf04785f674a48bc65f5e5b8be55dc385f675f353ff75f8ff75f46a00ff150c07840a5f5e5b8be55dc3558beca11c45290b83ec2456578bfa85c075368d45dc",
"8d4c2410e8ba2cb2ff8b8c240c0100008bc75f5e33cce824b020028be55dc3cccccccc558bec83ec18a1fc55310b33c58945f8538b5d18568b7508578bf983fa",
"85c00f848f000000ff15f2a3cc0a3d332700000f859f000000488bb698000000488d7e78488d15d8264f0a4c8d059a284f0a488d5c24304889d941b9d2000000",
"85c07407b801000000eb4e837c2440047520e8960000004c8b4c244841b808000000488b542438488b4c2430ffd0eb29eb25837c244040751ee86f0000004c8b",
"488b55??c6420c0148ba14d536dbf97f0000833a00740c48b928f235dbf97f0000ff114*",
"488b9570ffffffc6420c01833d*488b458048894590488b45904889459890909090909090488b*",
"85c0746bff1528c2900f3d33270000747289c76a02e86d3378ff83c40484c0743a8d5c240489d96a0268600300006838a6320fe82f3478ff8d4424086a106838",
"488b9570ffffffc6420c01833de9835d5a007406ff15718d5d5a48894580e8a0ddb45990488b458048894590488b45904889459890909090909090488b459848",
"8985271f001056e8f60300008d8dbd1d001085c00f859400000056e84003000056e85502000056e85301000090909090909090908b4e3485c90f848900000003",
"488b5560c6420c01833d6a70c85f007406ff15768dc75f488bf0e8165a4a5f48897570488b4d00e84300000090488b4570488b5560c6420c01488b5560488b4d",
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"488b454833c9394804742a48894c24284533c94c8bc3894c242033d2ff97900000004885c0741083caff488bc8ff9788000000eb02ffd3488b4d504c8d4d4041",
"488b4d50458bc433d2e82019000041807d00007429488d46ff4883f8fd771fff97b8000000488b5550488bc8ff9750020000488b4df8ff97f8000000eb0f488b",
"0fb747064503f44883c628443bf00f826bffffff448badb80000004533c033d24883c9ffff55084439bfd400000074248b87d0000000488b741818eb0f4533c0",
"85c074*33270000747*89c76a02e8*ff83c40484c074*",
"85c074508b45146a0168001000000500f0ffff680010000003c650ffd785c08b4510741c8b4dfc050010000003c65056e8e8e6ffff5f5eb0015b8be55dc21000")) and
not (process.thread.Ext.call_stack_final_user_module.protection_provenance in ("tiptsf.dll", "mscms.dll") and
process.thread.Ext.call_stack_final_user_module.protection_provenance_path like "c:\\windows\\microsoft.net\\framework*\\mscorwks.dll") and
not process.thread.Ext.call_stack_final_user_module.protection_provenance_path like
("c:\\windows\\assembly\\nativeimages_*\\smdiagnostics.ni.dll",
"c:\\program files (x86)\\ibm\\client access\\*\\cwbsomri.dll",
"c:\\program files (x86)\\panasonic\\idrengine\\idrjchar.dll",
"c:\\windows\\assembly\\nativeimages_*\\newtonsoft.json\\*\\newtonsoft.json.ni.dll") and
not (process.Ext.api.name == "VirtualProtect" and
_arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info like ("c:\\windows\\sys?????\\ntdll.dll!LdrLoadDll*", "c:\\windows\\sys?????\\kernelbase.dll!LoadLibrary*"))) and
not process.Ext.api.metadata.target_address_path :
("?:\\program files\\sap businessobjects\\office addin\\plugins\\analysisoffice\\bixllfunctions.dll",
"?:\\program files (x86)\\viewplus\\tss?\\lib64\\htbrl.dll",
"?:\\program files (x86)\\vyaire\\sentrysuite\\vasservicedataclient.dll") and
not process.executable : ("?:\\Program Files (x86)\\CrystalScheduler\\crexport.exe",
"?:\\Program Files (x86)\\Bus\\Buscube64.exe",
"?:\\Program Files (x86)\\ETS5\\ETS5N.exe",
"?:\\Program Files (x86)\\ATAS Platform\\OFT.Platform.exe",
"?:\\Program Files\\Aseproda\\VirtusTPV Net\\VirtusTPVNet.exe",
"?:\\Program Files (x86)\\VisualCron\\VisualCronClient.exe",
"?:\\Program Files (x86)\\Citrix\\ICA Client\\Receiver\\Receiver.exe",
"C:\\Program Files\\Magnet Forensics\\Magnet AXIOM\\AXIOM Process\\AXIOMProcess.exe",
"?:\\Program Files (x86)\\SquareEnix\\FINAL FANTASY XIV - A Realm Reborn\\game\\ffxiv_dx11.exe",
"C:\\Program Files (x86)\\Mitel\\MiContact Center\\Applications\\Ignite\\Ignite.exe",
"C:\\Program Files (x86)\\SolarWinds\\Orion\\ExportToPdfCmd.exe",
"C:\\Program Files (x86)\\SolarWinds\\Orion\\WebsiteMaintenance.exe",
"C:\\Program Files (x86)\\QSR Automations\\ConnectSmart\\KitchenReportViewer\\Bin\\ReportViewer.exe") and
not (process.code_signature.trusted == true and
process.code_signature.subject_name in ("Ro-ot Service AG", "Connectwise, LLC", "SQUARE ENIX CO., LTD.", "Bluebeam, Inc.", "ANSYS Inc.", "Trimble Solutions Corporation", "Environmental Systems Research Institute, Inc.", "Acuant, Inc", "GB Group plc", "FUJIFILM Healthcare Americas Corporation", "Anego Studios SIA")) and
not (process.parent.executable : "C:\\Windows\\SysWOW64\\rundll32.exe" and process.executable : "C:\\Windows\\SysWOW64\\rundll32.exe" and
process.command_line : "* --enable-speech-input *")
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
process.Ext.api.behaviors | in |
| field:"process.Ext.api.behaviors" kind:in |
process.Ext.api.name | in |
| field:"process.Ext.api.name" kind:in |
process.executable | is_not_null | field:"Image" kind:is_not_null | |
process.parent.executable | is_not_null | field:"ParentImage" kind:is_not_null | |
process.thread.Ext.call_stack_final_user_module.name | eq |
| field:"process.thread.Ext.call_stack_final_user_module.name" kind:eq value:"Unbacked" |
process.thread.Ext.call_stack_final_user_module.protection_provenance | in |
| field:"process.thread.Ext.call_stack_final_user_module.protection_provenance" kind:in |
process.thread.Ext.call_stack_final_user_module.protection_provenance | wildcard |
| field:"process.thread.Ext.call_stack_final_user_module.protection_provenance" kind:wildcard |
process.thread.Ext.call_stack_final_user_module.protection_provenance_path | wildcard |
| field:"process.thread.Ext.call_stack_final_user_module.protection_provenance_path" kind:wildcard |
process.thread.Ext.call_stack_summary | wildcard |
| field:"process.thread.Ext.call_stack_summary" kind:wildcard |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.thread.Ext.call_stack | array_any | excludes:process.thread.Ext.call_stack | |
process.Ext.api.name | eq | VirtualProtect | excludes:process.Ext.api.name field:"process.Ext.api.name" value:"VirtualProtect" |
process.code_signature.subject_name | in | ANSYS Inc., Acuant, Inc, Anego Studios SIA, Bluebeam, Inc., Connectwise, LLC, Environmental Systems Research Institute, Inc., FUJIFILM Healthcare Americas Corporation, GB Group plc, Ro-ot Service AG, SQUARE ENIX CO., LTD., Trimble Solutions Corporation | excludes:process.code_signature.subject_name |
process.code_signature.trusted | eq | true | excludes:process.code_signature.trusted field:"process.code_signature.trusted" value:"true" |
process.command_line | match | --enable-speech-input | excludes:process.command_line field:"process.command_line" value:" --enable-speech-input " |
process.executable | eq | C:\Windows\SysWOW64\rundll32.exe | excludes:process.executable field:"process.executable" value:"C:\Windows\SysWOW64\rundll32.exe" |
process.parent.executable | eq | C:\Windows\SysWOW64\rundll32.exe | excludes:process.parent.executable field:"process.parent.executable" value:"C:\Windows\SysWOW64\rundll32.exe" |
process.thread.Ext.call_stack_final_user_module.protection_provenance | in | mscms.dll, tiptsf.dll | excludes:process.thread.Ext.call_stack_final_user_module.protection_provenance field:"process.thread.Ext.call_stack_final_user_module.protection_provenance" value:"mscms.dll" field:"process.thread.Ext.call_stack_final_user_module.protection_provenance" value:"tiptsf.dll" |
process.thread.Ext.call_stack_final_user_module.protection_provenance_path | wildcard | c:\windows\microsoft.net\framework*\mscorwks.dll | excludes:process.thread.Ext.call_stack_final_user_module.protection_provenance_path field:"process.thread.Ext.call_stack_final_user_module.protection_provenance_path" value:"c:\windows\microsoft.net\framework*\mscorwks.dll" |
process.Ext.api.metadata.target_address_path | eq | ?:\program files\sap businessobjects\office addin\plugins\analysisoffice\bixllfunctions.dll, ?:\program files (x86)\viewplus\tss?\lib64\htbrl.dll, ?:\program files (x86)\vyaire\sentrysuite\vasservicedataclient.dll | excludes:process.Ext.api.metadata.target_address_path field:"process.Ext.api.metadata.target_address_path" value:"?:\program files\sap businessobjects\office addin\plugins\analysisoffice\bixllfunctions.dll" field:"process.Ext.api.metadata.target_address_path" value:"?:\program files (x86)\viewplus\tss?\lib64\htbrl.dll" field:"process.Ext.api.metadata.target_address_path" value:"?:\program files (x86)\vyaire\sentrysuite\vasservicedataclient.dll" |
process.Ext.api.parameters.size | lt | 1000 | excludes:process.Ext.api.parameters.size field:"process.Ext.api.parameters.size" value:"1000" |
process.executable | eq | ?:\Program Files (x86)\CrystalScheduler\crexport.exe, ?:\Program Files (x86)\Bus\Buscube64.exe, ?:\Program Files (x86)\ETS5\ETS5N.exe, ?:\Program Files (x86)\ATAS Platform\OFT.Platform.exe, ?:\Program Files\Aseproda\VirtusTPV Net\VirtusTPVNet.exe, ?:\Program Files (x86)\VisualCron\VisualCronClient.exe, ?:\Program Files (x86)\Citrix\ICA Client\Receiver\Receiver.exe, C:\Program Files\Magnet Forensics\Magnet AXIOM\AXIOM Process\AXIOMProcess.exe, ?:\Program Files (x86)\SquareEnix\FINAL FANTASY XIV - A Realm Reborn\game\ffxiv_dx11.exe, C:\Program Files (x86)\Mitel\MiContact Center\Applications\Ignite\Ignite.exe, C:\Program Files (x86)\SolarWinds\Orion\ExportToPdfCmd.exe, C:\Program Files (x86)\SolarWinds\Orion\WebsiteMaintenance.exe, C:\Program Files (x86)\QSR Automations\ConnectSmart\KitchenReportViewer\Bin\ReportViewer.exe | excludes:process.executable |
process.thread.Ext.call_stack_final_user_module.protection_provenance_path | wildcard | c:\windows\assembly\nativeimages_*\smdiagnostics.ni.dll, c:\program files (x86)\ibm\client access\*\cwbsomri.dll, c:\program files (x86)\panasonic\idrengine\idrjchar.dll, c:\windows\assembly\nativeimages_*\newtonsoft.json\*\newtonsoft.json.ni.dll | excludes:process.thread.Ext.call_stack_final_user_module.protection_provenance_path |
PowerShell Script with Password Policy Discovery Capabilities
#Identifies PowerShell script block content that queries Active Directory password policy settings using AD cmdlets, GPP password helpers, or directory searcher attributes. Attackers collect password policy details to tune credential attacks and target weak configurations.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Execution | |
| Credential Access | |
| Discovery |
Rule Body
[metadata]
creation_date = "2023/07/12"
integration = ["windows"]
maturity = "production"
updated_date = "2026/03/24"
[rule]
author = ["Elastic"]
building_block_type = "default"
description = """
Identifies PowerShell script block content that queries Active Directory password policy settings using AD cmdlets, GPP
password helpers, or directory searcher attributes. Attackers collect password policy details to tune credential attacks
and target weak configurations.
"""
from = "now-119m"
index = ["winlogbeat-*", "logs-windows.powershell*"]
interval = "60m"
language = "kuery"
license = "Elastic License v2"
name = "PowerShell Script with Password Policy Discovery 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 Password Policy Discovery Capabilities
This alert identifies PowerShell script block content consistent with querying Active Directory password policy settings, including default domain policy requirements, fine-grained password policies, or related directory attributes. Adversaries may use these details to tune password guessing attempts and prioritize targets; administrators may also collect this information for auditing and troubleshooting.
#### 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
- Review `powershell.file.script_block_text` and identify the discovery method:
- AD password policy cmdlets/functions such as `Get-ADDefaultDomainPasswordPolicy`, `Get-ADFineGrainedPasswordPolicy`, `Get-ADUserResultantPasswordPolicy`, `Get-DomainPolicy`, or `Get-PassPol`.
- Directory searcher patterns such as `defaultNamingContext`, `ActiveDirectory.DirectoryContext`, or `ActiveDirectory.DirectorySearcher`, and referenced properties/attributes like `.MinLengthPassword`, `.MinPasswordAge`, `.MaxPasswordAge`, `minPwdLength`, `minPwdAge`, `maxPwdAge`, or `msDS-PasswordSettings`.
- Helper function use that may attempt to access Group Policy Preference password data (for example, `Get-GPPPassword`).
- Determine scope and intent from the script content:
- Domain-wide enumeration vs querying a specific user/resultant policy.
- Enumeration of fine-grained policy objects (`msDS-PasswordSettings`), which can indicate targeted reconnaissance for weaker settings.
- Evidence of output collection (formatting, exporting, or writing results) that may support later use.
- Validate the execution context using `host.name`, `host.id`, `user.name`, `user.domain`, and `user.id`:
- Confirm the host is an expected location for administrative or audit activity (for example, an admin workstation or management server).
- Assess whether the account context aligns with expected job function and normal host access patterns.
- Determine script origin and how it was introduced when `file.path`, `file.directory`, or `file.name` are present:
- Validate that the script path and name align with approved tooling and standard locations for that host.
- Treat execution from user-writable or temporary locations, or from unfamiliar script names, as higher risk and scope for additional suspicious activity.
- Reconstruct the full script content when it is split across multiple events:
- Pivot on `powershell.file.script_block_id` and order by `powershell.sequence` to rebuild the full script (use `powershell.total` to confirm all fragments are present).
- Preserve the reconstructed content for case notes and scoping.
- Correlate with other activity from the same host and account near `@timestamp` (if available in your telemetry):
- Review additional PowerShell script block logs for related discovery, credential access attempts, or follow-on execution.
- Review process activity to determine how PowerShell was launched (parent process, service/automation context, or interactive use) and whether the launch source is expected for the user/host.
- Review network activity consistent with directory queries or access to domain infrastructure that may indicate broader reconnaissance.
- Review file activity for evidence of staged scripts/modules or stored output containing policy details.
- Review authentication activity for spikes in failed logons, account lockouts, or access to multiple hosts following the discovery.
- Scope and prevalence:
- Look for similar `powershell.file.script_block_text` content executed by the same `user.id` on other hosts to determine whether this is isolated or part of a wider discovery phase.
- Look for similar content on the same `host.id` from other users to identify shared tooling, automation, or a compromised host used to launch reconnaissance.
### False positive analysis
- Authorized identity and directory administration activities (for example, validating password policy requirements during audits, troubleshooting, or policy change reviews).
- Scheduled reporting or compliance workflows that periodically inventory default and fine-grained password policy settings.
- Support investigations that query resultant password policy for a specific user as part of account lifecycle management or lockout investigations.
### Response and remediation
- If the activity is unexpected or cannot be tied to an approved administrative task:
- Isolate the affected host to prevent further reconnaissance.
- Restrict or disable the involved account (`user.id`) and reset credentials according to incident response procedures.
- Preserve evidence, including the reconstructed `powershell.file.script_block_text`, associated `powershell.file.script_block_id` fragments, and any referenced scripts (`file.path`, `file.name`).
- Hunt for follow-on activity associated with password policy discovery, such as password guessing attempts, credential collection, and additional directory enumeration, using the same `user.id`, `host.id`, and timeframe.
- If the script content suggests access to Group Policy Preference password data, treat this as potential credential exposure and rotate any identified credentials and remediate insecure configurations.
- If the activity is confirmed benign:
- Document the approved use case (expected accounts, hosts, and script locations) to speed future triage.
- Apply least-privilege controls to limit where and by whom directory policy discovery can be performed while maintaining audit visibility.
"""
risk_score = 21
rule_id = "fe25d5bc-01fa-494a-95ff-535c29cc4c96"
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: Discovery",
"Tactic: Execution",
"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: (
"Get-ADDefaultDomainPasswordPolicy" or
"Get-ADFineGrainedPasswordPolicy" or
"Get-ADUserResultantPasswordPolicy" or
"Get-DomainPolicy" or
"Get-GPPPassword" or
"Get-PassPol"
)
or
powershell.file.script_block_text: (
("defaultNamingContext" or "ActiveDirectory.DirectoryContext" or "ActiveDirectory.DirectorySearcher") and
(
(
".MinLengthPassword" or
".MinPasswordAge" or
".MaxPasswordAge"
) or
(
"minPwdAge" or
"maxPwdAge" or
"minPwdLength"
) or
(
"msDS-PasswordSettings"
)
)
)
) and
not powershell.file.script_block_text : ("sentinelbreakpoints" and "Set-PSBreakpoint" and "PowerSploitIndicators") and
not powershell.file.script_block_text : ("43c15630-959c-49e4-a977-758c5cc93408" and "CmdletsToExport" and "ActiveDirectory.Types.ps1xml") and
not file.directory: "C:\Program Files\LogicMonitor\Agent\tmp" and
not user.id : "S-1-5-18"
'''
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1201"
name = "Password Policy Discovery"
reference = "https://attack.mitre.org/techniques/T1201/"
[rule.threat.tactic]
id = "TA0007"
name = "Discovery"
reference = "https://attack.mitre.org/tactics/TA0007/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1059"
name = "Command and Scripting Interpreter"
reference = "https://attack.mitre.org/techniques/T1059/"
[[rule.threat.technique.subtechnique]]
id = "T1059.001"
name = "PowerShell"
reference = "https://attack.mitre.org/techniques/T1059/001/"
[rule.threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1552"
name = "Unsecured Credentials"
reference = "https://attack.mitre.org/techniques/T1552/"
[[rule.threat.technique.subtechnique]]
id = "T1552.006"
name = "Group Policy Preferences"
reference = "https://attack.mitre.org/techniques/T1552/006/"
[rule.threat.tactic]
id = "TA0006"
name = "Credential Access"
reference = "https://attack.mitre.org/tactics/TA0006/"
[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: (
"Get-ADDefaultDomainPasswordPolicy" or
"Get-ADFineGrainedPasswordPolicy" or
"Get-ADUserResultantPasswordPolicy" or
"Get-DomainPolicy" or
"Get-GPPPassword" or
"Get-PassPol"
)
or
powershell.file.script_block_text: (
("defaultNamingContext" or "ActiveDirectory.DirectoryContext" or "ActiveDirectory.DirectorySearcher") and
(
(
".MinLengthPassword" or
".MinPasswordAge" or
".MaxPasswordAge"
) or
(
"minPwdAge" or
"maxPwdAge" or
"minPwdLength"
) or
(
"msDS-PasswordSettings"
)
)
)
) and
not powershell.file.script_block_text : ("sentinelbreakpoints" and "Set-PSBreakpoint" and "PowerSploitIndicators") and
not powershell.file.script_block_text : ("43c15630-959c-49e4-a977-758c5cc93408" and "CmdletsToExport" and "ActiveDirectory.Types.ps1xml") and
not file.directory: "C:\Program Files\LogicMonitor\Agent\tmp" and
not user.id : "S-1-5-18"
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 value:"msDS-PasswordSettings" |
powershell.file.script_block_text | in |
| field:"ScriptBlockText" kind:in |
Exclusions
The rule actively suppresses these predicates.
Proxy Execution via Console Window Host
#Identifies abuse of the Console Window Host (conhost.exe) to execute commands via proxy. This behavior is used as a defense evasion technique to blend-in malicious activity with legitimate Windows software.
MITRE ATT&CK Coverage
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 = "2025/08/21"
integration = ["endpoint", "windows", "system", "m365_defender", "sentinel_one_cloud_funnel", "crowdstrike"]
maturity = "production"
updated_date = "2026/04/29"
[rule]
author = ["Elastic"]
description = """
Identifies abuse of the Console Window Host (conhost.exe) to execute commands via proxy. This behavior is used as a defense
evasion technique to blend-in malicious activity with legitimate Windows software.
"""
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 = "Proxy Execution via Console Window Host"
references = ["https://lolbas-project.github.io/lolbas/Binaries/Conhost/"]
risk_score = 73
rule_id = "fcd16fe8-eb29-42b3-8aee-6c9ad777a2f6"
severity = "high"
tags = [
"Domain: Endpoint",
"OS: Windows",
"Use Case: Threat Detection",
"Tactic: Defense Evasion",
"Data Source: Elastic Endgame",
"Data Source: Elastic Defend",
"Data Source: Windows Security Event Logs",
"Data Source: Microsoft Defender XDR",
"Data Source: Sysmon",
"Data Source: SentinelOne",
"Data Source: Crowdstrike",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
process where host.os.type == "windows" and event.type == "start" and
process.name : "conhost.exe" and process.args : "--headless" and
process.command_line : (
"*powershell*", "*cmd *", "*cmd.exe *", "*script*", "*mshta*", "*curl *", "*curl.exe *", "*^*^*^*",
"*.bat*", "*.cmd*", "*schtasks*", "*@SSL*", "*http*", "* \\\\*", "*.vbs*", "*.js*", "*mhsta*"
) and
not (
/* Winget-AutoUpdate via ServiceUI */
process.parent.executable : "?:\\Program Files\\winget-autoupdate*\\serviceui.exe" or
/* Winget-AutoUpdate notification via Task Scheduler */
(
process.parent.executable : "?:\\Windows\\System32\\svchost.exe" and process.parent.args : "-s" and
process.parent.args : "Schedule" and process.command_line : "*WAU-Notify.ps1*"
) or
/* Windows OpenSSH console host — SSH-specific detection handled by 8cd49fbc-a35a-4418-8688-133cc3a1e548 */
process.parent.executable : (
"?:\\Windows\\System32\\OpenSSH\\sshd.exe",
"?:\\Windows\\System32\\OpenSSH\\sshd-session.exe",
"?:\\Program Files\\OpenSSH*\\sshd.exe",
"?:\\Program Files\\OpenSSH*\\sshd-session.exe"
)
)
'''
note = """## Triage and analysis
### Investigating Proxy Execution via Console Window Host
#### Possible investigation steps
- What command did the headless conhost instance proxy?
- Why: `--headless` can hide the child window behind conhost, so command intent and child-process evidence outweigh conhost identity alone.
- Focus: `process.command_line` for `--headless` and the proxied family: shell, script host, retrieval, UNC, caret-escaped, batch, or scheduled-task action.
- Implication: escalate when headless conhost proxies script execution, remote retrieval, scheduled-task changes, or lateral-path commands; lower suspicion only when command, launcher, user, and host match remote-admin console management, deployment automation, or installer/update helper use and later process evidence does not contradict it.
- Is this the native conhost binary or a masqueraded copy?
- Focus: `process.executable`, `process.pe.original_file_name`, `process.hash.sha256`, `process.code_signature.subject_name`, and `process.code_signature.trusted`; compare the path with `C:\\Windows\\System32\\conhost.exe`.
- Implication: escalate when conhost is renamed, unsigned, user-writable, host-new by hash, or signed by an unexpected publisher; native signed identity lowers masquerade concern but not suspicious `--headless` proxy execution.
- Which launcher produced headless conhost?
- Focus: `process.parent.executable`, `process.parent.command_line`, and `process.parent.entity_id`.
- Implication: escalate when the launcher is Office, a browser, a script host, a temp or user-writable binary, another LOLBin, or a remote-management tool outside its console-management pattern; lower suspicion when the same parent is a stable console, deployment, or update path for the same `user.id` and `host.id`.
- Do the user and session context fit the same admin or deployment use?
- Focus: `user.id`, `host.id`, `process.Ext.session_info.logon_type`, and `process.Ext.authentication_id`.
- Implication: escalate when session type, account, or authentication ID is unusual for that `host.id` and user cohort or ties to unrelated suspicious processes; lower suspicion when user, host cohort, session type, command, and lineage match the same remote-admin, deployment, or update use.
- Did headless conhost spawn the command family named in the alert?
- Focus: child process starts on `host.id` where `process.parent.entity_id` matches alert `process.entity_id`; read `process.name`, `process.executable`, and `process.command_line`. $investigate_0
- Hint: if `process.entity_id` is absent, query the same `host.id` with alert `process.pid` in a tight alert-time window; treat matches as weaker because PID reuse is possible.
- Implication: escalate when conhost spawns shell, script-host, downloader, scheduled-task, or payload-like children; keep scope local only when no child execution appears and earlier evidence fits the same named admin, deployment, or update use.
- If local evidence is suspicious or unresolved, is this isolated or broader proxy execution?
- Focus: process-start history for the same `host.id` and, if needed, `user.id`; compare `process.command_line`, `process.parent.executable`, and child-process patterns.
- $investigate_1
- $investigate_2
- Hint: review related alerts for the same `host.id` and `user.id`, especially script execution, downloader, scheduled-task, credential-tool, or other proxy-execution activity.
- $investigate_3
- $investigate_4
- Implication: escalate scope when the same host or user shows repeated headless conhost proxy execution, suspicious launchers, or related script, downloader, scheduled-task, or credential-tool processes; lack of history does not clear suspicious command, lineage, session, or child-process evidence.
- Escalate on unauthorized headless proxy execution plus suspicious identity, launcher, session, child-process, or repeat-alert corroboration; close only when command, identity, lineage, session, and child-process evidence bind to one named benign use case below; preserve evidence and escalate when evidence is mixed or incomplete.
### False positive analysis
- Remote-administration, console-management, deployment automation, installer, or update agents can launch headless conhost when a named tool uses console helpers. Confirm that native `process.executable`, stable `process.parent.executable`, `process.parent.code_signature.subject_name`, `process.parent.code_signature.trusted`, parent and child `process.command_line`, `user.id`, `host.id`, `process.Ext.session_info.logon_type`, and child-process pattern all align with that tool or product path. Tool inventories, change records, or owner confirmation can corroborate telemetry-backed use, but should not replace missing or contradictory process evidence. If command, parent, session, or child evidence diverges, or the first cohort event includes retrieval, UNC, script-host, or scheduled-task behavior outside that path, treat it as unresolved or suspicious.
- Before creating an exception, verify that native `process.executable`, parent identity, exact `process.command_line`, `user.id`, `host.id`, and session type recur across prior alerts from this rule. Build the exception from that confirmed workflow pattern; avoid exceptions on `process.name`, the conhost filename, or `--headless` alone.
### Response and remediation
- If confirmed benign, reverse temporary containment and record the command intent, native conhost identity, parent lineage, `user.id`, `host.id`, session type, and child-process evidence that justified closure. Create an exception only when that same admin, deployment, or update pattern recurs consistently across prior alerts.
- If suspicious but unconfirmed, preserve the alert, process tree export, command lines, hash and signer details, `process.entity_id`, `process.parent.entity_id`, `process.Ext.authentication_id`, child-process events, and any scripts or task definitions named in the command line before containment. Apply reversible containment first, such as heightened monitoring or temporary restrictions on the affected `user.id`, `host.id`, or parent tool, and avoid process termination until scope is clearer.
- If confirmed malicious, contain the host or affected account when command intent, launcher lineage, session context, or child-process evidence establishes unauthorized proxy execution. Record the process identifiers, command lines, signer and hash evidence, user and host anchors, and child-process chain before terminating processes, deleting scripts, disabling scheduled tasks, or isolating accounts.
- Eradicate only the scripts, task definitions, copied tools, or persistence mechanisms identified during the investigation, then remediate the launcher, automation path, or access path that allowed headless conhost to proxy the command.
- Rotate credentials only when the user and session evidence or adjacent case evidence confirms account misuse, remote abuse, or privileged account compromise; otherwise keep identity action proportional to the confirmed process evidence.
- After containment, scope other hosts and users for the same `process.command_line`, `process.parent.executable`, `process.hash.sha256`, parent signer, or child-process pattern. Retain the process telemetry and response notes needed to distinguish repeat benign console automation from repeat proxy execution.
"""
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.name",
"host.id",
"user.name",
"user.id",
"process.entity_id",
"process.pid",
"process.executable",
"process.pe.original_file_name",
"process.command_line",
"process.Ext.authentication_id",
"process.Ext.session_info.logon_type",
"process.parent.executable",
"process.parent.command_line",
"process.code_signature.trusted",
]
[transform]
[[transform.investigate]]
label = "Child process starts from the same conhost instance"
description = ""
providers = [
[
{ excluded = false, field = "event.category", queryType = "phrase", value = "process", valueType = "string" },
{ excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" },
{ excluded = false, field = "process.parent.entity_id", queryType = "phrase", value = "{{process.entity_id}}", valueType = "string" }
]
]
relativeFrom = "now-1h"
relativeTo = "now"
[[transform.investigate]]
label = "Process history on the same host"
description = ""
providers = [
[
{ excluded = false, field = "event.category", queryType = "phrase", value = "process", valueType = "string" },
{ excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" }
]
]
relativeFrom = "now-48h/h"
relativeTo = "now"
[[transform.investigate]]
label = "Process history for the same user"
description = ""
providers = [
[
{ excluded = false, field = "event.category", queryType = "phrase", value = "process", valueType = "string" },
{ excluded = false, field = "user.id", queryType = "phrase", value = "{{user.id}}", valueType = "string" }
]
]
relativeFrom = "now-48h/h"
relativeTo = "now"
[[transform.investigate]]
label = "Alerts associated with the host"
description = ""
providers = [
[
{ excluded = false, field = "event.kind", queryType = "phrase", value = "signal", valueType = "string" },
{ excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" }
]
]
relativeFrom = "now-48h/h"
relativeTo = "now"
[[transform.investigate]]
label = "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"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1202"
name = "Indirect Command Execution"
reference = "https://attack.mitre.org/techniques/T1202/"
[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.technique.subtechnique]]
id = "T1059.003"
name = "Windows Command Shell"
reference = "https://attack.mitre.org/techniques/T1059/003/"
[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 : "conhost.exe" and process.args : "--headless" and
process.command_line : (
"*powershell*", "*cmd *", "*cmd.exe *", "*script*", "*mshta*", "*curl *", "*curl.exe *", "*^*^*^*",
"*.bat*", "*.cmd*", "*schtasks*", "*@SSL*", "*http*", "* \\\\*", "*.vbs*", "*.js*", "*mhsta*"
) and
not (
process.parent.executable : "?:\\Program Files\\winget-autoupdate*\\serviceui.exe" or
(
process.parent.executable : "?:\\Windows\\System32\\svchost.exe" and process.parent.args : "-s" and
process.parent.args : "Schedule" and process.command_line : "*WAU-Notify.ps1*"
) or
process.parent.executable : (
"?:\\Windows\\System32\\OpenSSH\\sshd.exe",
"?:\\Windows\\System32\\OpenSSH\\sshd-session.exe",
"?:\\Program Files\\OpenSSH*\\sshd.exe",
"?:\\Program Files\\OpenSSH*\\sshd-session.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:"--headless" |
process.command_line | wildcard |
| field:"CommandLine" kind:wildcard |
process.name | wildcard |
| field:"process_basename" kind:wildcard value:"conhost.exe" |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.command_line | match | WAU-Notify.ps1 | excludes:process.command_line field:"process.command_line" value:"WAU-Notify.ps1" |
process.parent.args | eq | -s | excludes:process.parent.args field:"process.parent.args" value:"-s" |
process.parent.args | eq | Schedule | excludes:process.parent.args field:"process.parent.args" value:"Schedule" |
process.parent.executable | eq | ?:\Windows\System32\svchost.exe | excludes:process.parent.executable field:"process.parent.executable" value:"?:\Windows\System32\svchost.exe" |
process.parent.executable | wildcard | ?:\Program Files\winget-autoupdate*\serviceui.exe | excludes:process.parent.executable field:"process.parent.executable" value:"?:\Program Files\winget-autoupdate*\serviceui.exe" |
process.parent.executable | wildcard | ?:\Windows\System32\OpenSSH\sshd.exe, ?:\Windows\System32\OpenSSH\sshd-session.exe, ?:\Program Files\OpenSSH*\sshd.exe, ?:\Program Files\OpenSSH*\sshd-session.exe | excludes:process.parent.executable |
Remote File Download via Script Interpreter
#Identifies built-in Windows script interpreters (cscript.exe or wscript.exe) being used to download an executable file from a remote destination.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Execution | |
| Command & Control |
Telemetry Coverage
| Provider | Record / event type |
|---|---|
| Sysmon | Event ID 3: Network connection |
| Sysmon | Event ID 11: FileCreate |
Rule Body
[metadata]
creation_date = "2020/11/29"
integration = ["endpoint", "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 built-in Windows script interpreters (cscript.exe or wscript.exe) being used to download an executable file
from a remote destination.
"""
from = "now-9m"
index = [
"winlogbeat-*",
"logs-endpoint.events.network-*",
"logs-endpoint.events.file-*",
"logs-windows.sysmon_operational-*",
]
language = "eql"
license = "Elastic License v2"
name = "Remote File Download via Script Interpreter"
note = """## Triage and analysis
### Investigating Remote File Download via Script Interpreter
The Windows Script Host (WSH) is a Windows automation technology, which is ideal for non-interactive scripting needs, such as logon scripting, administrative scripting, and machine automation.
Attackers commonly use WSH scripts as their initial access method, acting like droppers for second stage payloads, but can also use them to download tools and utilities needed to accomplish their goals.
This rule looks for DLLs and executables downloaded using `cscript.exe` or `wscript.exe`.
> **Note**:
> This investigation guide uses the [Osquery Markdown Plugin](https://www.elastic.co/guide/en/security/current/invest-guide-run-osquery.html) introduced in Elastic Stack version 8.5.0. Older Elastic Stack versions will display unrendered Markdown in this guide.
#### Possible investigation steps
- Investigate the process execution chain (parent process tree) for unknown processes. Examine their executable files for prevalence, whether they are located in expected locations, and if they are signed with valid digital signatures.
- Examine the host for derived artifacts that indicate suspicious activities:
- Analyze both the script and the executable involved using a private sandboxed analysis system.
- Observe and collect information about the following activities in both the sandbox and the alert subject host:
- Attempts to contact external domains and addresses.
- Use the Elastic Defend network events to determine domains and addresses contacted by the subject process by filtering by the process' `process.entity_id`.
- Examine the DNS cache for suspicious or anomalous entries.
- $osquery_0
- Use the Elastic Defend registry events to examine registry keys accessed, modified, or created by the related processes in the process tree.
- Examine the host services for suspicious or anomalous entries.
- $osquery_1
- $osquery_2
- $osquery_3
- Retrieve the files' SHA-256 hash values using the PowerShell `Get-FileHash` cmdlet and search for the existence and reputation of the hashes in resources like VirusTotal, Hybrid-Analysis, CISCO Talos, Any.run, etc.
- Investigate potentially compromised accounts. Analysts can do this by searching for login events (for example, 4624) to the target host after the registry modification.
### False positive analysis
- The usage of these script engines by regular users is unlikely. In the case of authorized benign true positives (B-TPs), exceptions can be added.
### Response and remediation
- Initiate the incident response process based on the outcome of the triage.
- Isolate the involved host to prevent further post-compromise behavior.
- If the triage identified malware, search the environment for additional compromised hosts.
- Implement temporary network rules, procedures, and segmentation to contain the malware.
- Stop suspicious processes.
- Immediately block the identified indicators of compromise (IoCs).
- Inspect the affected systems for additional malware backdoors like reverse shells, reverse proxies, or droppers that attackers could use to reinfect the system.
- Remove and block malicious artifacts identified during triage.
- Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
- Investigate credential exposure on systems compromised or used by the attacker to ensure all compromised accounts are identified. Reset passwords for these accounts and other potentially compromised credentials, such as email, business systems, and web services.
- Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
- Using the incident response data, update logging and audit policies to improve the mean time to detect (MTTD) and the mean time to respond (MTTR).
"""
setup = """## Setup
This rule is designed for data generated by [Elastic Defend](https://www.elastic.co/security/endpoint-security), which provides native endpoint detection and response, along with event enrichments designed to work with our detection rules.
Setup instructions: https://ela.st/install-elastic-defend
### Additional data sources
This rule also supports the following third-party data sources. For setup instructions, refer to the links below:
- [Sysmon Event ID 3 - Network Connection](https://ela.st/sysmon-event-3-setup)
- [Sysmon Event ID 11 - File Create](https://ela.st/sysmon-event-11-setup)
"""
risk_score = 47
rule_id = "1d276579-3380-4095-ad38-e596a01bc64f"
severity = "medium"
tags = [
"Domain: Endpoint",
"OS: Windows",
"Use Case: Threat Detection",
"Tactic: Command and Control",
"Tactic: Execution",
"Resources: Investigation Guide",
"Data Source: Elastic Defend",
"Data Source: Sysmon",
]
type = "eql"
query = '''
sequence by host.id, process.entity_id
[network where host.os.type == "windows" and process.name : ("wscript.exe", "cscript.exe") and network.protocol != "dns" and
network.direction : ("outgoing", "egress") and network.type == "ipv4" and destination.ip != "127.0.0.1"
]
[file where host.os.type == "windows" and event.type == "creation" and
file.extension : ("exe", "dll", "bat", "cmd", "ps1", "vbs", "vbe", "js", "jse", "wsh", "wsf", "sct", "hta", "scr", "pif", "com", "cpl")]
'''
[[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 = "T1059"
name = "Command and Scripting Interpreter"
reference = "https://attack.mitre.org/techniques/T1059/"
[[rule.threat.technique.subtechnique]]
id = "T1059.005"
name = "Visual Basic"
reference = "https://attack.mitre.org/techniques/T1059/005/"
[[rule.threat.technique.subtechnique]]
id = "T1059.007"
name = "JavaScript"
reference = "https://attack.mitre.org/techniques/T1059/007/"
[rule.threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
Stages and Predicates
Ordered sequence: each step below must occur in order, correlated by host.id, process.entity_id.
Stage 1: network
[network where host.os.type == "windows" and process.name : ("wscript.exe", "cscript.exe") and network.protocol != "dns" and
network.direction : ("outgoing", "egress") and network.type == "ipv4" and destination.ip != "127.0.0.1"
]
Stage 2: file
[file where host.os.type == "windows" and event.type == "creation" and
file.extension : ("exe", "dll", "bat", "cmd", "ps1", "vbs", "vbe", "js", "jse", "wsh", "wsf", "sct", "hta", "scr", "pif", "com", "cpl")]
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
destination.ip | ne |
| field:"dest_ip" kind:ne value:"127.0.0.1" |
event.type | eq |
| field:"event.type" kind:eq value:"creation" |
file.extension | wildcard |
| field:"file.extension" kind:wildcard |
network.direction | wildcard |
| field:"Initiated" kind:wildcard |
network.protocol | ne |
| field:"DestinationPortName" kind:ne value:"dns" |
network.type | eq |
| field:"network.type" kind:eq value:"ipv4" |
process.name | wildcard |
| field:"process_basename" kind:wildcard |
Suspicious LSASS Access via MalSecLogon
#Identifies suspicious access to LSASS handle from a call trace pointing to seclogon.dll and with a suspicious access rights value. This may indicate an attempt to leak an LSASS handle via abusing the Secondary Logon service in preparation for credential access.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Credential Access |
Telemetry Coverage
| Provider | Record / event type |
|---|---|
| Sysmon | Event ID 10: ProcessAccess |
Rule Body
[metadata]
creation_date = "2022/06/29"
integration = ["windows"]
maturity = "production"
updated_date = "2026/04/24"
[rule]
author = ["Elastic"]
description = """
Identifies suspicious access to LSASS handle from a call trace pointing to seclogon.dll and with a suspicious access
rights value. This may indicate an attempt to leak an LSASS handle via abusing the Secondary Logon service in
preparation for credential access.
"""
from = "now-9m"
index = ["winlogbeat-*", "logs-windows.sysmon_operational-*"]
language = "eql"
license = "Elastic License v2"
name = "Suspicious LSASS Access via MalSecLogon"
references = ["https://splintercod3.blogspot.com/p/the-hidden-side-of-seclogon-part-3.html"]
risk_score = 73
rule_id = "7ba58110-ae13-439b-8192-357b0fcfa9d7"
severity = "high"
tags = [
"Domain: Endpoint",
"OS: Windows",
"Use Case: Threat Detection",
"Tactic: Credential Access",
"Data Source: Sysmon",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
process where host.os.type == "windows" and event.code == "10" and
winlog.event_data.TargetImage : "?:\\WINDOWS\\system32\\lsass.exe" and
/* seclogon service accessing lsass */
winlog.event_data.CallTrace : "*seclogon.dll*" and process.name : "svchost.exe" and
/* PROCESS_CREATE_PROCESS & PROCESS_DUP_HANDLE & PROCESS_QUERY_INFORMATION & PROCESS_QUERY_LIMITED_INFORMATION */
winlog.event_data.GrantedAccess == "0x14c0"
'''
note = """## Triage and analysis
### Investigating Suspicious LSASS Access via MalSecLogon
#### Possible investigation steps
- Does the alert show the MalSecLogon handle-leak pattern rather than generic LSASS access?
- Why: the alert-local target, call trace, and access mask distinguish seclogon-mediated LSASS handle leakage from ordinary LSASS access; they do not prove a dump was written.
- Focus: `winlog.event_data.TargetImage`, `winlog.event_data.CallTrace`, `winlog.event_data.GrantedAccess`, `winlog.event_data.SourceImage`, `winlog.event_data.SourceProcessGUID`, `@timestamp`, and `host.id`.
- Implication: escalate when the tuple is LSASS target + "seclogon.dll" call trace + "0x14c0" access from the seclogon-hosting "svchost.exe"; lower suspicion only when that exact tuple and service context match a recognized security product or authorized test on the same host.
- Which seclogon source process and surrounding initiator candidates can you recover?
- Focus: use `winlog.event_data.SourceProcessGUID` and `winlog.event_data.SourceImage` to recover the seclogon-hosting process, then use `host.id` and `process.entity_id` to review surrounding process starts with `process.executable` and `process.command_line`. $investigate_2
- Hint: `winlog.event_data.SourceProcessGUID` identifies the service host that touched LSASS, not automatically the original RPC caller; if endpoint process start details are sparse, keep the conclusion at service-host level instead of assigning a caller.
- Implication: escalate when the surrounding window shows MalSeclogon-like tooling, shells, script hosts, dump utilities, or newly started binaries that explain why seclogon touched LSASS; unresolved initiator recovery does not clear the alert.
- Does the recovered lineage and session context fit a recognized Secondary Logon workflow?
- Focus: process context for the recovered service host or initiator candidates: `process.command_line`, `process.parent.executable`, `process.parent.command_line`, `process.Ext.ancestry`, and `user.id`; if parent or ancestry fields are absent, stay scoped to `host.id` plus `process.entity_id` and the tight alert window.
- Implication: escalate when the chain starts from phishing, scripting, remote-admin, dump tooling, or a user context inconsistent with the asset role; treat recognized security-product or authorized-test lineage as lower suspicion, but continue to artifact and authentication checks before closure.
- Do process or file artifacts show dump preparation after the handle access?
- Why: the alert proves seclogon-hosted handle access, not dump completion; process and file artifacts show whether the activity advanced toward credential dumping.
- Focus: endpoint process and file events scoped by `host.id` plus recovered `process.entity_id`, checking `process.command_line`, `process.executable`, `file.path`, and `file.name`. $investigate_3
- Hint: look for LSASS clone or dump-helper command lines, dump-like files, encrypted or renamed dump output, or rapid child creation around the handle event; missing endpoint file telemetry is unresolved, not benign.
- Implication: escalate when the timeline shows dump output, clone or dump helpers, suspicious child creation, or staged files tied to the recovered process context; absence of artifacts lowers urgency only when file coverage is present and the process context is otherwise recognized.
- Does the user and host context make this access especially high impact?
- Focus: `host.name`, `user.id`, `user.name`, and `user.domain`, plus asset inventory or alert enrichment for domain controller, jump host, credential vault, or tier-0 administration roles when available.
- Implication: escalate faster when the host or account can expose privileged credentials; ordinary workstation context lowers scope, not suspicion, unless the alert-local tuple and recovered workflow are also recognized.
- Do follow-on authentication events suggest the leaked handle was used to pivot?
- Why: MalSecLogon handle leakage is usually a precursor to dumping or token abuse, so later credential use can be more decisive than the access event alone.
- Focus: Windows Security events for the same `host.id` and initial `user.id` pivot, especially `winlog.event_id`, `winlog.logon.type`, `winlog.event_data.TargetLogonId`, `winlog.event_data.SubjectLogonId`, and `source.ip`. $investigate_4
- Hint: if `process.Ext.authentication_id` is available, match it to `winlog.event_data.TargetLogonId` for 4624 session creation and search `winlog.event_data.SubjectLogonId` separately for 4648 explicit-credential use; read `winlog.event_data.TargetUserSid` as the authenticated account and `winlog.event_data.SubjectUserSid` as the initiator when they differ. Missing authentication telemetry is unresolved, not benign.
- Implication: escalate when later events show NewCredentials logon type 9, explicit-credential use, or unexpected remote logons after the LSASS access; do not close solely because no follow-on authentication telemetry was ingested.
- If the local evidence remains suspicious or unresolved, do related alerts for this user or host show broader credential abuse?
- Focus: related alerts for the same `user.id` in the last 48 hours, especially credential-access, lateral-movement, privilege-escalation, archive, or suspicious authentication findings. $investigate_0
- Hint: compare related alerts for the same `host.id` only after local evidence is suspicious or unresolved, to decide whether this is confined to one asset or part of a broader credential-theft chain. $investigate_1
- Implication: broaden scope when the same user or host also shows dumping, token abuse, remote-admin, or suspicious authentication alerts that support the local findings; keep the case local when related alerts are absent or clearly separate from the LSASS-handle activity.
- Escalate when the alert-local tuple, recovered process context, artifacts, privileged scope, or follow-on credential use support unauthorized handle leakage; close only when the exact tuple and recovered workflow align with recognized security tooling or authorized testing; preserve and escalate when evidence is mixed or missing.
### False positive analysis
- Seclogon-mediated LSASS handle access with "0x14c0" is an operational anti-pattern outside credential-protection products, EDR diagnostics, and authorized IR or red-team testing. Confirm a benign workflow only when the alert-local tuple, seclogon service context, recovered process identity, `user.id`, `host.id`, and absence of dump artifacts or credential-use follow-on all align. When telemetry cannot prove legitimacy, require confirmation for that exact activity from the security product owner, IR lead, or test plan.
- Before creating an exception, verify prior alerts from this rule show the same `winlog.event_data.SourceImage`, `winlog.event_data.CallTrace`, `winlog.event_data.GrantedAccess`, recovered workflow identity, `user.id`, `host.id`, and benign follow-on pattern. Avoid exceptions on `process.name`, "svchost.exe", seclogon, or the access mask alone.
### Response and remediation
- If confirmed benign, reverse temporary containment and record the exact alert-local tuple, service context, recovered workflow identity, host/user scope, and benign follow-on evidence. Create an exception only for that stable pattern after recurrence or explicit product/test confirmation.
- If suspicious but unconfirmed, preserve the alert document, source service GUID/image, recovered process starts, command lines, authentication records, volatile handle/service state when feasible, and any `file.path` dump artifacts before containment. Apply reversible containment first, such as suspending the recovered non-system tool, restricting outbound administrative access, or temporarily limiting the affected `user.id` while scope is unresolved.
- If confirmed malicious, isolate the affected host and contain accounts only after preserving the seclogon context, recovered initiator candidates, dump artifacts, and follow-on authentication evidence. If immediate isolation is unavailable, escalate with that evidence set to the team that can act.
- For privileged hosts or accounts, activate credential-compromise response and rotate exposed credentials according to host role and account tier. Do not assume enterprise-wide compromise without dump or credential-use evidence, but treat confirmed LSASS dump artifacts on tier-0 assets as urgent.
- Eradicate only the tools, scripts, dump files, XOR-protected dumps, staged files, persistence, and entry-path artifacts found during the investigation, then remediate the access path that allowed the Secondary Logon abuse.
- After containment, reduce recurrence risk by reviewing local administrator and debug-privilege exposure, LSASS protection such as RunAsPPL or Credential Guard where supported, and Secondary Logon service necessity on critical servers.
"""
setup = """## Setup
This rule requires Sysmon telemetry to be enabled and ingested.
Setup instructions: https://ela.st/sysmon-event-10-setup
"""
[rule.investigation_fields]
field_names = [
"@timestamp",
"host.name",
"host.id",
"user.name",
"user.id",
"process.entity_id",
"process.executable",
"process.command_line",
"process.parent.executable",
"process.parent.command_line",
"winlog.event_data.SourceProcessGUID",
"winlog.event_data.SourceImage",
"winlog.event_data.TargetImage",
"winlog.event_data.GrantedAccess",
"winlog.event_data.CallTrace",
]
[[transform.investigate]]
label = "Alerts associated with the user"
description = ""
providers = [
[
{ excluded = false, field = "event.kind", queryType = "phrase", value = "signal", valueType = "string" },
{ excluded = false, field = "user.id", queryType = "phrase", value = "{{user.id}}", valueType = "string" }
]
]
relativeFrom = "now-48h/h"
relativeTo = "now"
[[transform.investigate]]
label = "Alerts associated with the host"
description = ""
providers = [
[
{ excluded = false, field = "event.kind", queryType = "phrase", value = "signal", valueType = "string" },
{ excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" }
]
]
relativeFrom = "now-48h/h"
relativeTo = "now"
[[transform.investigate]]
label = "Process events for the recovered seclogon source process"
description = ""
providers = [
[
{ excluded = false, field = "event.category", queryType = "phrase", value = "process", valueType = "string" },
{ excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" },
{ excluded = false, field = "process.entity_id", queryType = "phrase", value = "{{process.entity_id}}", valueType = "string" }
]
]
relativeFrom = "now-1h"
relativeTo = "now"
[[transform.investigate]]
label = "Process and file events for the recovered process context"
description = ""
providers = [
[
{ excluded = false, field = "event.category", queryType = "phrase", value = "process", valueType = "string" },
{ excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" },
{ excluded = false, field = "process.entity_id", queryType = "phrase", value = "{{process.entity_id}}", valueType = "string" }
],
[
{ excluded = false, field = "event.category", queryType = "phrase", value = "file", valueType = "string" },
{ excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" },
{ excluded = false, field = "process.entity_id", queryType = "phrase", value = "{{process.entity_id}}", valueType = "string" }
]
]
relativeFrom = "now-1h"
relativeTo = "now"
[[transform.investigate]]
label = "Authentication events for the same user on the host"
description = ""
providers = [
[
{ excluded = false, field = "event.code", queryType = "phrase", value = "4624", valueType = "string" },
{ excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" },
{ excluded = false, field = "winlog.event_data.TargetUserSid", queryType = "phrase", value = "{{user.id}}", valueType = "string" }
],
[
{ excluded = false, field = "event.code", queryType = "phrase", value = "4648", valueType = "string" },
{ excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" },
{ excluded = false, field = "winlog.event_data.SubjectUserSid", queryType = "phrase", value = "{{user.id}}", valueType = "string" }
]
]
relativeFrom = "now-24h"
relativeTo = "now"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1003"
name = "OS Credential Dumping"
reference = "https://attack.mitre.org/techniques/T1003/"
[[rule.threat.technique.subtechnique]]
id = "T1003.001"
name = "LSASS Memory"
reference = "https://attack.mitre.org/techniques/T1003/001/"
[rule.threat.tactic]
id = "TA0006"
name = "Credential Access"
reference = "https://attack.mitre.org/tactics/TA0006/"
Stages and Predicates
Stage 1: process
process where host.os.type == "windows" and event.code == "10" and
winlog.event_data.TargetImage : "?:\\WINDOWS\\system32\\lsass.exe" and
winlog.event_data.CallTrace : "*seclogon.dll*" and process.name : "svchost.exe" and
winlog.event_data.GrantedAccess == "0x14c0"
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.code | eq |
| field:"EventID" kind:eq value:"10" |
process.name | wildcard |
| field:"process_basename" kind:wildcard value:"svchost.exe" |
winlog.event_data.CallTrace | wildcard |
| field:"CallTrace" kind:wildcard value:"*seclogon.dll*" |
winlog.event_data.GrantedAccess | eq |
| field:"GrantedAccess" kind:eq value:"0x14c0" |
winlog.event_data.TargetImage | wildcard |
| field:"TargetImage" kind:wildcard value:"?:\WINDOWS\system32\lsass.exe" |
Suspicious Windows Core Module Change
#Identifies attempts to change memory protection of a Windows Core Module often targeted for functions unhooking.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Stealth |
Rule Body
[rule]
description = "Identifies attempts to change memory protection of a Windows Core Module often targeted for functions unhooking."
id = "e6b77636-53e6-416f-81bb-863b74a896e8"
license = "Elastic License v2"
name = "Suspicious Windows Core Module Change"
os_list = ["windows"]
version = "1.0.8"
query = '''
api where process.Ext.api.name == "VirtualProtect" and
process.Ext.api.metadata.target_address_name in ("ntdll.dll", "kernel32.dll", "kernelbase.dll") and
process.Ext.token.integrity_level_name != "low" and process.thread.Ext.call_stack_final_user_module.hash.sha256 != null and
process.Ext.api.parameters.size >= 10000 and
not process.thread.Ext.call_stack_final_user_module.name in ("Kernel", "Unknown", "Undetermined") and
not process.thread.Ext.call_stack_final_user_module.protection_provenance like ("Kernel", "Unknown", "Kernel|*") and
not process.thread.Ext.call_stack_final_user_module.name in ("Kernel", "Unknown") and
not _arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info: ("*ntdll.dll!LdrLoadDll*", "*ntdll.dll!LdrUnloadDll*")) and
not process.thread.Ext.call_stack_final_user_module.path like ("c:\\program files\\*", "c:\\program files (x86)\\*",
"c:\\windows\\assembly\\nativeimages_*.ni.dll",
"c:\\windows\\system32\\ntdll.dll",
"c:\\windows\\syswow64\\ntdll.dll",
"c:\\windows\\syswow64\\msvbvm??.dll") and
not process.thread.Ext.call_stack_final_hook_module.path like ("c:\\program files\\*", "c:\\program files (x86)\\*") and
not (process.thread.Ext.call_stack_final_user_module.path in ("c:\\windows\\system32\\apphelp.dll", "c:\\windows\\syswow64\\apphelp.dll") and
process.Ext.api.metadata.target_address_name in ("kernel32.dll", "kernelbase.dll")) and
not (process.Ext.api.parameters.protection == "R--" and process.Ext.api.metadata.target_address_name == "kernel32.dll") and
not process.thread.Ext.call_stack_final_user_module.hash.sha256 in ("b27b7d2ac43c6c734aa9e370afc987704f4bd8ba11bc5199a8c3bc5b07b2600c",
"85f238fb7ace3cbdf7c29c72b01307c440f13491b07a509cbc5b9f257a637164",
"7f6f5855d4968235163d75c62ab82e8fdc7cf3c83de34e3c5a0666e2d08a0001",
"36b45f919f856e3eb8115cb883c38b62c653e8d46af147551a7d6efc1708de23",
"46c861b688fe129552920c62985e662b6789bb7a646ab65ae8fee4a8a82d7bc5",
"148a2e5cffd3c30f9647d8bdf8a6d0a891f4dfdca459fef9629db6ccd985fe02",
"bc3d667b3e2a6ff84031c839e5cb9e93ab558f339646d34f0419f51788929eda",
"f12898b6f0536b90561b9309b03afd3c4f83ff51fc50d0bcaa39110a3fbce359",
"eff09cb37f0e0ea6de0f5b1ee499ceb612b36a9229caf9a0f464a53c66735646",
"f0eb8747d3499416873892700d6d7d1fe24ccc4d461cb68fa93d1f8030d747a0",
"447e50302f0aa72add1866e4115d363497b82aa38bd47be8310d688194fb1b2d",
"92cf0c5c9248ec17b408a37021ea89144a9aeb71317e3c61b767eced3265d5af",
"685774f56983b22fbd1f84880fe60f149ccf0322abe8dd09b7a0d81f4a5dd1f1",
"da8c6bcefb5397d1763987dff1d99ff374c9643b27c1f8285d66fb99494b253b",
"bd5c092be2d1d5856041a743c90e64ba232badc3b1c3d063539cb328a91bd9ae",
"48cefaab52832b85dda4dd16b56d8dd97d433601bb4a72aec9affc2723588a4c",
"bd5c092be2d1d5856041a743c90e64ba232badc3b1c3d063539cb328a91bd9ae",
"1bb34f11b79fad256ca2e72ea7bcc618815632d585538e1e601c7fc5512ba72d",
"4c92f5bcefdec3e38aa8c30f14379c723e573587abe7e8c4fc77f1fae2a0d270",
"fe498b13e464d26beacdcba32bc3b26d356b52f9b251546831e3d86923a35d6b",
"8a882e25b9a7d49feee49c70ddc816720f82dccf0691076c098959fb3b2f4711",
"d0fdfd7102505692385d4061e2a73504727802594434d31136ff4e75cd5072d5",
"d3813940007faa5f2b15bd53ac9c1d28032252133257c2f3d8ef87563ae55301",
"028f848c8a44b4831741e01e27624fee9c408f63d859021fff533e87ce19f129",
"cee9a6ff8026dde09eda9f892c57cc928d42e4a4d22bb740fe38ee6e91797a28",
"93e9243a44c29200eeacaf9658efe2558581770e4b11ca4b500e18e424a6e3b5",
"e2856585e980f3d74b0f17499206335a4af1d5acf1fe6a7033c5dc7b1ac80dea",
"665cccc891ea95a0f43b38c7a0ba537d802c2083c974db4cf8046e0860f6747e") and
not (_arraysearch(process.thread.Ext.call_stack_final_user_module.code_signature, $entry, $entry.trusted == true and $entry.subject_name in ("Microsoft Windows", "Microsoft Corporation", ".NET")) and not process.Ext.api.behaviors == "image_rop") and
not _arraysearch(process.thread.Ext.call_stack_final_user_module.code_signature, $entry, $entry.trusted == true and
$entry.subject_name in ("Microsoft Windows Hardware Compatibility Publisher",
"Microsoft Windows Software Compatibility Publisher",
"ESET, spol. s r.o.",
"Activision Publishing Inc",
"Sony Interactive Entertainment LLC",
"Electronic Arts, Inc.",
"KRAFTON, Inc.",
"WIBU-SYSTEMS AG",
"The TWAIN Working Group",
"Twain Working Group",
"LEAD Technologies, Inc",
"Roblox Corporation",
"Vectric Ltd.",
"Cylance, Inc.",
"Hyland Software Inc.",
"COGNOSPHERE PTE. LTD.",
"Code Systems Corporation",
"Tencent Technology (Shenzhen) Company Limited",
"Windows Phone",
"Adobe Inc.",
"Viber Media S.a r.l.",
"SentinelOne Inc.",
"Spotify AB",
"TEAMDEV LTD.",
"miHoYo Co.,Ltd.",
"Google LLC",
"AO Kaspersky Lab",
"Mozilla Corporation",
"SignPath Foundation",
"Palo Alto Networks",
"Duncan Ogilvie",
"combit Software GmbH",
"Cisco Systems, Inc.",
"MetaQuotes Ltd",
"Solarwinds Worldwide, LLC",
"Symantec Corporation",
"AgentLite.sign",
"Eclipse.org Foundation, Inc.",
"Zoom Communications, Inc.")) and
not process.thread.Ext.call_stack_final_user_module.protection_provenance_path like "c:\\windows\\assembly\\nativeimages_*.dll"
'''
min_endpoint_version = "8.16.0"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1620"
name = "Reflective Code Loading"
reference = "https://attack.mitre.org/techniques/T1620/"
[threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
[internal]
min_endpoint_version = "8.16.0"
Stages and Predicates
Stage 1: api
api where process.Ext.api.name == "VirtualProtect" and
process.Ext.api.metadata.target_address_name in ("ntdll.dll", "kernel32.dll", "kernelbase.dll") and
process.Ext.token.integrity_level_name != "low" and process.thread.Ext.call_stack_final_user_module.hash.sha256 != null and
process.Ext.api.parameters.size >= 10000 and
not process.thread.Ext.call_stack_final_user_module.name in ("Kernel", "Unknown", "Undetermined") and
not process.thread.Ext.call_stack_final_user_module.protection_provenance like ("Kernel", "Unknown", "Kernel|*") and
not process.thread.Ext.call_stack_final_user_module.name in ("Kernel", "Unknown") and
not _arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info: ("*ntdll.dll!LdrLoadDll*", "*ntdll.dll!LdrUnloadDll*")) and
not process.thread.Ext.call_stack_final_user_module.path like ("c:\\program files\\*", "c:\\program files (x86)\\*",
"c:\\windows\\assembly\\nativeimages_*.ni.dll",
"c:\\windows\\system32\\ntdll.dll",
"c:\\windows\\syswow64\\ntdll.dll",
"c:\\windows\\syswow64\\msvbvm??.dll") and
not process.thread.Ext.call_stack_final_hook_module.path like ("c:\\program files\\*", "c:\\program files (x86)\\*") and
not (process.thread.Ext.call_stack_final_user_module.path in ("c:\\windows\\system32\\apphelp.dll", "c:\\windows\\syswow64\\apphelp.dll") and
process.Ext.api.metadata.target_address_name in ("kernel32.dll", "kernelbase.dll")) and
not (process.Ext.api.parameters.protection == "R--" and process.Ext.api.metadata.target_address_name == "kernel32.dll") and
not process.thread.Ext.call_stack_final_user_module.hash.sha256 in ("b27b7d2ac43c6c734aa9e370afc987704f4bd8ba11bc5199a8c3bc5b07b2600c",
"85f238fb7ace3cbdf7c29c72b01307c440f13491b07a509cbc5b9f257a637164",
"7f6f5855d4968235163d75c62ab82e8fdc7cf3c83de34e3c5a0666e2d08a0001",
"36b45f919f856e3eb8115cb883c38b62c653e8d46af147551a7d6efc1708de23",
"46c861b688fe129552920c62985e662b6789bb7a646ab65ae8fee4a8a82d7bc5",
"148a2e5cffd3c30f9647d8bdf8a6d0a891f4dfdca459fef9629db6ccd985fe02",
"bc3d667b3e2a6ff84031c839e5cb9e93ab558f339646d34f0419f51788929eda",
"f12898b6f0536b90561b9309b03afd3c4f83ff51fc50d0bcaa39110a3fbce359",
"eff09cb37f0e0ea6de0f5b1ee499ceb612b36a9229caf9a0f464a53c66735646",
"f0eb8747d3499416873892700d6d7d1fe24ccc4d461cb68fa93d1f8030d747a0",
"447e50302f0aa72add1866e4115d363497b82aa38bd47be8310d688194fb1b2d",
"92cf0c5c9248ec17b408a37021ea89144a9aeb71317e3c61b767eced3265d5af",
"685774f56983b22fbd1f84880fe60f149ccf0322abe8dd09b7a0d81f4a5dd1f1",
"da8c6bcefb5397d1763987dff1d99ff374c9643b27c1f8285d66fb99494b253b",
"bd5c092be2d1d5856041a743c90e64ba232badc3b1c3d063539cb328a91bd9ae",
"48cefaab52832b85dda4dd16b56d8dd97d433601bb4a72aec9affc2723588a4c",
"bd5c092be2d1d5856041a743c90e64ba232badc3b1c3d063539cb328a91bd9ae",
"1bb34f11b79fad256ca2e72ea7bcc618815632d585538e1e601c7fc5512ba72d",
"4c92f5bcefdec3e38aa8c30f14379c723e573587abe7e8c4fc77f1fae2a0d270",
"fe498b13e464d26beacdcba32bc3b26d356b52f9b251546831e3d86923a35d6b",
"8a882e25b9a7d49feee49c70ddc816720f82dccf0691076c098959fb3b2f4711",
"d0fdfd7102505692385d4061e2a73504727802594434d31136ff4e75cd5072d5",
"d3813940007faa5f2b15bd53ac9c1d28032252133257c2f3d8ef87563ae55301",
"028f848c8a44b4831741e01e27624fee9c408f63d859021fff533e87ce19f129",
"cee9a6ff8026dde09eda9f892c57cc928d42e4a4d22bb740fe38ee6e91797a28",
"93e9243a44c29200eeacaf9658efe2558581770e4b11ca4b500e18e424a6e3b5",
"e2856585e980f3d74b0f17499206335a4af1d5acf1fe6a7033c5dc7b1ac80dea",
"665cccc891ea95a0f43b38c7a0ba537d802c2083c974db4cf8046e0860f6747e") and
not (_arraysearch(process.thread.Ext.call_stack_final_user_module.code_signature, $entry, $entry.trusted == true and $entry.subject_name in ("Microsoft Windows", "Microsoft Corporation", ".NET")) and not process.Ext.api.behaviors == "image_rop") and
not _arraysearch(process.thread.Ext.call_stack_final_user_module.code_signature, $entry, $entry.trusted == true and
$entry.subject_name in ("Microsoft Windows Hardware Compatibility Publisher",
"Microsoft Windows Software Compatibility Publisher",
"ESET, spol. s r.o.",
"Activision Publishing Inc",
"Sony Interactive Entertainment LLC",
"Electronic Arts, Inc.",
"KRAFTON, Inc.",
"WIBU-SYSTEMS AG",
"The TWAIN Working Group",
"Twain Working Group",
"LEAD Technologies, Inc",
"Roblox Corporation",
"Vectric Ltd.",
"Cylance, Inc.",
"Hyland Software Inc.",
"COGNOSPHERE PTE. LTD.",
"Code Systems Corporation",
"Tencent Technology (Shenzhen) Company Limited",
"Windows Phone",
"Adobe Inc.",
"Viber Media S.a r.l.",
"SentinelOne Inc.",
"Spotify AB",
"TEAMDEV LTD.",
"miHoYo Co.,Ltd.",
"Google LLC",
"AO Kaspersky Lab",
"Mozilla Corporation",
"SignPath Foundation",
"Palo Alto Networks",
"Duncan Ogilvie",
"combit Software GmbH",
"Cisco Systems, Inc.",
"MetaQuotes Ltd",
"Solarwinds Worldwide, LLC",
"Symantec Corporation",
"AgentLite.sign",
"Eclipse.org Foundation, Inc.",
"Zoom Communications, Inc.")) and
not process.thread.Ext.call_stack_final_user_module.protection_provenance_path like "c:\\windows\\assembly\\nativeimages_*.dll"
Indicators
These rows show field, operator, and value matches.
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.thread.Ext.call_stack_final_user_module.code_signature | array_any | excludes:process.thread.Ext.call_stack_final_user_module.code_signature | |
process.Ext.api.behaviors | eq | image_rop | excludes:process.Ext.api.behaviors field:"process.Ext.api.behaviors" value:"image_rop" |
process.Ext.api.metadata.target_address_name | eq | kernel32.dll | excludes:process.Ext.api.metadata.target_address_name field:"process.Ext.api.metadata.target_address_name" value:"kernel32.dll" |
process.Ext.api.parameters.protection | eq | R-- | excludes:process.Ext.api.parameters.protection field:"process.Ext.api.parameters.protection" value:"R--" |
process.Ext.api.metadata.target_address_name | in | kernel32.dll, kernelbase.dll | excludes:process.Ext.api.metadata.target_address_name field:"process.Ext.api.metadata.target_address_name" value:"kernel32.dll" field:"process.Ext.api.metadata.target_address_name" value:"kernelbase.dll" |
process.thread.Ext.call_stack_final_user_module.path | in | c:\windows\system32\apphelp.dll, c:\windows\syswow64\apphelp.dll | excludes:process.thread.Ext.call_stack_final_user_module.path field:"process.thread.Ext.call_stack_final_user_module.path" value:"c:\windows\system32\apphelp.dll" field:"process.thread.Ext.call_stack_final_user_module.path" value:"c:\windows\syswow64\apphelp.dll" |
process.thread.Ext.call_stack | array_any | excludes:process.thread.Ext.call_stack | |
process.thread.Ext.call_stack_final_hook_module.path | starts_with | c:\program files\, c:\program files (x86)\ | excludes:process.thread.Ext.call_stack_final_hook_module.path field:"process.thread.Ext.call_stack_final_hook_module.path" value:"c:\program files\" field:"process.thread.Ext.call_stack_final_hook_module.path" value:"c:\program files (x86)\" |
process.thread.Ext.call_stack_final_user_module.hash.sha256 | in | 028f848c8a44b4831741e01e27624fee9c408f63d859021fff533e87ce19f129, 148a2e5cffd3c30f9647d8bdf8a6d0a891f4dfdca459fef9629db6ccd985fe02, 1bb34f11b79fad256ca2e72ea7bcc618815632d585538e1e601c7fc5512ba72d, 36b45f919f856e3eb8115cb883c38b62c653e8d46af147551a7d6efc1708de23, 447e50302f0aa72add1866e4115d363497b82aa38bd47be8310d688194fb1b2d, 46c861b688fe129552920c62985e662b6789bb7a646ab65ae8fee4a8a82d7bc5, 48cefaab52832b85dda4dd16b56d8dd97d433601bb4a72aec9affc2723588a4c, 4c92f5bcefdec3e38aa8c30f14379c723e573587abe7e8c4fc77f1fae2a0d270, 665cccc891ea95a0f43b38c7a0ba537d802c2083c974db4cf8046e0860f6747e, 685774f56983b22fbd1f84880fe60f149ccf0322abe8dd09b7a0d81f4a5dd1f1, 7f6f5855d4968235163d75c62ab82e8fdc7cf3c83de34e3c5a0666e2d08a0001, 85f238fb7ace3cbdf7c29c72b01307c440f13491b07a509cbc5b9f257a637164, 8a882e25b9a7d49feee49c70ddc816720f82dccf0691076c098959fb3b2f4711, 92cf0c5c9248ec17b408a37021ea89144a9aeb71317e3c61b767eced3265d5af, 93e9243a44c29200eeacaf9658efe2558581770e4b11ca4b500e18e424a6e3b5, b27b7d2ac43c6c734aa9e370afc987704f4bd8ba11bc5199a8c3bc5b07b2600c, bc3d667b3e2a6ff84031c839e5cb9e93ab558f339646d34f0419f51788929eda, bd5c092be2d1d5856041a743c90e64ba232badc3b1c3d063539cb328a91bd9ae, cee9a6ff8026dde09eda9f892c57cc928d42e4a4d22bb740fe38ee6e91797a28, d0fdfd7102505692385d4061e2a73504727802594434d31136ff4e75cd5072d5, d3813940007faa5f2b15bd53ac9c1d28032252133257c2f3d8ef87563ae55301, da8c6bcefb5397d1763987dff1d99ff374c9643b27c1f8285d66fb99494b253b, e2856585e980f3d74b0f17499206335a4af1d5acf1fe6a7033c5dc7b1ac80dea, eff09cb37f0e0ea6de0f5b1ee499ceb612b36a9229caf9a0f464a53c66735646, f0eb8747d3499416873892700d6d7d1fe24ccc4d461cb68fa93d1f8030d747a0, f12898b6f0536b90561b9309b03afd3c4f83ff51fc50d0bcaa39110a3fbce359, fe498b13e464d26beacdcba32bc3b26d356b52f9b251546831e3d86923a35d6b | excludes:process.thread.Ext.call_stack_final_user_module.hash.sha256 |
process.thread.Ext.call_stack_final_user_module.name | in | Kernel, Undetermined, Unknown | excludes:process.thread.Ext.call_stack_final_user_module.name field:"process.thread.Ext.call_stack_final_user_module.name" value:"Kernel" field:"process.thread.Ext.call_stack_final_user_module.name" value:"Undetermined" field:"process.thread.Ext.call_stack_final_user_module.name" value:"Unknown" |
process.thread.Ext.call_stack_final_user_module.name | in | Kernel, Unknown | excludes:process.thread.Ext.call_stack_final_user_module.name field:"process.thread.Ext.call_stack_final_user_module.name" value:"Kernel" field:"process.thread.Ext.call_stack_final_user_module.name" value:"Unknown" |
process.thread.Ext.call_stack_final_user_module.path | wildcard | c:\program files\*, c:\program files (x86)\*, c:\windows\assembly\nativeimages_*.ni.dll, c:\windows\system32\ntdll.dll, c:\windows\syswow64\ntdll.dll, c:\windows\syswow64\msvbvm??.dll | excludes:process.thread.Ext.call_stack_final_user_module.path |
process.thread.Ext.call_stack_final_user_module.protection_provenance | wildcard | Kernel, Unknown, Kernel|* | excludes:process.thread.Ext.call_stack_final_user_module.protection_provenance field:"process.thread.Ext.call_stack_final_user_module.protection_provenance" value:"Kernel" field:"process.thread.Ext.call_stack_final_user_module.protection_provenance" value:"Unknown" field:"process.thread.Ext.call_stack_final_user_module.protection_provenance" value:"Kernel|*" |
process.thread.Ext.call_stack_final_user_module.protection_provenance_path | wildcard | c:\windows\assembly\nativeimages_*.dll | excludes:process.thread.Ext.call_stack_final_user_module.protection_provenance_path field:"process.thread.Ext.call_stack_final_user_module.protection_provenance_path" value:"c:\windows\assembly\nativeimages_*.dll" |
Unusual Execution via Microsoft Common Console File
#Identifies the execution of a child process from a Microsoft Common Console file. Adversaries may embed a malicious command in an MSC file in order to trick victims into executing malicious commands.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Initial Access | |
| Execution | |
| Stealth |
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/05/12"
integration = ["endpoint", "windows", "m365_defender", "sentinel_one_cloud_funnel"]
maturity = "production"
updated_date = "2026/05/01"
[rule]
author = ["Elastic"]
description = """
Identifies the execution of a child process from a Microsoft Common Console file. Adversaries may embed a malicious
command in an MSC file in order to trick victims into executing malicious commands.
"""
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 = "Unusual Execution via Microsoft Common Console File"
references = ["https://www.genians.co.kr/blog/threat_intelligence/facebook"]
risk_score = 73
rule_id = "e760c72b-bb1f-44f0-9f0d-37d51744ee75"
severity = "high"
tags = [
"Domain: Endpoint",
"OS: Windows",
"Use Case: Threat Detection",
"Tactic: Execution",
"Tactic: Initial Access",
"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.parent.executable : "?:\\Windows\\System32\\mmc.exe" and endswith~(process.parent.args, ".msc") and
not (
process.parent.args : (
"?:\\Windows\\System32\\*.msc",
"?:\\Windows\\SysWOW64\\*.msc",
"?:\\Program files\\*.msc",
"?:\\Program Files (x86)\\*.msc"
) or
(
process.executable : "?:\\Windows\\System32\\mmc.exe" and
process.command_line : "\"C:\\WINDOWS\\system32\\mmc.exe\" \"C:\\Windows\\System32\\gpme.msc\" /s /gpobject:\"LDAP://*"
) or
(
process.executable : (
"?:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe",
"?:\\Program Files\\Mozilla Firefox\\firefox.exe",
"?:\\Program Files\\Google\\Chrome\\Application\\chrome.exe",
"?:\\Program Files\\internet explorer\\iexplore.exe"
) and
process.args : "http*://go.microsoft.com/fwlink/*"
) or
process.executable : (
"?:\\Windows\\System32\\vmconnect.exe",
"?:\\Windows\\System32\\WerFault.exe",
"?:\\Windows\\System32\\wermgr.exe"
)
)
'''
note = """## Triage and analysis
### Investigating Unusual Execution via Microsoft Common Console File
#### Possible investigation steps
- What ".msc" path and immediate child process triggered the alert?
- Focus: `process.parent.executable`, `process.parent.args`, `process.parent.command_line`, `process.executable`, and `process.command_line`.
- Implication: escalate when "mmc.exe" opens a user-writable, download, cloud-sync, archive-extraction, or document-like ".msc" and the child is a shell, script host, "mshta.exe", "schtasks.exe", or another LOLBin; lower suspicion only when the exact ".msc" path and child command fit a recognized administrative console workflow on this host.
- Does the child command line expose second-stage or persistence intent?
- Focus: `process.command_line`, checking for "WScript.Shell", "schtasks /create", "OneDriveUpdate", "wscript.exe /b", "start /min", "mshta", ".hta", remote URLs, or script/batch names.
- Hint: review same-child file and network events for staged scripts, task artifacts, or remote retrieval. Missing network telemetry is unresolved, not benign. $investigate_3
- Implication: escalate when the command creates tasks, hides/minimizes execution, starts script hosts, or embeds remote retrieval; lower suspicion only when the arguments perform a narrow helper action expected from the same console.
- Does the child identity and session context fit expected administration?
- Focus: `process.executable`, `process.code_signature.subject_name`, `process.code_signature.trusted`, `process.Ext.relative_file_creation_time`, and the `user.id` + `host.id` pair.
- Implication: escalate when the child runs from a user-writable or recently created path, has a signer mismatch, or appears under an unexpected administrative user/session; identity confirmation alone never clears an unsafe command line.
- Do descendants continue the MSC-launched chain into scripting, tasks, or delayed execution?
- Why: MSC lures can store task commands that create a scheduled task, run VBS, then launch HTA through "mshta.exe"; the first child may be only the handoff.
- Focus: descendant starts on the same `host.id`, linked by `process.parent.entity_id` or `process.Ext.ancestry`, checking `process.name` and `process.command_line`. $investigate_2
- Hint: if entity linkage is absent, match `process.parent.pid` to the alerting `process.pid` within a tight alert-time window and treat matches as weaker.
- Hint: after a suspicious descendant, expand that descendant's file and network events from Timeline.
- Implication: escalate when descendants show "cmd.exe", "wscript.exe", "cscript.exe", "mshta.exe", "powershell.exe", "pwsh.exe", "schtasks.exe", repeated shells, Microsoft-themed task names, or command-line URLs; lower suspicion when the tree ends at one expected helper with no delayed script or task process.
- If local evidence remains suspicious or unresolved, what related alerts change scope or containment?
- Focus: related alerts for the same `user.id`, especially document delivery, script execution, task creation, or outbound staging. $investigate_0
- Hint: review same-`host.id` alerts to separate one-host lure execution from repeated activity across assets. $investigate_1
- Implication: broaden containment when the same user or host also shows initial-access, script-host, scheduled-task, or outbound-staging alerts; keep response local when those alerts are absent, but leave benign closure to the process-chain synthesis.
- Escalate for lure-driven ".msc" execution, script staging, scheduled-task creation, remote retrieval, or suspicious descendants; close only when alert-local evidence and process recovery bind one exact recognized console workflow with no contradictory descendants; preserve artifacts and escalate when evidence is mixed or visibility incomplete.
### False positive analysis
- Custom administrative consoles, vendor MMC snap-ins, or IT troubleshooting bundles stored outside default Windows console paths can launch helpers, browsers, viewers, or support utilities. Confirm that `process.parent.args`, `process.parent.command_line`, `process.executable`, `process.command_line`, `process.code_signature.subject_name`, `user.id`, and `host.id` all align with one exact console package or affected cohort. If inventory, ticketing, or owner confirmation is unavailable, close only when process and descendant telemetry still prove that helper workflow with no unresolved script, task, hidden execution, or remote-retrieval behavior.
- Before creating an exception, validate prior alerts from this rule for the same ".msc" path in `process.parent.args`, child `process.executable`, signer in `process.code_signature.subject_name`, stable `process.command_line`, and bounded `user.id` and `host.id` scope. Build the exception from that full workflow pattern; avoid exceptions on `process.parent.name` value "mmc.exe" or the child `process.executable` alone.
### Response and remediation
- If confirmed benign, reverse any temporary containment and document the exact ".msc" path, child command pattern, signer, `user.id`, and `host.id`. Create an exception only after the same workflow pattern recurs consistently across prior alerts from this rule.
- If suspicious but unconfirmed, preserve a case export for the alerting process instance (`host.id` plus `process.entity_id` or `process.pid` and alert time), the parent MSC path, child and descendant command lines, executable hash/signer, task names, script names, and URLs visible in command lines before making destructive changes. Apply reversible containment first, such as temporary URL/domain blocking, disabling a newly created scheduled task after preserving its command, or heightened monitoring on the affected `host.id` and `user.id`.
- If confirmed malicious, isolate the host or contain the affected account only after preserving the process chain, scheduled-task names, script names, hashes, and command-line indicators. Terminate malicious child or descendant processes after preservation, block confirmed command-line URLs or domains, and hand off the preserved artifact set if endpoint response is unavailable.
- Eradicate only the malicious ".msc", scripts, scheduled tasks, and staged payloads identified during the investigation, then remediate the delivery path that let the lure execute. Review related hosts and users for the same `process.parent.args` path or descendant `process.command_line` pattern before broad cleanup.
- Post-incident hardening: restrict or warn on ".msc" launches from user-writable, download, archive-extraction, or cloud-sync paths, and retain process lineage and command-line telemetry needed to distinguish future admin consoles from MSC lures.
"""
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.entity_id",
"process.pid",
"process.executable",
"process.command_line",
"process.code_signature.subject_name",
"process.code_signature.trusted",
"process.hash.sha256",
"process.Ext.session_info.logon_type",
"process.Ext.relative_file_creation_time",
"process.parent.executable",
"process.parent.command_line",
"process.parent.args",
]
[transform]
[[transform.investigate]]
label = "Alerts associated with the user"
description = ""
providers = [
[
{ excluded = false, field = "event.kind", queryType = "phrase", value = "signal", valueType = "string" },
{ excluded = false, field = "user.id", queryType = "phrase", value = "{{user.id}}", valueType = "string" }
]
]
relativeFrom = "now-48h/h"
relativeTo = "now"
[[transform.investigate]]
label = "Alerts associated with the host"
description = ""
providers = [
[
{ excluded = false, field = "event.kind", queryType = "phrase", value = "signal", valueType = "string" },
{ excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" }
]
]
relativeFrom = "now-48h/h"
relativeTo = "now"
[[transform.investigate]]
label = "Descendant processes from the MMC-launched child"
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 = "File and network events for the MMC-launched child"
description = ""
providers = [
[
{ excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" },
{ excluded = false, field = "process.entity_id", queryType = "phrase", value = "{{process.entity_id}}", valueType = "string" },
{ excluded = false, field = "event.category", queryType = "phrase", value = "file", valueType = "string" }
],
[
{ excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" },
{ excluded = false, field = "process.entity_id", queryType = "phrase", value = "{{process.entity_id}}", valueType = "string" },
{ excluded = false, field = "event.category", queryType = "phrase", value = "network", valueType = "string" }
]
]
relativeFrom = "now-1h"
relativeTo = "now"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "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/"
[[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.technique.subtechnique]]
id = "T1566.002"
name = "Spearphishing Link"
reference = "https://attack.mitre.org/techniques/T1566/002/"
[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 = "T1218"
name = "System Binary Proxy Execution"
reference = "https://attack.mitre.org/techniques/T1218/"
[[rule.threat.technique.subtechnique]]
id = "T1218.014"
name = "MMC"
reference = "https://attack.mitre.org/techniques/T1218/014/"
[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.parent.executable : "?:\\Windows\\System32\\mmc.exe" and endswith~(process.parent.args, ".msc") and
not (
process.parent.args : (
"?:\\Windows\\System32\\*.msc",
"?:\\Windows\\SysWOW64\\*.msc",
"?:\\Program files\\*.msc",
"?:\\Program Files (x86)\\*.msc"
) or
(
process.executable : "?:\\Windows\\System32\\mmc.exe" and
process.command_line : "\"C:\\WINDOWS\\system32\\mmc.exe\" \"C:\\Windows\\System32\\gpme.msc\" /s /gpobject:\"LDAP://*"
) or
(
process.executable : (
"?:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe",
"?:\\Program Files\\Mozilla Firefox\\firefox.exe",
"?:\\Program Files\\Google\\Chrome\\Application\\chrome.exe",
"?:\\Program Files\\internet explorer\\iexplore.exe"
) and
process.args : "http*://go.microsoft.com/fwlink/*"
) or
process.executable : (
"?:\\Windows\\System32\\vmconnect.exe",
"?:\\Windows\\System32\\WerFault.exe",
"?:\\Windows\\System32\\wermgr.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.parent.args | ends_with |
| field:"process.parent.args" kind:ends_with value:".msc" |
process.parent.executable | wildcard |
| field:"ParentImage" kind:wildcard value:"?:\Windows\System32\mmc.exe" |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.args | wildcard | http*://go.microsoft.com/fwlink/* | excludes:process.args field:"process.args" value:"http*://go.microsoft.com/fwlink/*" |
process.executable | eq | ?:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe, ?:\Program Files\Mozilla Firefox\firefox.exe, ?:\Program Files\Google\Chrome\Application\chrome.exe, ?:\Program Files\internet explorer\iexplore.exe | excludes:process.executable |
process.command_line | starts_with | "C:\WINDOWS\system32\mmc.exe" "C:\Windows\System32\gpme.msc" /s /gpobject:"LDAP:// | excludes:process.command_line |
process.executable | eq | ?:\Windows\System32\mmc.exe | excludes:process.executable field:"process.executable" value:"?:\Windows\System32\mmc.exe" |
process.executable | eq | ?:\Windows\System32\vmconnect.exe, ?:\Windows\System32\WerFault.exe, ?:\Windows\System32\wermgr.exe | excludes:process.executable field:"process.executable" value:"?:\Windows\System32\vmconnect.exe" field:"process.executable" value:"?:\Windows\System32\WerFault.exe" field:"process.executable" value:"?:\Windows\System32\wermgr.exe" |
process.parent.args | wildcard | ?:\Windows\System32\*.msc, ?:\Windows\SysWOW64\*.msc, ?:\Program files\*.msc, ?:\Program Files (x86)\*.msc | excludes:process.parent.args |
Windows Error Manager/Reporting Masquerading
#Identifies suspicious instances of the Windows Error Reporting process (WerFault.exe or Wermgr.exe) with matching command-line and process executable values performing outgoing network connections. This may be indicative of a masquerading attempt to evade suspicious child process behavior detections.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Stealth |
Rule Body
[rule]
description = """
Identifies suspicious instances of the Windows Error Reporting process (WerFault.exe or Wermgr.exe) with matching
command-line and process executable values performing outgoing network connections. This may be indicative of a
masquerading attempt to evade suspicious child process behavior detections.
"""
id = "3d16f5f9-da4c-4b15-a501-505761b75ca6"
license = "Elastic License v2"
name = "Windows Error Manager/Reporting Masquerading"
os_list = ["windows"]
reference = ["https://www.elastic.co/security-labs/revisiting-blister-new-developments-of-the-blister-loader"]
version = "1.0.34"
query = '''
sequence by process.entity_id with maxspan=5m
[process where event.action == "start" and
process.name : ("wermgr.exe", "WerFault.exe") and process.args_count == 1 and process.parent.executable != null and
not (process.args : "C:\\WINDOWS\\system32\\wermgr.exe -upload" and process.parent.executable : "C:\\Windows\\System32\\svchost.exe")]
[network where event.action == "connection_attempted" and process.name : ("wermgr.exe", "WerFault.exe")]
'''
min_endpoint_version = "7.15.0"
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
[[optional_actions]]
action = "rollback"
field = "process.entity_id"
state = 0
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1036"
name = "Masquerading"
reference = "https://attack.mitre.org/techniques/T1036/"
[[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 = "7.15.0"
Stages and Predicates
Ordered sequence: each step below must occur in order within 5m, correlated by process.entity_id.
Stage 1: process
[process where event.action == "start" and
process.name : ("wermgr.exe", "WerFault.exe") and process.args_count == 1 and process.parent.executable != null and
not (process.args : "C:\\WINDOWS\\system32\\wermgr.exe -upload" and process.parent.executable : "C:\\Windows\\System32\\svchost.exe")]
Stage 2: network
[network where event.action == "connection_attempted" and process.name : ("wermgr.exe", "WerFault.exe")]
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | eq |
| field:"EventType" kind:eq |
process.args_count | eq |
| field:"process.args_count" kind:eq value:"1" |
process.name | wildcard |
| field:"process_basename" kind:wildcard |
process.parent.executable | is_not_null | field:"ParentImage" kind:is_not_null |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.args | eq | C:\WINDOWS\system32\wermgr.exe -upload | excludes:process.args field:"process.args" value:"C:\WINDOWS\system32\wermgr.exe -upload" |
process.parent.executable | eq | C:\Windows\System32\svchost.exe | excludes:process.parent.executable field:"process.parent.executable" value:"C:\Windows\System32\svchost.exe" |