Cyber Security Labs (Beginner → Advanced)

Lesson 11 of 12

Lab 11 — Threat Hunting in Logs

Hunt brute-force attacks, impossible travel and data exfiltration hidden in authentication and web logs.

🔴 Advanced 160 XP

Learn it

Every login, file access and web request leaves a line in a log.

Attacks leave patterns: many failed logins, logins from strange places, huge downloads at 3 a.m.

Threat hunting means searching logs for attackers before an alarm goes off.

Key terms

SIEM
Security Information and Event Management — collects and searches logs from many systems.
Password spraying
Trying a few common passwords against many accounts.
Impossible travel
Logins from distant locations too close in time to be genuine.
Exfiltration
Unauthorised transfer of data out of an organisation.
False positive
An alert that looks bad but is actually harmless.

Hunt through a night of logs

Read these log lines and build the story.

  1. 11. 02:10: 40 failed logins across 40 different accounts from 45.83.x.x — password spraying.
  2. 22. 02:14: One success: j.novak logs in from 45.83.x.x with 'Spring2026!'.
  3. 33. 02:20: j.novak also active from Prague 10 minutes earlier — impossible travel.
  4. 44. 02:31: j.novak downloads 4.2 GB from the HR share — far above normal (20 MB/day).
  5. 55. 02:45: Upload to a file-sharing site — likely exfiltration.
  6. 66. Response: Disable the account, revoke sessions, block the IP, enforce MFA and notify the data protection officer.

Detecting password spraying

pythonfrom collections import defaultdict

logs = [
  ('45.83.1.9', 'a.smith', 'FAIL'), ('45.83.1.9', 'b.lee', 'FAIL'),
  ('45.83.1.9', 'c.ng', 'FAIL'),    ('45.83.1.9', 'j.novak', 'OK'),
  ('10.0.0.5', 'm.ross', 'FAIL'),
]

users_per_ip = defaultdict(set)
for ip, user, result in logs:
    if result == 'FAIL':
        users_per_ip[ip].add(user)

for ip, users in users_per_ip.items():
    if len(users) >= 3:
        print(f'Possible spraying from {ip}: {len(users)} accounts')

Grouping failed logins by IP and counting distinct accounts reveals spraying, which a per-account lockout would miss.

Try it

True or false?

Password spraying usually triggers account lockouts quickly.

A login from Prague and Sydney 5 minutes apart is suspicious.

Every alert is a real attack.

Logs should be stored where attackers cannot easily delete them.

Challenge

Write three detection rules in plain English (or pseudo-SQL): one for password spraying, one for impossible travel and one for exfiltration. Give each a threshold and explain one possible false positive.

Pick whichever way suits you — every mode earns the same bonus XP.

Write at least 40 more characters to submit.

Mark your own work

Guided walkthrough — 0/3 clues revealed

  1. Clue 1 locked — reveal it only if you get stuck.
  2. Clue 2 locked — reveal it only if you get stuck.
  3. Clue 3 locked — reveal it only if you get stuck.

Each clue costs 8 XP (never below 40 XP). You'd earn 80 XP right now.

Quiz time

Question 1 of 3Score 0

Many accounts each failing once from one IP suggests…