Web Shell

From enterprise
Jump to: navigation, search
Web Shell
ID T1100
Tactic Persistence, Privilege Escalation
Platform Linux, macOS, Windows
System Requirements Adversary access to Web server with vulnerability or account to upload and serve the Web shell file.
Effective Permissions User, SYSTEM
Data Sources Anti-virus, File monitoring, Process monitoring, Authentication logs, Netflow/Enclave netflow

A Web shell is a Web script that is placed on an openly accessible Web server to allow an adversary to use the Web server as a gateway into a network. A Web shell may provide a set of functions to execute or a command-line interface on the system that hosts the Web server. In addition to a server-side script, a Web shell may have a client interface program that is used to talk to the Web server (see, for example, China Chopper Web shell client).1

Web shells may serve as Redundant Access or as a persistence mechanism in case an adversary's primary access methods are detected and removed.


  • APT32 has used Web shells to maintain access to victim websites.2
  • APT34 has frequently used Web shells, often to maintain access to a victim network.3
  • Deep Panda uses Web shells on publicly accessible Web servers to access victim networks.4
  • Dragonfly used Web shells to maintain access to a victim network and download additional malicious files.5
  • OilRig has installed Web shells onto victim Web servers.6
  • ASPXSpy is a Web shell.7 The ASPXTool version used by Threat Group-3390 has been deployed to accessible servers running Internet Information Services (IIS).7
  • The China Chopper backdoor is a Web shell that supports server payloads for many different kinds of server-side scripting languages and contains functionality to access files, connect to a database, and open a virtual command prompt.1
  • OwaAuth is a Web shell that appears to be exclusively used by Threat Group-3390.7 It is installed as an ISAPI filter on Exchange servers and shares characteristics with the China Chopper Web shell.7
  • SEASHARPEE is a Web shell.3


Ensure that externally facing Web servers are patched regularly to prevent adversary access through Exploitation of Vulnerability to gain remote code access or through file inclusion weaknesses that may allow adversaries to upload files or scripts that are automatically served as Web pages.

Audit account and group permissions to ensure that accounts used to manage servers do not overlap with accounts and permissions of users in the internal network that could be acquired through Credential Access and used to log into the Web server and plant a Web shell or pivot from the Web server into the internal network.8


Web shells can be difficult to detect. Unlike other forms of persistent remote access, they do not initiate connections. The portion of the Web shell that is on the server may be small and innocuous looking. The PHP version of the China Chopper Web shell, for example, is the following short payload:1

<?php @eval($_POST['password']);>

Nevertheless, detection mechanisms exist. Process monitoring may be used to detect Web servers that perform suspicious actions such as running cmd or accessing files that are not in the Web directory. File monitoring may be used to detect changes to files in the Web directory of a Web server that do not match with updates to the Web server's content and may indicate implantation of a Web shell script. Log authentication attempts to the server and any unusual traffic patterns to or from the server and internal network.8