Lion Cipher Lab

Recover where an attacker SSHed to from a hashed known_hosts file

Why it matters

When an attacker takes over a Linux account, one of the first questions in the incident is: where did they go next? The account's ~/.ssh/known_hosts file quietly answers it, because the SSH client writes a line there the first time it connects to any new server. Attackers know this too: MITRE ATT&CK records malware such as Kinsing and Rocke reading known_hosts to find more machines to attack. That is why many Linux systems store the names in a hashed form, which hides them from a casual reader. Hashing is one-way, so you cannot decode the names, but you can test guesses. Each guess either…

What you'll learn

Steps in this lab

  1. Why known_hosts is a record of lateral movement
  2. Read a known_hosts line field by field
  3. When names are hashed, and when they are not
  4. Build the evidence folder
  5. Test candidate names in stages and measure each stage
  6. Read what each stage bought you
  7. Cross-check with ssh-keygen -F, and its wildcard trap
  8. When no name works, match the host key instead
  9. What known_hosts cannot tell you
  10. Turn the result into the next moves

Open the full interactive lab →