You are logged in as the ordinary user raven on a Ravens Linux box. The real secret is in a root-owned file you cannot read — but the ops team keeps backups, and backups are a classic place where secrets leak.
A Linux box where you are the user raven. There is a root-owned secret file whose permissions block you, and a backups directory. Your job is to understand permissions and discover that the secret was copied somewhere everyone can read.
You read the secret that leaked into a world-readable backup.
Why the solution worked
The 600 permission on root’s file correctly blocked you — but the backup was copied with 644, so any user could read it. The lesson: a file’s security does not automatically carry over to its copies. The fix: give backups the tightest permissions, make the backup directory non-readable to others, and do not copy secrets into exposed locations.
The root cause
Permissions protect the original file, but a backup was copied with mode 644 that everyone can read. Protecting the original does not protect its copies; the root cause is sensitive data left in a world-readable location.
How the code is fixed
Rule: give the backup the tightest permissions and close the backups directory to others.
Vulnerable code
# nightly backup job — copies the secret world-readable (mode 644)
cp /root/flag /var/backups/creds.bak
Safe code
# keep the backup owner-only, and lock the backups directory
install -m 600 -o root -g root /root/flag /var/backups/creds.bak
chmod 700 /var/backups
Impact in the real world
An attacker who lands as a low-privilege user reads secrets from backups and escalates or steals credentials — a very common path to full server compromise.
How defenders detect it
Defenders monitor for world-readable files in backup directories, run file-integrity checks, and alert on unexpected access to backup paths.
Your workspace now has a Server logs tab: your own attack, as the defender saw it, with the alerting lines marked.
Solved with the walkthrough. Put it aside and solve again to earn the feather.
Explain it back
Answer both to show you know why it worked. That is what mastery means here.
You solved it and explained why it works.