Lion Cipher Lab

Detect a web shell: hunt it in your web server logs and on disk

Why it matters

A web shell is one of the most common ways an attacker turns a single web-application bug into a durable foothold: a few lines of PHP, JSP or ASPX dropped into a web-reachable folder give them a command prompt on your server that they reach with an ordinary web request. It is the technique behind a long list of real intrusions — mass exploitation of Exchange, of file-transfer appliances, of forgotten upload forms — because it is cheap to plant, survives reboots, and blends into a directory full of legitimate web files while running as the harmless-looking web-server user. That camouflage is…

What you'll learn

Steps in this lab

  1. What a web shell is, and why it is hard to spot
  2. The authorized, defensive framing (read this before you build anything)
  3. Stand up a throwaway PHP server, a normal site, and a baseline
  4. Simulate the compromise: drop the benign shell artifact and use it
  5. Hunt on disk: newest files, recent mtime, and code smells
  6. Hunt in the access log: the endpoint, the client, the query, the source
  7. The strongest signal: the web server spawns a shell
  8. Judgment: when each signal is reliable, and how to do better than one check
  9. What you built — and clean up

Open the full interactive lab →