heroui logo

Potential Prompt Injection Coercing Shell Execution

Elastic Detection Rules

View Source
Summary
This rule detects potential prompt injection attempts that coerc e a shell or scripting interpreter into executing attacker-controlled commands via an injected prompt. It uses an EQL rule on endpoint process events to identify cases where a child process (shell/interpreter) is launched and the parent process line contains adversarial or jailbreak language commonly associated with prompting GenAI agents (for example phrases like ignore previous instructions, do anything now, jailbreak mode, bypass the safety filter, etc.). The intent is to surface untrusted prompt content that traverses from a GenAI wrapper or agent into local command execution, which could enable credential theft, data exfiltration, persistence, or abuse of tools under the user’s privileges. The query targets process.start events and matches known shells (bash, sh, cmd.exe, powershell, etc.) and related interpreters, with a parent.command_line filter capturing jailbreak/instruction-bypass text. It is a content-based heuristic rather than a definitive file/hash indicator, and should be correlated with other GenAI-related activity to confirm legitimate testing versus compromise. The rule is mapped to MITRE ATT&CK (T1059 Command and Scripting Interpreter and subtechniques such as Windows Command Shell, PowerShell, Unix Shell, Python, JavaScript) and MITRE ATLAS (AML.T0051 LLM Prompt Injection and AML.T0054 LLM Jailbreak) under Execution and Defense Evasion. False positives include approved red-team tests or non-adversarial documentation that mention jailbreak terms; user/host context and the broader session should be reviewed before escalating. Recommended actions include isolating sessions for suspected injections, reviewing agent conversation history, rotating credentials, auditing GenAI tool configurations, and blocking the implicated automation if confirmed. Overall, the rule provides a proactive guardrail against a class of adversarial prompt-based exploits that aim to drive local code execution via untrusted GenAI content.
Categories
  • Endpoint
  • Windows
  • Linux
  • macOS
Data Sources
  • Process
ATT&CK Techniques
  • T0051
  • T0054
  • T1059
  • T1059.001
  • T1059.002
  • T1059.003
  • T1059.004
  • T1059.005
  • T1059.006
  • T1059.007
Created: 2026-10-09