SigmaHunting query: tune before alertingAI coding agents on endpoints
AI coding agent spawns a shell that pipes a download into an interpreter
Prompt injection that reaches an agent's shell tool typically ends in download-and-execute (curl or wget piped into sh, bash or python). SpecterOps describes prompt injection from repositories, web pages or MCP servers turning into code execution through Claude Code's Bash tool. The Claude Code native installer places versioned binaries under ~/.local/share/claude/versions/, so the path is matched as well as the process name.
- Log source
- Process creation on Linux and macOS (EDR / Sysmon for Linux / Endpoint Security)
- Techniques
- ASI05 Unexpected Code Execution · LLM01 Prompt Injection · AML.T0051 LLM Prompt Injection · AML.T0050 Command and Scripting Interpreter
- MITRE ATT&CK
- T1105Ingress Tool TransferT1059.004Unix ShellT1698Indirect Prompt Injection
- Reviewed
- 2026-11-10
Query
title: AI Coding Agent Spawns Download-And-Execute Shell
id: da92b961-a478-451c-a3cd-b10eac16cb3f
status: experimental
description: Detects a shell started by an AI coding agent that downloads content with curl or wget and pipes it into an interpreter.
references:
- https://specterops.io/blog/2025/11/21/an-evening-with-claude-code/
- https://genai.owasp.org/resource/owasp-top-10-for-agentic-applications-for-2026/
author: ThreatDeck
date: 2026-11-09
modified: 2026-11-10
tags:
- attack.command-and-control
- attack.t1105
- attack.execution
- attack.t1059.004
- attack.t1698
- detection.threat-hunting
logsource:
category: process_creation
detection:
selection_parent:
- ParentImage|endswith:
- '/claude'
- '/codex'
- '/cursor-agent'
- '/gemini'
- ParentImage|contains: '/.local/share/claude/versions/'
- ParentCommandLine|contains:
- '@anthropic-ai/claude-code'
- '@google/gemini-cli'
- '@openai/codex'
selection_shell:
Image|endswith:
- '/sh'
- '/bash'
- '/zsh'
- '/dash'
selection_download:
CommandLine|contains:
- 'curl '
- 'wget '
selection_exec:
CommandLine|contains:
- '| sh'
- '|sh'
- '| bash'
- '|bash'
- '| zsh'
- '| python'
- '|python'
condition: all of selection_*
falsepositives:
- Agents following official install instructions that use curl-pipe-shell installers (for example language toolchains)
level: medium Expected false positives
- Agents running vendor install one-liners (rustup, nvm, Homebrew) at the user's request
- Project setup scripts that the user asked the agent to execute
Sources
- SpecterOps: An evening with Claude Code (CVE-2025-64755)
- Elastic rule: Potential prompt injection coercing shell execution
- Claude Code docs: The .claude directory (application data)
Reviewed against vendor documentation, not tested in your environment. Defensive use only.