Explore our new Cybersecurity Terms Glossary, explained by our experts.
Cybersecurity Terms Glossary
A web shell is a malicious script uploaded to a web server that gives an attacker remote, persistent control of the server through ordinary web requests.

What Is a Web Shell?
A web shell is a malicious script that an attacker places on a web server to control it remotely. Once installed, it lets the attacker run commands, browse and upload files, access databases, and move deeper into the network, simply by sending web requests to a particular page. Because the traffic looks like ordinary HTTP or HTTPS, web shells can operate for long periods without attracting attention.
Web shells are written in whatever language the server supports, such as PHP, ASP.NET, JSP, or Python. Some are full-featured control panels with file managers and database tools; others, such as the notorious China Chopper, are a single line of code that simply executes whatever the attacker sends.
Attackers plant web shells by exploiting weaknesses in internet-facing applications:
The best-known web shell campaign followed the ProxyLogon vulnerabilities in Microsoft Exchange Server, disclosed in March 2021. A Chinese state-sponsored group, later followed by many others, exploited the flaws before and after patches were released, installing web shells on tens of thousands of Exchange servers worldwide, including in the UK. Even organisations that patched quickly had to hunt for web shells already in place, because patching closed the vulnerability but did not remove the backdoor. Similar patterns followed ProxyShell later in 2021, and attacks on file transfer products such as MOVEit Transfer in 2023, where attackers deployed a custom web shell called LEMURLOOT.
A web shell is rarely the end goal. It is a foothold for:
Web shells are designed to blend in, but several approaches reveal them:
Finding a web shell means the server has been compromised. Removing the file is not enough: investigators must determine how it got there, what the attacker did, whether credentials were stolen, and whether other footholds exist elsewhere in the network. Preserve logs and disk images before cleaning up.
At Privia Security, our Incident Response Services investigate web shell compromises end to end, and our web application testing finds the upload and execution flaws that let them in.
Look for unexpected script files in web directories, especially recently created or modified ones, web server processes launching command shells, unusual POST requests in access logs, and outbound connections from the server. File integrity monitoring and endpoint detection make this much easier. If you find one, treat it as a full compromise and investigate further.
No. Patching closes the vulnerability used to install the web shell, but any web shell already planted remains in place and keeps working. After serious vulnerabilities such as ProxyLogon, organisations had to patch and then hunt for existing web shells and other signs of compromise. Investigation is essential even after a prompt patch.
A WAF can block many attempts to exploit the vulnerabilities used to upload web shells and may detect some known web shell traffic patterns. It cannot remove a web shell that is already present, and attackers can disguise their requests. Combine a WAF with patching, secure upload handling, file integrity monitoring, and endpoint detection.
You May Be Interested In These
We use a few cookies that are needed to make this website work, and they are always on. We would also like to set analytics cookies, to see which pages are useful; functional cookies, so that our live chat works; and advertising cookies, to measure our campaigns. We will not set any of those until you say yes, and you can change your mind at any time from the Cookie Settings link in the footer.
Choose the cookies you are happy for us to use. Strictly necessary cookies are always on; everything else is off until you turn it on.
These cookies keep the website working: they hold your security checks, your form submissions and the choice you make here. The site cannot run without them, so they are always on.
These let our live chat open and remember your conversation, and let the newsletter sign-up work. Switch them off and the chat window will not appear.
These tell us which pages are read and how people find us, so that we can improve the site. The reports are about groups of visitors, never about you personally.
These let us measure our advertising and show you our adverts on other websites, such as LinkedIn, Google and Meta. Switch them off and you will still see adverts, but they will be less relevant.