Read an Auth Log: Find the Brute Force
- Beginner
- 32 min
- Blue Team
- Forensics
- SSH
- Logs
- 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.
Simran starts you on the SSH side. auth.log is where sshd, sudo and cron write down every login, every privilege change and every session. On a quiet night it holds a few hundred lines; this one holds more. Somewhere in it is the moment someone outside Kestrel got a shell.
You will separate a brute force from background noise by volume, count exactly, and find the one line that turns noise into an incident: Accepted password.
What you will learn
- Read sshd's lines in auth.log: failed, invalid user, accepted, closed
- Rank source addresses by failed logins with
grep -o,sortanduniq -c - Count exactly with fixed strings and whole-word matches
- Find the success after the failures, and when it happened
Before you start
- Comfortable in a Linux shell:
grep, pipes and redirecting with> sudofor files another account owns — you have it here
Tasks
- 01Who was knocking?
- 02How many guesses, exactly?
- 03Did they get in?
- 04When?