ISAPI Extensions Guide

FDN » IIS » ISAPI Extensions Guide

ISAPI Extensions Guide

ISAPI (Internet Server Application Programming Interface) lets you write high-performance DLLs that run inside the IIS process. ISAPI extensions handle requests directly; ISAPI filters intercept requests before they reach the extension.

ISAPI Extensions vs. Filters

FeatureExtensionFilter
PurposeProcesses HTTP requests and generates responsesModifies or inspects requests/responses in the pipeline
Entry PointsHttpExtensionProc, GetExtensionVersionHttpFilterProc, GetFilterVersion
URL MappingMapped by file extension (e.g., .asp → asp.dll)Runs on every request to the site
ExamplesASP engine (asp.dll), custom CGI replacementURL rewriting, custom authentication, logging

How ASP Works (ISAPI Extension)

The ASP engine (asp.dll) is an ISAPI extension. When IIS receives a request for a .asp file, it passes the request to asp.dll, which parses the file, executes the VBScript or JScript code, and returns the HTML output to the client.

Application Mappings

Application mappings associate file extensions with ISAPI DLLs. To view or modify them:

  1. Right-click the web site → PropertiesHome Directory tab → Configuration.
  2. The App Mappings tab shows all registered extensions.
ExtensionISAPI DLL
.aspC:\WINNT\System32\inetsrv\asp.dll
.asaC:\WINNT\System32\inetsrv\asp.dll
.cdxC:\WINNT\System32\inetsrv\asp.dll
.cerC:\WINNT\System32\inetsrv\asp.dll
.shtmlC:\WINNT\System32\inetsrv\ssinc.dll

Security Considerations

  • Remove unused ISAPI mappings to reduce attack surface (e.g., .htr, .idc, .printer)
  • ISAPI extensions run in the IIS process: a bug can crash the entire server. Test thoroughly.
  • Use the IIS Lockdown Tool to remove unnecessary extensions and features.
« Developer Network ‹ IIS Authentication and SSL IIS Metabase Reference ›