Ransomware: the right backup
At Valle Alta Wine Cooperative the files in the shared folder were encrypted last night. Before restoring you must work out which user the encryption started from and which backup is clean: not the most recent, but the last one that finished before the encryption began. Read the file server log and the backup list, then decode the right plan.
Lab 10 of 10 in the Blue Team / Defense path. If you get stuck you have 3 hints, from the vaguest to the most precise: they cost 0, 60 and 150 XP.
What you learn
Objectives complete themselves while you work in the terminal; each one is worth experience points:
- Find the encrypted files in the audit log (150 XP)
- Read the backup list with start and end times (150 XP)
- Decode the plan with the right user and backup (200 XP)
Topics: defense, incidente, backup, ripristino.
Commands you will use
The terminal is simulated and understands about forty Linux commands. In this lab you will mostly need these:
cat: prints the contents of a file: the most direct way to read configurations, notes and logs.grep: finds the lines that contain a word, even across whole folders with -r. It is the main tool for analysing text and logs.head: shows only the first lines of a file, handy for understanding a log format without reading all of it.base64: encodes and decodes Base64, the format that turns bytes into text. It protects nothing: it can be undone without a key.|: the vertical bar | chains commands: the output of the first becomes the input of the next, so small tools form a complete analysis.
The simulated environment
You work in a simulated Linux shell, in the home folder of the user runner: invented files and folders, no network target.
Besides the home folder there is a complete simulated system, with configuration files, logs, users and permissions to examine.
The defensive lesson
Once the lab is solved, the write-up explains what went wrong and how to protect yourself:
Restoring in a hurry from the most recent backup may bring back files that are already encrypted. The timeline must be rebuilt: when and by whom the encryption started (the first encrypted file in the audit log), then pick the last backup that FINISHED before, not one that merely started before. Then the starting computer is isolated, the newer backups are kept as evidence and passwords are changed. Defense: offline or immutable backups that malware cannot encrypt, periodic restore tests, minimal permissions on shared folders and an audit log that flags mass writes.
Before and after this lab
To unlock it you must have solved:
- The malware heartbeat (Blue Team / Defense, hard)
- Responding to an incident (Blue Team / Defense, hard)
It is one of the final labs: no other lab requires it.
The Blue Team / Defense path
Blue Team / Defense is the path of those who protect. You read access logs, count failed attempts to find out who is forcing a login, rebuild the timeline of an incident, compare an SSH configuration with the recommended one, shut down unnecessary services and handle incident response in four steps: detect, contain, clean up, document. The commands are the same as in the other paths, but used through the eyes of someone who must understand what happened and stop it from happening again.