A structured lesson workspace with readable content, hands-on examples, and a clean path to completion.
You do not need to memorize twenty operators. You need to understand five, know their URL-encoded forms, and understand when each one executes the second command. The rest is variation on a theme.
| Operator | URL-Encoded | Executes Second Command When... | Platform |
|---|---|---|---|
| ; (semicolon) | %3b | Always (both commands run) | Linux + Windows PowerShell |
| \n (newline) | %0a | Always (both commands run) | Linux + Windows |
| && (AND) | %26%26 | First command succeeds (exit 0) | Linux + Windows |
| || (OR) | %7c%7c | First command fails (exit non-0) | Linux + Windows |
| ` ` (backticks) | %60%60 | Always (sub-shell, Linux only) | Linux |
| $() (sub-shell) | %24%28%29 | Always (sub-shell, Linux only) | Linux |
Semicolon does not care whether the first command succeeded or failed. Both run, period. The only caveat: Windows CMD does not recognize semicolons as command separators. PowerShell does. If you are targeting a Windows backend and semicolons fail, try newline or AND.
In an HTTP request, you send the newline as %0a in the POST body or query string. It is the most reliable operator because almost no filter blacklists newlines. The input might legitimately need them.
This is useful when your injection breaks the original command syntax. Supply no valid IP, let ping fail with a usage error, and your injected command runs cleanly. The output is just your command result. No ping noise. Cleaner exploitation.
Pro tip: the || operator with an intentionally broken first command gives you the cleanest output for data exfiltration. No need to parse ping statistics from the response. Just your command output, front and center.
Five operators. Five URL encodings. That is your entire toolkit for basic command injection. The next lesson shows you what happens when the application says "no" before your payload ever reaches the server.
Finish the lesson once you have worked through the material. This awards ★ 30 XP.