Servers are built to be extended, and every plug-in point that lets a developer add a module, filter or script also lets an intruder add a backdoor that runs inside a trusted service. MITRE ATT&CK T1505 Server Software Component covers that abuse: web shells, IIS modules and ISAPI filters, SQL Server stored procedures, Exchange transport agents, the Terminal Services DLL and VMware ESXi installation bundles. It sits in the Persistence tactic (TA0003) in ATT&CK v20 and is typically the step that follows T1190 exploitation of an internet-facing application. This guide explains what each sub-technique looks like to a defender, the logs and integrity checks that expose it, and the server settings that close the extension points intruders rely on. It is for server owners, detection engineers and incident responders; for the response steps once a web shell is found, use the Web Shell Response Playbook. It contains no attack procedures.
Key takeaways
- The server process is the tell.
w3wp.exe,sqlservr.exe,apache2ornginxstartingcmd.exe, PowerShell or a shell is rare in normal operation and is the single most reliable web shell signal. - Compare against known good. NSA and ASD recommend comparing the production web root with a verified clean copy by hash; timestamps cannot be trusted because intruders alter them.
- Close the extension points you do not use. Keep
xp_cmdshelland CLR integration disabled, stop the web application identity writing to its own code directories, and enforce signed VIBs on ESXi. - Patching does not evict. A planted component and any secrets it stole, such as ASP.NET machine keys, survive the patch for the vulnerability that let it in.
- Treat every server identity on the host as exposed. Application pool identities, SQL service accounts and connection strings are what the component runs as and what it can read.
How the attack works
ATT&CK describes T1505 as abuse of "legitimate extensible development features of servers to establish persistent access". The component runs inside the server's own process, under its service identity, and is invoked by ordinary traffic: an HTTP request, an email passing through the transport pipeline, a database start-up event or an RDP connection. That makes it quiet on the network and durable across reboots.
| Sub-technique (v20) | Extension point | Where the defender looks |
|---|---|---|
| T1505.001 SQL Stored Procedures | Stored procedures run on demand or at server start; OS commands need extra features such as xp_cmdshell or CLR assemblies | SQL Server audit of procedure and assembly creation, sp_configure changes, sqlservr.exe child processes |
| T1505.002 Transport Agent | .NET assemblies registered with Exchange that act on every message in the transport pipeline; Postfix or Sendmail milters on Linux | Get-TransportAgent output against a baseline, PowerShell 4104, unusual assemblies loaded by the transport service |
| T1505.003 Web Shell | A script placed in a web-accessible directory that gives command execution through the web server | New files in web roots, server process spawning shells, low-prevalence URIs in access logs |
| T1505.004 IIS Components | ISAPI extensions and filters (DLLs) and IIS modules that see every request | Changes to applicationHost.config, unknown DLLs loaded by w3wp.exe, Sysmon 7 and 11 |
| T1505.005 Terminal Services DLL | termsrv.dll or the ServiceDll registry value for the Terminal Services service replaced or redirected | Registry change events (4657, Sysmon 13), file writes to System32, unsigned module loads by svchost.exe |
| T1505.006 vSphere Installation Bundles | VIBs that persist files, start-up tasks or firewall rules across ESXi reboots | /var/log/esxupdate.log, shell history for installs with --force or --no-sig-check, unexpected acceptance levels |
ATT&CK v20 lists eight mitigations for the technique: M1018 User Account Management, M1024 Restrict Registry Permissions, M1026 Privileged Account Management, M1038 Execution Prevention, M1042 Disable or Remove Feature or Program, M1045 Code Signing, M1046 Boot Integrity and M1047 Audit.
Where it shows up
- Edge and collaboration servers after a zero-day: web shells are the standard follow-up to exploitation of SharePoint, Exchange, file transfer and VPN products. See the T1190 Exploit Public-Facing Application Defensive Guide.
- Network and security appliances: ATT&CK lists Network Devices as a platform for web shells, and appliance web interfaces are frequent targets. See the Edge Device Security Guide.
- State-sponsored espionage: ATT&CK records the technique for groups including HAFNIUM, APT29, APT28, Sandworm Team, OilRig and GALLIUM.
- Mail servers: transport agents give silent access to all mail in transit, which suits long-term collection. See the Microsoft Exchange Server Security Guide.
- Database servers: procedures that call the operating system turn database access into host access. See the Microsoft SQL Server Security Guide.
- Hypervisors: malicious VIBs give persistence below every virtual machine on the host. See the VMware ESXi Hardening Guide.
Impact
- Durable re-entry: the component survives reboots, password resets and often the patch for the original vulnerability.
- Execution as the service identity: application pool, SQL service, Exchange or root on ESXi, with access to the secrets that identity holds.
- Secret theft: configuration files, connection strings, certificates and cryptographic keys readable by the server process.
- Data in transit: IIS filters and transport agents can read, change or copy every request or message.
- Pivot point: an internet-facing server with a web shell becomes the entry for lateral movement, which is why NSA and ASD stress DMZ segregation.
Detection
NSA and the Australian Signals Directorate's joint guidance on detecting and preventing web shell malware groups detection into known-good comparison, web traffic anomalies, signatures, unexpected network flows and endpoint process monitoring, and notes that signatures work only against unmodified or lightly modified shells.
| Signal | Source and event | Detection idea |
|---|---|---|
| Server process spawns a shell | Sysmon 1 or EDR; auditd execve rule keyed to the web server UID | Children of w3wp.exe, sqlservr.exe, httpd, nginx, php-fpm or Java application servers such as cmd.exe, powershell.exe, whoami, net.exe, sh |
| New or changed file in a web root | Sysmon 11; file integrity monitoring; auditd watch on /var/www | Script extensions (.aspx, .ashx, .jsp, .php) written outside deployment windows or by the server process itself |
| Known-good drift | Hash comparison of the web root against the release artefact | Any file present in production but absent from the signed release |
| Low-prevalence URIs | IIS or Apache access logs in the SIEM | URIs reached by five or fewer user agents or client IPs, rare user agents and missing referers, the pattern NSA and ASD give as a starting query |
| IIS module or filter registration | Microsoft-IIS-Configuration log; Sysmon 7 for w3wp.exe module loads | New native or managed modules and ISAPI filters, DLLs loaded from non-standard paths |
| SQL Server feature changes | SQL Server Audit; Application log | sp_configure changes to xp_cmdshell or CLR, new assemblies, procedures marked to run at start-up |
| Transport agent changes | Exchange Management Shell logs, PowerShell 4104 | Any agent in Get-TransportAgent output not in the approved list |
| Terminal Services DLL | 4657 and Sysmon 13 on the TermService ServiceDll value; Sysmon 7 | Value not pointing at the default termsrv.dll, or the file hash changing outside a Windows update |
| ESXi VIBs | esxupdate.log, shell.log | Installs with --force or --no-sig-check, community-level VIBs on hosts that should hold only signed bundles |
| Outbound from servers | Firewall and NetFlow | Web or database servers opening connections to the internet that they never made before |
Metrics
- Integrity coverage: percentage of internet-facing web roots under hash comparison or FIM.
- Process telemetry coverage: percentage of web, SQL and Exchange servers sending process creation events.
- Extension inventory: servers whose IIS modules, transport agents and VIBs match an approved baseline at the last check.
- Exposure: SQL Server instances with
xp_cmdshellor CLR enabled, and web roots writable by the application identity. - Time to detect: in purple team tests, minutes from a benign test file in a web root to alert.
Prevention and hardening
| Area | Control | Notes |
|---|---|---|
| Web roots | Application identity cannot write to web-accessible or code directories; uploads stored outside the web root | NSA and ASD's first least-privilege recommendation; confirm with the vendor for packaged products |
| Patching | Automatic or at least daily update checks for internet-facing applications | The guidance notes exploitation often follows a patch within 24 hours; cross-check the CISA KEV catalogue |
| File integrity | Block or alert on file creation and renaming in web directories, with exceptions for permitted types | Start in monitor mode to find conflicts with deployments. See the File Integrity Monitoring Guide. |
| WAF and IPS | Block malicious uploads, ideally with the OWASP Core Rule Set tuned per application | Helps stop initial compromise; unlikely to see web shell traffic afterwards. See the Web Application Firewall Guide. |
| SQL Server | Keep xp_cmdshell disabled (the default on new installations); if a legacy application needs it, enable it only for the task and disable it again | Microsoft's own guidance; also restrict who holds ALTER SETTINGS and sysadmin |
| IIS | Remove unused modules and handlers; restrict who can edit applicationHost.config | See the IIS Hardening Guide. |
| Exchange | Baseline transport agents per server role and alert on changes | Limit Exchange administrative roles that can install agents |
| Windows registry | Protect service registry keys (M1024) and monitor ServiceDll values | Applies to the Terminal Services DLL and to service persistence generally |
| ESXi | Keep the host acceptance level at a signed level, use UEFI Secure Boot, and disable the ESXi Shell and SSH except when needed | M1045 Code Signing and M1046 Boot Integrity in ATT&CK |
| Network | Internet-facing servers in a DMZ with default-deny egress | Limits what a web shell can reach and makes its callbacks visible |
Implementation sequence
- Inventory: list internet-facing web, mail, SQL and file transfer servers, and record their current IIS modules, transport agents, enabled SQL features and ESXi VIBs as the baseline.
- Telemetry first: deploy process creation logging with server-process parent filters and access log forwarding; run in alert-only mode for two weeks to learn legitimate child processes such as health checks.
- Integrity: add hash comparison of web roots against release artefacts in the deployment pipeline, then FIM on the web directories in monitor mode.
- Hardening by ring: remove web root write permissions and unused modules on a pilot server, test the application, then roll out; disable SQL features one instance at a time with the application owner.
- Enforce: switch FIM to blocking where the application tolerates it and require signed VIBs on ESXi.
- Roll back: keep the previous permission set and module list in configuration management so a broken application can be restored in minutes, and record every exception with an owner and expiry date.
Small and large estates
A small organisation with a few web servers gets most of the value from removing write access to web roots, process creation alerts on the server process and a nightly hash comparison. A large estate should build extension baselines into configuration management, put every internet-facing server behind a WAF and egress control, and test detections regularly with harmless canary files. Either way, prefer managed platforms that remove the extension points altogether where the application allows.
Where identity fits
A server component runs as the server's identity and reads what that identity can read. Run application pools and SQL Server under dedicated low-privilege accounts or gMSAs, never as domain administrators, keep connection strings in a vault rather than web.config, and after any web shell finding rotate the service account passwords, keys, certificates and connection strings on the host as well as removing the file. See the Service Account Security Guide.
Lessons from incidents
- Stolen keys outlive the shell: in the ToolShell SharePoint exploitation, a web shell named
spinstall0.aspxwas used to read the ASP.NET machine keys. With those keys an attacker can sign ViewState the server accepts, so patching alone did not end access; the response required rotating the keys, restarting IIS and hunting forw3wp.exespawning PowerShell. - Appliance integrity checks can miss modified components: in the Ivanti Connect Secure exploitation, CISA reported a web shell on an affected device and Mandiant found a credential harvester inserted into a legitimate appliance file, while the vendor's integrity checker failed to detect the compromise. Use external integrity checks, off-box logs and network monitoring as well.
Framework mapping
| Framework | Relevant items |
|---|---|
| MITRE ATT&CK v20 | TA0003 Persistence; T1505.001 to .006; often preceded by T1190 and followed by T1059 execution |
| MITRE D3FEND | D3-FIM File Integrity Monitoring, D3-PA Process Analysis, D3-EAL Executable Allowlisting |
| NIST SP 800-53 Rev. 5 | CM-7 Least Functionality, CM-6 Configuration Settings, SI-7 Software, Firmware, and Information Integrity, SI-4 System Monitoring, AC-6 Least Privilege |
| NIST CSF 2.0 | PR.PS-01 (configuration management), PR.PS-05 (unauthorised software prevented), DE.CM-09 (software and runtime environments monitored) |
| CIS Controls v8.1 | Control 4 Secure Configuration, Control 7 Continuous Vulnerability Management, Control 13 Network Monitoring and Defense |
Practitioner checklist
- Alert on web, SQL and mail server processes spawning shells or reconnaissance tools.
- Remove write access to web roots from application identities and store uploads outside them.
- Compare production web roots with release artefacts by hash after every deployment and nightly.
- Baseline IIS modules, ISAPI filters, Exchange transport agents and ESXi VIBs, and alert on change.
- Keep
xp_cmdshelland CLR disabled unless an owner has approved a time-limited exception. - Monitor the TermService
ServiceDllvalue andtermsrv.dllhash. - Apply default-deny egress to internet-facing servers.
- After any finding, rotate every secret the server identity could read, not just the vulnerable component.
Standards and references
- MITRE ATT&CK: Server Software Component (T1505)
- MITRE ATT&CK: Web Shell (T1505.003)
- NSA and ASD: Detect and Prevent Web Shell Malware
- Microsoft Learn: xp_cmdshell server configuration option
- Microsoft Learn: Get-TransportAgent
- MITRE ATT&CK: vSphere Installation Bundles (T1505.006)
- CISA: Known Exploited Vulnerabilities Catalog
- MITRE D3FEND: File Integrity Monitoring
Related NHI Mgmt Group resources: Web Shell Response Playbook · Persistence Techniques Guide · SharePoint Server Security Guide · Edge Device Compromise Investigation Playbook · T1543 Create or Modify System Process Defensive Guide