Detection rules › Elastic
Elastic rules: 0k
AWS Batch Job Submitted with Container Override by Unusual Identity
#Detects the first time an AWS identity submits an AWS Batch job with a container command override ("containerOverrides.command"), indicating a runtime-modified execution environment. Command overrides allow the submitter to replace the default command of a job definition at submission time. This flexibility is commonly abused by adversaries to inject malicious commands or exfiltration logic into otherwise legitimate Batch compute environments without modifying the underlying job definition — making the malicious activity harder to detect through configuration review alone.
Known False Positives
- Development teams and data pipelines may legitimately use container overrides to parameterize job executions with dynamic inputs. Validate that the submitting identity, job queue, and override content are consistent with expected workload behavior.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Execution |
Telemetry Coverage
| Platform | Record / event type |
|---|---|
| AWS | CloudTrail event SubmitJob: Submits an Batch job from a job definition. |
Rule Body
[metadata]
creation_date = "2026/07/27"
integration = ["aws"]
maturity = "production"
updated_date = "2026/07/27"
[rule]
author = ["Elastic"]
description = """
Detects the first time an AWS identity submits an AWS Batch job with a container command override ("containerOverrides.command"),
indicating a runtime-modified execution environment. Command overrides allow the submitter to
replace the default command of a job definition at submission time. This flexibility is commonly abused by adversaries
to inject malicious commands or exfiltration logic into otherwise legitimate Batch compute environments without modifying
the underlying job definition — making the malicious activity harder to detect through
configuration review alone.
"""
false_positives = [
"""
Development teams and data pipelines may legitimately use container overrides to parameterize
job executions with dynamic inputs. Validate that the submitting identity, job queue, and
override content are consistent with expected workload behavior.
""",
]
from = "now-6m"
index = ["logs-aws.cloudtrail-*"]
language = "kuery"
license = "Elastic License v2"
name = "AWS Batch Job Submitted with Container Override by Unusual Identity"
note = """## Triage and analysis
### Investigating AWS Batch Job Submitted with Container Override by Unusual Identity
This rule fires when an identity submits a Batch job with a container command override and has not been observed doing so in the prior 7 days. Container overrides at submission time bypass job definition review — an adversary can inject a malicious command into an approved job definition without modifying it, making the change invisible to IaC drift detection or configuration compliance tools.
### Possible investigation steps
- Identify the submitting principal (`aws.cloudtrail.user_identity.arn`) and determine whether they are expected to use AWS Batch with runtime overrides.
- Review `aws.cloudtrail.request_parameters` to extract the overridden command in `containerOverrides.command` - this is the trigger. Also inspect any environment variables or resource requirements present. Look for shell commands, curl/wget calls, base64-encoded payloads, or references to external endpoints in the command override.
- Identify the job queue and job definition used to understand the compute environment and IAM role the job will execute under.
- Search for `DescribeJobs` events after the submission to track execution status and output.
- Correlate with S3 `GetObject` or `PutObject` events from the Batch execution role during the job's execution window to identify data access or exfiltration.
### False positive analysis
- ETL and data processing pipelines that parameterize job commands at submission time.
- CI/CD systems that submit test jobs with dynamic parameters.
### Response and remediation
- If unauthorized, cancel the job immediately using `TerminateJob`.
- Review the Batch compute environment's IAM execution role for the scope of data access the job had.
- Restrict `batch:SubmitJob` with `Condition` keys on `batch:Image` and job queue ARNs to prevent arbitrary container override submissions.
"""
references = [
"https://docs.aws.amazon.com/batch/latest/APIReference/API_SubmitJob.html",
"https://docs.aws.amazon.com/batch/latest/APIReference/API_ContainerOverrides.html",
]
risk_score = 47
rule_id = "2b7d9e61-4c83-4f1a-9e52-0b8a3d7c6f29"
setup = "The AWS CloudTrail integration must be enabled and configured to collect Batch management events (`batch.amazonaws.com`)."
severity = "medium"
tags = [
"Domain: Cloud",
"Data Source: AWS",
"Data Source: Amazon Web Services",
"Data Source: AWS Batch",
"Use Case: Threat Detection",
"Tactic: Execution",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "new_terms"
query = '''
data_stream.dataset: "aws.cloudtrail"
and event.provider: "batch.amazonaws.com"
and event.action: "SubmitJob"
and event.outcome: "success"
and aws.cloudtrail.request_parameters: (*containerOverrides* and *command*)
'''
[[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.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
[rule.new_terms]
field = "new_terms_fields"
value = ["aws.cloudtrail.user_identity.arn"]
[[rule.new_terms.history_window_start]]
field = "history_window_start"
value = "now-7d"
[rule.investigation_fields]
field_names = [
"@timestamp",
"aws.cloudtrail.user_identity.arn",
"aws.cloudtrail.user_identity.type",
"event.action",
"event.outcome",
"aws.cloudtrail.request_parameters",
"source.ip",
"cloud.region",
"cloud.account.id",
]
Stages and Predicates
Stage 1: new_terms
data_stream.dataset: "aws.cloudtrail"
and event.provider: "batch.amazonaws.com"
and event.action: "SubmitJob"
and event.outcome: "success"
and aws.cloudtrail.request_parameters: (*containerOverrides* and *command*)
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
aws.cloudtrail.request_parameters | wildcard |
| field:"aws::requestParameters" kind:wildcard |
data_stream.dataset | eq |
| field:"data_stream.dataset" kind:eq value:"aws.cloudtrail" |
event.action | eq |
| field:"EventType" kind:eq value:"SubmitJob" |
event.outcome | eq |
| field:"event.outcome" kind:eq value:"success" |
event.provider | eq |
| field:"Provider_Name" kind:eq value:"batch.amazonaws.com" |
AWS IAM Inline Policy Added to a Group
#Identifies an inline policy added to an IAM group via PutGroupPolicy. An inline policy attached to a group grants its permissions to every current and future member of that group. Adversaries can abuse this to escalate privileges (grant elevated permissions to a group they belong to, or will add themselves to) and to establish persistence through a durable, membership-based grant that is easy to overlook. Group inline policies are uncommon compared to managed-policy attachments, so their creation by an unexpected principal warrants review.
Known False Positives
- Identity and platform teams and infrastructure-as-code pipelines occasionally manage group inline policies as part of normal access governance. Verify the principal in `aws.cloudtrail.user_identity.arn`, the targeted group, and the policy document against approved change records. Known administration roles and deployment automation can be excluded after validation.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Persistence | |
| Privilege Escalation |
Telemetry Coverage
Rule Body
[metadata]
creation_date = "2026/06/18"
integration = ["aws"]
maturity = "production"
updated_date = "2026/06/18"
[rule]
author = ["Elastic"]
description = """
Identifies an inline policy added to an IAM group via PutGroupPolicy. An inline policy attached to a group grants its
permissions to every current and future member of that group. Adversaries can abuse this to escalate privileges (grant
elevated permissions to a group they belong to, or will add themselves to) and to establish persistence through a
durable, membership-based grant that is easy to overlook. Group inline policies are uncommon compared to managed-policy
attachments, so their creation by an unexpected principal warrants review.
"""
false_positives = [
"""
Identity and platform teams and infrastructure-as-code pipelines occasionally manage group inline policies as part
of normal access governance. Verify the principal in `aws.cloudtrail.user_identity.arn`, the targeted group, and the
policy document against approved change records. Known administration roles and deployment automation can be
excluded after validation.
""",
]
from = "now-6m"
index = ["logs-aws.cloudtrail-*"]
language = "kuery"
license = "Elastic License v2"
name = "AWS IAM Inline Policy Added to a Group"
note = """## Triage and analysis
### Investigating AWS IAM Inline Policy Added to a Group
`PutGroupPolicy` embeds an inline permissions policy directly on an IAM group. Because the policy applies to all members of the group, it is an effective way to broadly grant permissions — and, for an adversary, to escalate privileges or persist while drawing less attention than attaching a well-known managed policy such as `AdministratorAccess`. Group inline policies are relatively rare, which makes their creation a useful signal.
### Possible investigation steps
- Identify the actor in `aws.cloudtrail.user_identity.arn`, `aws.cloudtrail.user_identity.type`, and `aws.cloudtrail.user_identity.session_context.session_issuer.arn`, and review `source.ip` / `user_agent.original` to determine how the change was made.
- Inspect `aws.cloudtrail.request_parameters` for the targeted `groupName`, the `policyName`, and the `policyDocument` to assess what permissions were granted (look for broad `Action`/`Resource` of `*`, IAM, or data-access permissions).
- Enumerate the group's current members to understand who immediately gains the new permissions, and whether the actor is or could become a member.
- Confirm whether the change aligns with an approved access request, onboarding, or deployment.
- Correlate with recent activity by the same principal, such as group creation, adding users to the group, or other IAM modifications that may form an escalation chain.
### False positive analysis
- Approved access governance and infrastructure-as-code may add group inline policies. Confirm the change is expected and exclude known administration roles or automation on `aws.cloudtrail.user_identity.arn` after validation.
### Response and remediation
- If the change is unauthorized, remove the inline policy from the group (`DeleteGroupPolicy`) and review which members used the granted permissions while it was in place.
- Rotate or restrict credentials for the principal if compromise is suspected, and constrain `iam:PutGroupPolicy` to a small set of trusted administrators.
### Additional information
- [IAM identity-based policies (inline)](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_managed-vs-inline.html)
- [PutGroupPolicy API](https://docs.aws.amazon.com/IAM/latest/APIReference/API_PutGroupPolicy.html)
"""
references = [
"https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_managed-vs-inline.html",
"https://docs.aws.amazon.com/IAM/latest/APIReference/API_PutGroupPolicy.html",
]
risk_score = 47
rule_id = "87f8141e-4275-4d49-9e76-d215b4614a0b"
severity = "medium"
tags = [
"Domain: Cloud",
"Domain: Identity",
"Data Source: AWS",
"Data Source: Amazon Web Services",
"Data Source: AWS IAM",
"Use Case: Threat Detection",
"Tactic: Privilege Escalation",
"Tactic: Persistence",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "query"
query = '''
data_stream.dataset: "aws.cloudtrail"
and event.provider: "iam.amazonaws.com"
and event.action: "PutGroupPolicy"
and event.outcome: "success"
and not aws.cloudtrail.user_identity.type: "AWSService"
and not user_agent.original: (*terraform* or *pulumi* or *ansible*)
and not aws.cloudtrail.user_identity.arn: (*terraform* or *pulumi* or *ansible*)
and not source.as.organization.name: (Amazon* or AMAZON* or Google*)
and not source.address: ("cloudformation.amazonaws.com" or "servicecatalog.amazonaws.com")
'''
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1098"
name = "Account Manipulation"
reference = "https://attack.mitre.org/techniques/T1098/"
[rule.threat.tactic]
id = "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.003"
name = "Additional Cloud Roles"
reference = "https://attack.mitre.org/techniques/T1098/003/"
[rule.threat.tactic]
id = "TA0003"
name = "Persistence"
reference = "https://attack.mitre.org/tactics/TA0003/"
[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",
"aws.cloudtrail.user_identity.session_context.session_issuer.arn",
"aws.cloudtrail.request_parameters",
"aws.cloudtrail.response_elements",
"event.action",
"event.outcome",
"cloud.account.id",
"cloud.region",
]
Stages and Predicates
Stage 1: query
data_stream.dataset: "aws.cloudtrail"
and event.provider: "iam.amazonaws.com"
and event.action: "PutGroupPolicy"
and event.outcome: "success"
and not aws.cloudtrail.user_identity.type: "AWSService"
and not user_agent.original: (*terraform* or *pulumi* or *ansible*)
and not aws.cloudtrail.user_identity.arn: (*terraform* or *pulumi* or *ansible*)
and not source.as.organization.name: (Amazon* or AMAZON* or Google*)
and not source.address: ("cloudformation.amazonaws.com" or "servicecatalog.amazonaws.com")
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 | eq |
| field:"EventType" kind:eq value:"PutGroupPolicy" |
event.outcome | eq |
| field:"event.outcome" kind:eq value:"success" |
event.provider | eq |
| field:"Provider_Name" kind:eq value:"iam.amazonaws.com" |
Exclusions
The rule actively suppresses these predicates.
AWS IAM Virtual MFA Device Registration Attempt with Session Token
#Detects attempts to create or enable a Virtual MFA device (CreateVirtualMFADevice, EnableMFADevice) using temporary AWS credentials (access keys beginning with ASIA). Session credentials are short-lived and tied to existing authenticated sessions, so using them to register or enable MFA devices is unusual. Adversaries who compromise temporary credentials may abuse this behavior to establish persistence by attaching new MFA devices to maintain access to high-privilege accounts despite key rotation or password resets.
Known False Positives
- Some legitimate administrative workflows or CI/CD automation pipelines may temporarily configure or re-enable MFA devices using session-based credentials. Validate the calling identity’s purpose, source IP, and user agent to confirm whether this activity was authorized. This rule automatically excludes console login sessions, which filters out expected MFA operations performed via the AWS Management Console.
MITRE ATT&CK Coverage
Telemetry Coverage
Rules Detecting the Same Action
These rules filter on the same operation.
Rule Body
[metadata]
creation_date = "2025/04/11"
integration = ["aws"]
maturity = "production"
min_stack_version = "9.3.0"
min_stack_comments = "Changing min stack to 9.3.0, the latest minimum supported version for 9.X releases."
updated_date = "2026/07/20"
[rule]
author = ["Elastic"]
description = """
Detects attempts to create or enable a Virtual MFA device (CreateVirtualMFADevice, EnableMFADevice) using temporary AWS
credentials (access keys beginning with ASIA). Session credentials are short-lived and tied to existing authenticated
sessions, so using them to register or enable MFA devices is unusual. Adversaries who compromise temporary credentials
may abuse this behavior to establish persistence by attaching new MFA devices to maintain access to high-privilege
accounts despite key rotation or password resets.
"""
false_positives = [
"""
Some legitimate administrative workflows or CI/CD automation pipelines may temporarily configure or re-enable MFA
devices using session-based credentials. Validate the calling identity’s purpose, source IP, and user agent to
confirm whether this activity was authorized. This rule automatically excludes console login sessions, which filters out expected MFA operations performed via the
AWS Management Console.
""",
]
from = "now-6m"
index = ["logs-aws.cloudtrail-*"]
language = "eql"
license = "Elastic License v2"
name = "AWS IAM Virtual MFA Device Registration Attempt with Session Token"
note = """## Triage and Analysis
### Investigating AWS IAM Virtual MFA Device Registration Attempt with Session Token
Temporary credentials that start with the prefix `ASIA` are generated by the AWS Security Token Service (STS). These
session tokens are used for short-lived operations and should not be used to modify or register IAM
authentication mechanisms. This rule detects cases where an IAM user or role uses such temporary credentials to invoke either `CreateVirtualMFADevice` or `EnableMFADevice`.
### Possible investigation steps
- **Identify the actor and session context**
- Review `aws.cloudtrail.user_identity.arn` and `aws.cloudtrail.user_identity.access_key_id` to determine the identity and confirm the `ASIA` prefix.
- This rule automatically filters out console login sessions using `aws.cloudtrail.session_credential_from_console`, so alerts indicate non-console temporary credential usage.
- Check `user_agent.original`, `source.ip`, and `cloud.region` to determine if this activity originated from an expected host, VPN, or location.
- Cross-reference with prior activity by this identity—especially `GetSessionToken`, `AssumeRole`, or `GetCallerIdentity` calls.
- **Correlate related IAM events**
- Search for subsequent or preceding calls to:
- `EnableMFADevice` (after `CreateVirtualMFADevice`)
- `DeactivateMFADevice` or `DeleteVirtualMFADevice`
- `ListMFADevices`, `ListUsers`, or `UpdateLoginProfile`
- Review whether new MFA devices were successfully enabled (`event.outcome:success`).
- **Assess session scope and privileges**
- Identify what IAM policies are attached to the user or role that issued this request.
- If the temporary credentials were created via `AssumeRole` or `GetSessionToken`, check the originating principal’s permissions.
- **Investigate possible persistence**
- Look for new MFA devices listed for privileged users (e.g., account root or admin roles).
- Review login history for those accounts following the MFA change.
### False positive analysis
- **Legitimate Administrative or Automated Actions**
Certain IAM administrative workflows or CI/CD automation tools may register or enable MFA devices using temporary
session credentials. Confirm whether the calling principal is part of an authorized automation process or a known
identity performing account configuration tasks.
- **Expected Console Behavior**
Console-based MFA operations are automatically filtered out by this rule using the `aws.cloudtrail.session_credential_from_console` field.
Alerts from this rule indicate MFA operations performed with temporary credentials obtained outside of console login sessions.
### Response and remediation
- **Immediate containment**
- Revoke or expire the temporary credentials (`aws sts revoke-session` if applicable).
- Disable or delete any newly created virtual MFA devices using `DeleteVirtualMFADevice`.
- Rotate passwords and long-term access keys for the associated IAM users.
- **Investigation and scoping**
- Review CloudTrail logs for related IAM modifications (`UpdateLoginProfile`, `AttachUserPolicy`, `CreateAccessKey`).
- Identify any new API keys or tokens created after the MFA registration.
- Cross-check whether the attacker leveraged the new MFA binding for session persistence or login.
- **Recovery and hardening**
- Enforce the `iam:EnableMFADevice` and `iam:CreateVirtualMFADevice` permissions only for trusted admin roles.
- Implement `aws:MultiFactorAuthPresent` conditions in IAM policies.
- Monitor for any future `ASIA` credential–based IAM configuration changes.
### 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)**
- **[Managing MFA Devices in IAM](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_mfa.html)**
"""
references = ["https://www.sygnia.co/blog/sygnia-investigation-bybit-hack/"]
risk_score = 73
rule_id = "e4feea34-3b62-4c83-b77f-018fbef48c00"
severity = "high"
tags = [
"Domain: Cloud",
"Data Source: AWS",
"Data Source: Amazon Web Services",
"Data Source: AWS CloudTrail",
"Data Source: AWS IAM",
"Tactic: Persistence",
"Use Case: Identity and Access Audit",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
iam where data_stream.dataset == "aws.cloudtrail"
and event.provider == "iam.amazonaws.com"
and event.outcome == "success"
and event.action in ("CreateVirtualMFADevice", "EnableMFADevice")
and startsWith (aws.cloudtrail.user_identity.access_key_id, "ASIA")
and not aws.cloudtrail.session_credential_from_console == "true"
'''
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1078"
name = "Valid Accounts"
reference = "https://attack.mitre.org/techniques/T1078/"
[[rule.threat.technique.subtechnique]]
id = "T1078.004"
name = "Cloud Accounts"
reference = "https://attack.mitre.org/techniques/T1078/004/"
[[rule.threat.technique]]
id = "T1098"
name = "Account Manipulation"
reference = "https://attack.mitre.org/techniques/T1098/"
[[rule.threat.technique.subtechnique]]
id = "T1098.005"
name = "Device Registration"
reference = "https://attack.mitre.org/techniques/T1098/005/"
[[rule.threat.technique]]
id = "T1556"
name = "Modify Authentication Process"
reference = "https://attack.mitre.org/techniques/T1556/"
[[rule.threat.technique.subtechnique]]
id = "T1556.006"
name = "Multi-Factor Authentication"
reference = "https://attack.mitre.org/techniques/T1556/006/"
[rule.threat.tactic]
id = "TA0003"
name = "Persistence"
reference = "https://attack.mitre.org/tactics/TA0003/"
[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: iam
iam where data_stream.dataset == "aws.cloudtrail"
and event.provider == "iam.amazonaws.com"
and event.outcome == "success"
and event.action in ("CreateVirtualMFADevice", "EnableMFADevice")
and startsWith (aws.cloudtrail.user_identity.access_key_id, "ASIA")
and not aws.cloudtrail.session_credential_from_console == "true"
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
aws.cloudtrail.user_identity.access_key_id | starts_with |
| field:"aws::userIdentity.accessKeyId" kind:starts_with value:"ASIA" |
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" |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
aws.cloudtrail.session_credential_from_console | eq | true | excludes:aws.cloudtrail.session_credential_from_console field:"aws.cloudtrail.session_credential_from_console" value:"true" |
Component Object Model Registry Modification by a Low Reputation Process
#Identifies Component Object Model (COM) hijacking via registry modification by a process with low or unknown reputation. Adversaries may establish persistence by executing malicious content triggered by hijacked references to COM objects.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Persistence |
Rule Body
[rule]
description = """
Identifies Component Object Model (COM) hijacking via registry modification by a process with low or unknown reputation.
Adversaries may establish persistence by executing malicious content triggered by hijacked references to COM objects.
"""
id = "02920d68-cd43-47d2-9552-99284979a1c6"
license = "Elastic License v2"
name = "Component Object Model Registry Modification by a Low Reputation Process"
os_list = ["windows"]
reference = [
"https://bohops.com/2018/08/18/abusing-the-com-registry-structure-part-2-loading-techniques-for-evasion-and-persistence/",
]
version = "1.0.5"
query = '''
sequence by process.entity_id with maxspan=3m
[process where event.action == "start" and
(process.Ext.relative_file_creation_time <= 1800 or process.Ext.relative_file_name_modify_time <= 1800) and
(process.code_signature.trusted == false or process.code_signature.exists == false) and
not process.code_signature.status : ("errorExpired", "errorCode_endpoint*") and
not process.hash.sha256 in ("a9774d76822597777e1beaaad9d3a1e441b266836d6ca97a4b7bd908e8a3f518", "c9fe835d7f6fb610c78cb4e3b89bdc9e242d422cceb854fadf88f77c49fa8ff3")]
[registry where
process.executable != null and registry.data.strings != null and
registry.path : ("HKEY_USERS\\*Classes\\*\\InprocServer32\\",
"HKEY_USERS\\*Classes\\*\\DelegateExecute\\",
"HKEY_USERS\\*Classes\\*\\TreatAs\\",
"HKEY_USERS\\*Classes\\CLSID\\*\\ScriptletURL\\")]
'''
min_endpoint_version = "8.10.0"
reputation = true
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
[[optional_actions]]
action = "rollback"
field = "process.entity_id"
state = 0
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1546"
name = "Event Triggered Execution"
reference = "https://attack.mitre.org/techniques/T1546/"
[[threat.technique.subtechnique]]
id = "T1546.015"
name = "Component Object Model Hijacking"
reference = "https://attack.mitre.org/techniques/T1546/015/"
[threat.tactic]
id = "TA0003"
name = "Persistence"
reference = "https://attack.mitre.org/tactics/TA0003/"
[internal]
min_endpoint_version = "8.10.0"
Stages and Predicates
Ordered sequence: each step below must occur in order within 3m, correlated by process.entity_id.
Stage 1: process
[process where event.action == "start" and
(process.Ext.relative_file_creation_time <= 1800 or process.Ext.relative_file_name_modify_time <= 1800) and
(process.code_signature.trusted == false or process.code_signature.exists == false) and
not process.code_signature.status : ("errorExpired", "errorCode_endpoint*") and
not process.hash.sha256 in ("a9774d76822597777e1beaaad9d3a1e441b266836d6ca97a4b7bd908e8a3f518", "c9fe835d7f6fb610c78cb4e3b89bdc9e242d422cceb854fadf88f77c49fa8ff3")]
Stage 2: registry
[registry where
process.executable != null and registry.data.strings != null and
registry.path : ("HKEY_USERS\\*Classes\\*\\InprocServer32\\",
"HKEY_USERS\\*Classes\\*\\DelegateExecute\\",
"HKEY_USERS\\*Classes\\*\\TreatAs\\",
"HKEY_USERS\\*Classes\\CLSID\\*\\ScriptletURL\\")]
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | eq |
| field:"EventType" kind:eq value:"start" |
process.Ext.relative_file_creation_time | le |
| field:"process.Ext.relative_file_creation_time" kind:le value:"1800" |
process.Ext.relative_file_name_modify_time | le |
| field:"process.Ext.relative_file_name_modify_time" kind:le value:"1800" |
process.code_signature.exists | eq |
| field:"process.code_signature.exists" kind:eq value:"false" |
process.code_signature.trusted | eq |
| field:"process.code_signature.trusted" kind:eq value:"false" |
process.executable | is_not_null | field:"Image" kind:is_not_null | |
registry.data.strings | is_not_null | field:"Details" kind:is_not_null | |
registry.path | wildcard |
| field:"TargetObject" kind:wildcard |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.code_signature.status | wildcard | errorExpired, errorCode_endpoint* | excludes:process.code_signature.status field:"process.code_signature.status" value:"errorExpired" field:"process.code_signature.status" value:"errorCode_endpoint*" |
process.hash.sha256 | in | a9774d76822597777e1beaaad9d3a1e441b266836d6ca97a4b7bd908e8a3f518, c9fe835d7f6fb610c78cb4e3b89bdc9e242d422cceb854fadf88f77c49fa8ff3 | excludes:process.hash.sha256 field:"process.hash.sha256" value:"a9774d76822597777e1beaaad9d3a1e441b266836d6ca97a4b7bd908e8a3f518" field:"process.hash.sha256" value:"c9fe835d7f6fb610c78cb4e3b89bdc9e242d422cceb854fadf88f77c49fa8ff3" |
Crypto Wallet File Access by Unsigned or Untrusted Binary
#Detects when a suspicious process attempts to access a crypto wallet sensitive file. This is an alpha version of this rule and meant to be used to assess and test.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Credential Access |
Telemetry Coverage
| Platform | Record / event type |
|---|---|
| macOS | ESF event open (NOTIFY): Fires after the kernel grants a process access to open a file. |
Rule Body
[rule]
description = """
Detects when a suspicious process attempts to access a crypto wallet sensitive file. This is an alpha version of this
rule and meant to be used to assess and test.
"""
id = "a3050eae-c8ae-434d-aeff-97112eddcb48"
license = "Elastic License v2"
name = "Crypto Wallet File Access by Unsigned or Untrusted Binary"
os_list = ["macos"]
reference = ["https://www.elastic.co/security-labs/beyond-the-wail"]
version = "1.0.19"
query = '''
file where event.action == "open" and
file.path like~ ("/Users/*/.electrum/*",
"/Users/*/Library/Application_Support/*/Default/Extensions/*",
"/Users/*/Library/Application Support/*/Default/Local Extension Settings/*",
"/Users/*/Library/Application Support/Electrum/*",
"/Users/*/Library/Application Support/Exodus/*",
"/Users/*/Library/Application Support/Coinomi/*",
"/Users/*/Library/Application Support/Atomic/*",
"/Users/*/Library/Application Support/@trezor/*",
"/Users/*/Library/Application Support/Ledger Live/*",
"/Users/*/Library/Application Support/WasabiWallet/*",
"/Users/*/Monero/*",
"/Users/*/Library/Application Support/Bitcoin/*",
"/Users/*/Library/Application Support/Litecoin/*",
"/Users/*/Library/Application Support/DashCore/*",
"/Users/*/Library/Application Support/ElectronCash/*",
"/Users/*/Library/Application Support/Guarda/*",
"/Users/*/Library/Application Support/Dogecoin/*",
"/Users/*/Library/Application Support/BraveSoftware/Brave-Browser/BraveWallet/*",
"/Users/*/Library/Application Support/BraveSoftware/Brave-Browser/Default/Local Extension Settings/pgojbichloddijphfmfhhfolimnhjklk/*",
"/Users/*/Library/Application Support/Firefox/Profiles/*/extensions/*") and
process.executable != null and
(process.code_signature.trusted == false or process.code_signature.exists == false) and
not process.code_signature.signing_id : ("rg-*", "git-*", "rg") and
not process.executable like "/opt/homebrew/Cellar/rtk/*/bin/rtk" and
not (Effective_process.executable like "/Library/Elastic/Agent/data/elastic-agent-*/elastic-agent.app/Contents/MacOS/elastic-agent" and process.executable like "/Library/Elastic/Agent/data/elastic-agent-*/components/osquery-extension.ext")
'''
min_endpoint_version = "8.11.1"
optional_actions = []
[[actions]]
action = "kill_process"
field = "Effective_process.executable"
state = 0
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1552"
name = "Unsecured Credentials"
reference = "https://attack.mitre.org/techniques/T1552/"
[[threat.technique.subtechnique]]
id = "T1552.001"
name = "Credentials In Files"
reference = "https://attack.mitre.org/techniques/T1552/001/"
[threat.tactic]
id = "TA0006"
name = "Credential Access"
reference = "https://attack.mitre.org/tactics/TA0006/"
[internal]
min_endpoint_version = "8.11.1"
Stages and Predicates
Stage 1: file
file where event.action == "open" and
file.path like~ ("/Users/*/.electrum/*",
"/Users/*/Library/Application_Support/*/Default/Extensions/*",
"/Users/*/Library/Application Support/*/Default/Local Extension Settings/*",
"/Users/*/Library/Application Support/Electrum/*",
"/Users/*/Library/Application Support/Exodus/*",
"/Users/*/Library/Application Support/Coinomi/*",
"/Users/*/Library/Application Support/Atomic/*",
"/Users/*/Library/Application Support/@trezor/*",
"/Users/*/Library/Application Support/Ledger Live/*",
"/Users/*/Library/Application Support/WasabiWallet/*",
"/Users/*/Monero/*",
"/Users/*/Library/Application Support/Bitcoin/*",
"/Users/*/Library/Application Support/Litecoin/*",
"/Users/*/Library/Application Support/DashCore/*",
"/Users/*/Library/Application Support/ElectronCash/*",
"/Users/*/Library/Application Support/Guarda/*",
"/Users/*/Library/Application Support/Dogecoin/*",
"/Users/*/Library/Application Support/BraveSoftware/Brave-Browser/BraveWallet/*",
"/Users/*/Library/Application Support/BraveSoftware/Brave-Browser/Default/Local Extension Settings/pgojbichloddijphfmfhhfolimnhjklk/*",
"/Users/*/Library/Application Support/Firefox/Profiles/*/extensions/*") and
process.executable != null and
(process.code_signature.trusted == false or process.code_signature.exists == false) and
not process.code_signature.signing_id : ("rg-*", "git-*", "rg") and
not process.executable like "/opt/homebrew/Cellar/rtk/*/bin/rtk" and
not (Effective_process.executable like "/Library/Elastic/Agent/data/elastic-agent-*/elastic-agent.app/Contents/MacOS/elastic-agent" and process.executable like "/Library/Elastic/Agent/data/elastic-agent-*/components/osquery-extension.ext")
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | eq |
| field:"EventType" kind:eq value:"open" |
file.path | wildcard |
| field:"TargetFilename" kind:wildcard |
process.code_signature.exists | eq |
| field:"process.code_signature.exists" kind:eq value:"false" |
process.code_signature.trusted | eq |
| field:"process.code_signature.trusted" kind:eq value:"false" |
process.executable | is_not_null | field:"Image" kind:is_not_null |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
Effective_process.executable | wildcard | /Library/Elastic/Agent/data/elastic-agent-*/elastic-agent.app/Contents/MacOS/elastic-agent | excludes:Effective_process.executable field:"Effective_process.executable" value:"/Library/Elastic/Agent/data/elastic-agent-*/elastic-agent.app/Contents/MacOS/elastic-agent" |
process.executable | wildcard | /Library/Elastic/Agent/data/elastic-agent-*/components/osquery-extension.ext | excludes:process.executable field:"process.executable" value:"/Library/Elastic/Agent/data/elastic-agent-*/components/osquery-extension.ext" |
process.code_signature.signing_id | wildcard | rg-*, git-*, rg | excludes:process.code_signature.signing_id field:"process.code_signature.signing_id" value:"rg-*" field:"process.code_signature.signing_id" value:"git-*" field:"process.code_signature.signing_id" value:"rg" |
process.executable | wildcard | /opt/homebrew/Cellar/rtk/*/bin/rtk | excludes:process.executable field:"process.executable" value:"/opt/homebrew/Cellar/rtk/*/bin/rtk" |
DLL Injection via MavInject Utility
#Detects the utilization of the Microsoft MavInject utility to inject an arbitrary library into a remote process.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Stealth |
Rule Body
[rule]
description = "Detects the utilization of the Microsoft MavInject utility to inject an arbitrary library into a remote process."
id = "fccfdee7-b2be-4656-a3ab-9c2808aeff53"
license = "Elastic License v2"
name = "DLL Injection via MavInject Utility"
os_list = ["windows"]
reference = ["https://lolbas-project.github.io/lolbas/Binaries/Mavinject/"]
version = "1.0.5"
query = '''
sequence with maxspan=5s
[process where event.action == "start" and
(process.pe.original_file_name : "mavinject*.exe" or process.name : "mavinject*.exe") and
process.args : "/INJECTRUNNING" and not process.parent.executable : "?:\\Windows\\Sys*\\AppVClient.exe"] as event0
[library where process.pid != 4 and not dll.code_signature.status : "trusted" and
stringcontains~(event0.process.command_line, dll.name)]
'''
min_endpoint_version = "8.4.0"
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 1
[[optional_actions]]
action = "rollback"
field = "process.entity_id"
state = 0
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1055"
name = "Process Injection"
reference = "https://attack.mitre.org/techniques/T1055/"
[[threat.technique]]
id = "T1218"
name = "System Binary Proxy Execution"
reference = "https://attack.mitre.org/techniques/T1218/"
[threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
[internal]
min_endpoint_version = "8.4.0"
Stages and Predicates
Stage 1: process
[process where event.action == "start" and
(process.pe.original_file_name : "mavinject*.exe" or process.name : "mavinject*.exe") and
process.args : "/INJECTRUNNING" and not process.parent.executable : "?:\\Windows\\Sys*\\AppVClient.exe"] as event0
Stage 2: library
[library where process.pid != 4 and not dll.code_signature.status : "trusted" and
stringcontains~(event0.process.command_line, dll.name)]
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | eq |
| field:"EventType" kind:eq value:"start" |
event0.process.command_line | contains |
| field:"event0.process.command_line" kind:contains value:"dll.name" |
process.args | wildcard |
| field:"process.args" kind:wildcard value:"/INJECTRUNNING" |
process.name | wildcard |
| field:"process_basename" kind:wildcard value:"mavinject*.exe" |
process.pe.original_file_name | wildcard |
| field:"OriginalFileName" kind:wildcard value:"mavinject*.exe" |
process.pid | ne |
| field:"process_id" kind:ne value:"4" |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.parent.executable | wildcard | ?:\Windows\Sys*\AppVClient.exe | excludes:process.parent.executable field:"process.parent.executable" value:"?:\Windows\Sys*\AppVClient.exe" |
dll.code_signature.status | eq | trusted | excludes:dll.code_signature.status field:"dll.code_signature.status" value:"trusted" |
Downloaded URL Files
#Identifies .url shortcut files downloaded from outside the local network. These shortcut files are commonly used in phishing campaigns.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Initial Access | |
| Execution |
Telemetry Coverage
| Provider | Record / event type |
|---|---|
| Sysmon | Event ID 11: FileCreate |
Rule Body
[metadata]
creation_date = "2020/09/02"
integration = ["endpoint"]
maturity = "production"
updated_date = "2026/05/04"
[rule]
author = ["Elastic"]
description = """
Identifies .url shortcut files downloaded from outside the local network. These shortcut files are commonly used in
phishing campaigns.
"""
from = "now-9m"
index = ["logs-endpoint.events.file-*"]
language = "eql"
license = "Elastic License v2"
name = "Downloaded URL Files"
risk_score = 47
rule_id = "cd82e3d6-1346-4afd-8f22-38388bbf34cb"
severity = "medium"
tags = [
"Domain: Endpoint",
"OS: Windows",
"Use Case: Threat Detection",
"Tactic: Execution",
"Data Source: Elastic Defend",
"Resources: Investigation Guide"
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
file where host.os.type == "windows" and event.type == "creation" and file.extension == "url"
and file.Ext.windows.zone_identifier == 3
'''
setup = """## Setup
This rule is designed for data generated by [Elastic Defend](https://www.elastic.co/security/endpoint-security), which provides native endpoint detection and response, along with event enrichments designed to work with our detection rules.
Setup instructions: https://ela.st/install-elastic-defend
"""
note = """## Triage and analysis
> **Disclaimer**:
> This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.
### Investigating Downloaded URL Files
URL shortcut files, typically used for quick access to web resources, can be exploited by attackers in phishing schemes to execute malicious content. These files, when downloaded from non-local sources, may bypass traditional security measures. The detection rule identifies such files by monitoring their creation events on Windows systems, focusing on those not initiated by standard processes like Explorer, and flags them based on their network origin, aiding in early threat detection.
### Possible investigation steps
- Review the file creation event details to confirm the file extension is ".url" and verify the zone identifier is greater than 1, indicating a non-local source.
- Investigate the process that created the .url file, ensuring it was not initiated by "explorer.exe" and identify the actual process responsible for the creation.
- Check the network origin of the downloaded .url file to determine if it is from a known malicious domain or IP address.
- Analyze the contents of the .url file to identify the target URL and assess its reputation and potential risk.
- Correlate the event with other security alerts or logs from the same host to identify any additional suspicious activities or patterns.
- Contact the user associated with the alert to verify if they intentionally downloaded the file and gather any additional context regarding their actions.
### False positive analysis
- Corporate applications that generate .url files for legitimate purposes may trigger alerts. Identify these applications and create exceptions for their processes to prevent unnecessary alerts.
- Automated scripts or system management tools that download .url files as part of routine operations can be mistaken for threats. Review these tools and whitelist their activities if they are verified as safe.
- User-initiated downloads from trusted internal web portals might be flagged. Educate users on safe downloading practices and consider excluding specific trusted domains from monitoring.
- Security software updates or patches that include .url files could be misidentified. Verify the source of these updates and adjust the rule to exclude known safe update processes.
- Collaboration platforms that share .url files for internal use may cause false positives. Evaluate the platform's behavior and exclude its processes if they are deemed secure.
### Response and remediation
- Isolate the affected system from the network to prevent further spread of any potential malicious activity.
- Terminate any suspicious processes that are not initiated by standard processes like Explorer, especially those related to the creation of .url files.
- Delete the identified .url files from the system to remove the immediate threat.
- Conduct a full antivirus and anti-malware scan on the affected system to identify and remove any additional threats.
- Review and analyze the network logs to identify any other systems that may have downloaded similar .url files and apply the same containment measures.
- Escalate the incident to the security operations team for further investigation and to determine if there is a broader campaign targeting the organization.
- Update security policies and endpoint protection configurations to block the download and execution of .url files from untrusted sources in the future."""
[[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/"
Stages and Predicates
Stage 1: file
file where host.os.type == "windows" and event.type == "creation" and file.extension == "url"
and file.Ext.windows.zone_identifier == 3
Indicators
These rows show field, operator, and value matches.
Egress Network Connection by MOTD Child
#This rule detects network connections to external IP's immediatly after the process execution of a file within the message of the day (MOTD) configuration directory. This could be indicative of a persistence mechanism being established on the system.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Execution | |
| Persistence | |
| Command & Control |
Rule Body
[rule]
description = """
This rule detects network connections to external IP's immediatly after the process execution of a file within the
message of the day (MOTD) configuration directory. This could be indicative of a persistence mechanism being established
on the system.
"""
id = "da02d81a-d432-4cfe-8aa4-fc1a31c29c98"
license = "Elastic License v2"
name = "Egress Network Connection by MOTD Child"
os_list = ["linux"]
reference = [
"https://pberba.github.io/security/2022/02/06/linux-threat-hunting-for-persistence-initialization-scripts-and-shell-configuration/",
"https://www.elastic.co/security-labs/sequel-on-persistence-mechanisms",
]
version = "1.0.5"
query = '''
sequence with maxspan=3s
[process where event.type == "start" and event.action == "exec" and process.parent.executable like "/etc/update-motd.d/*"
and not (
(process.name in ("wget", "curl") and process.args == "https://motd.ubuntu.com") or
process.executable in (
"/usr/bin/landscape-sysinfo", "/usr/bin/yum", "/usr/bin/cloud-id", "/usr/bin/timeout",
"/usr/lib/ubuntu-release-upgrader/release-upgrade-motd"
) or
process.executable : "/etc/update-motd.d/*"
)
] by process.entity_id
[network where event.type == "start" and event.action == "connection_attempted" 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", "172.31.0.0/16"
)
)
] by process.parent.entity_id
'''
min_endpoint_version = "8.6.0"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 1
[[actions]]
action = "kill_process"
field = "process.parent.entity_id"
state = 0
[[actions]]
action = "kill_process"
field = "process.parent.entity_id"
state = 1
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1059"
name = "Command and Scripting Interpreter"
reference = "https://attack.mitre.org/techniques/T1059/"
[[threat.technique.subtechnique]]
id = "T1059.004"
name = "Unix Shell"
reference = "https://attack.mitre.org/techniques/T1059/004/"
[threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1037"
name = "Boot or Logon Initialization Scripts"
reference = "https://attack.mitre.org/techniques/T1037/"
[threat.tactic]
id = "TA0003"
name = "Persistence"
reference = "https://attack.mitre.org/tactics/TA0003/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1071"
name = "Application Layer Protocol"
reference = "https://attack.mitre.org/techniques/T1071/"
[threat.tactic]
id = "TA0011"
name = "Command and Control"
reference = "https://attack.mitre.org/tactics/TA0011/"
[internal]
min_endpoint_version = "8.6.0"
Stages and Predicates
Ordered sequence: each step below must occur in order within 3s, correlated by process.entity_id, process.parent.entity_id.
Stage 1: process
[process where event.type == "start" and event.action == "exec" and process.parent.executable like "/etc/update-motd.d/*"
and not (
(process.name in ("wget", "curl") and process.args == "https://motd.ubuntu.com") or
process.executable in (
"/usr/bin/landscape-sysinfo", "/usr/bin/yum", "/usr/bin/cloud-id", "/usr/bin/timeout",
"/usr/lib/ubuntu-release-upgrader/release-upgrade-motd"
) or
process.executable : "/etc/update-motd.d/*"
)
] by process.entity_id
Stage 2: network
[network where event.type == "start" and event.action == "connection_attempted" 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", "172.31.0.0/16"
)
)
] by process.parent.entity_id
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | eq |
| field:"EventType" kind:eq |
event.type | eq |
| field:"event.type" kind:eq value:"start" |
process.parent.executable | wildcard |
| field:"ParentImage" kind:wildcard value:"/etc/update-motd.d/*" |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.args | eq | https://motd.ubuntu.com | excludes:process.args field:"process.args" value:"https://motd.ubuntu.com" |
process.name | in | curl, wget | excludes:process.name field:"process.name" value:"curl" field:"process.name" value:"wget" |
process.executable | in | /usr/bin/cloud-id, /usr/bin/landscape-sysinfo, /usr/bin/timeout, /usr/bin/yum, /usr/lib/ubuntu-release-upgrader/release-upgrade-motd | excludes:process.executable |
process.executable | starts_with | /etc/update-motd.d/ | excludes:process.executable field:"process.executable" value:"/etc/update-motd.d/" |
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, 172.31.0.0/16 | 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 |
Entra ID Service Principal Credentials Created by Unusual User
#Identifies when new Service Principal credentials have been added in Microsoft Entra ID. In most organizations, credentials will be added to service principals infrequently. Hijacking an application (by adding a rogue secret or certificate) with granted permissions will allow the attacker to access data that is normally protected by MFA requirements.
Known False Positives
- Service principal credential additions may be done by a system or network administrator. Verify whether the username, hostname, and/or resource name should be making changes in your environment. Credential additions from 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 |
|---|---|
| Persistence | |
| Privilege Escalation |
Telemetry Coverage
| Platform | Record / event type |
|---|---|
| Azure | Add service principal credentials |
Rules Detecting the Same Action
These rules filter on the same operation.
- [Entra ID] Application Assigned Administrator Permissions Immediately After Obtaining Role Management Permissions (Kusto)
- [Entra ID] Application Granted Administrative Permission to Assign Microsoft Entra ID Roles (Kusto)
- Added Credentials to Existing Application (Sigma)
- Added Owner To Application (Sigma)
- Admin promotion after Role Management Application Permission Grant (Kusto)
- App Granted Microsoft Permissions (Sigma)
- App Granted Privileged Delegated Or App Permissions (Sigma)
- Application AppID Uri Configuration Changes (Sigma)
Rule Body
[metadata]
creation_date = "2021/05/05"
integration = ["azure"]
maturity = "production"
updated_date = "2026/04/10"
[rule]
author = ["Elastic", "Austin Songer"]
description = """
Identifies when new Service Principal credentials have been added in Microsoft Entra ID. In most organizations,
credentials will be added to service principals infrequently. Hijacking an application (by adding a rogue secret or
certificate) with granted permissions will allow the attacker to access data that is normally protected by MFA
requirements.
"""
false_positives = [
"""
Service principal credential additions may be done by a system or network administrator. Verify whether the
username, hostname, and/or resource name should be making changes in your environment. Credential additions from
unfamiliar users or hosts should be investigated. If known behavior is causing false positives, it can be exempted
from the rule.
""",
]
from = "now-9m"
index = ["filebeat-*", "logs-azure.auditlogs-*"]
language = "kuery"
license = "Elastic License v2"
name = "Entra ID Service Principal Credentials Created by Unusual User"
note = """## Triage and analysis
### Investigating Entra ID Service Principal Credentials Created by Unusual User
This rule identifies the addition of new credentials (client secrets or certificates) to a Microsoft Entra ID (formerly Azure AD) service principal by a user who has not previously performed this operation in the last 10 days. Adversaries who obtain temporary or persistent access to a user account may add rogue credentials to service principals in order to maintain unauthorized access to cloud resources.
This is a [New Terms](https://www.elastic.co/guide/en/security/current/rules-ui-create.html#create-new-terms-rule) rule that detects rare users performing sensitive identity-related actions in Entra ID.
#### Possible Investigation Steps
- Identify the Actor: Review the `azure.auditlogs.properties.initiated_by.user.user_principal_name` and `azure.auditlogs.properties.initiated_by.user.id` fields to identify the user account performing the action. Determine if this user typically manages service principals.
- Check for Known Admin or Automation Context: Validate if the action was expected (e.g., part of a deployment pipeline or credential rotation process). Investigate whether this is a known administrative account or an automated service principal maintainer.
- Inspect Credential Type: Determine if a certificate or client secret was added, and assess its expiration time, usage scope, and whether it aligns with internal practices.
- Correlate with Other Events: Look for surrounding events such as creation of new service principals, assignment of roles or permissions, or suspicious application sign-ins that could indicate persistence or privilege escalation.
- Analyze Source of Activity: Review `source.ip` and `user_agent.original` fields to assess whether the request came from a trusted network or device. Unexpected geolocations, hosting providers, or Linux CLI-based user agents may indicate unauthorized activity.
### False Positive Analysis
- Routine Administrative Tasks: This alert may trigger when legitimate administrators or DevOps engineers rotate credentials for service principals as part of normal operations.
- First-Time Actions by Known Accounts: If a new user joins the team or an existing user is performing this task for the first time in the observed period, it may be expected behavior. Verify with the relevant team.
### Response and Remediation
- Revoke Unauthorized Credentials: If suspicious, disable or delete the newly added service principal credential immediately.
- Investigate User Account: Review the login history, IP address usage, and other activity from the initiating user to determine whether the account is compromised.
- Audit Affected Service Principal: Evaluate the permissions granted to the service principal to understand the potential impact of misuse.
- Review RBAC and Least Privilege: Ensure that only authorized identities have permission to add credentials to service principals. Tighten IAM role definitions if necessary.
- Enable Just-in-Time or Approval-Based Access: Consider implementing access control policies that require approvals for modifying service principals or adding credentials.
"""
references = [
"https://cloud.google.com/blog/topics/threat-intelligence/remediation-and-hardening-strategies-for-microsoft-365-to-defend-against-unc2452",
"https://dirkjanm.io/azure-ad-privilege-escalation-application-admin/",
"https://www.cisa.gov/news-events/alerts/2025/05/22/advisory-update-cyber-threat-activity-targeting-commvaults-saas-cloud-application-metallic"
]
risk_score = 47
rule_id = "f766ffaf-9568-4909-b734-75d19b35cbf4"
severity = "medium"
tags = [
"Domain: Cloud",
"Data Source: Azure",
"Data Source: Microsoft Entra ID",
"Data Source: Microsoft Entra ID Audit Logs",
"Use Case: Identity and Access Audit",
"Tactic: Persistence",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "new_terms"
query = '''
data_stream.dataset: "azure.auditlogs"
and azure.auditlogs.operation_name:"Add service principal credentials"
and event.outcome: "success"
'''
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1098"
name = "Account Manipulation"
reference = "https://attack.mitre.org/techniques/T1098/"
[[rule.threat.technique.subtechnique]]
id = "T1098.001"
name = "Additional Cloud Credentials"
reference = "https://attack.mitre.org/techniques/T1098/001/"
[rule.threat.tactic]
id = "TA0003"
name = "Persistence"
reference = "https://attack.mitre.org/tactics/TA0003/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1098"
name = "Account Manipulation"
reference = "https://attack.mitre.org/techniques/T1098/"
[[rule.threat.technique.subtechnique]]
id = "T1098.001"
name = "Additional Cloud Credentials"
reference = "https://attack.mitre.org/techniques/T1098/001/"
[rule.threat.tactic]
id = "TA0004"
name = "Privilege Escalation"
reference = "https://attack.mitre.org/tactics/TA0004/"
[rule.new_terms]
field = "new_terms_fields"
value = [
"azure.auditlogs.properties.target_resources.0.display_name",
"azure.auditlogs.properties.initiated_by.user.id",
]
[[rule.new_terms.history_window_start]]
field = "history_window_start"
value = "now-10d"
Stages and Predicates
Stage 1: new_terms
data_stream.dataset: "azure.auditlogs"
and azure.auditlogs.operation_name:"Add service principal credentials"
and event.outcome: "success"
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
azure.auditlogs.operation_name | eq |
| field:"azure_ad::activity_display_name" kind:eq value:"Add service principal credentials" |
data_stream.dataset | eq |
| field:"data_stream.dataset" kind:eq value:"azure.auditlogs" |
event.outcome | eq |
| field:"event.outcome" kind:eq value:"success" |
Ingress Tool Transfer Followed by Execution and Deletion Detected via Defend for Containers
#This rule detects the creation, execution, and deletion of files inside a container, a common technique used by attackers to evade detection.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Execution | |
| Stealth | |
| Command & Control |
Rule Body
[metadata]
creation_date = "2026/03/05"
integration = ["cloud_defend"]
maturity = "production"
min_stack_comments = "Defend for Containers integration was re-introduced in 9.3.0"
min_stack_version = "9.3.0"
updated_date = "2026/03/24"
[rule]
author = ["Elastic"]
description = """
This rule detects the creation, execution, and deletion of files inside a container, a common
technique used by attackers to evade detection.
"""
from = "now-6m"
index = ["logs-cloud_defend.process*", "logs-cloud_defend.file*"]
interval = "5m"
language = "eql"
license = "Elastic License v2"
name = "Ingress Tool Transfer Followed by Execution and Deletion Detected via Defend for Containers"
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 Ingress Tool Transfer Followed by Execution and Deletion Detected via Defend for Containers
This detection flags a rapid sequence inside a container where a file is written to a common transient or user-writable location, executed, then deleted shortly after—an evasion pattern meant to minimize on-disk artifacts and frustrate forensic review. Attackers often use a shell to pull a payload with common transfer utilities into `/tmp` or shared memory, run it immediately for credential theft or lateral movement, and then remove it to blend back into normal container churn.
### Possible investigation steps
- Pivot on the container to review the full process tree and preceding commands around the sequence to determine how the payload was introduced (interactive shell, entrypoint, cron, CI job, or exploited service) and what else executed nearby in time.
- Retrieve the file content if still present or recover it from container runtime logs/snapshots/registry layers, then compute hashes and run static/dynamic analysis to identify malware family, network indicators, and persistence or credential-access behavior.
- Review outbound network connections from the container during the same window to identify download sources, callback infrastructure, and any subsequent lateral movement attempts to internal services.
- Check whether the container or pod is running with elevated privileges (host mounts, privileged mode, sensitive service account tokens, or access to Docker/CRI sockets) to assess host-escape risk and scope potential impact beyond the container.
- Validate legitimacy by correlating with recent deploys/build steps and expected package/install activity, and if suspicious, isolate the workload and rotate any exposed secrets or tokens used by the container.
### False positive analysis
- A container entrypoint or bootstrap script downloads a small helper or configuration artifact into `/tmp` (or similar), executes it via a shell to perform initialization checks or configuration, and then deletes it immediately to keep the runtime filesystem clean.
- A build/test step running inside a container fetches transient binaries or linkable objects (e.g., via `curl`/`wget`/`scp` or `ld`) into writable paths like `/tmp` or `/opt`, executes them as part of compilation or validation, and removes them as part of routine cleanup.
### Response and remediation
- Quarantine the affected pod or container by isolating it from the network and scaling it to zero or killing the container while preserving a copy of the writable layer and runtime logs for forensic analysis.
- Identify and block the download and command-and-control endpoints used by the transfer utility (for example the `curl`/`wget` URL or `scp` destination) at egress controls, then search for the same indicator across other workloads and nodes to find additional compromised containers.
- Eradicate by rebuilding and redeploying the workload from a known-good image and clean source, removing any unauthorized startup scripts or injected binaries in paths like `/tmp`, `/dev/shm`, `/var/tmp`, `/root`, or `/opt`.
- Rotate and revoke any credentials the container could access such as Kubernetes service account tokens, API keys, registry credentials, and mounted secrets, and invalidate sessions if the executed payload could have harvested them.
- Escalate to incident response immediately if the workload was privileged, had hostPath mounts or container runtime socket access, touched `/proc/*/fd/*`, or showed signs of data access or lateral movement to internal services.
- Harden by enforcing least privilege and runtime controls such as read-only root filesystems, no shell or download tools in production images, restricted egress allowlists, and admission policies that block privileged pods and sensitive host mounts.
"""
references = [
"https://flare.io/learn/resources/blog/teampcp-cloud-native-ransomware",
]
risk_score = 73
rule_id = "1dc56174-5d02-4ca4-af92-e391f096fb21"
severity = "high"
tags = [
"Data Source: Elastic Defend for Containers",
"Domain: Container",
"OS: Linux",
"Use Case: Threat Detection",
"Tactic: Defense Evasion",
"Tactic: Execution",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
sequence by container.id, user.id with maxspan=10s
[file where event.action == "creation" and (
process.name in ("curl", "wget", "fetch", "ftp", "sftp", "scp", "rsync", "ld") or
(
process.name in ("bash", "dash", "sh", "tcsh", "csh", "zsh", "ksh", "fish", "busybox") and
process.args in (
"curl", "/bin/curl", "/usr/bin/curl", "/usr/local/bin/curl",
"wget", "/bin/wget", "/usr/bin/wget", "/usr/local/bin/wget",
"fetch", "/bin/fetch", "/usr/bin/fetch", "/usr/local/bin/fetch",
"ftp", "/bin/ftp", "/usr/bin/ftp", "/usr/local/bin/ftp",
"sftp", "/bin/sftp", "/usr/bin/sftp", "/usr/local/bin/sftp",
"scp", "/bin/scp", "/usr/bin/scp", "/usr/local/bin/scp",
"rsync", "/bin/rsync", "/usr/bin/rsync", "/usr/local/bin/rsync",
"ld", "/bin/ld", "/usr/bin/ld", "/usr/local/bin/ld"
) and
/* default exclusion list to not FP on default multi-process commands */
not process.args in (
"which", "/bin/which", "/usr/bin/which", "/usr/local/bin/which",
"man", "/bin/man", "/usr/bin/man", "/usr/local/bin/man",
"chmod", "/bin/chmod", "/usr/bin/chmod", "/usr/local/bin/chmod",
"chown", "/bin/chown", "/usr/bin/chown", "/usr/local/bin/chown"
)
)
) and file.path like (
"/dev/shm/*", "/run/shm/*", "/tmp/*", "/var/tmp/*", "/run/*", "/var/run/*", "/var/www/*",
"/proc/*/fd/*", "/home/*/*", "/root/*", "/opt/*"
)
] by file.name
[process where event.type == "start" and event.action == "exec" and
process.parent.name in ("bash", "dash", "ash", "sh", "tcsh", "csh", "zsh", "ksh", "fish", "busybox")
] by process.name
[file where event.action == "deletion" and file.path like (
"/dev/shm/*", "/run/shm/*", "/tmp/*", "/var/tmp/*", "/run/*", "/var/run/*", "/var/www/*",
"/proc/*/fd/*", "/home/*/*", "/root/*", "/opt/*"
) and not process.name in ("rm", "ld", "conftest", "link", "gcc", "getarch", "ld")
] by file.name
'''
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1070"
name = "Indicator Removal"
reference = "https://attack.mitre.org/techniques/T1070/"
[[rule.threat.technique.subtechnique]]
id = "T1070.004"
name = "File Deletion"
reference = "https://attack.mitre.org/techniques/T1070/004/"
[rule.threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1059"
name = "Command and Scripting Interpreter"
reference = "https://attack.mitre.org/techniques/T1059/"
[[rule.threat.technique.subtechnique]]
id = "T1059.004"
name = "Unix Shell"
reference = "https://attack.mitre.org/techniques/T1059/004/"
[[rule.threat.technique]]
id = "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 = "T1105"
name = "Ingress Tool Transfer"
reference = "https://attack.mitre.org/techniques/T1105/"
[rule.threat.tactic]
id = "TA0011"
name = "Command and Control"
reference = "https://attack.mitre.org/tactics/TA0011/"
Stages and Predicates
Ordered sequence: each step below must occur in order within 10s, correlated by container.id, file.name, process.name, user.id.
Stage 1: file
[file where event.action == "creation" and (
process.name in ("curl", "wget", "fetch", "ftp", "sftp", "scp", "rsync", "ld") or
(
process.name in ("bash", "dash", "sh", "tcsh", "csh", "zsh", "ksh", "fish", "busybox") and
process.args in (
"curl", "/bin/curl", "/usr/bin/curl", "/usr/local/bin/curl",
"wget", "/bin/wget", "/usr/bin/wget", "/usr/local/bin/wget",
"fetch", "/bin/fetch", "/usr/bin/fetch", "/usr/local/bin/fetch",
"ftp", "/bin/ftp", "/usr/bin/ftp", "/usr/local/bin/ftp",
"sftp", "/bin/sftp", "/usr/bin/sftp", "/usr/local/bin/sftp",
"scp", "/bin/scp", "/usr/bin/scp", "/usr/local/bin/scp",
"rsync", "/bin/rsync", "/usr/bin/rsync", "/usr/local/bin/rsync",
"ld", "/bin/ld", "/usr/bin/ld", "/usr/local/bin/ld"
) and
not process.args in (
"which", "/bin/which", "/usr/bin/which", "/usr/local/bin/which",
"man", "/bin/man", "/usr/bin/man", "/usr/local/bin/man",
"chmod", "/bin/chmod", "/usr/bin/chmod", "/usr/local/bin/chmod",
"chown", "/bin/chown", "/usr/bin/chown", "/usr/local/bin/chown"
)
)
) and file.path like (
"/dev/shm/*", "/run/shm/*", "/tmp/*", "/var/tmp/*", "/run/*", "/var/run/*", "/var/www/*",
"/proc/*/fd/*", "/home/*/*", "/root/*", "/opt/*"
)
] by file.name
Stage 2: process
[process where event.type == "start" and event.action == "exec" and
process.parent.name in ("bash", "dash", "ash", "sh", "tcsh", "csh", "zsh", "ksh", "fish", "busybox")
] by process.name
Stage 3: file
[file where event.action == "deletion" and file.path like (
"/dev/shm/*", "/run/shm/*", "/tmp/*", "/var/tmp/*", "/run/*", "/var/run/*", "/var/www/*",
"/proc/*/fd/*", "/home/*/*", "/root/*", "/opt/*"
) and not process.name in ("rm", "ld", "conftest", "link", "gcc", "getarch", "ld")
] by file.name
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | eq |
| field:"EventType" kind:eq |
event.type | eq |
| field:"event.type" kind:eq value:"start" |
file.path | wildcard |
| field:"TargetFilename" kind:wildcard |
process.args | in |
| field:"process.args" kind:in |
process.name | in |
| field:"process_basename" kind:in |
process.parent.name | in |
| field:"parent_process_basename" kind:in |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.name | in | conftest, gcc, getarch, ld, link, rm | excludes:process.name |
Keychain Dump via Native Security Tool
#Detects the dumping of the Apple keychain using the native "security" binary by a suspicious parent process. Dumping the keychain file using these binaries should not be commonplace and should be considered highly abnormal, possibly indicating malicious activity. The Apple keychain contains sensitive and valuable data an attacker could utilize to escalate privileges, move laterally and further compromise a system or account.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Credential Access |
Telemetry Coverage
Rule Body
[rule]
description = """
Detects the dumping of the Apple keychain using the native "security" binary by a suspicious parent process. Dumping the
keychain file using these binaries should not be commonplace and should be considered highly abnormal, possibly
indicating malicious activity. The Apple keychain contains sensitive and valuable data an attacker could utilize to
escalate privileges, move laterally and further compromise a system or account.
"""
id = "549344d6-aaef-4495-9ca2-7a0b849bf571"
license = "Elastic License v2"
name = "Keychain Dump via Native Security Tool"
os_list = ["macos"]
reference = ["https://github.com/its-a-feature/LockSmith"]
version = "1.0.26"
query = '''
process where event.action == "exec" and process.name == "security" and
((process.args like~ "dump-keychain" and process.args == "-d") or (process.args like~ "dump")) and
process.Ext.effective_parent.executable != null and
not process.Ext.effective_parent.executable like ("/Library/Application Support/JAMF/Jamf.app/Contents/MacOS/JamfDaemon.app/Contents/MacOS/JamfDaemon",
"/usr/local/jamf/bin/jamf",
"/Library/Application Support/JAMF/Jamf.app/Contents/MacOS/JamfManagementService.app/Contents/MacOS/JamfManagementService",
"/Library/Application Support/DARE/Bin/dareupdate",
"/usr/libexec/xpcproxy",
"/Library/Application Support/DARE/Zappl/Bin/zappl")
'''
min_endpoint_version = "8.10.2"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
[[actions]]
action = "kill_process"
field = "process.parent.entity_id"
state = 0
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1555"
name = "Credentials from Password Stores"
reference = "https://attack.mitre.org/techniques/T1555/"
[[threat.technique.subtechnique]]
id = "T1555.001"
name = "Keychain"
reference = "https://attack.mitre.org/techniques/T1555/001/"
[threat.tactic]
id = "TA0006"
name = "Credential Access"
reference = "https://attack.mitre.org/tactics/TA0006/"
[internal]
min_endpoint_version = "8.10.2"
Stages and Predicates
Stage 1: process
process where event.action == "exec" and process.name == "security" and
((process.args like~ "dump-keychain" and process.args == "-d") or (process.args like~ "dump")) and
process.Ext.effective_parent.executable != null and
not process.Ext.effective_parent.executable like ("/Library/Application Support/JAMF/Jamf.app/Contents/MacOS/JamfDaemon.app/Contents/MacOS/JamfDaemon",
"/usr/local/jamf/bin/jamf",
"/Library/Application Support/JAMF/Jamf.app/Contents/MacOS/JamfManagementService.app/Contents/MacOS/JamfManagementService",
"/Library/Application Support/DARE/Bin/dareupdate",
"/usr/libexec/xpcproxy",
"/Library/Application Support/DARE/Zappl/Bin/zappl")
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | eq |
| field:"EventType" kind:eq value:"exec" |
process.Ext.effective_parent.executable | is_not_null | field:"process.Ext.effective_parent.executable" kind:is_not_null | |
process.args | eq |
| field:"process.args" kind:eq value:"-d" |
process.args | wildcard |
| field:"process.args" kind:wildcard |
process.name | eq |
| field:"process_basename" kind:eq value:"security" |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.Ext.effective_parent.executable | eq | /Library/Application Support/JAMF/Jamf.app/Contents/MacOS/JamfDaemon.app/Contents/MacOS/JamfDaemon, /usr/local/jamf/bin/jamf, /Library/Application Support/JAMF/Jamf.app/Contents/MacOS/JamfManagementService.app/Contents/MacOS/JamfManagementService, /Library/Application Support/DARE/Bin/dareupdate, /usr/libexec/xpcproxy, /Library/Application Support/DARE/Zappl/Bin/zappl | excludes:process.Ext.effective_parent.executable |
MsiExec Service Child Process With Network Connection
#Identifies the execution of an MsiExec service child process followed by network or dns lookup activity. Adversaries may abuse Windows Installers for initial access and delivery of malware.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Stealth |
Telemetry Coverage
Rule Body
[metadata]
creation_date = "2024/09/09"
integration = ["endpoint", "windows", "sentinel_one_cloud_funnel"]
maturity = "production"
updated_date = "2026/05/04"
[rule]
author = ["Elastic"]
description = """
Identifies the execution of an MsiExec service child process followed by network or dns lookup activity. Adversaries may
abuse Windows Installers for initial access and delivery of malware.
"""
from = "now-9m"
index = [
"logs-endpoint.events.process-*",
"logs-endpoint.events.network-*",
"logs-windows.sysmon_operational-*",
"logs-sentinel_one_cloud_funnel.*",
]
language = "eql"
license = "Elastic License v2"
name = "MsiExec Service Child Process With Network Connection"
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 MsiExec Service Child Process With Network Connection
MsiExec is a Windows utility for installing, maintaining, and removing software. Adversaries exploit it to execute malicious payloads by disguising them as legitimate installations. The detection rule identifies suspicious child processes spawned by MsiExec that initiate network activity, which is atypical for standard installations. By focusing on unusual executable paths and network connections, the rule helps uncover potential misuse indicative of malware delivery or initial access attempts.
### Possible investigation steps
- Review the process tree to identify the parent and child processes of the suspicious MsiExec activity, focusing on the process.entity_id and process.parent.name fields to understand the execution flow.
- Examine the process.executable path to determine if it deviates from typical installation paths, as specified in the query, to assess the likelihood of malicious activity.
- Analyze the network or DNS activity associated with the process by reviewing the event.category field for network or dns events, and correlate these with the process.name to identify any unusual or unauthorized connections.
- Check the process.args for any unusual or suspicious command-line arguments that might indicate an attempt to execute malicious payloads or scripts.
- Investigate the host's recent activity and security logs to identify any other indicators of compromise or related suspicious behavior, leveraging data sources like Elastic Defend, Sysmon, or SentinelOne as mentioned in the rule's tags.
- Assess the risk and impact of the detected activity by considering the context of the alert, such as the host's role in the network and any potential data exposure or system compromise.
### False positive analysis
- Legitimate software installations or updates may trigger the rule if they involve network activity. Users can create exceptions for known software update processes that are verified as safe.
- Custom enterprise applications that use MsiExec for deployment and require network access might be flagged. Identify these applications and exclude their specific executable paths from the rule.
- Automated deployment tools that utilize MsiExec and perform network operations could be misidentified. Review these tools and whitelist their processes to prevent false alerts.
- Security software or system management tools that leverage MsiExec for legitimate purposes may cause false positives. Confirm these tools' activities and add them to an exclusion list if necessary.
- Regularly review and update the exclusion list to ensure it reflects the current environment and any new legitimate software that may interact with MsiExec.
### Response and remediation
- Isolate the affected system from the network immediately to prevent further malicious activity and lateral movement.
- Terminate the suspicious child process spawned by MsiExec to halt any ongoing malicious operations.
- Conduct a thorough scan of the affected system using updated antivirus or endpoint detection and response (EDR) tools to identify and remove any malicious payloads or remnants.
- Review and analyze the process execution and network activity logs to identify any additional indicators of compromise (IOCs) and assess the scope of the intrusion.
- Reset credentials and review access permissions for any accounts that may have been compromised or used during the attack.
- 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 detection rules to identify similar threats in the future, focusing on unusual MsiExec activity and network connections."""
risk_score = 47
rule_id = "65432f4a-e716-4cc1-ab11-931c4966da2d"
severity = "medium"
tags = [
"Domain: Endpoint",
"OS: Windows",
"Use Case: Threat Detection",
"Tactic: Defense Evasion",
"Data Source: Elastic Defend",
"Data Source: Sysmon",
"Data Source: SentinelOne",
"Resources: Investigation Guide",
]
type = "eql"
query = '''
sequence by process.entity_id with maxspan=1m
[process where host.os.type == "windows" and event.type : "start" and
process.parent.name : "msiexec.exe" and process.parent.args : "/v" and
not process.executable :
("?:\\Windows\\System32\\msiexec.exe",
"?:\\Windows\\sysWOW64\\msiexec.exe",
"?:\\Windows\\system32\\srtasks.exe",
"?:\\Windows\\syswow64\\srtasks.exe",
"?:\\Windows\\sys*\\taskkill.exe",
"?:\\Program Files\\*.exe",
"?:\\Program Files (x86)\\*.exe",
"?:\\Windows\\Installer\\MSI*.tmp",
"?:\\Windows\\Microsoft.NET\\Framework*\\RegSvcs.exe",
"C:\\Windows\\System32\\regsvr32.exe",
"C:\\Windows\\Sys?????\\certutil.exe",
"C:\\Windows\\System32\\WerFault.exe",
"C:\\Windows\\System32\\wevtutil.exe",
"C:\\Windows\\SysWOW64\\WindowsPowerShell\\v1.0\\powershell.exe") and
not (process.name : ("rundll32.exe", "regsvr32.exe", "powershell.exe", "regasm.exe", "wscript.exe") and process.args : ("?:\\Program Files\\*", "?:\\Program Files (x86)\\*")) and
not (?process.code_signature.subject_name : ("Bruno Software Inc", "Proton AG", "Axis Communications AB", "Citrix Systems, Inc.", "NSUS Limited", "Action1 Corporation", "Solarwinds Worldwide, LLC") and
?process.code_signature.trusted == true) and
not (?process.pe.original_file_name in ("dxsetup.exe", "MofCompiler.exe", "ShellApp.exe") and
?process.code_signature.subject_name : "Microsoft Corporation" and ?process.code_signature.trusted == true) and
not ?process.hash.sha256 in ("cfaef8c711db04d6c4a4381c66ac21b9e234e57febedb77fedc9316898b214bc",
"2f26f37cce780ca76f0dbac0de233f4c8d84c31b3f37380b9d5faacc3ee2d03e",
"7d9c691bfbf3beb78919dfd940fa6d325c3437425d5b0371df39aef6accf858d")
]
[network where host.os.type == "windows" and process.name != null and
not dns.question.name : ("core.bdec.microsoft.com", "go.microsoft.com", "ocsp.digicert.com", "localhost", "www.google-analytics.com",
"ocsp.verisign.com", "*.symcb.com")]
'''
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:
- [SentinelOne Cloud Funnel](https://ela.st/sentinel-one-cloud-funnel)
- [Sysmon Event ID 1 - Process Creation](https://ela.st/sysmon-event-1-setup)
- [Sysmon Event ID 3 - Network Connection](https://ela.st/sysmon-event-3-setup)
"""
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1218"
name = "System Binary Proxy Execution"
reference = "https://attack.mitre.org/techniques/T1218/"
[[rule.threat.technique.subtechnique]]
id = "T1218.007"
name = "Msiexec"
reference = "https://attack.mitre.org/techniques/T1218/007/"
[rule.threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
Stages and Predicates
Ordered sequence: each step below must occur in order within 1m, correlated by process.entity_id.
Stage 1: process
[process where host.os.type == "windows" and event.type : "start" and
process.parent.name : "msiexec.exe" and process.parent.args : "/v" and
not process.executable :
("?:\\Windows\\System32\\msiexec.exe",
"?:\\Windows\\sysWOW64\\msiexec.exe",
"?:\\Windows\\system32\\srtasks.exe",
"?:\\Windows\\syswow64\\srtasks.exe",
"?:\\Windows\\sys*\\taskkill.exe",
"?:\\Program Files\\*.exe",
"?:\\Program Files (x86)\\*.exe",
"?:\\Windows\\Installer\\MSI*.tmp",
"?:\\Windows\\Microsoft.NET\\Framework*\\RegSvcs.exe",
"C:\\Windows\\System32\\regsvr32.exe",
"C:\\Windows\\Sys?????\\certutil.exe",
"C:\\Windows\\System32\\WerFault.exe",
"C:\\Windows\\System32\\wevtutil.exe",
"C:\\Windows\\SysWOW64\\WindowsPowerShell\\v1.0\\powershell.exe") and
not (process.name : ("rundll32.exe", "regsvr32.exe", "powershell.exe", "regasm.exe", "wscript.exe") and process.args : ("?:\\Program Files\\*", "?:\\Program Files (x86)\\*")) and
not (?process.code_signature.subject_name : ("Bruno Software Inc", "Proton AG", "Axis Communications AB", "Citrix Systems, Inc.", "NSUS Limited", "Action1 Corporation", "Solarwinds Worldwide, LLC") and
?process.code_signature.trusted == true) and
not (?process.pe.original_file_name in ("dxsetup.exe", "MofCompiler.exe", "ShellApp.exe") and
?process.code_signature.subject_name : "Microsoft Corporation" and ?process.code_signature.trusted == true) and
not ?process.hash.sha256 in ("cfaef8c711db04d6c4a4381c66ac21b9e234e57febedb77fedc9316898b214bc",
"2f26f37cce780ca76f0dbac0de233f4c8d84c31b3f37380b9d5faacc3ee2d03e",
"7d9c691bfbf3beb78919dfd940fa6d325c3437425d5b0371df39aef6accf858d")
]
Stage 2: network
[network where host.os.type == "windows" and process.name != null and
not dns.question.name : ("core.bdec.microsoft.com", "go.microsoft.com", "ocsp.digicert.com", "localhost", "www.google-analytics.com",
"ocsp.verisign.com", "*.symcb.com")]
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.type | wildcard |
| field:"event.type" kind:wildcard value:"start" |
process.name | is_not_null | field:"process_basename" kind:is_not_null | |
process.parent.args | wildcard |
| field:"process.parent.args" kind:wildcard value:"/v" |
process.parent.name | wildcard |
| field:"parent_process_basename" kind:wildcard value:"msiexec.exe" |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.args | starts_with | ?:\Program Files\, ?:\Program Files (x86)\ | excludes:process.args field:"process.args" value:"?:\Program Files\" field:"process.args" value:"?:\Program Files (x86)\" |
process.name | eq | rundll32.exe, regsvr32.exe, powershell.exe, regasm.exe, wscript.exe | excludes:process.name |
process.code_signature.subject_name | eq | Bruno Software Inc, Proton AG, Axis Communications AB, Citrix Systems, Inc., NSUS Limited, Action1 Corporation, Solarwinds Worldwide, LLC | 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.code_signature.subject_name | eq | Microsoft Corporation | excludes:process.code_signature.subject_name field:"process.code_signature.subject_name" value:"Microsoft Corporation" |
process.pe.original_file_name | in | MofCompiler.exe, ShellApp.exe, dxsetup.exe | excludes:process.pe.original_file_name field:"process.pe.original_file_name" value:"MofCompiler.exe" field:"process.pe.original_file_name" value:"ShellApp.exe" field:"process.pe.original_file_name" value:"dxsetup.exe" |
process.executable | wildcard | ?:\Windows\System32\msiexec.exe, ?:\Windows\sysWOW64\msiexec.exe, ?:\Windows\system32\srtasks.exe, ?:\Windows\syswow64\srtasks.exe, ?:\Windows\sys*\taskkill.exe, ?:\Program Files\*.exe, ?:\Program Files (x86)\*.exe, ?:\Windows\Installer\MSI*.tmp, ?:\Windows\Microsoft.NET\Framework*\RegSvcs.exe, C:\Windows\System32\regsvr32.exe, C:\Windows\Sys?????\certutil.exe, C:\Windows\System32\WerFault.exe, C:\Windows\System32\wevtutil.exe, C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe | excludes:process.executable |
process.hash.sha256 | in | 2f26f37cce780ca76f0dbac0de233f4c8d84c31b3f37380b9d5faacc3ee2d03e, 7d9c691bfbf3beb78919dfd940fa6d325c3437425d5b0371df39aef6accf858d, cfaef8c711db04d6c4a4381c66ac21b9e234e57febedb77fedc9316898b214bc | excludes:process.hash.sha256 field:"process.hash.sha256" value:"2f26f37cce780ca76f0dbac0de233f4c8d84c31b3f37380b9d5faacc3ee2d03e" field:"process.hash.sha256" value:"7d9c691bfbf3beb78919dfd940fa6d325c3437425d5b0371df39aef6accf858d" field:"process.hash.sha256" value:"cfaef8c711db04d6c4a4381c66ac21b9e234e57febedb77fedc9316898b214bc" |
dns.question.name | wildcard | core.bdec.microsoft.com, go.microsoft.com, ocsp.digicert.com, localhost, www.google-analytics.com, ocsp.verisign.com, *.symcb.com | excludes:dns.question.name |
Potential Command and Control via Internet Explorer
#Identifies instances of Internet Explorer (iexplore.exe) being started via the Component Object Model (COM) making unusual network connections. Adversaries could abuse Internet Explorer via COM to avoid suspicious processes making network connections and bypass host-based firewall restrictions.
Known False Positives
- Processes such as MS Office using IEproxy to render HTML content.
MITRE ATT&CK Coverage
Telemetry Coverage
Rule Body
[metadata]
creation_date = "2020/11/28"
integration = ["endpoint"]
maturity = "production"
updated_date = "2026/05/04"
[rule]
author = ["Elastic"]
description = """
Identifies instances of Internet Explorer (iexplore.exe) being started via the Component Object Model (COM) making
unusual network connections. Adversaries could abuse Internet Explorer via COM to avoid suspicious processes making
network connections and bypass host-based firewall restrictions.
"""
false_positives = ["Processes such as MS Office using IEproxy to render HTML content."]
from = "now-9m"
index = ["logs-endpoint.events.library-*", "logs-endpoint.events.process-*", "logs-endpoint.events.network-*"]
language = "eql"
license = "Elastic License v2"
name = "Potential Command and Control via Internet Explorer"
risk_score = 47
rule_id = "acd611f3-2b93-47b3-a0a3-7723bcc46f6d"
severity = "medium"
tags = [
"Domain: Endpoint",
"OS: Windows",
"Use Case: Threat Detection",
"Tactic: Command and Control",
"Data Source: Elastic Defend",
"Resources: Investigation Guide",
]
type = "eql"
query = '''
sequence by host.id, user.name with maxspan = 5s
[library where host.os.type == "windows" and dll.name : "IEProxy.dll" and process.name : ("rundll32.exe", "regsvr32.exe")]
[process where host.os.type == "windows" and event.type == "start" and process.parent.name : "iexplore.exe" and process.parent.args : "-Embedding"]
/* IE started via COM in normal conditions makes few connections, mainly to Microsoft and OCSP related domains, add FPs here */
[network where host.os.type == "windows" and network.protocol == "dns" and process.name : "iexplore.exe" and
not dns.question.name :
(
"*.microsoft.com",
"*.digicert.com",
"*.msocsp.com",
"*.windowsupdate.com",
"*.bing.com",
"*.identrust.com",
"*.sharepoint.com",
"*.office365.com",
"*.office.com"
)
] /* with runs=5 */
'''
setup = """## Setup
This rule is designed for data generated by [Elastic Defend](https://www.elastic.co/security/endpoint-security), which provides native endpoint detection and response, along with event enrichments designed to work with our detection rules.
Setup instructions: https://ela.st/install-elastic-defend
"""
note = """## Triage and analysis
> **Disclaimer**:
> This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.
### Investigating Potential Command and Control via Internet Explorer
Internet Explorer can be manipulated via the Component Object Model (COM) to initiate network connections, potentially bypassing security measures. Adversaries exploit this by embedding IE in processes like rundll32.exe, making it appear benign. The detection rule identifies unusual DNS queries from IE, excluding common Microsoft domains, to flag suspicious activity indicative of command and control attempts.
### Possible investigation steps
- Review the alert details to identify the specific host and user associated with the suspicious activity, focusing on the host.id and user.name fields.
- Examine the process tree on the affected host to confirm if Internet Explorer (iexplore.exe) was indeed started via COM, specifically looking for the parent process rundll32.exe or regsvr32.exe with IEProxy.dll loaded.
- Analyze the DNS queries made by Internet Explorer to identify any unusual or suspicious domains that are not part of the common Microsoft or OCSP-related domains listed in the exclusion list.
- Check the network connections initiated by Internet Explorer to determine if there are any unexpected or unauthorized external IP addresses or domains being contacted.
- Investigate the context and timing of the alert by correlating it with other security events or logs from the same host or user to identify any patterns or additional indicators of compromise.
- Assess the risk and potential impact of the detected activity by considering the severity of the alert and any additional findings from the investigation steps above.
### False positive analysis
- Internet Explorer may make legitimate DNS queries to domains not listed in the exclusion list, such as those related to third-party services or internal company resources. Users should monitor and identify these domains and consider adding them to the exclusion list if they are verified as non-threatening.
- Some enterprise environments may use custom applications that leverage Internet Explorer via COM for legitimate purposes. In such cases, users should identify these applications and create exceptions for their associated processes to prevent false positives.
- Regular updates or patches from non-Microsoft sources might trigger alerts if they use Internet Explorer for network connections. Users should verify the legitimacy of these updates and adjust the exclusion list accordingly.
- Internal network monitoring tools or scripts that use Internet Explorer for testing or monitoring purposes could be flagged. Users should document these tools and exclude their associated network activities from the detection rule.
- If a specific user or department frequently triggers alerts due to legitimate use of Internet Explorer, consider creating user or department-specific exceptions to reduce noise while maintaining security oversight.
### Response and remediation
- Isolate the affected host from the network immediately to prevent further command and control communication and potential data exfiltration.
- Terminate the Internet Explorer process (iexplore.exe) and any associated processes like rundll32.exe or regsvr32.exe that are identified as suspicious.
- Conduct a thorough scan of the isolated host using updated antivirus and anti-malware tools to identify and remove any malicious software or scripts.
- Review and analyze the DNS query logs to identify any other potentially compromised hosts within the network that may have communicated with the same suspicious domains.
- Restore the affected system from a known good backup if malware is confirmed and cannot be fully removed, ensuring that the backup is free from compromise.
- Implement network-level controls to block the identified suspicious domains and IP addresses to prevent future communication attempts.
- Escalate the incident to the security operations center (SOC) or incident response team for further investigation and to determine if additional systems are affected."""
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1071"
name = "Application Layer Protocol"
reference = "https://attack.mitre.org/techniques/T1071/"
[[rule.threat.technique.subtechnique]]
id = "T1071.004"
name = "DNS"
reference = "https://attack.mitre.org/techniques/T1071/004/"
[rule.threat.tactic]
id = "TA0011"
name = "Command and Control"
reference = "https://attack.mitre.org/tactics/TA0011/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1559"
name = "Inter-Process Communication"
reference = "https://attack.mitre.org/techniques/T1559/"
[[rule.threat.technique.subtechnique]]
id = "T1559.001"
name = "Component Object Model"
reference = "https://attack.mitre.org/techniques/T1559/001/"
[rule.threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
[[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.010"
name = "Regsvr32"
reference = "https://attack.mitre.org/techniques/T1218/010/"
[[rule.threat.technique.subtechnique]]
id = "T1218.011"
name = "Rundll32"
reference = "https://attack.mitre.org/techniques/T1218/011/"
[rule.threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
Stages and Predicates
Ordered sequence: each step below must occur in order within 5s, correlated by host.id, user.name.
Stage 1: library
[library where host.os.type == "windows" and dll.name : "IEProxy.dll" and process.name : ("rundll32.exe", "regsvr32.exe")]
Stage 2: process
[process where host.os.type == "windows" and event.type == "start" and process.parent.name : "iexplore.exe" and process.parent.args : "-Embedding"]
Stage 3: network
[network where host.os.type == "windows" and network.protocol == "dns" and process.name : "iexplore.exe" and
not dns.question.name :
(
"*.microsoft.com",
"*.digicert.com",
"*.msocsp.com",
"*.windowsupdate.com",
"*.bing.com",
"*.identrust.com",
"*.sharepoint.com",
"*.office365.com",
"*.office.com"
)
]
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
dll.name | wildcard |
| field:"dll.name" kind:wildcard value:"IEProxy.dll" |
event.type | eq |
| field:"event.type" kind:eq value:"start" |
network.protocol | eq |
| field:"DestinationPortName" kind:eq value:"dns" |
process.name | wildcard |
| field:"process_basename" kind:wildcard |
process.parent.args | wildcard |
| field:"process.parent.args" kind:wildcard value:"-Embedding" |
process.parent.name | wildcard |
| field:"parent_process_basename" kind:wildcard value:"iexplore.exe" |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
dns.question.name | ends_with | .microsoft.com, .digicert.com, .msocsp.com, .windowsupdate.com, .bing.com, .identrust.com, .sharepoint.com, .office365.com, .office.com | excludes:dns.question.name |
Potential Execution via Archive Exploit
#Identifies when common third party decompression utilities are creating a file in the user Startup folder. This may indicate the successful exploitation of a path traversal vulnerability to enable unauthorized execution at the next user logon.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Initial Access | |
| Execution |
Rule Body
[rule]
description = """
Identifies when common third party decompression utilities are creating a file in the user Startup folder. This may
indicate the successful exploitation of a path traversal vulnerability to enable unauthorized execution at the next user
logon.
"""
id = "a8e974cd-e811-4321-bf89-e22d0252c8c3"
license = "Elastic License v2"
name = "Potential Execution via Archive Exploit"
os_list = ["windows"]
reference = [
"https://www.welivesecurity.com/en/eset-research/update-winrar-tools-now-romcom-and-others-exploiting-zero-day-vulnerability/",
"https://nvd.nist.gov/vuln/detail/CVE-2025-6218",
"https://www.zerodayinitiative.com/advisories/ZDI-25-409/",
]
version = "1.0.3"
query = '''
file where event.action in ("creation", "overwrite", "rename", "modification") and
process.name : ("WinRAR.exe", "Bandizip.exe", "7zFM.exe", "7zG.exe") and
file.path : "?:\\Users\\*\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs\\Startup\\*" and
not file.name : "desktop.ini"
'''
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 = "T1566"
name = "Phishing"
reference = "https://attack.mitre.org/techniques/T1566/"
[[threat.technique.subtechnique]]
id = "T1566.001"
name = "Spearphishing Attachment"
reference = "https://attack.mitre.org/techniques/T1566/001/"
[threat.tactic]
id = "TA0001"
name = "Initial Access"
reference = "https://attack.mitre.org/tactics/TA0001/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1203"
name = "Exploitation for Client Execution"
reference = "https://attack.mitre.org/techniques/T1203/"
[threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
[internal]
min_endpoint_version = "7.15.0"
Stages and Predicates
Stage 1: file
file where event.action in ("creation", "overwrite", "rename", "modification") and
process.name : ("WinRAR.exe", "Bandizip.exe", "7zFM.exe", "7zG.exe") and
file.path : "?:\\Users\\*\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs\\Startup\\*" and
not file.name : "desktop.ini"
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | in |
| field:"EventType" kind:in |
file.path | wildcard |
| field:"TargetFilename" kind:wildcard value:"?:\Users\*\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\*" |
process.name | wildcard |
| field:"process_basename" kind:wildcard |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
file.name | eq | desktop.ini | excludes:file.name field:"file.name" value:"desktop.ini" |
Potential Impersonation Attempt via Kubectl
#This rule detects potential impersonation attempts via the "kubectl" command in Linux and macOS environments. It identifies process events where "kubectl" is executed with arguments that suggest an attempt to impersonate another user or group, such as using "--kubeconfig", "--token", "--as", or "--as-group". This could indicate an adversary trying to gain unauthorized access or escalate privileges within a Kubernetes cluster. If this rule is triggered, in conjunction with rules related to secret access or kubeconfig file discovery, it may indicate a potential impersonation attempt.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Privilege Escalation | |
| Stealth | |
| Credential Access | |
| Lateral Movement |
Telemetry Coverage
Rule Body
[metadata]
creation_date = "2025/06/19"
integration = ["endpoint", "auditd_manager", "sentinel_one_cloud_funnel", "cloud_defend"]
maturity = "production"
min_stack_comments = "Defend for Containers integration was re-introduced in 9.3.0"
min_stack_version = "9.3.0"
updated_date = "2026/03/30"
[rule]
author = ["Elastic"]
description = """
This rule detects potential impersonation attempts via the "kubectl" command in Linux and macOS environments. It identifies
process events where "kubectl" is executed with arguments that suggest an attempt to impersonate another user or
group, such as using "--kubeconfig", "--token", "--as", or "--as-group". This could indicate an adversary trying
to gain unauthorized access or escalate privileges within a Kubernetes cluster. If this rule is triggered, in
conjunction with rules related to secret access or kubeconfig file discovery, it may indicate a potential
impersonation attempt.
"""
from = "now-9m"
index = [
"auditbeat-*",
"endgame-*",
"logs-auditd_manager.auditd-*",
"logs-endpoint.events.process*",
"logs-sentinel_one_cloud_funnel.*",
"logs-cloud_defend.process*",
]
language = "eql"
license = "Elastic License v2"
name = "Potential Impersonation Attempt via Kubectl"
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 Impersonation Attempt via Kubectl
Kubectl is a command-line tool for interacting with Kubernetes clusters, allowing users to manage applications and resources. Adversaries may exploit kubectl by using specific arguments to impersonate users, gaining unauthorized access or escalating privileges. The detection rule identifies suspicious kubectl executions, focusing on arguments that suggest impersonation, such as those related to user identity and authentication, to flag potential misuse.
### Possible investigation steps
- Review the process arguments to confirm the presence of impersonation-related flags such as "--kubeconfig", "--token", "--as", "--as-group", or "--as-uid" to understand the scope of the impersonation attempt.
- Examine the parent process name and executable path to determine if the kubectl command was initiated from a suspicious location or script, such as "/tmp/*", "/var/tmp/*", "/dev/shm/*", "/root/*", "/home/*", or "/Users/*".
- Check the user account associated with the kubectl execution to assess whether it aligns with expected usage patterns or if it indicates potential unauthorized access.
- Investigate related alerts or logs for secret access or kubeconfig file discovery to identify if there is a broader pattern of suspicious activity that could indicate a coordinated impersonation attempt.
- Analyze the network activity associated with the kubectl execution to identify any unusual connections or data transfers that may suggest unauthorized access or data exfiltration.
### False positive analysis
- Legitimate administrative tasks: System administrators may use kubectl with impersonation arguments for legitimate purposes such as testing permissions or managing resources on behalf of other users. To handle this, create exceptions for known administrative accounts or specific IP addresses.
- Automation scripts: Automated scripts or CI/CD pipelines might use impersonation arguments to perform tasks across different environments. Review and whitelist these scripts by identifying their unique execution patterns or specific user accounts.
- Development and testing environments: Developers might use impersonation features in non-production environments for testing purposes. Exclude these environments by filtering based on environment-specific identifiers or network segments.
- Security tools: Some security tools or monitoring solutions may use impersonation arguments to audit or verify access controls. Identify these tools and exclude their processes by recognizing their signatures or execution paths.
- Frequent legitimate use cases: If certain teams or departments regularly use impersonation for valid reasons, consider creating role-based exceptions to reduce noise while maintaining security oversight.
### Response and remediation
- Immediately isolate the affected Kubernetes node or cluster to prevent further unauthorized access or privilege escalation.
- Revoke any potentially compromised credentials, such as tokens or kubeconfig files, and issue new ones with updated security policies.
- Review and audit the Kubernetes RBAC (Role-Based Access Control) settings to ensure that only authorized users have the necessary permissions, and adjust roles and permissions as needed to minimize privilege escalation risks.
- Conduct a thorough investigation of the affected systems to identify any unauthorized changes or deployments made by the adversary, and roll back any malicious or suspicious configurations.
- Monitor for any further suspicious kubectl activity, especially those involving impersonation arguments, and set up alerts for any similar future attempts.
- Escalate the incident to the security operations team for a comprehensive review and to determine if additional security measures or incident response actions are required.
- Implement additional logging and monitoring for kubectl commands and Kubernetes API interactions to enhance detection capabilities for similar threats in the future.
"""
risk_score = 47
rule_id = "3c6685eb-9eaa-43a4-be1b-a7f9f1f5e63d"
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 or macOS system:
- Go to the Kibana home page and click "Add integrations".
- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.
- Click "Add Elastic Defend".
- Configure the integration name and optionally add a description.
- Select the type of environment you want to protect, either "Traditional Endpoints" or "Cloud Workloads".
- Select a configuration preset. Each preset comes with different default settings for Elastic Agent, you can further customize these later by configuring the Elastic Defend integration policy. [Helper guide](https://www.elastic.co/guide/en/security/current/configure-endpoint-integration-policy.html).
- We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"
- Enter a name for the agent policy in "New agent policy name". If other agent policies already exist, you can click the "Existing hosts" tab and select an existing policy instead.
For more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/8.10/agent-policy.html).
- Click "Save and Continue".
- To complete the integration, select "Add Elastic Agent to your hosts" and continue to the next section to install the Elastic Agent on your hosts.
For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
"""
severity = "medium"
tags = [
"Domain: Endpoint",
"Domain: Container",
"Domain: Kubernetes",
"OS: Linux",
"OS: macOS",
"Use Case: Threat Detection",
"Tactic: Defense Evasion",
"Tactic: Discovery",
"Data Source: Elastic Endgame",
"Data Source: Elastic Defend",
"Data Source: Auditd Manager",
"Data Source: SentinelOne",
"Data Source: Elastic Defend for Containers",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
process where host.os.type in ("linux", "macos") and event.type == "start" and
event.action in ("exec", "exec_event", "start", "executed", "process_started") and
process.name == "kubectl" and (
process.parent.name in ("bash", "dash", "sh", "tcsh", "csh", "zsh", "ksh", "fish") or
(
process.parent.executable like (
"/tmp/*", "/private/tmp/*", "/var/tmp/*", "/private/var/tmp/*", "/dev/shm/*", "/root/*", "/home/*", "/Users/*"
) or
process.parent.name like (".*", "*.sh", "python*")
)
) and process.args like~ ("--kubeconfig*", "--token*", "--as*", "--as-group*", "--as-uid*") and
not process.parent.args like ("/snap/microk8s/*/apiservice-kicker", "/snap/microk8s/*/microk8s-start.wrapper")
'''
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1078"
name = "Valid Accounts"
reference = "https://attack.mitre.org/techniques/T1078/"
[[rule.threat.technique]]
id = "T1550"
name = "Use Alternate Authentication Material"
reference = "https://attack.mitre.org/techniques/T1550/"
[[rule.threat.technique.subtechnique]]
id = "T1550.001"
name = "Application Access Token"
reference = "https://attack.mitre.org/techniques/T1550/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 = "T1528"
name = "Steal Application Access Token"
reference = "https://attack.mitre.org/techniques/T1528/"
[[rule.threat.technique]]
id = "T1552"
name = "Unsecured Credentials"
reference = "https://attack.mitre.org/techniques/T1552/"
[rule.threat.tactic]
id = "TA0006"
name = "Credential Access"
reference = "https://attack.mitre.org/tactics/TA0006/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1078"
name = "Valid Accounts"
reference = "https://attack.mitre.org/techniques/T1078/"
[rule.threat.tactic]
id = "TA0004"
name = "Privilege Escalation"
reference = "https://attack.mitre.org/tactics/TA0004/"
Stages and Predicates
Stage 1: process
process where host.os.type in ("linux", "macos") and event.type == "start" and
event.action in ("exec", "exec_event", "start", "executed", "process_started") and
process.name == "kubectl" and (
process.parent.name in ("bash", "dash", "sh", "tcsh", "csh", "zsh", "ksh", "fish") or
(
process.parent.executable like (
"/tmp/*", "/private/tmp/*", "/var/tmp/*", "/private/var/tmp/*", "/dev/shm/*", "/root/*", "/home/*", "/Users/*"
) or
process.parent.name like (".*", "*.sh", "python*")
)
) and process.args like~ ("--kubeconfig*", "--token*", "--as*", "--as-group*", "--as-uid*") and
not process.parent.args like ("/snap/microk8s/*/apiservice-kicker", "/snap/microk8s/*/microk8s-start.wrapper")
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 | wildcard |
| field:"process.args" kind:wildcard |
process.name | eq |
| field:"process_basename" kind:eq value:"kubectl" |
process.parent.executable | wildcard |
| field:"ParentImage" kind:wildcard |
process.parent.name | in |
| field:"parent_process_basename" kind:in |
process.parent.name | wildcard |
| field:"parent_process_basename" kind:wildcard |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.parent.args | wildcard | /snap/microk8s/*/apiservice-kicker, /snap/microk8s/*/microk8s-start.wrapper | excludes:process.parent.args field:"process.parent.args" value:"/snap/microk8s/*/apiservice-kicker" field:"process.parent.args" value:"/snap/microk8s/*/microk8s-start.wrapper" |
Potential Masquerading as SVCHOST
#Identifies the creation of a svchost process with an unusual parent. This may indicate an attempt to masquerade a malicious process.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Stealth |
Rule Body
[rule]
description = """
Identifies the creation of a svchost process with an unusual parent. This may indicate an attempt to masquerade a
malicious process.
"""
id = "5b00c9ba-9546-47cc-8f9f-1c1a3e95f65c"
license = "Elastic License v2"
name = "Potential Masquerading as SVCHOST"
os_list = ["windows"]
reference = [
"https://www.elastic.co/security-labs/siestagraph-new-implant-uncovered-in-asean-member-foreign-ministry",
"https://www.elastic.co/security-labs/dissecting-remcos-rat-part-four",
]
version = "1.0.38"
query = '''
process where event.action == "start" and
process.name : "svchost.exe" and
process.parent.executable != null and
not process.parent.executable : (
"?:\\Windows\\System32\\services.exe",
"\\Device\\HarddiskVolume?\\Windows\\System32\\services.exe",
"\\Device\\HarddiskVolume??\\Windows\\System32\\services.exe",
"?:\\ProgramData\\Microsoft\\Windows Defender\\Platform\\*\\MsMpEng.exe",
"?:\\Program Files\\Microsoft Security Client\\MsMpEng.exe",
"?:\\Program Files*\\Windows Defender\\MsMpEng.exe",
"?:\\Windows\\*\\rpcnet*.exe",
"?:\\Windows\\System32\\MRT.exe",
"?:\\Windows\\System32\\MRT-*.exe",
"?:\\Program Files*\\Unity Client\\Unity.exe",
"?:\\Windows\\System32\\wermgr.exe",
"?:\\Windows\\System32\\svchost.exe",
"?:\\WINDOWS\\SysWOW64\\svchost.exe",
"\\Device\\VhdHardDisk*\\Windows\\System32\\services.exe",
"\\Device\\HarddiskVolume*\\Windows\\System32\\services.exe",
"\\Device\\HarddiskVolume*\\ProgramData\\Microsoft\\Windows Defender\\Platform\\*\\MsMpEng.exe",
"\\Device\\HarddiskVolume*\\Program Files\\Microsoft Security Client\\MsMpEng.exe",
"\\Device\\HarddiskVolume*\\Program Files*\\Windows Defender\\MsMpEng.exe",
"\\Device\\HarddiskVolume*\\Windows\\*\\rpcnet*.exe",
"\\Device\\HarddiskVolume*\\Windows\\system32\\MRT.exe",
"\\Device\\HarddiskVolume*\\Program Files*\\Unity Client\\Unity.exe",
"\\Device\\HarddiskVolume*\\Windows\\System32\\wermgr.exe",
"?:\\Program Files\\Microsoft Security Client\\Antimalware\\MsMpEng.exe",
"?:\\Program Files (x86)\\Microsoft Security Client\\Antimalware\\MsMpEng.exe",
"?:\\Program Files\\Cisco\\AMP\\*\\sfc.exe",
"?:\\Program Files (x86)\\Cisco\\AMP\\*\\sfc.exe",
"?:\\Program Files (x86)\\AlibabaProtect\\*\\AlibabaProtect.exe",
"?:\\Program Files\\AlibabaProtect\\*\\AlibabaProtect.exe",
"?:\\Program Files\\Microsoft Security Client\\Antimalware\\MsMpEng.exe",
"?:\\Program Files (x86)\\Tencent\\QQ\\Bin\\QQExternal.exe",
"\\\\?\\Volume{*}\\Windows\\System32\\services.exe",
"\\\\?\\Volume{*}\\ProgramData\\Microsoft\\Windows Defender\\Platform\\*\\MsMpEng.exe",
"\\\\?\\Volume{*}\\Program Files\\Microsoft Security Client\\MsMpEng.exe",
"\\\\?\\Volume{*}\\Program Files*\\Windows Defender\\MsMpEng.exe",
"\\\\?\\Volume{*}\\Windows\\*\\rpcnet*.exe",
"\\\\?\\Volume{*}\\Windows\\system32\\MRT.exe",
"\\\\?\\Volume{*}\\Program Files*\\Unity Client\\Unity.exe",
"\\\\?\\Volume{*}\\Windows\\System32\\wermgr.exe",
"?:\\Program Files (x86)\\Common Files\\One Identity\\Safeguard Privilege Manager for Windows\\Client\\CSEHost.exe") and
not (process.parent.executable : "?:\\Windows\\system32\\svchost.exe" and process.executable : "?:\\Windows\\syswow64\\svchost.exe") and
not (process.parent.executable :
("?:\\Windows\\System32\\svchost.exe",
"?:\\Program Files\\COMODO\\COMODO Internet Security\\cmdvirth.exe",
"?:\\Program Files (x86)\\Adobe\\Acrobat Reader DC\\Reader\\acrocef*\\RdrCEF.exe") and
process.Ext.token.integrity_level_name == "system") and
not (process.pe.original_file_name == "AsDVDLock.exe" and
process.executable : "?:\\Program Files (x86)\\ASUS\\ASUS Manager\\USB Lock\\svchost.exe") and
not (process.parent.executable : "?:\\Windows\\System32\\svchost.exe" and process.executable : "?:\\Windows\\System32\\svchost.exe") and
not (process.code_signature.subject_name : ("SyncFuture Software Company Limited", "Code Systems Corporation") and process.code_signature.trusted == true)
'''
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.subtechnique]]
id = "T1036.004"
name = "Masquerade Task or Service"
reference = "https://attack.mitre.org/techniques/T1036/004/"
[threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
[internal]
min_endpoint_version = "7.15.0"
Stages and Predicates
Stage 1: process
process where event.action == "start" and
process.name : "svchost.exe" and
process.parent.executable != null and
not process.parent.executable : (
"?:\\Windows\\System32\\services.exe",
"\\Device\\HarddiskVolume?\\Windows\\System32\\services.exe",
"\\Device\\HarddiskVolume??\\Windows\\System32\\services.exe",
"?:\\ProgramData\\Microsoft\\Windows Defender\\Platform\\*\\MsMpEng.exe",
"?:\\Program Files\\Microsoft Security Client\\MsMpEng.exe",
"?:\\Program Files*\\Windows Defender\\MsMpEng.exe",
"?:\\Windows\\*\\rpcnet*.exe",
"?:\\Windows\\System32\\MRT.exe",
"?:\\Windows\\System32\\MRT-*.exe",
"?:\\Program Files*\\Unity Client\\Unity.exe",
"?:\\Windows\\System32\\wermgr.exe",
"?:\\Windows\\System32\\svchost.exe",
"?:\\WINDOWS\\SysWOW64\\svchost.exe",
"\\Device\\VhdHardDisk*\\Windows\\System32\\services.exe",
"\\Device\\HarddiskVolume*\\Windows\\System32\\services.exe",
"\\Device\\HarddiskVolume*\\ProgramData\\Microsoft\\Windows Defender\\Platform\\*\\MsMpEng.exe",
"\\Device\\HarddiskVolume*\\Program Files\\Microsoft Security Client\\MsMpEng.exe",
"\\Device\\HarddiskVolume*\\Program Files*\\Windows Defender\\MsMpEng.exe",
"\\Device\\HarddiskVolume*\\Windows\\*\\rpcnet*.exe",
"\\Device\\HarddiskVolume*\\Windows\\system32\\MRT.exe",
"\\Device\\HarddiskVolume*\\Program Files*\\Unity Client\\Unity.exe",
"\\Device\\HarddiskVolume*\\Windows\\System32\\wermgr.exe",
"?:\\Program Files\\Microsoft Security Client\\Antimalware\\MsMpEng.exe",
"?:\\Program Files (x86)\\Microsoft Security Client\\Antimalware\\MsMpEng.exe",
"?:\\Program Files\\Cisco\\AMP\\*\\sfc.exe",
"?:\\Program Files (x86)\\Cisco\\AMP\\*\\sfc.exe",
"?:\\Program Files (x86)\\AlibabaProtect\\*\\AlibabaProtect.exe",
"?:\\Program Files\\AlibabaProtect\\*\\AlibabaProtect.exe",
"?:\\Program Files\\Microsoft Security Client\\Antimalware\\MsMpEng.exe",
"?:\\Program Files (x86)\\Tencent\\QQ\\Bin\\QQExternal.exe",
"\\\\?\\Volume{*}\\Windows\\System32\\services.exe",
"\\\\?\\Volume{*}\\ProgramData\\Microsoft\\Windows Defender\\Platform\\*\\MsMpEng.exe",
"\\\\?\\Volume{*}\\Program Files\\Microsoft Security Client\\MsMpEng.exe",
"\\\\?\\Volume{*}\\Program Files*\\Windows Defender\\MsMpEng.exe",
"\\\\?\\Volume{*}\\Windows\\*\\rpcnet*.exe",
"\\\\?\\Volume{*}\\Windows\\system32\\MRT.exe",
"\\\\?\\Volume{*}\\Program Files*\\Unity Client\\Unity.exe",
"\\\\?\\Volume{*}\\Windows\\System32\\wermgr.exe",
"?:\\Program Files (x86)\\Common Files\\One Identity\\Safeguard Privilege Manager for Windows\\Client\\CSEHost.exe") and
not (process.parent.executable : "?:\\Windows\\system32\\svchost.exe" and process.executable : "?:\\Windows\\syswow64\\svchost.exe") and
not (process.parent.executable :
("?:\\Windows\\System32\\svchost.exe",
"?:\\Program Files\\COMODO\\COMODO Internet Security\\cmdvirth.exe",
"?:\\Program Files (x86)\\Adobe\\Acrobat Reader DC\\Reader\\acrocef*\\RdrCEF.exe") and
process.Ext.token.integrity_level_name == "system") and
not (process.pe.original_file_name == "AsDVDLock.exe" and
process.executable : "?:\\Program Files (x86)\\ASUS\\ASUS Manager\\USB Lock\\svchost.exe") and
not (process.parent.executable : "?:\\Windows\\System32\\svchost.exe" and process.executable : "?:\\Windows\\System32\\svchost.exe") and
not (process.code_signature.subject_name : ("SyncFuture Software Company Limited", "Code Systems Corporation") and process.code_signature.trusted == true)
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | eq |
| field:"EventType" kind:eq value:"start" |
process.name | wildcard |
| field:"process_basename" kind:wildcard value:"svchost.exe" |
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.Ext.token.integrity_level_name | eq | system | excludes:process.Ext.token.integrity_level_name field:"process.Ext.token.integrity_level_name" value:"system" |
process.parent.executable | wildcard | ?:\Windows\System32\svchost.exe, ?:\Program Files\COMODO\COMODO Internet Security\cmdvirth.exe, ?:\Program Files (x86)\Adobe\Acrobat Reader DC\Reader\acrocef*\RdrCEF.exe | excludes:process.parent.executable field:"process.parent.executable" value:"?:\Windows\System32\svchost.exe" field:"process.parent.executable" value:"?:\Program Files\COMODO\COMODO Internet Security\cmdvirth.exe" field:"process.parent.executable" value:"?:\Program Files (x86)\Adobe\Acrobat Reader DC\Reader\acrocef*\RdrCEF.exe" |
process.code_signature.subject_name | eq | SyncFuture Software Company Limited, Code Systems Corporation | excludes:process.code_signature.subject_name field:"process.code_signature.subject_name" value:"SyncFuture Software Company Limited" field:"process.code_signature.subject_name" value:"Code Systems Corporation" |
process.code_signature.trusted | eq | true | excludes:process.code_signature.trusted field:"process.code_signature.trusted" value:"true" |
process.executable | eq | ?:\Program Files (x86)\ASUS\ASUS Manager\USB Lock\svchost.exe | excludes:process.executable field:"process.executable" value:"?:\Program Files (x86)\ASUS\ASUS Manager\USB Lock\svchost.exe" |
process.pe.original_file_name | eq | AsDVDLock.exe | excludes:process.pe.original_file_name field:"process.pe.original_file_name" value:"AsDVDLock.exe" |
process.executable | eq | ?:\Windows\System32\svchost.exe | excludes:process.executable field:"process.executable" value:"?:\Windows\System32\svchost.exe" |
process.parent.executable | eq | ?:\Windows\System32\svchost.exe | excludes:process.parent.executable field:"process.parent.executable" value:"?:\Windows\System32\svchost.exe" |
process.executable | eq | ?:\Windows\syswow64\svchost.exe | excludes:process.executable field:"process.executable" value:"?:\Windows\syswow64\svchost.exe" |
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 | ?:\Windows\System32\services.exe, \Device\HarddiskVolume?\Windows\System32\services.exe, \Device\HarddiskVolume??\Windows\System32\services.exe, ?:\ProgramData\Microsoft\Windows Defender\Platform\*\MsMpEng.exe, ?:\Program Files\Microsoft Security Client\MsMpEng.exe, ?:\Program Files*\Windows Defender\MsMpEng.exe, ?:\Windows\*\rpcnet*.exe, ?:\Windows\System32\MRT.exe, ?:\Windows\System32\MRT-*.exe, ?:\Program Files*\Unity Client\Unity.exe, ?:\Windows\System32\wermgr.exe, ?:\Windows\System32\svchost.exe, ?:\WINDOWS\SysWOW64\svchost.exe, \Device\VhdHardDisk*\Windows\System32\services.exe, \Device\HarddiskVolume*\Windows\System32\services.exe, \Device\HarddiskVolume*\ProgramData\Microsoft\Windows Defender\Platform\*\MsMpEng.exe, \Device\HarddiskVolume*\Program Files\Microsoft Security Client\MsMpEng.exe, \Device\HarddiskVolume*\Program Files*\Windows Defender\MsMpEng.exe, \Device\HarddiskVolume*\Windows\*\rpcnet*.exe, \Device\HarddiskVolume*\Windows\system32\MRT.exe, \Device\HarddiskVolume*\Program Files*\Unity Client\Unity.exe, \Device\HarddiskVolume*\Windows\System32\wermgr.exe, ?:\Program Files\Microsoft Security Client\Antimalware\MsMpEng.exe, ?:\Program Files (x86)\Microsoft Security Client\Antimalware\MsMpEng.exe, ?:\Program Files\Cisco\AMP\*\sfc.exe, ?:\Program Files (x86)\Cisco\AMP\*\sfc.exe, ?:\Program Files (x86)\AlibabaProtect\*\AlibabaProtect.exe, ?:\Program Files\AlibabaProtect\*\AlibabaProtect.exe, ?:\Program Files\Microsoft Security Client\Antimalware\MsMpEng.exe, ?:\Program Files (x86)\Tencent\QQ\Bin\QQExternal.exe, \\?\Volume{*}\Windows\System32\services.exe, \\?\Volume{*}\ProgramData\Microsoft\Windows Defender\Platform\*\MsMpEng.exe, \\?\Volume{*}\Program Files\Microsoft Security Client\MsMpEng.exe, \\?\Volume{*}\Program Files*\Windows Defender\MsMpEng.exe, \\?\Volume{*}\Windows\*\rpcnet*.exe, \\?\Volume{*}\Windows\system32\MRT.exe, \\?\Volume{*}\Program Files*\Unity Client\Unity.exe, \\?\Volume{*}\Windows\System32\wermgr.exe, ?:\Program Files (x86)\Common Files\One Identity\Safeguard Privilege Manager for Windows\Client\CSEHost.exe | excludes:process.parent.executable |
Potential Masquerading as Windows Error Manager
#Identifies suspicious instances of the Windows Error Reporting process (WerFault.exe or Wermgr.exe) with matching a suspicious parent call stack. 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 a
suspicious parent call stack. This may be indicative of a masquerading attempt to evade suspicious child process
behavior detections.
"""
id = "ace0bb76-290f-4f5f-a21f-c3b13ee415a9"
license = "Elastic License v2"
name = "Potential Masquerading as Windows Error Manager"
os_list = ["windows"]
reference = [
"https://www.elastic.co/security-labs/upping-the-ante-detecting-in-memory-threats-with-kernel-call-stacks",
"https://www.elastic.co/security-labs/revisiting-blister-new-developments-of-the-blister-loader",
"https://www.elastic.co/security-labs/unmasking-financial-services-intrusion-ref0657",
]
version = "1.0.30"
query = '''
process where event.action == "start" and
process.name : ("WerFault.exe", "wermgr.exe", "WerFaultSecure.exe") and
process.parent.thread.Ext.call_stack_summary : "*|*" and
not process.parent.thread.Ext.call_stack_summary : ("*faultrep.dll*", "*wersvc.dll*", "*|wer.dll|*", "*|ubpm.dll|*", "*|cbscore.dll|rpcrt4.dll*") and
not _arraysearch(process.parent.thread.Ext.call_stack, $entry,
$entry.symbol_info: ("*kernel32.dll*!Wer*",
"*KernelBase.dll*!UnhandledExceptionFilter*",
"*kernel32.dll*!BasepReportFault*",
"*combase.dll!CoSetErrorInfo*",
"?:\\Program Files\\*.dll*",
"?:\\Program Files (x86)\\*.dll*",
"?:\\Windows\\System32\\dataclen.dll*Purge*",
"?:\\Windows\\WinSxS\\Temp\\PendingDeletes\\*!WerpLaunchAeDebug*",
"?:\\Windows\\System32\\tmumh\\*.dll*",
"*kernel32.dll*!WerpLaunchAeDebug*",
"?:\\Windows\\System32\\SettingsHandlers_StorageSense.dll!GetSettingForUser*",
"?:\\Windows\\WinSxS\\Temp\\PendingDeletes\\*!UbpmTriggerConsumerQueryStatus*",
"?:\\Windows\\System32\\SettingsHandlers_StorageSense.dll!DllGetActivationFactory*",
"?:\\Windows\\System32\\dataclen.dll!DllCanUnloadNow+*",
"?:\\Windows\\System32\\CsXumd64_*.dll+*",
"*Acrobat.exe!IsSandboxedProcess*",
"*AcroRd32.exe!IsSandboxedProcess*",
"C:\\Temp\\tmmon64.dll+*",
"*\\PendingDeletes\\$$DeleteMe*",
"*ntdll.dll+0*",
"*KernelBase.dll+0x*",
"*ntdll.dll!RtlCreateProcessReflection*",
"*ntdll.dll!RtlInitializeExceptionChain*",
"*dataclen.dll!?Purge*",
"*dataclen.dll!DllCanUnloadNow*",
"*shell32.dll!AssocCreateForClasses*")) and
not process.parent.thread.Ext.call_stack_summary in
("ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|wow64win.dll|ntdll.dll",
"ntdll.dll|kernelbase.dll|kernel32.dll|Unknown|ntdll.dll|kernel32.dll|ntdll.dll",
"ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|kernelbase.dll|dtframe32.dll",
"ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|kernelbase.dll|acrord32.exe|ntdll.dll|kernel32.dll|ntdll.dll",
"ntdll.dll|kernelbase.dll|kernel32.dll|werfault.exe|kernel32.dll|ntdll.dll",
"ntdll.dll|kernelbase.dll|Unknown|ntdll.dll|kernel32.dll|ntdll.dll",
"ntdll.dll|kernelbase.dll|hmpalert.dll|kernelbase.dll|kernel32.dll|werfault.exe|kernel32.dll|ntdll.dll",
"ntdll.dll|kernelbase.dll|kernel32.dll|appxdeploymentserver.dll|svchost.exe|sechost.dll|kernel32.dll|ntdll.dll",
"sysfer.dll|kernelbase.dll|kernel32.dll|appxupgrademigrationplugin.dll|kernel32.dll|ntdll.dll",
"ntdll.dll|kernelbase.dll|kernel32.dll|appxdeploymentserver.dll|ntdll.dll|kernel32.dll|ntdll.dll",
"ntdll.dll|kernelbase.dll|kernel32.dll|Unknown|cbscore.dll|wcp.dll|ucrtbase.dll|wcp.dll|ntdll.dll|wcp.dll|cbscore.dll|tiworker.exe|rpcrt4.dll|combase.dll|rpcrt4.dll|combase.dll|rpcrt4.dll") and
not _arraysearch(process.parent.thread.Ext.call_stack, $entry, $entry.callsite_trailing_bytes : "488945???88b4d*") and
/* Trellix */
not _arraysearch(process.parent.thread.Ext.call_stack, $entry, $entry.callsite_trailing_bytes : "488945*48894810488b4500ff50*")
'''
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 = "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 = "8.8.0"
Stages and Predicates
Stage 1: process
process where event.action == "start" and
process.name : ("WerFault.exe", "wermgr.exe", "WerFaultSecure.exe") and
process.parent.thread.Ext.call_stack_summary : "*|*" and
not process.parent.thread.Ext.call_stack_summary : ("*faultrep.dll*", "*wersvc.dll*", "*|wer.dll|*", "*|ubpm.dll|*", "*|cbscore.dll|rpcrt4.dll*") and
not _arraysearch(process.parent.thread.Ext.call_stack, $entry,
$entry.symbol_info: ("*kernel32.dll*!Wer*",
"*KernelBase.dll*!UnhandledExceptionFilter*",
"*kernel32.dll*!BasepReportFault*",
"*combase.dll!CoSetErrorInfo*",
"?:\\Program Files\\*.dll*",
"?:\\Program Files (x86)\\*.dll*",
"?:\\Windows\\System32\\dataclen.dll*Purge*",
"?:\\Windows\\WinSxS\\Temp\\PendingDeletes\\*!WerpLaunchAeDebug*",
"?:\\Windows\\System32\\tmumh\\*.dll*",
"*kernel32.dll*!WerpLaunchAeDebug*",
"?:\\Windows\\System32\\SettingsHandlers_StorageSense.dll!GetSettingForUser*",
"?:\\Windows\\WinSxS\\Temp\\PendingDeletes\\*!UbpmTriggerConsumerQueryStatus*",
"?:\\Windows\\System32\\SettingsHandlers_StorageSense.dll!DllGetActivationFactory*",
"?:\\Windows\\System32\\dataclen.dll!DllCanUnloadNow+*",
"?:\\Windows\\System32\\CsXumd64_*.dll+*",
"*Acrobat.exe!IsSandboxedProcess*",
"*AcroRd32.exe!IsSandboxedProcess*",
"C:\\Temp\\tmmon64.dll+*",
"*\\PendingDeletes\\$$DeleteMe*",
"*ntdll.dll+0*",
"*KernelBase.dll+0x*",
"*ntdll.dll!RtlCreateProcessReflection*",
"*ntdll.dll!RtlInitializeExceptionChain*",
"*dataclen.dll!?Purge*",
"*dataclen.dll!DllCanUnloadNow*",
"*shell32.dll!AssocCreateForClasses*")) and
not process.parent.thread.Ext.call_stack_summary in
("ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|wow64win.dll|ntdll.dll",
"ntdll.dll|kernelbase.dll|kernel32.dll|Unknown|ntdll.dll|kernel32.dll|ntdll.dll",
"ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|kernelbase.dll|dtframe32.dll",
"ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|kernelbase.dll|acrord32.exe|ntdll.dll|kernel32.dll|ntdll.dll",
"ntdll.dll|kernelbase.dll|kernel32.dll|werfault.exe|kernel32.dll|ntdll.dll",
"ntdll.dll|kernelbase.dll|Unknown|ntdll.dll|kernel32.dll|ntdll.dll",
"ntdll.dll|kernelbase.dll|hmpalert.dll|kernelbase.dll|kernel32.dll|werfault.exe|kernel32.dll|ntdll.dll",
"ntdll.dll|kernelbase.dll|kernel32.dll|appxdeploymentserver.dll|svchost.exe|sechost.dll|kernel32.dll|ntdll.dll",
"sysfer.dll|kernelbase.dll|kernel32.dll|appxupgrademigrationplugin.dll|kernel32.dll|ntdll.dll",
"ntdll.dll|kernelbase.dll|kernel32.dll|appxdeploymentserver.dll|ntdll.dll|kernel32.dll|ntdll.dll",
"ntdll.dll|kernelbase.dll|kernel32.dll|Unknown|cbscore.dll|wcp.dll|ucrtbase.dll|wcp.dll|ntdll.dll|wcp.dll|cbscore.dll|tiworker.exe|rpcrt4.dll|combase.dll|rpcrt4.dll|combase.dll|rpcrt4.dll") and
not _arraysearch(process.parent.thread.Ext.call_stack, $entry, $entry.callsite_trailing_bytes : "488945???88b4d*") and
not _arraysearch(process.parent.thread.Ext.call_stack, $entry, $entry.callsite_trailing_bytes : "488945*48894810488b4500ff50*")
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | eq |
| field:"EventType" kind:eq value:"start" |
process.name | wildcard |
| field:"process_basename" kind:wildcard |
process.parent.thread.Ext.call_stack_summary | wildcard |
| field:"process.parent.thread.Ext.call_stack_summary" kind:wildcard value:"*|*" |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.parent.thread.Ext.call_stack | array_any | excludes:process.parent.thread.Ext.call_stack | |
process.parent.thread.Ext.call_stack_summary | in | ntdll.dll|kernelbase.dll|Unknown|ntdll.dll|kernel32.dll|ntdll.dll, ntdll.dll|kernelbase.dll|hmpalert.dll|kernelbase.dll|kernel32.dll|werfault.exe|kernel32.dll|ntdll.dll, ntdll.dll|kernelbase.dll|kernel32.dll|Unknown|cbscore.dll|wcp.dll|ucrtbase.dll|wcp.dll|ntdll.dll|wcp.dll|cbscore.dll|tiworker.exe|rpcrt4.dll|combase.dll|rpcrt4.dll|combase.dll|rpcrt4.dll, ntdll.dll|kernelbase.dll|kernel32.dll|Unknown|ntdll.dll|kernel32.dll|ntdll.dll, ntdll.dll|kernelbase.dll|kernel32.dll|appxdeploymentserver.dll|ntdll.dll|kernel32.dll|ntdll.dll, ntdll.dll|kernelbase.dll|kernel32.dll|appxdeploymentserver.dll|svchost.exe|sechost.dll|kernel32.dll|ntdll.dll, ntdll.dll|kernelbase.dll|kernel32.dll|werfault.exe|kernel32.dll|ntdll.dll, ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|kernelbase.dll|acrord32.exe|ntdll.dll|kernel32.dll|ntdll.dll, ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|kernelbase.dll|dtframe32.dll, ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|wow64win.dll|ntdll.dll, sysfer.dll|kernelbase.dll|kernel32.dll|appxupgrademigrationplugin.dll|kernel32.dll|ntdll.dll | excludes:process.parent.thread.Ext.call_stack_summary |
process.parent.thread.Ext.call_stack_summary | match | faultrep.dll, wersvc.dll, |wer.dll|, |ubpm.dll|, |cbscore.dll|rpcrt4.dll | excludes:process.parent.thread.Ext.call_stack_summary |
Potential Reverse Shell via Java
#Identifies the execution of a shell process from a Java JAR application post an incoming network connection. This behavior may indicate a reverse shell activity via malicious Java application.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Execution | |
| Command & Control |
Rule Body
[rule]
description = """
Identifies the execution of a shell process from a Java JAR application post an incoming network connection. This
behavior may indicate a reverse shell activity via malicious Java application.
"""
id = "15c94c07-07ec-4e68-a623-e690be3d9d6b"
license = "Elastic License v2"
name = "Potential Reverse Shell via Java"
os_list = ["windows"]
version = "1.0.12"
query = '''
sequence with maxspan=1s
[network where process.pid != 4 and
event.action in ("connection_accepted", "connection_attempted") and
process.name in~ ("java.exe", "javaw.exe")] by process.entity_id
[process where event.action == "start" and process.parent.name : "java.exe" and
process.parent.args : "-jar" and
process.parent.executable :
("?:\\Program Files\\Java\\jre*\\bin\\java.exe",
"?:\\Program Files (x86)\\Java\\jre*\\bin\\java.exe",
"?:\\Program Files\\AdoptOpenJDK\\jdk-*\\bin\\java.exe",
"?:\\Program Files (x86)\\AdoptOpenJDK\\jdk-*\\bin\\java.exe") and
process.name in~ ("cmd.exe", "powershell.exe", "conhost.exe")] by process.parent.entity_id
'''
min_endpoint_version = "8.7.0"
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 1
[[optional_actions]]
action = "rollback"
field = "process.entity_id"
state = 0
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1059"
name = "Command and Scripting Interpreter"
reference = "https://attack.mitre.org/techniques/T1059/"
[threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1071"
name = "Application Layer Protocol"
reference = "https://attack.mitre.org/techniques/T1071/"
[threat.tactic]
id = "TA0011"
name = "Command and Control"
reference = "https://attack.mitre.org/tactics/TA0011/"
[internal]
min_endpoint_version = "8.7.0"
Stages and Predicates
Ordered sequence: each step below must occur in order within 1s, correlated by process.entity_id, process.parent.entity_id.
Stage 1: network
[network where process.pid != 4 and
event.action in ("connection_accepted", "connection_attempted") and
process.name in~ ("java.exe", "javaw.exe")] by process.entity_id
Stage 2: process
[process where event.action == "start" and process.parent.name : "java.exe" and
process.parent.args : "-jar" and
process.parent.executable :
("?:\\Program Files\\Java\\jre*\\bin\\java.exe",
"?:\\Program Files (x86)\\Java\\jre*\\bin\\java.exe",
"?:\\Program Files\\AdoptOpenJDK\\jdk-*\\bin\\java.exe",
"?:\\Program Files (x86)\\AdoptOpenJDK\\jdk-*\\bin\\java.exe") and
process.name in~ ("cmd.exe", "powershell.exe", "conhost.exe")] by process.parent.entity_id
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | eq |
| field:"EventType" kind:eq value:"start" |
event.action | in |
| field:"EventType" kind:in |
process.name | in |
| field:"process_basename" kind:in |
process.parent.args | wildcard |
| field:"process.parent.args" kind:wildcard value:"-jar" |
process.parent.executable | wildcard |
| field:"ParentImage" kind:wildcard |
process.parent.name | wildcard |
| field:"parent_process_basename" kind:wildcard value:"java.exe" |
process.pid | ne |
| field:"process_id" kind:ne value:"4" |
Privilege Boundary Enumeration Detected via Defend for Containers
#This rule detects the execution of the "id", "whoami", "capsh", "getcap", and "lsns" commands inside a container. These commands are used to enumerate the privilege boundary of the container, which can be used by an adversary to gain information about the container and the services running inside it.
Known False Positives
- There is a potential for false positives if the "id", "whoami", "capsh", "getcap", or "lsns" commands are used for legitimate purposes, such as debugging or troubleshooting. For example, an operator may use the "id" command to verify the identity of the current user, or the "whoami" command to verify the current user. It is important to investigate any alerts generated by this rule to determine if they are indicative of malicious activity or part of legitimate container activity.
MITRE ATT&CK Coverage
Rule Body
[metadata]
creation_date = "2026/02/06"
integration = ["cloud_defend"]
maturity = "production"
min_stack_comments = "Defend for Containers integration was re-introduced in 9.3.0"
min_stack_version = "9.3.0"
updated_date = "2026/07/29"
[rule]
author = ["Elastic"]
description = """
This rule detects the execution of the "id", "whoami", "capsh", "getcap", and "lsns" commands inside a container.
These commands are used to enumerate the privilege boundary of the container, which can be used by an adversary to
gain information about the container and the services running inside it.
"""
false_positives = [
"""
There is a potential for false positives if the "id", "whoami", "capsh", "getcap", or "lsns" commands are used for legitimate purposes,
such as debugging or troubleshooting. For example, an operator may use the "id" command to verify the identity of the current user, or
the "whoami" command to verify the current user. It is important to investigate any alerts generated by this rule to determine if they
are indicative of malicious activity or part of legitimate container activity.
""",
]
from = "now-6m"
index = ["logs-cloud_defend.process*"]
interval = "5m"
language = "eql"
license = "Elastic License v2"
name = "Privilege Boundary Enumeration Detected via Defend for Containers"
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 Privilege Boundary Enumeration Detected via Defend for Containers
This detects activity inside a Linux container running common identity and capability discovery tools (id, whoami, capsh, getcap, lsns) to map what privileges and namespace isolation the container actually has. This matters because attackers use this early in an intrusion to judge whether they can escalate within the container or pivot toward a host escape. A typical pattern is an attacker landing a shell through a vulnerable web service and immediately checking user context and Linux capabilities before attempting privilege abuse.
### Possible investigation steps
- Identify the impacted workload (pod/task/service), node, and cluster context, then correlate with Kubernetes audit logs or container runtime events to determine whether the interactive session originated from an operator action (e.g., exec) or an unexpected access path.
- Review surrounding process activity from the same container to find follow-on commands indicating escalation or lateral movement attempts, such as spawning shells, modifying permissions, inspecting mounts, or downloading tooling.
- Attribute the session to an identity by mapping the initiating user/service account and source to recent admin/CI activity, and flag anomalies like first-time access, unusual geolocation, or access outside change windows.
- Evaluate escape and blast-radius risk by confirming the container’s effective privileges and isolation, including privileged mode, added capabilities, host namespace sharing, and sensitive host mounts or sockets.
- If activity is suspicious, preserve evidence (processes, mounts, network connections, recent file changes) and consider isolating the pod/node or rotating credentials before remediation actions that would destroy artifacts.
### False positive analysis
- A platform engineer or developer attaches an interactive shell to a running container for routine troubleshooting and runs `id`/`whoami` to confirm the effective user and group context before making configuration changes.
- During a planned hardening or validation task, an operator interactively inspects container capability and namespace settings using `capsh`/`getcap`/`lsns` to verify the workload is running with the intended privilege boundaries.
### Response and remediation
- Contain the incident by terminating the interactive session and quarantining the affected pod/container (or cordoning the node) while preserving container filesystem, running processes, mounts, and active network connections for evidence.
- Eradicate by removing any unauthorized shells, binaries, or scripts dropped during the session, revoking/rotating credentials used to access the container (service account tokens, registry creds, app secrets), and rebuilding/redeploying the workload from a known-good image.
- Recover by restoring the service with clean images and validated configuration, then verify no persistence remains by checking for unexpected running processes, modified entrypoints, altered file permissions, or new cron/systemd artifacts within the container image/build context.
- Escalate to the incident response/on-call security team immediately if the container is privileged, has hostPath mounts or access to the container runtime socket, shares host namespaces, or if follow-on behavior appears (e.g., attempts to access `/proc/1`, `/var/run/docker.sock`, `nsenter`, or outbound downloads).
- Harden by disabling or tightly restricting interactive exec/attach for production workloads, enforcing least-privilege securityContext (drop capabilities, runAsNonRoot, read-only root filesystem), and preventing host mounts/sockets via admission controls and policy (Pod Security Admission/Gatekeeper/Kyverno).
- Improve detection and prevention by alerting on interactive shells and suspicious tooling in containers, adding egress allowlists to limit tool download/pivoting, and ensuring audit logging is enabled for Kubernetes exec events and container runtime actions."""
risk_score = 21
rule_id = "737626a2-4dca-4195-8ecd-68ef96fd1bad"
severity = "low"
tags = [
"Data Source: Elastic Defend for Containers",
"Domain: Container",
"OS: Linux",
"Use Case: Threat Detection",
"Tactic: Discovery",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
process where host.os.type == "linux" and event.type == "start" and event.action == "exec" and (
(process.name in ("id", "whoami", "capsh", "getcap", "lsns")) or
(process.args in (
"id", "/bin/id", "/usr/bin/id", "/usr/local/bin/id",
"whoami", "/bin/whoami", "/usr/bin/whoami", "/usr/local/bin/whoami",
"capsh", "/bin/capsh", "/usr/bin/capsh", "/usr/local/bin/capsh",
"getcap", "/bin/getcap", "/usr/bin/getcap", "/usr/local/bin/getcap",
"lsns", "/bin/lsns", "/usr/bin/lsns", "/usr/local/bin/lsns"
) and
/* default exclusion list to not FP on default multi-process commands */
not process.args in (
"man", "/bin/man", "/usr/bin/man", "/usr/local/bin/man",
"chmod", "/bin/chmod", "/usr/bin/chmod", "/usr/local/bin/chmod",
"chown", "/bin/chown", "/usr/bin/chown", "/usr/local/bin/chown"
)
)
) and container.id like "?*"
'''
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1033"
name = "System Owner/User Discovery"
reference = "https://attack.mitre.org/techniques/T1033/"
[[rule.threat.technique]]
id = "T1082"
name = "System Information Discovery"
reference = "https://attack.mitre.org/techniques/T1082/"
[[rule.threat.technique]]
id = "T1613"
name = "Container and Resource Discovery"
reference = "https://attack.mitre.org/techniques/T1613/"
[rule.threat.tactic]
id = "TA0007"
name = "Discovery"
reference = "https://attack.mitre.org/tactics/TA0007/"
Stages and Predicates
Stage 1: process
process where host.os.type == "linux" and event.type == "start" and event.action == "exec" and (
(process.name in ("id", "whoami", "capsh", "getcap", "lsns")) or
(process.args in (
"id", "/bin/id", "/usr/bin/id", "/usr/local/bin/id",
"whoami", "/bin/whoami", "/usr/bin/whoami", "/usr/local/bin/whoami",
"capsh", "/bin/capsh", "/usr/bin/capsh", "/usr/local/bin/capsh",
"getcap", "/bin/getcap", "/usr/bin/getcap", "/usr/local/bin/getcap",
"lsns", "/bin/lsns", "/usr/bin/lsns", "/usr/local/bin/lsns"
) and
not process.args in (
"man", "/bin/man", "/usr/bin/man", "/usr/local/bin/man",
"chmod", "/bin/chmod", "/usr/bin/chmod", "/usr/local/bin/chmod",
"chown", "/bin/chown", "/usr/bin/chown", "/usr/local/bin/chown"
)
)
) and container.id like "?*"
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
container.id | wildcard |
| field:"container.id" kind:wildcard value:"?*" |
event.action | eq |
| field:"EventType" kind:eq value:"exec" |
event.type | eq |
| field:"event.type" kind:eq value:"start" |
process.args | in |
| field:"process.args" kind:in |
process.name | in |
| field:"process_basename" kind:in |
Remote Scheduled Task Creation via RPC
#Identifies scheduled task creation from a remote source. This could be indicative of adversary lateral movement.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Execution | |
| Lateral Movement |
Telemetry Coverage
| Provider | Record / event type |
|---|---|
| Security-Auditing | Event ID 4698: A scheduled task was created. |
Rule Body
[metadata]
creation_date = "2022/08/29"
integration = ["system", "windows"]
maturity = "production"
updated_date = "2026/05/04"
[rule]
author = ["Elastic"]
description = "Identifies scheduled task creation from a remote source. This could be indicative of adversary lateral movement.\n"
from = "now-9m"
index = ["logs-system.security*", "logs-windows.forwarded*", "winlogbeat-*"]
language = "eql"
license = "Elastic License v2"
name = "Remote Scheduled Task Creation via RPC"
note = """## Triage and analysis
### Remote Scheduled Task Creation via RPC
[Scheduled tasks](https://docs.microsoft.com/en-us/windows/win32/taskschd/about-the-task-scheduler) are a great mechanism for persistence and program execution. These features can be used remotely for a variety of legitimate reasons, but at the same time used by malware and adversaries. When investigating scheduled tasks that were set up remotely, one of the first steps should be to determine the original intent behind the configuration and to verify if the activity is tied to benign behavior such as software installation or any kind of network administrator work. One objective for these alerts is to understand the configured action within the scheduled task. This is captured within the registry event data for this rule and can be base64 decoded to view the value.
#### Possible investigation steps
- Review the TaskContent value to investigate the task configured action.
- Validate if the activity is not related to planned patches, updates, network administrator activity, or legitimate software installations.
- Further examination should include review of host-based artifacts and network logs from around when the scheduled task was created, on both the source and target machines.
### False positive analysis
- There is a high possibility of benign activity tied to the creation of remote scheduled tasks as it is a general feature within Windows and used for legitimate purposes for a wide range of activity. Any kind of context should be found to further understand the source of the activity and determine the intent based on the scheduled task's contents.
### Related rules
- Service Command Lateral Movement - d61cbcf8-1bc1-4cff-85ba-e7b21c5beedc
- Remotely Started Services via RPC - aa9a274d-6b53-424d-ac5e-cb8ca4251650
- Remote Scheduled Task Creation - 954ee7c8-5437-49ae-b2d6-2960883898e9
### 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.
- Remove scheduled task and any other related artifacts.
- Review privileged account management and user account management settings. Consider implementing group policy object (GPO) policies to further restrict activity, or configuring settings that only allow administrators to create remote scheduled tasks.
"""
setup = """## Setup
Audit Other Object Access Events must be enabled to generate the events used by this rule.
Setup instructions: https://ela.st/audit-other-object-access-events
"""
risk_score = 47
rule_id = "9c865691-5599-447a-bac9-b3f2df5f9a9d"
severity = "medium"
tags = [
"Domain: Endpoint",
"OS: Windows",
"Use Case: Threat Detection",
"Tactic: Lateral Movement",
"Data Source: Windows Security Event Logs",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
iam where host.os.type == "windows" and event.action == "scheduled-task-created" and
winlog.event_data.RpcCallClientLocality : "0" and winlog.event_data.ClientProcessId : "0"
'''
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1021"
name = "Remote Services"
reference = "https://attack.mitre.org/techniques/T1021/"
[rule.threat.tactic]
id = "TA0008"
name = "Lateral Movement"
reference = "https://attack.mitre.org/tactics/TA0008/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1053"
name = "Scheduled Task/Job"
reference = "https://attack.mitre.org/techniques/T1053/"
[[rule.threat.technique.subtechnique]]
id = "T1053.005"
name = "Scheduled Task"
reference = "https://attack.mitre.org/techniques/T1053/005/"
[rule.threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
Stages and Predicates
Stage 1: iam
iam where host.os.type == "windows" and event.action == "scheduled-task-created" and
winlog.event_data.RpcCallClientLocality : "0" and winlog.event_data.ClientProcessId : "0"
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | eq |
| field:"EventType" kind:eq value:"scheduled-task-created" |
winlog.event_data.ClientProcessId | wildcard |
| field:"ClientProcessId" kind:wildcard value:"0" |
winlog.event_data.RpcCallClientLocality | wildcard |
| field:"RpcCallClientLocality" kind:wildcard value:"0" |
Spike in Successful Logon Events from a Source IP
#A machine learning job found an unusually large spike in successful authentication events from a particular source IP address. This can be due to password spraying, user enumeration or brute force activity.
Known False Positives
- Build servers and CI systems can sometimes trigger this alert. Security test cycles that include brute force or password spraying activities may trigger this alert.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Stealth | |
| Credential Access |
Rule Body
[metadata]
creation_date = "2021/06/10"
integration = ["auditd_manager", "endpoint", "system"]
maturity = "production"
min_stack_version = "9.4.0"
min_stack_comments = "Use EA (Entity Analytics) fields"
updated_date = "2026/07/27"
[rule]
anomaly_threshold = 75
author = ["Elastic"]
description = """
A machine learning job found an unusually large spike in successful authentication events from a particular source IP
address. This can be due to password spraying, user enumeration or brute force activity.
"""
false_positives = [
"""
Build servers and CI systems can sometimes trigger this alert. Security test cycles that include brute force or
password spraying activities may trigger this alert.
""",
]
from = "now-30m"
interval = "15m"
license = "Elastic License v2"
machine_learning_job_id = "auth_high_count_logon_events_for_a_source_ip_ea"
name = "Spike in Successful Logon Events from a Source IP"
setup = """## Setup
This rule requires the installation of associated Machine Learning jobs, as well as data coming in from one of the following integrations:
- Elastic Defend
- Auditd Manager
- System
### Anomaly Detection Setup
Once the rule is enabled, the associated Machine Learning job will start automatically. You can view the Machine Learning job linked under the "Definition" panel of the detection rule. If the job does not start due to an error, the issue must be resolved for the job to commence successfully. For more details on setting up anomaly detection jobs, refer to the [helper guide](https://www.elastic.co/guide/en/kibana/current/xpack-ml-anomalies.html).
### Elastic Defend Integration Setup
Elastic Defend is integrated into the Elastic Agent using Fleet. Upon configuration, the integration allows the Elastic Agent to monitor events on your host and send data to the Elastic Security app.
#### Prerequisite Requirements:
- Fleet is required for Elastic Defend.
- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).
#### The following steps should be executed in order to add the Elastic Defend integration to your system:
- Go to the Kibana home page and click "Add integrations".
- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.
- Click "Add Elastic Defend".
- Configure the integration name and optionally add a description.
- Select the type of environment you want to protect, either "Traditional Endpoints" or "Cloud Workloads".
- Select a configuration preset. Each preset comes with different default settings for Elastic Agent, you can further customize these later by configuring the Elastic Defend integration policy. [Helper guide](https://www.elastic.co/guide/en/security/current/configure-endpoint-integration-policy.html).
- We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"
- Enter a name for the agent policy in "New agent policy name". If other agent policies already exist, you can click the "Existing hosts" tab and select an existing policy instead.
For more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/current/agent-policy.html).
- Click "Save and Continue".
- To complete the integration, select "Add Elastic Agent to your hosts" and continue to the next section to install the Elastic Agent on your hosts.
For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
### Auditd Manager Integration Setup
The Auditd Manager Integration receives audit events from the Linux Audit Framework which is a part of the Linux kernel.
Auditd Manager provides a user-friendly interface and automation capabilities for configuring and monitoring system auditing through the auditd daemon. With `auditd_manager`, administrators can easily define audit rules, track system events, and generate comprehensive audit reports, improving overall security and compliance in the system.
#### The following steps should be executed in order to add the Elastic Agent System integration "auditd_manager" to your system:
- Go to the Kibana home page and click “Add integrations”.
- In the query bar, search for “Auditd Manager” and select the integration to see more details about it.
- Click “Add Auditd Manager”.
- Configure the integration name and optionally add a description.
- Review optional and advanced settings accordingly.
- Add the newly installed “auditd manager” to an existing or a new agent policy, and deploy the agent on a Linux system from which auditd log files are desirable.
- Click “Save and Continue”.
- For more details on the integration refer to the [helper guide](https://docs.elastic.co/integrations/auditd_manager).
#### Rule Specific Setup Note
Auditd Manager subscribes to the kernel and receives events as they occur without any additional configuration.
However, if more advanced configuration is required to detect specific behavior, audit rules can be added to the integration in either the "audit rules" configuration box or the "auditd rule files" box by specifying a file to read the audit rules from.
- For this detection rule no additional audit rules are required.
### System Integration Setup
The System integration allows you to collect system logs and metrics from your servers with Elastic Agent.
#### The following steps should be executed in order to add the Elastic Agent System integration "system" to your system:
- Go to the Kibana home page and click “Add integrations”.
- In the query bar, search for “System” and select the integration to see more details about it.
- Click “Add System”.
- Configure the integration name and optionally add a description.
- Review optional and advanced settings accordingly.
- Add the newly installed “system” to an existing or a new agent policy, and deploy the agent on your system from which system log files are desirable.
- Click “Save and Continue”.
- For more details on the integration refer to the [helper guide](https://docs.elastic.co/integrations/system).
"""
note = """## Triage and analysis
### Investigating Spike in Successful Logon Events from a Source IP
This rule uses a machine learning job to detect a substantial spike in successful authentication events. This could indicate post-exploitation activities that aim to test which hosts, services, and other resources the attacker can access with the compromised credentials.
#### Possible investigation steps
- Identify the specifics of the involved assets, such as role, criticality, and associated users.
- Check if the authentication comes from different sources.
- Use the historical data available to determine if the same behavior happened in the past.
- Investigate other alerts associated with the involved users during the past 48 hours.
- Check whether the involved credentials are used in automation or scheduled tasks.
- If this activity is suspicious, contact the account owner and confirm whether they are aware of it.
### False positive analysis
- Understand the context of the authentications by contacting the asset owners. If this activity is related to a new business process or newly implemented (approved) technology, consider adding exceptions — preferably with a combination of user and source conditions.
### Response and remediation
- Initiate the incident response process based on the outcome of the triage.
- 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.
- Using the incident response data, update logging and audit policies to improve the mean time to detect (MTTD) and the mean time to respond (MTTR).
"""
references = ["https://www.elastic.co/guide/en/security/current/prebuilt-ml-jobs.html"]
risk_score = 21
rule_id = "e26aed74-c816-40d3-a810-48d6fbd8b2fd"
severity = "low"
tags = [
"Data Source: Elastic Defend",
"Data Source: Auditd Manager",
"Data Source: Windows Security Event Logs",
"Use Case: Identity and Access Audit",
"Use Case: Threat Detection",
"Rule Type: ML",
"Rule Type: Machine Learning",
"Tactic: Credential Access",
"Tactic: Defense Evasion",
"Resources: Investigation Guide",
]
type = "machine_learning"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1110"
name = "Brute Force"
reference = "https://attack.mitre.org/techniques/T1110/"
[[rule.threat.technique.subtechnique]]
id = "T1110.003"
name = "Password Spraying"
reference = "https://attack.mitre.org/techniques/T1110/003/"
[rule.threat.tactic]
id = "TA0006"
name = "Credential Access"
reference = "https://attack.mitre.org/tactics/TA0006/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1078"
name = "Valid Accounts"
reference = "https://attack.mitre.org/techniques/T1078/"
[[rule.threat.technique.subtechnique]]
id = "T1078.002"
name = "Domain Accounts"
reference = "https://attack.mitre.org/techniques/T1078/002/"
[[rule.threat.technique.subtechnique]]
id = "T1078.003"
name = "Local Accounts"
reference = "https://attack.mitre.org/techniques/T1078/003/"
[rule.threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
Suspicious PrivilegedHelperTool Activity
#Detects the potential abuse of a PrivilegedHelperTool by triggering on the execution of specific system binaries where the parent process is a privilegedhelpertool. This activity is not normal or common and could indicate a privilegedhelpertool exploitation bypass attempt. PrivilegedHelperTools are sometimes targeted via injection and XPC manipulation to bypass macOS security controls in order to elevate privileges, establish privileged persistence, or execute commands as a privileged user.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Privilege Escalation |
Telemetry Coverage
Rule Body
[rule]
description = """
Detects the potential abuse of a PrivilegedHelperTool by triggering on the execution of specific system binaries where
the parent process is a privilegedhelpertool. This activity is not normal or common and could indicate a
privilegedhelpertool exploitation bypass attempt. PrivilegedHelperTools are sometimes targeted via injection and XPC
manipulation to bypass macOS security controls in order to elevate privileges, establish privileged persistence, or
execute commands as a privileged user.
"""
id = "900fdb84-2a81-4a6d-88db-b48a0fafd79e"
license = "Elastic License v2"
name = "Suspicious PrivilegedHelperTool Activity"
os_list = ["macos"]
reference = ["https://wojciechregula.blog/post/bypass-tcc-via-privileged-helpers-aka-cve-2020-10008/"]
version = "1.0.27"
query = '''
process where event.type == "start" and
event.action == "exec" and user.name == "root" and
process.parent.executable like "/Library/PrivilegedHelperTools/*" and
(
/* shell and common lolbins */
(((process.name like~ ("bash", "zsh", "sh", "tclsh*") and process.args == "-c" and process.args like~ ("/tmp/*",
"*/bin/curl *",
"*/bin/nscurl*",
"*/bin/osascript *",
"*/bin/python*",
"osascript*",
"python*",
"curl*")) or
process.name like~ ("python*", "tclsh*", "osascript", "osacompile", "curl", "nscurl", "wget", "tccd")) and not
process.command_line like~ ("*remove*", "*unload*", "*/Library/Application Support/JAMF/Composer/Sources/*", "*https://www.google.com*")) or
/* unsigned or untrusted macO */
(process.code_signature.exists == false or process.code_signature.trusted == false)
) and not
process.executable like ("/Library/PrivilegedHelperTools/*", "/Applications/*") and not
process.parent.executable == "/Library/PrivilegedHelperTools/com.kaseya.VSAHelper" and not
(process.parent.code_signature.trusted == true and process.parent.code_signature.exists == true)
'''
min_endpoint_version = "8.11.0"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
[[actions]]
action = "kill_process"
field = "process.parent.entity_id"
state = 0
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1068"
name = "Exploitation for Privilege Escalation"
reference = "https://attack.mitre.org/techniques/T1068/"
[threat.tactic]
id = "TA0004"
name = "Privilege Escalation"
reference = "https://attack.mitre.org/tactics/TA0004/"
[internal]
min_endpoint_version = "8.11.0"
Stages and Predicates
Stage 1: process
process where event.type == "start" and
event.action == "exec" and user.name == "root" and
process.parent.executable like "/Library/PrivilegedHelperTools/*" and
(
(((process.name like~ ("bash", "zsh", "sh", "tclsh*") and process.args == "-c" and process.args like~ ("/tmp/*",
"*/bin/curl *",
"*/bin/nscurl*",
"*/bin/osascript *",
"*/bin/python*",
"osascript*",
"python*",
"curl*")) or
process.name like~ ("python*", "tclsh*", "osascript", "osacompile", "curl", "nscurl", "wget", "tccd")) and not
process.command_line like~ ("*remove*", "*unload*", "*/Library/Application Support/JAMF/Composer/Sources/*", "*https://www.google.com*")) or
(process.code_signature.exists == false or process.code_signature.trusted == false)
) and not
process.executable like ("/Library/PrivilegedHelperTools/*", "/Applications/*") and not
process.parent.executable == "/Library/PrivilegedHelperTools/com.kaseya.VSAHelper" and not
(process.parent.code_signature.trusted == true and process.parent.code_signature.exists == true)
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 value:"-c" |
process.args | wildcard |
| field:"process.args" kind:wildcard |
process.code_signature.exists | eq |
| field:"process.code_signature.exists" kind:eq value:"false" |
process.code_signature.trusted | eq |
| field:"process.code_signature.trusted" kind:eq value:"false" |
process.name | wildcard |
| field:"process_basename" kind:wildcard |
process.parent.executable | wildcard |
| field:"ParentImage" kind:wildcard value:"/Library/PrivilegedHelperTools/*" |
user.name | eq |
| field:"user" kind:eq value:"root" |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.parent.code_signature.exists | eq | true | excludes:process.parent.code_signature.exists field:"process.parent.code_signature.exists" value:"true" |
process.parent.code_signature.trusted | eq | true | excludes:process.parent.code_signature.trusted field:"process.parent.code_signature.trusted" value:"true" |
process.executable | starts_with | /Library/PrivilegedHelperTools/, /Applications/ | excludes:process.executable field:"process.executable" value:"/Library/PrivilegedHelperTools/" field:"process.executable" value:"/Applications/" |
process.parent.executable | eq | /Library/PrivilegedHelperTools/com.kaseya.VSAHelper | excludes:process.parent.executable field:"process.parent.executable" value:"/Library/PrivilegedHelperTools/com.kaseya.VSAHelper" |
System Time Discovery
#Detects the usage of commonly used system time discovery techniques, which attackers may use during the reconnaissance phase after compromising a system.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Discovery |
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]
bypass_bbr_timing = true
creation_date = "2023/01/24"
integration = ["windows", "endpoint", "system"]
maturity = "production"
updated_date = "2026/03/24"
[rule]
author = ["Elastic"]
building_block_type = "default"
description = """
Detects the usage of commonly used system time discovery techniques, which attackers may use during the reconnaissance
phase after compromising a system.
"""
from = "now-9m"
index = [
"endgame-*",
"logs-endpoint.events.process-*",
"logs-system.security*",
"logs-windows.*",
"winlogbeat-*",
]
language = "eql"
license = "Elastic License v2"
name = "System Time Discovery"
risk_score = 21
rule_id = "06568a02-af29-4f20-929c-f3af281e41aa"
severity = "low"
tags = [
"Domain: Endpoint",
"OS: Windows",
"Use Case: Threat Detection",
"Tactic: Discovery",
"Data Source: Elastic Defend",
"Data Source: Elastic Endgame",
"Rule Type: BBR",
"Data Source: Windows Security Event Logs",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
process where host.os.type == "windows" and event.type == "start" and
(
(
(process.name: "net.exe" or (process.name : "net1.exe" and not process.parent.name : "net.exe")) and
process.args : "time" and not process.args : "/set"
) or
(process.name: "w32tm.exe" and process.args: "/tz") or
(process.name: "tzutil.exe" and process.args: "/g")
) and not user.id : ("S-1-5-18", "S-1-5-19", "S-1-5-20")
'''
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1124"
name = "System Time Discovery"
reference = "https://attack.mitre.org/techniques/T1124/"
[[rule.threat.technique]]
id = "T1614"
name = "System Location Discovery"
reference = "https://attack.mitre.org/techniques/T1614/"
[rule.threat.tactic]
id = "TA0007"
name = "Discovery"
reference = "https://attack.mitre.org/tactics/TA0007/"
Stages and Predicates
Stage 1: process
process where host.os.type == "windows" and event.type == "start" and
(
(
(process.name: "net.exe" or (process.name : "net1.exe" and not process.parent.name : "net.exe")) and
process.args : "time" and not process.args : "/set"
) or
(process.name: "w32tm.exe" and process.args: "/tz") or
(process.name: "tzutil.exe" and process.args: "/g")
) and not user.id : ("S-1-5-18", "S-1-5-19", "S-1-5-20")
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.type | eq |
| field:"event.type" kind:eq value:"start" |
process.args | wildcard |
| field:"process.args" kind:wildcard |
process.name | wildcard |
| field:"process_basename" kind:wildcard |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
user.id | eq | S-1-5-18, S-1-5-19, S-1-5-20 | excludes:user.id field:"user.id" value:"S-1-5-18" field:"user.id" value:"S-1-5-19" field:"user.id" value:"S-1-5-20" |
UID Elevation from Previously Unknown Executable
#Monitors for the elevation of regular user permissions to root permissions through a previously unknown executable. Attackers may attempt to evade detection by hijacking the execution flow and hooking certain functions/syscalls through a rootkit in order to provide easy access to root via a special modified command.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Privilege Escalation | |
| Stealth |
Rule Body
[metadata]
creation_date = "2023/10/26"
integration = ["endpoint"]
maturity = "production"
updated_date = "2026/03/24"
[rule]
author = ["Elastic"]
description = """
Monitors for the elevation of regular user permissions to root permissions through a previously unknown executable.
Attackers may attempt to evade detection by hijacking the execution flow and hooking certain functions/syscalls through
a rootkit in order to provide easy access to root via a special modified command.
"""
from = "now-9m"
index = ["logs-endpoint.events.*"]
language = "kuery"
license = "Elastic License v2"
name = "UID Elevation from Previously Unknown Executable"
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 UID Elevation from Previously Unknown Executable
In Linux environments, UID elevation is a process where a user's permissions are increased, often to root level, allowing full system control. Adversaries exploit this by using unknown executables to hijack execution flow, often via rootkits, to gain unauthorized root access. The detection rule identifies such activities by monitoring for UID changes initiated by non-standard executables, excluding known safe paths and processes, thus highlighting potential privilege escalation attempts.
### Possible investigation steps
- Review the process details to identify the unknown executable that triggered the alert, focusing on the process.executable field to determine its path and origin.
- Examine the parent process information using process.parent.name to understand the context in which the unknown executable was launched, checking for any unusual or unexpected shell activity.
- Investigate the user account associated with the UID change by analyzing the user.id field to determine if the account has a history of privilege escalation attempts or if it has been compromised.
- Check the system logs for any recent changes or installations that might have introduced the unknown executable, focusing on the time frame around the event.action:"uid_change".
- Assess the network activity around the time of the alert to identify any potential external connections or data exfiltration attempts that might correlate with the privilege escalation.
- Cross-reference the executable path and name against known threat intelligence databases to determine if it is associated with any known malicious activity or rootkits.
- If possible, perform a forensic analysis of the executable to understand its behavior and potential impact on the system, looking for signs of function or syscall hooking as indicated in the rule description.
### False positive analysis
- Executables in custom directories may trigger false positives if they are legitimate but not included in the known safe paths. Users can mitigate this by adding these directories to the exclusion list in the detection rule.
- Scripts or binaries executed by system administrators from non-standard locations for maintenance or deployment purposes might be flagged. To handle this, users should document and exclude these specific processes or paths if they are verified as safe.
- Development or testing environments where new executables are frequently introduced can cause alerts. Users should consider creating exceptions for these environments or paths to reduce noise while ensuring they are monitored separately for any unusual activity.
- Automated scripts or tools that perform legitimate UID changes but are not part of the standard system paths can be excluded by adding their specific executable paths or names to the rule's exception list.
- Temporary or ephemeral processes that are part of containerized applications might be flagged. Users should review and exclude these processes if they are confirmed to be part of normal operations.
### Response and remediation
- Immediately isolate the affected system from the network to prevent further unauthorized access or lateral movement by the adversary.
- Terminate any suspicious processes identified by the detection rule that are not part of the known safe paths or processes.
- Conduct a thorough review of the affected system's logs to identify any additional indicators of compromise or related suspicious activities.
- Remove any unauthorized or unknown executables found on the system, especially those involved in the UID elevation attempt.
- Restore the system from a known good backup if any rootkits or persistent threats are detected that cannot be easily removed.
- Update and patch the system to the latest security standards to close any vulnerabilities that may have been exploited.
- Escalate the incident to the security operations center (SOC) or incident response team for further investigation and to assess the potential impact on other systems."""
risk_score = 73
rule_id = "7787362c-90ff-4b1a-b313-8808b1020e64"
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 to select "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"
- Enter a name for the agent policy in New agent policy name. If other agent policies already exist, you can click the Existing hosts tab and select an existing policy instead.
For more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/8.10/agent-policy.html).
- Click Save and Continue.
- To complete the integration, select Add Elastic Agent to your hosts and continue to the next section to install the Elastic Agent on your hosts.
For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
"""
severity = "high"
tags = [
"Domain: Endpoint",
"OS: Linux",
"Use Case: Threat Detection",
"Tactic: Privilege Escalation",
"Tactic: Defense Evasion",
"Data Source: Elastic Defend",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "new_terms"
query = '''
host.os.type:"linux" and event.category:"process" and event.action:"uid_change" and event.type:"change" and user.id:"0"
and process.parent.name:("bash" or "dash" or "sh" or "tcsh" or "csh" or "zsh" or "ksh" or "fish") and not (
process.executable:(
/bin/* or /usr/bin/* or /sbin/* or /usr/sbin/* or /snap/* or /tmp/newroot/* or /var/lib/docker/* or /usr/local/* or
/opt/psa/admin/* or /usr/lib/snapd/snap-confine or /opt/dynatrace/* or /opt/microsoft/* or
/var/lib/snapd/snap/bin/node or /opt/gitlab/embedded/sbin/logrotate or /etc/apt/universal-hooks/* or
/opt/puppetlabs/puppet/bin/puppet or /opt/cisco/* or /run/k3s/containerd/* or /usr/lib/postfix/sbin/master or
/usr/libexec/postfix/local or /var/lib/snapd/snap/bin/postgresql* or /opt/puppetlabs/puppet/bin/ruby
) or
process.name:(
"bash" or "dash" or "sh" or "tcsh" or "csh" or "zsh" or "ksh" or "fish" or "sudo" or "su" or "apt" or "apt-get" or
"aptitude" or "squid" or "snap" or "fusermount" or "pkexec" or "umount" or "master" or "omsbaseline" or "dzdo" or
"sandfly" or "logrotate" or "nix-installer" or "sapstartsrv" or "microk8s" or "vrns_watchdog" or "sdbgloballistener" or
"clean_user_php_sessions" or "nsca_wrapper"
) or
process.args:/usr/bin/python*
)
'''
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1548"
name = "Abuse Elevation Control Mechanism"
reference = "https://attack.mitre.org/techniques/T1548/"
[[rule.threat.technique.subtechnique]]
id = "T1548.001"
name = "Setuid and Setgid"
reference = "https://attack.mitre.org/techniques/T1548/001/"
[[rule.threat.technique]]
id = "T1574"
name = "Hijack Execution Flow"
reference = "https://attack.mitre.org/techniques/T1574/"
[[rule.threat.technique.subtechnique]]
id = "T1574.013"
name = "KernelCallbackTable"
reference = "https://attack.mitre.org/techniques/T1574/013/"
[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 = "T1014"
name = "Rootkit"
reference = "https://attack.mitre.org/techniques/T1014/"
[rule.threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
[rule.new_terms]
field = "new_terms_fields"
value = ["process.executable"]
[[rule.new_terms.history_window_start]]
field = "history_window_start"
value = "now-5d"
Stages and Predicates
Stage 1: new_terms
host.os.type:"linux" and event.category:"process" and event.action:"uid_change" and event.type:"change" and user.id:"0"
and process.parent.name:("bash" or "dash" or "sh" or "tcsh" or "csh" or "zsh" or "ksh" or "fish") and not (
process.executable:(
/bin/* or /usr/bin/* or /sbin/* or /usr/sbin/* or /snap/* or /tmp/newroot/* or /var/lib/docker/* or /usr/local/* or
/opt/psa/admin/* or /usr/lib/snapd/snap-confine or /opt/dynatrace/* or /opt/microsoft/* or
/var/lib/snapd/snap/bin/node or /opt/gitlab/embedded/sbin/logrotate or /etc/apt/universal-hooks/* or
/opt/puppetlabs/puppet/bin/puppet or /opt/cisco/* or /run/k3s/containerd/* or /usr/lib/postfix/sbin/master or
/usr/libexec/postfix/local or /var/lib/snapd/snap/bin/postgresql* or /opt/puppetlabs/puppet/bin/ruby
) or
process.name:(
"bash" or "dash" or "sh" or "tcsh" or "csh" or "zsh" or "ksh" or "fish" or "sudo" or "su" or "apt" or "apt-get" or
"aptitude" or "squid" or "snap" or "fusermount" or "pkexec" or "umount" or "master" or "omsbaseline" or "dzdo" or
"sandfly" or "logrotate" or "nix-installer" or "sapstartsrv" or "microk8s" or "vrns_watchdog" or "sdbgloballistener" or
"clean_user_php_sessions" or "nsca_wrapper"
) or
process.args:/usr/bin/python*
)
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | eq |
| field:"EventType" kind:eq value:"uid_change" |
event.category | eq |
| field:"event.category" kind:eq value:"process" |
event.type | eq |
| field:"event.type" kind:eq value:"change" |
process.parent.name | in |
| field:"parent_process_basename" kind:in |
user.id | eq |
| field:"user.id" kind:eq value:"0" |
Exclusions
The rule actively suppresses these predicates.
Unusual Windows System Service Disabled
#Identifies attempts to disable certain Windows security related services such as the Windows Defender or System Updates via registry modification.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Persistence | |
| Defense Impairment |
Rule Body
[rule]
description = """
Identifies attempts to disable certain Windows security related services such as the Windows Defender or System Updates
via registry modification.
"""
id = "7c44cfc6-d336-400e-9cc1-2417dfb5c00a"
license = "Elastic License v2"
name = "Unusual Windows System Service Disabled"
os_list = ["windows"]
version = "1.0.13"
query = '''
registry where
registry.value : "Start" and registry.data.strings == "4" and
process.executable != null and registry.path != null and
registry.path :
("HKLM\\SYSTEM\\ControlSet001\\Services\\WinDefend\\Start",
"HKLM\\SYSTEM\\ControlSet001\\Services\\SecurityHealthService\\Start",
"HKLM\\SYSTEM\\ControlSet001\\Services\\Sense\\Start",
"HKLM\\SYSTEM\\ControlSet001\\Services\\WdBoot\\Start",
"HKLM\\SYSTEM\\ControlSet001\\Services\\WdFilter\\Start",
"HKLM\\SYSTEM\\ControlSet001\\Services\\WdNisDrv\\Start",
"HKLM\\SYSTEM\\ControlSet001\\Services\\WdNisSvc\\Start",
"HKLM\\SYSTEM\\ControlSet001\\Services\\wscsvc\\Start",
"HKLM\\SYSTEM\\ControlSet001\\Services\\EventLog\\Start") and
not process.executable : ("?:\\Windows\\System32\\reg.exe", "?:\\Windows\\regedit.exe") and
not (process.code_signature.subject_name in ("Connectwise, LLC", "Enestech Software (Cyprus) Ltd") and process.code_signature.trusted == true)
'''
actions = []
min_endpoint_version = "8.4.0"
[[optional_actions]]
action = "rollback"
field = "process.entity_id"
state = 0
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1112"
name = "Modify Registry"
reference = "https://attack.mitre.org/techniques/T1112/"
[[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.4.0"
Stages and Predicates
Stage 1: registry
registry where
registry.value : "Start" and registry.data.strings == "4" and
process.executable != null and registry.path != null and
registry.path :
("HKLM\\SYSTEM\\ControlSet001\\Services\\WinDefend\\Start",
"HKLM\\SYSTEM\\ControlSet001\\Services\\SecurityHealthService\\Start",
"HKLM\\SYSTEM\\ControlSet001\\Services\\Sense\\Start",
"HKLM\\SYSTEM\\ControlSet001\\Services\\WdBoot\\Start",
"HKLM\\SYSTEM\\ControlSet001\\Services\\WdFilter\\Start",
"HKLM\\SYSTEM\\ControlSet001\\Services\\WdNisDrv\\Start",
"HKLM\\SYSTEM\\ControlSet001\\Services\\WdNisSvc\\Start",
"HKLM\\SYSTEM\\ControlSet001\\Services\\wscsvc\\Start",
"HKLM\\SYSTEM\\ControlSet001\\Services\\EventLog\\Start") and
not process.executable : ("?:\\Windows\\System32\\reg.exe", "?:\\Windows\\regedit.exe") and
not (process.code_signature.subject_name in ("Connectwise, LLC", "Enestech Software (Cyprus) Ltd") and process.code_signature.trusted == true)
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
process.executable | is_not_null | field:"Image" kind:is_not_null | |
registry.data.strings | eq |
| field:"Details" kind:eq value:"4" |
registry.path | is_not_null | field:"TargetObject" kind:is_not_null | |
registry.path | wildcard |
| field:"TargetObject" kind:wildcard |
registry.value | wildcard |
| field:"registry_value_name" kind:wildcard value:"Start" |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.code_signature.subject_name | in | Connectwise, LLC, Enestech Software (Cyprus) Ltd | excludes:process.code_signature.subject_name field:"process.code_signature.subject_name" value:"Connectwise, LLC" field:"process.code_signature.subject_name" value:"Enestech Software (Cyprus) Ltd" |
process.code_signature.trusted | eq | true | excludes:process.code_signature.trusted field:"process.code_signature.trusted" value:"true" |
process.executable | eq | ?:\Windows\System32\reg.exe, ?:\Windows\regedit.exe | excludes:process.executable field:"process.executable" value:"?:\Windows\System32\reg.exe" field:"process.executable" value:"?:\Windows\regedit.exe" |