<?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; htaccess</title>
	<atom:link href="http://42.kaizeku.com/taxonomy/htaccess//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>
		<item>
		<title>How to block Google Wireless Transcoder</title>
		<link>http://42.kaizeku.com/tips/how-to-block-google-wireless-transcoder-gwt-googlebot-mobile/</link>
		<comments>http://42.kaizeku.com/tips/how-to-block-google-wireless-transcoder-gwt-googlebot-mobile/#comments</comments>
		<pubDate>Sat, 29 Dec 2007 07:11:19 +0000</pubDate>
		<dc:creator>Noah Ark</dc:creator>
		
		<category><![CDATA[GWT]]></category>

		<category><![CDATA[Google Proxy]]></category>

		<category><![CDATA[Google-mobile]]></category>

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

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

		<category><![CDATA[Google Wireless Transcoder]]></category>

		<category><![CDATA[googlebot-mobile]]></category>

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

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

		<guid isPermaLink="false">http://blog.kakkoi.net/tips/how-to-block-google-wireless-transcoder-gwt-googlebot-mobile/</guid>
		<description><![CDATA[

When Google Wireless Transcoder (GWT, Googlebot-mobile) translate your website it strip all &#8220;scripts&#8221; and render it in mobile format (XHTML mobile 1.0)Google version of &#8220;Mobile format&#8221;. To test this services go to http://google.com/gwt/n. GWT services is actually made for mobile-user but you can still surf with normal browser.
So what the heck wrong with it
The answer [...]]]></description>
			<content:encoded><![CDATA[
<!-- google_ad_section_start -->
<p><img src='http://blog.kakkoi.net/wp-content/uploads/2007/12/google_mobile.gif' alt='google_mobile.gif' width="70" height="75" class="fl" />When <strong class="fw-">Google Wireless Transcoder </strong>(GWT, Googlebot-mobile) translate your website it strip all &#8220;scripts&#8221; and render it in mobile format (XHTML mobile 1.0)<span class="td-l">Google version of &#8220;Mobile format&#8221;</span>. To test this services go to <a href="http://google.com/gwt/n" class="external icn-r exturl">http://google.com/gwt/n</a>. GWT services is actually made for mobile-user but you can still surf with normal browser.</p>
<h2>So what the heck wrong with it</h2>
<p>The answer is Yes &#038; No. This type of services is bad for webmaster that depend on ads income. Otherwise Normal Surfer would love this services as they wont need to view any ads and surf safely without &#8220;javascript embed&#8221; (from the originating website).<br />
<span id="more-113"></span></p>
<h2>How to Block Googlebot Mobile Crawler</h2>
<p>These are some server environment variables for <strong>Google Wireless Transcoder</strong> </p>
<dl id="GWT" class="profile">
<dt>USER_AGENT</dt>
<dd>Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; Google Wireless Transcoder;)</dd>
<dt>HTTP_VIA</dt>
<dd>1.1 proxy.google.com:80 (squid)</dd>
<dt>HTTP_X_FORWARDED_FOR</dt>
<dd>xxx.xx.xxx.xxx, unknown</dd>
<dt>REMOTE_ADDR</dt>
<dd>209.85.138.136</dd>
<dt>REMOTE_PORT</dt>
<dd>56931</dd>
</dl>
<h2>block via .htaccess</h2>
<p>with <a href="http://httpd.apache.org/docs/1.3/mod/mod_setenvif.html" rel="external">mod_setenvif</a></p>
<pre class="prebox">
&lt;IfModule mod_setenvif.c&gt;
SetEnvIfNoCase User-Agent &quot;^Google\ Wireless\ Transcoder*&quot; gwt_agent=1
SetEnvIfNoCase User-Agent &quot;^Googlebot-Mobile*&quot; gwt_agent=1
&lt;FilesMatch &quot;(.*)&quot;&gt;
Order Allow,Deny
Allow from all
Deny from env=gwt_agent
&lt;/FilesMatch&gt;
&lt;/IfModule&gt;
</pre>
<p>or with <a href="http://httpd.apache.org/docs/1.3/mod/mod_rewrite.html" rel="external">mod_rewrite</a></p>
<pre class="prebox">
&lt;IfModule mod_rewrite.c&gt;
RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} ^Google\ Wireless\ Transcoder [OR]
RewriteCond %{HTTP_USER_AGENT} ^Googlebot-Mobile
RewriteRule ^.* - [F,L]
&lt;/IfModule&gt;
</pre>
<h2>Robots Exclusion Standards</h2>
<pre class="prebox">
User-agent: Googlebot-Mobile
Disallow: /
</pre>
<h3>Google Webmaster Analyze robots.txt</h3>
<p>After you add the above robot.txt code login to your <a href="http://www.google.com/webmasters/tools/" class="google icn-l1">Google Webmaster Central</a>. </p>
<ol class="cb">
<li>Select Tools &gt; Analyze robots.txt </li>
<li>Select <tt class="di">Google Mobile : Crawls page for our mobile index</tt> on &#8220;user-agents dropdown list&#8221;.</li>
</ol>
<p><img src='http://gmodules.com/ig/proxy?url=http://blog.kakkoi.net/wp-content/uploads/2007/12/google-webmaster-tools-analyze-robotstxt.png' alt='google-webmaster-tools-analyze-robotstxt.png' /></p>
<h2 class="cb">Embed HTML Meta Link header</h2>
<pre class="smallbox">
&lt;link rel=&quot;alternate&quot; media=&quot;handheld&quot; href=&quot;http://changethis-url-for-mobile-user&quot; /&gt;
</pre>
<h2>Google Support</h2>
<p>If you want to prevent Google Mobile services from transcoding your page its recommended to request for removal via <a href="http://www.google.com/support/mobile/bin/request.py?contact_type=googlebot">Google Mobile Support</a> form. </p>
<h2>Soap</h2>
<p>If google-mobile can restrict this services for mobile only view or maybe implement something like &#8220;<a href="http://www.duggtrends.com">duggmirror</a>&#8221; for normal browsing, it would be welcome. </p>
<!-- google_ad_section_end -->
]]></content:encoded>
			<wfw:commentRss>http://42.kaizeku.com/tips/how-to-block-google-wireless-transcoder-gwt-googlebot-mobile/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
