Detection rules › Elastic
Elastic rules: 19
Access Attempt to Non Existing Cryptocurrency Wallet
#Identifies access attempts to non existing cryptocurrency wallet files. Adversaries may perform discovery to steal potential cryptocurrency related files for for financial gains.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Credential Access |
Rule Body
[rule]
description = """
Identifies access attempts to non existing cryptocurrency wallet files. Adversaries may perform discovery to steal
potential cryptocurrency related files for for financial gains.
"""
id = "ae071666-e38b-4309-9714-0d014befa01e"
license = "Elastic License v2"
name = "Access Attempt to Non Existing Cryptocurrency Wallet"
os_list = ["windows"]
version = "1.0.7"
query = '''
file where event.type == "access" and process.pid != 4 and not user.id : ("S-1-5-18", "S-1-5-19", "S-1-5-20") and
event.outcome == "failure" and process.executable != null and not file.name : "desktop.ini" and
file.path :
("*\\ElectronCash\\wallets*",
"*\\Electrum-LTC\\wallets*",
"*\\Electrum\\wallets*",
"*\\Ethereum\\keystore*",
"*\\Exodus\\exodus.wallet*",
"*\\Bitcoin\\wallets*",
"*\\Coinomi\\wallets*",
"*\\Appdata\\Roaming\\Raven\\*wallet*",
"*\\DaedalusMainnet\\wallets*",
"*\\Blockstream\\Green\\wallets*",
"*\\MultiDoge\\multidoge.wallet*",
"*\\WalletWasabi\\Client\\Wallets*",
"*\\com.liberty.jaxx\\IndexedDB\\file__0.indexeddb.leveldb",
"*\\Appdata\\Roaming\\atomic\\LocalStorage\\leveldb*",
"*AppData\\Roaming\\Guarda\\LocalStorage\\leveldb*",
"*fhbohimaelbohpjbbldcngcnapndodjp*",
"*aeachknmefphepccionboohckonoeemg*",
"*hnfanknocfeofbddgcijnmhnfnkdnaad*",
"*hifafgmccdpekplomjjkcfgodnhcellj*",
"*nkbihfbeogaeaoehlefnkodbefgpgknn*",
"*ejbalbakoplchlghecdalmeeeajnimhm*",
"*bfnaelmomeimhlpmgjnjophhpkkoljpa*",
"*fnjhmkhhmkbjkkabndcnnogagogbneec*",
"ibnejdfjmmkpcnlpebklmnkoeoihofec*",
"*klfhbdnlcfcaccoakhceodhldjojboga*",
"*aanjhgiamnacdfnlfnmgehjikagdbafd*",
"*bblmcdckkhkhfhhpfcchlpalebmonecp*",
"*hpglfhgfnhbgpjdenjgmdgoeiappafln*",
"*afbcbjpbpfadlkmhmclhkeeodmamcflc*",
"*kncchdigobghenbbaddojjnnaogfppfj*") and
not (process.executable : "?:\\Users\\*\\AppData\\Local\\Microsoft\\OneDrive\\OneDrive.exe" and
process.code_signature.subject_name == "Microsoft Corporation" and process.code_signature.trusted == true) and
not process.executable : "?:\\Windows\\explorer.exe" and
not (process.code_signature.subject_name : ("Exodus Movement Inc", "Exodus Movement, Inc.", "Blockstream USA Corp") and process.code_signature.trusted == true and
file.path : "?:\\Users\\*\\Exodus\\exodus.wallet*") and
not (process.executable == "C:\\Program Files\\WasabiWallet\\wassabee.exe" and file.name == "Wallet.json.old")
'''
min_endpoint_version = "8.1.0"
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
[[optional_actions]]
action = "rollback"
field = "process.entity_id"
state = 0
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1552"
name = "Unsecured Credentials"
reference = "https://attack.mitre.org/techniques/T1552/"
[[threat.technique.subtechnique]]
id = "T1552.001"
name = "Credentials In Files"
reference = "https://attack.mitre.org/techniques/T1552/001/"
[threat.tactic]
id = "TA0006"
name = "Credential Access"
reference = "https://attack.mitre.org/tactics/TA0006/"
[internal]
min_endpoint_version = "8.1.0"
Stages and Predicates
Stage 1: file
file where event.type == "access" and process.pid != 4 and not user.id : ("S-1-5-18", "S-1-5-19", "S-1-5-20") and
event.outcome == "failure" and process.executable != null and not file.name : "desktop.ini" and
file.path :
("*\\ElectronCash\\wallets*",
"*\\Electrum-LTC\\wallets*",
"*\\Electrum\\wallets*",
"*\\Ethereum\\keystore*",
"*\\Exodus\\exodus.wallet*",
"*\\Bitcoin\\wallets*",
"*\\Coinomi\\wallets*",
"*\\Appdata\\Roaming\\Raven\\*wallet*",
"*\\DaedalusMainnet\\wallets*",
"*\\Blockstream\\Green\\wallets*",
"*\\MultiDoge\\multidoge.wallet*",
"*\\WalletWasabi\\Client\\Wallets*",
"*\\com.liberty.jaxx\\IndexedDB\\file__0.indexeddb.leveldb",
"*\\Appdata\\Roaming\\atomic\\LocalStorage\\leveldb*",
"*AppData\\Roaming\\Guarda\\LocalStorage\\leveldb*",
"*fhbohimaelbohpjbbldcngcnapndodjp*",
"*aeachknmefphepccionboohckonoeemg*",
"*hnfanknocfeofbddgcijnmhnfnkdnaad*",
"*hifafgmccdpekplomjjkcfgodnhcellj*",
"*nkbihfbeogaeaoehlefnkodbefgpgknn*",
"*ejbalbakoplchlghecdalmeeeajnimhm*",
"*bfnaelmomeimhlpmgjnjophhpkkoljpa*",
"*fnjhmkhhmkbjkkabndcnnogagogbneec*",
"ibnejdfjmmkpcnlpebklmnkoeoihofec*",
"*klfhbdnlcfcaccoakhceodhldjojboga*",
"*aanjhgiamnacdfnlfnmgehjikagdbafd*",
"*bblmcdckkhkhfhhpfcchlpalebmonecp*",
"*hpglfhgfnhbgpjdenjgmdgoeiappafln*",
"*afbcbjpbpfadlkmhmclhkeeodmamcflc*",
"*kncchdigobghenbbaddojjnnaogfppfj*") and
not (process.executable : "?:\\Users\\*\\AppData\\Local\\Microsoft\\OneDrive\\OneDrive.exe" and
process.code_signature.subject_name == "Microsoft Corporation" and process.code_signature.trusted == true) and
not process.executable : "?:\\Windows\\explorer.exe" and
not (process.code_signature.subject_name : ("Exodus Movement Inc", "Exodus Movement, Inc.", "Blockstream USA Corp") and process.code_signature.trusted == true and
file.path : "?:\\Users\\*\\Exodus\\exodus.wallet*") and
not (process.executable == "C:\\Program Files\\WasabiWallet\\wassabee.exe" and file.name == "Wallet.json.old")
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.outcome | eq |
| field:"event.outcome" kind:eq value:"failure" |
event.type | eq |
| field:"event.type" kind:eq value:"access" |
file.path | wildcard |
| field:"TargetFilename" kind:wildcard |
process.executable | is_not_null | field:"Image" kind:is_not_null | |
process.pid | ne |
| field:"process_id" kind:ne value:"4" |
Exclusions
The rule actively suppresses these predicates.
At Job Creation or Modification via Shell Command
#Detects the creation or modification of an At job by a suspicious process. This activity should almost never take place as Apple is slowly deprecating it and atrun execution is disabled by default. If this rule fires it should indicate highly abnormal or malicious activity. Threat actors can abuse the atrun scheduler to persist their binaries on a system.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Execution | |
| Persistence |
Rule Body
[rule]
description = """
Detects the creation or modification of an At job by a suspicious process. This activity should almost never take place
as Apple is slowly deprecating it and atrun execution is disabled by default. If this rule fires it should indicate
highly abnormal or malicious activity. Threat actors can abuse the atrun scheduler to persist their binaries on a
system.
"""
id = "779f18ce-1457-457c-80e1-3a5d146c2dc0"
license = "Elastic License v2"
name = "At Job Creation or Modification via Shell Command"
os_list = ["macos"]
reference = ["https://theevilbit.github.io/beyond/beyond_0014/"]
version = "1.0.23"
query = '''
sequence by process.entity_id with maxspan=5s
[process where event.type == "start" and (process.name in ("bash", "sh", "zsh", "dash", "csh", "tcsh", "ksh", "tclsh", "fish") or process.name like "tclsh*") and process.args == "-c"]
[file where event.action != "deletion" and
file.path like "/private/var/at/jobs/*" and not
file.path == "/private/var/at/jobs/root"]
'''
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 = "T1053"
name = "Scheduled Task/Job"
reference = "https://attack.mitre.org/techniques/T1053/"
[[threat.technique.subtechnique]]
id = "T1053.002"
name = "At"
reference = "https://attack.mitre.org/techniques/T1053/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.subtechnique]]
id = "T1053.002"
name = "At"
reference = "https://attack.mitre.org/techniques/T1053/002/"
[threat.tactic]
id = "TA0003"
name = "Persistence"
reference = "https://attack.mitre.org/tactics/TA0003/"
[internal]
min_endpoint_version = "8.11.0"
Stages and Predicates
Ordered sequence: each step below must occur in order within 5s, correlated by process.entity_id.
Stage 1: process
[process where event.type == "start" and (process.name in ("bash", "sh", "zsh", "dash", "csh", "tcsh", "ksh", "tclsh", "fish") or process.name like "tclsh*") and process.args == "-c"]
Stage 2: file
[file where event.action != "deletion" and
file.path like "/private/var/at/jobs/*" and not
file.path == "/private/var/at/jobs/root"]
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | ne |
| field:"EventType" kind:ne value:"deletion" |
event.type | eq |
| field:"event.type" kind:eq value:"start" |
file.path | wildcard |
| field:"TargetFilename" kind:wildcard value:"/private/var/at/jobs/*" |
process.args | eq |
| field:"process.args" kind:eq value:"-c" |
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 |
|---|---|---|---|
file.path | eq | /private/var/at/jobs/root | excludes:file.path field:"file.path" value:"/private/var/at/jobs/root" |
Attempt to Disable Driver via HVCIDisallowedImages
#Identifies registry modification to disallow a driver by name using the undocumented Code Integrity registry value HVCIDisallowedImages. An adversary may abuse this setting to block Endpoint security drivers from loading after system reboot.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Persistence | |
| Defense Impairment |
Rule Body
[rule]
description = """
Identifies registry modification to disallow a driver by name using the undocumented Code Integrity registry value
HVCIDisallowedImages. An adversary may abuse this setting to block Endpoint security drivers from loading after system
reboot.
"""
id = "908bec9a-39c6-4de4-b8e5-25f0b57faa38"
license = "Elastic License v2"
name = "Attempt to Disable Driver via HVCIDisallowedImages"
os_list = ["windows"]
reference = [
"https://learn.microsoft.com/en-us/windows-hardware/drivers/bringup/device-guard-and-credential-guard",
"https://github.com/yardenshafir/conference_talks/blob/main/OffensiveCon_2023_Your_Mitigations_are_My_Opportunities.pdf",
]
version = "1.0.11"
query = '''
registry where registry.path : "HKLM\\SYSTEM\\*ControlSet*\\CI\\*HVCIDisallowedImages*"
'''
min_endpoint_version = "7.15.0"
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
[[optional_actions]]
action = "rollback"
field = "process.entity_id"
state = 0
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1112"
name = "Modify Registry"
reference = "https://attack.mitre.org/techniques/T1112/"
[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: registry
registry where registry.path : "HKLM\\SYSTEM\\*ControlSet*\\CI\\*HVCIDisallowedImages*"
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
registry.path | wildcard |
| field:"TargetObject" kind:wildcard value:"HKLM\SYSTEM\*ControlSet*\CI\*HVCIDisallowedImages*" |
AWS S3 Bucket ACL Modified to Allow Public Access by New Identity
#Detects a principal modifying an S3 bucket ACL to grant public read or write access that has not been observed doing so within the history window, using canned ACLs such as public-read or public-read-write. ACL-based public access is a distinct API path (PutBucketAcl) that can bypass some Block Public Access controls. Monitoring for new identities performing this change helps surface freshly compromised credentials being used to stage data for exfiltration or inadvertently expose sensitive content.
Known False Positives
- Static website hosting configurations may intentionally use a public-read ACL on S3 buckets that serve web content. Validate that the target bucket is a known public-facing asset and that the change was authorized. Consider adding exclusions for specific bucket names used for static hosting.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Collection |
Telemetry Coverage
Rules Detecting the Same Action
These rules filter on the same operation.
- Detect New Open S3 buckets (Splunk)
- Detect New Open S3 Buckets over AWS CLI (Splunk)
Rule Body
[metadata]
creation_date = "2026/07/27"
integration = ["aws"]
maturity = "production"
updated_date = "2026/07/27"
[rule]
author = ["Elastic"]
description = """
Detects a principal modifying an S3 bucket ACL to grant public read or write access that has not
been observed doing so within the history window, using canned ACLs such as public-read or
public-read-write. ACL-based public access is a distinct API path (PutBucketAcl) that can bypass
some Block Public Access controls. Monitoring for new identities performing this change helps surface
freshly compromised credentials being used to stage data for exfiltration or inadvertently expose sensitive
content.
"""
false_positives = [
"""
Static website hosting configurations may intentionally use a public-read ACL on S3 buckets
that serve web content. Validate that the target bucket is a known public-facing asset and that
the change was authorized. Consider adding exclusions for specific bucket names used for static
hosting.
""",
]
from = "now-6m"
index = ["logs-aws.cloudtrail-*"]
interval = "5m"
language = "kuery"
license = "Elastic License v2"
name = "AWS S3 Bucket ACL Modified to Allow Public Access by New Identity"
note = """## Triage and analysis
### Investigating AWS S3 Bucket ACL Modified to Allow Public Access by New Identity
This rule fires when a `PutBucketAcl` call sets a canned ACL that grants public or broad access. Unlike bucket policies, bucket ACLs are a legacy mechanism that bypasses some newer Block Public Access controls and can inadvertently or deliberately expose bucket contents to unauthenticated internet users.
### Possible investigation steps
- Identify the modifying principal (`aws.cloudtrail.user_identity.arn`) and determine whether they are authorized to modify S3 bucket ACLs.
- Review `aws.cloudtrail.request_parameters` to confirm the specific canned ACL applied (`public-read`, `public-read-write`).
- Check whether AWS S3 Block Public Access is enabled at the account or bucket level — if so, it may still be preventing effective public exposure even though this ACL change succeeded.
- Enumerate the bucket contents to assess the sensitivity of any exposed data.
- Check for recent `GetObject` or `ListObjects` calls from unauthenticated sources against the same bucket.
### False positive analysis
- Static website hosting buckets are commonly configured with `public-read` ACLs.
### Response and remediation
- If unauthorized, immediately reset the bucket ACL to `private` using `PutBucketAcl`.
- Enable S3 Block Public Access at the account level to prevent future ACL-based public exposure across all buckets.
- Review the bucket's object-level access log for any unauthorized reads that occurred after the ACL change.
"""
references = [
"https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketAcl.html",
"https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-control-overview.html",
]
risk_score = 47
rule_id = "3e7c1b84-9f52-4d63-8a17-6b0e4c2f9d31"
setup = "The AWS CloudTrail integration must be enabled and configured to collect S3 management events (`s3.amazonaws.com`)."
severity = "medium"
tags = [
"Domain: Cloud",
"Data Source: AWS",
"Data Source: Amazon Web Services",
"Data Source: Amazon S3",
"Use Case: Threat Detection",
"Tactic: Collection",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "new_terms"
query = '''
data_stream.dataset: "aws.cloudtrail"
and event.provider: "s3.amazonaws.com"
and event.action: "PutBucketAcl"
and event.outcome: "success"
and not aws.cloudtrail.user_identity.type: "AWSService"
and aws.cloudtrail.flattened.request_parameters.x-amz-acl: ("public-read" or "public-read-write")
and not user_agent.original: (*Terraform* or *terraform* or "cloudformation.amazonaws.com" or *pulumi* or *Pulumi*)
'''
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1530"
name = "Data from Cloud Storage"
reference = "https://attack.mitre.org/techniques/T1530/"
[rule.threat.tactic]
id = "TA0009"
name = "Collection"
reference = "https://attack.mitre.org/tactics/TA0009/"
[rule.new_terms]
field = "new_terms_fields"
value = ["aws.cloudtrail.user_identity.arn"]
[[rule.new_terms.history_window_start]]
field = "history_window_start"
value = "now-7d"
[rule.investigation_fields]
field_names = [
"@timestamp",
"aws.cloudtrail.user_identity.arn",
"aws.cloudtrail.user_identity.type",
"event.action",
"event.outcome",
"aws.cloudtrail.request_parameters",
"source.ip",
"cloud.region",
"cloud.account.id",
]
Stages and Predicates
Stage 1: new_terms
data_stream.dataset: "aws.cloudtrail"
and event.provider: "s3.amazonaws.com"
and event.action: "PutBucketAcl"
and event.outcome: "success"
and not aws.cloudtrail.user_identity.type: "AWSService"
and aws.cloudtrail.flattened.request_parameters.x-amz-acl: ("public-read" or "public-read-write")
and not user_agent.original: (*Terraform* or *terraform* or "cloudformation.amazonaws.com" or *pulumi* or *Pulumi*)
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
aws.cloudtrail.flattened.request_parameters.x-amz-acl | in |
| field:"aws.cloudtrail.flattened.request_parameters.x-amz-acl" kind:in |
data_stream.dataset | eq |
| field:"data_stream.dataset" kind:eq value:"aws.cloudtrail" |
event.action | eq |
| field:"EventType" kind:eq value:"PutBucketAcl" |
event.outcome | eq |
| field:"event.outcome" kind:eq value:"success" |
event.provider | eq |
| field:"Provider_Name" kind:eq value:"s3.amazonaws.com" |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
user_agent.original | eq | cloudformation.amazonaws.com | excludes:user_agent.original field:"user_agent.original" value:"cloudformation.amazonaws.com" |
user_agent.original | match | Pulumi | excludes:user_agent.original field:"user_agent.original" value:"Pulumi" |
user_agent.original | match | Terraform | excludes:user_agent.original field:"user_agent.original" value:"Terraform" |
user_agent.original | match | pulumi | excludes:user_agent.original field:"user_agent.original" value:"pulumi" |
user_agent.original | match | terraform | excludes:user_agent.original field:"user_agent.original" value:"terraform" |
aws.cloudtrail.user_identity.type | eq | AWSService | excludes:aws.cloudtrail.user_identity.type field:"aws.cloudtrail.user_identity.type" value:"AWSService" |
AWS S3 Bucket Policy Added to Allow Public Access
#Detects when an Amazon S3 bucket policy is modified to grant public access using a wildcard (Principal:"") statement. This rule analyzes PutBucketPolicy events that include both Effect=Allow and Principal:"" in the request parameters, indicating that permissions were extended to all identities, potentially making the bucket or its contents publicly accessible. Publicly exposing an S3 bucket is one of the most common causes of sensitive data leaks in AWS environments. Adversaries or misconfigurations can leverage this exposure to exfiltrate data, host malicious content, or collect credentials and logs left in open storage.
Known False Positives
- This rule does not differentiate by itself whether the same policy also includes Deny statements that restrict public access. If a policy includes both Effect=Allow and Effect=Deny with Principal:"*", this rule may still trigger. Such cases should be manually analyzed to verify whether the Deny statement effectively negates the public exposure.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Collection | |
| Exfiltration |
Telemetry Coverage
| Platform | Record / event type |
|---|---|
| AWS | CloudTrail event PutBucketPolicy: Applies a resource-based bucket policy to an S3 bucket. |
Rules Detecting the Same Action
These rules filter on the same operation.
Rule Body
[metadata]
creation_date = "2025/10/30"
integration = ["aws"]
maturity = "production"
updated_date = "2026/04/10"
[rule]
author = ["Elastic"]
description = """
Detects when an Amazon S3 bucket policy is modified to grant public access using a wildcard (Principal:"*") statement.
This rule analyzes PutBucketPolicy events that include both Effect=Allow and Principal:"*" in the request parameters,
indicating that permissions were extended to all identities, potentially making the bucket or its contents publicly
accessible. Publicly exposing an S3 bucket is one of the most common causes of sensitive data leaks in AWS environments.
Adversaries or misconfigurations can leverage this exposure to exfiltrate data, host malicious content, or collect
credentials and logs left in open storage.
"""
event_category_override = "event.type"
false_positives = [
"""
This rule does not differentiate by itself whether the same policy also includes Deny statements that restrict
public access. If a policy includes both Effect=Allow and Effect=Deny with Principal:"*", this rule may still
trigger. Such cases should be manually analyzed to verify whether the Deny statement effectively negates the public
exposure.
""",
]
index = ["filebeat-*", "logs-aws.cloudtrail-*"]
language = "eql"
license = "Elastic License v2"
name = "AWS S3 Bucket Policy Added to Allow Public Access"
note = """## Triage and analysis
### Investigating AWS S3 Bucket Policy Added to Allow Public Access
This rule detects modifications to Amazon S3 bucket policies using the `PutBucketPolicy` API where both `Effect=Allow`
and `Principal:"*"` are present. This effectively grants permissions to all AWS identities, including unauthenticated users.
Such exposure can result in sensitive data leaks, ransomware staging, or unauthorized data collection.
This rule focuses on policy-based exposure rather than ACL-based or block-public-access configurations.
It will still trigger if a bucket policy includes both `Effect=Allow` and `Effect=Deny` statements that contain `Principal:"*"`. Those cases should be reviewed to confirm whether the `Deny` statement restricts access sufficiently.
#### Possible investigation steps
- **Identify the Actor**
- Review `aws.cloudtrail.user_identity.arn`, `aws.cloudtrail.user_identity.type`, and `aws.cloudtrail.user_identity.access_key_id` to identify who made the change.
- Validate whether this user or role is authorized to modify S3 bucket policies.
- Examine `source.ip`, `source.geo`, and `user_agent.original` to identify unusual sources or tools (e.g., CLI or SDK-based activity).
- **Analyze the Bucket Policy Content**
- Extract the full JSON from `aws.cloudtrail.request_parameters`.
- Look for `Effect=Allow` statements paired with `Principal:"*"`.
- Identify what permissions were granted — for example:
- `s3:GetObject` (read access to all objects)
- `s3:PutObject` or `s3:*` (read/write access)
- Check if the policy also contains any `Effect=Deny` statements targeting `Principal:"*"`.
If present, determine whether these statements fully restrict public access, if so this alert can be closed.
- **Assess the Impact and Scope**
- Review `aws.cloudtrail.resources.arn` to confirm which bucket was affected.
- Determine if the bucket contains sensitive, regulated, or internal data.
- Check for `PutPublicAccessBlock` or `DeleteBucketPolicy` events in close proximity, as attackers often disable protections first.
- **Correlate with Related Activity**
- Review CloudTrail for `GetObject` or `ListBucket` events following the policy change to identify possible data access.
- Look for policy changes across multiple buckets by the same actor, suggesting scripted or automated misuse.
- **Validate Intent**
- Contact the bucket owner or application owner to determine whether this change was part of a legitimate operation (e.g., website hosting or public dataset publishing).
- Review change management logs or ticketing systems for documented approval.
### False positive analysis
- **Intended Public Access**
- Buckets used for static websites, documentation hosting, or public datasets may legitimately contain `Principal:"*"`.
- Verify such use cases are covered by organizational policies and hardened with least-privilege permissions (e.g., read-only).
- **Effect=Deny Condition**
- This rule does not currently exclude cases where `Principal:"*"` appears under both `Effect=Allow` and `Effect=Deny`.
- Analysts should review the bucket policy JSON to confirm whether `Deny` statements restrict the same resources.
- If access remains blocked to unauthorized entities, the alert can be dismissed as a false positive.
- **Automation or Pipeline Behavior**
- Some automated pipelines or templates (e.g., Terraform, CloudFormation) create temporary policies with `Principal:"*"` for bootstrap access.
Review timing, user agent, and role identity for expected automation patterns.
### Response and remediation
- **Containment**
- If exposure is unauthorized, immediately remove the public access policy using:
- `aws s3api delete-bucket-policy` or restore from version control.
- Re-enable Block Public Access at the account and bucket levels.
- **Investigation and Scoping**
- Review CloudTrail and S3 access logs to identify whether external IPs accessed bucket objects after the policy change.
- Search for similar policy updates across other buckets in the same account or region.
- Validate AWS Config history for baseline deviations and determine how long the bucket was publicly exposed.
- **Recovery and Hardening**
- Reinstate the intended bucket policy from backups or version control.
- Implement AWS Config rules:
- `s3-bucket-public-read-prohibited`
- `s3-bucket-public-write-prohibited`
- Restrict `s3:PutBucketPolicy` permissions to trusted administrative roles.
- Apply service control policies (SCPs) that prevent policies containing `Principal:"*"` unless explicitly approved.
- Enable continuous monitoring through AWS Security Hub or GuardDuty for any new public exposure events.
### 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://stratus-red-team.cloud/attack-techniques/AWS/aws.exfiltration.s3-backdoor-bucket-policy/",
"https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketPolicy.html",
]
risk_score = 47
rule_id = "618bb351-00f0-467b-8956-8cace8b81f07"
severity = "medium"
tags = [
"Domain: Cloud",
"Data Source: AWS",
"Data Source: Amazon Web Services",
"Data Source: AWS S3",
"Use Case: Threat Detection",
"Tactic: Exfiltration",
"Tactic: Collection",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
info where data_stream.dataset == "aws.cloudtrail"
and event.provider == "s3.amazonaws.com"
and event.action == "PutBucketPolicy"
and event.outcome == "success"
and stringContains(aws.cloudtrail.request_parameters, "Effect=Allow")
and stringContains(aws.cloudtrail.request_parameters, "Principal=\\*")
'''
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1537"
name = "Transfer Data to Cloud Account"
reference = "https://attack.mitre.org/techniques/T1537/"
[rule.threat.tactic]
id = "TA0010"
name = "Exfiltration"
reference = "https://attack.mitre.org/tactics/TA0010/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1530"
name = "Data from Cloud Storage"
reference = "https://attack.mitre.org/techniques/T1530/"
[rule.threat.tactic]
id = "TA0009"
name = "Collection"
reference = "https://attack.mitre.org/tactics/TA0009/"
[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",
"aws.cloudtrail.response_elements",
]
Stages and Predicates
Stage 1: info
info where data_stream.dataset == "aws.cloudtrail"
and event.provider == "s3.amazonaws.com"
and event.action == "PutBucketPolicy"
and event.outcome == "success"
and stringContains(aws.cloudtrail.request_parameters, "Effect=Allow")
and stringContains(aws.cloudtrail.request_parameters, "Principal=\\*")
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
aws.cloudtrail.request_parameters | contains |
| field:"aws::requestParameters" kind:contains |
data_stream.dataset | eq |
| field:"data_stream.dataset" kind:eq value:"aws.cloudtrail" |
event.action | eq |
| field:"EventType" kind:eq value:"PutBucketPolicy" |
event.outcome | eq |
| field:"event.outcome" kind:eq value:"success" |
event.provider | eq |
| field:"Provider_Name" kind:eq value:"s3.amazonaws.com" |
Chkconfig Service Add
#Detects the use of the chkconfig binary to manually add a service for management by chkconfig. Threat actors may utilize this technique to maintain persistence on a system. When a new service is added, chkconfig ensures that the service has either a start or a kill entry in every runlevel and when the system is rebooted the service file added will run providing long-term persistence.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Persistence |
Rule Body
[metadata]
creation_date = "2022/07/22"
integration = ["endpoint", "sentinel_one_cloud_funnel"]
maturity = "production"
updated_date = "2026/03/24"
[transform]
[[transform.osquery]]
label = "Osquery - Retrieve File Listing Information"
query = "SELECT * FROM file WHERE (path LIKE '/etc/init.d/%' OR path LIKE '/etc/rc%.d/%')"
[[transform.osquery]]
label = "Osquery - Retrieve Additional File Listing Information"
query = """
SELECT f.path, u.username AS file_owner, g.groupname AS group_owner, datetime(f.atime, 'unixepoch') AS
file_last_access_time, datetime(f.mtime, 'unixepoch') AS file_last_modified_time, datetime(f.ctime, 'unixepoch') AS
file_last_status_change_time, datetime(f.btime, 'unixepoch') AS file_created_time, f.size AS size_bytes FROM file f LEFT
JOIN users u ON f.uid = u.uid LEFT JOIN groups g ON f.gid = g.gid WHERE (path LIKE '/etc/init.d/%' OR path LIKE
'/etc/rc%.d/%')
"""
[[transform.osquery]]
label = "Osquery - Retrieve Running Processes by User"
query = "SELECT pid, username, name FROM processes p JOIN users u ON u.uid = p.uid ORDER BY username"
[[transform.osquery]]
label = "Osquery - Retrieve Crontab Information"
query = "SELECT * FROM crontab"
[[transform.osquery]]
label = "Osquery - Retrieve Listening Ports"
query = "SELECT pid, address, port, socket, protocol, path FROM listening_ports"
[[transform.osquery]]
label = "Osquery - Retrieve Open Sockets"
query = "SELECT pid, family, remote_address, remote_port, socket, state FROM process_open_sockets"
[[transform.osquery]]
label = "Osquery - Retrieve Information for a Specific User"
query = "SELECT * FROM users WHERE username = {{user.name}}"
[[transform.osquery]]
label = "Osquery - Investigate the Account Authentication Status"
query = "SELECT * FROM logged_in_users WHERE user = {{user.name}}"
[rule]
author = ["Elastic"]
description = """
Detects the use of the chkconfig binary to manually add a service for management by chkconfig. Threat actors may utilize
this technique to maintain persistence on a system. When a new service is added, chkconfig ensures that the service has
either a start or a kill entry in every runlevel and when the system is rebooted the service file added will run
providing long-term persistence.
"""
from = "now-9m"
index = ["endgame-*", "logs-endpoint.events.process*", "logs-sentinel_one_cloud_funnel.*"]
language = "eql"
license = "Elastic License v2"
name = "Chkconfig Service Add"
note = """## Triage and analysis
### Investigating Chkconfig Service Add
Service files are configuration files in Linux systems used to define and manage system services. The `Chkconfig` binary can be used to manually add, delete or modify a service.
Malicious actors can leverage services to achieve persistence by creating or modifying service files to execute malicious commands or payloads during system startup. This allows them to maintain unauthorized access, execute additional malicious activities, or evade detection.
This rule monitors the usage of the `chkconfig` binary to manually add a service for management by `chkconfig`, potentially indicating the creation of a persistence mechanism.
> **Note**:
> This investigation guide uses the [Osquery Markdown Plugin](https://www.elastic.co/guide/en/security/current/invest-guide-run-osquery.html) introduced in Elastic Stack version 8.5.0. Older Elastic Stack versions will display unrendered Markdown in this guide.
> This investigation guide uses [placeholder fields](https://www.elastic.co/guide/en/security/current/osquery-placeholder-fields.html) to dynamically pass alert data into Osquery queries. Placeholder fields were introduced in Elastic Stack version 8.7.0. If you're using Elastic Stack version 8.6.0 or earlier, you'll need to manually adjust this investigation guide's queries to ensure they properly run.
#### Possible Investigation Steps
- Investigate the service that was created or modified.
- Investigate the currently enabled system services through the following commands `sudo chkconfig --list | grep on` and `sudo systemctl list-unit-files`.
- Investigate the status of potentially suspicious services through the `chkconfig --list service_name` command.
- Search for the `rc.d` or `init.d` service files that were created or modified, and analyze their contents.
- Investigate whether any other files in any of the available `rc.d` or `init.d` directories have been altered through OSQuery.
- $osquery_0
- $osquery_1
- Investigate the script execution chain (parent process tree) for unknown processes. Examine their executable files for prevalence and whether they are located in expected locations.
- $osquery_2
- Investigate syslog through the `sudo cat /var/log/syslog | grep 'LSB'` command to find traces of the LSB header of the script (if present). If syslog is being ingested into Elasticsearch, the same can be accomplished through Kibana.
- Investigate other alerts associated with the user/host during the past 48 hours.
- Validate the activity is not related to planned patches, updates, network administrator activity, or legitimate software installations.
- Investigate whether the altered scripts call other malicious scripts elsewhere on the file system.
- If scripts or executables were dropped, retrieve the files and determine if they are malicious:
- Use a private sandboxed malware analysis system to perform analysis.
- Observe and collect information about the following activities:
- Attempts to contact external domains and addresses.
- Check if the domain is newly registered or unexpected.
- Check the reputation of the domain or IP address.
- File access, modification, and creation activities.
- Cron jobs, services and other persistence mechanisms.
- $osquery_3
- Investigate abnormal behaviors by the subject process/user such as network connections, file modifications, and any other spawned child processes.
- Investigate listening ports and open sockets to look for potential command and control traffic or data exfiltration.
- $osquery_4
- $osquery_5
- Identify the user account that performed the action, analyze it, and check whether it should perform this kind of action.
- $osquery_6
- Investigate whether the user is currently logged in and active.
- $osquery_7
### False Positive Analysis
- If this activity is related to new benign software installation activity, consider adding exceptions — preferably with a combination of user and command line conditions.
- If this activity is related to a system administrator who uses the `chkconfig` binary for administrative purposes, consider adding exceptions for this specific administrator user account.
- Try to understand the context of the execution by thinking about the user, machine, or business purpose. A small number of endpoints, such as servers with unique software, might appear unusual but satisfy a specific business need.
### Related Rules
- Suspicious File Creation in /etc for Persistence - 1c84dd64-7e6c-4bad-ac73-a5014ee37042
- Potential Persistence Through Run Control Detected - 0f4d35e4-925e-4959-ab24-911be207ee6f
- Potential Persistence Through init.d Detected - 474fd20e-14cc-49c5-8160-d9ab4ba16c8b
- New Systemd Timer Created - 7fb500fa-8e24-4bd1-9480-2a819352602c
- New Systemd Service Created by Previously Unknown Process - 17b0a495-4d9f-414c-8ad0-92f018b8e001
### Response and remediation
- Initiate the incident response process based on the outcome of the triage.
- Isolate the involved host to prevent further post-compromise behavior.
- If the triage identified malware, search the environment for additional compromised hosts.
- Implement temporary network rules, procedures, and segmentation to contain the malware.
- Stop suspicious processes.
- Immediately block the identified indicators of compromise (IoCs).
- Inspect the affected systems for additional malware backdoors like reverse shells, reverse proxies, or droppers that attackers could use to reinfect the system.
- 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.
- Delete the service/timer or restore its original configuration.
- 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.
- Leverage the incident response data and logging to improve the mean time to detect (MTTD) and the mean time to respond (MTTR).
"""
references = ["https://www.intezer.com/blog/research/lightning-framework-new-linux-threat/"]
risk_score = 47
rule_id = "b910f25a-2d44-47f2-a873-aabdc0d355e6"
setup = """## Setup
This rule requires data coming in from Elastic Defend.
### Elastic Defend Integration Setup
Elastic Defend is integrated into the Elastic Agent using Fleet. Upon configuration, the integration allows the Elastic Agent to monitor events on your host and send data to the Elastic Security app.
#### Prerequisite Requirements:
- Fleet is required for Elastic Defend.
- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).
#### The following steps should be executed in order to add the Elastic Defend integration on a Linux System:
- Go to the Kibana home page and click "Add integrations".
- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.
- Click "Add Elastic Defend".
- Configure the integration name and optionally add a description.
- Select the type of environment you want to protect, either "Traditional Endpoints" or "Cloud Workloads".
- Select a configuration preset. Each preset comes with different default settings for Elastic Agent, you can further customize these later by configuring the Elastic Defend integration policy. [Helper guide](https://www.elastic.co/guide/en/security/current/configure-endpoint-integration-policy.html).
- We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"
- Enter a name for the agent policy in "New agent policy name". If other agent policies already exist, you can click the "Existing hosts" tab and select an existing policy instead.
For more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/8.10/agent-policy.html).
- Click "Save and Continue".
- To complete the integration, select "Add Elastic Agent to your hosts" and continue to the next section to install the Elastic Agent on your hosts.
For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
"""
severity = "medium"
tags = [
"Domain: Endpoint",
"OS: Linux",
"Use Case: Threat Detection",
"Tactic: Persistence",
"Threat: Lightning Framework",
"Data Source: Elastic Endgame",
"Data Source: Elastic Defend",
"Data Source: SentinelOne",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
process where host.os.type == "linux" and event.action in ("exec", "exec_event", "start") and
process.executable != null and
(
(process.executable : "/usr/sbin/chkconfig" and process.args : "--add") or
(process.args : "*chkconfig" and process.args : "--add")
) and not (
process.parent.name in ("rpm", "qualys-scan-util", "qualys-cloud-agent", "update-alternatives") or
process.parent.executable in ("/opt/commvault/.gxsetup/silent_install/install", "/usr/sbin/alternatives") or
process.parent.args : ("/var/tmp/rpm*", "/var/lib/waagent/*", "/usr/bin/puppet*") or
process.args in ("jexec", "sapinit", "httpd", "dbora" , "selfprotection")
)
'''
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1037"
name = "Boot or Logon Initialization Scripts"
reference = "https://attack.mitre.org/techniques/T1037/"
[[rule.threat.technique]]
id = "T1543"
name = "Create or Modify System Process"
reference = "https://attack.mitre.org/techniques/T1543/"
[rule.threat.tactic]
id = "TA0003"
name = "Persistence"
reference = "https://attack.mitre.org/tactics/TA0003/"
Stages and Predicates
Stage 1: process
process where host.os.type == "linux" and event.action in ("exec", "exec_event", "start") and
process.executable != null and
(
(process.executable : "/usr/sbin/chkconfig" and process.args : "--add") or
(process.args : "*chkconfig" and process.args : "--add")
) and not (
process.parent.name in ("rpm", "qualys-scan-util", "qualys-cloud-agent", "update-alternatives") or
process.parent.executable in ("/opt/commvault/.gxsetup/silent_install/install", "/usr/sbin/alternatives") or
process.parent.args : ("/var/tmp/rpm*", "/var/lib/waagent/*", "/usr/bin/puppet*") or
process.args in ("jexec", "sapinit", "httpd", "dbora" , "selfprotection")
)
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | in |
| field:"EventType" kind:in |
process.args | wildcard |
| field:"process.args" kind:wildcard |
process.executable | is_not_null | field:"Image" kind:is_not_null | |
process.executable | wildcard |
| field:"Image" kind:wildcard value:"/usr/sbin/chkconfig" |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.args | in | dbora, httpd, jexec, sapinit, selfprotection | excludes:process.args |
process.parent.args | starts_with | /var/tmp/rpm, /var/lib/waagent/, /usr/bin/puppet | excludes:process.parent.args field:"process.parent.args" value:"/var/tmp/rpm" field:"process.parent.args" value:"/var/lib/waagent/" field:"process.parent.args" value:"/usr/bin/puppet" |
process.parent.executable | in | /opt/commvault/.gxsetup/silent_install/install, /usr/sbin/alternatives | excludes:process.parent.executable field:"process.parent.executable" value:"/opt/commvault/.gxsetup/silent_install/install" field:"process.parent.executable" value:"/usr/sbin/alternatives" |
process.parent.name | in | qualys-cloud-agent, qualys-scan-util, rpm, update-alternatives | excludes:process.parent.name |
Curl Download and Execution of JavaScript Payload
#Identifies when curl is used to download a JavaScript payload and subsequently execute it using the built-in osascript utility. An adversary may use this technique to execute their malicious payload and obtain initial access to an endpoint.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Execution |
Telemetry Coverage
Rule Body
[rule]
description = """
Identifies when curl is used to download a JavaScript payload and subsequently execute it using the built-in osascript
utility. An adversary may use this technique to execute their malicious payload and obtain initial access to an
endpoint.
"""
id = "871f0c30-a7c5-40a5-80e3-a50c6714632f"
license = "Elastic License v2"
name = "Curl Download and Execution of JavaScript Payload"
os_list = ["macos"]
reference = ["https://github.com/its-a-feature/Mythic"]
version = "1.0.46"
query = '''
sequence by process.parent.entity_id with maxspan=15s
[process where event.action == "exec" and
process.name in ("curl", "nscurl") and process.args like ("-o", "--output", "-O", "--remote-name") and process.parent.name in~ ("bash", "zsh", "sh", "Terminal") and
not process.args like ("https://*.jamfcloud.com/JSSResource/computercommands/command/BlankPush/id/*", "POST")]
[process where event.action == "exec" and process.name == "osascript" and
(process.args == "-e" or process.args == "-l") and
not process.Ext.effective_parent.executable in
("/usr/local/jamf/bin/jamf",
"/Library/Addigy/auditor",
"/opt/jc/bin/jumpcloud-agent",
"/Library/Intune/Microsoft Intune Agent.app/Contents/MacOS/IntuneMdmDaemon",
"/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") and
not process.command_line : ("osascript -e display dialog \"Please advise your Support Representative of the following error:\\r\\r• Dialog Team ID verification failed\\r\\r\" with title \"Setup Your Mac: Error\" buttons {\"Close\"} with icon caution",
"osascript -e display dialog \"Please advise your Support Representative of the following error:\\r\\r• Dialog Team ID verification failed\\r\\r\" with title \"App Auto-Patch: Error\" buttons {\"Close\"} with icon caution") and
not process.parent.command_line == "/bin/bash /Library/Management/super/super"
]
'''
min_endpoint_version = "8.16.0"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 1
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1059"
name = "Command and Scripting Interpreter"
reference = "https://attack.mitre.org/techniques/T1059/"
[[threat.technique.subtechnique]]
id = "T1059.007"
name = "JavaScript"
reference = "https://attack.mitre.org/techniques/T1059/007/"
[threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
[internal]
min_endpoint_version = "8.16.0"
Stages and Predicates
Ordered sequence: each step below must occur in order within 15s, correlated by process.parent.entity_id.
Stage 1: process
[process where event.action == "exec" and
process.name in ("curl", "nscurl") and process.args like ("-o", "--output", "-O", "--remote-name") and process.parent.name in~ ("bash", "zsh", "sh", "Terminal") and
not process.args like ("https://*.jamfcloud.com/JSSResource/computercommands/command/BlankPush/id/*", "POST")]
Stage 2: process
[process where event.action == "exec" and process.name == "osascript" and
(process.args == "-e" or process.args == "-l") and
not process.Ext.effective_parent.executable in
("/usr/local/jamf/bin/jamf",
"/Library/Addigy/auditor",
"/opt/jc/bin/jumpcloud-agent",
"/Library/Intune/Microsoft Intune Agent.app/Contents/MacOS/IntuneMdmDaemon",
"/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") and
not process.command_line : ("osascript -e display dialog \"Please advise your Support Representative of the following error:\\r\\r• Dialog Team ID verification failed\\r\\r\" with title \"Setup Your Mac: Error\" buttons {\"Close\"} with icon caution",
"osascript -e display dialog \"Please advise your Support Representative of the following error:\\r\\r• Dialog Team ID verification failed\\r\\r\" with title \"App Auto-Patch: Error\" buttons {\"Close\"} with icon caution") and
not process.parent.command_line == "/bin/bash /Library/Management/super/super"
]
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | eq |
| field:"EventType" kind:eq value:"exec" |
process.args | eq |
| field:"process.args" kind:eq |
process.args | wildcard |
| field:"process.args" kind:wildcard |
process.name | eq |
| field:"process_basename" kind:eq value:"osascript" |
process.name | in |
| field:"process_basename" kind:in |
process.parent.name | in |
| field:"parent_process_basename" kind:in |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.args | wildcard | https://*.jamfcloud.com/JSSResource/computercommands/command/BlankPush/id/*, POST | excludes:process.args field:"process.args" value:"https://*.jamfcloud.com/JSSResource/computercommands/command/BlankPush/id/*" field:"process.args" value:"POST" |
process.Ext.effective_parent.executable | in | /Library/Addigy/auditor, /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, /Library/Intune/Microsoft Intune Agent.app/Contents/MacOS/IntuneMdmDaemon, /opt/jc/bin/jumpcloud-agent, /usr/local/jamf/bin/jamf | excludes:process.Ext.effective_parent.executable |
process.command_line | eq | osascript -e display dialog "Please advise your Support Representative of the following error:\r\r• Dialog Team ID verification failed\r\r" with title "Setup Your Mac: Error" buttons {"Close"} with icon caution, osascript -e display dialog "Please advise your Support Representative of the following error:\r\r• Dialog Team ID verification failed\r\r" with title "App Auto-Patch: Error" buttons {"Close"} with icon caution | excludes:process.command_line |
process.parent.command_line | eq | /bin/bash /Library/Management/super/super | excludes:process.parent.command_line field:"process.parent.command_line" value:"/bin/bash /Library/Management/super/super" |
Debug Privilege Enabled by a Low Reputation Process
#Identifies an unsigned process enabling the SeDebugPrivilege required to debug and adjust the memory of a process owned by another account.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Privilege Escalation |
Rule Body
[rule]
description = """
Identifies an unsigned process enabling the SeDebugPrivilege required to debug and adjust the memory of a process owned
by another account.
"""
id = "82547ffb-7186-4317-8a15-599a291d1f73"
license = "Elastic License v2"
name = "Debug Privilege Enabled by a Low Reputation Process"
os_list = ["windows"]
reference = [
"https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-10/security/threat-protection/auditing/event-4703",
]
version = "1.0.4"
query = '''
sequence by process.entity_id with maxspan=1m
[process where event.action == "start" and
(process.Ext.relative_file_creation_time <= 900 or process.Ext.relative_file_name_modify_time <= 900) and
(process.code_signature.trusted == false or process.code_signature.exists == false) and not process.code_signature.status like "errorCode_endpoint*" and
not process.parent.executable : "C:\\Program Files (x86)\\Common Files\\VAudio\\Interop.Exe" and
not process.hash.sha256 in ("6ab0815affa73b779a0da5bfff3e8498f279a4254ca67948d068811d58b89118",
"167d04f2824b3af925c2d34228f2c5b3aa44dd3ae0b8e0a146076c0b7794f56c",
"555dc00f5988f1106adc1254aca6fab54ed25a0a4c1dff787f1b85a50c686d55",
"2ab171f42975d7539965d96c0750d43be14335e8f604a403cd8574ef7936e700")]
[any where event.category == "iam" and event.action == "token_right_adjusted" and winlog.event_data.EnabledPrivilegeList == "SeDebugPrivilege" and
not winlog.event_data.EnabledPrivilegeList == "SeLockMemoryPrivilege"]
'''
min_endpoint_version = "8.18.0"
optional_actions = []
reputation = true
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
tree = true
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1134"
name = "Access Token Manipulation"
reference = "https://attack.mitre.org/techniques/T1134/"
[threat.tactic]
id = "TA0004"
name = "Privilege Escalation"
reference = "https://attack.mitre.org/tactics/TA0004/"
[internal]
min_endpoint_version = "8.18.0"
Stages and Predicates
Ordered sequence: each step below must occur in order within 1m, correlated by process.entity_id.
Stage 1: process
[process where event.action == "start" and
(process.Ext.relative_file_creation_time <= 900 or process.Ext.relative_file_name_modify_time <= 900) and
(process.code_signature.trusted == false or process.code_signature.exists == false) and not process.code_signature.status like "errorCode_endpoint*" and
not process.parent.executable : "C:\\Program Files (x86)\\Common Files\\VAudio\\Interop.Exe" and
not process.hash.sha256 in ("6ab0815affa73b779a0da5bfff3e8498f279a4254ca67948d068811d58b89118",
"167d04f2824b3af925c2d34228f2c5b3aa44dd3ae0b8e0a146076c0b7794f56c",
"555dc00f5988f1106adc1254aca6fab54ed25a0a4c1dff787f1b85a50c686d55",
"2ab171f42975d7539965d96c0750d43be14335e8f604a403cd8574ef7936e700")]
Stage 2: any
[any where event.category == "iam" and event.action == "token_right_adjusted" and winlog.event_data.EnabledPrivilegeList == "SeDebugPrivilege" and
not winlog.event_data.EnabledPrivilegeList == "SeLockMemoryPrivilege"]
Indicators
These rows show field, operator, and value matches.
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.code_signature.status | starts_with | errorCode_endpoint | excludes:process.code_signature.status field:"process.code_signature.status" value:"errorCode_endpoint" |
process.hash.sha256 | in | 167d04f2824b3af925c2d34228f2c5b3aa44dd3ae0b8e0a146076c0b7794f56c, 2ab171f42975d7539965d96c0750d43be14335e8f604a403cd8574ef7936e700, 555dc00f5988f1106adc1254aca6fab54ed25a0a4c1dff787f1b85a50c686d55, 6ab0815affa73b779a0da5bfff3e8498f279a4254ca67948d068811d58b89118 | excludes:process.hash.sha256 |
process.parent.executable | eq | C:\Program Files (x86)\Common Files\VAudio\Interop.Exe | excludes:process.parent.executable field:"process.parent.executable" value:"C:\Program Files (x86)\Common Files\VAudio\Interop.Exe" |
winlog.event_data.EnabledPrivilegeList | eq | SeLockMemoryPrivilege | excludes:winlog.event_data.EnabledPrivilegeList field:"winlog.event_data.EnabledPrivilegeList" value:"SeLockMemoryPrivilege" |
Direct Syscall via Assembly Bytes
#Identifies attempts to call a System call directly using assembly instructions and from unusual native system module ntdll. This may indicate the use of direct system calls to evade endpoint security solutions hooking Windows APIs.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Stealth |
Rule Body
[rule]
description = """
Identifies attempts to call a System call directly using assembly instructions and from unusual native system module
ntdll. This may indicate the use of direct system calls to evade endpoint security solutions hooking Windows APIs.
"""
id = "e0abc200-a578-4e3a-bd1a-eded0c32a245"
license = "Elastic License v2"
name = "Direct Syscall via Assembly Bytes"
os_list = ["windows"]
version = "1.0.24"
query = '''
any where process.executable != null and
(
(event.category in ("registry", "file") and
process.thread.Ext.call_stack_summary like "?*" and not process.thread.Ext.call_stack_summary like "ntdll.dll*" and
not process.thread.Ext.call_stack_summary in ("Unknown", "Unknown|Unbacked") and
/* mov r10,rcx, mov eax,ssn, syscall */
_arraysearch(process.thread.Ext.call_stack, $entry,
$entry.callsite_leading_bytes like ("*4c8bd1b8??????000f05", "*4989cab8??????000f05", "*4c8bd10f05", "*4989ca0f05"))) or
(event.category == "process" and
process.parent.thread.Ext.call_stack_summary like "?*" and not process.parent.thread.Ext.call_stack_summary like "ntdll.dll*" and
/* mov r10,rcx, mov eax,ssn, syscall */
_arraysearch(process.parent.thread.Ext.call_stack, $entry,
$entry.callsite_leading_bytes : ("*4c8bd1b8??????000f05", "*4989cab8??????000f05", "*4c8bd10f05", "*4989ca0f05")))
) and
not process.executable :
("?:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe",
"?:\\Program Files\\Google\\Chrome\\Application\\chrome.exe",
"?:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe",
"?:\\Program Files (x86)\\Chromium\\Application\\chrome.exe",
"?:\\Program Files\\Mozilla Firefox\\firefox.exe",
"?:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe",
"?:\\Windows\\System32\\inetsrv\\w3wp.exe",
"?:\\Program Files\\Adobe\\Acrobat DC\\Acrobat\\Acrobat.exe",
"?:\\Program Files\\Adobe\\Acrobat DC\\Acrobat\\acrocef_*\\AcroCEF.exe",
"?:\\Program Files (x86)\\Adobe\\Acrobat DC\\Acrobat\\Acrobat.exe",
"?:\\Program Files (x86)\\Adobe\\Acrobat DC\\Acrobat\\acrocef_*\\AcroCEF.exe",
"?:\\Program Files (x86)\\Adobe\\Acrobat Reader DC\\Reader\\AcroRd32.exe",
"?:\\Program Files (x86)\\Microsoft\\EdgeUpdate\\MicrosoftEdgeUpdate.exe",
"?:\\Program Files\\Microsoft\\EdgeUpdate\\MicrosoftEdgeUpdate.exe",
"?:\\Program Files\\BackupClient\\TrayMonitor\\MmsMonitor.exe",
"?:\\Program Files (x86)\\Google\\Update\\GoogleUpdate.exe",
"?:\\Program Files\\Google\\Update\\GoogleUpdate.exe",
"?:\\Program Files\\BackupClient\\TrayMonitor\\MmsMonitor.exe",
"?:\\Program Files (x86)\\BackupClient\\TrayMonitor\\MmsMonitor.exe",
"?:\\Program Files\\Mozilla Firefox\\updated\\firefox.exe",
"?:\\Program Files (x86)\\Microsoft\\EdgeWebView\\Application\\*\\msedgewebview2.exe",
"?:\\Program Files\\Microsoft\\EdgeWebView\\Application\\*\\msedgewebview2.exe",
"?:\\Users\\*\\AppData\\Local\\Microsoft\\EdgeWebView\\Application\\*\\msedgewebview2.exe",
"?:\\Users\\*\\AppData\\Local\\Microsoft\\Teams\\*\\Teams.exe",
"?:\\Program Files\\Veeam\\Endpoint Backup\\Veeam.EndPoint.Manager.exe",
"?:\\Program Files\\Netmarble\\Netmarble Game\\*",
"?:\\Program Files (x86)\\SolarWinds\\Agent\\Plugins\\ADMProbe\\SolarWinds.ADM.AgentPlugin.exe",
"?:\\Program Files (x86)\\Adobe\\Acrobat Reader DC\\Reader\\AcroCEF\\RdrCEF.exe",
"?:\\Program Files\\New Relic\\newrelic-infra\\newrelic-integrations\\nr-winpkg.exe") and
not (process.code_signature.subject_name in~
("Google LLC", "Mozilla Corporation", "Rockstar Games, Inc.", "Commvault Systems, Inc.", "Galooli Ltd", "TOTVS S.A", "ROBLOX CORPORATION",
"Roblox Corporation", "SIGNODE PACKAGING GROUP NZ", "GraphOn Corporation", "Blizzard Entertainment, Inc.", "343 Industries (Microsoft Corporation)") and
process.code_signature.trusted == true) and
not (process.executable : "?:\\Windows\\System32\\LogonUI.exe" and process.parent.executable : "?:\\Windows\\System32\\winlogon.exe") and
not (process.executable : "?:\\Windows\\System32\\auditpol.exe" and process.parent.executable : "?:\\Program Files\\ColorTokens\\LGM\\ct-lgm.exe") and
not (process.executable : "?:\\Windows\\Microsoft.NET\\Framework*\\cvtres.exe" and process.code_signature.trusted == true and process.code_signature.subject_name : "Microsoft Corporation") and
not (process.executable : "?:\\Windows\\System32\\quser.exe" and process.parent.executable : "?:\\Windows\\LTSvc\\LTSVC.exe") and
not (process.executable : "?:\\Windows\\SysWOW64\\sc.exe" and process.parent.executable : "?:\\Program Files (x86)\\NinjaRMMAgent\\NinjaRMMAgent.exe") and
not (process.executable : "?:\\Windows\\Microsoft.NET\\Framework*\\csc.exe" and process.code_signature.trusted == true and process.code_signature.subject_name : "Microsoft Corporation") and
not (process.executable : "?:\\Windows\\Microsoft.NET\\Framework*\\ngen.exe" and process.code_signature.trusted == true and process.code_signature.subject_name : "Microsoft Corporation") and
not (process.executable : "?:\\Windows\\System32\\cscript.exe" and process.parent.executable : "?:\\Program Files\\Microsoft Monitoring Agent\\Agent\\MonitoringHost.exe") and
/* chromium and last one for Acrobat */
not _arraysearch(process.thread.Ext.call_stack, $entry,
$entry.callsite_trailing_bytes :
("c3cd2ec30f1f84000000000000000000000000000000000000000000000000000000000000000000000000004c8bd1b82a000000f604250803fe7f0175030f05",
"c3cd2ec30f1f8400000000004c8bd1b829000000f604250800000000000000000000000000000000000000004c8bd1b82a000000f604250803fe7f0175030f05",
"c3cd2ec30f1f84000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"c30f1f4400004c8bd1b8280000000f05c30f1f44000000000000000000000000000000000000000000000000000000000000000000004c8bd1b8290000000f05",
"c30f1f4400004c8bd1b8280000000f05c30f1f4400004c8bd1b8290000000f05c30f00000000000000000000000000000000000000004c8bd1b8290000000f05",
"c30f1f440000ff25000000007004fd89ff7f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"c3ff25000000005b14*7f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"ff2554000000cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc4ecc4c8bd1b8*",
"c30f0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"c341514150525166660f1f840000000000909090e81c0000005c004400650076006900630065005c00470047005300530052000000681a001c00488bc46a006a",
"e99b3808200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000")) and
not _arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info: "?:\\Windows\\WinSxS\\Temp\\PendingDeletes\\$$DeleteMe*") and
not _arraysearch(process.parent.thread.Ext.call_stack, $entry, $entry.symbol_info: "?:\\Windows\\WinSxS\\Temp\\PendingDeletes\\$$DeleteMe*") and
not _arraysearch(process.parent.thread.Ext.call_stack, $entry,
$entry.callsite_trailing_bytes like
("ff2554000000cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc4ecc4c8bd1b8*",
"ff2500000000da12d2bdf97f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"c30f0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"e9cb2e08200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"))
'''
min_endpoint_version = "8.10.0"
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
[[optional_actions]]
action = "rollback"
field = "process.entity_id"
state = 0
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1055"
name = "Process Injection"
reference = "https://attack.mitre.org/techniques/T1055/"
[threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
[internal]
min_endpoint_version = "8.10.0"
Stages and Predicates
Stage 1: any
any where process.executable != null and
(
(event.category in ("registry", "file") and
process.thread.Ext.call_stack_summary like "?*" and not process.thread.Ext.call_stack_summary like "ntdll.dll*" and
not process.thread.Ext.call_stack_summary in ("Unknown", "Unknown|Unbacked") and
_arraysearch(process.thread.Ext.call_stack, $entry,
$entry.callsite_leading_bytes like ("*4c8bd1b8??????000f05", "*4989cab8??????000f05", "*4c8bd10f05", "*4989ca0f05"))) or
(event.category == "process" and
process.parent.thread.Ext.call_stack_summary like "?*" and not process.parent.thread.Ext.call_stack_summary like "ntdll.dll*" and
_arraysearch(process.parent.thread.Ext.call_stack, $entry,
$entry.callsite_leading_bytes : ("*4c8bd1b8??????000f05", "*4989cab8??????000f05", "*4c8bd10f05", "*4989ca0f05")))
) and
not process.executable :
("?:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe",
"?:\\Program Files\\Google\\Chrome\\Application\\chrome.exe",
"?:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe",
"?:\\Program Files (x86)\\Chromium\\Application\\chrome.exe",
"?:\\Program Files\\Mozilla Firefox\\firefox.exe",
"?:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe",
"?:\\Windows\\System32\\inetsrv\\w3wp.exe",
"?:\\Program Files\\Adobe\\Acrobat DC\\Acrobat\\Acrobat.exe",
"?:\\Program Files\\Adobe\\Acrobat DC\\Acrobat\\acrocef_*\\AcroCEF.exe",
"?:\\Program Files (x86)\\Adobe\\Acrobat DC\\Acrobat\\Acrobat.exe",
"?:\\Program Files (x86)\\Adobe\\Acrobat DC\\Acrobat\\acrocef_*\\AcroCEF.exe",
"?:\\Program Files (x86)\\Adobe\\Acrobat Reader DC\\Reader\\AcroRd32.exe",
"?:\\Program Files (x86)\\Microsoft\\EdgeUpdate\\MicrosoftEdgeUpdate.exe",
"?:\\Program Files\\Microsoft\\EdgeUpdate\\MicrosoftEdgeUpdate.exe",
"?:\\Program Files\\BackupClient\\TrayMonitor\\MmsMonitor.exe",
"?:\\Program Files (x86)\\Google\\Update\\GoogleUpdate.exe",
"?:\\Program Files\\Google\\Update\\GoogleUpdate.exe",
"?:\\Program Files\\BackupClient\\TrayMonitor\\MmsMonitor.exe",
"?:\\Program Files (x86)\\BackupClient\\TrayMonitor\\MmsMonitor.exe",
"?:\\Program Files\\Mozilla Firefox\\updated\\firefox.exe",
"?:\\Program Files (x86)\\Microsoft\\EdgeWebView\\Application\\*\\msedgewebview2.exe",
"?:\\Program Files\\Microsoft\\EdgeWebView\\Application\\*\\msedgewebview2.exe",
"?:\\Users\\*\\AppData\\Local\\Microsoft\\EdgeWebView\\Application\\*\\msedgewebview2.exe",
"?:\\Users\\*\\AppData\\Local\\Microsoft\\Teams\\*\\Teams.exe",
"?:\\Program Files\\Veeam\\Endpoint Backup\\Veeam.EndPoint.Manager.exe",
"?:\\Program Files\\Netmarble\\Netmarble Game\\*",
"?:\\Program Files (x86)\\SolarWinds\\Agent\\Plugins\\ADMProbe\\SolarWinds.ADM.AgentPlugin.exe",
"?:\\Program Files (x86)\\Adobe\\Acrobat Reader DC\\Reader\\AcroCEF\\RdrCEF.exe",
"?:\\Program Files\\New Relic\\newrelic-infra\\newrelic-integrations\\nr-winpkg.exe") and
not (process.code_signature.subject_name in~
("Google LLC", "Mozilla Corporation", "Rockstar Games, Inc.", "Commvault Systems, Inc.", "Galooli Ltd", "TOTVS S.A", "ROBLOX CORPORATION",
"Roblox Corporation", "SIGNODE PACKAGING GROUP NZ", "GraphOn Corporation", "Blizzard Entertainment, Inc.", "343 Industries (Microsoft Corporation)") and
process.code_signature.trusted == true) and
not (process.executable : "?:\\Windows\\System32\\LogonUI.exe" and process.parent.executable : "?:\\Windows\\System32\\winlogon.exe") and
not (process.executable : "?:\\Windows\\System32\\auditpol.exe" and process.parent.executable : "?:\\Program Files\\ColorTokens\\LGM\\ct-lgm.exe") and
not (process.executable : "?:\\Windows\\Microsoft.NET\\Framework*\\cvtres.exe" and process.code_signature.trusted == true and process.code_signature.subject_name : "Microsoft Corporation") and
not (process.executable : "?:\\Windows\\System32\\quser.exe" and process.parent.executable : "?:\\Windows\\LTSvc\\LTSVC.exe") and
not (process.executable : "?:\\Windows\\SysWOW64\\sc.exe" and process.parent.executable : "?:\\Program Files (x86)\\NinjaRMMAgent\\NinjaRMMAgent.exe") and
not (process.executable : "?:\\Windows\\Microsoft.NET\\Framework*\\csc.exe" and process.code_signature.trusted == true and process.code_signature.subject_name : "Microsoft Corporation") and
not (process.executable : "?:\\Windows\\Microsoft.NET\\Framework*\\ngen.exe" and process.code_signature.trusted == true and process.code_signature.subject_name : "Microsoft Corporation") and
not (process.executable : "?:\\Windows\\System32\\cscript.exe" and process.parent.executable : "?:\\Program Files\\Microsoft Monitoring Agent\\Agent\\MonitoringHost.exe") and
not _arraysearch(process.thread.Ext.call_stack, $entry,
$entry.callsite_trailing_bytes :
("c3cd2ec30f1f84000000000000000000000000000000000000000000000000000000000000000000000000004c8bd1b82a000000f604250803fe7f0175030f05",
"c3cd2ec30f1f8400000000004c8bd1b829000000f604250800000000000000000000000000000000000000004c8bd1b82a000000f604250803fe7f0175030f05",
"c3cd2ec30f1f84000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"c30f1f4400004c8bd1b8280000000f05c30f1f44000000000000000000000000000000000000000000000000000000000000000000004c8bd1b8290000000f05",
"c30f1f4400004c8bd1b8280000000f05c30f1f4400004c8bd1b8290000000f05c30f00000000000000000000000000000000000000004c8bd1b8290000000f05",
"c30f1f440000ff25000000007004fd89ff7f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"c3ff25000000005b14*7f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"ff2554000000cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc4ecc4c8bd1b8*",
"c30f0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"c341514150525166660f1f840000000000909090e81c0000005c004400650076006900630065005c00470047005300530052000000681a001c00488bc46a006a",
"e99b3808200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000")) and
not _arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info: "?:\\Windows\\WinSxS\\Temp\\PendingDeletes\\$$DeleteMe*") and
not _arraysearch(process.parent.thread.Ext.call_stack, $entry, $entry.symbol_info: "?:\\Windows\\WinSxS\\Temp\\PendingDeletes\\$$DeleteMe*") and
not _arraysearch(process.parent.thread.Ext.call_stack, $entry,
$entry.callsite_trailing_bytes like
("ff2554000000cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc4ecc4c8bd1b8*",
"ff2500000000da12d2bdf97f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"c30f0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"e9cb2e08200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"))
Indicators
These rows show field, operator, and value matches.
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.code_signature.subject_name | eq | Microsoft Corporation | excludes:process.code_signature.subject_name field:"process.code_signature.subject_name" value:"Microsoft Corporation" |
process.code_signature.trusted | eq | true | excludes:process.code_signature.trusted field:"process.code_signature.trusted" value:"true" |
process.executable | wildcard | ?:\Windows\Microsoft.NET\Framework*\csc.exe | excludes:process.executable field:"process.executable" value:"?:\Windows\Microsoft.NET\Framework*\csc.exe" |
process.executable | wildcard | ?:\Windows\Microsoft.NET\Framework*\cvtres.exe | excludes:process.executable field:"process.executable" value:"?:\Windows\Microsoft.NET\Framework*\cvtres.exe" |
process.executable | wildcard | ?:\Windows\Microsoft.NET\Framework*\ngen.exe | excludes:process.executable field:"process.executable" value:"?:\Windows\Microsoft.NET\Framework*\ngen.exe" |
process.code_signature.subject_name | in | 343 Industries (Microsoft Corporation), Blizzard Entertainment, Inc., Commvault Systems, Inc., Galooli Ltd, Google LLC, GraphOn Corporation, Mozilla Corporation, ROBLOX CORPORATION, Roblox Corporation, Rockstar Games, Inc., SIGNODE PACKAGING GROUP NZ, TOTVS S.A | excludes:process.code_signature.subject_name |
process.executable | eq | ?:\Windows\SysWOW64\sc.exe | excludes:process.executable field:"process.executable" value:"?:\Windows\SysWOW64\sc.exe" |
process.parent.executable | eq | ?:\Program Files (x86)\NinjaRMMAgent\NinjaRMMAgent.exe | excludes:process.parent.executable field:"process.parent.executable" value:"?:\Program Files (x86)\NinjaRMMAgent\NinjaRMMAgent.exe" |
process.executable | eq | ?:\Windows\System32\LogonUI.exe | excludes:process.executable field:"process.executable" value:"?:\Windows\System32\LogonUI.exe" |
process.parent.executable | eq | ?:\Windows\System32\winlogon.exe | excludes:process.parent.executable field:"process.parent.executable" value:"?:\Windows\System32\winlogon.exe" |
process.executable | eq | ?:\Windows\System32\auditpol.exe | excludes:process.executable field:"process.executable" value:"?:\Windows\System32\auditpol.exe" |
process.parent.executable | eq | ?:\Program Files\ColorTokens\LGM\ct-lgm.exe | excludes:process.parent.executable field:"process.parent.executable" value:"?:\Program Files\ColorTokens\LGM\ct-lgm.exe" |
process.executable | eq | ?:\Windows\System32\cscript.exe | excludes:process.executable field:"process.executable" value:"?:\Windows\System32\cscript.exe" |
process.parent.executable | eq | ?:\Program Files\Microsoft Monitoring Agent\Agent\MonitoringHost.exe | excludes:process.parent.executable field:"process.parent.executable" value:"?:\Program Files\Microsoft Monitoring Agent\Agent\MonitoringHost.exe" |
process.executable | eq | ?:\Windows\System32\quser.exe | excludes:process.executable field:"process.executable" value:"?:\Windows\System32\quser.exe" |
process.parent.executable | eq | ?:\Windows\LTSvc\LTSVC.exe | excludes:process.parent.executable field:"process.parent.executable" value:"?:\Windows\LTSvc\LTSVC.exe" |
process.parent.thread.Ext.call_stack | array_any | excludes:process.parent.thread.Ext.call_stack | |
process.thread.Ext.call_stack | array_any | excludes:process.thread.Ext.call_stack | |
process.executable | wildcard | ?:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe, ?:\Program Files\Google\Chrome\Application\chrome.exe, ?:\Program Files (x86)\Google\Chrome\Application\chrome.exe, ?:\Program Files (x86)\Chromium\Application\chrome.exe, ?:\Program Files\Mozilla Firefox\firefox.exe, ?:\Program Files (x86)\Mozilla Firefox\firefox.exe, ?:\Windows\System32\inetsrv\w3wp.exe, ?:\Program Files\Adobe\Acrobat DC\Acrobat\Acrobat.exe, ?:\Program Files\Adobe\Acrobat DC\Acrobat\acrocef_*\AcroCEF.exe, ?:\Program Files (x86)\Adobe\Acrobat DC\Acrobat\Acrobat.exe, ?:\Program Files (x86)\Adobe\Acrobat DC\Acrobat\acrocef_*\AcroCEF.exe, ?:\Program Files (x86)\Adobe\Acrobat Reader DC\Reader\AcroRd32.exe, ?:\Program Files (x86)\Microsoft\EdgeUpdate\MicrosoftEdgeUpdate.exe, ?:\Program Files\Microsoft\EdgeUpdate\MicrosoftEdgeUpdate.exe, ?:\Program Files\BackupClient\TrayMonitor\MmsMonitor.exe, ?:\Program Files (x86)\Google\Update\GoogleUpdate.exe, ?:\Program Files\Google\Update\GoogleUpdate.exe, ?:\Program Files\BackupClient\TrayMonitor\MmsMonitor.exe, ?:\Program Files (x86)\BackupClient\TrayMonitor\MmsMonitor.exe, ?:\Program Files\Mozilla Firefox\updated\firefox.exe, ?:\Program Files (x86)\Microsoft\EdgeWebView\Application\*\msedgewebview2.exe, ?:\Program Files\Microsoft\EdgeWebView\Application\*\msedgewebview2.exe, ?:\Users\*\AppData\Local\Microsoft\EdgeWebView\Application\*\msedgewebview2.exe, ?:\Users\*\AppData\Local\Microsoft\Teams\*\Teams.exe, ?:\Program Files\Veeam\Endpoint Backup\Veeam.EndPoint.Manager.exe, ?:\Program Files\Netmarble\Netmarble Game\*, ?:\Program Files (x86)\SolarWinds\Agent\Plugins\ADMProbe\SolarWinds.ADM.AgentPlugin.exe, ?:\Program Files (x86)\Adobe\Acrobat Reader DC\Reader\AcroCEF\RdrCEF.exe, ?:\Program Files\New Relic\newrelic-infra\newrelic-integrations\nr-winpkg.exe | excludes:process.executable |
Google Workspace Impossible Travel Login
#Detects successful Google Workspace sign-ins for the same user from two geographically separated locations within a 90-minute window, where the implied travel speed between the two points exceeds what is physically possible (>=800 km/h, faster than modern commercial airliners) and the geographic separation is at least 500 km. This pattern indicates either VPN/proxy use or an adversary signing in to a compromised account from a different location than the legitimate user.
Known False Positives
- Users on VPN or proxy egress that geo-resolves through a region distant from the user's physical location. Mobile clients on cellular carrier networks that peer through regional hubs may geo-resolve to a different region than the user's physical location.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Initial Access | |
| Credential Access |
Telemetry Coverage
| Platform | Record / event type |
|---|---|
| Google Workspace | login_success: Login Success |
| Google Workspace | login_success: SAML Login Success |
Rule Body
[metadata]
creation_date = "2026/05/14"
integration = ["google_workspace"]
maturity = "production"
min_stack_comments = "ES|QL FIRST and LAST aggregation functions are GA in 9.4."
min_stack_version = "9.4.0"
updated_date = "2026/05/14"
[rule]
author = ["Elastic"]
description = """
Detects successful Google Workspace sign-ins for the same user from two geographically separated locations within a
90-minute window, where the implied travel speed between the two points exceeds what is physically possible (>=800 km/h,
faster than modern commercial airliners) and the geographic separation is at least 500 km. This pattern indicates either
VPN/proxy use or an adversary signing in to a compromised account from a different location than the legitimate user.
"""
false_positives = [
"""
Users on VPN or proxy egress that geo-resolves through a region distant from the user's physical location. Mobile
clients on cellular carrier networks that peer through regional hubs may geo-resolve to a different region than the
user's physical location.
""",
]
from = "now-180m"
interval = "30m"
language = "esql"
license = "Elastic License v2"
name = "Google Workspace Impossible Travel Login"
note = """## Triage and analysis
### Investigating Google Workspace Impossible Travel Login
Google Workspace is accessible globally; legitimate users authenticate from one location at a time. Two successful sign-ins for the same user separated by a distance and time delta implying travel faster than a commercial airliner cannot be the same human being physically moving, and indicate either a VPN/proxy egress mismatch or a compromised account being accessed from a separate location by an adversary.
### Possible investigation steps
- Identify the user (`user.email`) and the geographic separation observed: `Esql.distance_km`, `Esql.travel_kmh`, `Esql.window_minutes` (bbox path over region centroids), and the set of distinct countries, regions, and cities (`Esql.source_geo_country_name_values`, `Esql.source_geo_region_name_values`, `Esql.source_geo_city_name_values`).
- Cross-check `Esql.honest_distance_km`, `Esql.honest_travel_kmh`, `Esql.honest_window_minutes` these measure the real great-circle distance between the user's actual first and last sign-in events with timestamps locked to those same events. When the honest distance is small but the bbox distance is large, the user appeared in an outlier region in the middle of the window (A->B->A pattern -- typical AiTM kit replay). When both agree, it's a clean two-region case.
- Pull all `google_workspace.login` events for the user across the alert window. Sort by `@timestamp` and inspect each `source.ip`, `source.as.organization.name`, `source.geo.country_name`, and `user_agent.original` (when present).
- Determine which sign-ins are consistent with the user's baseline (corporate VPN egress, home ISP, mobile carrier) and which are not.
- For each non-baseline sign-in: check the ASN. Hosting-provider ASNs (Clouvider, Host Telecom, Alibaba, cheap-VPS providers) for interactive sign-ins are high-fidelity suspicious because legitimate end users do not typically egress through those networks.
- Cross-reference `logs-google_workspace.token` for `event.action: authorize` events from the same `user.email` around the same time. An OAuth grant minted from a non-baseline ASN immediately after a non-baseline sign-in is the AiTM kit signature.
- Check `logs-google_workspace.user_accounts` for `2sv_enroll`, recovery email/phone additions, or other state changes that an attacker would make to establish persistence.
- Confirm with the user whether the sign-ins are theirs (VPN, travel) or unexpected.
### False positive analysis
- Users on VPN or proxy infrastructure egressing through a distant region: validate against the user's known VPN ranges and consider excluding by ASN.
- Mobile carriers that geo-resolve outside the user's home country (cellular providers often peer through regional hubs): validate by user-agent (mobile UA fingerprint) and source ASN (carrier networks).
### Response and remediation
- If the pattern is unexpected, suspend the user immediately, then revoke OAuth tokens (`DELETE /admin/directory/v1/users/<upn>/tokens/<clientId>`), reset password, and clear recovery email/phone.
- Investigate any `google_workspace.token: authorize` events fired around the same window for tokens minted to the adversary.
- Review `google_workspace.device` for any `DEVICE_REGISTER_UNREGISTER_EVENT` with `account_state: REGISTERED` near the same window: kit-side device registrations are a persistence vector that survives password rotation if the underlying OAuth tokens were not revoked.
- Cross-check `logs-gcp.audit-*` if the tenant exposes any GCP resources to the user: look for `authenticationInfo.principalEmail` matching the user from a non-baseline `callerIp`.
"""
references = [
"https://www.elastic.co/security-labs/google-workspace-attack-surface-part-one",
"https://www.elastic.co/security-labs/google-workspace-attack-surface-part-two",
"https://security.googlecloudcommunity.com/community-blog-42/detecting-impossible-travel-with-google-secops-part-1-3892",
]
risk_score = 73
rule_id = "aff74d85-5bfa-4ff1-ace2-4e3995a37cfa"
severity = "high"
tags = [
"Domain: Cloud",
"Domain: Identity",
"Data Source: Google Workspace",
"Data Source: Google Workspace Audit Logs",
"Data Source: Google Workspace User log events",
"Use Case: Threat Detection",
"Use Case: Identity and Access Audit",
"Tactic: Initial Access",
"Tactic: Credential Access",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "esql"
query = '''
// successful Google Workspace logins with country + region populated.
from logs-google_workspace.login-*
| where event.dataset == "google_workspace.login"
and event.action == "login_success"
and event.outcome == "success"
and user.email is not null
and source.geo.location is not null
and source.geo.country_name is not null
and source.geo.region_name is not null
| eval Esql.source_geo_lat = st_y(source.geo.location),
Esql.source_geo_lon = st_x(source.geo.location)
// collapse each (user, country, region) into one centroid + the actual lat/lon
// of the first and last event in that region. FIRST/LAST lock coords to the
// timestamp ordering so we can later build the honest event pair.
| stats
Esql.region_centroid_lat = avg(Esql.source_geo_lat),
Esql.region_centroid_lon = avg(Esql.source_geo_lon),
Esql.region_first_lat = first(Esql.source_geo_lat, @timestamp),
Esql.region_first_lon = first(Esql.source_geo_lon, @timestamp),
Esql.region_last_lat = last(Esql.source_geo_lat, @timestamp),
Esql.region_last_lon = last(Esql.source_geo_lon, @timestamp),
Esql.region_first_seen = min(@timestamp),
Esql.region_last_seen = max(@timestamp),
Esql.region_event_count = count(*),
Esql.region_city_values = values(source.geo.city_name),
Esql.region_asn_values = values(source.`as`.organization.name),
Esql.region_ip_values = values(source.ip)
by user.email,
source.geo.country_name,
source.geo.region_name
// roll up to the user. two parallel measurements:
// bbox: corners over region centroids.
// honest: real coords at the user's actual first and last events (nested FIRST/LAST).
| stats
Esql.min_lat = min(Esql.region_centroid_lat),
Esql.max_lat = max(Esql.region_centroid_lat),
Esql.min_lon = min(Esql.region_centroid_lon),
Esql.max_lon = max(Esql.region_centroid_lon),
Esql.honest_first_lat = first(Esql.region_first_lat, Esql.region_first_seen),
Esql.honest_first_lon = first(Esql.region_first_lon, Esql.region_first_seen),
Esql.honest_last_lat = last(Esql.region_last_lat, Esql.region_last_seen),
Esql.honest_last_lon = last(Esql.region_last_lon, Esql.region_last_seen),
Esql.timestamp_first_seen = min(Esql.region_first_seen),
Esql.timestamp_last_seen = max(Esql.region_first_seen), // first arrival in last region > tighter bbox window
Esql.honest_last_time = max(Esql.region_last_seen), // user's actual last event > honest window
Esql.region_count = count_distinct(source.geo.region_name),
Esql.country_count = count_distinct(source.geo.country_name),
Esql.event_count = sum(Esql.region_event_count),
Esql.source_geo_country_name_values = values(source.geo.country_name),
Esql.source_geo_region_name_values = values(source.geo.region_name),
Esql.source_geo_city_name_values = values(Esql.region_city_values),
Esql.source_as_organization_name_values = values(Esql.region_asn_values),
Esql.source_ip_values = values(Esql.region_ip_values)
by user.email
// need at least 2 regions to have anything to compare. cap at 5 because regions
// are finer-grained than countries (a traveling user can hit 3-4 in 90m via
// carrier hub bouncing) > bbox drift stays bounded below this.
| where Esql.region_count >= 2 and Esql.region_count <= 5
// bbox path (primary trigger): corners over region centroids.
| eval Esql.p1 = to_geopoint(concat("POINT(", to_string(Esql.min_lon), " ", to_string(Esql.min_lat), ")")),
Esql.p2 = to_geopoint(concat("POINT(", to_string(Esql.max_lon), " ", to_string(Esql.max_lat), ")"))
| eval Esql.distance_km = round(st_distance(Esql.p1, Esql.p2) / 1000.0, 0),
Esql.window_minutes = date_diff("minute", Esql.timestamp_first_seen, Esql.timestamp_last_seen),
Esql.travel_kmh = case(Esql.window_minutes > 0,
round(Esql.distance_km * 60.0 / Esql.window_minutes, 0), null)
// honest pair (triage signal): real coords at the user's actual first and last
// events, time locked to those same two events.
| eval Esql.honest_p1 = to_geopoint(concat("POINT(", to_string(Esql.honest_first_lon), " ", to_string(Esql.honest_first_lat), ")")),
Esql.honest_p2 = to_geopoint(concat("POINT(", to_string(Esql.honest_last_lon), " ", to_string(Esql.honest_last_lat), ")"))
| eval Esql.honest_distance_km = round(st_distance(Esql.honest_p1, Esql.honest_p2) / 1000.0, 0),
Esql.honest_window_minutes = date_diff("minute", Esql.timestamp_first_seen, Esql.honest_last_time),
Esql.honest_travel_kmh = case(Esql.honest_window_minutes > 0,
round(Esql.honest_distance_km * 60.0 / Esql.honest_window_minutes, 0), null)
// 500 km separation + faster than a commercial airliner. bbox is the trigger
// honest fields are kept purely as triage signal.
| where Esql.distance_km >= 500 and Esql.travel_kmh >= 800
| keep user.email,
Esql.source_geo_country_name_values,
Esql.source_geo_region_name_values,
Esql.source_geo_city_name_values,
Esql.source_as_organization_name_values,
Esql.source_ip_values,
Esql.country_count,
Esql.region_count,
Esql.event_count,
Esql.timestamp_first_seen,
Esql.timestamp_last_seen,
Esql.window_minutes,
Esql.distance_km,
Esql.travel_kmh,
Esql.honest_distance_km,
Esql.honest_travel_kmh,
Esql.honest_window_minutes
'''
[[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.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1528"
name = "Steal Application Access Token"
reference = "https://attack.mitre.org/techniques/T1528/"
[[rule.threat.technique]]
id = "T1557"
name = "Adversary-in-the-Middle"
reference = "https://attack.mitre.org/techniques/T1557/"
[rule.threat.tactic]
id = "TA0006"
name = "Credential Access"
reference = "https://attack.mitre.org/tactics/TA0006/"
[rule.alert_suppression]
group_by = ["user.email"]
missing_fields_strategy = "suppress"
[rule.investigation_fields]
field_names = ["user.email"]
[rule.alert_suppression.duration]
unit = "m"
value = 180
Stages and Predicates
Stage 1: from
from logs-google_workspace.login-*
Stage 2: where
| where event.dataset == "google_workspace.login"
and event.action == "login_success"
and event.outcome == "success"
and user.email is not null
and source.geo.location is not null
and source.geo.country_name is not null
and source.geo.region_name is not null
Stage 3: eval
| eval Esql.source_geo_lat = st_y(source.geo.location),
Esql.source_geo_lon = st_x(source.geo.location)
Stage 4: stats
| stats
Esql.region_centroid_lat = avg(Esql.source_geo_lat),
Esql.region_centroid_lon = avg(Esql.source_geo_lon),
Esql.region_first_lat = first(Esql.source_geo_lat, @timestamp),
Esql.region_first_lon = first(Esql.source_geo_lon, @timestamp),
Esql.region_last_lat = last(Esql.source_geo_lat, @timestamp),
Esql.region_last_lon = last(Esql.source_geo_lon, @timestamp),
Esql.region_first_seen = min(@timestamp),
Esql.region_last_seen = max(@timestamp),
Esql.region_event_count = count(*),
Esql.region_city_values = values(source.geo.city_name),
Esql.region_asn_values = values(source.`as`.organization.name),
Esql.region_ip_values = values(source.ip)
by user.email,
source.geo.country_name,
source.geo.region_name
Stage 5: stats
| stats
Esql.min_lat = min(Esql.region_centroid_lat),
Esql.max_lat = max(Esql.region_centroid_lat),
Esql.min_lon = min(Esql.region_centroid_lon),
Esql.max_lon = max(Esql.region_centroid_lon),
Esql.honest_first_lat = first(Esql.region_first_lat, Esql.region_first_seen),
Esql.honest_first_lon = first(Esql.region_first_lon, Esql.region_first_seen),
Esql.honest_last_lat = last(Esql.region_last_lat, Esql.region_last_seen),
Esql.honest_last_lon = last(Esql.region_last_lon, Esql.region_last_seen),
Esql.timestamp_first_seen = min(Esql.region_first_seen),
Esql.timestamp_last_seen = max(Esql.region_first_seen),
Esql.honest_last_time = max(Esql.region_last_seen),
Esql.region_count = count_distinct(source.geo.region_name),
Esql.country_count = count_distinct(source.geo.country_name),
Esql.event_count = sum(Esql.region_event_count),
Esql.source_geo_country_name_values = values(source.geo.country_name),
Esql.source_geo_region_name_values = values(source.geo.region_name),
Esql.source_geo_city_name_values = values(Esql.region_city_values),
Esql.source_as_organization_name_values = values(Esql.region_asn_values),
Esql.source_ip_values = values(Esql.region_ip_values)
by user.email
Stage 6: where
| where Esql.region_count >= 2 and Esql.region_count <= 5
Stage 7: eval
| eval Esql.p1 = to_geopoint(concat("POINT(", to_string(Esql.min_lon), " ", to_string(Esql.min_lat), ")")),
Esql.p2 = to_geopoint(concat("POINT(", to_string(Esql.max_lon), " ", to_string(Esql.max_lat), ")"))
Stage 8: eval
| eval Esql.distance_km = round(st_distance(Esql.p1, Esql.p2) / 1000.0, 0),
Esql.window_minutes = date_diff("minute", Esql.timestamp_first_seen, Esql.timestamp_last_seen),
Esql.travel_kmh = case(Esql.window_minutes > 0,
round(Esql.distance_km * 60.0 / Esql.window_minutes, 0), null)
Esql.travel_kmh =Esql.window_minutes > 0round(Esql.distance_km * 60.0 / Esql.window_minutes, 0)nullStage 9: eval
| eval Esql.honest_p1 = to_geopoint(concat("POINT(", to_string(Esql.honest_first_lon), " ", to_string(Esql.honest_first_lat), ")")),
Esql.honest_p2 = to_geopoint(concat("POINT(", to_string(Esql.honest_last_lon), " ", to_string(Esql.honest_last_lat), ")"))
Stage 10: eval
| eval Esql.honest_distance_km = round(st_distance(Esql.honest_p1, Esql.honest_p2) / 1000.0, 0),
Esql.honest_window_minutes = date_diff("minute", Esql.timestamp_first_seen, Esql.honest_last_time),
Esql.honest_travel_kmh = case(Esql.honest_window_minutes > 0,
round(Esql.honest_distance_km * 60.0 / Esql.honest_window_minutes, 0), null)
Esql.honest_travel_kmh =Esql.honest_window_minutes > 0round(Esql.honest_distance_km * 60.0 / Esql.honest_window_minutes, 0)nullStage 11: where
| where Esql.distance_km >= 500 and Esql.travel_kmh >= 800
Stage 12: keep
| keep user.email,
Esql.source_geo_country_name_values,
Esql.source_geo_region_name_values,
Esql.source_geo_city_name_values,
Esql.source_as_organization_name_values,
Esql.source_ip_values,
Esql.country_count,
Esql.region_count,
Esql.event_count,
Esql.timestamp_first_seen,
Esql.timestamp_last_seen,
Esql.window_minutes,
Esql.distance_km,
Esql.travel_kmh,
Esql.honest_distance_km,
Esql.honest_travel_kmh,
Esql.honest_window_minutes
Indicators
These rows show field, operator, and value matches.
Output Fields
These fields are emitted when the rule matches.
| Field | Source |
|---|---|
user.email | KEEP user.email |
Esql.source_geo_country_name_values | KEEP Esql.source_geo_country_name_values |
Esql.source_geo_region_name_values | KEEP Esql.source_geo_region_name_values |
Esql.source_geo_city_name_values | KEEP Esql.source_geo_city_name_values |
Esql.source_as_organization_name_values | KEEP Esql.source_as_organization_name_values |
Esql.source_ip_values | KEEP Esql.source_ip_values |
Esql.country_count | KEEP Esql.country_count |
Esql.region_count | KEEP Esql.region_count |
Esql.event_count | KEEP Esql.event_count |
Esql.timestamp_first_seen | KEEP Esql.timestamp_first_seen |
Esql.timestamp_last_seen | KEEP Esql.timestamp_last_seen |
Esql.window_minutes | KEEP Esql.window_minutes |
Esql.distance_km | KEEP Esql.distance_km |
Esql.travel_kmh | KEEP Esql.travel_kmh |
Esql.honest_distance_km | KEEP Esql.honest_distance_km |
Esql.honest_travel_kmh | KEEP Esql.honest_travel_kmh |
Esql.honest_window_minutes | KEEP Esql.honest_window_minutes |
Hping Process Activity
#Hping ran on a Linux host. Hping is a FOSS command-line packet analyzer and has the ability to construct network packets for a wide variety of network security testing applications, including scanning and firewall auditing.
Known False Positives
- Normal use of hping is uncommon apart from security testing and research. Use by non-security engineers is very uncommon.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Discovery |
Rule Body
[metadata]
creation_date = "2020/02/18"
integration = ["endpoint", "auditd_manager", "crowdstrike", "sentinel_one_cloud_funnel"]
maturity = "production"
updated_date = "2026/03/24"
[rule]
author = ["Elastic"]
description = """
Hping ran on a Linux host. Hping is a FOSS command-line packet analyzer and has the ability to construct network packets
for a wide variety of network security testing applications, including scanning and firewall auditing.
"""
false_positives = [
"""
Normal use of hping is uncommon apart from security testing and research. Use by non-security engineers is very
uncommon.
""",
]
from = "now-9m"
index = [
"auditbeat-*",
"endgame-*",
"logs-auditd_manager.auditd-*",
"logs-crowdstrike.fdr*",
"logs-endpoint.events.process*",
"logs-sentinel_one_cloud_funnel.*",
]
language = "eql"
license = "Elastic License v2"
name = "Hping Process Activity"
note = """## Triage and analysis
> **Disclaimer**:
> This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.
### Investigating Hping Process Activity
Hping is a versatile command-line tool used for crafting and analyzing network packets, often employed in network security testing. Adversaries may exploit Hping to perform reconnaissance, such as scanning networks or probing firewalls, to gather system information. The detection rule identifies Hping's execution on Linux systems by monitoring specific process start events, helping to flag potential misuse indicative of discovery tactics.
### Possible investigation steps
- Review the process start event details to confirm the execution of Hping, focusing on the process.name field to ensure it matches "hping", "hping2", or "hping3".
- Identify the user account associated with the Hping process by examining the user context in the event data to determine if the activity aligns with expected behavior for that user.
- Analyze the command line arguments used with the Hping process to understand the intent of the execution, such as specific network targets or options that indicate scanning or probing activities.
- Check the timing and frequency of the Hping process execution to assess whether it aligns with routine network testing schedules or if it appears anomalous.
- Investigate the source and destination IP addresses involved in the Hping activity to identify potential targets and assess whether they are internal or external to the organization.
- Correlate the Hping activity with other security events or alerts from the same host or network segment to identify any related suspicious activities or patterns.
- Consult with the system owner or network security team to verify if the Hping activity was authorized as part of legitimate security testing or if it requires further investigation.
### False positive analysis
- Routine network testing by IT teams may trigger the rule when using Hping for legitimate purposes. To manage this, create exceptions for known IP addresses or user accounts involved in regular network audits.
- Automated scripts or cron jobs that utilize Hping for monitoring network performance can lead to false positives. Identify these scripts and exclude their execution paths or associated user accounts from the detection rule.
- Security training exercises or penetration testing activities might involve Hping usage. Coordinate with security teams to whitelist these activities by specifying time windows or specific user roles.
- Development or testing environments where Hping is used for application testing can cause alerts. Exclude these environments by filtering based on hostnames or network segments associated with non-production systems.
### Response and remediation
- Immediately isolate the affected Linux host from the network to prevent further reconnaissance or potential lateral movement by the adversary.
- Terminate any active Hping processes on the affected host to stop ongoing packet crafting or network probing activities.
- Conduct a thorough review of network logs and firewall configurations to identify any unauthorized access or anomalies that may have been exploited using Hping.
- Perform a comprehensive scan of the affected system for additional indicators of compromise, such as unauthorized user accounts or unexpected changes to system files.
- Reset credentials and review access permissions for accounts on the affected host to ensure no unauthorized access persists.
- Escalate the incident to the security operations center (SOC) or incident response team for further investigation and to determine if additional systems are affected.
- Update detection and monitoring systems to enhance visibility and alerting for similar reconnaissance activities, ensuring rapid response to future threats."""
references = ["https://en.wikipedia.org/wiki/Hping"]
risk_score = 47
rule_id = "90169566-2260-4824-b8e4-8615c3b4ed52"
setup = """## Setup
This rule requires data coming in from one of the following integrations:
- Elastic Defend
- Auditbeat
### Elastic Defend Integration Setup
Elastic Defend is integrated into the Elastic Agent using Fleet. Upon configuration, the integration allows the Elastic Agent to monitor events on your host and send data to the Elastic Security app.
#### Prerequisite Requirements:
- Fleet is required for Elastic Defend.
- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).
#### The following steps should be executed in order to add the Elastic Defend integration on a Linux System:
- Go to the Kibana home page and click "Add integrations".
- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.
- Click "Add Elastic Defend".
- Configure the integration name and optionally add a description.
- Select the type of environment you want to protect, either "Traditional Endpoints" or "Cloud Workloads".
- Select a configuration preset. Each preset comes with different default settings for Elastic Agent, you can further customize these later by configuring the Elastic Defend integration policy. [Helper guide](https://www.elastic.co/guide/en/security/current/configure-endpoint-integration-policy.html).
- We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"
- Enter a name for the agent policy in "New agent policy name". If other agent policies already exist, you can click the "Existing hosts" tab and select an existing policy instead.
For more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/8.10/agent-policy.html).
- Click "Save and Continue".
- To complete the integration, select "Add Elastic Agent to your hosts" and continue to the next section to install the Elastic Agent on your hosts.
For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
### Auditbeat Setup
Auditbeat is a lightweight shipper that you can install on your servers to audit the activities of users and processes on your systems. For example, you can use Auditbeat to collect and centralize audit events from the Linux Audit Framework. You can also use Auditbeat to detect changes to critical files, like binaries and configuration files, and identify potential security policy violations.
#### The following steps should be executed in order to add the Auditbeat on a Linux System:
- Elastic provides repositories available for APT and YUM-based distributions. Note that we provide binary packages, but no source packages.
- To install the APT and YUM repositories follow the setup instructions in this [helper guide](https://www.elastic.co/guide/en/beats/auditbeat/current/setup-repositories.html).
- To run Auditbeat on Docker follow the setup instructions in the [helper guide](https://www.elastic.co/guide/en/beats/auditbeat/current/running-on-docker.html).
- To run Auditbeat on Kubernetes follow the setup instructions in the [helper guide](https://www.elastic.co/guide/en/beats/auditbeat/current/running-on-kubernetes.html).
- For complete “Setup and Run Auditbeat” information refer to the [helper guide](https://www.elastic.co/guide/en/beats/auditbeat/current/setting-up-and-running.html).
"""
severity = "medium"
tags = [
"Domain: Endpoint",
"OS: Linux",
"Use Case: Threat Detection",
"Tactic: Discovery",
"Data Source: Elastic Endgame",
"Data Source: Elastic Defend",
"Data Source: Auditd Manager",
"Data Source: Crowdstrike",
"Data Source: SentinelOne",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
process where host.os.type == "linux" and event.type == "start" and
event.action in ("exec", "exec_event", "start", "ProcessRollup2", "executed", "process_started") and
process.name in ("hping", "hping2", "hping3")
'''
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1046"
name = "Network Service Discovery"
reference = "https://attack.mitre.org/techniques/T1046/"
[[rule.threat.technique]]
id = "T1082"
name = "System Information Discovery"
reference = "https://attack.mitre.org/techniques/T1082/"
[rule.threat.tactic]
id = "TA0007"
name = "Discovery"
reference = "https://attack.mitre.org/tactics/TA0007/"
Stages and Predicates
Stage 1: process
process where host.os.type == "linux" and event.type == "start" and
event.action in ("exec", "exec_event", "start", "ProcessRollup2", "executed", "process_started") and
process.name in ("hping", "hping2", "hping3")
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | in |
| field:"EventType" kind:in |
event.type | eq |
| field:"event.type" kind:eq value:"start" |
process.name | in |
| field:"process_basename" kind:in |
Linux System Information Discovery via Getconf
#This rule identifies Linux system information discovery via the "getconf" command. The "getconf" command is used to query system configuration variables and system limits. Adversaries may use this command to gather information about the system, such as the page size, maximum number of open files, and other system limits, to aid in further exploration and exploitation of the system.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Discovery |
Rule Body
[metadata]
creation_date = "2025/01/07"
integration = ["endpoint"]
maturity = "production"
updated_date = "2025/12/24"
[rule]
author = ["Elastic"]
building_block_type = "default"
description = """
This rule identifies Linux system information discovery via the "getconf" command. The "getconf" command is used to query system configuration
variables and system limits. Adversaries may use this command to gather information about the system, such as the page size, maximum number
of open files, and other system limits, to aid in further exploration and exploitation of the system.
"""
from = "now-119m"
index = ["logs-endpoint.events.process*"]
interval = "60m"
language = "kuery"
license = "Elastic License v2"
name = "Linux System Information Discovery via Getconf"
references = ["https://blog.exatrack.com/Perfctl-using-portainer-and-new-persistences/"]
risk_score = 21
rule_id = "90e5976d-ed8c-489a-a293-bfc57ff8ba89"
severity = "low"
tags = [
"Domain: Endpoint",
"OS: Linux",
"Use Case: Threat Detection",
"Tactic: Discovery",
"Rule Type: BBR",
"Data Source: Elastic Defend",
]
timestamp_override = "event.ingested"
type = "new_terms"
query = '''
event.category:process and host.os.type:linux and event.type:start and event.action:exec and process.name:getconf and not (
process.parent.executable:(
"/usr/bin/google_guest_agent_manager" or "/opt/commvault/Base64/cvlaunchd" or /usr/local/manageengine/uems_agent/bin/*
) or
process.working_directory:(
"/opt/oracle/mgmt_agent/agent_inst/bin" or "/var/lib/oracle-cloud-agent/plugins/oci-managementagent/polaris" or
"/opt/commvault/Base/cvlaunchd" or "/opt/simpana" or "/opt/commvault" or "/opt/ITSPlatform/agentcore" or
"/u01/app/oracle/EMBase/agent_inst/sysman/emd" or "/opt/abacus/lib"
) or
process.parent.args:(
/opt/oracle/mgmt_agent/agent_inst/* or "/opt/datadog-agent/bin/agent/agent" or "/usr/bin/byobu-status" or
"/usr/local/nagios/libexec/check_ssl_cert" or "/usr/lib64/nagios/plugins/cpanel/check_ssl_cert"
) or
process.parent.command_line:(
"/bin/sh -s unix:cmd" or "ruby /usr/local/bundle/bin/bundle exec rackup"
)
)
'''
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1082"
name = "System Information Discovery"
reference = "https://attack.mitre.org/techniques/T1082/"
[rule.threat.tactic]
id = "TA0007"
name = "Discovery"
reference = "https://attack.mitre.org/tactics/TA0007/"
[rule.new_terms]
field = "new_terms_fields"
value = ["process.parent.executable"]
[[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 event.type:start and event.action:exec and process.name:getconf and not (
process.parent.executable:(
"/usr/bin/google_guest_agent_manager" or "/opt/commvault/Base64/cvlaunchd" or /usr/local/manageengine/uems_agent/bin/*
) or
process.working_directory:(
"/opt/oracle/mgmt_agent/agent_inst/bin" or "/var/lib/oracle-cloud-agent/plugins/oci-managementagent/polaris" or
"/opt/commvault/Base/cvlaunchd" or "/opt/simpana" or "/opt/commvault" or "/opt/ITSPlatform/agentcore" or
"/u01/app/oracle/EMBase/agent_inst/sysman/emd" or "/opt/abacus/lib"
) or
process.parent.args:(
/opt/oracle/mgmt_agent/agent_inst/* or "/opt/datadog-agent/bin/agent/agent" or "/usr/bin/byobu-status" or
"/usr/local/nagios/libexec/check_ssl_cert" or "/usr/lib64/nagios/plugins/cpanel/check_ssl_cert"
) or
process.parent.command_line:(
"/bin/sh -s unix:cmd" or "ruby /usr/local/bundle/bin/bundle exec rackup"
)
)
Indicators
These rows show field, operator, and value matches.
Exclusions
The rule actively suppresses these predicates.
Linux Telegram API Request
#This rule detects when a process executes the curl or wget command with an argument that includes the api.telegram.org domain. This may indicate command and control behavior.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Command & Control |
Rule Body
[metadata]
creation_date = "2025/04/29"
integration = ["endpoint", "crowdstrike", "sentinel_one_cloud_funnel", "auditd_manager"]
maturity = "production"
updated_date = "2026/03/24"
[rule]
author = ["Elastic"]
description = """
This rule detects when a process executes the curl or wget command with an argument that includes the
api.telegram.org domain. This may indicate command and control behavior.
"""
from = "now-9m"
index = [
"endgame-*",
"logs-crowdstrike.fdr*",
"logs-endpoint.events.process*",
"logs-sentinel_one_cloud_funnel.*",
"auditbeat-*",
"logs-auditd_manager.auditd-*",
]
language = "eql"
license = "Elastic License v2"
name = "Linux Telegram API Request"
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 Linux Telegram API Request
Telegram's API allows applications to interact with its messaging platform, often used for legitimate automation and communication tasks. However, adversaries may exploit this by using commands like `curl` or `wget` to communicate with Telegram's API for command and control purposes. The detection rule identifies such suspicious activity by monitoring for these commands accessing the Telegram API, indicating potential misuse.
### Possible investigation steps
- Review the process details to confirm the execution of the curl or wget command with the api.telegram.org domain in the command line, as indicated by the process.command_line field.
- Investigate the user account associated with the process to determine if the activity aligns with expected behavior or if the account may be compromised.
- Check the network activity logs to identify any additional connections to api.telegram.org or other suspicious domains, which may indicate further command and control communication.
- Analyze the parent process of the detected curl or wget command to understand how the process was initiated and if it was triggered by another suspicious activity.
- Examine the system for any other indicators of compromise, such as unusual file modifications or additional unauthorized processes, to assess the scope of potential malicious activity.
### False positive analysis
- Legitimate automation scripts or applications may use curl or wget to interact with Telegram's API for non-malicious purposes. Review the context and purpose of these scripts to determine if they are authorized.
- System administrators or developers might use curl or wget for testing or maintenance tasks involving Telegram's API. Verify if these activities are part of routine operations and consider excluding them if they are deemed safe.
- Monitoring tools or integrations that rely on Telegram for notifications could trigger this rule. Identify these tools and add exceptions for their known processes to prevent unnecessary alerts.
- If a specific user or service account frequently triggers this rule due to legitimate use, consider creating an exception for that account to reduce noise while maintaining security oversight.
### Response and remediation
- Immediately isolate the affected system from the network to prevent further communication with the Telegram API and potential data exfiltration.
- Terminate any suspicious processes identified as using curl or wget to interact with api.telegram.org to halt ongoing malicious activities.
- Conduct a thorough review of the affected system's process logs and network connections to identify any additional indicators of compromise or related malicious activity.
- Remove any unauthorized scripts or binaries that may have been used to automate the interaction with the Telegram API.
- Reset credentials and review access permissions for any accounts that were active on the affected system to prevent unauthorized access.
- Update and patch the affected system to the latest security standards to mitigate vulnerabilities that could be exploited in similar attacks.
- Escalate the incident to the security operations center (SOC) or incident response team for further investigation and to determine if additional systems are affected.
"""
risk_score = 47
rule_id = "af1e36fe-0abd-4463-b5ec-4e276dec0b26"
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).
Elastic Defend integration does not collect environment variable logging by default.
In order to capture this behavior, this rule requires a specific configuration option set within the advanced settings of the Elastic Defend integration.
#### To set up environment variable capture for an Elastic Agent policy:
- Go to “Security → Manage → Policies”.
- Select an “Elastic Agent policy”.
- Click “Show advanced settings”.
- Scroll down or search for “linux.advanced.capture_env_vars”.
- Enter the names of environment variables you want to capture, separated by commas.
- For this rule the linux.advanced.capture_env_vars variable should be set to "HTTP_PROXY,HTTPS_PROXY,ALL_PROXY".
- Click “Save”.
After saving the integration change, the Elastic Agents running this policy will be updated and the rule will function properly.
For more information on capturing environment variables refer to the [helper guide](https://www.elastic.co/guide/en/security/current/environment-variable-capture.html).
"""
severity = "medium"
tags = [
"Domain: Endpoint",
"OS: Linux",
"Use Case: Threat Detection",
"Tactic: Command and Control",
"Data Source: Elastic Defend",
"Data Source: Elastic Endgame",
"Data Source: Crowdstrike",
"Data Source: SentinelOne",
"Data Source: Auditd Manager",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
process where host.os.type == "linux" and event.type == "start" and
event.action in ("exec", "start", "exec_event", "ProcessRollup2", "executed", "exec_event", "process_started") and
process.name in ("curl", "wget") and process.command_line like "*api.telegram.org*"
'''
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1071"
name = "Application Layer Protocol"
reference = "https://attack.mitre.org/techniques/T1071/"
[[rule.threat.technique.subtechnique]]
id = "T1071.001"
name = "Web Protocols"
reference = "https://attack.mitre.org/techniques/T1071/001/"
[[rule.threat.technique]]
id = "T1102"
name = "Web Service"
reference = "https://attack.mitre.org/techniques/T1102/"
[[rule.threat.technique.subtechnique]]
id = "T1102.002"
name = "Bidirectional Communication"
reference = "https://attack.mitre.org/techniques/T1102/002/"
[rule.threat.tactic]
id = "TA0011"
name = "Command and Control"
reference = "https://attack.mitre.org/tactics/TA0011/"
Stages and Predicates
Stage 1: process
process where host.os.type == "linux" and event.type == "start" and
event.action in ("exec", "start", "exec_event", "ProcessRollup2", "executed", "exec_event", "process_started") and
process.name in ("curl", "wget") and process.command_line like "*api.telegram.org*"
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | in |
| field:"EventType" kind:in |
event.type | eq |
| field:"event.type" kind:eq value:"start" |
process.command_line | wildcard |
| field:"CommandLine" kind:wildcard value:"*api.telegram.org*" |
process.name | in |
| field:"process_basename" kind:in |
M365 Exchange Mail Flow Transport Rule Created
#Identifies a transport rule creation in Microsoft 365. As a best practice, Exchange Online mail transport rules should not be set to forward email to domains outside of your organization. An adversary may create transport rules to exfiltrate data.
Known False Positives
- A new transport rule may be created by a system or network administrator. Verify that the configuration change was expected. Exceptions can be added to this rule to filter expected behavior.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Collection | |
| Exfiltration |
Telemetry Coverage
| Platform | Record / event type |
|---|---|
| Microsoft 365 | Exchange audit operation New-TransportRule: Federated domain added |
Rules Detecting the Same Action
These rules filter on the same operation.
Rule Body
[metadata]
creation_date = "2020/11/18"
integration = ["o365"]
maturity = "production"
updated_date = "2026/04/10"
[rule]
author = ["Elastic"]
description = """
Identifies a transport rule creation in Microsoft 365. As a best practice, Exchange Online mail transport rules should
not be set to forward email to domains outside of your organization. An adversary may create transport rules to
exfiltrate data.
"""
false_positives = [
"""
A new transport rule may be created by a system or network administrator. Verify that the configuration change was
expected. Exceptions can be added to this rule to filter expected behavior.
""",
]
from = "now-9m"
index = ["logs-o365.audit-*", "filebeat-*"]
language = "kuery"
license = "Elastic License v2"
name = "M365 Exchange Mail Flow Transport Rule Created"
note = """## Triage and analysis
> **Disclaimer**:
> This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.
### Investigating M365 Exchange Mail Flow Transport Rule Created
Microsoft 365 Exchange transport rules automate email handling, applying actions like forwarding or blocking based on conditions. While beneficial for managing communications, adversaries can exploit these rules to redirect emails externally, facilitating data exfiltration. The detection rule monitors successful creation of new transport rules, flagging potential misuse by identifying specific actions and outcomes in audit logs.
### Possible investigation steps
- Review the audit logs for the event.dataset:o365.audit to identify the user account responsible for creating the new transport rule.
- Examine the event.provider:Exchange and event.category:web fields to confirm the context and source of the rule creation.
- Investigate the event.action:"New-TransportRule" to understand the specific conditions and actions defined in the newly created transport rule.
- Check the event.outcome:success to ensure the rule creation was completed successfully and assess if it aligns with expected administrative activities.
- Analyze the transport rule settings to determine if it includes actions that forward emails to external domains, which could indicate potential data exfiltration.
- Correlate the findings with other security events or alerts to identify any patterns or anomalies that might suggest malicious intent.
### False positive analysis
- Routine administrative tasks may trigger alerts when IT staff create or modify transport rules for legitimate purposes. To manage this, establish a baseline of expected rule creation activities and exclude these from alerts.
- Automated systems or third-party applications that integrate with Microsoft 365 might create transport rules as part of their normal operation. Identify these systems and create exceptions for their known actions.
- Changes in organizational policies or email handling procedures can lead to legitimate rule creations. Document these changes and update the monitoring system to recognize them as non-threatening.
- Regular audits or compliance checks might involve creating temporary transport rules. Coordinate with audit teams to schedule these activities and temporarily adjust alert thresholds or exclusions during these periods.
### Response and remediation
- Immediately disable the newly created transport rule to prevent further unauthorized email forwarding or data exfiltration.
- Conduct a thorough review of the audit logs to identify any other suspicious transport rules or related activities that may indicate a broader compromise.
- Isolate the affected user accounts or systems associated with the creation of the transport rule to prevent further unauthorized access or actions.
- Reset passwords and enforce multi-factor authentication for the affected accounts to secure access and prevent recurrence.
- Notify the security team and relevant stakeholders about the incident for awareness and further investigation.
- Escalate the incident to the incident response team if there is evidence of a broader compromise or if sensitive data has been exfiltrated.
- Implement enhanced monitoring and alerting for transport rule changes to detect and respond to similar threats more effectively in the future.
## Setup
The Office 365 Logs Fleet integration, Filebeat module, or similarly structured data is required to be compatible with this rule."""
references = [
"https://docs.microsoft.com/en-us/powershell/module/exchange/new-transportrule?view=exchange-ps",
"https://docs.microsoft.com/en-us/exchange/security-and-compliance/mail-flow-rules/mail-flow-rules",
]
risk_score = 47
rule_id = "ff4dd44a-0ac6-44c4-8609-3f81bc820f02"
severity = "medium"
tags = ["Domain: Cloud", "Data Source: Microsoft 365", "Use Case: Configuration Audit", "Tactic: Exfiltration", "Resources: Investigation Guide"]
timestamp_override = "event.ingested"
type = "query"
query = '''
data_stream.dataset:o365.audit and event.provider:Exchange and event.category:web and event.action:"New-TransportRule" and event.outcome:success
'''
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1537"
name = "Transfer Data to Cloud Account"
reference = "https://attack.mitre.org/techniques/T1537/"
[rule.threat.tactic]
id = "TA0010"
name = "Exfiltration"
reference = "https://attack.mitre.org/tactics/TA0010/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1114"
name = "Email Collection"
reference = "https://attack.mitre.org/techniques/T1114/"
[[rule.threat.technique.subtechnique]]
id = "T1114.003"
name = "Email Forwarding Rule"
reference = "https://attack.mitre.org/techniques/T1114/003/"
[rule.threat.tactic]
id = "TA0009"
name = "Collection"
reference = "https://attack.mitre.org/tactics/TA0009/"
Stages and Predicates
Stage 1: query
data_stream.dataset:o365.audit and event.provider:Exchange and event.category:web and event.action:"New-TransportRule" and event.outcome:success
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
data_stream.dataset | eq |
| field:"data_stream.dataset" kind:eq value:"o365.audit" |
event.action | eq |
| field:"EventType" kind:eq value:"New-TransportRule" |
event.category | eq |
| field:"event.category" kind:eq value:"web" |
event.outcome | eq |
| field:"event.outcome" kind:eq value:"success" |
event.provider | eq |
| field:"Provider_Name" kind:eq value:"Exchange" |
M365 Identity OAuth Illicit Consent Grant by Rare Client and User
#Identifies an Microsoft 365 illicit consent grant request on-behalf-of a registered Entra ID application. Adversaries may create and register an application in Microsoft Entra ID for the purpose of requesting user consent to access resources in Microsoft 365. This is accomplished by tricking a user into granting consent to the application, typically via a pre-made phishing URL. This establishes an OAuth grant that allows the malicious client applocation to access resources in Microsoft 365 on-behalf-of the user.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Initial Access | |
| Persistence | |
| Credential Access |
Telemetry Coverage
| Platform | Record / event type |
|---|---|
| Microsoft 365 | Consent to application. |
Rules Detecting the Same Action
These rules filter on the same operation.
Rule Body
[metadata]
creation_date = "2025/03/24"
integration = ["o365"]
maturity = "production"
updated_date = "2026/07/15"
[rule]
author = ["Elastic"]
description = """
Identifies an Microsoft 365 illicit consent grant request on-behalf-of a registered Entra ID application. Adversaries
may create and register an application in Microsoft Entra ID for the purpose of requesting user consent to access
resources in Microsoft 365. This is accomplished by tricking a user into granting consent to the application, typically
via a pre-made phishing URL. This establishes an OAuth grant that allows the malicious client applocation to access
resources in Microsoft 365 on-behalf-of the user.
"""
from = "now-9m"
index = ["logs-o365.audit-*"]
language = "kuery"
license = "Elastic License v2"
name = "M365 Identity OAuth Illicit Consent Grant by Rare Client and User"
note = """## Triage and analysis
### Investigating M365 Identity OAuth Illicit Consent Grant by Rare Client and User
Adversaries may register a malicious application in Microsoft Entra ID and trick users into granting excessive permissions via OAuth consent. These apps can access sensitive Microsoft 365 data—such as mail, profiles, and files—on behalf of the user once consent is granted. This activity is often initiated through spearphishing campaigns that direct the user to a pre-crafted OAuth consent URL.
This rule identifies a new consent grant to an application using Microsoft 365 audit logs. Additionally, this is a New Terms rule that will only trigger if the user and client ID have not been seen doing this activity in the last 14 days.
#### Possible investigation steps
- **Review the app in Entra ID**:
- Go to **Enterprise Applications** in the Azure portal.
- Search for the `AppId` or name from `o365.audit.ObjectId`.
- Review granted API permissions and whether admin consent was required.
- Check the `Publisher` and `Verified` status.
- **Assess the user who granted consent**:
- Investigate `o365.audit.UserId` (e.g., `terrance.dejesus@...`) for signs of phishing or account compromise.
- Check if the user was targeted in recent phishing simulations or campaigns.
- Review the user’s sign-in logs for suspicious geolocation, IP, or device changes.
- **Determine scope and risk**:
- Check `o365.audit.ModifiedProperties.ConsentAction_Reason.NewValue` to determine whether Microsoft's own risk heuristics flagged the application. A value of `Risky application detected` means Microsoft scored the app as suspicious at the time consent was granted and should raise the priority of the review. This reason is only populated on admin-consent events, and its absence does not clear the application; a flagged app is also not necessarily malicious, since Microsoft's heuristic can flag legitimate apps.
- Use the `ConsentContext_IsAdminConsent` and `ConsentContext_OnBehalfOfAll` flags to assess privilege level.
- Review `o365.audit.ModifiedProperties.ConsentAction_Permissions.NewValue` for the granted scopes. Combinations such as `offline_access` with `Mail.ReadWrite`, `Files.ReadWrite.All`, or `Chat.Read` are characteristic of mailbox and file exfiltration and indicate potential data exposure.
- Cross-reference affected `Target` objects with known business-critical assets or data owners.
- **Correlate additional telemetry**:
- Review logs from Defender for Cloud Apps (MCAS), Microsoft Purview, or other DLP tooling for unusual access patterns.
- Search for `AppId` across your tenant to determine how widely it's used.
### False positive analysis
- Not all consent grants are malicious. Verify if the app is business-approved, listed in your app catalog, or commonly used by users in that role or department.
- Consent reasons like `WindowsAzureActiveDirectoryIntegratedApp` could relate to integrated services, though these still require verification.
- A `ConsentAction_Reason` of `Risky application detected` raises confidence that the consent is worth investigating, but Microsoft's risk heuristic is advisory and can flag legitimate applications (including internal line-of-business apps and newly registered tenant applications). Its absence does not make the consent benign, so weigh it alongside the requested scopes, admin-consent context, and the application's publisher.
### Response and remediation
- **If the app is confirmed malicious**:
- Revoke OAuth consent using the [Microsoft Graph API](https://learn.microsoft.com/en-us/graph/api/oauth2permissiongrant-delete).
- Remove any related service principals from Entra ID.
- Block the app via the Conditional Access "Grant" control or Defender for Cloud Apps policies.
- Revoke refresh tokens and require reauthentication for affected users.
- Notify end-users and IT of the potential exposure.
- Activate your phishing or OAuth abuse response playbook.
- **Prevent future misuse**:
- Enable the [Admin consent workflow](https://learn.microsoft.com/en-us/azure/active-directory/manage-apps/configure-admin-consent-workflow) to restrict user-granted consent.
- Audit and reduce overprivileged applications in your environment.
- Consider using Defender for Cloud Apps OAuth app governance.
"""
references = [
"https://www.wiz.io/blog/midnight-blizzard-microsoft-breach-analysis-and-best-practices",
"https://docs.microsoft.com/en-us/microsoft-365/security/office-365-security/detect-and-remediate-illicit-consent-grants?view=o365-worldwide",
"https://www.cloud-architekt.net/detection-and-mitigation-consent-grant-attacks-azuread/",
"https://docs.microsoft.com/en-us/defender-cloud-apps/investigate-risky-oauth#how-to-detect-risky-oauth-apps",
"https://learn.microsoft.com/en-us/office/office-365-management-api/office-365-management-activity-api-schema",
]
risk_score = 47
rule_id = "0c3c80de-08c2-11f0-bd11-f661ea17fbcc"
severity = "medium"
tags = [
"Domain: Cloud",
"Data Source: Microsoft 365",
"Data Source: Microsoft 365 Audit Logs",
"Use Case: Identity and Access Audit",
"Resources: Investigation Guide",
"Tactic: Initial Access",
"Tactic: Credential Access",
]
timestamp_override = "event.ingested"
type = "new_terms"
query = '''
data_stream.dataset: "o365.audit"
and o365.audit.Actor.Type: 5
and event.action: "Consent to application."
and event.outcome: "success"
and o365.audit.Target.Type: (0 or 2 or 3 or 9 or 10)
and o365.audit.UserId: *
and o365.audit.ObjectId: *
'''
[[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.002"
name = "Spearphishing Link"
reference = "https://attack.mitre.org/techniques/T1566/002/"
[rule.threat.tactic]
id = "TA0001"
name = "Initial Access"
reference = "https://attack.mitre.org/tactics/TA0001/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1528"
name = "Steal Application Access Token"
reference = "https://attack.mitre.org/techniques/T1528/"
[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 = "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.investigation_fields]
field_names = [
"@timestamp",
"event.action",
"event.outcome",
"o365.audit.UserId",
"o365.audit.ObjectId",
"o365.audit.Actor.Type",
"o365.audit.Target.Type",
"o365.audit.ModifiedProperties.ConsentAction_Reason.NewValue",
"o365.audit.ExtendedProperties.additionalDetails",
"cloud.region"
]
[rule.new_terms]
field = "new_terms_fields"
value = ["o365.audit.UserId", "o365.audit.ObjectId"]
[[rule.new_terms.history_window_start]]
field = "history_window_start"
value = "now-10d"
Stages and Predicates
Stage 1: new_terms
data_stream.dataset: "o365.audit"
and o365.audit.Actor.Type: 5
and event.action: "Consent to application."
and event.outcome: "success"
and o365.audit.Target.Type: (0 or 2 or 3 or 9 or 10)
and o365.audit.UserId: *
and o365.audit.ObjectId: *
Indicators
These rows show field, operator, and value matches.
Memory File Descriptor Process Execution
#This rule detects when a process is executed from a memory file descriptor (memfd). Attackers may use memfd to create and execute code directly in memory, bypassing traditional file-based detection mechanisms. The use of memfd for process execution is uncommon and may indicate an attempt to evade security controls.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Execution | |
| Stealth |
Rule Body
[rule]
description = """
This rule detects when a process is executed from a memory file descriptor (memfd). Attackers may use memfd to create
and execute code directly in memory, bypassing traditional file-based detection mechanisms. The use of memfd for process
execution is uncommon and may indicate an attempt to evade security controls.
"""
id = "de860e9f-be00-4045-ba04-ba8a5008d3b4"
license = "Elastic License v2"
name = "Memory File Descriptor Process Execution"
os_list = ["linux"]
reference = ["https://man7.org/linux/man-pages/man2/memfd_create.2.html"]
version = "1.0.3"
query = '''
process where event.type == "start" and event.action == "exec" and process.executable like "?memfd:*"
'''
min_endpoint_version = "7.15.0"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
tree = true
[[actions]]
action = "kill_process"
field = "process.parent.entity_id"
state = 0
tree = true
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "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 = "T1055"
name = "Process Injection"
reference = "https://attack.mitre.org/techniques/T1055/"
[[threat.technique.subtechnique]]
id = "T1055.009"
name = "Proc Memory"
reference = "https://attack.mitre.org/techniques/T1055/009/"
[[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 = "7.15.0"
Stages and Predicates
Stage 1: process
process where event.type == "start" and event.action == "exec" and process.executable like "?memfd:*"
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.executable | wildcard |
| field:"Image" kind:wildcard value:"?memfd:*" |
Modification of Safari Settings via Defaults Command
#Identifies changes to the Safari configuration using the built-in defaults command. Adversaries may attempt to enable or disable certain Safari settings, such as enabling JavaScript from Apple Events to ease the user's browser's hijacking.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Defense Impairment |
Rule Body
[rule]
description = """
Identifies changes to the Safari configuration using the built-in defaults command. Adversaries may attempt to enable or
disable certain Safari settings, such as enabling JavaScript from Apple Events to ease the user's browser's hijacking.
"""
id = "396e1138-243c-4215-a8ed-be303204710d"
license = "Elastic License v2"
name = "Modification of Safari Settings via Defaults Command"
os_list = ["macos"]
reference = ["https://objectivebythesea.com/v2/talks/OBTS_v2_Zohar.pdf"]
version = "1.0.29"
query = '''
process where event.type == "start" and
process.name == "defaults" and process.args like~ "write" and
process.command_line like~ "*com.apple.Safari*" and process.command_line like~ ("*IncludeDevelopMenu*", "*JavaScript*")
'''
min_endpoint_version = "8.10.2"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1562"
name = "Impair Defenses"
reference = "https://attack.mitre.org/techniques/T1562/"
[[threat.technique.subtechnique]]
id = "T1562.001"
name = "Disable or Modify Tools"
reference = "https://attack.mitre.org/techniques/T1562/001/"
[threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
[internal]
min_endpoint_version = "8.10.2"
Stages and Predicates
Stage 1: process
process where event.type == "start" and
process.name == "defaults" and process.args like~ "write" and
process.command_line like~ "*com.apple.Safari*" and process.command_line like~ ("*IncludeDevelopMenu*", "*JavaScript*")
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.type | eq |
| field:"event.type" kind:eq value:"start" |
process.args | wildcard |
| field:"process.args" kind:wildcard value:"write" |
process.command_line | wildcard |
| field:"CommandLine" kind:wildcard |
process.name | eq |
| field:"process_basename" kind:eq value:"defaults" |
NetworkCleartext Logon by a Suspicious Process
#Identifies NetworkCleartext logon attempt by an unusual process. Adversaries may leverage compromised credentials to bypass access controls.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Privilege Escalation |
Rule Body
[rule]
description = """
Identifies NetworkCleartext logon attempt by an unusual process. Adversaries may leverage compromised credentials to
bypass access controls.
"""
id = "07ca9f3f-50b9-4b2f-ae18-e500d21fe73d"
license = "Elastic License v2"
name = "NetworkCleartext Logon by a Suspicious Process"
os_list = ["windows"]
reference = ["https://attack.mitre.org/techniques/T1134/002/"]
version = "1.0.11"
query = '''
authentication where event.action == "log_on" and
process.Ext.session_info.logon_type == "NetworkCleartext" and process.executable : "C:\\*" and
user.id like ("S-1-5-21*", "S-1-12-*") and (user.effective.id != null and user.effective.id like ("S-1-5-21*", "S-1-12-*")) and
not (process.code_signature.trusted == true and
process.code_signature.subject_name in ("Varonis Systems, Inc.", "Remote Access World SAS", "TSplus SAS", "Solarwinds Worldwide, LLC", "Siemens AG")) and
not process.executable :
("?:\\Windows\\System32\\inetsrv\\w3wp.exe",
"?:\\Windows\\SysWOW64\\inetsrv\\w3wp.exe",
"?:\\Windows\\System32\\inetsrv\\appcmd.exe",
"?:\\Windows\\System32\\mmc.exe",
"?:\\Windows\\System32\\wsmprovhost.exe",
"?:\\Program Files\\*.exe",
"?:\\Program Files (x86)\\*.exe",
"?:\\Windows\\System32\\inetsrv\\InetMgr.exe",
"?:\\Windows\\System32\\inetsrv\\WMSvc.exe",
"?:\\Windows\\System32\\wbem\\WmiPrvSE.exe",
"?:\\Windows\\System32\\CPrepSrv.exe",
"?:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe")
'''
min_endpoint_version = "8.15.1"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1134"
name = "Access Token Manipulation"
reference = "https://attack.mitre.org/techniques/T1134/"
[[threat.technique.subtechnique]]
id = "T1134.001"
name = "Token Impersonation/Theft"
reference = "https://attack.mitre.org/techniques/T1134/001/"
[[threat.technique.subtechnique]]
id = "T1134.002"
name = "Create Process with Token"
reference = "https://attack.mitre.org/techniques/T1134/002/"
[threat.tactic]
id = "TA0004"
name = "Privilege Escalation"
reference = "https://attack.mitre.org/tactics/TA0004/"
[internal]
min_endpoint_version = "8.15.1"
Stages and Predicates
Stage 1: authentication
authentication where event.action == "log_on" and
process.Ext.session_info.logon_type == "NetworkCleartext" and process.executable : "C:\\*" and
user.id like ("S-1-5-21*", "S-1-12-*") and (user.effective.id != null and user.effective.id like ("S-1-5-21*", "S-1-12-*")) and
not (process.code_signature.trusted == true and
process.code_signature.subject_name in ("Varonis Systems, Inc.", "Remote Access World SAS", "TSplus SAS", "Solarwinds Worldwide, LLC", "Siemens AG")) and
not process.executable :
("?:\\Windows\\System32\\inetsrv\\w3wp.exe",
"?:\\Windows\\SysWOW64\\inetsrv\\w3wp.exe",
"?:\\Windows\\System32\\inetsrv\\appcmd.exe",
"?:\\Windows\\System32\\mmc.exe",
"?:\\Windows\\System32\\wsmprovhost.exe",
"?:\\Program Files\\*.exe",
"?:\\Program Files (x86)\\*.exe",
"?:\\Windows\\System32\\inetsrv\\InetMgr.exe",
"?:\\Windows\\System32\\inetsrv\\WMSvc.exe",
"?:\\Windows\\System32\\wbem\\WmiPrvSE.exe",
"?:\\Windows\\System32\\CPrepSrv.exe",
"?:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe")
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | eq |
| field:"EventType" kind:eq value:"log_on" |
process.Ext.session_info.logon_type | eq |
| field:"process.Ext.session_info.logon_type" kind:eq value:"NetworkCleartext" |
process.executable | wildcard |
| field:"Image" kind:wildcard value:"C:\*" |
user.effective.id | is_not_null | field:"user.effective.id" kind:is_not_null | |
user.effective.id | wildcard |
| field:"user.effective.id" kind:wildcard |
user.id | wildcard |
| field:"user.id" kind:wildcard |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.code_signature.subject_name | in | Remote Access World SAS, Siemens AG, Solarwinds Worldwide, LLC, TSplus SAS, Varonis Systems, Inc. | excludes:process.code_signature.subject_name |
process.code_signature.trusted | eq | true | excludes:process.code_signature.trusted field:"process.code_signature.trusted" value:"true" |
process.executable | wildcard | ?:\Windows\System32\inetsrv\w3wp.exe, ?:\Windows\SysWOW64\inetsrv\w3wp.exe, ?:\Windows\System32\inetsrv\appcmd.exe, ?:\Windows\System32\mmc.exe, ?:\Windows\System32\wsmprovhost.exe, ?:\Program Files\*.exe, ?:\Program Files (x86)\*.exe, ?:\Windows\System32\inetsrv\InetMgr.exe, ?:\Windows\System32\inetsrv\WMSvc.exe, ?:\Windows\System32\wbem\WmiPrvSE.exe, ?:\Windows\System32\CPrepSrv.exe, ?:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe | excludes:process.executable |
Oversized DLL Creation followed by SideLoad
#Identifies the creation of an unsigned or untrusted large DLL and subsequently loaded by a trusted binary. This behavior is consistent with some malwares leveraging malicious DLLs for evasion and execution.
MITRE ATT&CK Coverage
Rule Body
[rule]
description = """
Identifies the creation of an unsigned or untrusted large DLL and subsequently loaded by a trusted binary. This behavior
is consistent with some malwares leveraging malicious DLLs for evasion and execution.
"""
id = "33cdad6c-5809-4d78-94f0-5a5153289e7e"
license = "Elastic License v2"
name = "Oversized DLL Creation followed by SideLoad"
os_list = ["windows"]
version = "1.0.23"
query = '''
sequence with maxspan=5m
[file where event.action != "deletion" and file.Ext.header_bytes : "4d5a*" and
/* size more or equal to 90MB */
file.size >= 90000000 and
not process.executable : "?:\\Windows\\System32\\drvinst.exe" and
not (process.code_signature.trusted == true and not process.code_signature.subject_name : "Microsoft *")
] as event0
[library where
(dll.Ext.relative_file_creation_time < 5000 or dll.Ext.relative_file_name_modify_time < 5000) and
not dll.code_signature.trusted == true and
process.code_signature.trusted == true and not startswith~(dll.name, process.name) and
startswith~(dll.path, event0.file.path) and
not process.executable :
("?:\\Program Files\\*.exe",
"?:\\Program Files (x86)\\*.exe",
"?:\\Windows\\System32\\DriverStore\\FileRepository\\*",
"?:\\Windows\\SysWOW64\\DriverStore\\FileRepository\\*",
"?:\\Windows\\System32\\msiexec.exe",
"?:\\Users\\*\\AppData\\Local\\SquirrelTemp\\Update.exe") and
not process.code_signature.subject_name :
("TEAMDEV LTD.", "Spotify AB", "Snap-on Business Solutions, Inc.", "ITAU UNIBANCO S.A.",
"Kahua Inc.", "Bloomberg LP", "Amazon.com Services LLC", "EnterpriseDB Corporation",
"Mitel Networks Corporation", "The Document Foundation", "Bytedance Pte. Ltd.", "Kahua Inc.",
"Sikka Software Corporation", "Leica Geosystems Inc", "3M Company", "DASSAULT SYSTEMES SE",
"Dassault Systemes SolidWorks Corp.", "Siemens Industry Software Inc.", "PlanGrid, Inc.",
"Stichting Blender Foundation") and
not dll.name : ("libcef.dll", "Qt?WebEngineCore.dll", "xul.dll", "chrome.dll", "libwireshark.dll", "chrome_child.dll", "msedge.dll") and
/* loaded from current dir */
endswith~(substring(dll.path, 0, length(dll.path) - (length(dll.name) + 1)),
substring(process.executable, 0, length(process.executable) - (length(process.name) + 1)))]
'''
min_endpoint_version = "8.4.0"
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 1
[[optional_actions]]
action = "rollback"
field = "process.entity_id"
state = 0
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1027"
name = "Obfuscated Files or Information"
reference = "https://attack.mitre.org/techniques/T1027/"
[[threat.technique.subtechnique]]
id = "T1027.001"
name = "Binary Padding"
reference = "https://attack.mitre.org/techniques/T1027/001/"
[[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 = "8.4.0"
Stages and Predicates
Stage 1: file
[file where event.action != "deletion" and file.Ext.header_bytes : "4d5a*" and
file.size >= 90000000 and
not process.executable : "?:\\Windows\\System32\\drvinst.exe" and
not (process.code_signature.trusted == true and not process.code_signature.subject_name : "Microsoft *")
] as event0
Stage 2: library
[library where
(dll.Ext.relative_file_creation_time < 5000 or dll.Ext.relative_file_name_modify_time < 5000) and
not dll.code_signature.trusted == true and
process.code_signature.trusted == true and not startswith~(dll.name, process.name) and
startswith~(dll.path, event0.file.path) and
not process.executable :
("?:\\Program Files\\*.exe",
"?:\\Program Files (x86)\\*.exe",
"?:\\Windows\\System32\\DriverStore\\FileRepository\\*",
"?:\\Windows\\SysWOW64\\DriverStore\\FileRepository\\*",
"?:\\Windows\\System32\\msiexec.exe",
"?:\\Users\\*\\AppData\\Local\\SquirrelTemp\\Update.exe") and
not process.code_signature.subject_name :
("TEAMDEV LTD.", "Spotify AB", "Snap-on Business Solutions, Inc.", "ITAU UNIBANCO S.A.",
"Kahua Inc.", "Bloomberg LP", "Amazon.com Services LLC", "EnterpriseDB Corporation",
"Mitel Networks Corporation", "The Document Foundation", "Bytedance Pte. Ltd.", "Kahua Inc.",
"Sikka Software Corporation", "Leica Geosystems Inc", "3M Company", "DASSAULT SYSTEMES SE",
"Dassault Systemes SolidWorks Corp.", "Siemens Industry Software Inc.", "PlanGrid, Inc.",
"Stichting Blender Foundation") and
not dll.name : ("libcef.dll", "Qt?WebEngineCore.dll", "xul.dll", "chrome.dll", "libwireshark.dll", "chrome_child.dll", "msedge.dll") and
endswith~(substring(dll.path, 0, length(dll.path) - (length(dll.name) + 1)),
substring(process.executable, 0, length(process.executable) - (length(process.name) + 1)))]
Indicators
These rows show field, operator, and value matches.
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
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\drvinst.exe | excludes:process.executable field:"process.executable" value:"?:\Windows\System32\drvinst.exe" |
dll.code_signature.trusted | eq | true | excludes:dll.code_signature.trusted field:"dll.code_signature.trusted" value:"true" |
dll.name | eq | libcef.dll, Qt?WebEngineCore.dll, xul.dll, chrome.dll, libwireshark.dll, chrome_child.dll, msedge.dll | excludes:dll.name |
dll.name | starts_with | process.name | excludes:dll.name field:"dll.name" value:"process.name" |
process.code_signature.subject_name | eq | TEAMDEV LTD., Spotify AB, Snap-on Business Solutions, Inc., ITAU UNIBANCO S.A., Kahua Inc., Bloomberg LP, Amazon.com Services LLC, EnterpriseDB Corporation, Mitel Networks Corporation, The Document Foundation, Bytedance Pte. Ltd., Kahua Inc., Sikka Software Corporation, Leica Geosystems Inc, 3M Company, DASSAULT SYSTEMES SE, Dassault Systemes SolidWorks Corp., Siemens Industry Software Inc., PlanGrid, Inc., Stichting Blender Foundation | excludes:process.code_signature.subject_name |
process.executable | wildcard | ?:\Program Files\*.exe, ?:\Program Files (x86)\*.exe, ?:\Windows\System32\DriverStore\FileRepository\*, ?:\Windows\SysWOW64\DriverStore\FileRepository\*, ?:\Windows\System32\msiexec.exe, ?:\Users\*\AppData\Local\SquirrelTemp\Update.exe | excludes:process.executable |
Polkit Version Discovery
#This rule detects Polkit version discovery activity on Linux systems. Polkit version discovery can be an indication of an attacker attempting to exploit misconfigurations or vulnerabilities in the Polkit service.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Discovery |
Rule Body
[metadata]
creation_date = "2025/01/16"
integration = ["endpoint", "crowdstrike", "sentinel_one_cloud_funnel", "auditd_manager"]
maturity = "production"
updated_date = "2026/06/17"
[rule]
author = ["Elastic"]
description = """
This rule detects Polkit version discovery activity on Linux systems. Polkit version discovery can be an indication of
an attacker attempting to exploit misconfigurations or vulnerabilities in the Polkit service.
"""
from = "now-9m"
index = [
"auditbeat-*",
"endgame-*",
"logs-crowdstrike.fdr*",
"logs-endpoint.events.process*",
"logs-sentinel_one_cloud_funnel.*",
"logs-auditd_manager.auditd-*",
]
language = "eql"
license = "Elastic License v2"
name = "Polkit Version Discovery"
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 Polkit Version Discovery
Polkit, a system service in Linux, manages system-wide privileges, enabling non-privileged processes to communicate with privileged ones. Adversaries may exploit Polkit by discovering its version to identify vulnerabilities or misconfigurations. The detection rule identifies suspicious activities by monitoring specific command executions related to Polkit version checks, signaling potential reconnaissance efforts by attackers.
### Possible investigation steps
- Review the process execution details to confirm the command used for Polkit version discovery, focusing on the process name and arguments such as "dnf", "rpm", "apt", or "pkaction".
- Check the user account associated with the process execution to determine if it is a legitimate user or potentially compromised.
- Investigate the host from which the command was executed to assess if it has a history of suspicious activities or if it is a high-value target.
- Correlate the event with other logs or alerts to identify if there are additional indicators of compromise or related reconnaissance activities.
- Evaluate the necessity and frequency of Polkit version checks in the environment to determine if this behavior is expected or anomalous.
### False positive analysis
- Routine system updates or package management activities may trigger the rule when administrators use package managers like dnf, rpm, or apt to check for updates or verify installed packages. To mitigate this, create exceptions for known administrative scripts or user accounts that regularly perform these actions.
- Automated system monitoring tools that check software versions for compliance or inventory purposes might also cause false positives. Identify these tools and exclude their processes from triggering the rule.
- Developers or system administrators testing Polkit configurations or updates might execute version checks as part of their workflow. Consider excluding specific user accounts or process paths associated with development and testing environments.
- Security audits or vulnerability assessments conducted by internal teams may involve version checks as part of their procedures. Coordinate with these teams to whitelist their activities during scheduled assessments.
### Response and remediation
- Isolate the affected system from the network to prevent potential lateral movement by the attacker.
- Terminate any suspicious processes identified in the alert, such as those involving the execution of Polkit version discovery commands.
- Conduct a thorough review of system logs and command history to identify any unauthorized access or further malicious activities.
- Apply any available security patches or updates to the Polkit service to address known vulnerabilities.
- Implement stricter access controls and monitoring on systems running Polkit to prevent unauthorized version checks and other reconnaissance activities.
- Escalate the incident to the security operations team for further investigation and to determine if additional systems are affected.
- Enhance detection capabilities by configuring alerts for similar reconnaissance activities across the network to ensure early detection of potential threats."""
risk_score = 21
rule_id = "ca3bcacc-9285-4452-a742-5dae77538f61"
setup = """## Setup
This rule requires data coming in from Elastic Defend.
### Elastic Defend Integration Setup
Elastic Defend is integrated into the Elastic Agent using Fleet. Upon configuration, the integration allows the Elastic Agent to monitor events on your host and send data to the Elastic Security app.
#### Prerequisite Requirements:
- Fleet is required for Elastic Defend.
- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).
#### The following steps should be executed in order to add the Elastic Defend integration on a Linux System:
- Go to the Kibana home page and click "Add integrations".
- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.
- Click "Add Elastic Defend".
- Configure the integration name and optionally add a description.
- Select the type of environment you want to protect, either "Traditional Endpoints" or "Cloud Workloads".
- Select a configuration preset. Each preset comes with different default settings for Elastic Agent, you can further customize these later by configuring the Elastic Defend integration policy. [Helper guide](https://www.elastic.co/guide/en/security/current/configure-endpoint-integration-policy.html).
- We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"
- Enter a name for the agent policy in "New agent policy name". If other agent policies already exist, you can click the "Existing hosts" tab and select an existing policy instead.
For more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/8.10/agent-policy.html).
- Click "Save and Continue".
- To complete the integration, select "Add Elastic Agent to your hosts" and continue to the next section to install the Elastic Agent on your hosts.
For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
"""
severity = "low"
tags = [
"Domain: Endpoint",
"OS: Linux",
"Use Case: Threat Detection",
"Tactic: Discovery",
"Data Source: Elastic Defend",
"Data Source: Elastic Endgame",
"Data Source: Crowdstrike",
"Data Source: SentinelOne",
"Data Source: Auditd Manager",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
process where host.os.type == "linux" and event.type == "start" and
event.action in ("exec", "exec_event", "start", "ProcessRollup2", "process_started", "executed") and (
(process.name == "dnf" and process.args == "dnf" and process.args == "info" and process.args == "polkit") or
(process.name == "rpm" and process.args == "polkit") or
(process.name == "apt" and process.args == "show" and process.args == "policykit-1") or
(process.name == "pkaction" and process.args == "--version")
) and
not (
?process.working_directory in ("/opt/msp-agent", "/opt/CyberCNSAgent") or
?process.parent.executable like ("/usr/local/cpanel/3rdparty/perl/*/bin/perl", "/usr/share/vicarius/topiad") or
?process.entry_leader.executable in ("/usr/local/qualys/cloud-agent/bin/qualys-cloud-agent", "/sf/edr/agent/bin/edr_monitor") or
(
?process.parent.args == "/usr/lib/venv-salt-minion/bin/python.original" and
?process.parent.args == "/usr/lib/venv-salt-minion/bin/salt-minion"
)
)
'''
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1082"
name = "System Information Discovery"
reference = "https://attack.mitre.org/techniques/T1082/"
[[rule.threat.technique]]
id = "T1518"
name = "Software Discovery"
reference = "https://attack.mitre.org/techniques/T1518/"
[rule.threat.tactic]
id = "TA0007"
name = "Discovery"
reference = "https://attack.mitre.org/tactics/TA0007/"
Stages and Predicates
Stage 1: process
process where host.os.type == "linux" and event.type == "start" and
event.action in ("exec", "exec_event", "start", "ProcessRollup2", "process_started", "executed") and (
(process.name == "dnf" and process.args == "dnf" and process.args == "info" and process.args == "polkit") or
(process.name == "rpm" and process.args == "polkit") or
(process.name == "apt" and process.args == "show" and process.args == "policykit-1") or
(process.name == "pkaction" and process.args == "--version")
) and
not (
?process.working_directory in ("/opt/msp-agent", "/opt/CyberCNSAgent") or
?process.parent.executable like ("/usr/local/cpanel/3rdparty/perl/*/bin/perl", "/usr/share/vicarius/topiad") or
?process.entry_leader.executable in ("/usr/local/qualys/cloud-agent/bin/qualys-cloud-agent", "/sf/edr/agent/bin/edr_monitor") or
(
?process.parent.args == "/usr/lib/venv-salt-minion/bin/python.original" and
?process.parent.args == "/usr/lib/venv-salt-minion/bin/salt-minion"
)
)
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | in |
| field:"EventType" kind:in |
event.type | eq |
| field:"event.type" kind:eq value:"start" |
process.args | eq |
| field:"process.args" kind:eq |
process.name | eq |
| field:"process_basename" kind:eq |
Exclusions
The rule actively suppresses these predicates.
Potential Elastic Tampering via PendingFileRename
#Identifies attempts to delete Elastic protected resources via PendingFileRename operation. Malware may abuse this feature to delete Elastic endpoint after reboot.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Persistence | |
| Defense Impairment |
Rule Body
[rule]
description = """
Identifies attempts to delete Elastic protected resources via PendingFileRename operation. Malware may abuse this
feature to delete Elastic endpoint after reboot.
"""
id = "faf5018c-2cf0-4334-b89f-db197d95ee16"
license = "Elastic License v2"
name = "Potential Elastic Tampering via PendingFileRename"
os_list = ["windows"]
reference = [
"https://qtechbabble.wordpress.com/2020/06/26/use-pendingfilerenameoperations-registry-key-to-automatically-delete-a-file-on-reboot/",
"https://github.com/rad9800/FileRenameJunctionsEDRDisable",
"https://github.com/duhirsch/MoveEdr",
]
version = "1.0.3"
query = '''
registry where event.action == "modification" and
registry.value == "PendingFileRenameOperations" and
registry.data.strings : (
"*Program Files\\Elastic\\*",
"*Program Files//Elastic//*",
"*Program Files\\Elastic",
"*Program Files//Elastic",
"*elastic-endpoint-driver.sys*",
"*ElasticElam.sys*"
)
'''
min_endpoint_version = "8.1.0"
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
[[optional_actions]]
action = "rollback"
field = "process.entity_id"
state = 0
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1112"
name = "Modify Registry"
reference = "https://attack.mitre.org/techniques/T1112/"
[[threat.technique]]
id = "T1562"
name = "Impair Defenses"
reference = "https://attack.mitre.org/techniques/T1562/"
[[threat.technique.subtechnique]]
id = "T1562.001"
name = "Disable or Modify Tools"
reference = "https://attack.mitre.org/techniques/T1562/001/"
[threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
[internal]
min_endpoint_version = "8.1.0"
Stages and Predicates
Stage 1: registry
registry where event.action == "modification" and
registry.value == "PendingFileRenameOperations" and
registry.data.strings : (
"*Program Files\\Elastic\\*",
"*Program Files//Elastic//*",
"*Program Files\\Elastic",
"*Program Files//Elastic",
"*elastic-endpoint-driver.sys*",
"*ElasticElam.sys*"
)
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | eq |
| field:"EventType" kind:eq value:"modification" |
registry.data.strings | wildcard |
| field:"Details" kind:wildcard |
registry.value | eq |
| field:"registry_value_name" kind:eq value:"PendingFileRenameOperations" |
Potential Evasion via Intel GfxDownloadWrapper
#Identifies abuse of the legitimate application GfxDownloadWrapper.exe shipped by Intel to load an arbitrary DLL or download a remote file. This behavior is used as a defense evasion technique to blend-in malicious activity with legitimate software.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Stealth | |
| Command & Control |
Rule Body
[rule]
description = """
Identifies abuse of the legitimate application GfxDownloadWrapper.exe shipped by Intel to load an arbitrary DLL or
download a remote file. This behavior is used as a defense evasion technique to blend-in malicious activity with
legitimate software.
"""
id = "aafe3c78-15d9-4853-a602-663b8fada5b5"
license = "Elastic License v2"
name = "Potential Evasion via Intel GfxDownloadWrapper"
os_list = ["windows"]
reference = [
"https://twitter.com/bohops/status/1318767376175976449",
"https://www.trendmicro.com/en_us/research/23/b/invitation-to-secret-event-uncovering-earth-yako-campaigns.html",
"https://lolbas-project.github.io/lolbas/Binaries/GfxDownloadWrapper/",
]
version = "1.0.17"
query = '''
process where event.action == "start" and
(process.pe.original_file_name : "GfxDownloadWrapper.exe" or process.name : "GfxDownloadWrapper.exe") and
process.parent.executable != null and
(
/* run a DLL */
(process.args : "run" and process.args : ("0", "2")) or
/* download remote content */
(process.command_line : "http*" and not process.args : "https://gameplayapi.intel.com/*")
)
'''
min_endpoint_version = "7.16.0"
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
[[optional_actions]]
action = "rollback"
field = "process.entity_id"
state = 0
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1218"
name = "System Binary Proxy Execution"
reference = "https://attack.mitre.org/techniques/T1218/"
[threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1105"
name = "Ingress Tool Transfer"
reference = "https://attack.mitre.org/techniques/T1105/"
[threat.tactic]
id = "TA0011"
name = "Command and Control"
reference = "https://attack.mitre.org/tactics/TA0011/"
[internal]
min_endpoint_version = "7.16.0"
Stages and Predicates
Stage 1: process
process where event.action == "start" and
(process.pe.original_file_name : "GfxDownloadWrapper.exe" or process.name : "GfxDownloadWrapper.exe") and
process.parent.executable != null and
(
(process.args : "run" and process.args : ("0", "2")) or
(process.command_line : "http*" and not process.args : "https://gameplayapi.intel.com/*")
)
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | eq |
| field:"EventType" kind:eq value:"start" |
process.args | wildcard |
| field:"process.args" kind:wildcard |
process.command_line | wildcard |
| field:"CommandLine" kind:wildcard value:"http*" |
process.name | wildcard |
| field:"process_basename" kind:wildcard value:"GfxDownloadWrapper.exe" |
process.parent.executable | is_not_null | field:"ParentImage" kind:is_not_null | |
process.pe.original_file_name | wildcard |
| field:"OriginalFileName" kind:wildcard value:"GfxDownloadWrapper.exe" |
Potential Exploitation via ComDotNet Exploit
#Identifies the start of the WaaSMedicSvc service followed by loading the CLR module. This may indicate a successful exploitation of Windows Protected Process Light (PPL) using COM-to-.NET redirection and reflection techniques for code injection.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Privilege Escalation | |
| Stealth |
Rule Body
[rule]
description = """
Identifies the start of the WaaSMedicSvc service followed by loading the CLR module. This may indicate a successful
exploitation of Windows Protected Process Light (PPL) using COM-to-.NET redirection and reflection techniques for code
injection.
"""
id = "061bb372-9c37-4bc2-ae91-a34a00f85793"
license = "Elastic License v2"
name = "Potential Exploitation via ComDotNet Exploit"
os_list = ["windows"]
reference = [
"https://mohamed-fakroud.gitbook.io/red-teamings-dojo/abusing-idispatch-for-trapped-com-object-access-and-injecting-into-ppl-processes",
"https://github.com/T3nb3w/ComDotNetExploit",
]
version = "1.0.2"
query = '''
sequence by process.entity_id with maxspan=1m
[process where event.action == "start" and process.name == "svchost.exe" and process.args == "WaaSMedicSvc"]
[library where process.name == "svchost.exe" and dll.name == "clr.dll"]
'''
min_endpoint_version = "8.14.0"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
tree = true
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1068"
name = "Exploitation for Privilege Escalation"
reference = "https://attack.mitre.org/techniques/T1068/"
[threat.tactic]
id = "TA0004"
name = "Privilege Escalation"
reference = "https://attack.mitre.org/tactics/TA0004/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1055"
name = "Process Injection"
reference = "https://attack.mitre.org/techniques/T1055/"
[threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
[internal]
min_endpoint_version = "8.14.0"
Stages and Predicates
Ordered sequence: each step below must occur in order within 1m, correlated by process.entity_id.
Stage 1: process
[process where event.action == "start" and process.name == "svchost.exe" and process.args == "WaaSMedicSvc"]
Stage 2: library
[library where process.name == "svchost.exe" and dll.name == "clr.dll"]
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
dll.name | eq |
| field:"dll.name" kind:eq value:"clr.dll" |
event.action | eq |
| field:"EventType" kind:eq value:"start" |
process.args | eq |
| field:"process.args" kind:eq value:"WaaSMedicSvc" |
process.name | eq |
| field:"process_basename" kind:eq value:"svchost.exe" |
Spike in GCP Audit Failed Messages
#A machine learning job detected a significant spike in the rate of a particular failure in the GCP Audit messages. Spikes in failed messages may accompany attempts at privilege escalation, lateral movement, or discovery.
Known False Positives
- Spikes in failures can also be due to bugs in cloud automation scripts or workflows; changes to cloud automation scripts or workflows; adoption of new services; changes in the way services are used; or changes to IAM privileges.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Discovery |
Rule Body
[metadata]
creation_date = "2025/10/06"
integration = ["gcp"]
maturity = "production"
min_stack_comments = "Use EA (Entity Analytics) fields"
min_stack_version = "9.4.0"
updated_date = "2026/04/01"
[rule]
anomaly_threshold = 50
author = ["Elastic"]
description = """
A machine learning job detected a significant spike in the rate of a particular failure in the GCP Audit messages. Spikes
in failed messages may accompany attempts at privilege escalation, lateral movement, or discovery.
"""
false_positives = [
"""
Spikes in failures can also be due to bugs in cloud automation scripts or workflows; changes to cloud
automation scripts or workflows; adoption of new services; changes in the way services are used; or changes to IAM
privileges.
""",
]
from = "now-60m"
interval = "15m"
license = "Elastic License v2"
machine_learning_job_id = "gcp_audit_high_distinct_count_error_message_ea"
name = "Spike in GCP Audit Failed Messages"
setup = """## Setup
This rule requires the installation of associated Machine Learning jobs, as well as data coming in from GCP Audit.
### 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).
### GCP Audit logs Integration Setup
The Google Cloud Platform (GCP) Audit logs integration allows you to collect logs and metrics from Google Cloud Platform (GCP) with Elastic Agent.
#### The following steps should be executed in order to add the Elastic Agent System "Google Cloud Platform (GCP) Audit logs" integration to your system:
- Go to the Kibana home page and click “Add integrations”.
- In the query bar, search for “Google Cloud Platform (GCP) Audit logs” and select the integration to see more details about it.
- Click “Add Google Cloud Platform (GCP) Audit logs".
- Configure the integration.
- Click “Save and Continue”.
- For more details on the integration refer to the [helper guide](https://www.elastic.co/docs/current/integrations/gcp).
"""
references = ["https://www.elastic.co/guide/en/security/current/prebuilt-ml-jobs.html"]
risk_score = 21
rule_id = "a4b740e4-be17-4048-9aa4-1e6f42b455b1"
severity = "low"
tags = [
"Domain: Cloud",
"Data Source: GCP",
"Data Source: GCP Audit Logs",
"Data Source: Google Cloud Platform",
"Rule Type: ML",
"Rule Type: Machine Learning",
"Resources: Investigation Guide",
]
type = "machine_learning"
[[rule.threat]]
framework = "MITRE ATT&CK"
[rule.threat.tactic]
id = "TA0007"
name = "Discovery"
reference = "https://attack.mitre.org/tactics/TA0007/"
[[rule.threat.technique]]
id = "T1526"
name = "Cloud Service Discovery"
reference = "https://attack.mitre.org/techniques/T1526/"
[[rule.threat.technique]]
id = "T1580"
name = "Cloud Infrastructure Discovery"
reference = "https://attack.mitre.org/techniques/T1580/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[rule.threat.tactic]
id = "TA0004"
name = "Privilege Escalation"
reference = "https://attack.mitre.org/tactics/TA0004/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[rule.threat.tactic]
id = "TA0008"
name = "Lateral Movement"
reference = "https://attack.mitre.org/tactics/TA0008/"
Suspicious Executable Memory Permission Modification
#Identifies suspicious memory permission modification from read and execute R-X to read only. This may indicate an attempt to hide executable code while in sleep state.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Stealth |
Rule Body
[rule]
description = """
Identifies suspicious memory permission modification from read and execute R-X to read only. This may indicate an
attempt to hide executable code while in sleep state.
"""
id = "c6e63ef1-e2d8-4703-80c7-a544f2aa5c6e"
license = "Elastic License v2"
name = "Suspicious Executable Memory Permission Modification"
os_list = ["windows"]
reference = ["https://www.elastic.co/security-labs/doubling-down-etw-callstacks"]
version = "1.0.16"
query = '''
api where process.Ext.api.name == "VirtualProtect" and process.executable != null and
process.Ext.api.parameters.protection == "R--" and process.Ext.api.parameters.protection_old == "R-X" and
process.thread.Ext.call_stack_summary : "?*" and
not (process.code_signature.subject_name : ("Electronic Arts, Inc.", "Activision Publishing Inc") and process.code_signature.trusted == true) and
process.thread.Ext.call_stack_final_user_module.name : "Unbacked" and
not process.thread.Ext.call_stack_final_user_module.name : ("Kernel", "Unknown", "Undetermined") and
not process.thread.Ext.call_stack_final_user_module.protection_provenance like ("Kernel", "Kernel|*", "hmpalert.dll", "Unknown", "Unbacked") and
not _arraysearch(process.thread.Ext.call_stack, $entry, $entry.protection_provenance : ("Kernel", "Kernel|*")) and
not process.thread.Ext.call_stack_final_user_module.path :
("?:\\windows\\system32\\apphelp.dll",
"?:\\windows\\syswow64\\apphelp.dll",
"?:\\windows\\microsoft.net\\framework*\\clr.dll",
"?:\\program files\\dotnet\\shared\\microsoft.netcore.app\\*\\coreclr.dll") and
not process.thread.Ext.call_stack_final_user_module.hash.sha256 :
("f7c78dba07128af325d8da99138ebf78be163ecfb5da5b01fa6b65b96efecef1",
"ca6079aadef0e98ee94f59babe8d67c0412829a42581c7884659a2737833b83e",
"14ddc0fed1748f89318fbdc59c092e9891feffe5175ef22991b6a794fe539dc3",
"6ad6c03ac893bce8aeb65362c7615b7c74d457276ce6bdcde40a110178267fa3",
"f7c78dba07128af325d8da99138ebf78be163ecfb5da5b01fa6b65b96efecef1",
"e0f97f4ca158dc6de279467dd469b7d9da6613de64c7e5ed34bdd9d358dd8a90",
"b8962adcfb27934ff93f7fffe306e1f01b9342305e883443896204e24c68290b") and
not (process.code_signature.trusted == true and process.code_signature.subject_name : "Roblox Corporation") and
not _arraysearch(process.thread.Ext.call_stack_final_user_module.code_signature,
$entry, $entry.subject_name: ("Bitdefender SRL", "Google LLC", "Mozilla Corporation", "Adobe Inc.") and $entry.status : "trusted") and
not _arraysearch(process.thread.Ext.call_stack, $entry, $entry.callsite_trailing_bytes : "85c00f856a010000b84d5a00006639070f855c0100004889b424a8000000488d45e84863773c4c8d45e04803f748c745e00801000041b920000000488975d848") and
not (process.parent.executable : "C:\\Program Files (x86)\\Outline\\OutlineService.exe" and process.executable : "C:\\Windows\\SysWOW64\\netsh.exe") and
not (process.parent.executable : ("C:\\Program Files (x86)\\CyberCNSAgentV2\\cybercnsagentv2.exe", "C:\\Program Files (x86)\\CyberCNSAgent\\cybercnsagent.exe") and
process.executable : "C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe") and
not _arraysearch(process.thread.Ext.call_stack, $entry,
$entry.symbol_info like ("c:\\windows\\system32\\ntdll.dll!LdrResolveDelayLoadedAPI*",
"c:\\windows\\system32\\ntdll.dll!LdrShutdownProcess*"))
'''
min_endpoint_version = "8.10.0"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1055"
name = "Process Injection"
reference = "https://attack.mitre.org/techniques/T1055/"
[threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
[internal]
min_endpoint_version = "8.10.0"
Stages and Predicates
Stage 1: api
api where process.Ext.api.name == "VirtualProtect" and process.executable != null and
process.Ext.api.parameters.protection == "R--" and process.Ext.api.parameters.protection_old == "R-X" and
process.thread.Ext.call_stack_summary : "?*" and
not (process.code_signature.subject_name : ("Electronic Arts, Inc.", "Activision Publishing Inc") and process.code_signature.trusted == true) and
process.thread.Ext.call_stack_final_user_module.name : "Unbacked" and
not process.thread.Ext.call_stack_final_user_module.name : ("Kernel", "Unknown", "Undetermined") and
not process.thread.Ext.call_stack_final_user_module.protection_provenance like ("Kernel", "Kernel|*", "hmpalert.dll", "Unknown", "Unbacked") and
not _arraysearch(process.thread.Ext.call_stack, $entry, $entry.protection_provenance : ("Kernel", "Kernel|*")) and
not process.thread.Ext.call_stack_final_user_module.path :
("?:\\windows\\system32\\apphelp.dll",
"?:\\windows\\syswow64\\apphelp.dll",
"?:\\windows\\microsoft.net\\framework*\\clr.dll",
"?:\\program files\\dotnet\\shared\\microsoft.netcore.app\\*\\coreclr.dll") and
not process.thread.Ext.call_stack_final_user_module.hash.sha256 :
("f7c78dba07128af325d8da99138ebf78be163ecfb5da5b01fa6b65b96efecef1",
"ca6079aadef0e98ee94f59babe8d67c0412829a42581c7884659a2737833b83e",
"14ddc0fed1748f89318fbdc59c092e9891feffe5175ef22991b6a794fe539dc3",
"6ad6c03ac893bce8aeb65362c7615b7c74d457276ce6bdcde40a110178267fa3",
"f7c78dba07128af325d8da99138ebf78be163ecfb5da5b01fa6b65b96efecef1",
"e0f97f4ca158dc6de279467dd469b7d9da6613de64c7e5ed34bdd9d358dd8a90",
"b8962adcfb27934ff93f7fffe306e1f01b9342305e883443896204e24c68290b") and
not (process.code_signature.trusted == true and process.code_signature.subject_name : "Roblox Corporation") and
not _arraysearch(process.thread.Ext.call_stack_final_user_module.code_signature,
$entry, $entry.subject_name: ("Bitdefender SRL", "Google LLC", "Mozilla Corporation", "Adobe Inc.") and $entry.status : "trusted") and
not _arraysearch(process.thread.Ext.call_stack, $entry, $entry.callsite_trailing_bytes : "85c00f856a010000b84d5a00006639070f855c0100004889b424a8000000488d45e84863773c4c8d45e04803f748c745e00801000041b920000000488975d848") and
not (process.parent.executable : "C:\\Program Files (x86)\\Outline\\OutlineService.exe" and process.executable : "C:\\Windows\\SysWOW64\\netsh.exe") and
not (process.parent.executable : ("C:\\Program Files (x86)\\CyberCNSAgentV2\\cybercnsagentv2.exe", "C:\\Program Files (x86)\\CyberCNSAgent\\cybercnsagent.exe") and
process.executable : "C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe") and
not _arraysearch(process.thread.Ext.call_stack, $entry,
$entry.symbol_info like ("c:\\windows\\system32\\ntdll.dll!LdrResolveDelayLoadedAPI*",
"c:\\windows\\system32\\ntdll.dll!LdrShutdownProcess*"))
Indicators
These rows show field, operator, and value matches.
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.thread.Ext.call_stack_final_user_module.code_signature | array_any | excludes:process.thread.Ext.call_stack_final_user_module.code_signature | |
process.code_signature.subject_name | eq | Electronic Arts, Inc., Activision Publishing Inc | excludes:process.code_signature.subject_name field:"process.code_signature.subject_name" value:"Electronic Arts, Inc." field:"process.code_signature.subject_name" value:"Activision Publishing Inc" |
process.code_signature.trusted | eq | true | excludes:process.code_signature.trusted field:"process.code_signature.trusted" value:"true" |
process.code_signature.subject_name | eq | Roblox Corporation | excludes:process.code_signature.subject_name field:"process.code_signature.subject_name" value:"Roblox Corporation" |
process.executable | eq | C:\Windows\SysWOW64\netsh.exe | excludes:process.executable field:"process.executable" value:"C:\Windows\SysWOW64\netsh.exe" |
process.parent.executable | eq | C:\Program Files (x86)\Outline\OutlineService.exe | excludes:process.parent.executable field:"process.parent.executable" value:"C:\Program Files (x86)\Outline\OutlineService.exe" |
process.executable | eq | C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe | excludes:process.executable field:"process.executable" value:"C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" |
process.parent.executable | eq | C:\Program Files (x86)\CyberCNSAgentV2\cybercnsagentv2.exe, C:\Program Files (x86)\CyberCNSAgent\cybercnsagent.exe | excludes:process.parent.executable field:"process.parent.executable" value:"C:\Program Files (x86)\CyberCNSAgentV2\cybercnsagentv2.exe" field:"process.parent.executable" value:"C:\Program Files (x86)\CyberCNSAgent\cybercnsagent.exe" |
process.thread.Ext.call_stack | array_any | excludes:process.thread.Ext.call_stack | |
process.thread.Ext.call_stack_final_user_module.hash.sha256 | eq | f7c78dba07128af325d8da99138ebf78be163ecfb5da5b01fa6b65b96efecef1, ca6079aadef0e98ee94f59babe8d67c0412829a42581c7884659a2737833b83e, 14ddc0fed1748f89318fbdc59c092e9891feffe5175ef22991b6a794fe539dc3, 6ad6c03ac893bce8aeb65362c7615b7c74d457276ce6bdcde40a110178267fa3, f7c78dba07128af325d8da99138ebf78be163ecfb5da5b01fa6b65b96efecef1, e0f97f4ca158dc6de279467dd469b7d9da6613de64c7e5ed34bdd9d358dd8a90, b8962adcfb27934ff93f7fffe306e1f01b9342305e883443896204e24c68290b | excludes:process.thread.Ext.call_stack_final_user_module.hash.sha256 |
process.thread.Ext.call_stack_final_user_module.name | eq | Kernel, Unknown, Undetermined | excludes:process.thread.Ext.call_stack_final_user_module.name field:"process.thread.Ext.call_stack_final_user_module.name" value:"Kernel" field:"process.thread.Ext.call_stack_final_user_module.name" value:"Unknown" field:"process.thread.Ext.call_stack_final_user_module.name" value:"Undetermined" |
process.thread.Ext.call_stack_final_user_module.path | wildcard | ?:\windows\system32\apphelp.dll, ?:\windows\syswow64\apphelp.dll, ?:\windows\microsoft.net\framework*\clr.dll, ?:\program files\dotnet\shared\microsoft.netcore.app\*\coreclr.dll | excludes:process.thread.Ext.call_stack_final_user_module.path |
process.thread.Ext.call_stack_final_user_module.protection_provenance | wildcard | Kernel, Kernel|*, hmpalert.dll, Unknown, Unbacked | excludes:process.thread.Ext.call_stack_final_user_module.protection_provenance |
Suspicious Microsoft HTML Help Descendant
#Identifies when the Microsoft HTML Help Executable (hh.exe) creates a suspicious child process. Adversaries may conceal malicious code in a CHM file and deliver it to a victim for execution.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Initial Access | |
| Stealth |
Rule Body
[rule]
description = """
Identifies when the Microsoft HTML Help Executable (hh.exe) creates a suspicious child process. Adversaries may conceal
malicious code in a CHM file and deliver it to a victim for execution.
"""
id = "f79a18a4-e8d8-481f-bf66-04941f7b549a"
license = "Elastic License v2"
name = "Suspicious Microsoft HTML Help Descendant"
os_list = ["windows"]
reference = ["https://attack.mitre.org/techniques/T1218/001/"]
version = "1.0.5"
query = '''
process where event.action == "start" and
process.parent.executable : "?:\\Windows\\hh.exe" and
(
process.name : ("wscript.exe", "cscript.exe", "cmd.exe", "powershell.exe", "rundll32.exe",
"regsvr32.exe", "mshta.exe", "msiexec.exe", "msbuild.exe", "conhost.exe", "curl.exe", "xcopy.exe", "expand.exe") or
(process.Ext.relative_file_creation_time <= 500 and (process.code_signature.trusted == false or process.code_signature.exists == false)) or
process.pe.original_file_name: ("wscript.exe", "cscript.exe", "cmd.exe", "powershell.exe", "rundll32.exe",
"regsvr32.exe", "mshta.exe", "msiexec.exe", "msbuild.exe", "conhost.exe", "curl.exe", "xcopy.exe", "expand.exe")
) and
not (process.executable : "C:\\Windows\\system32\\conhost.exe" and
process.command_line : "\\??\\C:\\Windows\\system32\\conhost.exe 0xffffffff -ForceV1") and
not process.hash.sha256 in ("4535320c5b9596a6210109f68c647dbdbd0289ba63286fd389dea910855491f1",
"9440e89e0ea081e3016d6c604a746c74ffd0dbbf5c4c1e03d544a5128d6e1ade",
"7902fc0d4483b5bffed560455539f1dd0ea26380318ca4d5e04e5c8c4a7e545d",
"cb35afb097cf36892dead09b39ea8dbe2d552daf9b489843e8835e9d7715e418") and
not (process.executable : ("C:\\Windows\\SysWOW64\\cmd.exe", "C:\\Windows\\SysWOW64\\regsvr32.exe", "C:\\Windows\\SysWOW64\\*\\powershell.exe") and
not process.parent.name : "hh.exe")
'''
min_endpoint_version = "8.4.0"
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
tree = true
[[actions]]
action = "kill_process"
field = "process.parent.entity_id"
state = 0
tree = true
[[optional_actions]]
action = "rollback"
field = "process.entity_id"
state = 0
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1566"
name = "Phishing"
reference = "https://attack.mitre.org/techniques/T1566/"
[[threat.technique.subtechnique]]
id = "T1566.001"
name = "Spearphishing Attachment"
reference = "https://attack.mitre.org/techniques/T1566/001/"
[threat.tactic]
id = "TA0001"
name = "Initial Access"
reference = "https://attack.mitre.org/tactics/TA0001/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1218"
name = "System Binary Proxy Execution"
reference = "https://attack.mitre.org/techniques/T1218/"
[[threat.technique.subtechnique]]
id = "T1218.001"
name = "Compiled HTML File"
reference = "https://attack.mitre.org/techniques/T1218/001/"
[threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
[internal]
min_endpoint_version = "8.4.0"
Stages and Predicates
Stage 1: process
process where event.action == "start" and
process.parent.executable : "?:\\Windows\\hh.exe" and
(
process.name : ("wscript.exe", "cscript.exe", "cmd.exe", "powershell.exe", "rundll32.exe",
"regsvr32.exe", "mshta.exe", "msiexec.exe", "msbuild.exe", "conhost.exe", "curl.exe", "xcopy.exe", "expand.exe") or
(process.Ext.relative_file_creation_time <= 500 and (process.code_signature.trusted == false or process.code_signature.exists == false)) or
process.pe.original_file_name: ("wscript.exe", "cscript.exe", "cmd.exe", "powershell.exe", "rundll32.exe",
"regsvr32.exe", "mshta.exe", "msiexec.exe", "msbuild.exe", "conhost.exe", "curl.exe", "xcopy.exe", "expand.exe")
) and
not (process.executable : "C:\\Windows\\system32\\conhost.exe" and
process.command_line : "\\??\\C:\\Windows\\system32\\conhost.exe 0xffffffff -ForceV1") and
not process.hash.sha256 in ("4535320c5b9596a6210109f68c647dbdbd0289ba63286fd389dea910855491f1",
"9440e89e0ea081e3016d6c604a746c74ffd0dbbf5c4c1e03d544a5128d6e1ade",
"7902fc0d4483b5bffed560455539f1dd0ea26380318ca4d5e04e5c8c4a7e545d",
"cb35afb097cf36892dead09b39ea8dbe2d552daf9b489843e8835e9d7715e418") and
not (process.executable : ("C:\\Windows\\SysWOW64\\cmd.exe", "C:\\Windows\\SysWOW64\\regsvr32.exe", "C:\\Windows\\SysWOW64\\*\\powershell.exe") and
not process.parent.name : "hh.exe")
Indicators
These rows show field, operator, and value matches.
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.parent.name | eq | hh.exe | excludes:process.parent.name field:"process.parent.name" value:"hh.exe" |
process.executable | wildcard | C:\Windows\SysWOW64\cmd.exe, C:\Windows\SysWOW64\regsvr32.exe, C:\Windows\SysWOW64\*\powershell.exe | excludes:process.executable field:"process.executable" value:"C:\Windows\SysWOW64\cmd.exe" field:"process.executable" value:"C:\Windows\SysWOW64\regsvr32.exe" field:"process.executable" value:"C:\Windows\SysWOW64\*\powershell.exe" |
process.command_line | eq | \??\C:\Windows\system32\conhost.exe 0xffffffff -ForceV1 | excludes:process.command_line field:"process.command_line" value:"\??\C:\Windows\system32\conhost.exe 0xffffffff -ForceV1" |
process.executable | eq | C:\Windows\system32\conhost.exe | excludes:process.executable field:"process.executable" value:"C:\Windows\system32\conhost.exe" |
process.hash.sha256 | in | 4535320c5b9596a6210109f68c647dbdbd0289ba63286fd389dea910855491f1, 7902fc0d4483b5bffed560455539f1dd0ea26380318ca4d5e04e5c8c4a7e545d, 9440e89e0ea081e3016d6c604a746c74ffd0dbbf5c4c1e03d544a5128d6e1ade, cb35afb097cf36892dead09b39ea8dbe2d552daf9b489843e8835e9d7715e418 | excludes:process.hash.sha256 |
System Binary Proxy Execution via ld.so
#This rule detects the execution of a binary through the ld.so dynamic linker. Attackers may use this technique to execute binaries while attempting to evade detection.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Execution | |
| Stealth |
Rule Body
[rule]
description = """
This rule detects the execution of a binary through the ld.so dynamic linker. Attackers may use this technique to
execute binaries while attempting to evade detection.
"""
id = "10cb6563-35a9-45b7-a394-e7bca6fd5bed"
license = "Elastic License v2"
name = "System Binary Proxy Execution via ld.so"
os_list = ["linux"]
reference = ["https://gtfobins.github.io/gtfobins/ld.so/"]
version = "1.0.7"
query = '''
process where event.type == "start" and event.action == "exec" and process.parent.executable like (
"/lib/ld-linux*.so*", "/lib64/ld-linux*.so*", "/usr/lib/ld-linux*.so*", "/usr/lib64/ld-linux*.so*"
) and not (
process.executable in ("/usr/bin/uptime", "/usr/bin/xkbcomp") or
process.parent.command_line like ("*/home/*/JetBrains/*", "*/snap/intellij-idea-ultimate*") or
process.command_line like "sh -c*/usr/bin/xkbcomp*" or
process.working_directory like ("/users/*/.cache/JetBrains/*", "/var/tmp/mkinitramfs*", "/home/adoagent") or
process.command_line == "/usr/bin/python3.9 -V" or
process.args like "/users/*/.cache/JetBrains/*"
)
'''
min_endpoint_version = "7.15.0"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
[[actions]]
action = "kill_process"
field = "process.parent.entity_id"
state = 0
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1059"
name = "Command and Scripting Interpreter"
reference = "https://attack.mitre.org/techniques/T1059/"
[[threat.technique.subtechnique]]
id = "T1059.004"
name = "Unix Shell"
reference = "https://attack.mitre.org/techniques/T1059/004/"
[threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1218"
name = "System Binary Proxy Execution"
reference = "https://attack.mitre.org/techniques/T1218/"
[threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
[internal]
min_endpoint_version = "7.15.0"
Stages and Predicates
Stage 1: process
process where event.type == "start" and event.action == "exec" and process.parent.executable like (
"/lib/ld-linux*.so*", "/lib64/ld-linux*.so*", "/usr/lib/ld-linux*.so*", "/usr/lib64/ld-linux*.so*"
) and not (
process.executable in ("/usr/bin/uptime", "/usr/bin/xkbcomp") or
process.parent.command_line like ("*/home/*/JetBrains/*", "*/snap/intellij-idea-ultimate*") or
process.command_line like "sh -c*/usr/bin/xkbcomp*" or
process.working_directory like ("/users/*/.cache/JetBrains/*", "/var/tmp/mkinitramfs*", "/home/adoagent") or
process.command_line == "/usr/bin/python3.9 -V" or
process.args like "/users/*/.cache/JetBrains/*"
)
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.parent.executable | wildcard |
| field:"ParentImage" kind:wildcard |
Exclusions
The rule actively suppresses these predicates.
Uncommon Registry Persistence Change
#Detects changes to registry persistence keys that are not commonly used or modified by legitimate programs. This could be an indication of an adversary's attempt to persist in a stealthy manner.
MITRE ATT&CK Coverage
Telemetry Coverage
Rule Body
[metadata]
creation_date = "2020/11/18"
integration = ["endpoint", "windows"]
maturity = "production"
updated_date = "2026/05/04"
[rule]
author = ["Elastic"]
description = """
Detects changes to registry persistence keys that are not commonly used or modified by legitimate programs. This could
be an indication of an adversary's attempt to persist in a stealthy manner.
"""
from = "now-9m"
index = ["logs-endpoint.events.registry-*", "logs-windows.sysmon_operational-*", "winlogbeat-*"]
language = "eql"
license = "Elastic License v2"
name = "Uncommon Registry Persistence Change"
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 Uncommon Registry Persistence Change
Windows Registry is a critical system database storing configuration settings. Adversaries exploit registry keys for persistence, ensuring malicious code executes on startup or during specific events. The detection rule identifies unusual modifications to less commonly altered registry keys, which may indicate stealthy persistence attempts. It filters out benign changes by excluding known legitimate processes and paths, focusing on suspicious alterations.
### Possible investigation steps
- Review the specific registry path and value that triggered the alert to understand the context of the change and its potential impact on system behavior.
- Identify the process responsible for the registry modification by examining the process.name and process.executable fields, and determine if it is a known legitimate process or potentially malicious.
- Check the registry.data.strings field to see the new data or command being set in the registry key, and assess whether it aligns with known legitimate software or suspicious activity.
- Investigate the user account associated with the registry change by reviewing the HKEY_USERS path, if applicable, to determine if the change was made by an authorized user or an unexpected account.
- Correlate the alert with other recent events on the host, such as file modifications or network connections, to identify any additional indicators of compromise or related suspicious activity.
- Consult threat intelligence sources or databases to see if the registry path or process involved is associated with known malware or adversary techniques.
### False positive analysis
- Legitimate software installations or updates may modify registry keys for setup or configuration purposes. Users can create exceptions for known software paths like C:\\Program Files\\*.exe to reduce noise.
- System maintenance processes such as Windows Update might trigger changes in registry keys like SetupExecute. Exclude processes like TiWorker.exe and poqexec.exe when they match known update patterns.
- Administrative scripts or tools that automate system configurations can alter registry keys. Identify and exclude these scripts by their executable paths or process names to prevent false alerts.
- Security software, including antivirus or endpoint protection, may interact with registry keys for monitoring purposes. Exclude paths related to these tools, such as C:\\ProgramData\\Microsoft\\Windows Defender\\Platform\\*\\MsMpEng.exe, to avoid false positives.
- User-initiated changes through control panel settings or personalization options can affect registry keys like SCRNSAVE.EXE. Exclude common system paths like %windir%\\system32\\rundll32.exe user32.dll,LockWorkStation to minimize false detections.
### Response and remediation
- Isolate the affected system from the network to prevent further spread of potential malicious activity.
- Terminate any suspicious processes identified in the alert, particularly those not matching known legitimate executables or paths.
- Restore any altered registry keys to their original state using a known good backup or by manually resetting them to default values.
- Conduct a thorough scan of the affected system using updated antivirus or endpoint detection and response (EDR) tools to identify and remove any additional malicious files or processes.
- Review and update endpoint protection policies to ensure that similar registry changes are monitored and alerted on in the future.
- Escalate the incident to the security operations center (SOC) or incident response team for further investigation and to determine if additional systems are affected.
- Document the incident, including all actions taken, to improve future response efforts and update threat intelligence databases."""
references = [
"https://www.microsoftpressstore.com/articles/article.aspx?p=2762082&seqNum=2",
"https://github.com/rad9800/BootExecuteEDR",
]
risk_score = 47
rule_id = "54902e45-3467-49a4-8abc-529f2c8cfb80"
severity = "medium"
tags = [
"Domain: Endpoint",
"OS: Windows",
"Use Case: Threat Detection",
"Tactic: Persistence",
"Data Source: Elastic Defend",
"Data Source: Sysmon",
"Resources: Investigation Guide",
]
timeline_id = "3e47ef71-ebfc-4520-975c-cb27fc090799"
timeline_title = "Comprehensive Registry Timeline"
timestamp_override = "event.ingested"
type = "eql"
query = '''
registry where host.os.type == "windows" and event.type == "change" and
length(registry.data.strings) > 0 and
registry.path : (
"HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Terminal Server\\Install\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run\\*",
"HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Terminal Server\\Install\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Runonce\\*",
"HKEY_USERS\\*\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Windows\\Load",
"HKEY_USERS\\*\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Windows\\Run",
"HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Windows\\IconServiceLib",
"HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon\\Shell",
"HKEY_USERS\\*\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon\\Shell",
"HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon\\AppSetup",
"HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon\\Taskman",
"HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon\\Userinit",
"HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon\\VmApplet",
"HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\\Run\\*",
"HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System\\Shell",
"HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows\\System\\Scripts\\Logoff\\Script",
"HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows\\System\\Scripts\\Logon\\Script",
"HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows\\System\\Scripts\\Shutdown\\Script",
"HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows\\System\\Scripts\\Startup\\Script",
"HKEY_USERS\\*\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\\Run\\*",
"HKEY_USERS\\*\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System\\Shell",
"HKEY_USERS\\*\\SOFTWARE\\Policies\\Microsoft\\Windows\\System\\Scripts\\Logoff\\Script",
"HKEY_USERS\\*\\SOFTWARE\\Policies\\Microsoft\\Windows\\System\\Scripts\\Logon\\Script",
"HKEY_USERS\\*\\SOFTWARE\\Policies\\Microsoft\\Windows\\System\\Scripts\\Shutdown\\Script",
"HKEY_USERS\\*\\SOFTWARE\\Policies\\Microsoft\\Windows\\System\\Scripts\\Startup\\Script",
"HKLM\\SOFTWARE\\Microsoft\\Active Setup\\Installed Components\\*\\ShellComponent",
"HKLM\\SOFTWARE\\Microsoft\\Windows CE Services\\AutoStartOnConnect\\MicrosoftActiveSync",
"HKLM\\SOFTWARE\\Microsoft\\Windows CE Services\\AutoStartOnDisconnect\\MicrosoftActiveSync",
"HKLM\\SOFTWARE\\Microsoft\\Ctf\\LangBarAddin\\*\\FilePath",
"HKLM\\SOFTWARE\\Microsoft\\Internet Explorer\\Extensions\\*\\Exec",
"HKLM\\SOFTWARE\\Microsoft\\Internet Explorer\\Extensions\\*\\Script",
"HKLM\\SOFTWARE\\Microsoft\\Command Processor\\Autorun",
"HKEY_USERS\\*\\SOFTWARE\\Microsoft\\Ctf\\LangBarAddin\\*\\FilePath",
"HKEY_USERS\\*\\SOFTWARE\\Microsoft\\Internet Explorer\\Extensions\\*\\Exec",
"HKEY_USERS\\*\\SOFTWARE\\Microsoft\\Internet Explorer\\Extensions\\*\\Script",
"HKEY_USERS\\*\\SOFTWARE\\Microsoft\\Command Processor\\Autorun",
"HKEY_USERS\\*\\Control Panel\\Desktop\\scrnsave.exe",
"HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Image File Execution Options\\*\\VerifierDlls",
"HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon\\GpExtensions\\*\\DllName",
"HKLM\\SYSTEM\\ControlSet*\\Control\\SafeBoot\\AlternateShell",
"HKLM\\SYSTEM\\ControlSet*\\Control\\Terminal Server\\Wds\\rdpwd\\StartupPrograms",
"HKLM\\SYSTEM\\ControlSet*\\Control\\Terminal Server\\WinStations\\RDP-Tcp\\InitialProgram",
"HKLM\\SYSTEM\\ControlSet*\\Control\\Session Manager\\BootExecute",
"HKLM\\SYSTEM\\ControlSet*\\Control\\Session Manager\\BootExecuteNoPnpSync",
"HKLM\\SYSTEM\\ControlSet*\\Control\\Session Manager\\SetupExecute",
"HKLM\\SYSTEM\\ControlSet*\\Control\\Session Manager\\SetupExecuteNoPnpSync",
"HKLM\\SYSTEM\\ControlSet*\\Control\\Session Manager\\PlatformExecute",
"HKLM\\SYSTEM\\ControlSet*\\Control\\Session Manager\\Execute",
"HKLM\\SYSTEM\\ControlSet*\\Control\\Session Manager\\S0InitialCommand",
"HKLM\\SYSTEM\\ControlSet*\\Control\\ServiceControlManagerExtension",
"HKLM\\SYSTEM\\ControlSet*\\Control\\BootVerificationProgram\\ImagePath",
"HKLM\\SYSTEM\\Setup\\CmdLine",
"HKEY_USERS\\*\\Environment\\UserInitMprLogonScript") and
not registry.data.strings : ("C:\\Windows\\system32\\userinit.exe", "cmd.exe", "C:\\Program Files (x86)\\*.exe",
"C:\\Program Files\\*.exe") and
not (process.name : "rundll32.exe" and registry.path : "*\\Software\\Microsoft\\Internet Explorer\\Extensions\\*\\Script") and
not process.executable : ("C:\\Windows\\System32\\msiexec.exe",
"C:\\Windows\\SysWOW64\\msiexec.exe",
"C:\\ProgramData\\Microsoft\\Windows Defender\\Platform\\*\\MsMpEng.exe",
"C:\\Program Files\\*.exe",
"C:\\Program Files (x86)\\*.exe") and
not (process.name : ("TiWorker.exe", "poqexec.exe") and registry.value : "SetupExecute" and
registry.data.strings : (
"C:\\windows\\System32\\poqexec.exe /display_progress \\SystemRoot\\WinSxS\\pending.xml",
"C:\\Windows\\System32\\poqexec.exe /skip_critical_poq /display_progress \\SystemRoot\\WinSxS\\pending.xml"
)
) and
not (process.name : "svchost.exe" and registry.value : "SCRNSAVE.EXE" and
registry.data.strings : (
"%windir%\\system32\\rundll32.exe user32.dll,LockWorkStation",
"scrnsave.scr",
"%windir%\\system32\\Ribbons.scr"
)
)
'''
setup = """## Setup
This rule is designed for data generated by [Elastic Defend](https://www.elastic.co/security/endpoint-security), which provides native endpoint detection and response, along with event enrichments designed to work with our detection rules.
Setup instructions: https://ela.st/install-elastic-defend
### Additional data sources
This rule also supports the following third-party data sources. For setup instructions, refer to the links below:
- [Sysmon Registry Events](https://ela.st/sysmon-event-reg-setup)
"""
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1037"
name = "Boot or Logon Initialization Scripts"
reference = "https://attack.mitre.org/techniques/T1037/"
[[rule.threat.technique]]
id = "T1176"
name = "Software Extensions"
reference = "https://attack.mitre.org/techniques/T1176/"
[[rule.threat.technique]]
id = "T1546"
name = "Event Triggered Execution"
reference = "https://attack.mitre.org/techniques/T1546/"
[[rule.threat.technique.subtechnique]]
id = "T1546.002"
name = "Screensaver"
reference = "https://attack.mitre.org/techniques/T1546/002/"
[[rule.threat.technique.subtechnique]]
id = "T1546.012"
name = "Image File Execution Options Injection"
reference = "https://attack.mitre.org/techniques/T1546/012/"
[[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.technique.subtechnique]]
id = "T1547.014"
name = "Active Setup"
reference = "https://attack.mitre.org/techniques/T1547/014/"
[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
length(registry.data.strings) > 0 and
registry.path : (
"HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Terminal Server\\Install\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run\\*",
"HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Terminal Server\\Install\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Runonce\\*",
"HKEY_USERS\\*\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Windows\\Load",
"HKEY_USERS\\*\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Windows\\Run",
"HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Windows\\IconServiceLib",
"HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon\\Shell",
"HKEY_USERS\\*\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon\\Shell",
"HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon\\AppSetup",
"HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon\\Taskman",
"HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon\\Userinit",
"HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon\\VmApplet",
"HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\\Run\\*",
"HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System\\Shell",
"HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows\\System\\Scripts\\Logoff\\Script",
"HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows\\System\\Scripts\\Logon\\Script",
"HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows\\System\\Scripts\\Shutdown\\Script",
"HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows\\System\\Scripts\\Startup\\Script",
"HKEY_USERS\\*\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\\Run\\*",
"HKEY_USERS\\*\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System\\Shell",
"HKEY_USERS\\*\\SOFTWARE\\Policies\\Microsoft\\Windows\\System\\Scripts\\Logoff\\Script",
"HKEY_USERS\\*\\SOFTWARE\\Policies\\Microsoft\\Windows\\System\\Scripts\\Logon\\Script",
"HKEY_USERS\\*\\SOFTWARE\\Policies\\Microsoft\\Windows\\System\\Scripts\\Shutdown\\Script",
"HKEY_USERS\\*\\SOFTWARE\\Policies\\Microsoft\\Windows\\System\\Scripts\\Startup\\Script",
"HKLM\\SOFTWARE\\Microsoft\\Active Setup\\Installed Components\\*\\ShellComponent",
"HKLM\\SOFTWARE\\Microsoft\\Windows CE Services\\AutoStartOnConnect\\MicrosoftActiveSync",
"HKLM\\SOFTWARE\\Microsoft\\Windows CE Services\\AutoStartOnDisconnect\\MicrosoftActiveSync",
"HKLM\\SOFTWARE\\Microsoft\\Ctf\\LangBarAddin\\*\\FilePath",
"HKLM\\SOFTWARE\\Microsoft\\Internet Explorer\\Extensions\\*\\Exec",
"HKLM\\SOFTWARE\\Microsoft\\Internet Explorer\\Extensions\\*\\Script",
"HKLM\\SOFTWARE\\Microsoft\\Command Processor\\Autorun",
"HKEY_USERS\\*\\SOFTWARE\\Microsoft\\Ctf\\LangBarAddin\\*\\FilePath",
"HKEY_USERS\\*\\SOFTWARE\\Microsoft\\Internet Explorer\\Extensions\\*\\Exec",
"HKEY_USERS\\*\\SOFTWARE\\Microsoft\\Internet Explorer\\Extensions\\*\\Script",
"HKEY_USERS\\*\\SOFTWARE\\Microsoft\\Command Processor\\Autorun",
"HKEY_USERS\\*\\Control Panel\\Desktop\\scrnsave.exe",
"HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Image File Execution Options\\*\\VerifierDlls",
"HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon\\GpExtensions\\*\\DllName",
"HKLM\\SYSTEM\\ControlSet*\\Control\\SafeBoot\\AlternateShell",
"HKLM\\SYSTEM\\ControlSet*\\Control\\Terminal Server\\Wds\\rdpwd\\StartupPrograms",
"HKLM\\SYSTEM\\ControlSet*\\Control\\Terminal Server\\WinStations\\RDP-Tcp\\InitialProgram",
"HKLM\\SYSTEM\\ControlSet*\\Control\\Session Manager\\BootExecute",
"HKLM\\SYSTEM\\ControlSet*\\Control\\Session Manager\\BootExecuteNoPnpSync",
"HKLM\\SYSTEM\\ControlSet*\\Control\\Session Manager\\SetupExecute",
"HKLM\\SYSTEM\\ControlSet*\\Control\\Session Manager\\SetupExecuteNoPnpSync",
"HKLM\\SYSTEM\\ControlSet*\\Control\\Session Manager\\PlatformExecute",
"HKLM\\SYSTEM\\ControlSet*\\Control\\Session Manager\\Execute",
"HKLM\\SYSTEM\\ControlSet*\\Control\\Session Manager\\S0InitialCommand",
"HKLM\\SYSTEM\\ControlSet*\\Control\\ServiceControlManagerExtension",
"HKLM\\SYSTEM\\ControlSet*\\Control\\BootVerificationProgram\\ImagePath",
"HKLM\\SYSTEM\\Setup\\CmdLine",
"HKEY_USERS\\*\\Environment\\UserInitMprLogonScript") and
not registry.data.strings : ("C:\\Windows\\system32\\userinit.exe", "cmd.exe", "C:\\Program Files (x86)\\*.exe",
"C:\\Program Files\\*.exe") and
not (process.name : "rundll32.exe" and registry.path : "*\\Software\\Microsoft\\Internet Explorer\\Extensions\\*\\Script") and
not process.executable : ("C:\\Windows\\System32\\msiexec.exe",
"C:\\Windows\\SysWOW64\\msiexec.exe",
"C:\\ProgramData\\Microsoft\\Windows Defender\\Platform\\*\\MsMpEng.exe",
"C:\\Program Files\\*.exe",
"C:\\Program Files (x86)\\*.exe") and
not (process.name : ("TiWorker.exe", "poqexec.exe") and registry.value : "SetupExecute" and
registry.data.strings : (
"C:\\windows\\System32\\poqexec.exe /display_progress \\SystemRoot\\WinSxS\\pending.xml",
"C:\\Windows\\System32\\poqexec.exe /skip_critical_poq /display_progress \\SystemRoot\\WinSxS\\pending.xml"
)
) and
not (process.name : "svchost.exe" and registry.value : "SCRNSAVE.EXE" and
registry.data.strings : (
"%windir%\\system32\\rundll32.exe user32.dll,LockWorkStation",
"scrnsave.scr",
"%windir%\\system32\\Ribbons.scr"
)
)
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.type | eq |
| field:"event.type" kind:eq value:"change" |
registry.path | wildcard |
| field:"TargetObject" kind:wildcard |
Exclusions
The rule actively suppresses these predicates.
Unsigned DLL Loaded by a Trusted Process
#Identifies digitally signed (trusted) processes loading unsigned DLLs. Attackers may plant their payloads into the application folder and invoke the legitimate application to execute the payload, masking actions they perform under a legitimate, trusted, and potentially elevated system or software process.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Stealth |
Telemetry Coverage
| Provider | Record / event type |
|---|---|
| Sysmon | Event ID 7: Image loaded |
Rule Body
[metadata]
creation_date = "2023/07/12"
integration = ["endpoint"]
maturity = "production"
updated_date = "2026/03/24"
[rule]
author = ["Elastic"]
building_block_type = "default"
description = """
Identifies digitally signed (trusted) processes loading unsigned DLLs. Attackers may plant their payloads into the
application folder and invoke the legitimate application to execute the payload, masking actions they perform under a
legitimate, trusted, and potentially elevated system or software process.
"""
from = "now-119m"
index = ["logs-endpoint.events.library-*"]
interval = "60m"
language = "eql"
license = "Elastic License v2"
name = "Unsigned DLL Loaded by a Trusted Process"
risk_score = 21
rule_id = "c20cd758-07b1-46a1-b03f-fa66158258b8"
severity = "low"
tags = [
"Domain: Endpoint",
"OS: Windows",
"Use Case: Threat Detection",
"Tactic: Defense Evasion",
"Rule Type: BBR",
"Data Source: Elastic Defend",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
library where host.os.type == "windows" and
(dll.Ext.relative_file_creation_time <= 500 or
dll.Ext.relative_file_name_modify_time <= 500 or
dll.Ext.device.product_id : ("Virtual DVD-ROM", "Virtual Disk")) and dll.hash.sha256 != null and
process.code_signature.status :"trusted" and not dll.code_signature.status : ("trusted", "errorExpired", "errorCode_endpoint*") and
/* DLL loaded from the process.executable current directory */
endswith~(substring(dll.path, 0, length(dll.path) - (length(dll.name) + 1)), substring(process.executable, 0, length(process.executable) - (length(process.name) + 1)))
and not user.id : "S-1-5-18" and
not dll.hash.sha256 : (
"19588e6a318894abe8094374bee233e666f319de909c69f12a6047b14473e299",
"6e8bee250c8cc1b65150522f33794759f5c65f58fff17c5cbf6422ad68b421d2",
"55de11531dc0e566cb91f26e48d1301a161a4b8b24abed42304d711412368760",
"56a5148d00c2d9e58415be2d64eca922a58063fe26d9af1c87084aa383c9058e",
"83ee0ff920144edb2c2f4ea10130f55443493290886985a63233fa2431e450f9",
"0d0d8f2eaff6b5f75e63d9721d5a0480b30e70792fe0d3a24d76fd3e61b05982",
"8b6ce3a640e2d6f36b0001be2a1abb765ae51e62c314a15911e75138cbb544bb",
"ea02a19dd824cb7d611b8821d1b9e6a076714a195d027d1ff918128a64ac5220",
"02a6d001e6dd944738e09b720e49dcb1272cb782b870e5ae319d4600bc192225",
"e7714a1d6ac3f4c4ae22564b9ca301e486f5f42691859c0a687246c47b5cf5c9",
"17f0f709fb7f6190c03b19b6198fd863b6f0d79f46ccfebac6064be747a4cb3e",
"cb7ab3788d10940df874acd97b1821bbb5ee4a91f3eec11982bb5bf7a3c96443",
"c944ee510721a1d30d42227cc3061dfdcbc144c952381afcfe4f6e82c5435ffc",
"967189adfbc889fde89aafc867f7a1f02731f8592cf6fd5a4ace1929213e2e13",
"4a824526749790603eb66777f79787128dd282162a3904a4c1135de43b14d029",
"620a7e658af05cc848091b8a639854b9b15700a9061b4a3d078523653133a4af",
"cb220267fb0116b298bab6a09a764420d630c52026f7d750f8ffca4818389327",
"0da1f856d92d6b95f10ed8c3f629cd15468c906de9352fb4ae629139d1412eed",
"e1646c7778c24407a17881908037a49ecfcb5a980d155212d544302653a3ef62",
"e102c9c5b22ceb60dc516ab4124bea8ec8e808b08eec48ea7ac674d13fca82ef",
"c7544e1f9927afdf6e8cd7063020b572e60fe8f00af39227eb831d331df38225",
"3668c6749db59a6cbc5293d0a4f904f76d6fb5048704449dd53894916f408a57",
"7705851ba047a8154402aca92621b60be0e0e9d9b52b19bf8be540305bd53dba",
"b5acf358ff97127eac9ef4c664a980b937376b5295ef23d77ee338225de10d60",
"394d2d862f2ddce71f28d9b933b21a7d6c621c80ef28652574f758f77f01f716",
"e958d03db79e9f1d2770c70a5bc24904aa3e2d27a8d5637684cf8166b38908f2",
"284701380f33a30b25e8eb9822e7f47179238e91d08bd3fb5a117145de7e0d8d",
"497471497886f18ca16f7facab7d76dc9bfadd69deb9c6e4ea9bdc0869a15628",
"739bedcfc8eb860927eb2057474be5b39518aaaa6703f9f85307a432fa1f236e",
"8f4c72e3c7de1ab5d894ec7813f65c5298ecafc183f31924b44a427433ffca42",
"1ac4753056179b358132c55ca3086d550849ae30259ba94f334826c2fbf6c57e",
"53e8fecd7d4b1b74064eba9bfa6a361d52929f440954931b4ba65615148bf0ea",
"e9088afd8871dbad5eda47a9d8abf3b08dd2e17c423ba8a05f9b6ad6751f9b7c",
"ab27eb05130db2f92499234b69ff97ee6429c7824efcb7324ae3e404e2b405bf",
"553451008520a5f0110d84192cba40208fb001c27454f946e85e6fb2e6553292"
)
'''
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1574"
name = "Hijack Execution Flow"
reference = "https://attack.mitre.org/techniques/T1574/"
[[rule.threat.technique.subtechnique]]
id = "T1574.001"
name = "DLL"
reference = "https://attack.mitre.org/techniques/T1574/001/"
[rule.threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
Stages and Predicates
Stage 1: library
library where host.os.type == "windows" and
(dll.Ext.relative_file_creation_time <= 500 or
dll.Ext.relative_file_name_modify_time <= 500 or
dll.Ext.device.product_id : ("Virtual DVD-ROM", "Virtual Disk")) and dll.hash.sha256 != null and
process.code_signature.status :"trusted" and not dll.code_signature.status : ("trusted", "errorExpired", "errorCode_endpoint*") and
endswith~(substring(dll.path, 0, length(dll.path) - (length(dll.name) + 1)), substring(process.executable, 0, length(process.executable) - (length(process.name) + 1)))
and not user.id : "S-1-5-18" and
not dll.hash.sha256 : (
"19588e6a318894abe8094374bee233e666f319de909c69f12a6047b14473e299",
"6e8bee250c8cc1b65150522f33794759f5c65f58fff17c5cbf6422ad68b421d2",
"55de11531dc0e566cb91f26e48d1301a161a4b8b24abed42304d711412368760",
"56a5148d00c2d9e58415be2d64eca922a58063fe26d9af1c87084aa383c9058e",
"83ee0ff920144edb2c2f4ea10130f55443493290886985a63233fa2431e450f9",
"0d0d8f2eaff6b5f75e63d9721d5a0480b30e70792fe0d3a24d76fd3e61b05982",
"8b6ce3a640e2d6f36b0001be2a1abb765ae51e62c314a15911e75138cbb544bb",
"ea02a19dd824cb7d611b8821d1b9e6a076714a195d027d1ff918128a64ac5220",
"02a6d001e6dd944738e09b720e49dcb1272cb782b870e5ae319d4600bc192225",
"e7714a1d6ac3f4c4ae22564b9ca301e486f5f42691859c0a687246c47b5cf5c9",
"17f0f709fb7f6190c03b19b6198fd863b6f0d79f46ccfebac6064be747a4cb3e",
"cb7ab3788d10940df874acd97b1821bbb5ee4a91f3eec11982bb5bf7a3c96443",
"c944ee510721a1d30d42227cc3061dfdcbc144c952381afcfe4f6e82c5435ffc",
"967189adfbc889fde89aafc867f7a1f02731f8592cf6fd5a4ace1929213e2e13",
"4a824526749790603eb66777f79787128dd282162a3904a4c1135de43b14d029",
"620a7e658af05cc848091b8a639854b9b15700a9061b4a3d078523653133a4af",
"cb220267fb0116b298bab6a09a764420d630c52026f7d750f8ffca4818389327",
"0da1f856d92d6b95f10ed8c3f629cd15468c906de9352fb4ae629139d1412eed",
"e1646c7778c24407a17881908037a49ecfcb5a980d155212d544302653a3ef62",
"e102c9c5b22ceb60dc516ab4124bea8ec8e808b08eec48ea7ac674d13fca82ef",
"c7544e1f9927afdf6e8cd7063020b572e60fe8f00af39227eb831d331df38225",
"3668c6749db59a6cbc5293d0a4f904f76d6fb5048704449dd53894916f408a57",
"7705851ba047a8154402aca92621b60be0e0e9d9b52b19bf8be540305bd53dba",
"b5acf358ff97127eac9ef4c664a980b937376b5295ef23d77ee338225de10d60",
"394d2d862f2ddce71f28d9b933b21a7d6c621c80ef28652574f758f77f01f716",
"e958d03db79e9f1d2770c70a5bc24904aa3e2d27a8d5637684cf8166b38908f2",
"284701380f33a30b25e8eb9822e7f47179238e91d08bd3fb5a117145de7e0d8d",
"497471497886f18ca16f7facab7d76dc9bfadd69deb9c6e4ea9bdc0869a15628",
"739bedcfc8eb860927eb2057474be5b39518aaaa6703f9f85307a432fa1f236e",
"8f4c72e3c7de1ab5d894ec7813f65c5298ecafc183f31924b44a427433ffca42",
"1ac4753056179b358132c55ca3086d550849ae30259ba94f334826c2fbf6c57e",
"53e8fecd7d4b1b74064eba9bfa6a361d52929f440954931b4ba65615148bf0ea",
"e9088afd8871dbad5eda47a9d8abf3b08dd2e17c423ba8a05f9b6ad6751f9b7c",
"ab27eb05130db2f92499234b69ff97ee6429c7824efcb7324ae3e404e2b405bf",
"553451008520a5f0110d84192cba40208fb001c27454f946e85e6fb2e6553292"
)
Indicators
These rows show field, operator, and value matches.
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
dll.code_signature.status | wildcard | trusted, errorExpired, errorCode_endpoint* | excludes:dll.code_signature.status field:"dll.code_signature.status" value:"trusted" field:"dll.code_signature.status" value:"errorExpired" field:"dll.code_signature.status" value:"errorCode_endpoint*" |
dll.hash.sha256 | eq | 19588e6a318894abe8094374bee233e666f319de909c69f12a6047b14473e299, 6e8bee250c8cc1b65150522f33794759f5c65f58fff17c5cbf6422ad68b421d2, 55de11531dc0e566cb91f26e48d1301a161a4b8b24abed42304d711412368760, 56a5148d00c2d9e58415be2d64eca922a58063fe26d9af1c87084aa383c9058e, 83ee0ff920144edb2c2f4ea10130f55443493290886985a63233fa2431e450f9, 0d0d8f2eaff6b5f75e63d9721d5a0480b30e70792fe0d3a24d76fd3e61b05982, 8b6ce3a640e2d6f36b0001be2a1abb765ae51e62c314a15911e75138cbb544bb, ea02a19dd824cb7d611b8821d1b9e6a076714a195d027d1ff918128a64ac5220, 02a6d001e6dd944738e09b720e49dcb1272cb782b870e5ae319d4600bc192225, e7714a1d6ac3f4c4ae22564b9ca301e486f5f42691859c0a687246c47b5cf5c9, 17f0f709fb7f6190c03b19b6198fd863b6f0d79f46ccfebac6064be747a4cb3e, cb7ab3788d10940df874acd97b1821bbb5ee4a91f3eec11982bb5bf7a3c96443, c944ee510721a1d30d42227cc3061dfdcbc144c952381afcfe4f6e82c5435ffc, 967189adfbc889fde89aafc867f7a1f02731f8592cf6fd5a4ace1929213e2e13, 4a824526749790603eb66777f79787128dd282162a3904a4c1135de43b14d029, 620a7e658af05cc848091b8a639854b9b15700a9061b4a3d078523653133a4af, cb220267fb0116b298bab6a09a764420d630c52026f7d750f8ffca4818389327, 0da1f856d92d6b95f10ed8c3f629cd15468c906de9352fb4ae629139d1412eed, e1646c7778c24407a17881908037a49ecfcb5a980d155212d544302653a3ef62, e102c9c5b22ceb60dc516ab4124bea8ec8e808b08eec48ea7ac674d13fca82ef, c7544e1f9927afdf6e8cd7063020b572e60fe8f00af39227eb831d331df38225, 3668c6749db59a6cbc5293d0a4f904f76d6fb5048704449dd53894916f408a57, 7705851ba047a8154402aca92621b60be0e0e9d9b52b19bf8be540305bd53dba, b5acf358ff97127eac9ef4c664a980b937376b5295ef23d77ee338225de10d60, 394d2d862f2ddce71f28d9b933b21a7d6c621c80ef28652574f758f77f01f716, e958d03db79e9f1d2770c70a5bc24904aa3e2d27a8d5637684cf8166b38908f2, 284701380f33a30b25e8eb9822e7f47179238e91d08bd3fb5a117145de7e0d8d, 497471497886f18ca16f7facab7d76dc9bfadd69deb9c6e4ea9bdc0869a15628, 739bedcfc8eb860927eb2057474be5b39518aaaa6703f9f85307a432fa1f236e, 8f4c72e3c7de1ab5d894ec7813f65c5298ecafc183f31924b44a427433ffca42, 1ac4753056179b358132c55ca3086d550849ae30259ba94f334826c2fbf6c57e, 53e8fecd7d4b1b74064eba9bfa6a361d52929f440954931b4ba65615148bf0ea, e9088afd8871dbad5eda47a9d8abf3b08dd2e17c423ba8a05f9b6ad6751f9b7c, ab27eb05130db2f92499234b69ff97ee6429c7824efcb7324ae3e404e2b405bf, 553451008520a5f0110d84192cba40208fb001c27454f946e85e6fb2e6553292 | excludes:dll.hash.sha256 |
user.id | eq | S-1-5-18 | excludes:user.id field:"user.id" value:"S-1-5-18" |
Virtual Machine Fingerprinting via Grep
#An adversary may attempt to get detailed information about the operating system and hardware. This rule identifies common locations used to discover virtual machine hardware by a non-root user. This technique has been used by the Pupy RAT and other malware.
Known False Positives
- Certain tools or automated software may enumerate hardware information. These tools can be exempted via user name or process arguments to eliminate potential noise.
MITRE ATT&CK Coverage
Rule Body
[metadata]
creation_date = "2021/09/29"
integration = ["endpoint"]
maturity = "production"
updated_date = "2026/03/24"
[rule]
author = ["Elastic"]
description = """
An adversary may attempt to get detailed information about the operating system and hardware. This rule identifies
common locations used to discover virtual machine hardware by a non-root user. This technique has been used by the Pupy
RAT and other malware.
"""
false_positives = [
"""
Certain tools or automated software may enumerate hardware information. These tools can be exempted via user name or
process arguments to eliminate potential noise.
""",
]
from = "now-9m"
index = ["auditbeat-*", "logs-endpoint.events.*"]
language = "eql"
license = "Elastic License v2"
name = "Virtual Machine Fingerprinting via Grep"
references = ["https://objective-see.com/blog/blog_0x4F.html"]
risk_score = 47
rule_id = "c85eb82c-d2c8-485c-a36f-534f914b7663"
setup = """## Setup
If enabling an EQL rule on a non-elastic-agent index (such as beats) for versions <8.2,
events will not define `event.ingested` and default fallback for EQL rules was not added until version 8.2.
Hence for this rule to work effectively, users will need to add a custom ingest pipeline to populate
`event.ingested` to @timestamp.
For more details on adding a custom ingest pipeline refer - https://www.elastic.co/guide/en/fleet/current/data-streams-pipeline-tutorial.html
"""
severity = "medium"
tags = [
"Domain: Endpoint",
"OS: macOS",
"OS: Linux",
"Use Case: Threat Detection",
"Tactic: Discovery",
"Data Source: Elastic Defend",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
process where event.type == "start" and
process.name in ("grep", "egrep") and user.id != "0" and
process.args : ("parallels*", "vmware*", "virtualbox*") and process.args : "Manufacturer*" and
not process.parent.executable in ("/Applications/Docker.app/Contents/MacOS/Docker", "/usr/libexec/kcare/virt-what")
'''
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 Virtual Machine Fingerprinting via Grep
Virtual machine fingerprinting involves identifying virtualized environments by querying system details. Adversaries exploit tools like `grep` to extract information about virtual machine hardware, aiding in evasion or targeting. The detection rule identifies non-root users executing `grep` with arguments linked to virtual machine identifiers, flagging potential reconnaissance activities while excluding benign processes.
### Possible investigation steps
- Review the process execution details to confirm the non-root user who initiated the `grep` or `egrep` command and assess their typical behavior and access rights.
- Examine the command-line arguments used with `grep` to identify specific virtual machine identifiers such as "parallels", "vmware", or "virtualbox" and determine if these align with known reconnaissance patterns.
- Investigate the parent process of the `grep` command to understand the context in which it was executed, ensuring it is not a benign process like Docker or kcare.
- Check for any additional suspicious activities or commands executed by the same user around the same time to identify potential lateral movement or further reconnaissance.
- Correlate this event with other security alerts or logs to determine if it is part of a broader attack pattern or campaign, particularly looking for connections to known malware like Pupy RAT.
### False positive analysis
- Non-root users running legitimate scripts or applications that query virtual machine identifiers for system management or inventory purposes may trigger the rule. To handle this, identify and whitelist these specific scripts or applications by excluding their parent executable paths.
- Developers or IT personnel using grep to troubleshoot or gather system information on virtual machines might be flagged. Create exceptions for known user accounts or specific directories where these activities are expected.
- Automated monitoring tools that check virtual machine environments for compliance or performance metrics could cause false positives. Exclude these tools by adding their process names or parent executables to the exception list.
- Some virtualization management software might use grep internally to gather system information. Identify these applications and exclude their processes to prevent unnecessary alerts.
### Response and remediation
- Immediately isolate the affected system from the network to prevent further reconnaissance or data exfiltration by the adversary.
- Terminate any suspicious processes identified by the alert, specifically those involving `grep` or `egrep` with arguments related to virtual machine identifiers.
- Conduct a thorough review of the affected system's user accounts and permissions, focusing on non-root users, to identify any unauthorized access or privilege escalation.
- Analyze system logs and network traffic for any signs of lateral movement or additional compromise, paying close attention to connections initiated by the affected system.
- Restore the system from a known good backup if any unauthorized changes or malware are detected, ensuring that the backup is free from compromise.
- Implement stricter access controls and monitoring for systems running virtual machines, including enhanced logging and alerting for similar reconnaissance activities.
- Escalate the incident to the security operations team for further investigation and to determine if the activity is part of a larger attack campaign."""
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1082"
name = "System Information Discovery"
reference = "https://attack.mitre.org/techniques/T1082/"
[rule.threat.tactic]
id = "TA0007"
name = "Discovery"
reference = "https://attack.mitre.org/tactics/TA0007/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1497"
name = "Virtualization/Sandbox Evasion"
reference = "https://attack.mitre.org/techniques/T1497/"
[[rule.threat.technique.subtechnique]]
id = "T1497.001"
name = "System Checks"
reference = "https://attack.mitre.org/techniques/T1497/001/"
[rule.threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
Stages and Predicates
Stage 1: process
process where event.type == "start" and
process.name in ("grep", "egrep") and user.id != "0" and
process.args : ("parallels*", "vmware*", "virtualbox*") and process.args : "Manufacturer*" and
not process.parent.executable in ("/Applications/Docker.app/Contents/MacOS/Docker", "/usr/libexec/kcare/virt-what")
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.type | eq |
| field:"event.type" kind:eq value:"start" |
process.args | wildcard |
| field:"process.args" kind:wildcard |
process.name | in |
| field:"process_basename" kind:in |
user.id | ne |
| field:"user.id" kind:ne value:"0" |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.parent.executable | in | /Applications/Docker.app/Contents/MacOS/Docker, /usr/libexec/kcare/virt-what | excludes:process.parent.executable field:"process.parent.executable" value:"/Applications/Docker.app/Contents/MacOS/Docker" field:"process.parent.executable" value:"/usr/libexec/kcare/virt-what" |
Windows System Module Remote Hooking
#Identifies attempts to write to a remote process memory to modify NTDLL or Kernelbase modules. This may indicate an attempt to evade endpoint security solutions or perform code injection.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Stealth |
Rule Body
[rule]
description = """
Identifies attempts to write to a remote process memory to modify NTDLL or Kernelbase modules. This may indicate an
attempt to evade endpoint security solutions or perform code injection.
"""
id = "4c10ee1d-8373-4450-bf5c-81ce138739a1"
license = "Elastic License v2"
name = "Windows System Module Remote Hooking"
os_list = ["windows"]
reference = ["https://www.elastic.co/security-labs/doubling-down-etw-callstacks"]
version = "1.0.12"
query = '''
api where process.Ext.api.name == "WriteProcessMemory" and process.executable != null and
process.thread.Ext.call_stack_final_user_module.name != null and
process.Ext.api.behaviors == "cross-process" and process.Ext.api.summary like ("*ntdll.dll*", "*kernelbase.dll*") and
process.thread.Ext.call_stack_summary like
("Unbacked", "*kernelbase.dll|Unbacked*", "ntdll.dll|Unknown", "*kernel32.dll|Unbacked*", "*ntdll.dll|Unbacked*") and
not stringcontains~(process.Ext.api.summary, process.name) and
(process.code_signature.trusted == false or process.code_signature.exists == false or process.name : "rundll32.exe") and
not (process.name : "rundll32.exe" and process.command_line : "\"?:\\WINDOWS\\System32\\RUNDLL32\" tsworkspace,WorkspaceStatusNotify2" and
process.parent.executable : "?:\\Windows\\System32\\svchost.exe") and
not process.thread.Ext.call_stack_final_user_module.name == "kernel" and
not process.parent.executable : ("C:\\Program Files (x86)\\Xoreax\\IncrediBuild\\BuildSystem.exe", "C:\\Program Files (x86)\\Incredibuild\\BuildSystem.exe") and
not process.thread.Ext.call_stack_final_user_module.path like
("?:\\program files\\*",
"?:\\program files (x86)\\*",
"?:\\windows\\system32\\*.dll",
"?:\\windows\\syswow64\\*.dll",
"\\program files\\*",
"\\program files (x86)\\*",
"\\windows\\system32\\*.dll",
"\\windows\\syswow64\\*.dll",
"?:\\windows\\apppatch\\appPatch64\\exploitblocker.dll",
"?:\\windows\\FireEye\\AppMonitorDll.dll") and
not (process.thread.Ext.call_stack_final_user_module.protection_provenance in ("clr.dll", "mscorwks.dll", "coreclr.dll", "teams.exe") and
_arraysearch(process.thread.Ext.call_stack_final_user_module.code_signature, $entry, $entry.trusted == true and $entry.subject_name in ("Microsoft Corporation", "Microsoft Corporation", ".NET"))) and
not _arraysearch(process.thread.Ext.call_stack_final_user_module.code_signature, $entry, $entry.trusted == true and
$entry.subject_name in ("Microsoft Windows Hardware Compatibility Publisher",
"Microsoft Windows Software Compatibility Publisher"))
'''
min_endpoint_version = "8.10.0"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1055"
name = "Process Injection"
reference = "https://attack.mitre.org/techniques/T1055/"
[threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
[internal]
min_endpoint_version = "8.10.0"
Stages and Predicates
Stage 1: api
api where process.Ext.api.name == "WriteProcessMemory" and process.executable != null and
process.thread.Ext.call_stack_final_user_module.name != null and
process.Ext.api.behaviors == "cross-process" and process.Ext.api.summary like ("*ntdll.dll*", "*kernelbase.dll*") and
process.thread.Ext.call_stack_summary like
("Unbacked", "*kernelbase.dll|Unbacked*", "ntdll.dll|Unknown", "*kernel32.dll|Unbacked*", "*ntdll.dll|Unbacked*") and
not stringcontains~(process.Ext.api.summary, process.name) and
(process.code_signature.trusted == false or process.code_signature.exists == false or process.name : "rundll32.exe") and
not (process.name : "rundll32.exe" and process.command_line : "\"?:\\WINDOWS\\System32\\RUNDLL32\" tsworkspace,WorkspaceStatusNotify2" and
process.parent.executable : "?:\\Windows\\System32\\svchost.exe") and
not process.thread.Ext.call_stack_final_user_module.name == "kernel" and
not process.parent.executable : ("C:\\Program Files (x86)\\Xoreax\\IncrediBuild\\BuildSystem.exe", "C:\\Program Files (x86)\\Incredibuild\\BuildSystem.exe") and
not process.thread.Ext.call_stack_final_user_module.path like
("?:\\program files\\*",
"?:\\program files (x86)\\*",
"?:\\windows\\system32\\*.dll",
"?:\\windows\\syswow64\\*.dll",
"\\program files\\*",
"\\program files (x86)\\*",
"\\windows\\system32\\*.dll",
"\\windows\\syswow64\\*.dll",
"?:\\windows\\apppatch\\appPatch64\\exploitblocker.dll",
"?:\\windows\\FireEye\\AppMonitorDll.dll") and
not (process.thread.Ext.call_stack_final_user_module.protection_provenance in ("clr.dll", "mscorwks.dll", "coreclr.dll", "teams.exe") and
_arraysearch(process.thread.Ext.call_stack_final_user_module.code_signature, $entry, $entry.trusted == true and $entry.subject_name in ("Microsoft Corporation", "Microsoft Corporation", ".NET"))) and
not _arraysearch(process.thread.Ext.call_stack_final_user_module.code_signature, $entry, $entry.trusted == true and
$entry.subject_name in ("Microsoft Windows Hardware Compatibility Publisher",
"Microsoft Windows Software Compatibility Publisher"))
Indicators
These rows show field, operator, and value matches.
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.thread.Ext.call_stack_final_user_module.code_signature | array_any | excludes:process.thread.Ext.call_stack_final_user_module.code_signature | |
process.thread.Ext.call_stack_final_user_module.protection_provenance | in | clr.dll, coreclr.dll, mscorwks.dll, teams.exe | excludes:process.thread.Ext.call_stack_final_user_module.protection_provenance |
process.command_line | eq | "?:\WINDOWS\System32\RUNDLL32" tsworkspace,WorkspaceStatusNotify2 | excludes:process.command_line |
process.name | eq | rundll32.exe | excludes:process.name field:"process.name" value:"rundll32.exe" |
process.parent.executable | eq | ?:\Windows\System32\svchost.exe | excludes:process.parent.executable field:"process.parent.executable" value:"?:\Windows\System32\svchost.exe" |
process.Ext.api.summary | contains | process.name | excludes:process.Ext.api.summary field:"process.Ext.api.summary" value:"process.name" |
process.parent.executable | eq | C:\Program Files (x86)\Xoreax\IncrediBuild\BuildSystem.exe, C:\Program Files (x86)\Incredibuild\BuildSystem.exe | excludes:process.parent.executable field:"process.parent.executable" value:"C:\Program Files (x86)\Xoreax\IncrediBuild\BuildSystem.exe" field:"process.parent.executable" value:"C:\Program Files (x86)\Incredibuild\BuildSystem.exe" |
process.thread.Ext.call_stack_final_user_module.name | eq | kernel | excludes:process.thread.Ext.call_stack_final_user_module.name field:"process.thread.Ext.call_stack_final_user_module.name" value:"kernel" |
process.thread.Ext.call_stack_final_user_module.path | wildcard | ?:\program files\*, ?:\program files (x86)\*, ?:\windows\system32\*.dll, ?:\windows\syswow64\*.dll, \program files\*, \program files (x86)\*, \windows\system32\*.dll, \windows\syswow64\*.dll, ?:\windows\apppatch\appPatch64\exploitblocker.dll, ?:\windows\FireEye\AppMonitorDll.dll | excludes:process.thread.Ext.call_stack_final_user_module.path |