Get Started

Read server logs like an analyst and find the attack

This is the blue team side of the track: the work of the defender who reads what a server wrote down and spots the attack inside it. You build a tiny log lab on your own machine (no root, no Docker), run a real OpenSSH server on localhost, then knock on it with failed logins the way a brute-force bot would, so the logs fill with real attack entries you created yourself. Then you do the analyst's job on them: read the SSH auth log with journalctl, find the failed logins and the address they came from, count the attempts per source with a grep and awk pipeline until the one noisy attacker stands out from the quiet, read a web server access log for the scanners sweeping for vulnerable pages, and finally turn detection on with fail2ban and summarise the web log with GoAccess. Every log line you analyse is one your own activity produced, against your own box. It pairs with Harden a server (the defence you apply once you can see the attack) and Build a hacking lab (which sets the one rule everything here obeys).

59 minIntermediateTools: FreeStep 1 free
Tested 12 Oct 2026 · Built and run end to end on Ubuntu 24.04.3 LTS (kernel 6.6.87.2-microsoft-standard-WSL2) under WSL2 on Windows 11, with Python 3.12.3. The lab runs real Ubuntu-archive builds fetched without root and unpacked into the home folder: OpenSSH sshd 9.6p1 (OpenSSL 3.0.13), fail2ban 1.0.2, GoAccess 1.8.1, plus sshpass 1.09 to send the failed passwords. The SSH server listens only on 127.0.0.1:2222; every brute-force attempt and scanner request below came from loopback source addresses (127.0.0.2 to 127.0.0.77) that this mission generated against that server. No external host was contacted, so there were no real external IPs to redact. All command output shown is from that run; the GoAccess screenshot is the real HTML report the lab produced, captured with headless Chrome. The kit scripts were run from a clean home folder to confirm they reproduce these exact numbers.
A log lab you build in minutes with no root and no Dockera real OpenSSH server on localhost that you attack yourself, so the auth log holds genuine brute-force entries, plus a web access log full of real scanner traffic you generated
The core analyst loop done on real logsread the SSH auth log with journalctl, find the failed logins and the attacking address, then count attempts per source with a grep and awk pipeline until the one heavy attacker separates from the noise
Detection switched on and provenfail2ban reading your auth log, banning the two addresses that crossed the threshold and leaving the near-miss alone, and a one-screen GoAccess summary of the web log that puts the scanners at the top
Before you start
  • A Linux-style terminal. On Windows that is WSL2 (the slim Linux built into Windows), which has journalctl, apt and systemd; on Linux your normal terminal. The exact lab uses journalctl and the Ubuntu package archive, so it is Linux and WSL2 only, not macOS
  • The lab-only mindset from Build a hacking lab: you generate attack traffic only against software you run yourself, never against anyone else's machine. This mission stays inside that rule from the first command to the last
  • It pairs with Harden a server. That lesson shuts the doors; this one teaches you to see the attacker testing them. Doing either first is fine. Nothing here depends on Docker, so you can do this one even if you skipped that setup
  • About 60MB of disk for the unpacked tools, a working internet connection the first time (to fetch them from the Ubuntu archive), and Python 3, which Ubuntu already has
01/08Why logs, and the analyst's one habit0 done
STEP 01 of 08~5 min

Why logs, and the analyst's one habit

Understand what a log is, why the defender lives in it, and the single mental habit that turns a wall of text into a finding. Fix in your mind that this only happens on your own box.

  1. Almost every program on a server keeps a diary. A log is that diary: an append-only record of events, one line each, written as they happen, with the time, what happened and often who it involved. When someone logs in over SSH, a line is written. When a web server answers a request, a line is written. When a login fails, that is written too. The attacker cannot easily stop these lines being recorded, which is exactly why they are the defender's best evidence. An attack is not invisible; it is usually sitting in a log, waiting for someone to read it.

  2. Reading logs is the first skill of blue team work (defence) and of DFIR, digital forensics and incident response: the job of working out, from what a machine recorded, what happened to it. You do not need special tools to start. The logs are plain text, and the standard terminal commands, read in the right order, answer the questions that matter: who connected, what did they try, how often, and from where.

  3. The one habit that separates an analyst from someone staring at scrolling text is this: baseline first, then anomalies. Learn what normal looks like, so the abnormal announces itself. A quiet server has a handful of SSH logins a day, from addresses you recognise. One failed login is a typo. The anomaly is volume and shape: two hundred failed logins in a minute, from one address, trying username after username. You are not reading every line. You are learning the shape of calm, then looking for the spike that breaks it.

  4. This whole lesson is defensive. You will generate attack traffic, but only so there is something real to find, and only against a server you run on your own machine. The skill you build is recognising the signs of an attack in what a system recorded, so that on a real server you own you can tell the difference between a normal Tuesday and someone trying to break in.

    CarefulYou will create failed logins and scanner requests in this mission. Generate them only against your own lab server, which listens on your own machine's loopback address and nowhere else. Sending failed logins or vulnerability scans at a server you do not own or have written permission to test is an offence in the UK (the Computer Misuse Act 1990) and almost everywhere else, even if nothing breaks. Every attack in this mission is aimed at a box you built, on the address 127.0.0.1, which is your own machine talking to itself.
    TipThe same line the attack track opened with, read from the defender's chair. In the attack lessons you only attacked software built to be attacked. Here you only read the logs of a server you own. Before any command, the question is the same: is this my machine? For the whole of this mission, yes.
✓
CheckpointYou can say what a log is in one sentence, and explain why 'baseline first, then anomalies' is more useful than trying to read every line.
Stuck? Ask the community
Next mission · Ethical hackingCrack your own passwords to see how strong they really are
→