<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>HttpHandlers and HttpModules</title><link>http://forums.asp.net/27.aspx</link><description>Extending the ASP.NET Framework through HttpModules and HttpHandlers.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Re: Override IIS and allow *.config file downloads</title><link>http://forums.asp.net/thread/3256477.aspx</link><pubDate>Wed, 24 Jun 2009 23:47:28 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3256477</guid><dc:creator>Spider Master</dc:creator><author>Spider Master</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3256477.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=27&amp;PostID=3256477</wfw:commentRss><description>&lt;p&gt;&lt;span style="FONT-FAMILY:comic sans ms,sans-serif;FONT-SIZE:small;"&gt;.config is simply a security protected masked&amp;nbsp;extension for .xml&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="FONT-FAMILY:comic sans ms,sans-serif;FONT-SIZE:small;"&gt;I would recommend just changing the extension to .xml&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="FONT-FAMILY:comic sans ms,sans-serif;FONT-SIZE:small;"&gt;By using .config as an extension on the IIS server is telling the server hey this is for you only (IIS)&amp;nbsp;the server handles this with great selfishnish and does not allow &amp;quot;remote access in any way&amp;quot; to the extension .config&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="FONT-FAMILY:comic sans ms,sans-serif;FONT-SIZE:small;"&gt;This is the same for Protected folders (App_Data, App_Code, Bin and other extensions such as .dll)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="FONT-FAMILY:comic sans ms,sans-serif;FONT-SIZE:small;"&gt;If you really want to allow permissions to the extension .config you will have to do this on the IIS server under security of &lt;strong&gt;full trust&lt;/strong&gt;. If your site is hosted I doubt you will have full trust.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="FONT-FAMILY:comic sans ms,sans-serif;FONT-SIZE:small;"&gt;The previous user is correct. I would give it days before someones bot finds a fully open config file and mess&amp;#39;s with!!&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="FONT-FAMILY:comic sans ms,sans-serif;FONT-SIZE:small;"&gt;So with out full trust there is still a solution. Connect via ftp using credentials allows you access to download the config file as is (of course this is full trust!).&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="FONT-FAMILY:comic sans ms,sans-serif;FONT-SIZE:small;"&gt;Obviously you want to do this via browser and allow others to do so, how about Duplicating the file and changing the extension to .xml&amp;nbsp;then initiating download?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="FONT-FAMILY:comic sans ms,sans-serif;FONT-SIZE:small;"&gt;Actually I just had another thought! The above is suited to IIS6&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="FONT-FAMILY:comic sans ms,sans-serif;FONT-SIZE:small;"&gt;If you are using IIS7 you would need to define your handler in the new section&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="FONT-FAMILY:comic sans ms,sans-serif;FONT-SIZE:small;"&gt;&lt;/span&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span style="FONT-FAMILY:comic sans ms,sans-serif;FONT-SIZE:small;"&gt;&lt;pre class="xhtml" name="code"&gt; &amp;lt;system.webServer&amp;gt;
    &amp;lt;validation validateIntegratedModeConfiguration=&amp;quot;false&amp;quot;/&amp;gt;
    &amp;lt;!-- Begin REMOVABLE New Error Checking --&amp;gt;
    &amp;lt;httpErrors errorMode=&amp;quot;Detailed&amp;quot;/&amp;gt;
    &amp;lt;asp scriptErrorSentToBrowser=&amp;quot;true&amp;quot;/&amp;gt;
    &amp;lt;!-- End --&amp;gt;
    &amp;lt;modules&amp;gt;
      &amp;lt;remove name=&amp;quot;ScriptModule&amp;quot;/&amp;gt;
      &amp;lt;add name=&amp;quot;ScriptModule&amp;quot; preCondition=&amp;quot;managedHandler&amp;quot; type=&amp;quot;System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35&amp;quot;/&amp;gt;
    &amp;lt;/modules&amp;gt;
    &amp;lt;handlers&amp;gt;
      &amp;lt;remove name=&amp;quot;WebServiceHandlerFactory-Integrated&amp;quot;/&amp;gt;
      &amp;lt;remove name=&amp;quot;ScriptHandlerFactory&amp;quot;/&amp;gt;
      &amp;lt;remove name=&amp;quot;ScriptHandlerFactoryAppServices&amp;quot;/&amp;gt;
      &amp;lt;remove name=&amp;quot;ScriptResource&amp;quot;/&amp;gt;
      &amp;lt;remove name=&amp;quot;WebServiceHandlerFactory-ISAPI-2.0&amp;quot;/&amp;gt;
      &amp;lt;add name=&amp;quot;ScriptHandlerFactory&amp;quot; verb=&amp;quot;*&amp;quot; path=&amp;quot;*.asmx&amp;quot; preCondition=&amp;quot;integratedMode&amp;quot; type=&amp;quot;System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35&amp;quot;/&amp;gt;
      &amp;lt;add name=&amp;quot;ScriptHandlerFactoryAppServices&amp;quot; verb=&amp;quot;*&amp;quot; path=&amp;quot;*_AppService.axd&amp;quot; preCondition=&amp;quot;integratedMode&amp;quot; type=&amp;quot;System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35&amp;quot;/&amp;gt;
      &amp;lt;add name=&amp;quot;ScriptResource&amp;quot; preCondition=&amp;quot;integratedMode&amp;quot; verb=&amp;quot;GET,HEAD&amp;quot; path=&amp;quot;ScriptResource.axd&amp;quot; type=&amp;quot;System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35&amp;quot;/&amp;gt;
    &amp;lt;/handlers&amp;gt;
  &amp;lt;/system.webServer&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="FONT-FAMILY:comic sans ms,sans-serif;FONT-SIZE:small;"&gt;Look forward to your response!&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="FONT-FAMILY:comic sans ms,sans-serif;FONT-SIZE:small;"&gt;&lt;/span&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span style="FONT-FAMILY:comic sans ms,sans-serif;FONT-SIZE:small;"&gt;&lt;/span&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Override IIS and allow *.config file downloads</title><link>http://forums.asp.net/thread/3252198.aspx</link><pubDate>Tue, 23 Jun 2009 06:31:12 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3252198</guid><dc:creator>sumitd</dc:creator><author>sumitd</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3252198.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=27&amp;PostID=3252198</wfw:commentRss><description>&lt;p&gt;Map .config handler to aspnet_isapi.dll in IIS.&lt;/p&gt;&lt;strong&gt;&lt;em&gt;
&lt;p&gt;Why do you want let the user see your configuration settings? Usually .config files is used to keep configuration setting which should not be exposted to user and sometimes we keep critical information also.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/em&gt;&lt;/strong&gt;&lt;strong&gt;&lt;em&gt;I assure you, if site is hosted in internet and some critical information is there, it will be compromised in a week.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Override IIS and allow *.config file downloads</title><link>http://forums.asp.net/thread/3250631.aspx</link><pubDate>Mon, 22 Jun 2009 12:57:55 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3250631</guid><dc:creator>doitconsultants</dc:creator><author>doitconsultants</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3250631.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=27&amp;PostID=3250631</wfw:commentRss><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;I&amp;#39;m trying to override IIS and allow config file downloads.&amp;nbsp; I am using IIS 6 on W2K3.&amp;nbsp;&amp;nbsp; I have tried using this example that is supposed to allow for all config files except the web.config to be downloaded but it doesn&amp;#39;t work.&amp;nbsp; Is there something else I need to do?&lt;/p&gt;
&lt;p&gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot; ?&amp;gt;&lt;br /&gt;&amp;lt;configuration&amp;gt;&lt;br /&gt;&amp;lt;system.web&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;httpHandlers&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;remove verb=&amp;quot;*&amp;quot; path=&amp;quot;*.config&amp;quot; /&amp;gt;&lt;br /&gt;&amp;lt;add verb=&amp;quot;*&amp;quot; path=&amp;quot;web.config&amp;quot; type=&amp;quot;System.Web.HttpForbiddenHandler&amp;quot; /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/httpHandlers&amp;gt;&lt;br /&gt;&amp;lt;/system.web&amp;gt;&lt;br /&gt;&amp;lt;/configuration&amp;gt;&lt;br /&gt;&lt;br /&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Mike&lt;/p&gt;</description></item></channel></rss>