<?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"
	>

<channel>
	<title>Kakkoi &#187; shell scripts</title>
	<atom:link href="http://42.kaizeku.com/taxonomy/shell-scripts//feed/" rel="self" type="application/rss+xml" />
	<link>http://42.kaizeku.com</link>
	<description>web development, software, windows tips and trick</description>
	<pubDate>Sat, 12 Jul 2008 15:10:01 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
	<language>en</language>
	<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Statcounter Update.sh Vulnerability Fixes</title>
		<link>http://42.kaizeku.com/security/vulnerability/fixes-statscounter-updatesh-vulnerability/</link>
		<comments>http://42.kaizeku.com/security/vulnerability/fixes-statscounter-updatesh-vulnerability/#comments</comments>
		<pubDate>Sun, 27 Jan 2008 13:11:46 +0000</pubDate>
		<dc:creator>chaoskaizer.myopenid.com</dc:creator>
		
		<category><![CDATA[Security]]></category>

		<category><![CDATA[vulnerability]]></category>

		<category><![CDATA[htaccess]]></category>

		<category><![CDATA[ip2location]]></category>

		<category><![CDATA[shell scripts]]></category>

		<category><![CDATA[Statcounter]]></category>

		<guid isPermaLink="false">http://blog.kakkoi.net/security/vulnerability/fixes-statscounter-updatesh-vulnerability/</guid>
		<description><![CDATA[The vulnerability exists in statcounters backup log inside utils directory where the file update.sh reside.]]></description>
			<content:encoded><![CDATA[
<!-- google_ad_section_start -->
<p><span class="vcard"><a class="url fn microformat icn-l" href="http://www.gianniamato.it/"><span class="given-name">Gianni</span> <span class="family-name">Amato</span></a></span> found a vulnerability in <a href="http://statcounter.com" rel="nofollow" class="exturl icn-r">statcounter</a> that can expose ip2location database log and account credentials. </p>
<h2>The Vulnerability</h2>
<p>The vulnerability exists in <strong>statcounters backup log</strong> inside utils directory where the file <em>update.sh</em> reside.</p>
<ul>
<li>googlecache: <a href="http://209.85.135.104/search?q=cache:www.sunmarklsa.com/mc1.statcounter.com/utils/update.sh" class="exturl icn-r">*.statcounter.com/utils/update.sh</a></li>
</ul>
<p><span id="more-154"></span><br />
Excerpt from Giani Amot:</p>
<blockquote cite="http://www.gianniamato.it/"><p class="quote">The server where the backup&#8217;s log of the last three days are situated is badly set. The access for all directory by server is free, include &#8220;utils&#8221; directory that contains one script file called &#8220;update.sh&#8221; inside of which are situated the user and password to enter and download the database log from ip2location.com<br />
</blockquote>
<h2>Update.sh</h2>
<pre class="prebox">
cd /home/ip2location

/usr/bin/curl --data 'login=webmaster@statcounter.com&amp;password=kOFr3VTh' 'http://www.ip2location.com/download.aspx?productcode=db6bin' &gt; /home/ip2location/ipdb_current.bin.zip

rm /home/ip2location/ipdb_new.bin

unzip -p /home/ip2location/ipdb_current.bin.zip *.BIN &gt; /home/ip2location/ipdb_new.bin

if [ &quot;$?&quot; -ne &quot;0&quot; ]; then

 echo &quot;Sorry, new ip_db archive isn't valid!&quot;

 exit 1

fi

mv /home/ip2location/ipdb_new.bin /home/ip2location/ipdb.bin

rm /home/ip2location/ipdb_current.bin.zip

/bin/cp /home/ip2location/ipdb.bin /mnt/rd/ipdb.bin
</pre>
<h2>htaccess workaround</h2>
<p>places the following <em>.htaccess</em> code inside statscounter /utils/ directory</p>
<pre class="prebox">
#deny access to any file with *.sh filetypes
&lt;Files ~ &quot;^\.sh&quot;&gt;
 Order allow,deny
 Deny from all
 Satisfy All
&lt;/Files&gt;

#Deny request for *.log &#038; comment files
&lt;Files ~ &quot;^.*\.([Ll][Oo][Gg]|[cC][oO][mM][mM][eE][nN][tT])&quot;&gt;
 Order allow,deny
 Deny from all
 Satisfy All
&lt;/Files&gt;
</pre>
<h2>password protected directories</h2>
<pre class="prebox">
AuthType Basic
AuthName "restricted area"
AuthUserFile /usr/local/etc/.htpasswd-allusers
require valid-user
</pre>
<p class="notice">Note: You will need to change the <span class="fw">AuthUserFile</span> password file location depending on your server configurations.</p>
<h2>External Resources</h2>
<ul>
<li><a class="exturl icn-r" href="http://www.gianniamato.it/2008/01/se-fossi-tu-monitorare-statcountercom.html">Giani Amato &rarr; Se fossi tu a monitorare Statcounter.com?</a></li>
<li><a class="exturl icn-r" href="http://translate.google.com/translate?hl=en&#038;u=http%3A%2F%2Fwww.gianniamato.it%2F2008%2F01%2Fse-fossi-tu-monitorare-statcountercom.html">Giani Amato &rarr; Se fossi tu a monitorare Statcounter.com &raquo; English Translations </a></li>
</ul>
<!-- google_ad_section_end -->
]]></content:encoded>
			<wfw:commentRss>http://42.kaizeku.com/security/vulnerability/fixes-statscounter-updatesh-vulnerability/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
