Skip to content
Lab 1 of 6

Read an Auth Log: Find the Brute Force

Hundreds of failed SSH logins in one night — and a slow scanner, a staffer's typo and the cron daemon in the same file. Find who was guessing, how hard, which account fell and when.
  • 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, sort and uniq -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 >
  • sudo for files another account owns — you have it here

Tasks

  1. 01Who was knocking?
  2. 02How many guesses, exactly?
  3. 03Did they get in?
  4. 04When?

Next in this course