Skip to content
Lab 4 of 6

File Integrity: What Changed on the Box

A weekly baseline of hashes says what the box looked like on 1 November. Compare it with now: what was modified, what is new, and which of those changes were the attacker's rather than Simran's release work.
  • Intermediate
  • 30 min
  • Blue Team
  • Forensics
  • File Integrity
  • sha256sum
  • Kestrel

Overview

The morning of 4 November. Customers have been getting SMS messages that use their names and phone numbers. Harpreet Kaur calls it in at 07:15; Simran Gill rolls back the release that went out at 22:47 the night before and, before anything rotates, copies the server's logs to /srv/evidence/var/log (start with cat /srv/evidence/README.md). This machine is that server, kestrel-api-1, exactly as the attacker left it.

Kestrel runs a small integrity job: every Sunday it hashes the files that decide what runs on this box — crontabs, /usr/local/bin, systemd units, SSH keys, sudoers, the API's code — into /var/backups/integrity/baseline.sha256 (read /var/backups/integrity/README). The last one was taken at 03:00 on 1 November, two days before the attack.

A hash cannot say who changed a file, only that it changed. Between the baseline and the breach, Simran shipped log rotation (ticket KST-212, 2 November) — legitimate changes in the same directories. Your job is to produce three lists an auditor can trust: modified, new, and the attacker's.

What you will learn

  • Verify files against a baseline with sha256sum -c
  • Find files that are new since the baseline with find, sort and comm
  • Use modification times to separate the attacker's changes from legitimate ones
  • Know what a hash proves, and what it does not

Before you start

  • Comfortable in a Linux shell: grep, pipes and redirecting with >
  • sudo for files another account owns — you have it here

Tasks

  1. 01What was modified?
  2. 02What is new?
  3. 03Which changes were the attacker's?

Next in this course