What is Web Shell?
A small script left on your web server that lets an attacker run commands through a normal-looking web request. Persistent, easy to miss, and the standard follow-up to exploiting an internet-facing application.
A Web Shell is adversary code planted on a web or application server that accepts commands over HTTP. It is the usual second step after exploiting an internet-facing application, and it is durable: it survives reboots, it survives the credential resets that follow an incident, and it frequently survives patching, because patching the vulnerability does not remove what was installed through it. That last point is the one leadership most needs to hear. Organisations that patch a widely exploited edge vulnerability and consider the matter closed are regularly found to have been compromised before the patch, with a web shell still in place. When a mass-exploitation event affects a product you run, the correct response is to patch and then to hunt for compromise. Detection relies on file integrity monitoring on web content directories, on web server logs showing requests to unfamiliar paths, and on the distinctive signal of a web server process spawning a command interpreter.
Source: MITRE ATT&CK (T1505.003).
Practice it in a lab
Free, hands-on labs that teach Web Shell.
- Detect a web shell: hunt it in your web server logs and on disk (intermediate, ~50 min)
- Deploy a web shell to Apache Tomcat Manager in your own lab (intermediate, ~45 min)