Article ID: 326444 - Last Review: July 7, 2008 - Revision: 6.1 How to configure the URLScan ToolThis article was previously published under Q326444 We strongly recommend that all users upgrade to Microsoft Internet Information Services (IIS) version 7.0 running on Microsoft Windows Server 2008. IIS 7.0 significantly increases Web infrastructure security. For more information about IIS security-related topics, visit the following Microsoft Web site: http://www.microsoft.com/technet/security/prodtech/IIS.mspx
(http://www.microsoft.com/technet/security/prodtech/IIS.mspx)
For more information about IIS 7.0, visit the following Microsoft Web site: http://www.iis.net/default.aspx?tabid=1
(http://www.iis.net/default.aspx?tabid=1)
On This PageSUMMARY This step-by-step article explains how to configure the
URLScan tool to protect your Web server from attacks and
exploits. Install URLScanTo install URLScan, visit the following Microsoft Developer Network (MSDN) Web site:http://msdn2.microsoft.com/en-us/library/aa302368.aspx
(http://msdn2.microsoft.com/en-us/library/aa302368.aspx)
For additional information, click the following article numbers to view the
articles in the Microsoft Knowledge Base: 307608
(http://support.microsoft.com/kb/307608/
)
Using URLScan on IIS
Modify the URLScan.ini fileAll configuration of URLScan is performed through the URLScan.ini file, which is located in the %WINDIR%\System32\Inetsrv\URLscan folder. To configure URLScan, open this file in a text editor such as Notepad, make the appropriate changes, and then save the file.Note You must restart Internet Information Services (IIS) for your changes to take effect. One way you can do this quickly is to run the IISRESET command at a command prompt. The URLScan.ini file contains the following sections:
The [Options] sectionIn the [Options] section, you can configure a number of URLScan options. Each line in this section has the following format:OptionName=OptionValue The available options and their default values are as follows:
The [AllowVerbs] and [DenyVerbs] sectionsThe [AllowVerbs] and [DenyVerbs] sections define the HTTP verbs (also known as methods) that URLScan permits. Common HTTP verbs include GET, POST, HEAD, and PUT. Other applications, such as FPSE and Web Distributed Authoring and Versioning (WebDAV), use additional verbs.Both the [AllowVerbs] and the [DenyVerbs] sections have the same syntax. They are made up of a list of HTTP verbs, and each verb appears on its own line. URLScan decides which section to use based on the value of the UseAllowVerbs option in the [Options] section. By default, this option is set to 1. If UseAllowVerbs is set to 1, URLScan only permits requests that use the verbs that are listed in the [AllowVerbs] section. A request that does not use one of these verbs is rejected. In this case, the [DenyVerbs] section is ignored. If UseAllowVerbs is set to 0, URLScan denies requests that use verbs that are explicitly listed in the [DenyVerbs] section. Any requests that use verbs that do not appear in this section are permitted. In this case, URLScan ignores the [AllowVerbs] section. The [DenyHeaders] sectionWhen a client requests a page from a Web server, it typically sends over some HTTP headers that contain additional information about the request. Common HTTP headers include the following:
In the [DenyHeaders] section, you define HTTP headers that URLScan will reject. If URLScan receives a request that contains any header that is listed in this section, it rejects the request. This section is made up of a list of HTTP headers, with each header appearing on its own line. Header names must be followed by a colon (:) (for example, Header-Name:). The [AllowExtensions] and [DenyExtensions] sectionsMost files have a file name extension that identifies what kind of file they are. For example, file names for Word documents typically end in .doc, HTML file names typically end in .htm or .html, and plain text file names typically end in .txt. The [AllowExtensions] and [DenyExtensions] sections permit you to define extensions that URLScan will block. For example, you can configure URLScan to reject requests for .exe files to prevent Web users from executing applications on your system.Both the [AllowExtensions] and the [DenyExtensions] sections have the same syntax. They are made up of a list of file name extensions, and each extension appears on its own line. The extension starts with a period (.) (for example, .ext). URLScan decides which section to use based on the value of UseAllowExtensions in the [Options] section. By default, this option is set to 0. If UseAllowExtensions is set to 0, URLScan only denies requests for file name extensions that are listed in the [DenyExtensions] section. Any file name extensions that are not listed in this section are permitted. The [AllowExtensions] section is ignored. If UseAllowExtensions is set to 1, URLScan denies requests for any file name extensions that are not explicitly listed in the [AllowExtensions] section. Only requests for a file name extension that is listed in that section are permitted. The [DenyExtensions] section is ignored. For additional information about how to configure URLScan to permit requests for files that do not have an extension, click the following article number to view the article in the Microsoft Knowledge Base: 312376
(http://support.microsoft.com/kb/312376/
)
How to configure URLScan to allow requests with a null extension in IIS
The [DenyUrlSequences] sectionYou can configure URLScan to block requests that contain certain sequences of characters in the URL. For example, you can block requests that contain two consecutive periods (..), which are frequently used with exploits that take advantage of directory traversal vulnerabilities. To specify a character sequence to block, put the sequence on a line by itself in the [DenyUrlSequences] section.Note that adding character sequences may adversely affect Outlook Web Access (OWA) for Microsoft Exchange. When you open a message from OWA, the subject line of the message is contained in the URL that is requested from the server. Because the URLScan.ini file blocks any requests that contain the percent sign (%) and the ampersand sign (&), users receive a 404 error message when they try to open a message with a subject line such as "Sales increase by 100%" or "Bob & Sue are coming to town". To resolve this, you can remove these sequences from the [DenyUrlSequences] section. Note that this reduces security because it potentially permits damaging requests to reach the server. For additional information, click the following article number to view the article in the Microsoft Knowledge Base: 325965
(http://support.microsoft.com/kb/325965/
)
The URLScan tool may cause problems in Outlook Web Access
Configure URLScan for use with IIS-dependent applicationsApplications such as Exchange, FPSE, and Microsoft Visual Studio .NET depend on IIS for correct functionality. If you do not configure URLScan correctly, these applications may stop working correctly.For additional information about how to configure URLScan to work with these applications, click the following article numbers to view the articles in the Microsoft Knowledge Base: 309508
(http://support.microsoft.com/kb/309508/
)
IIS Lockdown and URLscan configurations in an Exchange environment
309394
(http://support.microsoft.com/kb/309394/
)
How to use URLScan with FrontPage 2000
318290
(http://support.microsoft.com/kb/318290/
)
How to use URLScan with FrontPage 2002
310588
(http://support.microsoft.com/kb/310588/
)
Security toolkit breaks ASP.NET debugging in Visual Studio .NET
MORE INFORMATIONIf the Urlscan.ini does not exist in the
%WINDIR%\System32\Inetsrv\URLscan folder, the client will receive a 404 error
response. To resolve this issue, restore the Urlscan.ini file from a backup or
copy the Urlscan.ini file from an identical server. REFERENCES For additional
information, click the following article number to view the article in the
Microsoft Knowledge Base: 325864
(http://support.microsoft.com/kb/325864/
)
How to install and use the IIS Lockdown Wizard
| Article Translations
|
Back to the top
