Detection rules › Elastic
Elastic rules: 0h
AdminSDHolder SDProp Exclusion Added
#Identifies a modification on the dsHeuristics attribute on the bit that holds the configuration of groups excluded from the SDProp process. The SDProp compares the permissions on protected objects with those defined on the AdminSDHolder object. If the permissions on any of the protected accounts and groups do not match, the permissions on the protected accounts and groups are reset to match those of the domain's AdminSDHolder object, meaning that groups excluded will remain unchanged. Attackers can abuse this misconfiguration to maintain long-term access to privileged accounts in these groups.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Persistence | |
| Privilege Escalation | |
| Stealth | |
| Defense Impairment |
Telemetry Coverage
| Provider | Record / event type |
|---|---|
| Security-Auditing | Event ID 5136: A directory service object was modified. |
Rule Body
[metadata]
creation_date = "2022/02/24"
integration = ["system", "windows"]
maturity = "production"
updated_date = "2026/05/03"
[rule]
author = ["Elastic"]
description = """
Identifies a modification on the dsHeuristics attribute on the bit that holds the configuration of groups excluded from
the SDProp process. The SDProp compares the permissions on protected objects with those defined on the AdminSDHolder
object. If the permissions on any of the protected accounts and groups do not match, the permissions on the protected
accounts and groups are reset to match those of the domain's AdminSDHolder object, meaning that groups excluded will
remain unchanged. Attackers can abuse this misconfiguration to maintain long-term access to privileged accounts in these
groups.
"""
from = "now-9m"
index = ["logs-system.security*", "logs-windows.forwarded*", "winlogbeat-*"]
language = "eql"
license = "Elastic License v2"
name = "AdminSDHolder SDProp Exclusion Added"
references = [
"https://www.cert.ssi.gouv.fr/uploads/guide-ad.html#dsheuristics_bad",
"https://petri.com/active-directory-security-understanding-adminsdholder-object",
]
risk_score = 73
rule_id = "61d29caf-6c15-4d1e-9ccb-7ad12ccc0bc7"
severity = "high"
tags = [
"Domain: Endpoint",
"OS: Windows",
"Use Case: Threat Detection",
"Tactic: Persistence",
"Data Source: Active Directory",
"Resources: Investigation Guide",
"Use Case: Active Directory Monitoring",
"Data Source: Windows Security Event Logs",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
any where host.os.type == "windows" and event.code == "5136" and
winlog.event_data.AttributeLDAPDisplayName : "dSHeuristics" and
winlog.event_data.OperationType : "%%14674" and
length(winlog.event_data.AttributeValue) > 15 and
winlog.event_data.AttributeValue regex~ "[0-9]{15}([1-9a-f]).*"
'''
note = """## Triage and analysis
### Investigating AdminSDHolder SDProp Exclusion Added
#### Possible investigation steps
- What did the 5136 record do to the SDProp exclusion mask?
- Focus: `winlog.event_data.OperationType` and `winlog.event_data.AttributeValue`; decode position "1" = Account Operators, "2" = Server Operators, "4" = Print Operators, "8" = Backup Operators, with additive hex combinations.
- Implication: escalate when an added or replaced value leaves any operator group excluded from SDProp, especially multiple groups; lower concern only when paired 5136 records prove removal and rollback to 0. If the active mask is unproven, treat as unresolved.
- Did the change land on the forest configuration object controlling SDProp behavior?
- Focus: `winlog.event_data.ObjectDN`, `winlog.event_data.DSName`, and `host.name`.
- Implication: forest-impacting when `winlog.event_data.ObjectDN` is the Directory Service object under "CN=Windows NT,CN=Services,CN=Configuration" and the naming context is in scope; narrow only when `winlog.event_data.DSName` and `host.name` identify a lab or recovery forest.
- Which identity changed "dSHeuristics", and does it fit directory configuration work?
- Focus: `user.id`, `user.name`, `user.domain`, and `winlog.event_data.SubjectLogonId`.
- Implication: suspicious when the writer is not a dedicated directory-configuration identity for the affected forest; reduce concern only when identity and object match confirmed hardening or recovery.
- What source session produced the directory change?
- Why: the 5136 event names the writer, but session origin separates console or jump-host administration from remote or alternate-credential use.
- Focus: on the domain controller, find 4624 events where `winlog.event_data.TargetLogonId` equals the 5136 `winlog.event_data.SubjectLogonId`; read `source.ip`, `winlog.logon.type`, and `winlog.event_data.AuthenticationPackageName`. $investigate_0
- Hint: search 4648 by `winlog.event_data.SubjectLogonId` when explicit-credential use would change the answer. $investigate_1
- Hint: Missing authentication telemetry is unresolved, not benign.
- Implication: escalate for unexpected workstation, direct DC logon, remote-interactive path, NTLM where Kerberos is expected, or explicit-credential use; reduce concern when origin, logon type, and authentication package fit the confirmed directory-configuration case.
- Did the same operation or session change other privileged directory state?
- Why: SDProp exclusion is most damaging with AdminSDHolder ACL, privileged membership, delegation, or security-descriptor changes that persist because SDProp no longer resets excluded groups.
- Focus: 5136 events on the same `host.id` where `winlog.event_data.OpCorrelationID` matches, then the same `winlog.event_data.SubjectLogonId` if needed; read `winlog.event_data.ObjectDN`, `winlog.event_data.AttributeLDAPDisplayName`, and `winlog.event_data.AttributeValue`. $investigate_2
- Range: inspect the alert burst first; if the mask stayed non-zero, extend through the weakened interval for follow-on membership, ACL, delegation, or security-descriptor changes on excluded groups.
- Implication: escalate when the same burst touches AdminSDHolder, privileged groups, delegation attributes, or security descriptors; lower suspicion only when grouped changes stay limited to one intentional SDProp configuration action.
- If local evidence remains suspicious or unresolved, do related alerts change scope or urgency?
- Focus: recent alerts for the same `user.id`. $investigate_3
- Hint: also review domain controller `host.id` when controller compromise or change spread remains unresolved. $investigate_4
- Implication: broaden response when the writer or controller has related AD tampering, unusual authentication, privilege abuse, persistence, credential-access, or lateral-movement alerts; keep scope local only when related alerts are quiet and local telemetry supports a bounded explanation.
- Escalate for an active non-zero in-scope mask, abnormal writer or source session, or grouped privileged changes; close only when mask, operation, scope, writer, session, and grouped 5136 prove rollback to 0 or confirmed hardening/testing without contradictions; preserve and escalate mixed or incomplete cases.
### False positive analysis
- Treat non-zero SDProp exclusions as suspicious. Directory hardening or delegated-admin redesign is benign only when excluded operator groups were intentionally stripped of privileged rights and a dedicated configuration workflow made the change. Confirm `winlog.event_data.AttributeValue` maps to the planned group set, `winlog.event_data.ObjectDN` and `winlog.event_data.DSName` identify the expected Directory Service object, `user.id` and recovered `source.ip` identify the authorized admin session, and `winlog.event_data.OpCorrelationID` activity stays bounded to maintenance. If evidence is unavailable, the alert remains unresolved; do not close from repetition.
- Lab-forest or recovery-forest testing may intentionally change "dSHeuristics". Confirm `winlog.event_data.DSName` and `host.name` place the event in that forest, `user.id` and `winlog.event_data.SubjectLogonId` identify the designated test administrator, and related alerts on `host.id` lack unrelated credential-access, persistence, or lateral-movement activity. If records are unavailable, treat as unresolved unless another reliable source confirms forest identity and administrator.
- Before creating an exception, validate recurrence for the same `user.id`, `host.id`, `winlog.event_data.ObjectDN`, `winlog.event_data.DSName`, `winlog.event_data.AttributeValue`, and bounded `winlog.event_data.OpCorrelationID` pattern. Avoid exceptions on "dSHeuristics", event 5136, or rule name alone.
### Response and remediation
- If confirmed benign, reverse temporary containment and document the mask, object scope, writer, session origin, controller, and confirmation source proving the authorized workflow. Keep exceptions tied to the recurring workflow pattern, not the attribute or event code.
- If suspicious but unconfirmed, preserve triggering and grouped 5136 records, linked 4624 or 4648 authentication records, and key identifiers: `winlog.event_data.ObjectGUID`, `winlog.event_data.OpCorrelationID`, `user.id`, `host.id`, and recovered `source.ip`. Apply reversible containment tied to those findings: restrict the implicated account from directory-configuration changes, increase DC monitoring, or contain the recovered source host if not a critical controller. Escalate to account disablement or host isolation only when related alerts or session evidence show broader abuse.
- If confirmed malicious, preserve directory-change and authentication evidence before changing configuration. Restore "dSHeuristics" to the expected value, verify rollback replication on other domain controllers, and review the same `winlog.event_data.OpCorrelationID` or `winlog.event_data.SubjectLogonId` for unauthorized directory changes. Contain the writer account or recovered source host with identity or endpoint response tooling; avoid isolating a domain controller unless broader compromise is confirmed and directory owners can tolerate the action.
- After containment, check whether excluded operator groups received unauthorized membership, ACL, delegation, or security-descriptor changes while SDProp protection was weakened, and roll back only malicious changes identified.
- Post-incident hardening: keep Windows Security 5136 directory-service auditing enabled on domain controllers, restrict "dSHeuristics" changes to dedicated directory-configuration workflows, reduce or remove privileged rights from built-in operator groups where possible, and record visibility gaps or adjacent variants for engineering review.
"""
setup = """## Setup
Audit Directory Service Changes must be enabled to generate the events used by this rule.
Setup instructions: https://ela.st/audit-directory-service-changes
"""
[rule.investigation_fields]
field_names = [
"@timestamp",
"host.name",
"host.id",
"user.id",
"winlog.event_data.SubjectUserSid",
"winlog.event_data.SubjectLogonId",
"winlog.event_data.ObjectDN",
"winlog.event_data.ObjectGUID",
"winlog.event_data.ObjectClass",
"winlog.event_data.AttributeLDAPDisplayName",
"winlog.event_data.AttributeValue",
"winlog.event_data.OperationType",
"winlog.event_data.OpCorrelationID",
"winlog.event_data.DSName",
]
[transform]
[[transform.investigate]]
label = "Linked logon for the modifying session"
description = ""
providers = [
[
{ excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" },
{ excluded = false, field = "winlog.event_data.TargetLogonId", queryType = "phrase", value = "{{winlog.event_data.SubjectLogonId}}", valueType = "string" },
{ excluded = false, field = "event.code", queryType = "phrase", value = "4624", valueType = "string" }
]
]
relativeFrom = "now-24h/h"
relativeTo = "now"
[[transform.investigate]]
label = "Explicit credential events for the modifying session"
description = ""
providers = [
[
{ excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" },
{ excluded = false, field = "winlog.event_data.SubjectLogonId", queryType = "phrase", value = "{{winlog.event_data.SubjectLogonId}}", valueType = "string" },
{ excluded = false, field = "event.code", queryType = "phrase", value = "4648", valueType = "string" }
]
]
relativeFrom = "now-24h/h"
relativeTo = "now"
[[transform.investigate]]
label = "All 5136 events in this SDProp exclusion change set"
description = ""
providers = [
[
{ excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" },
{ excluded = false, field = "winlog.event_data.OpCorrelationID", queryType = "phrase", value = "{{winlog.event_data.OpCorrelationID}}", valueType = "string" },
{ excluded = false, field = "event.code", queryType = "phrase", value = "5136", valueType = "string" }
]
]
relativeFrom = "now-24h/h"
relativeTo = "now"
[[transform.investigate]]
label = "Alerts associated with the writer"
description = ""
providers = [
[
{ excluded = false, field = "event.kind", queryType = "phrase", value = "signal", valueType = "string" },
{ excluded = false, field = "user.id", queryType = "phrase", value = "{{user.id}}", valueType = "string" }
]
]
relativeFrom = "now-48h/h"
relativeTo = "now"
[[transform.investigate]]
label = "Alerts associated with the domain controller"
description = ""
providers = [
[
{ excluded = false, field = "event.kind", queryType = "phrase", value = "signal", valueType = "string" },
{ excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" }
]
]
relativeFrom = "now-48h/h"
relativeTo = "now"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "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]]
id = "T1098"
name = "Account Manipulation"
reference = "https://attack.mitre.org/techniques/T1098/"
[rule.threat.tactic]
id = "TA0003"
name = "Persistence"
reference = "https://attack.mitre.org/tactics/TA0003/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1484"
name = "Domain or Tenant Policy Modification"
reference = "https://attack.mitre.org/techniques/T1484/"
[rule.threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
Stages and Predicates
Stage 1: any
any where host.os.type == "windows" and event.code == "5136" and
winlog.event_data.AttributeLDAPDisplayName : "dSHeuristics" and
winlog.event_data.OperationType : "%%14674" and
length(winlog.event_data.AttributeValue) > 15 and
winlog.event_data.AttributeValue regex~ "[0-9]{15}([1-9a-f]).*"
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.code | eq |
| field:"EventID" kind:eq value:"5136" |
winlog.event_data.AttributeLDAPDisplayName | wildcard |
| field:"AttributeLDAPDisplayName" kind:wildcard value:"dSHeuristics" |
winlog.event_data.AttributeValue | regex_match |
| field:"AttributeValue" kind:regex_match value:"[0-9]{15}([1-9a-f]).*" |
winlog.event_data.OperationType | wildcard |
| field:"OperationType" kind:wildcard value:"%%14674" |
AWS EC2 Instance Console Login via Assumed Role
#Detects successful AWS Management Console or federation login activity performed using an EC2 instance’s assumed role credentials. EC2 instances typically use temporary credentials to make API calls, not to authenticate interactively via the console. A successful "ConsoleLogin" or "GetSigninToken" event using a session pattern that includes "i-" (the EC2 instance ID) is highly anomalous and may indicate that an adversary obtained the instance’s temporary credentials from the instance metadata service (IMDS) and used them to access the console. Such activity can enable lateral movement, privilege escalation, or persistence within the AWS account.
Known False Positives
- This is very uncommon behavior and should result in minimal false positives, ensure validity of the triggered event and include exceptions where necessary.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Persistence | |
| Privilege Escalation | |
| Stealth | |
| Credential Access | |
| Lateral Movement |
Telemetry Coverage
Rules Detecting the Same Action
These rules filter on the same operation.
- AWS Authentication From CrowdStrike Unmanaged Device (Panther)
- AWS Authentication from CrowdStrike Unmanaged Device (Panther)
- AWS Authentication from CrowdStrike Unmanaged Device (crowdstrike_fdrevent table) (Panther)
- AWS Console GetSigninToken Potential Abuse (Sigma)
- AWS Console GetSigninToken Potential Abuse (Panther)
- AWS GetFederationToken Followed by Console Login via Federation Exchange (Elastic)
- AWS IAM User Console Login from Multiple Geolocations (Elastic)
- AWS IAM User Console Login Without MFA (Elastic)
Rule Body
[metadata]
creation_date = "2024/07/24"
integration = ["aws"]
maturity = "production"
updated_date = "2026/04/10"
[rule]
author = ["Elastic"]
description = """
Detects successful AWS Management Console or federation login activity performed using an EC2 instance’s assumed role
credentials. EC2 instances typically use temporary credentials to make API calls, not to authenticate interactively via
the console. A successful "ConsoleLogin" or "GetSigninToken" event using a session pattern that includes "i-" (the EC2
instance ID) is highly anomalous and may indicate that an adversary obtained the instance’s temporary credentials from
the instance metadata service (IMDS) and used them to access the console. Such activity can enable lateral movement,
privilege escalation, or persistence within the AWS account.
"""
event_category_override = "event.type"
false_positives = [
"""
This is very uncommon behavior and should result in minimal false positives, ensure validity of the triggered event
and include exceptions where necessary.
""",
]
from = "now-6m"
index = ["filebeat-*", "logs-aws.cloudtrail-*"]
language = "eql"
license = "Elastic License v2"
name = "AWS EC2 Instance Console Login via Assumed Role"
note = """## Triage and analysis
### Investigating AWS EC2 Instance Console Login via Assumed Role
This rule detects successful AWS console or federation logins using temporary credentials tied to EC2 instance profiles. Under normal conditions, EC2 instances use their temporary credentials for programmatic API access — **not** for interactive console sessions. When an attacker gains access to an instance’s IMDS (Instance Metadata Service) or its environment variables, they may retrieve temporary STS credentials and attempt console logins to gain full access to the AWS account. A successful login of this type is rare and high-risk, as it strongly suggests credential theft or unauthorized session hijacking.
#### Possible investigation steps
- **Identify the source and actor**
- Review `aws.cloudtrail.user_identity.arn`, `user.id`, and `user_agent.original` fields to confirm the session originated from an EC2 instance (`:i-` pattern).
- Correlate the instance ID (`i-xxxxxx`) with the specific EC2 instance in your environment to identify its owner, purpose, and running applications.
- Check `source.ip` and `cloud.region` to determine if the login originated from within AWS infrastructure (expected) or an external location (suspicious).
- **Correlate surrounding activity**
- Pivot in Timeline to view the sequence of events leading up to the login, including:
- STS token retrievals (`GetSessionToken`, `AssumeRole`, `GetCallerIdentity`)
- Calls to the IMDS endpoint or local credential exfiltration attempts from the instance.
- Investigate whether the same role or credentials were used for API actions following the login (e.g., `CreateUser`, `AttachRolePolicy`, or `ListBuckets`).
- **Assess IAM role exposure**
- Determine which IAM role was associated with the instance at the time of the event and review its attached permissions.
- Evaluate whether the role grants console access or permissions beyond what that workload normally requires.
- Check for any recent changes to that role’s trust policy or attached policies.
- **Validate authorization**
- Contact the EC2 instance owner or service team to confirm if any legitimate process should be logging in to the console.
- If no legitimate activity can explain the login, treat the credentials as compromised.
### False positive analysis
This is very uncommon behavior.
Known legitimate causes include:
- AWS or internal security automation that programmatically initiates console sessions for validation or testing.
- Forensic or incident-response automation that logs in using temporary credentials from a compromised instance.
- Red-team or penetration-testing activity designed to validate IMDS exposure or lateral movement scenarios.
For any other occurrence, treat the alert as potentially malicious.
Validate through:
- The originating instance’s purpose and owner.
- Known automation patterns in `user_agent.original`.
- The timestamp alignment with planned testing or security validation.
### Response and remediation
- **Immediate containment**
- Revoke the temporary credentials for the affected role (`aws sts revoke-session-token` or rotate the role credentials).
- Isolate the associated EC2 instance (e.g., detach it from the VPC or security groups) to prevent further credential misuse.
- Invalidate active console sessions via AWS CLI or the AWS Console.
- **Investigation and scoping**
- Review CloudTrail logs for all actions associated with the compromised role in the preceding 24 hours.
- Determine if additional roles or instances show similar `ConsoleLogin` patterns.
- Search for network indicators of IMDS exploitation (e.g., requests to `169.254.169.254` from unauthorized binaries or users).
- **Recovery and hardening**
- Rotate all credentials for affected roles and users.
- Apply IMDSv2 enforcement to prevent credential harvesting from EC2 metadata.
- Implement restrictive IAM policies: deny console access (`iam:PassRole`, `sts:GetFederationToken`) for non-human roles.
### 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)**
- **Security Best Practices:** [AWS Knowledge Center – Security Best Practices](https://aws.amazon.com/premiumsupport/knowledge-center/security-best-practices/).
"""
references = [
"https://redcanary.com/blog/aws-sts/",
"https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-custom-url.html/",
]
risk_score = 73
rule_id = "d1e5e410-3e34-412e-9b1f-dd500b3b55cd"
severity = "high"
tags = [
"Domain: Cloud",
"Data Source: AWS",
"Data Source: Amazon Web Services",
"Data Source: AWS EC2",
"Data Source: AWS STS",
"Data Source: AWS Sign-In",
"Use Case: Identity and Access Audit",
"Tactic: Lateral Movement",
"Tactic: Credential Access",
"Tactic: Persistence",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
info where data_stream.dataset == "aws.cloudtrail"
and event.provider == "signin.amazonaws.com"
and event.action in ("ConsoleLogin", "GetSigninToken")
and event.outcome == "success"
and aws.cloudtrail.user_identity.type == "AssumedRole"
and stringContains (user.id, ":i-")
'''
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1021"
name = "Remote Services"
reference = "https://attack.mitre.org/techniques/T1021/"
[[rule.threat.technique.subtechnique]]
id = "T1021.007"
name = "Cloud Services"
reference = "https://attack.mitre.org/techniques/T1021/007/"
[[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 = "TA0008"
name = "Lateral Movement"
reference = "https://attack.mitre.org/tactics/TA0008/"
[[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.tactic]
id = "TA0003"
name = "Persistence"
reference = "https://attack.mitre.org/tactics/TA0003/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1552"
name = "Unsecured Credentials"
reference = "https://attack.mitre.org/techniques/T1552/"
[[rule.threat.technique.subtechnique]]
id = "T1552.005"
name = "Cloud Instance Metadata API"
reference = "https://attack.mitre.org/techniques/T1552/005/"
[rule.threat.tactic]
id = "TA0006"
name = "Credential Access"
reference = "https://attack.mitre.org/tactics/TA0006/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "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 = "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 = "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.tactic]
id = "TA0004"
name = "Privilege Escalation"
reference = "https://attack.mitre.org/tactics/TA0004/"
[rule.investigation_fields]
field_names = [
"@timestamp",
"user.name",
"user_agent.original",
"source.ip",
"aws.cloudtrail.user_identity.arn",
"aws.cloudtrail.user_identity.type",
"aws.cloudtrail.user_identity.access_key_id",
"event.action",
"event.outcome",
"cloud.account.id",
"cloud.region",
"aws.cloudtrail.response_elements",
]
Stages and Predicates
Stage 1: info
info where data_stream.dataset == "aws.cloudtrail"
and event.provider == "signin.amazonaws.com"
and event.action in ("ConsoleLogin", "GetSigninToken")
and event.outcome == "success"
and aws.cloudtrail.user_identity.type == "AssumedRole"
and stringContains (user.id, ":i-")
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
aws.cloudtrail.user_identity.type | eq |
| field:"aws::userIdentity.type" kind:eq value:"AssumedRole" |
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:"signin.amazonaws.com" |
user.id | contains |
| field:"user.id" kind:contains value:":i-" |
AWS SQS Queue Purge
#Identifies when an AWS Simple Queue Service (SQS) queue is purged. Purging an SQS queue permanently deletes all messages currently in the queue. Adversaries may use this action to disrupt application workflows, destroy operational data, or impair monitoring and alerting by removing messages that contain evidence of malicious activity.
Known False Positives
- Authorized administrators or automated workflows may purge SQS queues for legitimate operational reasons, such as clearing stale messages, resetting test environments, or performing approved maintenance. Verify that the action aligns with documented procedures and expected operational behavior.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Defense Impairment | |
| Impact |
Telemetry Coverage
| Platform | Record / event type |
|---|---|
| AWS | CloudTrail event PurgeQueue: Deletes all messages in an SQS queue without deleting the queue itself. |
Rule Body
[metadata]
creation_date = "2025/01/08"
integration = ["aws"]
maturity = "production"
updated_date = "2026/04/10"
[rule]
author = ["Elastic"]
description = """
Identifies when an AWS Simple Queue Service (SQS) queue is purged. Purging an SQS queue permanently deletes all messages
currently in the queue. Adversaries may use this action to disrupt application workflows, destroy operational data, or
impair monitoring and alerting by removing messages that contain evidence of malicious activity.
"""
false_positives = [
"""
Authorized administrators or automated workflows may purge SQS queues for legitimate operational reasons, such as
clearing stale messages, resetting test environments, or performing approved maintenance. Verify that the action
aligns with documented procedures and expected operational behavior.
""",
]
from = "now-6m"
index = ["filebeat-*", "logs-aws.cloudtrail-*"]
language = "kuery"
license = "Elastic License v2"
name = "AWS SQS Queue Purge"
note = """## Triage and analysis
### Investigating AWS SQS Queue Purge
AWS SQS is a managed message queuing service commonly used to decouple services and buffer events across distributed and serverless architectures. Purging a queue removes all pending messages and cannot be undone. While this may be required for maintenance or testing, adversaries may abuse this action to disrupt operations, delete forensic evidence, or evade detection by removing queued security or audit events.
### Possible investigation steps
**Identify the actor**
- Review `aws.cloudtrail.user_identity.arn` and `access_key_id` to determine who initiated the purge. Confirm whether this identity typically manages SQS resources and whether the action aligns with their role.
**Review the affected queue**
- Identify the purged queue using `aws.cloudtrail.request_parameters` or `aws.cloudtrail.resources.arn`. Determine the purpose of the queue and whether it supports critical workflows, security tooling, or monitoring pipelines.
**Evaluate the context of the action**
- Review the `@timestamp` to determine when the purge occurred and whether it aligns with maintenance windows or
deployment activity.
- Examine `source.ip` and `user_agent.original` for anomalies such as unexpected locations, automation tools, or
unfamiliar clients.
**Correlate related activity**
- Search for other CloudTrail events from the same identity before and after the purge, including IAM changes, credential activity, or additional SQS operations.
- Look for signs of follow-on behavior such as queue deletion, policy updates, or attempts to suppress logging.
**Validate intent**
- Confirm with the queue owner or application team whether the purge was intentional, approved, and expected. If no clear business justification exists, treat the activity as potentially suspicious.
### False positive analysis
- Queue purges performed during routine maintenance, incident recovery, or test resets may be legitimate.
- Automated jobs or cleanup scripts may regularly purge queues as part of normal operation.
### Response and remediation
- If the purge was unauthorized, immediately restrict SQS permissions for the affected identity and investigate for credential compromise.
- Assess operational impact and determine whether downstream systems were disrupted or lost critical data.
- Review recent activity to identify any additional attempts to evade detection or disable monitoring.
- Reinforce least-privilege IAM policies to limit which identities can perform `PurgeQueue`.
- Enhance monitoring and alerting for destructive SQS actions, especially in production environments.
- Work with application teams to document approved purge workflows and ensure adequate guardrails are in place.
### 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)**
- **[AWS Knowledge Center – Security Best Practices](https://aws.amazon.com/premiumsupport/knowledge-center/security-best-practices/)**
"""
references = [
"https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_PurgeQueue.html",
"https://hackingthe.cloud/aws/exploitation/Misconfigured_Resource-Based_Policies/exploting_public_resources_attack_playbook/",
]
risk_score = 47
rule_id = "bab88bb8-cdd9-11ef-bd9a-f661ea17fbcd"
severity = "medium"
tags = [
"Domain: Cloud",
"Data Source: AWS",
"Data Source: Amazon Web Services",
"Data Source: AWS SQS",
"Use Case: Threat Detection",
"Use Case: Log Auditing",
"Tactic: Defense Evasion",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "query"
query = '''
data_stream.dataset: "aws.cloudtrail"
and event.provider: "sqs.amazonaws.com"
and event.action: "PurgeQueue"
and event.outcome: "success"
'''
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1562"
name = "Impair Defenses"
reference = "https://attack.mitre.org/techniques/T1562/"
[[rule.threat.technique.subtechnique]]
id = "T1562.008"
name = "Disable or Modify Cloud Logs"
reference = "https://attack.mitre.org/techniques/T1562/008/"
[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 = "T1485"
name = "Data Destruction"
reference = "https://attack.mitre.org/techniques/T1485/"
[rule.threat.tactic]
id = "TA0040"
name = "Impact"
reference = "https://attack.mitre.org/tactics/TA0040/"
[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.resources.arn",
"aws.cloudtrail.resources.type",
"event.action",
"event.outcome",
"cloud.account.id",
"cloud.region",
"aws.cloudtrail.request_parameters",
]
Stages and Predicates
Stage 1: query
data_stream.dataset: "aws.cloudtrail"
and event.provider: "sqs.amazonaws.com"
and event.action: "PurgeQueue"
and event.outcome: "success"
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
data_stream.dataset | eq |
| field:"data_stream.dataset" kind:eq value:"aws.cloudtrail" |
event.action | eq |
| field:"EventType" kind:eq value:"PurgeQueue" |
event.outcome | eq |
| field:"event.outcome" kind:eq value:"success" |
event.provider | eq |
| field:"Provider_Name" kind:eq value:"sqs.amazonaws.com" |
Egress Network Connection Followed by Memory File Descriptor Creation
#This rule detects when a process establishes an outbound network connection followed by creating an in-memory file using the memfd_create syscall. This activity indicates an active attempt to execute a fileless payload and should be considered highly abnormal or suspicious. This activity can occur when the memfd syscall is utilized to create a memory resident file, like a payload, and then uses it to execute a process via a command and control channel, resulting in an exec event.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Execution | |
| Stealth |
Rule Body
[rule]
description = """
This rule detects when a process establishes an outbound network connection followed by creating an in-memory file using
the memfd_create syscall. This activity indicates an active attempt to execute a fileless payload and should be
considered highly abnormal or suspicious. This activity can occur when the memfd syscall is utilized to create a memory
resident file, like a payload, and then uses it to execute a process via a command and control channel, resulting in an
exec event.
"""
id = "360f8271-2c39-4b7c-87b8-87ef328ddac7"
license = "Elastic License v2"
name = "Egress Network Connection Followed by Memory File Descriptor Creation"
os_list = ["linux"]
reference = ["https://man7.org/linux/man-pages/man2/memfd_create.2.html"]
version = "1.0.4"
query = '''
sequence with maxspan=10s
[network where event.type == "start" and event.action == "connection_attempted" and (
process.name in (
"bash", "dash", "sh", "tcsh", "tclsh", "wish", "csh", "zsh", "ksh", "fish", "mksh",
"busybox", "pwsh", "deno", "bun", "base64", "rscript", "escript", "java", "javaw",
"r", "julia", "mono", "dotnet-ef", "groovy", "kotlin", "scala", "erlang",
"ocaml", "ocamlopt", "ld.so", "ld-linux-x86-64.so.2", "awk", "gawk", "mawk", "nawk",
"env", "timeout", "nice", "stdbuf", "setsid", "setarch", "unshare", "nsenter", "flock",
"nohup", "runuser", "sudo", "snap", "snap-confine", "snap-exec", "erlexec", "beam.smp"
) or
process.name like ("perl*", "php*", "lua*") or
process.executable like (
"memfd:*", "?memfd:*", "/tmp/*", "/var/tmp/*", "/dev/shm/*", "/run/user/*", "/var/run/user/*",
"/boot/*", "/sys/*", "/lost+found/*", "/proc/*", "/var/mail/*"
)
) and
not (
destination.ip == null or destination.ip == "0.0.0.0" or cidrmatch(
destination.ip, "10.0.0.0/8", "127.0.0.0/8", "169.254.0.0/16", "172.16.0.0/12", "192.0.0.0/24", "192.0.0.0/29",
"192.0.0.8/32", "192.0.0.9/32", "192.0.0.10/32", "192.0.0.170/32", "192.0.0.171/32", "192.0.2.0/24",
"192.31.196.0/24", "192.52.193.0/24", "192.168.0.0/16", "192.88.99.0/24", "224.0.0.0/4", "100.64.0.0/10",
"192.175.48.0/24","198.18.0.0/15", "198.51.100.0/24", "203.0.113.0/24", "240.0.0.0/4", "::1", "FE80::/10",
"FF00::/8"
) or
process.executable like (
"/usr/local/sbin/php-fpm", "/usr/local/cpanel/3rdparty/perl/*/bin/perl", "/snap/android-studio/*/jbr/bin/java",
"/tmp/.mount_*", "/tmp/.tmp*/node", "/usr/sbin/php-fpm*", "/tmp/vscode-komo/*/server/node"
)
)] by process.entity_id
[process where event.type == "start" and event.action == "memfd_create" and
not (
(
process.executable like (
"/home/runner/actions-runner-*/Runner.Listener", "/home/runner/actions-runner-*/Runner.Worker",
"/home/runner/bin/Runner.Listener", "/home/runner/bin/Runner.Worker"
) and
process.Ext.memfd.name == "memfd:doublemapper"
) or
(
process.name like "php*" and
process.Ext.memfd.name in ("memfd:opcache_lock", "memfd:sd-executor-state")
) or
(
process.executable like "/home/*/.cache/camoufox/camoufox-bin" and
process.Ext.memfd.name in ("memfd:mozilla-ipc", "memfd:mozilla-ipc-test")
) or
(
process.name == "praxis_node" and
process.Ext.memfd.name in (
"memfd:doublemapper", "memfd:sd-executor-state", "memfd:allocation fd", "memfd:spawn_stdio_stdin",
"doublemapper", "memfd:/.glXXXXXX", "memfd:pulseaudio"
)
) or
(
process.executable in ("./usr/bin/qemu-s390x", "./usr/bin/qemu-s390x-static") and
process.Ext.memfd.name == "memfd:qemu-open"
) or
(
process.name like "php*" and
process.working_directory like ("/var/www/*", "/builds/php/*")
) or
(
process.name like "php*" and
process.args in ("/usr/bin/composer", "/bin/composer")
) or
process.executable like (
"/tmp/.mount_remp*/zen", "/usr/lib/systemd/systemd", "/usr/libexec/nordlayer/nordlayer-resolvconf",
"/home/*/.vscode-server/*/bin/vsce-sign", "/sbin/apk", "/usr/bin/lxc-info", "/home/*/.local/share/claude/versions/*",
"/tmp/*/.vscode-server/bin/*/node_modules/@vscode/vsce-sign/bin/vsce-sign"
) or
(
process.executable like "/usr/bin/php*" and
process.Ext.memfd.name == "anon_hugepage"
) or
(
process.executable like "/opt/erlang/lib/erlang/erts-*/bin/beam.smp" and
process.args like ("/opt/rabbitmq/escript/rabbitmq-diagnostics", "/opt/erlang/lib/erlang/erts-*/bin/beam.smp")
)
)] by process.parent.entity_id
'''
min_endpoint_version = "9.1.4"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 1
[[actions]]
action = "kill_process"
field = "process.parent.entity_id"
state = 0
[[actions]]
action = "kill_process"
field = "process.parent.entity_id"
state = 1
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1106"
name = "Native API"
reference = "https://attack.mitre.org/techniques/T1106/"
[threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1620"
name = "Reflective Code Loading"
reference = "https://attack.mitre.org/techniques/T1620/"
[threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
[internal]
min_endpoint_version = "9.1.4"
Stages and Predicates
Ordered sequence: each step below must occur in order within 10s, correlated by process.entity_id, process.parent.entity_id.
Stage 1: network
[network where event.type == "start" and event.action == "connection_attempted" and (
process.name in (
"bash", "dash", "sh", "tcsh", "tclsh", "wish", "csh", "zsh", "ksh", "fish", "mksh",
"busybox", "pwsh", "deno", "bun", "base64", "rscript", "escript", "java", "javaw",
"r", "julia", "mono", "dotnet-ef", "groovy", "kotlin", "scala", "erlang",
"ocaml", "ocamlopt", "ld.so", "ld-linux-x86-64.so.2", "awk", "gawk", "mawk", "nawk",
"env", "timeout", "nice", "stdbuf", "setsid", "setarch", "unshare", "nsenter", "flock",
"nohup", "runuser", "sudo", "snap", "snap-confine", "snap-exec", "erlexec", "beam.smp"
) or
process.name like ("perl*", "php*", "lua*") or
process.executable like (
"memfd:*", "?memfd:*", "/tmp/*", "/var/tmp/*", "/dev/shm/*", "/run/user/*", "/var/run/user/*",
"/boot/*", "/sys/*", "/lost+found/*", "/proc/*", "/var/mail/*"
)
) and
not (
destination.ip == null or destination.ip == "0.0.0.0" or cidrmatch(
destination.ip, "10.0.0.0/8", "127.0.0.0/8", "169.254.0.0/16", "172.16.0.0/12", "192.0.0.0/24", "192.0.0.0/29",
"192.0.0.8/32", "192.0.0.9/32", "192.0.0.10/32", "192.0.0.170/32", "192.0.0.171/32", "192.0.2.0/24",
"192.31.196.0/24", "192.52.193.0/24", "192.168.0.0/16", "192.88.99.0/24", "224.0.0.0/4", "100.64.0.0/10",
"192.175.48.0/24","198.18.0.0/15", "198.51.100.0/24", "203.0.113.0/24", "240.0.0.0/4", "::1", "FE80::/10",
"FF00::/8"
) or
process.executable like (
"/usr/local/sbin/php-fpm", "/usr/local/cpanel/3rdparty/perl/*/bin/perl", "/snap/android-studio/*/jbr/bin/java",
"/tmp/.mount_*", "/tmp/.tmp*/node", "/usr/sbin/php-fpm*", "/tmp/vscode-komo/*/server/node"
)
)] by process.entity_id
Stage 2: process
[process where event.type == "start" and event.action == "memfd_create" and
not (
(
process.executable like (
"/home/runner/actions-runner-*/Runner.Listener", "/home/runner/actions-runner-*/Runner.Worker",
"/home/runner/bin/Runner.Listener", "/home/runner/bin/Runner.Worker"
) and
process.Ext.memfd.name == "memfd:doublemapper"
) or
(
process.name like "php*" and
process.Ext.memfd.name in ("memfd:opcache_lock", "memfd:sd-executor-state")
) or
(
process.executable like "/home/*/.cache/camoufox/camoufox-bin" and
process.Ext.memfd.name in ("memfd:mozilla-ipc", "memfd:mozilla-ipc-test")
) or
(
process.name == "praxis_node" and
process.Ext.memfd.name in (
"memfd:doublemapper", "memfd:sd-executor-state", "memfd:allocation fd", "memfd:spawn_stdio_stdin",
"doublemapper", "memfd:/.glXXXXXX", "memfd:pulseaudio"
)
) or
(
process.executable in ("./usr/bin/qemu-s390x", "./usr/bin/qemu-s390x-static") and
process.Ext.memfd.name == "memfd:qemu-open"
) or
(
process.name like "php*" and
process.working_directory like ("/var/www/*", "/builds/php/*")
) or
(
process.name like "php*" and
process.args in ("/usr/bin/composer", "/bin/composer")
) or
process.executable like (
"/tmp/.mount_remp*/zen", "/usr/lib/systemd/systemd", "/usr/libexec/nordlayer/nordlayer-resolvconf",
"/home/*/.vscode-server/*/bin/vsce-sign", "/sbin/apk", "/usr/bin/lxc-info", "/home/*/.local/share/claude/versions/*",
"/tmp/*/.vscode-server/bin/*/node_modules/@vscode/vsce-sign/bin/vsce-sign"
) or
(
process.executable like "/usr/bin/php*" and
process.Ext.memfd.name == "anon_hugepage"
) or
(
process.executable like "/opt/erlang/lib/erlang/erts-*/bin/beam.smp" and
process.args like ("/opt/rabbitmq/escript/rabbitmq-diagnostics", "/opt/erlang/lib/erlang/erts-*/bin/beam.smp")
)
)] 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.executable | wildcard |
| field:"Image" kind:wildcard |
process.name | in |
| field:"process_basename" kind:in |
process.name | wildcard |
| field:"process_basename" kind:wildcard |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
destination.ip | cidr_match | 10.0.0.0/8, 127.0.0.0/8, 169.254.0.0/16, 172.16.0.0/12, 192.0.0.0/24, 192.0.0.0/29, 192.0.0.8/32, 192.0.0.9/32, 192.0.0.10/32, 192.0.0.170/32, 192.0.0.171/32, 192.0.2.0/24, 192.31.196.0/24, 192.52.193.0/24, 192.168.0.0/16, 192.88.99.0/24, 224.0.0.0/4, 100.64.0.0/10, 192.175.48.0/24, 198.18.0.0/15, 198.51.100.0/24, 203.0.113.0/24, 240.0.0.0/4, ::1, FE80::/10, FF00::/8 | 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 | |
process.executable | wildcard | /usr/local/sbin/php-fpm, /usr/local/cpanel/3rdparty/perl/*/bin/perl, /snap/android-studio/*/jbr/bin/java, /tmp/.mount_*, /tmp/.tmp*/node, /usr/sbin/php-fpm*, /tmp/vscode-komo/*/server/node | excludes:process.executable |
process.Ext.memfd.name | eq | anon_hugepage | excludes:process.Ext.memfd.name field:"process.Ext.memfd.name" value:"anon_hugepage" |
process.executable | starts_with | /usr/bin/php | excludes:process.executable field:"process.executable" value:"/usr/bin/php" |
process.Ext.memfd.name | eq | memfd:doublemapper | excludes:process.Ext.memfd.name field:"process.Ext.memfd.name" value:"memfd:doublemapper" |
process.executable | wildcard | /home/runner/actions-runner-*/Runner.Listener, /home/runner/actions-runner-*/Runner.Worker, /home/runner/bin/Runner.Listener, /home/runner/bin/Runner.Worker | excludes:process.executable |
process.Ext.memfd.name | eq | memfd:qemu-open | excludes:process.Ext.memfd.name field:"process.Ext.memfd.name" value:"memfd:qemu-open" |
process.executable | in | ./usr/bin/qemu-s390x, ./usr/bin/qemu-s390x-static | excludes:process.executable field:"process.executable" value:"./usr/bin/qemu-s390x" field:"process.executable" value:"./usr/bin/qemu-s390x-static" |
process.Ext.memfd.name | in | doublemapper, memfd:/.glXXXXXX, memfd:allocation fd, memfd:doublemapper, memfd:pulseaudio, memfd:sd-executor-state, memfd:spawn_stdio_stdin | excludes:process.Ext.memfd.name |
process.name | eq | praxis_node | excludes:process.name field:"process.name" value:"praxis_node" |
process.Ext.memfd.name | in | memfd:mozilla-ipc, memfd:mozilla-ipc-test | excludes:process.Ext.memfd.name field:"process.Ext.memfd.name" value:"memfd:mozilla-ipc" field:"process.Ext.memfd.name" value:"memfd:mozilla-ipc-test" |
process.executable | wildcard | /home/*/.cache/camoufox/camoufox-bin | excludes:process.executable field:"process.executable" value:"/home/*/.cache/camoufox/camoufox-bin" |
process.Ext.memfd.name | in | memfd:opcache_lock, memfd:sd-executor-state | excludes:process.Ext.memfd.name field:"process.Ext.memfd.name" value:"memfd:opcache_lock" field:"process.Ext.memfd.name" value:"memfd:sd-executor-state" |
process.name | starts_with | php | excludes:process.name field:"process.name" value:"php" |
process.args | in | /bin/composer, /usr/bin/composer | excludes:process.args field:"process.args" value:"/bin/composer" field:"process.args" value:"/usr/bin/composer" |
process.args | wildcard | /opt/rabbitmq/escript/rabbitmq-diagnostics, /opt/erlang/lib/erlang/erts-*/bin/beam.smp | excludes:process.args field:"process.args" value:"/opt/rabbitmq/escript/rabbitmq-diagnostics" field:"process.args" value:"/opt/erlang/lib/erlang/erts-*/bin/beam.smp" |
process.executable | wildcard | /opt/erlang/lib/erlang/erts-*/bin/beam.smp | excludes:process.executable field:"process.executable" value:"/opt/erlang/lib/erlang/erts-*/bin/beam.smp" |
process.working_directory | starts_with | /var/www/, /builds/php/ | excludes:process.working_directory field:"process.working_directory" value:"/var/www/" field:"process.working_directory" value:"/builds/php/" |
process.executable | wildcard | /tmp/.mount_remp*/zen, /usr/lib/systemd/systemd, /usr/libexec/nordlayer/nordlayer-resolvconf, /home/*/.vscode-server/*/bin/vsce-sign, /sbin/apk, /usr/bin/lxc-info, /home/*/.local/share/claude/versions/*, /tmp/*/.vscode-server/bin/*/node_modules/@vscode/vsce-sign/bin/vsce-sign | excludes:process.executable |
Exporting Exchange Mailbox via PowerShell
#Identifies the use of the Exchange PowerShell cmdlet, New-MailBoxExportRequest, to export the contents of a primary mailbox or archive to a .pst file. Adversaries may target user email to collect sensitive information.
Known False Positives
- Legitimate exchange system administration activity.
MITRE ATT&CK Coverage
Telemetry Coverage
| Provider | Record / event type |
|---|---|
| Sysmon | Event ID 1: Process creation |
| Security-Auditing | Event ID 4688: A new process has been created. |
Rule Body
[metadata]
creation_date = "2020/12/15"
integration = ["endpoint", "windows", "system", "sentinel_one_cloud_funnel", "m365_defender", "crowdstrike"]
maturity = "production"
updated_date = "2026/05/04"
[rule]
author = ["Elastic"]
description = """
Identifies the use of the Exchange PowerShell cmdlet, New-MailBoxExportRequest, to export the contents of a primary
mailbox or archive to a .pst file. Adversaries may target user email to collect sensitive information.
"""
false_positives = ["Legitimate exchange system administration activity."]
from = "now-9m"
index = [
"endgame-*",
"logs-crowdstrike.fdr*",
"logs-endpoint.events.process-*",
"logs-m365_defender.event-*",
"logs-sentinel_one_cloud_funnel.*",
"logs-system.security*",
"logs-windows.forwarded*",
"logs-windows.sysmon_operational-*",
"winlogbeat-*",
]
language = "eql"
license = "Elastic License v2"
name = "Exporting Exchange Mailbox via PowerShell"
note = """## Triage and analysis
### Investigating Exporting Exchange Mailbox via PowerShell
Email mailboxes and their information can be valuable assets for attackers. Company mailboxes often contain sensitive information such as login credentials, intellectual property, financial data, and personal information, making them high-value targets for malicious actors.
The `New-MailBoxExportRequest` cmdlet is used to begin the process of exporting contents of a primary mailbox or archive to a .pst file. Note that this is done on a per-mailbox basis and this cmdlet is available only in on-premises Exchange.
Attackers can abuse this functionality in preparation for exfiltrating contents, which is likely to contain sensitive and strategic data.
#### Possible investigation steps
- Investigate the process execution chain (parent process tree) for unknown processes. Examine their executable files for prevalence, whether they are located in expected locations, and if they are signed with valid digital signatures.
- Investigate other alerts associated with the user/host during the past 48 hours.
- Investigate the export operation:
- Identify the user account that performed the action and whether it should perform this kind of action.
- Contact the account owner and confirm whether they are aware of this activity.
- Check if this operation was approved and performed according to the organization's change management policy.
- Retrieve the operation status and use the `Get-MailboxExportRequest` cmdlet to review previous requests.
- By default, no group in Exchange has the privilege to import or export mailboxes. Investigate administrators that assigned the "Mailbox Import Export" privilege for abnormal activity.
- Investigate if there is a significant quantity of export requests in the alert timeframe. This operation is done on a per-mailbox basis and can be part of a mass export.
- If the operation was completed successfully:
- Check if the file is on the path specified in the command.
- Investigate if the file was compressed, archived, or retrieved by the attacker for exfiltration.
### False positive analysis
- This mechanism can be used legitimately. Analysts can dismiss the alert if the administrator is aware of the activity and it is done with proper approval.
### Response and remediation
- Initiate the incident response process based on the outcome of the triage.
- If the involved host is not the Exchange server, isolate the host to prevent further post-compromise behavior.
- Use the `Remove-MailboxExportRequest` cmdlet to remove fully or partially completed export requests.
- Prioritize cases that involve personally identifiable information (PII) or other classified data.
- Investigate credential exposure on systems compromised or used by the attacker to ensure all compromised accounts are identified. Reset passwords for these accounts and other potentially compromised credentials, such as email, business systems, and web services.
- Review the privileges of users with the "Mailbox Import Export" privilege to ensure that the least privilege principle is being followed.
- Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
- Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
- Using the incident response data, update logging and audit policies to improve the mean time to detect (MTTD) and the mean time to respond (MTTR).
"""
setup = """## Setup
This rule is designed for data generated by [Elastic Defend](https://www.elastic.co/security/endpoint-security), which provides native endpoint detection and response, along with event enrichments designed to work with our detection rules.
Setup instructions: https://ela.st/install-elastic-defend
### Additional data sources
This rule also supports the following third-party data sources. For setup instructions, refer to the links below:
- [CrowdStrike](https://ela.st/crowdstrike-integration)
- [Microsoft Defender XDR](https://ela.st/m365-defender)
- [SentinelOne Cloud Funnel](https://ela.st/sentinel-one-cloud-funnel)
- [Sysmon Event ID 1 - Process Creation](https://ela.st/sysmon-event-1-setup)
- [Windows Process Creation Logs](https://ela.st/audit-process-creation)
"""
references = [
"https://www.volexity.com/blog/2020/12/14/dark-halo-leverages-solarwinds-compromise-to-breach-organizations/",
"https://docs.microsoft.com/en-us/powershell/module/exchange/new-mailboxexportrequest?view=exchange-ps",
"https://www.elastic.co/security-labs/siestagraph-new-implant-uncovered-in-asean-member-foreign-ministry",
]
risk_score = 47
rule_id = "6aace640-e631-4870-ba8e-5fdda09325db"
severity = "medium"
tags = [
"Domain: Endpoint",
"OS: Windows",
"Use Case: Threat Detection",
"Tactic: Collection",
"Tactic: Execution",
"Resources: Investigation Guide",
"Data Source: Elastic Endgame",
"Data Source: Elastic Defend",
"Data Source: SentinelOne",
"Data Source: Microsoft Defender XDR",
"Data Source: Windows Security Event Logs",
"Data Source: Crowdstrike",
"Data Source: Sysmon",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
process where host.os.type == "windows" and event.type == "start" and
process.name: ("powershell.exe", "pwsh.exe", "powershell_ise.exe") and
process.command_line : ("*MailboxExportRequest*", "*-Mailbox*-ContentFilter*")
'''
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1005"
name = "Data from Local System"
reference = "https://attack.mitre.org/techniques/T1005/"
[[rule.threat.technique]]
id = "T1114"
name = "Email Collection"
reference = "https://attack.mitre.org/techniques/T1114/"
[[rule.threat.technique.subtechnique]]
id = "T1114.001"
name = "Local Email Collection"
reference = "https://attack.mitre.org/techniques/T1114/001/"
[[rule.threat.technique.subtechnique]]
id = "T1114.002"
name = "Remote Email Collection"
reference = "https://attack.mitre.org/techniques/T1114/002/"
[rule.threat.tactic]
id = "TA0009"
name = "Collection"
reference = "https://attack.mitre.org/tactics/TA0009/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1059"
name = "Command and Scripting Interpreter"
reference = "https://attack.mitre.org/techniques/T1059/"
[[rule.threat.technique.subtechnique]]
id = "T1059.001"
name = "PowerShell"
reference = "https://attack.mitre.org/techniques/T1059/001/"
[rule.threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
Stages and Predicates
Stage 1: process
process where host.os.type == "windows" and event.type == "start" and
process.name: ("powershell.exe", "pwsh.exe", "powershell_ise.exe") and
process.command_line : ("*MailboxExportRequest*", "*-Mailbox*-ContentFilter*")
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.type | eq |
| field:"event.type" kind:eq value:"start" |
process.command_line | wildcard |
| field:"CommandLine" kind:wildcard |
process.name | wildcard |
| field:"process_basename" kind:wildcard |
First Seen Network Flow Exporter Followed by Suspicious Source Activity
#Identifies a newly observed NetFlow, IPFIX, or sFlow exporter IP followed by another detection alert with medium-or-higher severity or an elevated risk score, where that exporter IP is the source of the detected activity in the same data stream namespace. This correlation adds behavioral evidence that can help distinguish routine exporter onboarding from a potentially unauthorized or compromised exporter introduced as part of defense evasion.
Known False Positives
- Newly deployed network devices may legitimately generate other detection alerts during commissioning, testing, vulnerability scanning, or monitoring validation. Shared addresses, network address translation, and incomplete asset attribution can also cause unrelated activity to correlate to the exporter IP.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Defense Impairment |
Rule Body
[metadata]
creation_date = "2026/08/24"
integration = ["netflow", "goflow2"]
maturity = "production"
updated_date = "2026/09/08"
[rule]
author = ["Elastic"]
description = """
Identifies a newly observed NetFlow, IPFIX, or sFlow exporter IP followed by another detection alert with
medium-or-higher severity or an elevated risk score, where that exporter IP is the source of the detected activity in
the same data stream namespace. This correlation adds behavioral evidence that can help distinguish routine exporter
onboarding from a potentially unauthorized or compromised exporter introduced as part of defense evasion.
"""
false_positives = [
"""
Newly deployed network devices may legitimately generate other detection alerts during commissioning, testing,
vulnerability scanning, or monitoring validation. Shared addresses, network address translation, and incomplete
asset attribution can also cause unrelated activity to correlate to the exporter IP.
""",
]
from = "now-45m"
interval = "15m"
language = "esql"
license = "Elastic License v2"
name = "First Seen Network Flow Exporter Followed by Suspicious Source Activity"
note = """## Triage and analysis
### Investigating First Seen Network Flow Exporter Followed by Suspicious Source Activity
This higher-order rule correlates the building-block alert "First Seen Network Flow Exporter" with a later detection
alert that has medium-or-higher severity or an elevated risk score within 30 minutes. The new exporter's `observer.ip`
must equal the later alert's `source.ip`, and both alerts must share the same `data_stream.namespace`.
This relationship provides stronger evidence than suspicious flows merely reported by the exporter. It indicates that
the exporter address itself was subsequently identified as the source of separately detected activity. It does not by
itself prove telemetry injection, exporter compromise, or the addition of a rogue collector. A rogue collector receives
flow exports and generally requires network-device configuration or audit telemetry to detect directly.
### Possible investigation steps
- Review the `observer.ip`, `source.ip`, correlation timestamps, and suspicious rule names and IDs surfaced in the
alert. Pivot to the contributing alerts to review their risk score, destination, host, and user context.
- Confirm that `observer.ip` belongs to the newly observed exporter and that NAT, shared addressing, or stale asset
records did not cause the correlation.
- Examine the second alert's rule name and determine what behavior associated the exporter address with `source.ip`.
- Verify the exporter's owner, device type, software version, management plane, recent configuration changes, and
approved collector destinations.
- Review authentication, process, network-device audit, and configuration telemetry for the exporter around the
correlation window.
- Compare observation domains, exporter version, uptime, sequence values, templates, sampling configuration, and flow
volume with established exporters.
- Search for additional alerts involving the exporter address and for malformed, implausible, or conflicting flow
records received from it.
### False positive analysis
- Validate recent device onboarding, migrations, disaster-recovery activation, penetration tests, vulnerability scans,
and monitoring validation.
- Determine whether `source.ip` represents the exporter itself or a shared NAT, proxy, scanner, or management address.
- Confirm that the correlated source alert is a meaningful behavioral detection rather than an expected administrative
or discovery event.
### Response and remediation
- If the exporter is unauthorized or compromised, restrict it at the collector boundary and isolate its management
plane as appropriate.
- Preserve flow records, source alerts, configuration history, authentication events, and network evidence.
- Remove unauthorized export configuration, restore trusted device configuration, rotate affected credentials, and
review collector ACLs and authentication.
"""
references = [
"https://www.elastic.co/docs/solutions/security/detect-and-alert/about-building-block-rules",
"https://www.elastic.co/docs/reference/integrations/netflow",
"https://www.elastic.co/docs/reference/integrations/goflow2",
"https://datatracker.ietf.org/doc/html/rfc7011",
"https://sflow.org/sflow_version_5.txt",
]
risk_score = 73
rule_id = "882c8edc-1e39-4a60-80b2-485491b6c91c"
setup = """## Setup
Enable the building-block rule "First Seen Network Flow Exporter" and detection rules that can identify suspicious
activity with `source.ip` populated. The building-block rule requires decoded NetFlow, IPFIX, or sFlow records from the
Elastic NetFlow (`netflow.log`) or GoFlow2 (`goflow2.sflow`) integration.
The higher-order rule searches Elastic Security alert indices. The correlated source alert must preserve the exporter
address in `source.ip` and preserve `data_stream.namespace`; alerts without either field cannot contribute to this
correlation. Building-block, higher-order, machine-learning, new-terms, threat-match, and deprecated-rule alerts are
excluded as the second event.
"""
severity = "high"
tags = [
"Domain: Network",
"Use Case: Network Security Monitoring",
"Use Case: Threat Detection",
"Tactic: Defense Evasion",
"Rule Type: Higher-Order Rule",
"Data Source: Elastic Security",
"Data Source: NetFlow",
"Data Source: GoFlow2",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "esql"
query = '''
FROM .alerts-security.*
| WHERE event.kind == "signal"
AND data_stream.namespace IS NOT NULL
AND (
(kibana.alert.rule.rule_id == "dfe3f626-4224-417e-aff1-8ef9a72c3191" AND observer.ip IS NOT NULL)
OR
(source.ip IS NOT NULL
AND kibana.alert.rule.name IS NOT NULL
AND kibana.alert.rule.rule_id IS NOT NULL
AND kibana.alert.rule.rule_id != "dfe3f626-4224-417e-aff1-8ef9a72c3191"
AND (kibana.alert.risk_score >= 47 OR kibana.alert.severity IN ("medium", "high", "critical"))
AND KQL("""NOT kibana.alert.building_block_type : *""")
AND NOT kibana.alert.rule.type IN ("machine_learning", "new_terms", "threat_match")
AND NOT kibana.alert.rule.name LIKE "Deprecated - *"
AND NOT KQL("""kibana.alert.rule.tags : "Rule Type: Higher-Order Rule" """))
)
| EVAL
Esql.is_exporter_alert = kibana.alert.rule.rule_id == "dfe3f626-4224-417e-aff1-8ef9a72c3191",
Esql.is_suspicious_source_alert = kibana.alert.rule.rule_id != "dfe3f626-4224-417e-aff1-8ef9a72c3191",
Esql.correlation_ip = CASE(Esql.is_exporter_alert, observer.ip, source.ip),
Esql.exporter_alert_timestamp = CASE(Esql.is_exporter_alert, @timestamp, null),
Esql.suspicious_source_alert_timestamp = CASE(Esql.is_suspicious_source_alert, @timestamp, null),
Esql.suspicious_rule_name = CASE(Esql.is_suspicious_source_alert, kibana.alert.rule.name, null),
Esql.suspicious_rule_id = CASE(Esql.is_suspicious_source_alert, kibana.alert.rule.rule_id, null)
| WHERE Esql.correlation_ip IS NOT NULL
| STATS
Esql.exporter_alert_count = SUM(CASE(Esql.is_exporter_alert, 1, 0)),
Esql.suspicious_source_alert_count = SUM(CASE(Esql.is_suspicious_source_alert, 1, 0)),
observer.ip = MAX(CASE(Esql.is_exporter_alert, Esql.correlation_ip, null)),
source.ip = MAX(CASE(Esql.is_suspicious_source_alert, Esql.correlation_ip, null)),
Esql.exporter_alert_timestamp = MIN(Esql.exporter_alert_timestamp),
Esql.suspicious_source_alert_timestamp = MAX(Esql.suspicious_source_alert_timestamp),
Esql.suspicious_rule_name_values = VALUES(Esql.suspicious_rule_name),
Esql.suspicious_rule_id_values = VALUES(Esql.suspicious_rule_id)
BY data_stream.namespace, Esql.correlation_ip
| EVAL Esql.time_diff_seconds = DATE_DIFF(
"second", Esql.exporter_alert_timestamp, Esql.suspicious_source_alert_timestamp
)
| WHERE Esql.exporter_alert_count > 0
AND Esql.suspicious_source_alert_count > 0
AND Esql.time_diff_seconds >= 0
AND Esql.time_diff_seconds <= 1800
| KEEP
data_stream.namespace,
observer.ip,
source.ip,
Esql.correlation_ip,
Esql.exporter_alert_count,
Esql.suspicious_source_alert_count,
Esql.exporter_alert_timestamp,
Esql.suspicious_source_alert_timestamp,
Esql.suspicious_rule_name_values,
Esql.suspicious_rule_id_values,
Esql.time_diff_seconds
'''
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1562"
name = "Impair Defenses"
reference = "https://attack.mitre.org/techniques/T1562/"
[rule.threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
[rule.investigation_fields]
field_names = [
"observer.ip",
"source.ip",
"data_stream.namespace",
"Esql.exporter_alert_timestamp",
"Esql.suspicious_source_alert_timestamp",
"Esql.suspicious_rule_name_values",
"Esql.suspicious_rule_id_values",
"Esql.time_diff_seconds",
]
Stages and Predicates
Stage 1: from
FROM .alerts-security.*
Stage 2: where
| WHERE event.kind == "signal"
AND data_stream.namespace IS NOT NULL
AND (
(kibana.alert.rule.rule_id == "dfe3f626-4224-417e-aff1-8ef9a72c3191" AND observer.ip IS NOT NULL)
OR
(source.ip IS NOT NULL
AND kibana.alert.rule.name IS NOT NULL
AND kibana.alert.rule.rule_id IS NOT NULL
AND kibana.alert.rule.rule_id != "dfe3f626-4224-417e-aff1-8ef9a72c3191"
AND (kibana.alert.risk_score >= 47 OR kibana.alert.severity IN ("medium", "high", "critical"))
AND KQL("""NOT kibana.alert.building_block_type : *""")
AND NOT kibana.alert.rule.type IN ("machine_learning", "new_terms", "threat_match")
AND NOT kibana.alert.rule.name LIKE "Deprecated - *"
AND NOT KQL("""kibana.alert.rule.tags : "Rule Type: Higher-Order Rule" """))
)
Stage 3: eval
| EVAL
Esql.is_exporter_alert = kibana.alert.rule.rule_id == "dfe3f626-4224-417e-aff1-8ef9a72c3191",
Esql.is_suspicious_source_alert = kibana.alert.rule.rule_id != "dfe3f626-4224-417e-aff1-8ef9a72c3191",
Esql.correlation_ip = CASE(Esql.is_exporter_alert, observer.ip, source.ip),
Esql.exporter_alert_timestamp = CASE(Esql.is_exporter_alert, @timestamp, null),
Esql.suspicious_source_alert_timestamp = CASE(Esql.is_suspicious_source_alert, @timestamp, null),
Esql.suspicious_rule_name = CASE(Esql.is_suspicious_source_alert, kibana.alert.rule.name, null),
Esql.suspicious_rule_id = CASE(Esql.is_suspicious_source_alert, kibana.alert.rule.rule_id, null)
Esql.correlation_ip =Esql.is_exporter_alertobserver.ipsource.ipEsql.exporter_alert_timestamp =Esql.is_exporter_alert@timestampnullEsql.suspicious_rule_id =Esql.is_suspicious_source_alertkibana.alert.rule.rule_idnullEsql.suspicious_rule_name =Esql.is_suspicious_source_alertkibana.alert.rule.namenullEsql.suspicious_source_alert_timestamp =Esql.is_suspicious_source_alert@timestampnullStage 4: where
| WHERE Esql.correlation_ip IS NOT NULL
Stage 5: stats
| STATS
Esql.exporter_alert_count = SUM(CASE(Esql.is_exporter_alert, 1, 0)),
Esql.suspicious_source_alert_count = SUM(CASE(Esql.is_suspicious_source_alert, 1, 0)),
observer.ip = MAX(CASE(Esql.is_exporter_alert, Esql.correlation_ip, null)),
source.ip = MAX(CASE(Esql.is_suspicious_source_alert, Esql.correlation_ip, null)),
Esql.exporter_alert_timestamp = MIN(Esql.exporter_alert_timestamp),
Esql.suspicious_source_alert_timestamp = MAX(Esql.suspicious_source_alert_timestamp),
Esql.suspicious_rule_name_values = VALUES(Esql.suspicious_rule_name),
Esql.suspicious_rule_id_values = VALUES(Esql.suspicious_rule_id)
BY data_stream.namespace, Esql.correlation_ip
Stage 6: eval
| EVAL Esql.time_diff_seconds = DATE_DIFF(
"second", Esql.exporter_alert_timestamp, Esql.suspicious_source_alert_timestamp
)
Stage 7: where
| WHERE Esql.exporter_alert_count > 0
AND Esql.suspicious_source_alert_count > 0
AND Esql.time_diff_seconds >= 0
AND Esql.time_diff_seconds <= 1800
Stage 8: keep
| KEEP
data_stream.namespace,
observer.ip,
source.ip,
Esql.correlation_ip,
Esql.exporter_alert_count,
Esql.suspicious_source_alert_count,
Esql.exporter_alert_timestamp,
Esql.suspicious_source_alert_timestamp,
Esql.suspicious_rule_name_values,
Esql.suspicious_rule_id_values,
Esql.time_diff_seconds
Indicators
These rows show field, operator, and value matches.
Output Fields
These fields are emitted when the rule matches.
| Field | Source |
|---|---|
data_stream.namespace | KEEP data_stream.namespace |
observer.ip | KEEP observer.ip |
source.ip | KEEP source.ip |
Esql.correlation_ip | KEEP Esql.correlation_ip |
Esql.exporter_alert_count | KEEP Esql.exporter_alert_count |
Esql.suspicious_source_alert_count | KEEP Esql.suspicious_source_alert_count |
Esql.exporter_alert_timestamp | KEEP Esql.exporter_alert_timestamp |
Esql.suspicious_source_alert_timestamp | KEEP Esql.suspicious_source_alert_timestamp |
Esql.suspicious_rule_name_values | KEEP Esql.suspicious_rule_name_values |
Esql.suspicious_rule_id_values | KEEP Esql.suspicious_rule_id_values |
Esql.time_diff_seconds | KEEP Esql.time_diff_seconds |
GKE Cluster-Admin Role Binding Created or Modified
#Detects creation or modification of a GKE ClusterRoleBinding that grants the cluster-admin ClusterRole, providing unrestricted cluster access and enabling rapid privilege escalation or persistence.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Persistence | |
| Privilege Escalation |
Telemetry Coverage
Rules Detecting the Same Action
These rules filter on the same operation.
- Direct Interactive Kubernetes API Request by Unusual Utilities (Elastic)
- GKE Creation of a RoleBinding Referencing a ServiceAccount (Elastic)
- GKE Service Account Modified RBAC Objects (Elastic)
- Google Cloud Kubernetes RoleBinding (Sigma)
- Kubernetes Cluster-Admin Role Binding Created (Elastic)
- Kubernetes ClusterRoleBinding to Privileged Role (Panther)
- Kubernetes Creation of a RoleBinding Referencing a ServiceAccount (Elastic)
- Kubernetes Rolebinding Modification (Sigma)
Rule Body
[metadata]
creation_date = "2026/06/30"
integration = ["gcp"]
maturity = "production"
updated_date = "2026/07/10"
[rule]
author = ["Elastic"]
description = """
Detects creation or modification of a GKE ClusterRoleBinding that grants the cluster-admin ClusterRole, providing
unrestricted cluster access and enabling rapid privilege escalation or persistence.
"""
index = ["logs-gcp.audit-*"]
language = "kuery"
license = "Elastic License v2"
name = "GKE Cluster-Admin Role Binding Created or Modified"
note = """## Triage and analysis
### Investigating GKE Cluster-Admin Role Binding Created or Modified
Identify who created or changed the binding and which subject received cluster-admin.
### Investigation steps
- Review `client.user.email`, `source.ip`, and `gcp.audit.request` for the bound subject.
- Hunt for secret reads, privileged pod creation, or webhook changes from the same actor or new subject.
### False positives
- Bootstrap and recovery may recreate cluster-admin bindings via `system:apiserver` during control plane reconciliation (excluded).
"""
setup = "The GCP Fleet integration with GKE audit logs enabled is required to be compatible with this rule."
references = [
"https://cloud.google.com/kubernetes-engine/docs/how-to/role-based-access-control",
"https://heilancoos.github.io/research/2025/12/16/kubernetes.html#overly-permissive-role-based-access-control",
]
risk_score = 47
rule_id = "16708afb-4904-4d3c-af78-63640a075cb0"
severity = "medium"
tags = [
"Domain: Cloud",
"Domain: Kubernetes",
"Data Source: GCP",
"Data Source: Google Cloud Platform",
"Use Case: Threat Detection",
"Tactic: Persistence",
"Tactic: Privilege Escalation",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "query"
query = '''
data_stream.dataset:gcp.audit and service.name:"k8s.io" and event.outcome:success and
event.action:(
"io.k8s.authorization.rbac.v1.clusterrolebindings.create" or
"io.k8s.authorization.rbac.v1.clusterrolebindings.patch" or
"io.k8s.authorization.rbac.v1.clusterrolebindings.update"
) and gcp.audit.request.kind:"ClusterRoleBinding" and
gcp.audit.resource_name:"rbac.authorization.k8s.io/v1/clusterrolebindings/cluster-admin" and
not client.user.email:"system:apiserver"
'''
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1098"
name = "Account Manipulation"
reference = "https://attack.mitre.org/techniques/T1098/"
[[rule.threat.technique.subtechnique]]
id = "T1098.006"
name = "Additional Container Cluster Roles"
reference = "https://attack.mitre.org/techniques/T1098/006/"
[rule.threat.tactic]
id = "TA0003"
name = "Persistence"
reference = "https://attack.mitre.org/tactics/TA0003/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1098"
name = "Account Manipulation"
reference = "https://attack.mitre.org/techniques/T1098/"
[[rule.threat.technique.subtechnique]]
id = "T1098.006"
name = "Additional Container Cluster Roles"
reference = "https://attack.mitre.org/techniques/T1098/006/"
[rule.threat.tactic]
id = "TA0004"
name = "Privilege Escalation"
reference = "https://attack.mitre.org/tactics/TA0004/"
[rule.investigation_fields]
field_names = [
"@timestamp",
"client.user.email",
"source.ip",
"user_agent.original",
"event.action",
"event.outcome",
"gcp.audit.resource_name",
"gcp.audit.request.kind",
"gcp.audit.request.roleRef.name",
"gcp.audit.request.subjects.name",
"data_stream.namespace",
]
Stages and Predicates
Stage 1: query
data_stream.dataset:gcp.audit and service.name:"k8s.io" and event.outcome:success and
event.action:(
"io.k8s.authorization.rbac.v1.clusterrolebindings.create" or
"io.k8s.authorization.rbac.v1.clusterrolebindings.patch" or
"io.k8s.authorization.rbac.v1.clusterrolebindings.update"
) and gcp.audit.request.kind:"ClusterRoleBinding" and
gcp.audit.resource_name:"rbac.authorization.k8s.io/v1/clusterrolebindings/cluster-admin" and
not client.user.email:"system:apiserver"
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
data_stream.dataset | eq |
| field:"data_stream.dataset" kind:eq value:"gcp.audit" |
event.action | in |
| field:"EventType" kind:in |
event.outcome | eq |
| field:"event.outcome" kind:eq value:"success" |
gcp.audit.request.kind | eq |
| field:"gcp.audit.request.kind" kind:eq value:"ClusterRoleBinding" |
gcp.audit.resource_name | eq |
| field:"gcp.audit.resource_name" kind:eq value:"rbac.authorization.k8s.io/v1/clusterrolebindings/cluster-admin" |
service.name | eq |
| field:"ServiceName" kind:eq value:"k8s.io" |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
client.user.email | eq | system:apiserver | excludes:client.user.email field:"client.user.email" value:"system:apiserver" |
Keystroke Input Capture via RegisterRawInputDevices
#Identifies attempts to register for input from the keyboard using RegisterRawInputDevices API. Adversaries may log user keystrokes to intercept credentials or other information from the user as the user types them.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Collection |
Rule Body
[rule]
description = """
Identifies attempts to register for input from the keyboard using RegisterRawInputDevices API. Adversaries may log user
keystrokes to intercept credentials or other information from the user as the user types them.
"""
id = "4dbb9dfb-b3e2-49d7-8919-d6f221526df4"
license = "Elastic License v2"
name = "Keystroke Input Capture via RegisterRawInputDevices"
os_list = ["windows"]
reference = [
"https://attack.mitre.org/techniques/T1056/001/",
"https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-registerrawinputdevices",
"https://www.cyberbit.com/endpoint-security/hawkeye-malware-keylogging-technique/",
"https://www.elastic.co/security-labs/protecting-your-devices-from-information-theft-keylogger-protection",
]
version = "1.0.15"
query = '''
api where
process.Ext.api.name == "RegisterRawInputDevices" and not process.code_signature.status : "trusted" and
process.Ext.api.parameters.usage == "KEYBOARD" and
process.Ext.api.parameters.flags like "*INPUTSINK*" and process.thread.Ext.call_stack_summary : "?*" and
process.thread.Ext.call_stack_final_user_module.hash.sha256 != null and process.executable != null and
not process.thread.Ext.call_stack_final_user_module.path :
("*\\program files*", "*\\windows\\system32\\*", "*\\windows\\syswow64\\*",
"*\\windows\\systemapps\\*",
"*\\users\\*\\appdata\\local\\*\\kumospace.exe",
"*\\users\\*\\appdata\\local\\microsoft\\teams\\current\\teams.exe") and
not process.executable : ("?:\\Program Files\\*.exe", "?:\\Program Files (x86)\\*.exe") and
process.thread.Ext.call_stack_final_user_module.hash.sha256 in
("2e2dc7f8da5e1cc8510e0b3724dc4448a693f3fb76891cea7be5973aa9d94034",
"9e039448344e4f70122a9cb2416cf282d26033ec8a81b3084c8e7076e3242d8b")
'''
min_endpoint_version = "8.12.0"
optional_actions = []
reputation = true
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1056"
name = "Input Capture"
reference = "https://attack.mitre.org/techniques/T1056/"
[[threat.technique.subtechnique]]
id = "T1056.001"
name = "Keylogging"
reference = "https://attack.mitre.org/techniques/T1056/001/"
[threat.tactic]
id = "TA0009"
name = "Collection"
reference = "https://attack.mitre.org/tactics/TA0009/"
[internal]
min_endpoint_version = "8.12.0"
Stages and Predicates
Stage 1: api
api where
process.Ext.api.name == "RegisterRawInputDevices" and not process.code_signature.status : "trusted" and
process.Ext.api.parameters.usage == "KEYBOARD" and
process.Ext.api.parameters.flags like "*INPUTSINK*" and process.thread.Ext.call_stack_summary : "?*" and
process.thread.Ext.call_stack_final_user_module.hash.sha256 != null and process.executable != null and
not process.thread.Ext.call_stack_final_user_module.path :
("*\\program files*", "*\\windows\\system32\\*", "*\\windows\\syswow64\\*",
"*\\windows\\systemapps\\*",
"*\\users\\*\\appdata\\local\\*\\kumospace.exe",
"*\\users\\*\\appdata\\local\\microsoft\\teams\\current\\teams.exe") and
not process.executable : ("?:\\Program Files\\*.exe", "?:\\Program Files (x86)\\*.exe") and
process.thread.Ext.call_stack_final_user_module.hash.sha256 in
("2e2dc7f8da5e1cc8510e0b3724dc4448a693f3fb76891cea7be5973aa9d94034",
"9e039448344e4f70122a9cb2416cf282d26033ec8a81b3084c8e7076e3242d8b")
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
process.Ext.api.name | eq |
| field:"process.Ext.api.name" kind:eq value:"RegisterRawInputDevices" |
process.Ext.api.parameters.flags | wildcard |
| field:"process.Ext.api.parameters.flags" kind:wildcard value:"*INPUTSINK*" |
process.Ext.api.parameters.usage | eq |
| field:"process.Ext.api.parameters.usage" kind:eq value:"KEYBOARD" |
process.executable | is_not_null | field:"Image" kind:is_not_null | |
process.thread.Ext.call_stack_final_user_module.hash.sha256 | in |
| field:"process.thread.Ext.call_stack_final_user_module.hash.sha256" kind:in |
process.thread.Ext.call_stack_final_user_module.hash.sha256 | is_not_null | field:"process.thread.Ext.call_stack_final_user_module.hash.sha256" kind:is_not_null | |
process.thread.Ext.call_stack_summary | wildcard |
| field:"process.thread.Ext.call_stack_summary" kind:wildcard value:"?*" |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.code_signature.status | eq | trusted | excludes:process.code_signature.status field:"process.code_signature.status" value:"trusted" |
process.executable | wildcard | ?:\Program Files\*.exe, ?:\Program Files (x86)\*.exe | excludes:process.executable field:"process.executable" value:"?:\Program Files\*.exe" field:"process.executable" value:"?:\Program Files (x86)\*.exe" |
process.thread.Ext.call_stack_final_user_module.path | wildcard | *\program files*, *\windows\system32\*, *\windows\syswow64\*, *\windows\systemapps\*, *\users\*\appdata\local\*\kumospace.exe, *\users\*\appdata\local\microsoft\teams\current\teams.exe | excludes:process.thread.Ext.call_stack_final_user_module.path |
NTDLL Memory Protection Change via Unsigned DLL
#Identifies attempts to change memory protection of NTDLL from an unsigned final user module, this module is often targeted by malware for functions unhooking.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Stealth |
Rule Body
[rule]
description = """
Identifies attempts to change memory protection of NTDLL from an unsigned final user module, this module is often
targeted by malware for functions unhooking.
"""
id = "29688edf-a003-42e4-8d79-c958cffce9fc"
license = "Elastic License v2"
name = "NTDLL Memory Protection Change via Unsigned DLL"
os_list = ["windows"]
version = "1.0.5"
query = '''
api where process.Ext.api.name == "VirtualProtect" and process.Ext.token.integrity_level_name != "low" and
process.Ext.api.metadata.target_address_name == "ntdll.dll" and
process.thread.Ext.call_stack_final_user_module.hash.sha256 != null and process.Ext.api.parameters.size > 4096 and
_arraysearch(process.thread.Ext.call_stack_final_user_module.code_signature, $entry, $entry.trusted == false or $entry.exists == false) and
not _arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info: ("*ntdll.dll!LdrLoadDll*", "*ntdll.dll!LdrUnloadDll*", "*ntdll.dll!LdrShutdownProcess*")) and
not process.thread.Ext.call_stack_final_user_module.path like
("?:\\program files\\*",
"?:\\program files (x86)\\*",
"?:\\windows\\assembly\\nativeimages_*",
"?:\\windows\\syswow64\\cyinjct.dll",
"?:\\windows\\system32\\tmumh\\*\\tmmon64.dll",
"?:\\windows\\winsxs\\*\\mfc??.dll") and
not process.thread.Ext.call_stack_final_hook_module.path like ("c:\\program files\\*", "c:\\program files (x86)\\*") and
not (process.Ext.api.parameters.size == 4096 and
_arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info: ("*chrome_elf.dll!GetInstallDetailsPayload*", "*chrome_elf.dll!DumpHungProcessWithPtype_ExportThunk*", "*mozglue.dll!??MAwakeTimeStamp*", "*firefox.exe!TargetNtUnmapViewOfSection*", "*firefox.exe!IsSandboxedProcess*"))) and
not process.thread.Ext.call_stack_final_user_module.protection_provenance_path like ("c:\\program files\\*", "c:\\program files (x86)\\*", "c:\\windows\\assembly\\nativeimages_*") and
not _arraysearch(process.thread.Ext.call_stack_final_user_module.code_signature, $entry,
$entry.trusted == true and $entry.subject_name in ("Carbon Black, Inc.", "MUSARUBRA US LLC", "Microsoft Windows Hardware Compatibility Publisher", "Kaspersky Lab JSC", "AO Kaspersky Lab", "Palo Alto Networks (Netherlands) B.V.", "G DATA CyberDefense AG")) and
not process.thread.Ext.call_stack_final_user_module.hash.sha256 in ("b27b7d2ac43c6c734aa9e370afc987704f4bd8ba11bc5199a8c3bc5b07b2600c",
"85f238fb7ace3cbdf7c29c72b01307c440f13491b07a509cbc5b9f257a637164",
"55f3206cf9bb092aef6a61508683144afe21ddf930686433bb233e2e233be38c",
"b152de9afc373bba831dc9c1b137668462ae6d46ccd46815f2ffcc7f1bfc7056",
"991042b4a0eb46fdfddb6f9118d046dc1ff500743ff01a8584ad5e73c092b188",
"7f6f5855d4968235163d75c62ab82e8fdc7cf3c83de34e3c5a0666e2d08a0001",
"b27b7d2ac43c6c734aa9e370afc987704f4bd8ba11bc5199a8c3bc5b07b2600c",
"ddcbecf2cd2cd4904cf21e3db40c6a918df0ed3b258473fc5d6e2688dee72696",
"18d1bae077da62bb5cf5bfa6a6c5c38ac9ade57f098ea2b357fab477e85f1c25",
"a0c662a21ba02f2b997907ad113097856916fc3683331e24d065e864213ff379",
"16f1b19c60f80ae33c5b4fef4acd38454f11bbc965dcdd622db0d1c5bb65b931",
"023983f43bb97fd6c909df5012c142140650eff6921a9b0db33c0f558402988d",
"01f46f2401df22465bf2b3f3d59343d14dcf6aada6747e386f1adb965af7b3c3",
"680dc9c393faad3851147bcbb3c5a1fd29b8ed61ddf1bf416f4415132d85f784",
"d59c12264054c84d5e988d4c340fe9d83d2f646f240b5fd52b9bf8564b0dd164",
"9becd39f90077a5ab064681c0a1be139d15be9ce434bacd48cd1dc894d3911cb",
"bb7b4184ea19f248c34f6fb670d37e3062f1648aacc98e009cec1a58c78e8871",
"8df8b4e86a9e96baa92bcd9cf1fca189565a90d815630df899d72ac6eefcf852",
"1902241e12adbdf40ed4dafc410ccbcf8e07fce117d540dabbc2f75ff371f5be",
"7117da40b5cd080575863842e2281576f9b6d1d41cb250690a13aef9cc6436c5",
"e06439cebb8280c46d0aa538ec89b4af4659e7f2915c5787b239871c9dfd65a5",
"f5f02a15419cbad6b0ea2eb9e986d25f13d23abf8e6b8b32ccf18e427f6c48aa",
"2496a1ad22ed1917037e5d6747e5401c50612cb0e3c9cf32a3a1233ebb53207c",
"4b0b5c6e06f7df6dd89dcb027200f6f86b7b4d7dc274a095a82bb609d8cdbe38",
"05b70f473543119cd831f9fc1cd2fbcdc7a3e1938c8a5cb208a2dda017433a7d",
"967189adfbc889fde89aafc867f7a1f02731f8592cf6fd5a4ace1929213e2e13",
"f216ea8efb5b3bb9ad3d938fb9ac07e3b8f78c2c92faab03d2c468d0b6798a5a",
"dea0369456f49fcb4fc5afa42fffb69ae1e19ea238d18e32d9c498d69ab12c69",
"4d40d7064907cf932abae04ef8864ca7288af6993e1ff9e958bd9ac756f62808",
"bfe6fd180245ec727fbc538b11ed59d714b3d794d4fadb2dc76d8a019422066a",
"90c2f3d2bceafb50fb4468bda7a68025f12a23673f151839cae56e2b1ce0a74d",
"3c3c4dcec5b68807e874455021a133b5f5945af86cb9149efed146065201039a",
"cb7ab3788d10940df874acd97b1821bbb5ee4a91f3eec11982bb5bf7a3c96443")
'''
min_endpoint_version = "8.16.0"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1620"
name = "Reflective Code Loading"
reference = "https://attack.mitre.org/techniques/T1620/"
[threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
[internal]
min_endpoint_version = "8.16.0"
Stages and Predicates
Stage 1: api
api where process.Ext.api.name == "VirtualProtect" and process.Ext.token.integrity_level_name != "low" and
process.Ext.api.metadata.target_address_name == "ntdll.dll" and
process.thread.Ext.call_stack_final_user_module.hash.sha256 != null and process.Ext.api.parameters.size > 4096 and
_arraysearch(process.thread.Ext.call_stack_final_user_module.code_signature, $entry, $entry.trusted == false or $entry.exists == false) and
not _arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info: ("*ntdll.dll!LdrLoadDll*", "*ntdll.dll!LdrUnloadDll*", "*ntdll.dll!LdrShutdownProcess*")) and
not process.thread.Ext.call_stack_final_user_module.path like
("?:\\program files\\*",
"?:\\program files (x86)\\*",
"?:\\windows\\assembly\\nativeimages_*",
"?:\\windows\\syswow64\\cyinjct.dll",
"?:\\windows\\system32\\tmumh\\*\\tmmon64.dll",
"?:\\windows\\winsxs\\*\\mfc??.dll") and
not process.thread.Ext.call_stack_final_hook_module.path like ("c:\\program files\\*", "c:\\program files (x86)\\*") and
not (process.Ext.api.parameters.size == 4096 and
_arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info: ("*chrome_elf.dll!GetInstallDetailsPayload*", "*chrome_elf.dll!DumpHungProcessWithPtype_ExportThunk*", "*mozglue.dll!??MAwakeTimeStamp*", "*firefox.exe!TargetNtUnmapViewOfSection*", "*firefox.exe!IsSandboxedProcess*"))) and
not process.thread.Ext.call_stack_final_user_module.protection_provenance_path like ("c:\\program files\\*", "c:\\program files (x86)\\*", "c:\\windows\\assembly\\nativeimages_*") and
not _arraysearch(process.thread.Ext.call_stack_final_user_module.code_signature, $entry,
$entry.trusted == true and $entry.subject_name in ("Carbon Black, Inc.", "MUSARUBRA US LLC", "Microsoft Windows Hardware Compatibility Publisher", "Kaspersky Lab JSC", "AO Kaspersky Lab", "Palo Alto Networks (Netherlands) B.V.", "G DATA CyberDefense AG")) and
not process.thread.Ext.call_stack_final_user_module.hash.sha256 in ("b27b7d2ac43c6c734aa9e370afc987704f4bd8ba11bc5199a8c3bc5b07b2600c",
"85f238fb7ace3cbdf7c29c72b01307c440f13491b07a509cbc5b9f257a637164",
"55f3206cf9bb092aef6a61508683144afe21ddf930686433bb233e2e233be38c",
"b152de9afc373bba831dc9c1b137668462ae6d46ccd46815f2ffcc7f1bfc7056",
"991042b4a0eb46fdfddb6f9118d046dc1ff500743ff01a8584ad5e73c092b188",
"7f6f5855d4968235163d75c62ab82e8fdc7cf3c83de34e3c5a0666e2d08a0001",
"b27b7d2ac43c6c734aa9e370afc987704f4bd8ba11bc5199a8c3bc5b07b2600c",
"ddcbecf2cd2cd4904cf21e3db40c6a918df0ed3b258473fc5d6e2688dee72696",
"18d1bae077da62bb5cf5bfa6a6c5c38ac9ade57f098ea2b357fab477e85f1c25",
"a0c662a21ba02f2b997907ad113097856916fc3683331e24d065e864213ff379",
"16f1b19c60f80ae33c5b4fef4acd38454f11bbc965dcdd622db0d1c5bb65b931",
"023983f43bb97fd6c909df5012c142140650eff6921a9b0db33c0f558402988d",
"01f46f2401df22465bf2b3f3d59343d14dcf6aada6747e386f1adb965af7b3c3",
"680dc9c393faad3851147bcbb3c5a1fd29b8ed61ddf1bf416f4415132d85f784",
"d59c12264054c84d5e988d4c340fe9d83d2f646f240b5fd52b9bf8564b0dd164",
"9becd39f90077a5ab064681c0a1be139d15be9ce434bacd48cd1dc894d3911cb",
"bb7b4184ea19f248c34f6fb670d37e3062f1648aacc98e009cec1a58c78e8871",
"8df8b4e86a9e96baa92bcd9cf1fca189565a90d815630df899d72ac6eefcf852",
"1902241e12adbdf40ed4dafc410ccbcf8e07fce117d540dabbc2f75ff371f5be",
"7117da40b5cd080575863842e2281576f9b6d1d41cb250690a13aef9cc6436c5",
"e06439cebb8280c46d0aa538ec89b4af4659e7f2915c5787b239871c9dfd65a5",
"f5f02a15419cbad6b0ea2eb9e986d25f13d23abf8e6b8b32ccf18e427f6c48aa",
"2496a1ad22ed1917037e5d6747e5401c50612cb0e3c9cf32a3a1233ebb53207c",
"4b0b5c6e06f7df6dd89dcb027200f6f86b7b4d7dc274a095a82bb609d8cdbe38",
"05b70f473543119cd831f9fc1cd2fbcdc7a3e1938c8a5cb208a2dda017433a7d",
"967189adfbc889fde89aafc867f7a1f02731f8592cf6fd5a4ace1929213e2e13",
"f216ea8efb5b3bb9ad3d938fb9ac07e3b8f78c2c92faab03d2c468d0b6798a5a",
"dea0369456f49fcb4fc5afa42fffb69ae1e19ea238d18e32d9c498d69ab12c69",
"4d40d7064907cf932abae04ef8864ca7288af6993e1ff9e958bd9ac756f62808",
"bfe6fd180245ec727fbc538b11ed59d714b3d794d4fadb2dc76d8a019422066a",
"90c2f3d2bceafb50fb4468bda7a68025f12a23673f151839cae56e2b1ce0a74d",
"3c3c4dcec5b68807e874455021a133b5f5945af86cb9149efed146065201039a",
"cb7ab3788d10940df874acd97b1821bbb5ee4a91f3eec11982bb5bf7a3c96443")
Indicators
These rows show field, operator, and value matches.
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.thread.Ext.call_stack | array_any | excludes:process.thread.Ext.call_stack | |
process.Ext.api.parameters.size | eq | 4096 | excludes:process.Ext.api.parameters.size field:"process.Ext.api.parameters.size" value:"4096" |
process.thread.Ext.call_stack_final_user_module.code_signature | array_any | excludes:process.thread.Ext.call_stack_final_user_module.code_signature | |
process.thread.Ext.call_stack_final_hook_module.path | starts_with | c:\program files\, c:\program files (x86)\ | excludes:process.thread.Ext.call_stack_final_hook_module.path field:"process.thread.Ext.call_stack_final_hook_module.path" value:"c:\program files\" field:"process.thread.Ext.call_stack_final_hook_module.path" value:"c:\program files (x86)\" |
process.thread.Ext.call_stack_final_user_module.hash.sha256 | in | 01f46f2401df22465bf2b3f3d59343d14dcf6aada6747e386f1adb965af7b3c3, 023983f43bb97fd6c909df5012c142140650eff6921a9b0db33c0f558402988d, 05b70f473543119cd831f9fc1cd2fbcdc7a3e1938c8a5cb208a2dda017433a7d, 16f1b19c60f80ae33c5b4fef4acd38454f11bbc965dcdd622db0d1c5bb65b931, 18d1bae077da62bb5cf5bfa6a6c5c38ac9ade57f098ea2b357fab477e85f1c25, 1902241e12adbdf40ed4dafc410ccbcf8e07fce117d540dabbc2f75ff371f5be, 2496a1ad22ed1917037e5d6747e5401c50612cb0e3c9cf32a3a1233ebb53207c, 3c3c4dcec5b68807e874455021a133b5f5945af86cb9149efed146065201039a, 4b0b5c6e06f7df6dd89dcb027200f6f86b7b4d7dc274a095a82bb609d8cdbe38, 4d40d7064907cf932abae04ef8864ca7288af6993e1ff9e958bd9ac756f62808, 55f3206cf9bb092aef6a61508683144afe21ddf930686433bb233e2e233be38c, 680dc9c393faad3851147bcbb3c5a1fd29b8ed61ddf1bf416f4415132d85f784, 7117da40b5cd080575863842e2281576f9b6d1d41cb250690a13aef9cc6436c5, 7f6f5855d4968235163d75c62ab82e8fdc7cf3c83de34e3c5a0666e2d08a0001, 85f238fb7ace3cbdf7c29c72b01307c440f13491b07a509cbc5b9f257a637164, 8df8b4e86a9e96baa92bcd9cf1fca189565a90d815630df899d72ac6eefcf852, 90c2f3d2bceafb50fb4468bda7a68025f12a23673f151839cae56e2b1ce0a74d, 967189adfbc889fde89aafc867f7a1f02731f8592cf6fd5a4ace1929213e2e13, 991042b4a0eb46fdfddb6f9118d046dc1ff500743ff01a8584ad5e73c092b188, 9becd39f90077a5ab064681c0a1be139d15be9ce434bacd48cd1dc894d3911cb, a0c662a21ba02f2b997907ad113097856916fc3683331e24d065e864213ff379, b152de9afc373bba831dc9c1b137668462ae6d46ccd46815f2ffcc7f1bfc7056, b27b7d2ac43c6c734aa9e370afc987704f4bd8ba11bc5199a8c3bc5b07b2600c, bb7b4184ea19f248c34f6fb670d37e3062f1648aacc98e009cec1a58c78e8871, bfe6fd180245ec727fbc538b11ed59d714b3d794d4fadb2dc76d8a019422066a, cb7ab3788d10940df874acd97b1821bbb5ee4a91f3eec11982bb5bf7a3c96443, d59c12264054c84d5e988d4c340fe9d83d2f646f240b5fd52b9bf8564b0dd164, ddcbecf2cd2cd4904cf21e3db40c6a918df0ed3b258473fc5d6e2688dee72696, dea0369456f49fcb4fc5afa42fffb69ae1e19ea238d18e32d9c498d69ab12c69, e06439cebb8280c46d0aa538ec89b4af4659e7f2915c5787b239871c9dfd65a5, f216ea8efb5b3bb9ad3d938fb9ac07e3b8f78c2c92faab03d2c468d0b6798a5a, f5f02a15419cbad6b0ea2eb9e986d25f13d23abf8e6b8b32ccf18e427f6c48aa | excludes:process.thread.Ext.call_stack_final_user_module.hash.sha256 |
process.thread.Ext.call_stack_final_user_module.path | wildcard | ?:\program files\*, ?:\program files (x86)\*, ?:\windows\assembly\nativeimages_*, ?:\windows\syswow64\cyinjct.dll, ?:\windows\system32\tmumh\*\tmmon64.dll, ?:\windows\winsxs\*\mfc??.dll | excludes:process.thread.Ext.call_stack_final_user_module.path |
process.thread.Ext.call_stack_final_user_module.protection_provenance_path | starts_with | c:\program files\, c:\program files (x86)\, c:\windows\assembly\nativeimages_ | excludes:process.thread.Ext.call_stack_final_user_module.protection_provenance_path field:"process.thread.Ext.call_stack_final_user_module.protection_provenance_path" value:"c:\program files\" field:"process.thread.Ext.call_stack_final_user_module.protection_provenance_path" value:"c:\program files (x86)\" field:"process.thread.Ext.call_stack_final_user_module.protection_provenance_path" value:"c:\windows\assembly\nativeimages_" |
Potential Account Takeover - Logon from New Source IP
#Identifies a user account that normally logs in with high volume from one source IP suddenly logging in from a different source IP. This pattern (one IP with many successful logons, another IP with very few) may indicate account takeover or use of stolen credentials from a new location.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Privilege Escalation |
Telemetry Coverage
| Provider | Record / event type |
|---|---|
| Security-Auditing | Event ID 4624: An account was successfully logged on. |
Rule Body
[metadata]
creation_date = "2026/02/25"
integration = ["system", "windows"]
maturity = "production"
updated_date = "2026/05/04"
[rule]
author = ["Elastic"]
description = """
Identifies a user account that normally logs in with high volume from one source IP suddenly logging in from a different
source IP. This pattern (one IP with many successful logons, another IP with very few) may indicate account takeover
or use of stolen credentials from a new location.
"""
from = "now-15m"
interval = "14m"
language = "esql"
license = "Elastic License v2"
name = "Potential Account Takeover - Logon from New Source IP"
note = """## Triage and analysis
### Investigating Potential Account Takeover - Logon from New Source IP
An account that historically logs in many times from a single source IP (e.g. usual workstation or VPN) and then shows successful logons from exactly one other IP with a low count may indicate credential compromise and use from a new location (account takeover).
### Possible investigation steps
- Confirm with the account owner whether they recently logged in from the new source IP or from a new device/location.
- Check the new source IP for reputation, geography, and whether it is expected (e.g. corporate VPN range vs unknown).
- Correlate with other alerts for the same user or source IP (e.g. logon failures, password changes, MFA changes).
- Review timeline: if the "new" IP logon is very recent compared to the high-count IP, treat as higher priority.
### False positive analysis
- Legitimate use from a second device (e.g. new laptop, second office, VPN from travel) can produce exactly two IPs with one IP having few logons. Tune threshold (e.g. max_logon >= 100) or add exclusions for known VPN/remote ranges if needed.
- Service or shared accounts that are used from multiple jump hosts or scripts may show two IPs; consider excluding known service accounts.
### Response and remediation
- If takeover is confirmed: force password reset, revoke sessions, and enable or enforce MFA. Disable or lock the account until the user verifies identity.
- Investigate how credentials may have been compromised (phishing, breach, endpoint) and address the vector.
"""
setup = """## Setup
Audit Logon must be enabled to generate the events used by this rule.
Setup instructions: https://ela.st/audit-logon
"""
references = ["https://attack.mitre.org/techniques/T1078/"]
risk_score = 47
rule_id = "a1b2c3d4-e5f6-4a5b-8c9d-0e1f2a3b4c5d"
severity = "medium"
tags = [
"Domain: Endpoint",
"OS: Windows",
"Use Case: Threat Detection",
"Tactic: Privilege Escalation",
"Data Source: Windows Security Event Logs",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "esql"
query = '''
from logs-system.security*, logs-windows.forwarded*, winlogbeat-* metadata _id, _version, _index
| where event.category == "authentication" and event.action == "logged-in" and winlog.event_id == "4624" and
event.outcome == "success" and winlog.logon.type in ("Network", "RemoteInteractive") and
source.ip is not null and source.ip != "127.0.0.1" and not to_string(source.ip) like "*::*" and not user.name like "*$"
| stats logon_count = COUNT(*), host_names = VALUES(host.name) by user.name, user.id, source.ip
| stats
Esql.max_logon = MAX(logon_count),
Esql.min_logon = MIN(logon_count),
Esql.unique_host_count = COUNT_DISTINCT(host_names),
Esql.host_name_values = VALUES(host_names),
Esql.source_ip_values = VALUES(source.ip),
Esql.count_distinct_source_ip = COUNT_DISTINCT(source.ip) by user.name, user.id
// high count of logons is often associated with service account tied to a specific source.ip, if observed in use from a new source.ip it's suspicious
| where Esql.max_logon >= 1000 and (Esql.min_logon >= 1 and Esql.min_logon <= 5) and Esql.count_distinct_source_ip == 2 and Esql.unique_host_count >= 2
| eval source.ip = MV_FIRST(Esql.source_ip_values), host.name = MV_FIRST(Esql.host_name_values)
| KEEP user.name, user.id, host.name, source.ip, Esql.*
'''
[[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: from
from logs-system.security*, logs-windows.forwarded*, winlogbeat-* metadata _id, _version, _index
Stage 2: where
| where event.category == "authentication" and event.action == "logged-in" and winlog.event_id == "4624" and
event.outcome == "success" and winlog.logon.type in ("Network", "RemoteInteractive") and
source.ip is not null and source.ip != "127.0.0.1" and not to_string(source.ip) like "*::*" and not user.name like "*$"
Stage 3: stats
| stats logon_count = COUNT(*), host_names = VALUES(host.name) by user.name, user.id, source.ip
Stage 4: stats
| stats
Esql.max_logon = MAX(logon_count),
Esql.min_logon = MIN(logon_count),
Esql.unique_host_count = COUNT_DISTINCT(host_names),
Esql.host_name_values = VALUES(host_names),
Esql.source_ip_values = VALUES(source.ip),
Esql.count_distinct_source_ip = COUNT_DISTINCT(source.ip) by user.name, user.id
Stage 5: where
| where Esql.max_logon >= 1000 and (Esql.min_logon >= 1 and Esql.min_logon <= 5) and Esql.count_distinct_source_ip == 2 and Esql.unique_host_count >= 2
Stage 6: eval
| eval source.ip = MV_FIRST(Esql.source_ip_values), host.name = MV_FIRST(Esql.host_name_values)
Stage 7: keep
| KEEP user.name, user.id, host.name, source.ip, Esql.*
Indicators
These rows show field, operator, and value matches.
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
user.name | ends_with | $ | excludes:user.name field:"user.name" value:"$" |
Output Fields
These fields are emitted when the rule matches.
| Field | Source |
|---|---|
user.name | KEEP user.name |
user.id | KEEP user.id |
host.name | KEEP host.name |
source.ip | KEEP source.ip |
Esql.* | KEEP Esql.* |
Potential Persistence via Mandatory User Profile
#Detects the creation or modification of a mandatory user profile hive (NTUSER.MAN) by an unusual process. Adversaries may abuse Windows mandatory profiles by dropping a malicious NTUSER.MAN file containing pre-populated persistence-related registry keys. On the next user logon, Windows loads the registry hive from NTUSER.MAN, causing embedded persistence mechanisms to activate without directly modifying the live registry. This technique can evade traditional registry-based monitoring and indicate a stealthy persistence attempt.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Persistence |
Rule Body
[metadata]
creation_date = "2026/01/07"
integration = ["endpoint"]
maturity = "production"
updated_date = "2026/05/04"
[rule]
author = ["Elastic"]
description = """
Detects the creation or modification of a mandatory user profile hive (NTUSER.MAN) by an unusual process.
Adversaries may abuse Windows mandatory profiles by dropping a malicious NTUSER.MAN file containing
pre-populated persistence-related registry keys. On the next user logon, Windows loads the registry hive
from NTUSER.MAN, causing embedded persistence mechanisms to activate without directly modifying the live
registry. This technique can evade traditional registry-based monitoring and indicate a stealthy
persistence attempt.
"""
from = "now-9m"
index = ["logs-endpoint.events.file-*"]
language = "eql"
license = "Elastic License v2"
name = "Potential Persistence via Mandatory User Profile"
note = """## Triage and analysis
> **Disclaimer**:
> This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.
### Investigating Potential Persistence via Mandatory User Profile
Windows supports *mandatory user profiles*, which rely on the `NTUSER.MAN` registry hive instead of the standard `NTUSER.DAT`. When a user logs in, Windows loads registry settings directly from this file. Adversaries can exploit this behavior by crafting or modifying an `NTUSER.MAN` file with embedded persistence mechanisms (for example, `Run` keys, logon scripts, or policy-based execution). Because the registry hive is loaded at logon, this technique may bypass traditional registry modification telemetry and provide stealthy persistence.
This rule detects the creation or modification of `NTUSER.MAN` files in user profile directories by non-system processes, which is uncommon in legitimate environments.
### Possible investigation steps
- Review the process responsible for creating or modifying NTUSER.MAN, focusing on process.name, process.executable, and parent process relationships. Creation or modification by scripting engines, LOLBins, or unsigned binaries is highly suspicious.
- Examine the file path to confirm whether the .MAN profile corresponds to a legitimate mandatory profile or an unexpected user directory.
- Extract and analyze the contents of the NTUSER.MAN file by loading it offline into a registry viewer. Look for persistence-related keys such as:
- Run / RunOnce
- UserInitMprLogonScript
- Policy-based execution keys
- Determine which user account(s) are configured to use the mandatory profile and whether this aligns with expected administrative behavior.
- Correlate the event with preceding file writes, downloads, or process executions** that may have staged the malicious hive.
- Review recent logon activity for users tied to the mandatory profile to identify whether persistence may have already been triggered.
- Check threat intelligence sources for known malware or tooling that abuses mandatory profiles or offline registry hive manipulation.
### False positive analysis
- Legitimate enterprise environments may use mandatory profiles in controlled scenarios such as kiosks, training systems, or shared workstations.
- Administrative tools or scripts used during system imaging or profile provisioning may legitimately create NTUSER.MAN files.
- Profile migrations or backup/restore operations could trigger benign modifications.
Validate whether the modifying process, user, and timing align with known administrative activity before dismissing the alert.
### Response and remediation
- Isolate the affected host if malicious persistence is suspected to prevent further execution.
- Prevent further logons for users associated with the suspicious mandatory profile until analysis is complete.
- Remove or replace the malicious NTUSER.MAN file with a known-good version.
- Inspect the loaded registry hive for additional persistence mechanisms and remove any unauthorized entries.
- Conduct a full endpoint scan to identify additional payloads or lateral movement.
- Review endpoint detection coverage to ensure offline registry hive and profile-based persistence** techniques are monitored.
- Escalate confirmed malicious activity to incident response and document findings to improve future detections."""
references = ["https://deceptiq.com/blog/ntuser-man-registry-persistence"]
risk_score = 47
rule_id = "0e42f920-047d-4568-b961-2a50db6c4713"
severity = "medium"
tags = [
"Domain: Endpoint",
"OS: Windows",
"Use Case: Threat Detection",
"Tactic: Persistence",
"Data Source: Elastic Defend",
"Resources: Investigation Guide",
]
timeline_id = "4d4c0b59-ea83-483f-b8c1-8c360ee53c5c"
timeline_title = "Comprehensive File Timeline"
timestamp_override = "event.ingested"
type = "eql"
query = '''
file where host.os.type == "windows" and
event.type in ("creation", "change") and user.id != "S-1-5-18" and
file.name : "NTUSER.MAN" and file.path : "?:\\Users\\*.MAN"
'''
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
"""
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1547"
name = "Boot or Logon Autostart Execution"
reference = "https://attack.mitre.org/techniques/T1547/"
[[rule.threat.technique.subtechnique]]
id = "T1547.001"
name = "Registry Run Keys / Startup Folder"
reference = "https://attack.mitre.org/techniques/T1547/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 = "T1112"
name = "Modify Registry"
reference = "https://attack.mitre.org/techniques/T1112/"
[rule.threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
Stages and Predicates
Stage 1: file
file where host.os.type == "windows" and
event.type in ("creation", "change") and user.id != "S-1-5-18" and
file.name : "NTUSER.MAN" and file.path : "?:\\Users\\*.MAN"
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.type | in |
| field:"event.type" kind:in |
file.name | wildcard |
| field:"file.name" kind:wildcard value:"NTUSER.MAN" |
file.path | wildcard |
| field:"TargetFilename" kind:wildcard value:"?:\Users\*.MAN" |
user.id | ne |
| field:"user.id" kind:ne value:"S-1-5-18" |
Potential Telnet Authentication Bypass (CVE-2026-24061)
#Identifies potential exploitation of a Telnet remote authentication bypass vulnerability (CVE-2026-24061) in GNU Inetutils telnetd. The vulnerability allows unauthenticated access by supplying a crafted -f <username> value via the USER environment variable, resulting in a login process spawned with elevated privileges.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Initial Access | |
| Privilege Escalation | |
| Lateral Movement |
Rule Body
[metadata]
creation_date = "2026/01/24"
integration = ["endpoint", "crowdstrike", "sentinel_one_cloud_funnel"]
maturity = "production"
updated_date = "2026/03/24"
[rule]
author = ["Elastic"]
description = """
Identifies potential exploitation of a Telnet remote authentication bypass vulnerability (CVE-2026-24061) in GNU Inetutils
telnetd. The vulnerability allows unauthenticated access by supplying a crafted `-f <username>` value via the `USER` environment
variable, resulting in a login process spawned with elevated privileges.
"""
from = "now-9m"
index = [
"endgame-*",
"logs-endpoint.events.process*",
"logs-crowdstrike.fdr*",
"logs-sentinel_one_cloud_funnel.*",
]
language = "eql"
license = "Elastic License v2"
name = "Potential Telnet Authentication Bypass (CVE-2026-24061)"
note = """## Triage and analysis
### Investigating Potential Telnet Authentication Bypass (CVE-2026-24061)
CVE-2026-24061 is a critical authentication bypass vulnerability affecting `telnetd` in GNU Inetutils. By supplying a
crafted `-f root` value through the USER environment variable, a remote attacker can bypass authentication and gain
unauthorized root-level access. This exploit results in the `login` process being executed with attacker-controlled
arguments, typically spawned by `telnetd` or via `xinetd`.
This rule detects suspicious `login` executions associated with Telnet services that include the `-f` flag, which
forces authentication as a specified user and is indicative of exploitation attempts.
#### Possible investigation steps
- Investigate the process execution chain (parent process tree) for the suspicious `login` process.
- Confirm whether `login` was spawned by `telnetd` or indirectly via `xinetd`.
- Review the command-line arguments passed to `login`, paying special attention to the presence of `-f` and any
attempts to authenticate as `root` or other privileged users.
- Validate whether the Telnet service is expected to be running on the affected host.
- Telnet is deprecated and should rarely be exposed or enabled in modern environments.
- Investigate post-authentication activity originating from the compromised session.
- Look for command execution, file modifications, privilege escalation attempts, or persistence mechanisms.
- Review network connections initiated after the suspicious login event.
- Check for additional alerts or suspicious activity on the same host within the past 48 hours.
- Determine whether the system is running a vulnerable version of GNU Inetutils telnetd.
### False positive analysis
- Legitimate use of the `-f` flag with `login` is extremely rare and typically restricted to trusted, local workflows.
- False positives may occur in highly customized or legacy environments where Telnet is still in use.
- Any benign occurrences should be carefully validated and documented before adding exceptions.
### Related Rules
- Telnet Authentication Bypass via User Environment Variable - "eb3150eb-e9fb-4a64-a0fc-aa66cdd35632"
### Response and remediation
- Immediately isolate the affected host to prevent further unauthorized access or lateral movement.
- Terminate suspicious Telnet sessions and collect volatile forensic data where possible.
- Investigate for signs of credential access, persistence, or follow-on exploitation.
- Patch or upgrade GNU Inetutils to a version that addresses CVE-2026-24061.
- Disable the Telnet service entirely if it is not explicitly required.
- Enforce the use of secure alternatives such as SSH for remote administration.
- Rotate credentials for any accounts that may have been exposed or accessed.
- Perform a full system integrity review and antimalware scan.
- Update hardening, monitoring, and logging policies to improve detection of legacy remote access abuse.
"""
references = [
"https://www.safebreach.com/blog/safebreach-labs-root-cause-analysis-and-poc-exploit-for-cve-2026-24061/",
"https://security-tracker.debian.org/tracker/CVE-2026-24061"
]
risk_score = 99
rule_id = "ab7795cc-0e0b-4f9d-a934-1f17a58f869a"
severity = "critical"
tags = [
"Domain: Endpoint",
"OS: Linux",
"Use Case: Threat Detection",
"Tactic: Initial Access",
"Tactic: Lateral Movement",
"Resources: Investigation Guide",
"Use Case: Vulnerability",
"Data Source: Elastic Defend",
"Data Source: Elastic Endgame",
"Data Source: Crowdstrike",
"Data Source: SentinelOne"
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
process where host.os.type == "linux" and event.type == "start" and
event.action in ("exec", "exec_event", "start", "ProcessRollup2", "executed") and
process.name == "login" and process.parent.name in ("telnetd", "xinetd") and process.args : "-*f*"
'''
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1190"
name = "Exploit Public-Facing Application"
reference = "https://attack.mitre.org/techniques/T1190/"
[rule.threat.tactic]
id = "TA0001"
name = "Initial Access"
reference = "https://attack.mitre.org/tactics/TA0001/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1210"
name = "Exploitation of Remote Services"
reference = "https://attack.mitre.org/techniques/T1210/"
[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 = "T1068"
name = "Exploitation for Privilege Escalation"
reference = "https://attack.mitre.org/techniques/T1068/"
[rule.threat.tactic]
id = "TA0004"
name = "Privilege Escalation"
reference = "https://attack.mitre.org/tactics/TA0004/"
Stages and Predicates
Stage 1: process
process where host.os.type == "linux" and event.type == "start" and
event.action in ("exec", "exec_event", "start", "ProcessRollup2", "executed") and
process.name == "login" and process.parent.name in ("telnetd", "xinetd") and process.args : "-*f*"
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 value:"-*f*" |
process.name | eq |
| field:"process_basename" kind:eq value:"login" |
process.parent.name | in |
| field:"parent_process_basename" kind:in |
Program Files Directory Masquerading
#Identifies execution from a directory masquerading as the Windows Program Files directories. These paths are trusted and usually host trusted third party programs. An adversary may leverage masquerading, along with low privileges to bypass detections allowlisting those folders.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Stealth |
Telemetry Coverage
| Provider | Record / event type |
|---|---|
| Sysmon | Event ID 1: Process creation |
| Security-Auditing | Event ID 4688: A new process has been created. |
Rule Body
[metadata]
creation_date = "2020/11/18"
integration = ["endpoint", "windows", "system", "m365_defender", "sentinel_one_cloud_funnel", "crowdstrike"]
maturity = "production"
updated_date = "2026/05/04"
[rule]
author = ["Elastic"]
description = """
Identifies execution from a directory masquerading as the Windows Program Files directories. These paths are trusted and
usually host trusted third party programs. An adversary may leverage masquerading, along with low privileges to bypass
detections allowlisting those folders.
"""
from = "now-9m"
index = [
"endgame-*",
"logs-crowdstrike.fdr*",
"logs-endpoint.events.process-*",
"logs-m365_defender.event-*",
"logs-sentinel_one_cloud_funnel.*",
"logs-system.security*",
"logs-windows.forwarded*",
"logs-windows.sysmon_operational-*",
"winlogbeat-*",
]
language = "eql"
license = "Elastic License v2"
name = "Program Files Directory Masquerading"
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 Program Files Directory Masquerading
The Program Files directories in Windows are trusted locations for legitimate software. Adversaries may exploit this trust by creating similarly named directories to execute malicious files, bypassing security measures. The detection rule identifies suspicious executions from these masquerading paths, excluding known legitimate directories, to flag potential threats. This helps in identifying defense evasion tactics used by attackers.
### Possible investigation steps
- Review the process executable path to confirm if it matches any known masquerading patterns, such as unexpected directories containing "Program Files" in their path.
- Check the parent process of the suspicious executable to determine how it was launched and assess if the parent process is legitimate or potentially malicious.
- Investigate the user account associated with the process execution to determine if it has low privileges and if the activity aligns with typical user behavior.
- Correlate the event with other security logs or alerts from data sources like Microsoft Defender XDR or Sysmon to identify any related suspicious activities or patterns.
- Examine the file hash of the executable to see if it matches known malware signatures or if it has been flagged in threat intelligence databases.
- Assess the network activity associated with the process to identify any unusual outbound connections that could indicate data exfiltration or command-and-control communication.
### False positive analysis
- Legitimate software installations or updates may create temporary directories resembling Program Files paths. Users can monitor installation logs and exclude these specific paths if they are verified as part of a legitimate process.
- Some enterprise applications may use custom directories that mimic Program Files for compatibility reasons. IT administrators should document these paths and add them to the exclusion list to prevent false alerts.
- Development environments might create test directories with similar naming conventions. Developers should ensure these paths are excluded during active development phases to avoid unnecessary alerts.
- Security tools or scripts that perform regular checks or updates might execute from non-standard directories. Verify these tools and add their execution paths to the exception list if they are confirmed safe.
- Backup or recovery software might temporarily use directories that resemble Program Files for storing executable files. Confirm the legitimacy of these operations and exclude the paths if they are part of routine backup processes.
### Response and remediation
- Isolate the affected system from the network to prevent further spread of the potential threat and to contain any malicious activity.
- Terminate any suspicious processes identified as executing from masquerading directories to halt any ongoing malicious actions.
- Conduct a thorough scan of the affected system using updated antivirus or endpoint detection and response (EDR) tools to identify and remove any malicious files or remnants.
- Review and restore any altered system configurations or settings to their original state to ensure system integrity.
- Escalate the incident to the security operations center (SOC) or incident response team for further analysis and to determine if additional systems are affected.
- Implement additional monitoring on the affected system and similar environments to detect any recurrence of the threat or similar tactics.
- Update security policies and access controls to prevent unauthorized creation of directories that mimic trusted paths, enhancing defenses against similar masquerading attempts."""
risk_score = 47
rule_id = "32c5cf9c-2ef8-4e87-819e-5ccb7cd18b14"
severity = "medium"
tags = [
"Domain: Endpoint",
"OS: Windows",
"Use Case: Threat Detection",
"Tactic: Defense Evasion",
"Data Source: Elastic Endgame",
"Data Source: Elastic Defend",
"Data Source: Windows Security Event Logs",
"Data Source: Microsoft Defender XDR",
"Data Source: Sysmon",
"Data Source: SentinelOne",
"Data Source: Crowdstrike",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
process where host.os.type == "windows" and event.type == "start" and
process.executable : (
"C:\\*Program Files*\\*.exe",
"\\Device\\HarddiskVolume*\\*Program Files*\\*.exe"
) and
not process.executable : (
"?:\\Program Files\\*.exe",
"?:\\Program Files (x86)\\*.exe",
"?:\\Users\\*.exe",
"?:\\ProgramData\\*.exe",
"?:\\Windows\\Downloaded Program Files\\*.exe",
"?:\\Windows\\Temp\\.opera\\????????????\\CProgram?FilesOpera*\\*.exe",
"?:\\Windows\\Temp\\.opera\\????????????\\CProgram?Files?(x86)Opera*\\*.exe",
/* NT Object Paths */
"\\Device\\HarddiskVolume*\\Program Files\\*.exe",
"\\Device\\HarddiskVolume*\\Program Files (x86)\\*.exe",
"\\Device\\HarddiskVolume*\\Users\\*.exe",
"\\Device\\HarddiskVolume*\\ProgramData\\*.exe",
"\\Device\\HarddiskVolume*\\Windows\\Downloaded Program Files\\*.exe"
)
'''
setup = """## Setup
This rule is designed for data generated by [Elastic Defend](https://www.elastic.co/security/endpoint-security), which provides native endpoint detection and response, along with event enrichments designed to work with our detection rules.
Setup instructions: https://ela.st/install-elastic-defend
### Additional data sources
This rule also supports the following third-party data sources. For setup instructions, refer to the links below:
- [CrowdStrike](https://ela.st/crowdstrike-integration)
- [Microsoft Defender XDR](https://ela.st/m365-defender)
- [SentinelOne Cloud Funnel](https://ela.st/sentinel-one-cloud-funnel)
- [Sysmon Event ID 1 - Process Creation](https://ela.st/sysmon-event-1-setup)
- [Windows Process Creation Logs](https://ela.st/audit-process-creation)
"""
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1036"
name = "Masquerading"
reference = "https://attack.mitre.org/techniques/T1036/"
[[rule.threat.technique.subtechnique]]
id = "T1036.005"
name = "Match Legitimate Resource Name or Location"
reference = "https://attack.mitre.org/techniques/T1036/005/"
[rule.threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
Stages and Predicates
Stage 1: process
process where host.os.type == "windows" and event.type == "start" and
process.executable : (
"C:\\*Program Files*\\*.exe",
"\\Device\\HarddiskVolume*\\*Program Files*\\*.exe"
) and
not process.executable : (
"?:\\Program Files\\*.exe",
"?:\\Program Files (x86)\\*.exe",
"?:\\Users\\*.exe",
"?:\\ProgramData\\*.exe",
"?:\\Windows\\Downloaded Program Files\\*.exe",
"?:\\Windows\\Temp\\.opera\\????????????\\CProgram?FilesOpera*\\*.exe",
"?:\\Windows\\Temp\\.opera\\????????????\\CProgram?Files?(x86)Opera*\\*.exe",
"\\Device\\HarddiskVolume*\\Program Files\\*.exe",
"\\Device\\HarddiskVolume*\\Program Files (x86)\\*.exe",
"\\Device\\HarddiskVolume*\\Users\\*.exe",
"\\Device\\HarddiskVolume*\\ProgramData\\*.exe",
"\\Device\\HarddiskVolume*\\Windows\\Downloaded Program Files\\*.exe"
)
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.type | eq |
| field:"event.type" kind:eq value:"start" |
process.executable | wildcard |
| field:"Image" kind:wildcard |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.executable | wildcard | ?:\Program Files\*.exe, ?:\Program Files (x86)\*.exe, ?:\Users\*.exe, ?:\ProgramData\*.exe, ?:\Windows\Downloaded Program Files\*.exe, ?:\Windows\Temp\.opera\????????????\CProgram?FilesOpera*\*.exe, ?:\Windows\Temp\.opera\????????????\CProgram?Files?(x86)Opera*\*.exe, \Device\HarddiskVolume*\Program Files\*.exe, \Device\HarddiskVolume*\Program Files (x86)\*.exe, \Device\HarddiskVolume*\Users\*.exe, \Device\HarddiskVolume*\ProgramData\*.exe, \Device\HarddiskVolume*\Windows\Downloaded Program Files\*.exe | excludes:process.executable |
Registry Modification from a Potentially Altered Call Stack
#Detects registry modification from a potentially altered call stack in order to conceal the true source of the call.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Stealth |
Rule Body
[rule]
description = "Detects registry modification from a potentially altered call stack in order to conceal the true source of the call."
id = "2296595e-26d5-4834-8aa1-2602d11de45e"
license = "Elastic License v2"
name = "Registry Modification from a Potentially Altered Call Stack"
os_list = ["windows"]
reference = ["https://www.elastic.co/security-labs/doubling-down-etw-callstacks"]
version = "1.0.2"
query = '''
registry where event.action == "modification" and process.executable != null and registry.value == "CachePrefix" and
process.thread.Ext.call_stack_summary :
("ntdll.dll|kernelbase.dll|wininet.dll|ntdll.dll|kernelbase.dll|wininet.dll|kernel32.dll*",
"ntdll.dll|kernelbase.dll|wininet.dll|ntdll.dll|kernelbase.dll|wininet.dll|kernelbase.dll*") and
_arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info: "?:\\Windows\\System32\\wininet.dll!HttpSendRequest*") and
not (process.code_signature.trusted == true and
_arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info : "C:\\Windows\\System32\\ntdll.dll!LdrGetDllPath*") and
_arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info : "C:\\Windows\\System32\\KernelBase.dll!GetProcessTimes*"))
'''
min_endpoint_version = "8.10.0"
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
tree = true
[[optional_actions]]
action = "rollback"
field = "process.entity_id"
state = 0
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1036"
name = "Masquerading"
reference = "https://attack.mitre.org/techniques/T1036/"
[threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
[internal]
min_endpoint_version = "8.10.0"
Stages and Predicates
Stage 1: registry
registry where event.action == "modification" and process.executable != null and registry.value == "CachePrefix" and
process.thread.Ext.call_stack_summary :
("ntdll.dll|kernelbase.dll|wininet.dll|ntdll.dll|kernelbase.dll|wininet.dll|kernel32.dll*",
"ntdll.dll|kernelbase.dll|wininet.dll|ntdll.dll|kernelbase.dll|wininet.dll|kernelbase.dll*") and
_arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info: "?:\\Windows\\System32\\wininet.dll!HttpSendRequest*") and
not (process.code_signature.trusted == true and
_arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info : "C:\\Windows\\System32\\ntdll.dll!LdrGetDllPath*") and
_arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info : "C:\\Windows\\System32\\KernelBase.dll!GetProcessTimes*"))
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | eq |
| field:"EventType" kind:eq value:"modification" |
process.executable | is_not_null | field:"Image" kind:is_not_null | |
process.thread.Ext.call_stack_summary | wildcard |
| field:"process.thread.Ext.call_stack_summary" kind:wildcard |
registry.value | eq |
| field:"registry_value_name" kind:eq value:"CachePrefix" |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.thread.Ext.call_stack | array_any | excludes:process.thread.Ext.call_stack | |
process.code_signature.trusted | eq | true | excludes:process.code_signature.trusted field:"process.code_signature.trusted" value:"true" |
Service Created by Suspicious Process and Activated
#This rule detects the creation and activation of a service by a system process. Threat actors may abuse this to establish persistence or escalate privileges.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Execution | |
| Persistence | |
| Privilege Escalation | |
| Command & Control |
Rule Body
[rule]
description = """
This rule detects the creation and activation of a service by a system process. Threat actors may abuse this to
establish persistence or escalate privileges.
"""
id = "bada19f8-3ca7-4b44-812b-788e4f4f1342"
license = "Elastic License v2"
name = "Service Created by Suspicious Process and Activated"
os_list = ["linux"]
version = "1.0.5"
query = '''
sequence with maxspan=30s
[file where event.action == "creation" and file.extension == "service" and file.path like (
"/etc/systemd/system/*", "/etc/systemd/user/*", "/usr/local/lib/systemd/system/*",
"/lib/systemd/system/*", "/usr/lib/systemd/system/*", "/usr/lib/systemd/user/*",
"/home/*/.config/systemd/user/*", "/home/*/.local/share/systemd/user/*",
"/root/.config/systemd/user/*", "/root/.local/share/systemd/user/*"
) and (
process.executable like (
"/tmp/*", "/var/tmp/*", "/dev/shm/*", "/run/user/*", "/var/run/user/*", "/home/*/*", "/root/*", "/boot/*", "./*"
) or
process.name in ("curl", "wget")
) and
not process.executable like (
"/tmp/tmp.*/nix-installer", "/tmp/octofence-agent-installer_*", "/tmp/selfgz*/install.sh",
"/home/*/elastic-agent/.claude/*/elastic-agent", "/tmp/TestHeartbeatHTTPMonitor*/*/elastic-agent",
"/home/*/Downloads/*/elastic-agent", "/home/*/duoauthproxy-build/usr/local/bin/python3", "./elastic-agent",
"/root/elastic-agent-*/elastic-agent", "/home/*/elastic-agent-*/data/elastic-agent-*/elastic-agent",
"/tmp/elastic-agent-*/elastic-agent", "/tmp/cybercnsagent_linux", "/root/.cursor-server/bin/linux-x64/*/node"
)] as event0
[process where event.type == "start" and event.action == "exec" and process.name == "systemctl" and
process.args in ("enable", "start") and stringcontains(process.command_line, event0.file.name)]
'''
min_endpoint_version = "8.5.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 = "T1569"
name = "System Services"
reference = "https://attack.mitre.org/techniques/T1569/"
[[threat.technique.subtechnique]]
id = "T1569.002"
name = "Service Execution"
reference = "https://attack.mitre.org/techniques/T1569/002/"
[threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1053"
name = "Scheduled Task/Job"
reference = "https://attack.mitre.org/techniques/T1053/"
[[threat.technique]]
id = "T1543"
name = "Create or Modify System Process"
reference = "https://attack.mitre.org/techniques/T1543/"
[[threat.technique.subtechnique]]
id = "T1543.002"
name = "Systemd Service"
reference = "https://attack.mitre.org/techniques/T1543/002/"
[threat.tactic]
id = "TA0003"
name = "Persistence"
reference = "https://attack.mitre.org/tactics/TA0003/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1053"
name = "Scheduled Task/Job"
reference = "https://attack.mitre.org/techniques/T1053/"
[[threat.technique]]
id = "T1543"
name = "Create or Modify System Process"
reference = "https://attack.mitre.org/techniques/T1543/"
[[threat.technique.subtechnique]]
id = "T1543.002"
name = "Systemd Service"
reference = "https://attack.mitre.org/techniques/T1543/002/"
[threat.tactic]
id = "TA0004"
name = "Privilege Escalation"
reference = "https://attack.mitre.org/tactics/TA0004/"
[[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.5.0"
Stages and Predicates
Stage 1: file
[file where event.action == "creation" and file.extension == "service" and file.path like (
"/etc/systemd/system/*", "/etc/systemd/user/*", "/usr/local/lib/systemd/system/*",
"/lib/systemd/system/*", "/usr/lib/systemd/system/*", "/usr/lib/systemd/user/*",
"/home/*/.config/systemd/user/*", "/home/*/.local/share/systemd/user/*",
"/root/.config/systemd/user/*", "/root/.local/share/systemd/user/*"
) and (
process.executable like (
"/tmp/*", "/var/tmp/*", "/dev/shm/*", "/run/user/*", "/var/run/user/*", "/home/*/*", "/root/*", "/boot/*", "./*"
) or
process.name in ("curl", "wget")
) and
not process.executable like (
"/tmp/tmp.*/nix-installer", "/tmp/octofence-agent-installer_*", "/tmp/selfgz*/install.sh",
"/home/*/elastic-agent/.claude/*/elastic-agent", "/tmp/TestHeartbeatHTTPMonitor*/*/elastic-agent",
"/home/*/Downloads/*/elastic-agent", "/home/*/duoauthproxy-build/usr/local/bin/python3", "./elastic-agent",
"/root/elastic-agent-*/elastic-agent", "/home/*/elastic-agent-*/data/elastic-agent-*/elastic-agent",
"/tmp/elastic-agent-*/elastic-agent", "/tmp/cybercnsagent_linux", "/root/.cursor-server/bin/linux-x64/*/node"
)] as event0
Stage 2: process
[process where event.type == "start" and event.action == "exec" and process.name == "systemctl" and
process.args in ("enable", "start") and stringcontains(process.command_line, event0.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.extension | eq |
| field:"file.extension" kind:eq value:"service" |
file.path | wildcard |
| field:"TargetFilename" kind:wildcard |
process.args | in |
| field:"process.args" kind:in |
process.command_line | contains |
| field:"CommandLine" kind:contains value:"event0.file.name" |
process.executable | wildcard |
| field:"Image" kind:wildcard |
process.name | eq |
| field:"process_basename" kind:eq value:"systemctl" |
process.name | in |
| field:"process_basename" kind:in |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.executable | wildcard | /tmp/tmp.*/nix-installer, /tmp/octofence-agent-installer_*, /tmp/selfgz*/install.sh, /home/*/elastic-agent/.claude/*/elastic-agent, /tmp/TestHeartbeatHTTPMonitor*/*/elastic-agent, /home/*/Downloads/*/elastic-agent, /home/*/duoauthproxy-build/usr/local/bin/python3, ./elastic-agent, /root/elastic-agent-*/elastic-agent, /home/*/elastic-agent-*/data/elastic-agent-*/elastic-agent, /tmp/elastic-agent-*/elastic-agent, /tmp/cybercnsagent_linux, /root/.cursor-server/bin/linux-x64/*/node | excludes:process.executable |
Successful Application SSO from Rare Unknown Client Device
#Detects successful single sign-on (SSO) events to Okta applications from an unrecognized or "unknown" client device, as identified by the user-agent string. This activity may be indicative of exploitation of a vulnerability in Okta's Classic Engine, which could allow an attacker to bypass application-specific sign-on policies, such as device or network restrictions. The vulnerability potentially enables unauthorized access to applications using only valid, stolen credentials, without requiring additional authentication factors.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Initial Access |
Telemetry Coverage
| Platform | Record / event type |
|---|---|
| Okta | System Log event type user.authentication.sso: User SSO to application |
Rules Detecting the Same Action
These rules filter on the same operation.
- First Occurrence of Okta User Session Started via Proxy (Elastic)
- Okta AiTM Session Cookie Replay (Elastic)
- Okta Multiple Failed Requests To Access Applications (YARA-L)
- Okta Multiple Failed Requests to Access Applications (Splunk)
- Okta Potentially Stolen Session (Panther)
- Okta SWA Bulk Access, New Source, and Credential Extraction - Behavioral (Panther)
- Potential Okta MFA Bombing via Push Notifications (Elastic)
- Potentially Successful Okta MFA Bombing via Push Notifications (Elastic)
Rule Body
[metadata]
creation_date = "2024/10/07"
integration = ["okta"]
maturity = "production"
updated_date = "2026/04/10"
[rule]
author = ["Elastic"]
description = """
Detects successful single sign-on (SSO) events to Okta applications from an unrecognized or "unknown" client device, as
identified by the user-agent string. This activity may be indicative of exploitation of a vulnerability in Okta's
Classic Engine, which could allow an attacker to bypass application-specific sign-on policies, such as device or network
restrictions. The vulnerability potentially enables unauthorized access to applications using only valid, stolen
credentials, without requiring additional authentication factors.
"""
from = "now-9m"
index = ["filebeat-*", "logs-okta*"]
language = "kuery"
license = "Elastic License v2"
name = "Successful Application SSO from Rare Unknown Client Device"
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 Successful Application SSO from Rare Unknown Client Device
Single sign-on (SSO) streamlines user access across applications by using a single set of credentials. However, adversaries can exploit vulnerabilities in SSO systems, like Okta's, to bypass security policies using stolen credentials. The detection rule identifies unusual SSO events from unknown devices, signaling potential unauthorized access attempts, thus helping to mitigate risks associated with credential theft.
### Possible investigation steps
- Review the event details in the alert to confirm the presence of the "Unknown" or "unknown" client device in the okta.client.device field.
- Check the user-agent string associated with the event to gather more information about the unknown device and assess if it matches any known legitimate devices used by the user.
- Investigate the user's recent login history and patterns to identify any anomalies or deviations from their typical behavior, such as unusual login times or locations.
- Verify if there have been any recent changes to the user's account, such as password resets or modifications to multi-factor authentication settings, which could indicate account compromise.
- Cross-reference the IP address associated with the SSO event against known malicious IP databases or internal threat intelligence to identify potential threats.
- Contact the user to confirm whether they recognize the login activity and the device used, ensuring it was an authorized access attempt.
### False positive analysis
- Employees using new or updated devices may trigger false positives. Regularly update the list of recognized devices to include these changes.
- Legitimate users accessing applications from different locations or networks, such as while traveling, can appear as unknown devices. Implement geolocation checks and allow exceptions for known travel patterns.
- Software updates or changes in user-agent strings can cause devices to be misidentified. Monitor for consistent patterns and adjust the rule to accommodate these variations.
- Shared devices in environments like conference rooms or labs may not have unique identifiers. Establish a process to register these shared devices to prevent them from being flagged.
- Temporary network issues causing devices to appear as unknown can lead to false positives. Correlate with network logs to verify if the device is indeed unknown or if it was a transient issue.
### Response and remediation
- Immediately isolate the affected user account by disabling it to prevent further unauthorized access.
- Conduct a thorough review of the affected user's recent activity across all Okta-integrated applications to identify any unauthorized actions or data access.
- Reset the affected user's credentials and enforce a password change, ensuring the new password adheres to strong security policies.
- Implement multi-factor authentication (MFA) for the affected user account if not already in place, to add an additional layer of security.
- Notify the security team and relevant stakeholders about the incident for awareness and further investigation.
- Review and update Okta's device recognition policies to improve detection of unknown or rare devices, reducing the risk of similar incidents.
- Monitor for any further suspicious SSO activities from unknown devices and escalate to the incident response team if additional alerts are triggered."""
references = ["https://trust.okta.com/security-advisories/okta-classic-application-sign-on-policy-bypass-2024/"]
risk_score = 47
rule_id = "1502a836-84b2-11ef-b026-f661ea17fbcc"
severity = "medium"
tags = [
"Domain: SaaS",
"Data Source: Okta",
"Use Case: Threat Detection",
"Use Case: Identity and Access Audit",
"Tactic: Initial Access",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "new_terms"
query = '''
data_stream.dataset: "okta.system"
and event.action: "user.authentication.sso"
and event.outcome: "success"
and okta.client.device: ("Unknown" or "unknown")
'''
[[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.tactic]
id = "TA0001"
name = "Initial Access"
reference = "https://attack.mitre.org/tactics/TA0001/"
[rule.new_terms]
field = "new_terms_fields"
value = ["client.user.name", "okta.client.user_agent.raw_user_agent"]
[[rule.new_terms.history_window_start]]
field = "history_window_start"
value = "now-14d"
Stages and Predicates
Stage 1: new_terms
data_stream.dataset: "okta.system"
and event.action: "user.authentication.sso"
and event.outcome: "success"
and okta.client.device: ("Unknown" or "unknown")
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
data_stream.dataset | eq |
| field:"data_stream.dataset" kind:eq value:"okta.system" |
event.action | eq |
| field:"EventType" kind:eq value:"user.authentication.sso" |
event.outcome | eq |
| field:"event.outcome" kind:eq value:"success" |
okta.client.device | in |
| field:"okta.client.device" kind:in |
Suspicious Command Prompt Network Connection
#Identifies a network connection by the command prompt (cmd.exe) when it is executed with specific arguments, such as a script or a URL, or when it is spawned by Microsoft Office applications. Adversaries often abuse cmd.exe to download malicious payloads or establish command and control channels from a remote source.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Execution | |
| Command & Control |
Telemetry Coverage
Rule Body
[metadata]
creation_date = "2020/02/18"
integration = ["endpoint", "windows", "sentinel_one_cloud_funnel"]
maturity = "production"
updated_date = "2026/05/04"
[rule]
author = ["Elastic"]
description = """
Identifies a network connection by the command prompt (cmd.exe) when it is executed with specific arguments, such as a
script or a URL, or when it is spawned by Microsoft Office applications. Adversaries often abuse cmd.exe to download
malicious payloads or establish command and control channels from a remote source.
"""
from = "now-9m"
index = [
"winlogbeat-*",
"logs-endpoint.events.process-*",
"logs-endpoint.events.network-*",
"logs-windows.sysmon_operational-*",
"logs-sentinel_one_cloud_funnel.*",
]
language = "eql"
license = "Elastic License v2"
name = "Suspicious Command Prompt 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 Suspicious Command Prompt Network Connection
This alert identifies a Windows `cmd.exe` process start event that is quickly followed by a network connection from the same `cmd.exe` instance (`process.entity_id`). The command line indicates scripted execution (batch files), references to remote resources (URL-like strings), or execution launched by a Microsoft Office application. This pattern can be used to download payloads, stage execution, or establish command and control.
#### Triage and analysis steps
- Confirm the matched sequence and keep analysis tied to the correct process instance:
- Use the `Investigate in timeline` button in the Alerts table or pivot on `process.entity_id` to review both the process start event and the associated network event(s).
- Example KQL pivots:
- `process.entity_id:"<process_entity_id>" and event.category:process`
- `process.entity_id:"<process_entity_id>" and event.category:network`
- Determine why `cmd.exe` matched and assess intent:
- Review `process.args` to confirm the interpreter switch (`/c` to execute and exit, `/k` to remain open).
- Identify which match condition applies:
- Batch script: `process.args` includes a `.bat` or `.cmd` reference.
- Remote resource: `process.command_line` contains `http://`, `https://`, or `ftp://`.
- Office parent: `process.parent.name` is one of `winword.exe`, `excel.exe`, `powerpnt.exe`, `outlook.exe`, `msaccess.exe`, or `mspub.exe`.
- Look for staging or obfuscation patterns in `process.command_line` (for example: `&`/`&&`/`||`, pipes `|`, redirection `>`/`>>`, escaping `^`, environment variables, or long encoded strings).
- Validate the execution context and launch vector:
- Review `user.*` fields to determine who ran the command and whether it is expected for the host role.
- Review `process.parent.name` (and `process.parent.command_line` if available) to understand the initial trigger:
- Office parent: prioritize identifying the initiating document or message and any user interaction around `@timestamp`.
- Management tooling or installer parent: validate change control and whether the command line and destination are consistent with that software.
- If a batch script is referenced, locate the script on the host (if telemetry allows) and capture path and hash (`file.path`, `file.hash.sha256`) for scoping.
- Analyze the outbound destination:
- Review `destination.ip` and `destination.port` for expectedness (business relationship, known vendor, or organization-owned public IP space).
- Note: the rule excludes common private and reserved address ranges, but it can still alert on connections to legitimate public services.
- Pivot on `destination.ip` to identify other hosts contacting the same destination near `@timestamp`:
- `destination.ip:"<destination_ip>" and event.category:network`
- Check whether the same `process.entity_id` generated repeated connections (potential beaconing) versus a single connection (one-time retrieval).
- Reconstruct follow-on activity and potential impact:
- Identify child processes spawned by `cmd.exe` and look for common follow-on tooling (for example: `powershell.exe`, `mshta.exe`, `rundll32.exe`, `regsvr32.exe`, `certutil.exe`, `bitsadmin.exe`, `curl.exe`, `wget.exe`).
- If file telemetry is available, review file creation/modification shortly after `@timestamp` and correlate any new binaries or scripts with hashes and execution events.
- Scope the activity (blast radius):
- Search for the same `process.command_line` (or distinctive substrings), script name, or extracted URL across endpoints.
- Search for other `cmd.exe` instances connecting to the same `destination.ip` or the same destination port/protocol.
- If the parent is Office, scope for the same parent-child relationship (`process.parent.name` -> `cmd.exe`) across users and hosts.
### False positive analysis
- Software deployment, packaging, or endpoint management workflows that use `cmd.exe /c` to run batch scripts and contact vendor services.
- Signed installer or updater activity where `cmd.exe` is used as a helper process with stable command lines.
- Documented Office macros/add-ins/templates that legitimately spawn `cmd.exe` with consistent command lines and destinations.
A benign determination is more likely when the combination of `process.parent.name`, stable `process.command_line`, and consistent `destination.ip`/`destination.port` repeats across an expected set of hosts and users and aligns to a documented workflow owner.
### Response and remediation
- If the activity is suspicious or cannot be attributed to an approved workflow:
- Contain the affected endpoint (`host.id`) using available endpoint or network controls.
- Preserve evidence (at minimum):
- `@timestamp`, `host.*`, `user.*`
- `process.entity_id`, `process.command_line`, `process.args`, `process.parent.*`
- `destination.ip`, `destination.port`, `network.*`
- Any related child processes and file artifacts (paths and hashes) identified during triage
- Scope for related activity by searching for additional occurrences of the same destination and command-line patterns.
- If Office is the launch vector, identify and quarantine the initiating document or email and assess whether similar content was delivered to other users.
- If a script is involved, collect and review the script contents and investigate how it was introduced (downloads, email attachments, shared drives, logon scripts, scheduled tasks).
- If account compromise is suspected, follow established identity response procedures (credential reset, session review, and access auditing).
- If the activity is confirmed benign:
- Document the expected parent process, command-line pattern, and destinations.
- Consider adding a narrowly scoped exception using stable identifiers and constrained conditions (for example, specific `process.command_line` patterns and known destinations) to reduce recurring noise.
"""
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)
"""
references = ["https://www.iana.org/assignments/iana-ipv4-special-registry/iana-ipv4-special-registry.xhtml"]
risk_score = 21
rule_id = "89f9a4b0-9f8f-4ee0-8823-c4751a6d6696"
severity = "low"
tags = [
"Domain: Endpoint",
"OS: Windows",
"Use Case: Threat Detection",
"Tactic: Execution",
"Resources: Investigation Guide",
"Data Source: Elastic Defend",
"Data Source: Sysmon",
"Data Source: SentinelOne",
]
type = "eql"
query = '''
sequence by process.entity_id with maxspan=15s
[process where host.os.type == "windows" and event.type == "start" and
process.name : "cmd.exe" and process.args : ("/c", "/k") and
(
process.args : ("*.bat", "*.cmd") or
process.command_line : ("*http://*", "*https://*", "*ftp://*") or
process.parent.name : ("excel.exe", "msaccess.exe", "mspub.exe", "powerpnt.exe", "winword.exe", "outlook.exe")
)
]
[network where host.os.type == "windows" and process.name : "cmd.exe" and
not cidrmatch(destination.ip, "10.0.0.0/8", "127.0.0.0/8", "169.254.0.0/16", "172.16.0.0/12", "192.0.0.0/24",
"192.0.0.0/29", "192.0.0.8/32", "192.0.0.9/32", "192.0.0.10/32", "192.0.0.170/32",
"192.0.0.171/32", "192.0.2.0/24", "192.31.196.0/24", "192.52.193.0/24",
"192.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")]
'''
[[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.003"
name = "Windows Command Shell"
reference = "https://attack.mitre.org/techniques/T1059/003/"
[rule.threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
[[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]]
id = "T1105"
name = "Ingress Tool Transfer"
reference = "https://attack.mitre.org/techniques/T1105/"
[rule.threat.tactic]
id = "TA0011"
name = "Command and Control"
reference = "https://attack.mitre.org/tactics/TA0011/"
[rule.investigation_fields]
field_names = [
"@timestamp",
"host.name",
"host.id",
"user.name",
"user.domain",
"user.id",
"process.entity_id",
"process.name",
"process.parent.name"
]
Stages and Predicates
Ordered sequence: each step below must occur in order within 15s, correlated by process.entity_id.
Stage 1: process
[process where host.os.type == "windows" and event.type == "start" and
process.name : "cmd.exe" and process.args : ("/c", "/k") and
(
process.args : ("*.bat", "*.cmd") or
process.command_line : ("*http://*", "*https://*", "*ftp://*") or
process.parent.name : ("excel.exe", "msaccess.exe", "mspub.exe", "powerpnt.exe", "winword.exe", "outlook.exe")
)
]
Stage 2: network
[network where host.os.type == "windows" and process.name : "cmd.exe" and
not cidrmatch(destination.ip, "10.0.0.0/8", "127.0.0.0/8", "169.254.0.0/16", "172.16.0.0/12", "192.0.0.0/24",
"192.0.0.0/29", "192.0.0.8/32", "192.0.0.9/32", "192.0.0.10/32", "192.0.0.170/32",
"192.0.0.171/32", "192.0.2.0/24", "192.31.196.0/24", "192.52.193.0/24",
"192.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")]
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.command_line | wildcard |
| field:"CommandLine" kind:wildcard |
process.name | wildcard |
| field:"process_basename" kind:wildcard value:"cmd.exe" |
process.parent.name | wildcard |
| field:"parent_process_basename" kind:wildcard |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
destination.ip | cidr_match | 10.0.0.0/8, 127.0.0.0/8, 169.254.0.0/16, 172.16.0.0/12, 192.0.0.0/24, 192.0.0.0/29, 192.0.0.8/32, 192.0.0.9/32, 192.0.0.10/32, 192.0.0.170/32, 192.0.0.171/32, 192.0.2.0/24, 192.31.196.0/24, 192.52.193.0/24, 192.168.0.0/16, 192.88.99.0/24, 224.0.0.0/4, 100.64.0.0/10, 192.175.48.0/24, 198.18.0.0/15, 198.51.100.0/24, 203.0.113.0/24, 240.0.0.0/4, ::1, FE80::/10, FF00::/8 | excludes:destination.ip |
Suspicious DD Execution
#Detects suspicious execution of the dd command reading from standard input, often used by infostealer malware to convert decoded data. This technique is uncommon on macOS and typically indicates malicious activity.
MITRE ATT&CK Coverage
Telemetry Coverage
Rule Body
[rule]
description = """
Detects suspicious execution of the dd command reading from standard input, often used by infostealer malware to convert
decoded data. This technique is uncommon on macOS and typically indicates malicious activity.
"""
id = "c99b8b83-2b2c-43b0-a962-ddb0274c6939"
license = "Elastic License v2"
name = "Suspicious DD Execution"
os_list = ["macos"]
version = "1.0.10"
query = '''
sequence by process.Ext.effective_parent.entity_id with maxspan=15s
[process where event.type == "start" and event.action == "exec" and (process.name in ("bash", "sh", "zsh", "osascript", "dash", "csh", "tcsh", "ksh", "tclsh", "fish") or process.name like "tclsh*" or (process.code_signature.trusted == false or process.code_signature.exists == false)) and
not process.Ext.effective_parent.executable like ("/Library/Addigy/go-agent",
"/usr/local/bin/amagent",
"/Applications/Support.app/Contents/MacOS/Support",
"/Library/Application Support/Mosyle/MosyleMDM.app/Contents/MacOS/MosyleMDM",
"/Library/Sentinel/sentinel-agent.bundle/Contents/MacOS/sentineld_helper.app/Contents/MacOS/sentineld_helper",
"/Library/Application Support/JAMF/Jamf.app/Contents/MacOS/JamfDaemon.app/Contents/MacOS/JamfDaemon",
"/Library/Application Support/JAMF/Jamf.app/Contents/MacOS/JamfManagementService.app/Contents/MacOS/JamfManagementService",
"/usr/local/jamf/bin/jamf") and
not process.parent.command_line like "/bin/bash /Library/Scripts/Elastic SHIELD Firewall Manager LAUNCHD"]
[process where event.type == "start" and event.action == "exec" and process.name == "dd" and
process.command_line : "*if=/dev/stdin*"]
'''
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 = "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 = "T1027"
name = "Obfuscated Files or Information"
reference = "https://attack.mitre.org/techniques/T1027/"
[[threat.technique]]
id = "T1140"
name = "Deobfuscate/Decode Files or Information"
reference = "https://attack.mitre.org/techniques/T1140/"
[threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
[internal]
min_endpoint_version = "8.11.0"
Stages and Predicates
Ordered sequence: each step below must occur in order within 15s, correlated by process.Ext.effective_parent.entity_id.
Stage 1: process
[process where event.type == "start" and event.action == "exec" and (process.name in ("bash", "sh", "zsh", "osascript", "dash", "csh", "tcsh", "ksh", "tclsh", "fish") or process.name like "tclsh*" or (process.code_signature.trusted == false or process.code_signature.exists == false)) and
not process.Ext.effective_parent.executable like ("/Library/Addigy/go-agent",
"/usr/local/bin/amagent",
"/Applications/Support.app/Contents/MacOS/Support",
"/Library/Application Support/Mosyle/MosyleMDM.app/Contents/MacOS/MosyleMDM",
"/Library/Sentinel/sentinel-agent.bundle/Contents/MacOS/sentineld_helper.app/Contents/MacOS/sentineld_helper",
"/Library/Application Support/JAMF/Jamf.app/Contents/MacOS/JamfDaemon.app/Contents/MacOS/JamfDaemon",
"/Library/Application Support/JAMF/Jamf.app/Contents/MacOS/JamfManagementService.app/Contents/MacOS/JamfManagementService",
"/usr/local/jamf/bin/jamf") and
not process.parent.command_line like "/bin/bash /Library/Scripts/Elastic SHIELD Firewall Manager LAUNCHD"]
Stage 2: process
[process where event.type == "start" and event.action == "exec" and process.name == "dd" and
process.command_line : "*if=/dev/stdin*"]
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.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.command_line | wildcard |
| field:"CommandLine" kind:wildcard value:"*if=/dev/stdin*" |
process.name | eq |
| field:"process_basename" kind:eq value:"dd" |
process.name | in |
| field:"process_basename" kind:in |
process.name | wildcard |
| field:"process_basename" kind:wildcard value:"tclsh*" |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.Ext.effective_parent.executable | eq | /Library/Addigy/go-agent, /usr/local/bin/amagent, /Applications/Support.app/Contents/MacOS/Support, /Library/Application Support/Mosyle/MosyleMDM.app/Contents/MacOS/MosyleMDM, /Library/Sentinel/sentinel-agent.bundle/Contents/MacOS/sentineld_helper.app/Contents/MacOS/sentineld_helper, /Library/Application Support/JAMF/Jamf.app/Contents/MacOS/JamfDaemon.app/Contents/MacOS/JamfDaemon, /Library/Application Support/JAMF/Jamf.app/Contents/MacOS/JamfManagementService.app/Contents/MacOS/JamfManagementService, /usr/local/jamf/bin/jamf | excludes:process.Ext.effective_parent.executable |
process.parent.command_line | eq | /bin/bash /Library/Scripts/Elastic SHIELD Firewall Manager LAUNCHD | excludes:process.parent.command_line field:"process.parent.command_line" value:"/bin/bash /Library/Scripts/Elastic SHIELD Firewall Manager LAUNCHD" |
Suspicious File Made Executable via Chmod Inside A Container
#This rule detects when chmod or chown are used to add the execute permission to a file in a world-writeable directory, and inside of a container. Modifying file permissions to make a file executable could indicate malicious activity, as an attacker may attempt to run unauthorized or malicious code inside the container.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Execution | |
| Privilege Escalation | |
| Defense Impairment |
Rule Body
[metadata]
creation_date = "2025/03/12"
integration = ["endpoint"]
maturity = "production"
updated_date = "2026/03/24"
[rule]
author = ["Elastic"]
description = """
This rule detects when chmod or chown are used to add the execute permission to a file in a world-writeable directory,
and inside of a container. Modifying file permissions to make a file executable could indicate malicious activity, as
an attacker may attempt to run unauthorized or malicious code inside the container.
"""
from = "now-9m"
index = ["logs-endpoint.events.process*"]
language = "eql"
license = "Elastic License v2"
name = "Suspicious File Made Executable via Chmod Inside A Container"
note = """## Triage and analysis
> **Disclaimer**:
> This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.
### Investigating Suspicious File Made Executable via Chmod Inside A Container
Containers provide isolated environments for running applications, often on Linux systems. The `chmod` command is used to change file permissions, including making files executable. Adversaries may exploit this by altering permissions to execute unauthorized scripts or binaries, potentially leading to malicious activity. The detection rule identifies such actions by monitoring for `chmod` usage that grants execute permissions, focusing on specific permission patterns, and excluding benign cases. This helps in identifying potential threats where attackers attempt to execute unauthorized code within containers.
### Possible investigation steps
- Examine the process arguments to determine the exact permissions that were set and identify the file that was made executable.
- Investigate the origin of the `chmod` command by reviewing the process tree to understand which parent process initiated it and whether it aligns with expected behavior.
- Check the user account or service account that executed the `chmod` command to assess if it has legitimate access and reason to modify file permissions.
- Analyze the file that was made executable to determine its contents and origin, checking for any signs of unauthorized or malicious code.
- Correlate this event with other logs or alerts from the same container to identify any patterns or additional suspicious activities that might indicate a broader attack.
### False positive analysis
- Routine maintenance scripts or automated processes may use chmod to set execute permissions on files within containers. To handle these, identify and whitelist specific scripts or processes that are known to be safe and necessary for operations.
- Development environments often involve frequent changes to file permissions as developers test and deploy code. Consider excluding specific container IDs or paths associated with development environments to reduce noise.
- Some container orchestration tools might use chmod as part of their normal operation. Review the processes and arguments associated with these tools and create exceptions for known benign activities.
- System updates or package installations within containers might trigger this rule. Monitor and document regular update schedules and processes, and exclude these from triggering alerts if they are verified as non-threatening.
- If certain users or roles are responsible for legitimate permission changes, consider excluding their activities by user ID or role, ensuring that these exclusions are well-documented and reviewed regularly.
### Response and remediation
- Immediately isolate the affected container to prevent further execution of unauthorized code. This can be done by stopping the container or disconnecting it from the network.
- Conduct a thorough review of the container's file system to identify any unauthorized or suspicious files that have been made executable. Remove or quarantine these files as necessary.
- Analyze the container's logs to trace the source of the `chmod` command and determine if there are any other indicators of compromise or related malicious activities.
- If the unauthorized execution is confirmed, assess the potential impact on the host system and other containers. Implement additional security measures, such as enhanced monitoring or network segmentation, to protect other assets.
- Escalate the incident to the security operations team for further investigation and to determine if the threat is part of a larger attack campaign.
- Review and update container security policies to prevent unauthorized permission changes, such as implementing stricter access controls and using security tools that enforce policy compliance.
- Enhance detection capabilities by configuring alerts for similar suspicious activities, ensuring that any future attempts to modify file permissions within containers are promptly identified and addressed."""
risk_score = 21
rule_id = "30d94e59-e5c7-4828-bc4f-f5809ad1ffe1"
setup = """## Setup
This rule requires data coming in from Elastic Defend.
### Elastic Defend Integration Setup
Elastic Defend is integrated into the Elastic Agent using Fleet. Upon configuration, the integration allows the Elastic Agent to monitor events on your host and send data to the Elastic Security app.
#### Prerequisite Requirements:
- Fleet is required for Elastic Defend.
- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).
#### The following steps should be executed in order to add the Elastic Defend integration on a Linux System:
- Go to the Kibana home page and click "Add integrations".
- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.
- Click "Add Elastic Defend".
- Configure the integration name and optionally add a description.
- Select the type of environment you want to protect, either "Traditional Endpoints" or "Cloud Workloads".
- Select a configuration preset. Each preset comes with different default settings for Elastic Agent, you can further customize these later by configuring the Elastic Defend integration policy. [Helper guide](https://www.elastic.co/guide/en/security/current/configure-endpoint-integration-policy.html).
- We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"
- Enter a name for the agent policy in "New agent policy name". If other agent policies already exist, you can click the "Existing hosts" tab and select an existing policy instead.
For more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/8.10/agent-policy.html).
- Click "Save and Continue".
- To complete the integration, select "Add Elastic Agent to your hosts" and continue to the next section to install the Elastic Agent on your hosts.
For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
"""
severity = "low"
tags = [
"Domain: Container",
"OS: Linux",
"Use Case: Threat Detection",
"Tactic: Execution",
"Tactic: Defense Evasion",
"Data Source: Elastic Defend",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
process where host.os.type == "linux" and event.type == "start" and event.action == "exec" and
process.entry_leader.entry_meta.type == "container" and process.name in ("chmod", "chown") and
process.args in ("4755", "755", "000", "777", "444", "+x") and
process.args like ("/dev/shm/*", "/tmp/*", "/var/tmp/*", "/run/*", "/var/run/*", "/mnt/*", "/media/*")
'''
[[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.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1222"
name = "File and Directory Permissions Modification"
reference = "https://attack.mitre.org/techniques/T1222/"
[[rule.threat.technique.subtechnique]]
id = "T1222.002"
name = "Linux and Mac File and Directory Permissions Modification"
reference = "https://attack.mitre.org/techniques/T1222/002/"
[[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.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
[[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.tactic]
id = "TA0004"
name = "Privilege Escalation"
reference = "https://attack.mitre.org/tactics/TA0004/"
Stages and Predicates
Stage 1: process
process where host.os.type == "linux" and event.type == "start" and event.action == "exec" and
process.entry_leader.entry_meta.type == "container" and process.name in ("chmod", "chown") and
process.args in ("4755", "755", "000", "777", "444", "+x") and
process.args like ("/dev/shm/*", "/tmp/*", "/var/tmp/*", "/run/*", "/var/run/*", "/mnt/*", "/media/*")
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | eq |
| field:"EventType" kind:eq value:"exec" |
event.type | eq |
| field:"event.type" kind:eq value:"start" |
process.args | in |
| field:"process.args" kind:in |
process.args | wildcard |
| field:"process.args" kind:wildcard |
process.entry_leader.entry_meta.type | eq |
| field:"process.entry_leader.entry_meta.type" kind:eq value:"container" |
process.name | in |
| field:"process_basename" kind:in |
Suspicious ImagePath Service Creation
#Identifies the creation of a suspicious ImagePath value. This could be an indication of an adversary attempting to stealthily persist or escalate privileges through abnormal service creation.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Persistence |
Telemetry Coverage
Rule Body
[metadata]
creation_date = "2020/11/23"
integration = ["endpoint", "windows", "m365_defender", "sentinel_one_cloud_funnel", "crowdstrike"]
maturity = "production"
updated_date = "2026/05/03"
[rule]
author = ["Elastic"]
description = """
Identifies the creation of a suspicious ImagePath value. This could be an indication of an adversary attempting to
stealthily persist or escalate privileges through abnormal service creation.
"""
from = "now-9m"
index = [
"logs-endpoint.events.registry-*",
"endgame-*",
"logs-windows.sysmon_operational-*",
"winlogbeat-*",
"logs-m365_defender.event-*",
"logs-sentinel_one_cloud_funnel.*",
"logs-crowdstrike.fdr*",
]
language = "eql"
license = "Elastic License v2"
name = "Suspicious ImagePath Service Creation"
risk_score = 73
rule_id = "36a8e048-d888-4f61-a8b9-0f9e2e40f317"
severity = "high"
tags = [
"Domain: Endpoint",
"OS: Windows",
"Use Case: Threat Detection",
"Tactic: Persistence",
"Data Source: Elastic Endgame",
"Data Source: Elastic Defend",
"Data Source: Sysmon",
"Data Source: Microsoft Defender XDR",
"Data Source: SentinelOne",
"Data Source: Crowdstrike",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
registry where host.os.type == "windows" and event.type == "change" and
registry.value : "ImagePath" and
registry.path : "*\\SYSTEM\\ControlSet*\\Services\\*\\ImagePath" and
/* add suspicious registry ImagePath values here */
registry.data.strings : ("%COMSPEC%*", "*\\.\\pipe\\*")
'''
note = """## Triage and analysis
### Investigating Suspicious ImagePath Service Creation
#### Possible investigation steps
- What exact service "ImagePath" behavior did the alert preserve?
- Why: shell and pipe-backed service launches require different execution pivots.
- Focus: `registry.path`, `registry.key`, `registry.value`, `registry.data.type`, `registry.data.strings`.
- Implication: escalate when the value invokes the command interpreter, chains shell commands, or points to a local named pipe instead of a normal service executable; lower concern only when exact key and value match a recognized same-product service wrapper.
- Who wrote the service value, and does that context fit service management?
- Focus: `process.executable`, `process.command_line`, `process.code_signature.subject_name`, `process.code_signature.trusted`, `user.id`.
- Hint: if the writer is "svchost.exe" or another broker, use `process.parent.executable` and broader lineage before attributing intent. $investigate_0
- Implication: escalate for unsigned utilities, script hosts, remote-admin tools, unusual paths, or user contexts that do not fit service changes; lower concern only when signer, path, command line, and user fit a recognized installer or management agent.
- Did the same writer change other values under the service key?
- Why: existing-service edits can preserve trust while changing start mode, account context, DLL loading, failure behavior, or security descriptor.
- Focus: same-`host.id` registry events scoped by service `registry.key`, reviewing `registry.value` and `registry.data.strings`. $investigate_1
- Implication: escalate when surrounding values make the service autostart, run privileged, load a DLL/parameter path, restart on failure, or become harder to enumerate; lower concern when the writer performs only one bounded product-owned service update.
- Did the service path execute or spawn follow-on activity?
- Focus: later same-`host.id` process events where `process.executable` or `process.command_line` matches the recovered service value, plus `process.parent.executable` and lineage. $investigate_2
- Range: start with the alert window; expand after `@timestamp` only to test delayed service start.
- Hint: for command-interpreter paths, search "cmd.exe" and recovered command fragments in `process.command_line`; for named-pipe paths, search "services.exe" lineage, helpers, or service-start failures instead of expecting a file-backed executable.
- Implication: escalate when service lineage launches a shell, pipe helper, or unexpected child soon after the write; do not close solely because execution is not visible, since the service may start later or fail during launch.
- If execution occurred, does the launched process fit the expected service?
- Focus: recovered launch event: `process.hash.sha256`, `process.code_signature.subject_name`, `process.code_signature.trusted`, `process.pe.original_file_name`, `process.Ext.relative_file_creation_time`.
- Implication: escalate when the binary is unsigned, newly created, renamed, PE-mismatched, or unrelated to the writer signer; lower concern when identity, signer, age, and service value all fit the same recognized product.
- What disposition do service value, writer, adjacent values, execution, and related alerts support?
- Hint: if local evidence remains suspicious or unresolved, review user- and host-scoped alerts.
- $investigate_3
- $investigate_4
- Implication: escalate when shell or named-pipe execution plus writer, adjacent value, execution, or alert context fails to fit one recognized workflow; close only when those categories converge on the exact service-management activity, using outside confirmation when telemetry cannot prove legitimacy; if evidence is mixed or incomplete, preserve registry and process evidence and escalate.
### False positive analysis
- Software installation, repair, agent upgrade, remote-support, or deployment tooling can rewrite service "ImagePath" values or register short-lived helper services only when a signed installer, management component, vendor behavior, or internal test plan owns the service end-to-end. Confirm `process.executable`, signer/trust, `user.id`, `registry.key`, `registry.data.strings`, and later parent/command-line activity align with that workflow, not an ad hoc shell or pipe helper.
- Shell or pipe "ImagePath" behavior is an anti-pattern unless the vendor or test plan accounts for that exact helper. Without records, require current-case telemetry that writer, signer, service key/value, `user.id`, `host.id`, later execution, and related alerts align without contradiction.
- Before creating an exception, use prior alerts only to prove exception stability, not to close the case. Validate consistent service value, writer, user, host, and execution behavior across the same workflow. Treat a first occurrence as a candidate exception, not a suppression. Build the exception from the minimum confirmed pattern: writer signer and path, exact service key, exact `registry.data.strings`, `user.id`, and `host.id`. Avoid exceptions on `registry.value` = "ImagePath", "services.exe", or the rule name alone.
### Response and remediation
- If confirmed benign, preserve the case export and document the writer identity, exact service key and value, affected `user.id` and `host.id`, and later service-start behavior that proved the recognized workflow before reversing temporary containment. Keep any exception narrow and require recurrence of the same workflow pattern.
- If suspicious but unconfirmed, preserve a case export of the triggering registry event, exact service key/value, writer process details, launched-process details, and volatile service state before containment. Then apply reversible containment tied to those findings, such as disabling the affected service, preventing the referenced command from starting, or isolating the host only after weighing service criticality. Escalate to account or broader host action only when related alerts or later execution show wider compromise.
- If confirmed malicious, preserve the same registry and process evidence before destructive action. Disable and remove the malicious or hijacked service, restore the expected "ImagePath", quarantine the referenced executable or command artifact when present, and review the same `process.entity_id`, `registry.key`, and service lineage for additional unauthorized service changes before cleanup. Use endpoint response tooling to contain the host or terminate the recovered malicious process when available; if direct response is unavailable, escalate with the preserved identifiers to the team that can act.
- After containment, review other hosts for the same `registry.data.strings`, service-key pattern, signer, hash, or command fragment before deleting artifacts, then verify that no additional services reference the same shell, named pipe, or staged payload.
- Post-incident hardening: restrict service creation and service-registry writes to trusted installers and management tools, retain registry and process telemetry needed to correlate "ImagePath" changes to later execution, and record any adjacent service-abuse variant surfaced during triage.
"""
setup = """## Setup
This rule is designed for data generated by [Elastic Defend](https://www.elastic.co/security/endpoint-security), which provides native endpoint detection and response, along with event enrichments designed to work with our detection rules.
Setup instructions: https://ela.st/install-elastic-defend
### Additional data sources
This rule also supports the following third-party data sources. For setup instructions, refer to the links below:
- [CrowdStrike](https://ela.st/crowdstrike-integration)
- [Microsoft Defender XDR](https://ela.st/m365-defender)
- [SentinelOne Cloud Funnel](https://ela.st/sentinel-one-cloud-funnel)
- [Sysmon Registry Events](https://ela.st/sysmon-event-reg-setup)
"""
[rule.investigation_fields]
field_names = [
"@timestamp",
"host.id",
"user.id",
"process.entity_id",
"process.pid",
"process.executable",
"process.command_line",
"process.code_signature.subject_name",
"process.code_signature.trusted",
"process.parent.executable",
"registry.path",
"registry.key",
"registry.value",
"registry.data.type",
"registry.data.strings",
]
[transform]
[[transform.investigate]]
label = "Activity from this writer process"
description = ""
providers = [
[
{ excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" },
{ excluded = false, field = "process.entity_id", queryType = "phrase", value = "{{process.entity_id}}", valueType = "string" }
],
[
{ excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" },
{ excluded = false, field = "process.pid", queryType = "phrase", value = "{{process.pid}}", valueType = "string" }
]
]
relativeFrom = "now-1h"
relativeTo = "now"
[[transform.investigate]]
label = "Registry events for the same service key"
description = ""
providers = [
[
{ excluded = false, field = "event.category", queryType = "phrase", value = "registry", valueType = "string" },
{ excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" },
{ excluded = false, field = "registry.key", queryType = "phrase", value = "{{registry.key}}", valueType = "string" }
]
]
relativeFrom = "now-1h"
relativeTo = "now"
[[transform.investigate]]
label = "Process starts on the host near the service change"
description = ""
providers = [
[
{ excluded = false, field = "event.category", queryType = "phrase", value = "process", valueType = "string" },
{ excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" }
]
]
relativeFrom = "now-1h"
relativeTo = "now"
[[transform.investigate]]
label = "Alerts associated with the user"
description = ""
providers = [
[
{ excluded = false, field = "event.kind", queryType = "phrase", value = "signal", valueType = "string" },
{ excluded = false, field = "user.id", queryType = "phrase", value = "{{user.id}}", valueType = "string" }
]
]
relativeFrom = "now-48h/h"
relativeTo = "now"
[[transform.investigate]]
label = "Alerts associated with the host"
description = ""
providers = [
[
{ excluded = false, field = "event.kind", queryType = "phrase", value = "signal", valueType = "string" },
{ excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" }
]
]
relativeFrom = "now-48h/h"
relativeTo = "now"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1543"
name = "Create or Modify System Process"
reference = "https://attack.mitre.org/techniques/T1543/"
[[rule.threat.technique.subtechnique]]
id = "T1543.003"
name = "Windows Service"
reference = "https://attack.mitre.org/techniques/T1543/003/"
[rule.threat.tactic]
id = "TA0003"
name = "Persistence"
reference = "https://attack.mitre.org/tactics/TA0003/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1112"
name = "Modify Registry"
reference = "https://attack.mitre.org/techniques/T1112/"
[rule.threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
Stages and Predicates
Stage 1: registry
registry where host.os.type == "windows" and event.type == "change" and
registry.value : "ImagePath" and
registry.path : "*\\SYSTEM\\ControlSet*\\Services\\*\\ImagePath" and
registry.data.strings : ("%COMSPEC%*", "*\\.\\pipe\\*")
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.type | eq |
| field:"event.type" kind:eq value:"change" |
registry.data.strings | wildcard |
| field:"Details" kind:wildcard |
registry.path | wildcard |
| field:"TargetObject" kind:wildcard value:"*\SYSTEM\ControlSet*\Services\*\ImagePath" |
registry.value | wildcard |
| field:"registry_value_name" kind:wildcard value:"ImagePath" |
Suspicious Outbound Network Connection via Unsigned Binary
#Detects the execution of an unsigned or untrusted binary followed by an outbound network connection to a raw IP address on a non-standard port. Many malicious payloads will connect directly to C2 or a payload server using non-standard ports.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Defense Impairment | |
| Command & Control |
Telemetry Coverage
Rule Body
[metadata]
creation_date = "2026/01/30"
integration = ["endpoint"]
maturity = "production"
updated_date = "2026/03/24"
[rule]
author = ["Elastic"]
description = """
Detects the execution of an unsigned or untrusted binary followed by an outbound network connection to a
raw IP address on a non-standard port. Many malicious payloads will connect directly to C2 or a payload
server using non-standard ports.
"""
from = "now-9m"
index = ["logs-endpoint.events.process-*", "logs-endpoint.events.network-*"]
language = "eql"
license = "Elastic License v2"
name = "Suspicious Outbound Network Connection via Unsigned Binary"
risk_score = 73
rule_id = "e7e0588b-2b55-4f88-afd1-cf98e95e0f58"
severity = "high"
tags = [
"Domain: Endpoint",
"OS: macOS",
"Use Case: Threat Detection",
"Tactic: Command and Control",
"Data Source: Elastic Defend",
"Resources: Investigation Guide"
]
type = "eql"
note = """## Triage and analysis
> **Disclaimer**:
> This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.
### Investigating Suspicious Outbound Network Connection via Unsigned Binary
Unsigned or untrusted binaries making outbound network connections to raw IP addresses on non-standard ports is a significant indicator of malware activity. Legitimate macOS applications are typically code-signed by Apple or identified developers, while malware often lacks valid signatures. This detection rule identifies this suspicious combination of unsigned binaries with network activity to detect potential command and control communication or data exfiltration attempts.
### Possible investigation steps
- Review the process.executable and process.hash fields to identify the unsigned binary and search for its hash in threat intelligence databases and malware repositories.
- Examine the process.code_signature fields to understand why the binary is untrusted, including whether it lacks a signature entirely or has an invalid or revoked certificate.
- Analyze the destination.ip and destination.port fields to identify the remote endpoint and research it in threat intelligence sources for known malicious infrastructure.
- Investigate the process.parent.executable and process.command_line to understand how the unsigned binary was launched and trace the execution chain to the initial access vector.
- Review file.creation and file.modification events to determine when and how the unsigned binary was placed on the system.
- Check for persistence mechanisms that may have been created by or for the unsigned binary, such as LaunchAgents, LaunchDaemons, or cron jobs.
- Correlate with other network events from the same host to identify patterns of C2 communication or additional indicators of compromise.
### False positive analysis
- Custom internal tools developed in-house may be unsigned and require network access for legitimate business purposes. Verify with development teams and consider adding specific exclusions.
- Development builds and testing environments may use unsigned binaries during the software development lifecycle. Document these activities and create targeted exceptions.
- Open-source utilities compiled locally may not have code signatures. Evaluate these on a case-by-case basis and add to exclusion lists if verified safe.
- Homebrew and other package manager binaries are already excluded but verify that legitimate tools from these sources are not being flagged.
### Response and remediation
- Immediately terminate the unsigned process and block the destination IP address at network perimeters and endpoint firewalls.
- Quarantine the unsigned binary for forensic analysis and malware reverse engineering.
- Conduct a comprehensive scan of the affected system to identify additional malware components, persistence mechanisms, or lateral movement indicators.
- Investigate how the unsigned binary was delivered to the system and remediate the initial access vector.
- Review other systems in the environment for the same binary hash or similar indicators of compromise.
- Implement application allowlisting policies to prevent unauthorized unsigned binaries from executing.
- Escalate to the incident response team for further investigation if the binary is confirmed malicious.
"""
query = '''
sequence by process.entity_id with maxspan=1m
[process where host.os.type == "macos" and event.type == "start" and event.action == "exec" and
(process.code_signature.trusted == false or process.code_signature.exists == false) and
process.args_count == 1 and
not process.executable like "/opt/homebrew/*"]
[network where host.os.type == "macos" and event.type == "start" and
destination.domain == null and
not destination.port in (443, 80, 53, 22, 25, 587, 993, 465, 8080, 8200, 9200) and
destination.port < 49152 and
not cidrmatch(destination.ip, "0.0.0.0", "240.0.0.0/4", "233.252.0.0/24", "224.0.0.0/4",
"198.19.0.0/16", "192.18.0.0/15", "192.0.0.0/24", "10.0.0.0/8", "127.0.0.0/8",
"169.254.0.0/16", "172.16.0.0/12", "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", "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",
"::1", "FE80::/10", "FF00::/8")]
'''
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1571"
name = "Non-Standard Port"
reference = "https://attack.mitre.org/techniques/T1571/"
[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 = "T1553"
name = "Subvert Trust Controls"
reference = "https://attack.mitre.org/techniques/T1553/"
[[rule.threat.technique.subtechnique]]
id = "T1553.001"
name = "Gatekeeper Bypass"
reference = "https://attack.mitre.org/techniques/T1553/001/"
[rule.threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
Stages and Predicates
Ordered sequence: each step below must occur in order within 1m, correlated by process.entity_id.
Stage 1: process
[process where host.os.type == "macos" and event.type == "start" and event.action == "exec" and
(process.code_signature.trusted == false or process.code_signature.exists == false) and
process.args_count == 1 and
not process.executable like "/opt/homebrew/*"]
Stage 2: network
[network where host.os.type == "macos" and event.type == "start" and
destination.domain == null and
not destination.port in (443, 80, 53, 22, 25, 587, 993, 465, 8080, 8200, 9200) and
destination.port < 49152 and
not cidrmatch(destination.ip, "0.0.0.0", "240.0.0.0/4", "233.252.0.0/24", "224.0.0.0/4",
"198.19.0.0/16", "192.18.0.0/15", "192.0.0.0/24", "10.0.0.0/8", "127.0.0.0/8",
"169.254.0.0/16", "172.16.0.0/12", "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", "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",
"::1", "FE80::/10", "FF00::/8")]
Indicators
These rows show field, operator, and value matches.
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.executable | starts_with | /opt/homebrew/ | excludes:process.executable field:"process.executable" value:"/opt/homebrew/" |
destination.ip | cidr_match | 0.0.0.0, 240.0.0.0/4, 233.252.0.0/24, 224.0.0.0/4, 198.19.0.0/16, 192.18.0.0/15, 192.0.0.0/24, 10.0.0.0/8, 127.0.0.0/8, 169.254.0.0/16, 172.16.0.0/12, 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, 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, ::1, FE80::/10, FF00::/8 | excludes:destination.ip |
destination.port | in | 22, 25, 443, 465, 53, 587, 80, 8080, 8200, 9200, 993 | excludes:destination.port |
UAC Bypass Attempt via CDSSync Scheduled Task Hijack
#Identifies attempts to bypass User Account Control (UAC) via CDSSync scheduled task hijack by modifying the system root environment variable leading to loading a malicious npmproxy.dll module. Attackers may attempt to bypass UAC to stealthily execute code with elevated permissions.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Privilege Escalation | |
| Stealth |
Rule Body
[rule]
description = """
Identifies attempts to bypass User Account Control (UAC) via CDSSync scheduled task hijack by modifying the system root
environment variable leading to loading a malicious npmproxy.dll module. Attackers may attempt to bypass UAC to
stealthily execute code with elevated permissions.
"""
id = "d8b7a157-c98f-42bd-8aac-7d1e4fcd53f4"
license = "Elastic License v2"
name = "UAC Bypass Attempt via CDSSync Scheduled Task Hijack"
os_list = ["windows"]
reference = ["https://github.com/AzAgarampur/byeintegrity5-uac"]
version = "1.0.34"
query = '''
sequence with maxspan=60s
[file where file.path : "?:\\*\\system32\\npmproxy.dll" and
not file.path : ("?:\\Windows\\System32\\npmproxy.dll", "?:\\Windows\\SysWOW64\\npmproxy.dll")]
[process where event.action == "start" and
process.parent.name : "taskhostw.exe" and process.Ext.token.integrity_level_name == "high" and
not (process.executable : ("?:\\Windows\\System32\\rdrleakdiag.exe", "C:\\Windows\\System32\\WinSAT.exe") and
process.code_signature.trusted == true and process.code_signature.subject_name : "Microsoft*")]
'''
min_endpoint_version = "7.15.0"
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 1
[[optional_actions]]
action = "rollback"
field = "process.entity_id"
state = 1
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1548"
name = "Abuse Elevation Control Mechanism"
reference = "https://attack.mitre.org/techniques/T1548/"
[[threat.technique.subtechnique]]
id = "T1548.002"
name = "Bypass User Account Control"
reference = "https://attack.mitre.org/techniques/T1548/002/"
[threat.tactic]
id = "TA0004"
name = "Privilege Escalation"
reference = "https://attack.mitre.org/tactics/TA0004/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1574"
name = "Hijack Execution Flow"
reference = "https://attack.mitre.org/techniques/T1574/"
[[threat.technique.subtechnique]]
id = "T1574.001"
name = "DLL"
reference = "https://attack.mitre.org/techniques/T1574/001/"
[threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
[internal]
min_endpoint_version = "7.15.0"
Stages and Predicates
Stage 1: file
[file where file.path : "?:\\*\\system32\\npmproxy.dll" and
not file.path : ("?:\\Windows\\System32\\npmproxy.dll", "?:\\Windows\\SysWOW64\\npmproxy.dll")]
Stage 2: process
[process where event.action == "start" and
process.parent.name : "taskhostw.exe" and process.Ext.token.integrity_level_name == "high" and
not (process.executable : ("?:\\Windows\\System32\\rdrleakdiag.exe", "C:\\Windows\\System32\\WinSAT.exe") and
process.code_signature.trusted == true and process.code_signature.subject_name : "Microsoft*")]
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | eq |
| field:"EventType" kind:eq value:"start" |
file.path | wildcard |
| field:"TargetFilename" kind:wildcard value:"?:\*\system32\npmproxy.dll" |
process.Ext.token.integrity_level_name | eq |
| field:"process.Ext.token.integrity_level_name" kind:eq value:"high" |
process.parent.name | wildcard |
| field:"parent_process_basename" kind:wildcard value:"taskhostw.exe" |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
file.path | eq | ?:\Windows\System32\npmproxy.dll, ?:\Windows\SysWOW64\npmproxy.dll | excludes:file.path field:"file.path" value:"?:\Windows\System32\npmproxy.dll" field:"file.path" value:"?:\Windows\SysWOW64\npmproxy.dll" |
process.code_signature.subject_name | starts_with | Microsoft | excludes:process.code_signature.subject_name field:"process.code_signature.subject_name" value:"Microsoft" |
process.code_signature.trusted | eq | true | excludes:process.code_signature.trusted field:"process.code_signature.trusted" value:"true" |
process.executable | eq | ?:\Windows\System32\rdrleakdiag.exe, C:\Windows\System32\WinSAT.exe | excludes:process.executable field:"process.executable" value:"?:\Windows\System32\rdrleakdiag.exe" field:"process.executable" value:"C:\Windows\System32\WinSAT.exe" |
Unknown Execution of Binary with RWX Memory Region
#Monitors for the execution of a previously unknown unix binary with read, write and execute memory region permissions. The mprotect() system call is used to change the access protections on a region of memory that has already been allocated. This syscall allows a process to modify the permissions of pages in its virtual address space, enabling or disabling permissions such as read, write, and execute for those pages. RWX permissions on memory is in many cases overly permissive, and should be analyzed thoroughly.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Execution | |
| Stealth |
Rule Body
[metadata]
creation_date = "2024/03/13"
integration = ["auditd_manager"]
maturity = "production"
updated_date = "2026/03/24"
[rule]
author = ["Elastic"]
description = """
Monitors for the execution of a previously unknown unix binary with read, write and execute memory region permissions.
The mprotect() system call is used to change the access protections on a region of memory that has already been
allocated. This syscall allows a process to modify the permissions of pages in its virtual address space, enabling or
disabling permissions such as read, write, and execute for those pages. RWX permissions on memory is in many cases
overly permissive, and should be analyzed thoroughly.
"""
from = "now-9m"
index = ["auditbeat-*", "logs-auditd_manager.auditd-*"]
language = "kuery"
license = "Elastic License v2"
name = "Unknown Execution of Binary with RWX Memory Region"
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 Unknown Execution of Binary with RWX Memory Region
In Linux environments, the `mprotect()` system call is crucial for managing memory permissions, allowing processes to modify access rights of memory pages. Adversaries exploit this by granting read, write, and execute (RWX) permissions to inject and execute malicious code. The detection rule identifies suspicious RWX memory allocations by monitoring `mprotect()` calls, excluding known safe binaries, thus highlighting potential threats.
### Possible investigation steps
- Review the process details associated with the alert, focusing on the process.executable and process.name fields to identify the binary that triggered the alert.
- Investigate the command line arguments and parent process of the suspicious binary to understand its origin and purpose.
- Check the process's hash against known threat intelligence databases to determine if it is associated with any known malicious activity.
- Analyze the network activity of the process to identify any suspicious connections or data exfiltration attempts.
- Examine the user account under which the process is running to assess if it has been compromised or is being used for unauthorized activities.
- Review recent system logs and audit records for any other anomalies or related suspicious activities around the time of the alert.
### False positive analysis
- Known safe binaries like Node.js, Java, and Apache may trigger the rule due to their legitimate use of RWX memory regions. These are already excluded in the rule, but additional similar applications might need to be added to the exclusion list.
- Custom or in-house developed applications that require RWX permissions for legitimate functionality can also cause false positives. Identify these applications and add them to the exclusion list to prevent unnecessary alerts.
- Development environments or testing frameworks that dynamically generate and execute code might be flagged. Consider excluding these environments if they are known and trusted within your organization.
- Security tools or monitoring software that perform memory analysis or manipulation could be mistakenly identified. Verify their behavior and exclude them if they are part of your security infrastructure.
- Regularly review and update the exclusion list to ensure it reflects the current environment and any new applications that are introduced.
### Response and remediation
- Immediately isolate the affected system from the network to prevent potential lateral movement or data exfiltration by the malicious code.
- Terminate the suspicious process identified by the detection rule to halt any ongoing malicious activity.
- Conduct a forensic analysis of the affected system to identify the source and scope of the compromise, focusing on the unknown binary and its origin.
- Remove any malicious binaries or scripts identified during the forensic analysis to prevent further execution.
- Apply security patches and updates to the affected system to address any vulnerabilities that may have been exploited.
- Restore the system from a known good backup if the integrity of the system is in question and ensure all security patches are applied post-restoration.
- Escalate the incident to the security operations center (SOC) or incident response team for further investigation and to determine if additional systems are affected."""
references = [
"https://man7.org/linux/man-pages/man2/mprotect.2.html",
"https://www.elastic.co/security-labs/linux-detection-engineering-with-auditd",
]
risk_score = 47
rule_id = "23bcd283-2bc0-4db2-81d4-273fc051e5c0"
setup = """## Setup
This rule requires the use of the `auditd_manager` integration. `Auditd_manager` is a tool designed to simplify and enhance the management of the audit subsystem in Linux systems. It provides a user-friendly interface and automation capabilities for configuring and monitoring system auditing through the auditd daemon. With `auditd_manager`, administrators can easily define audit rules, track system events, and generate comprehensive audit reports, improving overall security and compliance in the system. The following steps should be executed in order to install and deploy `auditd_manager` on a Linux system.
```
Kibana -->
Management -->
Integrations -->
Auditd Manager -->
Add Auditd Manager
```
`Auditd_manager` subscribes to the kernel and receives events as they occur without any additional configuration. However, if more advanced configuration is required to detect specific behavior, audit rules can be added to the integration in either the "audit rules" configuration box or the "auditd rule files" box by specifying a file to read the audit rules from.
For this detection rule to trigger, the following additional audit rules are required to be added to the integration:
```
-a always,exit -F arch=b64 -S mprotect
```
Add the newly installed `auditd manager` to an agent policy, and deploy the agent on a Linux system from which auditd log files are desirable.
"""
severity = "medium"
tags = [
"Domain: Endpoint",
"OS: Linux",
"Use Case: Threat Detection",
"Tactic: Execution",
"Data Source: Auditd Manager",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "new_terms"
query = '''
event.category:process and host.os.type:linux and auditd.data.syscall:mprotect and auditd.data.a2:7 and not (
process.executable:(
"/usr/share/kibana/node/bin/node" or "/usr/share/elasticsearch/jdk/bin/java" or "/usr/sbin/apache2"
) or
process.name:(httpd or java or node or dotnet or github-desktop or code or tenzir or brave or qemu-* or php* or deno)
)
'''
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1059"
name = "Command and Scripting Interpreter"
reference = "https://attack.mitre.org/techniques/T1059/"
[[rule.threat.technique.subtechnique]]
id = "T1059.004"
name = "Unix Shell"
reference = "https://attack.mitre.org/techniques/T1059/004/"
[[rule.threat.technique]]
id = "T1106"
name = "Native API"
reference = "https://attack.mitre.org/techniques/T1106/"
[rule.threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1620"
name = "Reflective Code Loading"
reference = "https://attack.mitre.org/techniques/T1620/"
[rule.threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
[rule.new_terms]
field = "new_terms_fields"
value = ["process.name"]
[[rule.new_terms.history_window_start]]
field = "history_window_start"
value = "now-5d"
Stages and Predicates
Stage 1: new_terms
event.category:process and host.os.type:linux and auditd.data.syscall:mprotect and auditd.data.a2:7 and not (
process.executable:(
"/usr/share/kibana/node/bin/node" or "/usr/share/elasticsearch/jdk/bin/java" or "/usr/sbin/apache2"
) or
process.name:(httpd or java or node or dotnet or github-desktop or code or tenzir or brave or qemu-* or php* or deno)
)
Indicators
These rows show field, operator, and value matches.
Exclusions
The rule actively suppresses these predicates.
Unusual Network Connection via DllHost
#Identifies unusual instances of dllhost.exe making outbound network connections. This may indicate adversarial Command and Control activity.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Stealth | |
| Command & Control |
Telemetry Coverage
Rule Body
[metadata]
creation_date = "2021/05/28"
integration = ["endpoint", "windows", "sentinel_one_cloud_funnel"]
maturity = "production"
updated_date = "2026/05/04"
[rule]
author = ["Elastic"]
description = """
Identifies unusual instances of dllhost.exe making outbound network connections. This may indicate adversarial Command
and Control activity.
"""
from = "now-9m"
index = [
"winlogbeat-*",
"logs-endpoint.events.process-*",
"logs-endpoint.events.network-*",
"logs-windows.sysmon_operational-*",
"logs-sentinel_one_cloud_funnel.*",
]
language = "eql"
license = "Elastic License v2"
name = "Unusual Network Connection via DllHost"
note = """## Triage and analysis
> **Disclaimer**:
> This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.
### Investigating Unusual Network Connection via DllHost
Dllhost.exe is a legitimate Windows process used to host DLL services. Adversaries may exploit it for stealthy command and control by initiating unauthorized network connections. The detection rule identifies suspicious dllhost.exe activity by monitoring outbound connections to non-local IPs, which may indicate malicious intent. This approach helps in identifying potential threats by focusing on unusual network behaviors associated with this process.
### Possible investigation steps
- Review the process start event for dllhost.exe to confirm its legitimacy by checking the process arguments and the parent process that initiated it.
- Analyze the destination IP addresses involved in the network connections to determine if they are known malicious or suspicious entities, using threat intelligence sources.
- Check the timeline of events to see if there are any other unusual activities on the host around the time of the dllhost.exe network connection, such as other process executions or file modifications.
- Investigate the user account associated with the dllhost.exe process to determine if there are any signs of compromise or unauthorized access.
- Examine the network traffic patterns from the host to identify any other unusual outbound connections that might indicate broader malicious activity.
### False positive analysis
- Legitimate software updates or system maintenance tasks may cause dllhost.exe to make outbound connections. Users can monitor and whitelist known update servers to prevent these from being flagged.
- Certain enterprise applications might use dllhost.exe for legitimate network communications. Identify and document these applications, then create exceptions for their known IP addresses.
- Automated scripts or administrative tools that leverage dllhost.exe for network tasks can trigger false positives. Review and exclude these scripts or tools by specifying their associated IP ranges.
- Cloud-based services or virtual environments might route traffic through dllhost.exe. Verify these services and exclude their IP addresses from the detection rule to avoid unnecessary alerts.
### Response and remediation
- Isolate the affected host from the network immediately to prevent further unauthorized communications and potential lateral movement.
- Terminate the suspicious dllhost.exe process to stop any ongoing malicious activity and prevent further outbound connections.
- Conduct a thorough scan of the affected system using updated antivirus and anti-malware tools to identify and remove any additional malicious software or artifacts.
- Review and analyze the network logs to identify any other systems that may have been targeted or compromised, and apply similar containment measures if necessary.
- Restore the affected system from a known good backup to ensure that any potential backdoors or persistent threats are removed.
- Implement network segmentation to limit the ability of similar threats to spread across the network in the future.
- Escalate the incident to the security operations center (SOC) or incident response team for further investigation and to determine if additional organizational measures are required."""
references = [
"https://www.microsoft.com/security/blog/2021/05/27/new-sophisticated-email-based-attack-from-nobelium/",
"https://www.volexity.com/blog/2021/05/27/suspected-apt29-operation-launches-election-fraud-themed-phishing-campaigns/",
"https://www.iana.org/assignments/iana-ipv4-special-registry/iana-ipv4-special-registry.xhtml",
]
risk_score = 47
rule_id = "c7894234-7814-44c2-92a9-f7d851ea246a"
severity = "medium"
tags = [
"Domain: Endpoint",
"OS: Windows",
"Use Case: Threat Detection",
"Tactic: Defense Evasion",
"Data Source: Elastic Defend",
"Data Source: Sysmon",
"Resources: Investigation Guide",
"Data Source: SentinelOne",
]
type = "eql"
query = '''
sequence by host.id, process.entity_id with maxspan=1m
[process where host.os.type == "windows" and event.type == "start" and process.name : "dllhost.exe" and process.args_count == 1]
[network where host.os.type == "windows" and process.name : "dllhost.exe" and
not cidrmatch(destination.ip, "10.0.0.0/8", "127.0.0.0/8", "169.254.0.0/16", "172.16.0.0/12", "192.0.0.0/24",
"192.0.0.0/29", "192.0.0.8/32", "192.0.0.9/32", "192.0.0.10/32", "192.0.0.170/32", "192.0.0.171/32", "192.0.2.0/24",
"192.31.196.0/24", "192.52.193.0/24", "192.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")]
'''
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.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1071"
name = "Application Layer Protocol"
reference = "https://attack.mitre.org/techniques/T1071/"
[rule.threat.tactic]
id = "TA0011"
name = "Command and Control"
reference = "https://attack.mitre.org/tactics/TA0011/"
Stages and Predicates
Ordered sequence: each step below must occur in order within 1m, correlated by host.id, process.entity_id.
Stage 1: process
[process where host.os.type == "windows" and event.type == "start" and process.name : "dllhost.exe" and process.args_count == 1]
Stage 2: network
[network where host.os.type == "windows" and process.name : "dllhost.exe" and
not cidrmatch(destination.ip, "10.0.0.0/8", "127.0.0.0/8", "169.254.0.0/16", "172.16.0.0/12", "192.0.0.0/24",
"192.0.0.0/29", "192.0.0.8/32", "192.0.0.9/32", "192.0.0.10/32", "192.0.0.170/32", "192.0.0.171/32", "192.0.2.0/24",
"192.31.196.0/24", "192.52.193.0/24", "192.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")]
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_count | eq |
| field:"process.args_count" kind:eq value:"1" |
process.name | wildcard |
| field:"process_basename" kind:wildcard value:"dllhost.exe" |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
destination.ip | cidr_match | 10.0.0.0/8, 127.0.0.0/8, 169.254.0.0/16, 172.16.0.0/12, 192.0.0.0/24, 192.0.0.0/29, 192.0.0.8/32, 192.0.0.9/32, 192.0.0.10/32, 192.0.0.170/32, 192.0.0.171/32, 192.0.2.0/24, 192.31.196.0/24, 192.52.193.0/24, 192.168.0.0/16, 192.88.99.0/24, 224.0.0.0/4, 100.64.0.0/10, 192.175.48.0/24, 198.18.0.0/15, 198.51.100.0/24, 203.0.113.0/24, 240.0.0.0/4, ::1, FE80::/10, FF00::/8 | excludes:destination.ip |
Unusual Network Destination Domain Name
#A machine learning job detected an unusual network destination domain name. This can be due to initial access, persistence, command-and-control, or exfiltration activity. For example, when a user clicks on a link in a phishing email or opens a malicious document, a request may be sent to download and run a payload from an uncommon web server name. When malware is already running, it may send requests to an uncommon DNS domain the malware uses for command-and-control communication.
Known False Positives
- Web activity that occurs rarely in small quantities can trigger this alert. Possible examples are browsing technical support or vendor URLs that are used very sparsely. A user who visits a new and unique web destination may trigger this alert when the activity is sparse. Web applications that generate URLs unique to a transaction may trigger this when they are used sparsely. Web domains can be excluded in cases such as these.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Initial Access | |
| Command & Control | |
| Exfiltration |
Rule Body
[metadata]
creation_date = "2020/03/25"
integration = ["auditd_manager", "endpoint"]
maturity = "production"
min_stack_version = "9.4.0"
min_stack_comments = "Use EA (Entity Analytics) fields"
updated_date = "2026/07/27"
[rule]
anomaly_threshold = 50
author = ["Elastic"]
description = """
A machine learning job detected an unusual network destination domain name. This can be due to initial access,
persistence, command-and-control, or exfiltration activity. For example, when a user clicks on a link in a phishing
email or opens a malicious document, a request may be sent to download and run a payload from an uncommon web server
name. When malware is already running, it may send requests to an uncommon DNS domain the malware uses for
command-and-control communication.
"""
false_positives = [
"""
Web activity that occurs rarely in small quantities can trigger this alert. Possible examples are browsing technical
support or vendor URLs that are used very sparsely. A user who visits a new and unique web destination may trigger
this alert when the activity is sparse. Web applications that generate URLs unique to a transaction may trigger this
when they are used sparsely. Web domains can be excluded in cases such as these.
""",
]
from = "now-45m"
interval = "15m"
license = "Elastic License v2"
machine_learning_job_id = "packetbeat_rare_server_domain_ea"
name = "Unusual Network Destination Domain Name"
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
### 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.
"""
references = ["https://www.elastic.co/guide/en/security/current/prebuilt-ml-jobs.html"]
risk_score = 21
rule_id = "17e68559-b274-4948-ad0b-f8415bb31126"
severity = "low"
tags = [
"Data Source: Elastic Defend",
"Data Source: Auditd Manager",
"Use Case: Threat Detection",
"Rule Type: ML",
"Rule Type: Machine Learning",
"Resources: Investigation Guide",
]
type = "machine_learning"
note = """## Triage and analysis
> **Disclaimer**:
> This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.
### Investigating Unusual Network Destination Domain Name
Machine learning models analyze network traffic to identify atypical domain names, which may indicate malicious activities like phishing or malware communication. Adversaries exploit uncommon domains for initial access or command-and-control. This detection rule leverages ML to flag these anomalies, aiding analysts in identifying potential threats early.
### Possible investigation steps
- Review the domain name flagged by the alert to determine if it is known for malicious activity or if it is newly registered, using threat intelligence sources and domain reputation services.
- Analyze the network traffic associated with the domain to identify the source IP address and any related communication patterns, such as frequency and data volume.
- Check the user or system that initiated the connection to the unusual domain for any recent changes or suspicious activities, such as software installations or configuration changes.
- Investigate any related alerts or logs that might provide additional context, such as other unusual domain requests or failed login attempts, to identify potential patterns or correlations.
- Assess the endpoint security logs for signs of malware or unauthorized access attempts that could be linked to the unusual domain activity.
### False positive analysis
- Legitimate software updates or downloads from uncommon domains can trigger false positives. Users should maintain a list of known software vendors and their associated domains to exclude these from alerts.
- Internal testing or development environments may use non-standard domain names. Organizations should document these domains and configure exceptions to prevent unnecessary alerts.
- Newly registered domains for legitimate business purposes might be flagged. Regularly update the list of approved domains as new business initiatives arise.
- Third-party services or APIs that use unique domain names can cause false positives. Identify and whitelist these services to reduce noise in alerts.
- Temporary or one-time use domains for events or campaigns should be monitored and excluded as needed to avoid repeated false positives.
### Response and remediation
- Isolate the affected system from the network to prevent further communication with the suspicious domain and potential spread of malware.
- Conduct a thorough scan of the isolated system using updated antivirus and anti-malware tools to identify and remove any malicious software.
- Review and analyze network logs to identify any other systems that may have communicated with the unusual domain and apply similar isolation and scanning procedures to those systems.
- Change passwords and credentials associated with the affected system and any potentially compromised accounts to prevent unauthorized access.
- Escalate the incident to the security operations center (SOC) or incident response team for further investigation and to determine if additional containment measures are necessary.
- Implement network-level blocking of the identified unusual domain across the organization to prevent future access attempts.
- Update threat intelligence feeds and detection systems with indicators of compromise (IOCs) related to the unusual domain to enhance future detection capabilities."""
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1566"
name = "Phishing"
reference = "https://attack.mitre.org/techniques/T1566/"
[[rule.threat.technique.subtechnique]]
id = "T1566.001"
name = "Spearphishing Attachment"
reference = "https://attack.mitre.org/techniques/T1566/001/"
[[rule.threat.technique.subtechnique]]
id = "T1566.002"
name = "Spearphishing Link"
reference = "https://attack.mitre.org/techniques/T1566/002/"
[rule.threat.tactic]
id = "TA0001"
name = "Initial Access"
reference = "https://attack.mitre.org/tactics/TA0001/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[rule.threat.tactic]
id = "TA0003"
name = "Persistence"
reference = "https://attack.mitre.org/tactics/TA0003/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1071"
name = "Application Layer Protocol"
reference = "https://attack.mitre.org/techniques/T1071/"
[[rule.threat.technique.subtechnique]]
id = "T1071.001"
name = "Web Protocols"
reference = "https://attack.mitre.org/techniques/T1071/001/"
[[rule.threat.technique.subtechnique]]
id = "T1071.004"
name = "DNS"
reference = "https://attack.mitre.org/techniques/T1071/004/"
[[rule.threat.technique]]
id = "T1105"
name = "Ingress Tool Transfer"
reference = "https://attack.mitre.org/techniques/T1105/"
[rule.threat.tactic]
id = "TA0011"
name = "Command and Control"
reference = "https://attack.mitre.org/tactics/TA0011/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1041"
name = "Exfiltration Over C2 Channel"
reference = "https://attack.mitre.org/techniques/T1041/"
[rule.threat.tactic]
id = "TA0010"
name = "Exfiltration"
reference = "https://attack.mitre.org/tactics/TA0010/"