A scan answers one narrow question: which ports will accept a connection. This set checks that you can read the answer, tell the states apart, and keep the target on your own device.
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.
Scan a few ports on your own device
This scans four named ports on localhost, which is your own device and nothing else. The -n flag keeps it local by skipping name lookups. Paste the whole scan output.
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.
nmap -n -p 22,80,443,8022 localhost
If you have started the Termux SSH server with sshd, the 8022 row will read open. Otherwise every row reads closed, which is the ordinary state of a phone.
the table has the columns PORT, STATE and SERVICE
at least one port row reports its state
the command actually ran
What a good answer looks like
nmap's usual shape: a banner line naming the version, a scan report naming localhost and its loopback address, a blank line, then a table with the columns PORT, STATE and SERVICE and one row for each port you named. A row reads the port and protocol, then the state, then the usual service name. Every row reads closed unless you have started a service, in which case its row reads open. Then a closing line counting the host and the time. The STATE column is the answer you were looking for; the SERVICE column is only a label for the port number.
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.