A web shell is a small script that an attacker places on a web server. It lets the attacker run commands on that server from a distance. Because it sits on the server itself, it keeps working even if the first way in is closed, which is why attackers use it to keep access to the network over time.
Last updated 10 October 2026
Profile MapTechnique
Reconnaissance
Resource Development
Initial Access
Execution
Persistence
Privilege Escalation
Stealth
Defense Impairment
Credential Access
Discovery
Lateral Movement
Collection
Command and Control
Exfiltration
Impact
Persistence · Step 5 Of 15 In The Attack Chain
MITRE IDT1505.003ATT&CK technique
Detection4ways to spot itNew scripts in web folders · Web server starting shells
Defences3ways to stop itTurn off risky functions · Audit server components
How it works
Attackers put a web shell on a server that they can reach from the internet. The shell is a script that the web server runs like any other page.
The script gives the attacker a way to run commands or use a command line on the server. It is often paired with a client program that the attacker uses to talk to it.
Because the shell sits on the server itself, it keeps working even if the attacker’s first way in is closed. This is why MITRE files it under persistence, as one case of abusing server software components.
A real example
MITRE ATT&CK lists China Chopper as having a server component that is itself a web shell payload.
MITRE ATT&CK lists Agrius as typically deploying a variant of the ASPXSpy web shell after gaining initial access through exploitation.
MITRE ATT&CK lists APT28 as using a modified and obfuscated version of the reGeorg web shell to keep access to a target's webmail server.
MITRE ATT&CK lists APT5 as installing multiple web shells on compromised servers, including on VPN appliances.
MITRE ATT&CK lists BUSHWALK as a web shell that can run arbitrary commands or write files.
Consider disabling functions in web technologies, such as PHP's eval(), that can be abused.
Limit who can change web folders
Apply least privilege so only authorized accounts can modify web directories.
Audit server components
MITRE's guidance for server software components also advises regular checks for unexpected changes and turning off unneeded server features.
Questions
What is a web shell?
A web shell is a script placed on a web server that the server runs like any other page. It gives the attacker a way to run commands or use a command line on the server.
Why do attackers use web shells?
The shell sits on the server itself, so it keeps working even if the attacker's first way in is closed. This is why MITRE files it under persistence.
How can I detect a web shell?
Watch for unplanned new scripts in web folders and for the web server process starting command shells or unexpected utilities. MITRE points to process execution, file creation events and web server logs.
How do I defend against web shells?
Limit who can change web folders using least privilege, and consider disabling risky functions such as PHP's eval(). Regularly check for unexpected changes and turn off unneeded server features.
NetScaler zero-day flaws CVE-2026-88771 and CVE-2026-88772 are exploited at CVSS 9.5. See the fixed builds, what evidence to capture first and what to rotate.
Our H1 2026 analysis found that 32.1% of exploited vulnerabilities were attacked before a fix even existed. Patch velocity cannot close that window. See…
Attributed by the US, UK and South Korean governments to North Korea's Reconnaissance General Bureau, Andariel is described in a July 2024 joint advisory as stealing defense, aerospace and nuclear secrets and funding that work with ransomware against US healthcare. MITRE ATT&CK describes it as a sub-set of Lazarus Group; the advisory does not use that term.
Attributed by MITRE ATT&CK and by the US Department of Justice (5 March 2025) to a Chinese group, also called Threat Group-3390 and Emissary Panda, that targets governments and companies. The Justice Department charged two men it calls APT27 actors, alleging profit-driven hacking from 2013 to 2024.
Read more →
Stay Ahead of Digital Threats
Take control of your digital security with an exclusive demo of our AI-driven threat intelligence platform.