Baselines

A baseline is a written record of the ordinary state of your device: the packages installed, the ports listening, and the hashes of the files you care about. This set covers why it has to be written down, why the day you take it matters, and what an open listener really means.

4 questions 1 task Read the lesson

Questions

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.

1 What is a baseline?
2 Why does the lesson say to take the baseline on a quiet day?
3 Why pipe the package list through sort before saving it?
4 A listener in your baseline sits on 0.0.0.0 instead of 127.0.0.1. What does that mean?

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.

Build and read a baseline snapshot

This writes a small package list and a settings file, then records the ports, the packages and the hashes of those files into one dated snapshot. Read the three sections it prints.

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.

mkdir -p ~/baseline; printf 'openssh\nbash\ncoreutils\n' > ~/baseline/packages.txt; printf 'settings\n' > ~/baseline/notes.txt; { echo "== ports =="; ( ss -tuln 2>/dev/null || netstat -tuln 2>/dev/null || echo none ) | head -n 5; echo "== packages =="; sort ~/baseline/packages.txt; echo "== hashes =="; sha256sum ~/baseline/packages.txt ~/baseline/notes.txt; } > ~/baseline/baseline.txt; cat ~/baseline/baseline.txt
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.

All sets Read the lesson