[New Rule] Command Interpreter Spawned by Obsidian#6317
Open
Aryu-RU wants to merge 1 commit into
Open
Conversation
Add a cross-platform EQL rule that detects the Obsidian note-taking application spawning a command or script interpreter (PowerShell or a Unix shell). This is the execution behavior used by the PhantomPulse campaign, which abuses the Obsidian Shell Commands community plugin to auto-run attacker-supplied commands when a weaponized vault is opened.
Author
|
Quick summary for triage: this rule detects Obsidian spawning a command/script interpreter — the execution behavior from the PhantomPulse campaign documented in Elastic Security Labs' Phantom in the Vault (which notes a Defend behavior alert fired on PowerShell with Obsidian as the parent). No existing rule anchors on Obsidian as a parent; PowerShell/pwsh/osascript fire directly, while Happy to adjust scope, add an RTA, or tweak the MITRE mapping based on your feedback. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue link(s)
None yet — opening with a detailed summary per the PR template. Happy to file a New rule issue first if the team prefers that flow.
Summary - What I changed
Adds one new cross-platform EQL detection rule under
rules/cross-platform/, Command Interpreter Spawned by Obsidian, which fires when the Obsidian note-taking application spawns a command or script interpreter. To keep the signal-to-noise high on hosts that legitimately run community plugins, the strongly-anomalous and documented interpreters fire directly, while the more commonly-benign shells are gated behind download/execution arguments:Obsidian.exe→powershell.exe/pwsh.exe(the documented PhantomPulse vector — matched directly); orcmd.exewhen its command line shows download/execution behavior.Obsidian→osascript(the documented AppleScript vector — matched directly); orsh/bash/zshwhen the command line shows download/decode behavior.Why this is a real threat. Obsidian does not natively execute shell commands; the only common way it spawns an interpreter is through a community plugin — most notably Shell Commands (
obsidian-shellcommands), which can be configured to auto-run commands when a vault opens. Elastic Security Labs' Phantom in the Vault (REF6598) documents an active campaign where a victim is socially engineered into logging into an attacker-controlled Obsidian Sync vault and enabling community-plugin sync, which delivers a weaponizeddata.jsonthat launches a PowerShell download cradle (iwr ...→Start-BitsTransfer ...) on vault open, ultimately delivering the PhantomPulse RAT. The article notes: "An Elastic Defend behavior alert triggered on suspicious PowerShell execution with Obsidian as the parent process." This rule generalizes that exact observed behavior into a durable parent→interpreter detection across Windows and macOS.Coverage gap (deduplicated against the current ruleset). No existing rule covers Obsidian as a parent:
rules/windows/initial_access_suspicious_execution_from_vscode_extension.toml— structurally similar but hardcodesnode.exe/Code.exe+.vscode/extensions; does not fire for Obsidian.rules/windows/defense_evasion_communication_apps_suspicious_child_process.toml— fixed communication-app parent list (Obsidian absent), Windows-only.rules/windows/execution_windows_powershell_susp_args.toml— may opportunistically catch the Windows download stage but provides no Obsidian attribution and no macOS coverage.Obsidian currently appears in the repository only as a benign allowlist entry (
rules/windows/command_and_control_common_webservices.toml, which governs Obsidian's own outbound plugin-fetch traffic) — never as a detection subject, so this rule is complementary, not overlapping.This follows the accepted "trusted application as interpreter parent" pattern already in the repo — e.g.
rules/windows/defense_evasion_suspicious_zoom_child_process.toml(Zoom.exe→cmd/powershell) andrules/windows/initial_access_suspicious_execution_from_vscode_extension.toml— applied to a parent (Obsidian) that has no existing coverage.How To Test
Representative matching event (Windows), mirroring the documented chain:
{ "event": { "type": ["start"], "category": ["process"] }, "host": { "os": { "type": "windows" } }, "process": { "name": "powershell.exe", "command_line": "powershell.exe -ExecutionPolicy Bypass -WindowStyle Hidden -File \"%TEMP%\\tt.ps1\"", "parent": { "name": "Obsidian.exe" } } }macOS equivalent:
process.parent.name: "Obsidian"spawningosascript/sh/bash/zsh.Local validation on this branch:
python -m detection_rules validate-rule rules/cross-platform/execution_command_interpreter_spawned_by_obsidian.toml→ successfulpython -m detection_rules validate-all→ Rule validation successfulpytest tests/test_all_rules.py→ 51 passed, 1 skippedMITRE ATT&CK
References
False positives
false_positiveswith guidance to review the plugin'sdata.jsonand add exceptions for trusted users/hosts.git) can spawncmdor a Unix shell — review the child command line.The rule is
mediumseverity /risk_score 47, consistent with the accepted VS Code-extension analogue, reflecting behavior with a legitimate-but-uncommon path.Reviewer considerations
logs-endpoint.events.process-*), which actually emits this event.data.jsonis delivered via Obsidian Sync (written by Obsidian itself) and Shell Commands is a legitimate plugin, so a file-write detector ondata.jsonwould be high-FP; thedata.jsonpath is included as an investigation-guide triage step instead of a detection condition.Checklist
Rule: Newlabel for the type of PRContributor checklist