home *** CD-ROM | disk | FTP | other *** search
/ Power Hacker 2003 / Power_Hacker_2003.iso / Hacking tool / Backdoor / UrlScan.exe / UrlScan.txt < prev    next >
Encoding:
Text File  |  2001-09-11  |  14.9 KB  |  297 lines

  1.  
  2. Introduction
  3. ------------
  4.  
  5. URLScan is a tool that IIS administrators can use to help secure their 
  6. web servers.  When installed, URLScan screens all incoming requests to 
  7. the server, and filters them based on rules the administrator has set.  
  8. This significantly improves the security of the server by helping to 
  9. ensure that it only responds to valid requests for service.
  10.  
  11. URLScan requires a detailed knowledge of HTTP requests and server 
  12. operation in order to be used properly.  It is intended for use by 
  13. experienced web server administrators, and even then only the selected 
  14. filtering operations have been thoroughly tested.
  15.  
  16.  
  17. Installing the tool
  18. -------------------
  19.  
  20. URLScan can be downloaded from the Microsoft Web site.  To install it, 
  21. just execute the downloaded package.  
  22.  
  23.  
  24. Description
  25. -----------
  26.  
  27. UrlScan is an ISAPI filter that analyzes and screens HTTP requests 
  28. being made to Microsoft Internet Information Services (IIS).  When 
  29. properly configured, UrlScan is effective at reducing the exposure of 
  30. an IIS server to potential attacks.
  31.  
  32. This filter allows the administrator to configure IIS to reject 
  33. requests based on the following criteria:
  34.  
  35.  - The request method (verb)
  36.  - The file extension of the resource requested
  37.  - Suspicious URL encoding
  38.  - Presence of non ASCII characters in the URL
  39.  - Presence of particular character sequences in the URL
  40.  - Presence of particular headers in the request
  41.  
  42. In the event a request is denied by UrlScan, the action will be logged 
  43. with the reason for the denial and information about the request 
  44. (typically, the complete URL and IP address of the source of the 
  45. request will be logged).  When a denial occurs, the response to the 
  46. client is a simple "404 Object not found" response.  This response 
  47. reduces the possibility of inadvertently disclosing any information 
  48. about the nature of the server to a possible attacker.
  49.  
  50. Also, UrlScan provides the administrator with the option of deleting or
  51. altering the "Server:" header in the response.
  52.  
  53. It is important to note that the strategy that UrlScan uses to protect 
  54. a server from attacks is that it "turns off" functionality that's not 
  55. being used by the server.  The default UrlScan.ini file included with 
  56. this sample assumes that the server will be serving static content 
  57. (HTML files, images, etc.) and ASP pages.  It further assumes that you 
  58. are not using CGI (.exe) pages, not publishing content via WebDAV or 
  59. FrontPage Server Extensions, not using Index Server, not using Internet 
  60. Printing, not using Server Side Includes, etc.  Each of the settings in 
  61. the sample UrlScan.ini file is commented to reflect which feature it's 
  62. associated with.  If you need to modify the UrlScan.ini file to "turn 
  63. on" one of these features, it is important that you ensure your server 
  64. is fully patched against any known security vulnerabilities associated 
  65. with them.  Security patches are available at 
  66. http://www.microsoft.com/technet/security.
  67.  
  68.  
  69. Manual Installation
  70. -------------------
  71.  
  72. If, after downloading URLScan, you prefer to install it manually, use 
  73. the following steps in Internet Service Manager to install UrlScan as a 
  74. global filter (note that UrlScan may be installed as a site filter, but 
  75. it is recommended that it be installed as a global filter so that its 
  76. functionality applies to the entire server):
  77.  
  78. 1. Extract the files in the installer package to a test directory.
  79.  
  80. 2. Copy UrlScan.dll and UrlScan.ini into a local directory on the 
  81. server.
  82.  
  83. 3. Right click the server name (not the site name) under Internet 
  84. Information Services in MMC and select Properties.
  85.  
  86. 4. Ensure that "WWW Service" is displayed in the Master Properties drop 
  87. down list, and click on the Edit button.
  88.  
  89. 5. Choose the "ISAPI Filters" tab and click on the Add button.
  90.  
  91. 6. On the Filter Properties dialog, enter "UrlScan" (without the 
  92. quotes) in the Filter Properties box, and enter the full path to 
  93. UrlScan.dll in the Executable box.
  94.  
  95. 7. Select "OK" to close each dialog.
  96.  
  97. 8. Restart the web service.
  98.  
  99.  
  100. To Run
  101. ------
  102.  
  103. After being properly installed, UrlScan will run automatically whenever 
  104. IIS is started.  If you would like to confirm UrlScan's operation, 
  105. locate the UrlScan.log file in the directory that contains UrlScan.dll.  
  106. The log file will be automatically created by UrlScan (unless UrlScan 
  107. is configured with logging disabled), and contains a report of the 
  108. configured options each time the server is started.
  109.  
  110.  
  111. UrlScan.ini
  112. -----------
  113.  
  114. UrlScan's operation is controlled by the UrlScan.ini file.  This file 
  115. should reside in the same directory as UrlScan.dll, and contains the 
  116. sections and options listed below.
  117.  
  118. Note that UrlScan only reads the .ini file at initialization time (for
  119. performance reasons).  It is necessary to stop and start the web 
  120. service before any changes to this file will be effective.
  121.  
  122. Also note that the default options built into UrlScanl.dll will result 
  123. in a configuration that will reject all requests to the server.  It is 
  124. necessary to provide a UrlScan.ini file for UrlScan to pass requests to 
  125. be served. A sample UrlScan.ini file is provided that contains the 
  126. recommended settings to defend against known attacks against IIS 
  127. servers at the time of writing.
  128.  
  129. The [Options] section configures UrlScan's main options, listed below:
  130.  
  131. UseAllowVerbs           Allowed values are 0 or 1.  If 1, then UrlScan 
  132.                         will read the [AllowVerbs] section of the ini 
  133.                         file and reject any request containing an HTTP 
  134.                         verb that is not explicitly listed.  The 
  135.                         [AllowVerbs] section is case sensitive.  If 0, 
  136.                         then UrlScan will read the [DenyVerbs] section 
  137.                         of the ini file and reject any request 
  138.                         containing an HTTP verb listed.  The 
  139.                         [DenyVerbs] is not case sensitive.  The default 
  140.                         for UseAllowVerbs is 1.
  141.  
  142. UseAllowExtensions      Allowed values are 0 or 1.  If 1, then UrlScan 
  143.                         will read the [AllowExtensions] section of the 
  144.                         file and reject any request where the file 
  145.                         associated with the URL is not explicitly 
  146.                         listed.  If 0, then UrlScan will read the 
  147.                         [DenyExtensions] section of the ini file and 
  148.                         reject any request where the file extension 
  149.                         associated with the request is listed. Both the 
  150.                         [AllowExtensions] and [DenyExtensions] sections 
  151.                         are case insensitive.  The default value for 
  152.                         UseAllowExtensions is 0.
  153.                                
  154. NormalizeUrlBeforeScan  Allowed values are 0 or 1.  If 1, then UrlScan 
  155.                         will do all of its analysis on the request URLs 
  156.                         after IIS decodes and normalizes them.  If 0, 
  157.                         then UrlScan will do all of its analysis on the 
  158.                         raw URLs as sent by the client.  The default 
  159.                         value for NormalizeUrlBeforeScan is 1.  Note 
  160.                         that only advanced users, who are very 
  161.                         knowledgeable about URL parsing, should set 
  162.                         this option to 0, as doing so could expose the 
  163.                         IIS server to canonicalization attacks that 
  164.                         bypass proper analysis of the URL extensions.
  165.  
  166. VerifyNormalization     Allowed values are 0 or 1.  If 1, then UrlScan 
  167.                         will verify normalization of the URL.  This 
  168.                         action will defend against canonicalization 
  169.                         attacks where a URL contains a double encoded 
  170.                         string in the URL (i.e., The string "%252e" is 
  171.                         a double encoded '.' character because "%25" 
  172.                         decodes to a '%' character, the first pass 
  173.                         decoding of "%252e" results in "%2e", which can 
  174.                         be decoded a second time into '.')  If 0, then 
  175.                         this verification is not done.  The Default 
  176.                         value for VerifyNormalization is 1. Note that 
  177.                         this option is dependent on the 
  178.                         NormalizeUrlBeforeScan option.
  179.  
  180. AllowHighBitCharacters  Allowed values are 0 or 1.  If 1, then 
  181.                         UrlScan will allow any byte to exist in the 
  182.                         URL.  If 0, then UrlScan will reject any 
  183.                         request where the URL contains a character 
  184.                         outside of the ASCII character set.  This 
  185.                         feature can defend against UNICODE or UTF-8 
  186.                         based attacks, but will also reject legitimate 
  187.                         requests on IIS servers that use a non-ASCII 
  188.                         codepage.  The default value for 
  189.                         AllowHighBitCharacters is 1.
  190.  
  191. AllowDotInPath          Allowed values are 0 or 1.  If 1, then UrlScan 
  192.                         will reject any requests containing multiple 
  193.                         instances of the '.' character.  If 0, then 
  194.                         UrlScan will not perform this test.  Because 
  195.                         UrlScan operates at a level where IIS has not 
  196.                         yet parsed the URL, it is not possible to 
  197.                         determine in all cases whether a '.' character 
  198.                         denotes the extension or whether it is a part 
  199.                         of the directory path or filename of URL.  For 
  200.                         the purposes of extension analysis, UrlScan 
  201.                         will always assume that an extension is the 
  202.                         part of the URL beginning after the last '.' in 
  203.                         the string and ending at the first '?' or '/' 
  204.                         character after the '.' or the end of the 
  205.                         string.  Setting AllowDotInPath to 1 will 
  206.                         defend against the case where an attacker uses 
  207.                         a path info to obfuscate the true extension of 
  208.                         the request (ie. something like 
  209.                         "/path/TrueURL.asp/BogusPart.htm").  Note that 
  210.                         this will also cause UrlScan to deny any 
  211.                         request that contains a '.' in a directory or 
  212.                         file name.  The default value for 
  213.                         AllowDotInPath is 0.
  214.  
  215. RemoveServerHeader      Allowed values are 0 or 1.  If 1, then UrlScan 
  216.                         will remove the server header on all responses. 
  217.                         If 0, then this action will not be performed.  
  218.                         The default value for RemoveServerHeader is 0.  
  219.                         Note that this feature is only available if 
  220.                         UrlScan is installed on IIS 4.0 or later.
  221.  
  222. EnableLogging           Allowed values are 0 or 1.  If 1, then UrlScan 
  223.                         will log its actions into a file called 
  224.                         UrlScan.log that will be created in the same 
  225.                         directory that contains UrlScan.dll.  If 0, 
  226.                         then no logging will be done.  The default 
  227.                         value for EnableLogging is 1.
  228.  
  229. PerProcessLogging       Allowed values are 0 or 1.  If 1, then UrlScan 
  230.                         will append the process ID of the IIS process 
  231.                         hosting UrlScan.dll to the log file name (i.e., 
  232.                         UrlScan.1234.log).  This feature is helpful for 
  233.                         IIS versions that can host filters in more than 
  234.                         1 process concurrently (IIS 6.0).  If 0, then 
  235.                         the log file will be UrlScan.log.  The default 
  236.                         value of PerProcessLogging is 0.
  237.  
  238. AlternateServerName     Allowed value is a string.  If this setting is 
  239.                         present and RemoveServerHeader is 0, then IIS 
  240.                         will replace its default "Server:" header in 
  241.                         all responses with this string.  The default 
  242.                         value for AlternateServerName is an empty 
  243.                         string. Note that this feature is only 
  244.                         available if UrlScan is installed on IIS 4.0 or 
  245.                         later.
  246.  
  247. AllowLateScanning       Allowed values are 0 or 1.  If 1, then UrlScan 
  248.                         will register itself as a low priority filter. 
  249.                         This allows other filters to modify the URL 
  250.                         before UrlScan does its analysis (note that in 
  251.                         addition to this switch, it is necessary to 
  252.                         ensure that UrlScan is listed lower on the 
  253.                         filter list in the MMC "ISAPI Filters" property 
  254.                         sheet for the server).  If this value is 0, the 
  255.                         UrlScan will run as a high priority filter.  
  256.                         The default value for AllowLateScanning is 0.  
  257.                         Note that Front Page Server Extensions requires 
  258.                         that this setting be 1.
  259.  
  260. The [AllowVerbs] section contains a list of HTTP verbs (methods).  If
  261. UseAllowVerbs=1 is set in the [Options] section, then UrlScan will 
  262. reject any request containing a verb not explicitly listed here.  The 
  263. entries in this section are case sensitive.
  264.  
  265. The [DenyVerbs] section contains a lit of HTTP verbs (methods).  If
  266. UseAllowVerbs=0 is set in the [Options] section, the UrlScan will 
  267. reject any request containing a verb that is listed here.  The entries 
  268. in this section are case insensitive.
  269.  
  270. The [DenyHeaders] section contains a list of request headers in the 
  271. form "header-name:".  Any request containing a request header listed in 
  272. this section will be rejected.  The entries in this section are case
  273. insensitive.
  274.  
  275. The [AllowExtensions] section contains a list of file extensions in the
  276. form of ".xxx".  If UseAllowExtensions=1 is set in the [Options] 
  277. section, then any request containing a URL with an extension not 
  278. explicitly listed here is rejected.  The entries in this section are 
  279. case insensitive.
  280.  
  281. The [DenyExtensions] section contains a list of file extensions in the
  282. form of ".xxx".  If UseAllowExtensions=0 is set in the [Options] 
  283. section, then any request containing a URL with an extension listed 
  284. here is rejected.  The entries in this section are case insensitive.
  285.  
  286.  
  287. Other Files Used by UrlScan:
  288. ------------------------------
  289.  
  290. UrlScan may create the following files in the directory that contains
  291. UrlScan.dll:
  292.  
  293. UrlScan.log - Logs UrlScan activity, including initialization and 
  294. shutdown, and details for any request that is 
  295. rejected by UrlScan.
  296. UrlScan.ini - Contains the configuration options used by UrlScan
  297.