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.
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.
- In September and October 2026, admins reported PHP web shells in the app folder of Nextcloud servers attacked through CVE-2026-110447. See our Nextcloud Collabora CODE Server news post.
- Sansec reported on 24 October 2026 that a Magento CMS block loader reached 471 stores in one hour in March. The operator first uploaded web shells through the PolyShell flaw (CVE-2026-48356). CISA added that CVE to its Known Exploited Vulnerabilities catalog on 27 October 2026. See our Magento CMS block loader news post.
Who uses it
- Ransomware group BianLian BianLian is a ransomware and data extortion group that the FBI, CISA and Australia's ACSC say is likely based in Russia. Active · Since 2022 · Developer and deployer group with Russia-based affiliates
- Ransomware group Cl0p Cl0p is a ransomware operation first seen in February 2019 and, per a joint FBI and CISA advisory (AA23-158A, June 2023), also known as TA505. Active · Since 2019 · Ransomware as a service, and data theft campaigns (per the advisory)
Seen in incidents
- Incident Microsoft Exchange ProxyLogon mass exploitation, 2021 The Microsoft Exchange ProxyLogon attacks of early 2021 used four previously unknown flaws in on-premises Exchange Server to reach email servers around the world. March 2021 · Multiple sectors
- Incident MirrorFace campaigns against Japan, 2019 to 2025 On 8 January 2025 Japan's National Police Agency (NPA) and the National center of Incident readiness and Strategy for Cybersecurity (NISC) said that cyberattack campaigns against Japanese organizations since about 2019 were run by an actor called MirrorFace. 2019 to 2025 · Government and public sector
- Incident SharePoint ToolShell attacks In July 2025, attackers exploited flaws in on-premises Microsoft SharePoint Server in an attack chain called ToolShell. July 2025 · Multiple sectors
How to detect
-
New scripts in web folders
Watch for files created in web directories that nobody planned, especially scripts that are not part of normal site updates.
-
Web server starting shells
Look for the web server process starting command shells or unexpected system utilities soon after a new file appears.
-
Log sources
MITRE points to process execution, file creation events and web server activity logs as the data to review.
-
Data sources MITRE lists
File Creation, File Modification, Logon Session Creation, Network Traffic Content, Process Creation
How to defend
-
Turn off risky functions
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.
Frequently Asked 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.
