Join our Newsletter — 33% off our NHI Course
Home› Guides› T1505 Server Software Component Defensive Guide: Finding Web…
Guide Attack Techniques & Malware

T1505 Server Software Component Defensive Guide: Finding Web Shells and Malicious Server Modules

PDF for newsletter subscribers · free to read online

← All guides
By NHI Mgmt Group, edited by Lalit Choda Updated 27 October 2026 12 min read
On this page

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, apache2 or nginx starting cmd.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_cmdshell and 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 pointWhere the defender looks
T1505.001 SQL Stored ProceduresStored procedures run on demand or at server start; OS commands need extra features such as xp_cmdshell or CLR assembliesSQL 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 LinuxGet-TransportAgent output against a baseline, PowerShell 4104, unusual assemblies loaded by the transport service
T1505.003 Web ShellA script placed in a web-accessible directory that gives command execution through the web serverNew files in web roots, server process spawning shells, low-prevalence URIs in access logs
T1505.004 IIS ComponentsISAPI extensions and filters (DLLs) and IIS modules that see every requestChanges to applicationHost.config, unknown DLLs loaded by w3wp.exe, Sysmon 7 and 11
T1505.005 Terminal Services DLLtermsrv.dll or the ServiceDll registry value for the Terminal Services service replaced or redirectedRegistry change events (4657, Sysmon 13), file writes to System32, unsigned module loads by svchost.exe
T1505.006 vSphere Installation BundlesVIBs 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.

SignalSource and eventDetection idea
Server process spawns a shellSysmon 1 or EDR; auditd execve rule keyed to the web server UIDChildren 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 rootSysmon 11; file integrity monitoring; auditd watch on /var/wwwScript extensions (.aspx, .ashx, .jsp, .php) written outside deployment windows or by the server process itself
Known-good driftHash comparison of the web root against the release artefactAny file present in production but absent from the signed release
Low-prevalence URIsIIS or Apache access logs in the SIEMURIs 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 registrationMicrosoft-IIS-Configuration log; Sysmon 7 for w3wp.exe module loadsNew native or managed modules and ISAPI filters, DLLs loaded from non-standard paths
SQL Server feature changesSQL Server Audit; Application logsp_configure changes to xp_cmdshell or CLR, new assemblies, procedures marked to run at start-up
Transport agent changesExchange Management Shell logs, PowerShell 4104Any agent in Get-TransportAgent output not in the approved list
Terminal Services DLL4657 and Sysmon 13 on the TermService ServiceDll value; Sysmon 7Value not pointing at the default termsrv.dll, or the file hash changing outside a Windows update
ESXi VIBsesxupdate.log, shell.logInstalls with --force or --no-sig-check, community-level VIBs on hosts that should hold only signed bundles
Outbound from serversFirewall and NetFlowWeb 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_cmdshell or 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

AreaControlNotes
Web rootsApplication identity cannot write to web-accessible or code directories; uploads stored outside the web rootNSA and ASD's first least-privilege recommendation; confirm with the vendor for packaged products
PatchingAutomatic or at least daily update checks for internet-facing applicationsThe guidance notes exploitation often follows a patch within 24 hours; cross-check the CISA KEV catalogue
File integrityBlock or alert on file creation and renaming in web directories, with exceptions for permitted typesStart in monitor mode to find conflicts with deployments. See the File Integrity Monitoring Guide.
WAF and IPSBlock malicious uploads, ideally with the OWASP Core Rule Set tuned per applicationHelps stop initial compromise; unlikely to see web shell traffic afterwards. See the Web Application Firewall Guide.
SQL ServerKeep xp_cmdshell disabled (the default on new installations); if a legacy application needs it, enable it only for the task and disable it againMicrosoft's own guidance; also restrict who holds ALTER SETTINGS and sysadmin
IISRemove unused modules and handlers; restrict who can edit applicationHost.configSee the IIS Hardening Guide.
ExchangeBaseline transport agents per server role and alert on changesLimit Exchange administrative roles that can install agents
Windows registryProtect service registry keys (M1024) and monitor ServiceDll valuesApplies to the Terminal Services DLL and to service persistence generally
ESXiKeep the host acceptance level at a signed level, use UEFI Secure Boot, and disable the ESXi Shell and SSH except when neededM1045 Code Signing and M1046 Boot Integrity in ATT&CK
NetworkInternet-facing servers in a DMZ with default-deny egressLimits what a web shell can reach and makes its callbacks visible

Implementation sequence

  1. 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.
  2. 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.
  3. Integrity: add hash comparison of web roots against release artefacts in the deployment pipeline, then FIM on the web directories in monitor mode.
  4. 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.
  5. Enforce: switch FIM to blocking where the application tolerates it and require signed VIBs on ESXi.
  6. 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.aspx was 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 for w3wp.exe spawning 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

FrameworkRelevant items
MITRE ATT&CK v20TA0003 Persistence; T1505.001 to .006; often preceded by T1190 and followed by T1059 execution
MITRE D3FENDD3-FIM File Integrity Monitoring, D3-PA Process Analysis, D3-EAL Executable Allowlisting
NIST SP 800-53 Rev. 5CM-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.0PR.PS-01 (configuration management), PR.PS-05 (unauthorised software prevented), DE.CM-09 (software and runtime environments monitored)
CIS Controls v8.1Control 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_cmdshell and CLR disabled unless an owner has approved a time-limited exception.
  • Monitor the TermService ServiceDll value and termsrv.dll hash.
  • 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

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

PDF for subscribers

Take this guide with you

Every section, table and checklist in one PDF, with links to the sources and related guides. Subscribe to our weekly NHI & AI Identity Journal and we’ll email you a download link.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Researched and written by the NHI Mgmt Group editorial team using AI tools, under the editorial direction of Lalit Choda. Facts are drawn from the sources listed on this page and checked by our automated quality process. Last updated 27 October 2026. Spotted an error? Use our contact page.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM and Agentic AI security. nhimg.org

PDF Downloads for Newsletter Subscribers

Get the guide

Enter your details and we’ll email you a download link.

The full guide is free to read online. The PDF is a thank you for subscribing.

Fill in all fields marked * and tick the PDF box to continue.