Injection is a value being read as code by something that runs code. This set checks that you can spot where the crossing happens, and that you know an argument list and a query parameter keep a value a value.
Each one is marked as you go, and the explanation arrives straight after, which is
the part worth reading.
4 questions, marked as you go.
Tasks
These need your own device. Run the command in Termux, then paste what it printed.
The marking looks at what the output means, so spacing, version numbers and
ordering do not matter. If you have not installed anything yet, the
lesson covers the setup.
Pass a hostile value as an argument and watch it stay inert
This runs the fixed greeting, which passes the name as an argument to a program rather than to a shell. The name here contains a semicolon and a second command. Run it and paste what comes back.
Run this in Termux
On your own device. Nothing on this page executes it. The command runs in
your terminal, and this box only reads what you paste back.
Two lines should come back: the greeting with the value printed whole, then a line count.
the whole value went in as one argument
only one line came out, so nothing ran
no identity output leaked, so the injected command did not run
the command actually ran
What a good answer looks like
Two lines. The first is hello world; id, with the whole value printed as one piece of text, semicolon and all. The second reads lines: 1, because echo produced a single line. Nothing ran the id command, so no identity output appears. That is the fix in action: the value is data, the shell is out of the picture, and the marks inside the value mean nothing.
Marking your own work
Both halves of this are checked in your browser, with no server involved, so nothing
stops you from pasting output you did not run. The tasks are written so that the
easiest way to pass one is to actually do it and read the result, which is the whole
intention.