In-depth lesson · Command injection
Tips for beginners
Every point the Command injection reports back under this heading, best-backed first, each with the reports it is seen in.
-
Start with features that call external programs: image processing, file conversion, git operations, mail sending, package installation and CI build steps. The evidence lists these as common sinks, so they are good first places to look.
Seen in 5 reports
-
When you find a filter, test its edges: trailing whitespace, null bytes, grouped short flags, Unicode characters and unquoted variables. The evidence shows several fixes that were bypassed this way, so a blocked payload does not mean the bug is fixed.
Seen in 4 reports
-
Look for values that are concatenated into commands without a separator. A leading double dash can turn a value into an option, so test inputs that begin with a dash and see whether the tool treats them as flags rather than data.
Seen in 3 reports
-
Check generated configuration files and scripts. If a field accepts newlines, it may add new directives or commands. The evidence shows this in ingress annotations, SMTP settings and scripts users are told to run.
Seen in 3 reports
-
For CI and build systems, look at branch names, CI variables and pipeline checkout steps. These are user-influenced values that often reach git or shell commands.
Seen in 3 reports
-
Do not stop at the first blocked payload. The evidence shows incomplete fixes and blacklists that missed a flag or directive, so try variations that stay within the same feature.
Seen in 3 reports
-
Use out-of-band interaction to confirm blind command injection when no output is returned. This is a reliable way to show impact without needing a visible response.
Seen in 2 reports
-
Check scope before testing appliances, routers and management consoles. Many reports in the evidence are for network devices and VPN appliances, but these are often out of scope for a bug bounty programme unless explicitly listed.
-
For file upload features, test filenames and content. A null byte in the filename can truncate an extension check, and a crafted filename can reach a shell command in image or PDF tools.
Seen in 2 reports
-
Test environment variable names as well as values. One report shows that values were escaped but names were not, which allowed injection. This is easy to miss if you only look at the value field.
-
Do not report a finding without showing execution. A value that looks dangerous but never reaches a shell is not command injection. Confirm with a harmless command or an out-of-band interaction before writing up.
Seen in 1 report
-
For desktop clients, test protocol handlers and external link opening. The evidence shows crafted arguments reaching a shell through a custom protocol handler and through a chat client opening a link.
-
Keep your proof minimal and safe. Use a command that demonstrates execution without changing data or causing harm, and avoid payloads that could disrupt the service. The lesson does not include payloads, so rely on the report evidence for what to test.
Seen in 1 report