<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>RuslanY Blog &#187; Security</title>
	<atom:link href="http://ruslany.net/tag/security/feed/" rel="self" type="application/rss+xml" />
	<link>http://ruslany.net</link>
	<description>IIS, FastCGI, PHP and other interesting stuff</description>
	<lastBuildDate>Fri, 30 Jul 2010 23:07:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Dynamic IP Restrictions for IIS 7.0 &#8211; Beta</title>
		<link>http://ruslany.net/2009/02/dynamic-ip-restrictions-for-iis-70-beta/</link>
		<comments>http://ruslany.net/2009/02/dynamic-ip-restrictions-for-iis-70-beta/#comments</comments>
		<pubDate>Tue, 17 Feb 2009 02:34:00 +0000</pubDate>
		<dc:creator>ruslany</dc:creator>
				<category><![CDATA[Other]]></category>
		<category><![CDATA[IIS News Item]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://ruslany.net/?p=245</guid>
		<description><![CDATA[Today IIS team has released the Dynamic IP Restrictions Extension for IIS 7.0 &#8211; Beta. The Dynamic IP Restrictions Extension provides IT Professionals and Hosters a configurable module that helps mitigate or block Denial of Service Attacks or cracking of passwords through Brute-force by temporarily blocking Internet Protocol (IP) addresses of HTTP clients who follow [...]]]></description>
			<content:encoded><![CDATA[<p>Today IIS team has released the Dynamic IP Restrictions Extension for IIS 7.0 &#8211; Beta. The Dynamic IP Restrictions Extension provides IT Professionals and Hosters a configurable module that helps mitigate or block Denial of Service Attacks or cracking of passwords through Brute-force by temporarily blocking Internet Protocol (IP) addresses of HTTP clients who follow a pattern that could be conducive to one of such attacks. This module can be configured such that the analysis and blocking could be done at the Web Server or the Web Site level.</p>
<h3>Install the Dynamic IP Restrictions Beta Today!</h3>
<p><a href="http://www.iis.net/downloads/default.aspx?tabid=34&amp;g=6&amp;i=1825">Microsoft Dynamic IP Restrictions for IIS 7.0 &#8211; Beta (x86)</a></p>
<p><a href="http://www.iis.net/downloads/default.aspx?tabid=34&amp;g=6&amp;i=1826">Microsoft Dynamic IP Restrictions for IIS 7.0 &#8211; Beta (x64)</a></p>
<p>If IIS already has IPv4 Address and IP restrictions module enabled then Dynamic IP Restrictions installer will need to un-install the existing module in order to continue the setup process. Note that the existing IPv4 configuration will be preserved while old module is removed and new module is installed.<span id="more-245"></span></p>
<h3>Features</h3>
<p>The Dynamic IP Restrictions includes these key features:</p>
<ul>
<li><strong>Blocking of IP addresses based on number of concurrent requests</strong> &#8211; If HTTP client makes many concurrent requests then that client&#8217;s IP address gets temporarily blocked.</li>
<li><strong>Blocking of IP addresses based on number of requests over a period of time</strong> &#8211; If HTTP client makes many requests over short period of time then that client&#8217;s IP address gets temporarily blocked.</li>
<li><strong>Various deny actions</strong> &#8211; it is possible to specify what response to return to an HTTP client whose IP address is blocked. The module can return status codes 403 and 404 or just drop the HTTP connection and do not return any response.</li>
<li><strong>Logging of dynamically denied requests</strong> &#8211; all denied requests can be logged into a W3C formatted log file.</li>
<li><strong>Displaying currently blocked IP addresses</strong> &#8211; a list of currently blocked IP addresses can be obtained by using IIS Manager or by using IIS RSCA API&#8217;s.</li>
<li><strong>IPv6</strong> &#8211; the module fully supports IPv6 addresses.</li>
</ul>
<p>In additions to these features, the Dynamic IP Restrictions for IIS 7.0 provides the same functionality that exists in IIS 7.0 built-in IPv4 and Domain Restrictions. Because of that the Dynamic IP Restrictions is provided as a replacement for IPv4 and Domain Restrictions.</p>
<h3>More information</h3>
<p>Module walkthrough: <a href="http://learn.iis.net/page.aspx/548/using-dynamic-ip-restrictions/">http://learn.iis.net/page.aspx/548/using-dynamic-ip-restrictions/</a></p>
<p>Support forum: <a href="http://forums.iis.net/1043.aspx">http://forums.iis.net/1043.aspx</a></p>
]]></content:encoded>
			<wfw:commentRss>http://ruslany.net/2009/02/dynamic-ip-restrictions-for-iis-70-beta/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>How to secure WordPress admin directory on IIS 7.0</title>
		<link>http://ruslany.net/2009/02/how-to-secure-wordpress-admin-directory-on-iis-70/</link>
		<comments>http://ruslany.net/2009/02/how-to-secure-wordpress-admin-directory-on-iis-70/#comments</comments>
		<pubDate>Sat, 07 Feb 2009 01:00:36 +0000</pubDate>
		<dc:creator>ruslany</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://ruslany.net/?p=199</guid>
		<description><![CDATA[Recently I was told about Smashing Magazine, which turned out to be a pretty useful site. It is targeted for web developers and web designers and it contains tons of information, tools and freebies for web developers. One of the article on that site was about 10 Steps To Protect The Admin Area in WordPress. [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I was told about <a href="http://www.smashingmagazine.com/">Smashing Magazine</a>, which turned out to be a pretty useful site. It is targeted for web developers and web designers and it contains tons of information, tools and freebies for web developers. One of the article on that site was about <strong>10 Steps To Protect The Admin Area in WordPress</strong>. In that article step #7 described how to use web server’s built-in authentication to provide an extra protection layer for wp-admin directory, where all WordPress admin scripts are located. The article described how to do that in Apache by using .htaccess file. In this post I will explain how to protect WordPress wp-admin directory on IIS 7.0 by using IIS built-in Forms Authentication.<span id="more-199"></span></p>
<h3>Prerequisites</h3>
<p>First thing to make sure is to confirm that IIS Forms authentication and URL authorization modules are installed and enabled on your IIS server. To quickly check that, open an elevated command prompt and run the following commands:</p>
<pre name="code" class="dos">
C:\Windows\System32\inetsrv&gt;appcmd list modules | find &quot;FormsAuthentication&quot;
MODULE &quot;FormsAuthentication&quot; ( type: System.Web.Security.FormsAuthenticationModule,preCondition: )

C:\Windows\System32\inetsrv&gt;appcmd list modules | find &quot;UrlAuthorization&quot;
MODULE &quot;UrlAuthorization&quot; ( type: System.Web.Security.UrlAuthorizationModule, preCondition: managedHandler )
MODULE &quot;UrlAuthorizationModule&quot; ( native, preCondition: )
</pre>
<p>If the output from the commands look similar to above then the necessary modules are installed.</p>
<p>Another thing to ensure is that the WordPress site is hosted in an Application Pool with Integrated Managed Pipeline Mode. To check that run the following command from elevated command prompt (replace &#8220;DefaultAppPool&#8221; with the name of your AppPool if necessary):</p>
<pre name="code" class="dos">
C:\Windows\System32\inetsrv&gt;appcmd list apppools | find &quot;DefaultAppPool&quot;
APPPOOL &quot;DefaultAppPool&quot; (MgdVersion: v2.0,MgdMode: Integrated,state: Started)
</pre>
<p>The output should contain <strong>MgdMode:Integrated</strong>.</p>
<h3>Configuration steps</h3>
<p>Download the zip file below:</p>
<p><a href="http://ruslany.net/download/FormsAuthForWordPress.zip" title="Version 1.0 downloaded 286 times" >IIS Forms Authentication for WordPress (4.1 KB)</a></p>
<p>Extract the two folders &#8211; App_Code and App_Data – into the root folder or your WordPress web site. For example if your WordPress files are located in folder C:\inetpub\wwwroot, then there should be two new files present at the following paths:</p>
<pre name="code" class="dos">
C:\inetpub\wwwroot\App_Code\CustomProvider.cs
C:\inetpub\wwwroot\App_Data\Users.xml
</pre>
<p>The CustomProvider.cs file contains an implementation of membership provider for IIS that uses Users.xml file as a storage for usernames and passwords. To learn more about providers refer to the <a href="http://msdn.microsoft.com/en-us/library/aa479031.aspx">Membership Providers</a> article. The code for CustomProvider.cs was literally copied from that article.</p>
<p>The Users.xml file is a simple credentials storage. Its content looks like below:</p>
<pre name="code" class="xml">
&lt;Users&gt;
  &lt;User&gt;
    &lt;UserName&gt;your_username_here&lt;/UserName&gt;
    &lt;Password&gt;your_password_here&lt;/Password&gt;
    &lt;EMail&gt;user@ruslany.net&lt;/EMail&gt;
  &lt;/User&gt;
&lt;/Users&gt;
</pre>
<blockquote><p><strong>Note</strong> that it is important that this file is located in App_Data directory, because this directory, as well as App_Code, is protected by IIS Request Filtering module, which prevents anyone from requesting any files from these folders.</p>
<p>Also it is important to pick a user name and a password different from the ones that are used for the WordPress authentication.</p></blockquote>
<p>Also extract the Login.aspx file into the root folder of the web site, e.g.:</p>
<pre name="code" class="dos">
C:\inetpub\wwwroot\Login.aspx
</pre>
<p>Now you need to register this custom membership provider and enable Forms authentication. To do that add the following XML configuration element into the &lt;configuration&gt; element inside of the web.config file, located at the root folder of your WordPress site:</p>
<pre name="code" class="xml">
&lt;system.web&gt;
  &lt;authentication mode=&quot;Forms&quot; /&gt;
  &lt;membership defaultProvider=&quot;AspNetReadOnlyXmlMembershipProvider&quot;&gt;
    &lt;providers&gt;
       &lt;add name=&quot;AspNetReadOnlyXmlMembershipProvider&quot;
                type=&quot;ReadOnlyXmlMembershipProvider&quot;
                description=&quot;Read-only XML membership provider&quot;
                xmlFileName=&quot;~/App_Data/Users.xml&quot; /&gt;
    &lt;/providers&gt;
  &lt;/membership&gt;
&lt;/system.web&gt;
</pre>
<p>With the custom provider registered and configured, it is time to configure IIS to protect wp-admin folder with extra authentication that uses this custom provider. To do that add the following XML configuration fragment into the &lt;configuration&gt; element inside of the web.config file, located at the root folder of the WordPress site:</p>
<pre name="code" class="xml">
&lt;!-- Deny access to wp-admin for anonymous users --&gt;
&lt;location path=&quot;wp-admin&quot;&gt;
  &lt;system.webServer&gt;
      &lt;security&gt;
          &lt;authorization&gt;
              &lt;add accessType=&quot;Deny&quot; users=&quot;?&quot; /&gt;
          &lt;/authorization&gt;
      &lt;/security&gt;
  &lt;/system.webServer&gt;
&lt;/location&gt;
&lt;!-- Allow access to wp-admin/css folder for anonymous users --&gt;
&lt;!-- this is needed in order for WordPress login page to display correctly --&gt;
&lt;location path=&quot;wp-admin/css&quot;&gt;
  &lt;system.webServer&gt;
    &lt;security&gt;
      &lt;authorization&gt;
        &lt;remove users=&quot;?&quot; roles=&quot;&quot; verbs=&quot;&quot; /&gt;
      &lt;/authorization&gt;
    &lt;/security&gt;
  &lt;/system.webServer&gt;
&lt;/location&gt;
&lt;!-- Allow access to wp-admin/images folder for anonymous users --&gt;
&lt;!-- this is needed in order for WordPress login page to display correctly --&gt;
&lt;location path=&quot;wp-admin/images&quot;&gt;
  &lt;system.webServer&gt;
    &lt;security&gt;
      &lt;authorization&gt;
        &lt;remove users=&quot;?&quot; roles=&quot;&quot; verbs=&quot;&quot; /&gt;
      &lt;/authorization&gt;
    &lt;/security&gt;
  &lt;/system.webServer&gt;
&lt;/location&gt;
</pre>
<p>Last thing you will need to do is to configure IIS modules that are used for Forms Authentication and for URL authorization to run for all kinds of requests. Both those modules are Managed modules (that is they are implemented using .NET Framework) and by default they are configured to run only for requests that are made for ASP.NET content. In order for them to work with PHP content then need to be configured to run for all requests. This can be done by using the following configuration section. Add it inside of &lt;configuration&gt;/&lt;system.webServer&gt; element:</p>
<pre name="code" class="xml">
&lt;modules&gt;
    &lt;remove name=&quot;UrlAuthorization&quot; /&gt;
    &lt;remove name=&quot;FormsAuthentication&quot; /&gt;
    &lt;remove name=&quot;DefaultAuthentication&quot; /&gt;
    &lt;add name=&quot;DefaultAuthentication&quot;
               type=&quot;System.Web.Security.DefaultAuthenticationModule&quot; preCondition=&quot;&quot; /&gt;
    &lt;add name=&quot;FormsAuthentication&quot;
               type=&quot;System.Web.Security.FormsAuthenticationModule&quot; preCondition=&quot;&quot; /&gt;
    &lt;add name=&quot;UrlAuthorization&quot;
               type=&quot;System.Web.Security.UrlAuthorizationModule&quot; preCondition=&quot;&quot; /&gt;
&lt;/modules&gt;
</pre>
<p>At this point the WordPress wp-admin directory is protected by IIS Forms Authentication in addition to the standard WordPress authentication. Update the users.xml file with the username and password of your choice and then try to request <strong>http://localhost/wp-admin/.</strong> The IIS Forms Authentication logon page will be shown first:</p>
<p><a href="http://ruslany.net/wp-content/uploads/2009/02/formsauthpage.png"><img style="display: inline; border-width: 0px;" title="FormsAuthPage" src="http://ruslany.net/wp-content/uploads/2009/02/formsauthpage-thumb.png" border="0" alt="FormsAuthPage" width="504" height="330" /></a></p>
<p>Once you provided the user name and password as specified in users.xml file, the standard WordPress login page will be shown next. In that page you can provide your WordPress logon credentials:</p>
<p><a href="http://ruslany.net/wp-content/uploads/2009/02/wordpressauth.png"><img style="display: inline; border-width: 0px;" title="WordPressAuth" src="http://ruslany.net/wp-content/uploads/2009/02/wordpressauth-thumb.png" border="0" alt="WordPressAuth" width="488" height="379" /></a></p>
<p>Now the entire content of the wp-admin directory is protected by two different authentication mechanisms, which makes it harder for anyone to hack into it. And the nice thing about this configuration is that it can be done even if your site is hosted on a shared server. All that is necessary is to have ASP.NET and IIS URL authorization enabled on a shared server by a shared hosting provider.</p>
<p>Download all the necessary files as well as an example of web.config file from the link below.</p>
<p><a href="http://ruslany.net/download/FormsAuthForWordPress.zip" title="Version 1.0 downloaded 286 times" >IIS Forms Authentication for WordPress (4.1 KB)</a></p>
<p>Also check out how this protection actually works by trying to navigate to http://ruslany.net/wp-admin/.</p>
]]></content:encoded>
			<wfw:commentRss>http://ruslany.net/2009/02/how-to-secure-wordpress-admin-directory-on-iis-70/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
	</channel>
</rss>
