Skip to content

[New Rule] Potential Fileless Execution via O_TMPFILE - #6743

Merged
Aegrah merged 9 commits into
mainfrom
new-rule-detect-o-temp-file-execution
Sep 11, 2026
Merged

Aegrah merged 9 commits into
mainfrom
new-rule-detect-o-temp-file-execution

Conversation

@Aegrah

@Aegrah Aegrah commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Summary

Adding additional coverage for fileless execution via O_TMPFILE.

{E7E9A303-3008-4243-8D80-FD37752C5380}

Reference: https://matheuzsecurity.github.io/hacking/fileless-loader-bypassing-elastic-memfd/

@Aegrah Aegrah self-assigned this Sep 7, 2026
Copilot AI lite review requested due to automatic review settings September 7, 2026 13:29
@Aegrah Aegrah added OS: Linux Rule: New Proposal for new rule Team: TRADE labels Sep 7, 2026
@elastic-vault-github-plugin-prod

elastic-vault-github-plugin-prod Bot commented Sep 7, 2026

Copy link
Copy Markdown

⛔️ Test failed

Results
  • ❌ Potential Fileless Execution via O_TMPFILE (eql)
    • coverage_issue: no_rta
    • stack_validation_failed: no_rta

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Several rule fields need corrections/alignments (index pattern, references, tags, and description/setup text mismatches with the implemented query) before it can be safely approved.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR adds a new Linux EQL detection rule intended to identify potential fileless ELF execution patterns associated with anonymous temporary executables (e.g., O_TMPFILE/execveat-style execution).

Changes:

  • Introduces a new Linux EQL rule file with metadata, query, and MITRE ATT&CK mapping.
  • Adds an investigation guide (note) and setup guidance.
  • Configures indices/integrations and tags for multiple endpoint telemetry sources.
File summaries
File Description
rules/linux/defense_evasion_fileless_execution_via_o_tempfile.toml New Linux EQL rule and investigation guide for potential fileless execution via anonymous temporary executable paths.
Review details

Suppressed comments (2)

rules/linux/defense_evasion_fileless_execution_via_o_tempfile.toml:33

  • The investigation guide intro states the rule detects files created with O_TMPFILE and executed via execveat/AT_EMPTY_PATH, but the current query only looks for process.executable matching an anonymous /#<digits> path. Update the guide text to avoid over-asserting how the executable was created/executed.
This rule detects Linux processes launched from anonymous temporary files created with O_TMPFILE, a pattern associated with execveat and AT_EMPTY_PATH execution that leaves no normal filesystem pathname. An attacker can write a malicious ELF payload into an unnamed file descriptor and execute it directly, reducing disk artifacts and making the payload harder to discover through routine file inspection.

rules/linux/defense_evasion_fileless_execution_via_o_tempfile.toml:66

  • The setup section says the rule requires Elastic Defend, but the rule is configured for multiple integrations/data sources (Auditd Manager, CrowdStrike, SentinelOne, Endgame) via integration and index. Update the setup text to reflect that Elastic Defend is one supported source rather than the only requirement.
This rule requires data coming in from Elastic Defend.

### Elastic Defend Integration Setup
  • Files reviewed: 1/1 changed files
  • Comments generated: 4
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread rules/linux/defense_evasion_fileless_execution_via_o_tempfile.toml Outdated
Comment thread rules/linux/defense_evasion_fileless_execution_via_o_tempfile.toml
Comment thread rules/linux/defense_evasion_fileless_execution_via_o_tempfile.toml
Comment thread rules/linux/defense_evasion_fileless_execution_via_o_tempfile.toml
Aegrah and others added 2 commits September 7, 2026 17:04
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@elastic-vault-github-plugin-prod

elastic-vault-github-plugin-prod Bot commented Sep 7, 2026

Copy link
Copy Markdown

⛔️ Test failed

Results
  • ❌ Potential Fileless Execution via O_TMPFILE (eql)
    • coverage_issue: no_rta
    • stack_validation_failed: no_rta

Aegrah and others added 2 commits September 7, 2026 17:05
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@elastic-vault-github-plugin-prod

elastic-vault-github-plugin-prod Bot commented Sep 7, 2026

Copy link
Copy Markdown

⛔️ Test failed

Results
  • ❌ Potential Fileless Execution via O_TMPFILE (eql)
    • coverage_issue: no_rta
    • stack_validation_failed: no_rta

@elastic-vault-github-plugin-prod

elastic-vault-github-plugin-prod Bot commented Sep 7, 2026

Copy link
Copy Markdown

⛔️ Test failed

Results
  • ❌ Potential Fileless Execution via O_TMPFILE (eql)
    • coverage_issue: no_rta
    • stack_validation_failed: no_rta

@elastic-vault-github-plugin-prod

elastic-vault-github-plugin-prod Bot commented Sep 7, 2026

Copy link
Copy Markdown

⛔️ Test failed

Results
  • ❌ Potential Fileless Execution via O_TMPFILE (eql)
    • coverage_issue: no_rta
    • stack_validation_failed: no_rta

Updated the description formatting for clarity.
@elastic-vault-github-plugin-prod

elastic-vault-github-plugin-prod Bot commented Sep 7, 2026

Copy link
Copy Markdown

⛔️ Test failed

Results
  • ❌ Potential Fileless Execution via O_TMPFILE (eql)
    • coverage_issue: no_rta
    • stack_validation_failed: no_rta

@bryans3c bryans3c left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One nit, LGTM!

Comment thread rules/linux/defense_evasion_fileless_execution_via_o_tempfile.toml
@Aegrah
Aegrah requested a review from django-88 September 8, 2026 11:49

@eric-forte-elastic eric-forte-elastic left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good rule 👍

@elastic-vault-github-plugin-prod

elastic-vault-github-plugin-prod Bot commented Sep 11, 2026

Copy link
Copy Markdown

⛔️ Test failed

Results
  • ❌ Potential Fileless Execution via O_TMPFILE (eql)
    • coverage_issue: no_rta
    • stack_validation_failed: no_rta

@Aegrah
Aegrah merged commit 10513e4 into main Sep 11, 2026
37 of 43 checks passed
@Aegrah
Aegrah deleted the new-rule-detect-o-temp-file-execution branch September 11, 2026 08:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants