Safeguard
Application Security•

Detecting Malicious IIS Components (T1505.004)

ISAPI filters and IIS modules see every web request. What MITRE documents about their abuse, and how to audit, restrict and sign what runs in IIS.

Safeguard Security Team
3 min read

IIS Components (T1505.004) is a persistence technique on Windows. Internet Information Services offers several ways to extend a web server, and MITRE explains how an adversary can install malicious components to keep access.

How attackers use it

IIS supports Internet Server Application Programming Interface (ISAPI) extensions and filters. They are deployed as DLL files that can examine and change incoming and outgoing requests. MITRE notes that these may have access to all IIS web requests and responses.

MITRE says adversaries may install malicious ISAPI extensions and filters to observe or modify traffic, run commands on compromised machines, or proxy command and control traffic. One example is changing HTTP responses to hand malicious commands or content to hosts that were already compromised.

IIS modules, introduced in IIS 7.0, give the same unrestricted access to requests and responses. A module can be a DLL that exports RegisterModule, or a .NET application that uses ASP.NET APIs. Adversaries may use malicious modules to observe or modify traffic as well.

How to detect it

MITRE's analytic describes an adversary installing or changing ISAPI filters, extensions or modules by registering DLL files through configuration changes or administrative tools such as AppCmd.exe. Those components then intercept or manipulate requests and responses.

Useful signals include new DLLs in IIS related folders, changes to IIS configuration files, use of AppCmd.exe outside change windows, and the web server worker process loading DLLs that are not on your baseline.

How to reduce the risk

MITRE lists four mitigations:

  1. Privileged Account Management: do not use administrator accounts that can add IIS components for daily work.
  2. Execution Prevention: specify the list of ISAPI extensions and filters that are allowed to run, so unlisted ones are blocked.
  3. Audit: regularly check installed IIS components for unexpected changes.
  4. Code Signing: make sure IIS DLLs and binaries are signed by the correct developers.

Check your own environment

This read only command, run on the IIS server, lists the modules IIS is configured to load:

& "$env:windir\system32\inetsrv\appcmd.exe" list modules

Compare the result against a saved baseline. Also check that each custom DLL is signed by a publisher you expect:

Get-AuthenticodeSignature -FilePath C:\path\to\module.dll

Quick check

Why is an IIS module so powerful for an adversary?

Modules get unrestricted access to HTTP requests and responses, the same as ISAPI extensions and filters, so they can observe or change all traffic through the server.

Sources

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.