Lion Cipher Lab

Build an SSH tarpit from scratch and measure the slowdown

Why it matters

Any SSH service exposed to the internet is hit within minutes by automated scanners trying default and leaked credentials, around the clock. The common answer is to BLOCK them -- fail2ban, CrowdSec and sshguard all watch the logs and firewall an IP after a few failures, and Lion Cipher has labs for each. A tarpit is the opposite, older, and oddly satisfying idea, popularised by Chris Wellons' 'endlessh': instead of slamming the door, you hold it open a crack and waste the bot's time. The SSH protocol lets a server send arbitrary banner lines before it identifies itself, so a tarpit accepts…

What you'll learn

Steps in this lab

  1. What a tarpit is -- and how it is the opposite of a ban
  2. The one rule of the SSH banner the whole trick rides on
  3. Write the tarpit server (accept, then dribble forever)
  4. Write the measuring client and a normal server to compare against
  5. Run it and read the two numbers that matter
  6. Concurrency: hold many at once, and prove the cap is mandatory
  7. Honest negatives: what a tarpit does NOT do
  8. Do it better: when to use it, and how to pair it with a ban

Open the full interactive lab →