<?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>狗爺語錄 &#187; Site maintenance</title>
	<atom:link href="http://me.abelcheung.org/diary/site-maintenance/feed/" rel="self" type="application/rss+xml" />
	<link>http://me.abelcheung.org</link>
	<description>吠盡不平事</description>
	<lastBuildDate>Sun, 09 May 2010 20:28:54 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Yahoo Site Explorer SUCKS. Big time.</title>
		<link>http://me.abelcheung.org/2009/07/13/yahoo-site-explorer-sucks-big-time/</link>
		<comments>http://me.abelcheung.org/2009/07/13/yahoo-site-explorer-sucks-big-time/#comments</comments>
		<pubDate>Sun, 12 Jul 2009 20:08:43 +0000</pubDate>
		<dc:creator>Abel</dc:creator>
				<category><![CDATA[Site maintenance]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[search engine]]></category>
		<category><![CDATA[Yahoo]]></category>

		<guid isPermaLink="false">http://me.abelcheung.org/?p=716</guid>
		<description><![CDATA[<div class="sideblock alignright">(For those who don&#8217;t know about what &#8220;webmaster tool&#8221; is and what it does: webmaster tool allows site administrators to control how their sites are crawled by search engines. Please refer to <a href="http://www.digitalpurview.com/yahoo-webmaster-tools/" target="_blank" class="liexternal">this Digital Purview post</a> for a brief introduction.)</div>
<p><span class="drop">W</span>hile <a href="http://www.google.com/webmasters/tools/" target="_blank" class="liexternal">Google Webmaster tool</a> does its job well (even <a href="http://webmaster.live.com/" target="_blank" class="liexternal">Microsoft one</a> too), Yahoo Site Explorer (interesting that it&#8217;s not named Webmaster tool like the others) simply adds no value to webmasters except confusion, impatience and disappointment. The reason?</p>
<p>[......]</p><p class='read-more'><a href='http://me.abelcheung.org/2009/07/13/yahoo-site-explorer-sucks-big-time/'>(Continue reading...)</a></p>]]></description>
			<content:encoded><![CDATA[<div class="sideblock alignright">(For those who don&#8217;t know about what &#8220;webmaster tool&#8221; is and what it does: webmaster tool allows site administrators to control how their sites are crawled by search engines. Please refer to <a href="http://www.digitalpurview.com/yahoo-webmaster-tools/" target="_blank" class="liexternal">this Digital Purview post</a> for a brief introduction.)</div>
<p><span class="drop">W</span>hile <a href="http://www.google.com/webmasters/tools/" target="_blank" class="liexternal">Google Webmaster tool</a> does its job well (even <a href="http://webmaster.live.com/" target="_blank" class="liexternal">Microsoft one</a> too), Yahoo Site Explorer (interesting that it&#8217;s not named Webmaster tool like the others) simply adds no value to webmasters except confusion, impatience and disappointment. The reason?</p>
<p><span id="more-716"></span></p>
<ul>
<li>While Google and Microsoft one allows authentication of site using <code>META</code> tag, similar function by Yahoo simply fail. No idea, and no comprehensive error message. Yahoo just fails and tells you it would retry again later.</li>
<li>Once Yahoo fails to validate your site, what&#8217;s next? Revalidate immediately? NO! Even if you choose alternative method (uploading a file into web root folder), it would just indicate that validation will be pending some time soon. How long? No idea.</li>
<li>Therefore, for people impatient enough to demand immediate validation, one have to remove and readd the site, and revalidate afterwards using file upload method. No other choice.</li>
<li>Once validated, can I just revert to previous site content? OK for Google, not for Microsoft and Yahoo. In Yahoo it is indicated clearly:<br />
<blockquote><p>We will revalidate your site ownership by checking this file regularly.</p></blockquote>
<blockquote><p>We will revalidate your site ownership by checking this META tag regularly.</p></blockquote>
</li>
<li>Taiwan version of Site Explorer is equally stupid, one have to <em>stick an image on web page</em> for validation! Speechless. Can&#8217;t it just use some less intrusive method for validation?</li>
<li>Too bad that Yahoo doesn&#8217;t accept any sort of <a href="http://www.sitemaps.org/" target="_blank" class="liexternal">XML sitemap</a>.</li>
</ul>
<p>For the functionalities after validation &mdash; well, my opinion is, no one is perfect (a combination of all 3 as a single website management tool is most desirable). However, if I were to pick one, I <em>absolutely</em> would not pick Yahoo. So far the only thing worth mentioning is, Yahoo allows removal of selected URLs containing certain substrings or GET parameters.</p>
]]></content:encoded>
			<wfw:commentRss>http://me.abelcheung.org/2009/07/13/yahoo-site-explorer-sucks-big-time/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Blog spam 越來越聰明</title>
		<link>http://me.abelcheung.org/2009/04/08/blog-spam-%e8%b6%8a%e4%be%86%e8%b6%8a%e8%81%b0%e6%98%8e/</link>
		<comments>http://me.abelcheung.org/2009/04/08/blog-spam-%e8%b6%8a%e4%be%86%e8%b6%8a%e8%81%b0%e6%98%8e/#comments</comments>
		<pubDate>Wed, 08 Apr 2009 03:16:55 +0000</pubDate>
		<dc:creator>Abel</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Site maintenance]]></category>
		<category><![CDATA[spam]]></category>

		<guid isPermaLink="false">http://me.abelcheung.org/?p=668</guid>
		<description><![CDATA[如果某天有人在有關 WordPress 的 blog post 留言：
Nice plugin &#8211; I think I will use it in my next wordpress project and check it out
那麼會不會高興？可是我將它標記為 spam。因為那篇[......]<p class='read-more'><a href='http://me.abelcheung.org/2009/04/08/blog-spam-%e8%b6%8a%e4%be%86%e8%b6%8a%e8%81%b0%e6%98%8e/'>(Continue reading...)</a></p>]]></description>
			<content:encoded><![CDATA[<p><span class="drop">如</span>果某天有人在有關 WordPress 的 blog post 留言：</p>
<blockquote><p>Nice plugin &#8211; I think I will use it in my next wordpress project and check it out</p></blockquote>
<p>那麼會不會高興？可是我將它標記為 spam。因為那篇根本和 plugin 無關，而且連結來自信用咭網站。</p>
<p>現在似乎更多 spammer 懂得使用更個人化的 spam 工具了，拆解 JavaScript 就不用說 (<a href="http://wordpress.org/extend/plugins/wp-hashcash/" target="_blank" class="liwp">WordPress Hashcash</a> 漸漸被廢武功，不然我也看不到這種留言)，更開始因應內容而決定送出哪些留言。大概可以想像，某一天能從 facebook 等 social network 搜集個人資料，然後好像 Google Ad 般產生更針對性的廣告內容塞滿留言，日子也許不會太遠。</p>
]]></content:encoded>
			<wfw:commentRss>http://me.abelcheung.org/2009/04/08/blog-spam-%e8%b6%8a%e4%be%86%e8%b6%8a%e8%81%b0%e6%98%8e/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>感謝性愛用品留言</title>
		<link>http://me.abelcheung.org/2009/01/12/%e6%84%9f%e8%ac%9d%e6%80%a7%e6%84%9b%e7%94%a8%e5%93%81%e7%95%99%e8%a8%80/</link>
		<comments>http://me.abelcheung.org/2009/01/12/%e6%84%9f%e8%ac%9d%e6%80%a7%e6%84%9b%e7%94%a8%e5%93%81%e7%95%99%e8%a8%80/#comments</comments>
		<pubDate>Sun, 11 Jan 2009 19:34:06 +0000</pubDate>
		<dc:creator>Abel</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Site maintenance]]></category>
		<category><![CDATA[sex]]></category>
		<category><![CDATA[spam]]></category>

		<guid isPermaLink="false">http://me.abelcheung.org/?p=574</guid>
		<description><![CDATA[<p><span class="drop">致</span>「永久愛」讀者：</p>
<p>本人十分感謝閣下抽空回應本人的文章之餘，還提供性愛、自慰、SM 用品以及壯陽藥物的連結，本人會好好地考慮一下的。<br /><span style="float: right">&#8212; Abel</span></p>
<div id="attachment_573" class="wp-caption alignnone" style="width: 463px"><img src="http://me.abelcheung.org/wp-content/uploads/2009/01/p0rn_comments.png" alt="性愛用品留言" title="性愛用品留言" width="453" height="564" class="size-full wp-image-573" /><p class="wp-caption-text">性愛用品留言</p></div>]]></description>
			<content:encoded><![CDATA[<p><span class="drop">致</span>「永久愛」讀者：</p>
<p>本人十分感謝閣下抽空回應本人的文章之餘，還提供性愛、自慰、SM 用品以及壯陽藥物的連結，本人會好好地考慮一下的。<br /><span style="float: right">&mdash; Abel</span></p>
<div id="attachment_573" class="wp-caption alignnone" style="width: 463px"><img src="http://me.abelcheung.org/wp-content/uploads/2009/01/p0rn_comments.png" alt="性愛用品留言" title="性愛用品留言" width="453" height="564" class="size-full wp-image-573" /><p class="wp-caption-text">性愛用品留言</p></div>
]]></content:encoded>
			<wfw:commentRss>http://me.abelcheung.org/2009/01/12/%e6%84%9f%e8%ac%9d%e6%80%a7%e6%84%9b%e7%94%a8%e5%93%81%e7%95%99%e8%a8%80/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>吹爆餿狗大行動</title>
		<link>http://me.abelcheung.org/2008/08/19/%e5%90%b9%e7%88%86%e9%a4%bf%e7%8b%97%e5%a4%a7%e8%a1%8c%e5%8b%95/</link>
		<comments>http://me.abelcheung.org/2008/08/19/%e5%90%b9%e7%88%86%e9%a4%bf%e7%8b%97%e5%a4%a7%e8%a1%8c%e5%8b%95/#comments</comments>
		<pubDate>Tue, 19 Aug 2008 15:48:53 +0000</pubDate>
		<dc:creator>Abel</dc:creator>
				<category><![CDATA[Site maintenance]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[user agent]]></category>

		<guid isPermaLink="false">http://me.abelcheung.org/?p=546</guid>
		<description><![CDATA[<a href="http://me.abelcheung.org/wp-content/uploads/2008/08/blow.png" rel="lightbox"><img src="http://me.abelcheung.org/wp-content/uploads/2008/08/blow-150x150.png" alt="我要吹爆你呀！" title="我要吹爆你呀！" width="150" height="150" class="alignright" /></a>
竟然<a href="http://me.abelcheung.org/2008/08/02/%e6%90%9c%e7%8b%97%e5%a4%a7%e5%8f%8d%e6%93%8a/#comment-91982" class="liinternal">這麼快就說</a>上次的 iptables rule 太絕了？那些規則用了不到三天就不用了！何解？
<ol>
<li>餿狗實在太自私兼聰明了，發覺一段短時間沒有 traffic，它就會自行中斷連線；拖字訣對它完全無效。相反地，百度反而有用，一直都是等很多分鐘才 timeout。</li>
<li>近來開始做一些網站統計分析，但這些賤種搜尋引擎對於 traffic 的統計百[......]</li></ol><p class='read-more'><a href='http://me.abelcheung.org/2008/08/19/%e5%90%b9%e7%88%86%e9%a4%bf%e7%8b%97%e5%a4%a7%e8%a1%8c%e5%8b%95/'>(Continue reading...)</a></p>]]></description>
			<content:encoded><![CDATA[<p><a href="http://me.abelcheung.org/wp-content/uploads/2008/08/blow.png" rel="lightbox"><img src="http://me.abelcheung.org/wp-content/uploads/2008/08/blow-150x150.png" alt="我要吹爆你呀！" title="我要吹爆你呀！" width="150" height="150" class="alignright" /></a></p>
<p><span class="drop">竟</span>然<a href="http://me.abelcheung.org/2008/08/02/%e6%90%9c%e7%8b%97%e5%a4%a7%e5%8f%8d%e6%93%8a/#comment-91982" class="liinternal">這麼快就說</a>上次的 iptables rule 太絕了？那些規則用了不到三天就不用了！何解？</p>
<ol>
<li>餿狗實在太自私兼聰明了，發覺一段短時間沒有 traffic，它就會自行中斷連線；拖字訣對它完全無效。相反地，百度反而有用，一直都是等很多分鐘才 timeout。</li>
<li>近來開始做一些網站統計分析，但這些賤種搜尋引擎對於 traffic 的統計百害而無一利，所以要想個辦法將它永遠趕走，淨是 timeout 還是不太夠。</li>
</ol>
<p>第二個階段，嘗試讓它們自家打自家：用 Apache 的 RewriteRule，將百度的 request redirect 去餿狗，再將餿狗的 request 丢到百度去，因為它們互為天敵，所以看到我煽風點火，理應不再管我才是。結果我猜錯了，還是陸續有來，餿狗最高每 3-5 秒一次，百度最高速度也有 3-5 分鐘，而且仍是拼命找我禁止 index 的地方。</p>
<p>最後按捺不住了，出最後的殺手鐧，找專人侍候它們。</p>
<div class="cmd">iptables -t nat -A PREROUTING -j DNAT -p tcp -s 220.181.0.0/16 &#8211;dport 80 &#8211;to-destination :81</div>
<p>這些搜尋引擎絕對值得我另開渠道去服侍。服侍它們的僕人來頭可不少：<code>/dev/urandom</code> <img src='http://me.abelcheung.org/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>當然，一開始就給它們下馬威不是太禮貎，怕太快會嚇怕它們。所以提供一個正常的 HTTP header 作為甜頭是必須的：</p>
<pre class="cmd script">
#!/bin/sh

sleep 5
cat &lt;&lt; _EOF_
HTTP/1.1 200 OK
Date: `date +"%a, %d %b %Y %H:%M:%S HKT"`
Server: Apache/2.0
Transfer-Encoding: chunked
Content-Type: text/html

_EOF_

<strong>exec cat &lt; /dev/urandom</strong>
</pre>
<p>結果？餿狗好像不是太喜歡我的待客態度！現在連踪影都沒了，真是有點懷念餿狗的日子啊！至少不會那麼無聊。現在要應付的可麻煩多了，因為近來發覺有不少都是扮假狗，模彷 IE 的 user agent 的，雖然有些仍然找到別的蛛絲馬跡。例如有一個雖然是扮 IE，但是使用 HTTP/1.0，而且快速存取大量全無關係的頁面的。</p>
]]></content:encoded>
			<wfw:commentRss>http://me.abelcheung.org/2008/08/19/%e5%90%b9%e7%88%86%e9%a4%bf%e7%8b%97%e5%a4%a7%e8%a1%8c%e5%8b%95/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>被 snort 整蠱了</title>
		<link>http://me.abelcheung.org/2008/06/10/%e8%a2%ab-snort-%e6%95%b4%e8%a0%b1%e4%ba%86/</link>
		<comments>http://me.abelcheung.org/2008/06/10/%e8%a2%ab-snort-%e6%95%b4%e8%a0%b1%e4%ba%86/#comments</comments>
		<pubDate>Mon, 09 Jun 2008 23:48:22 +0000</pubDate>
		<dc:creator>Abel</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[Site maintenance]]></category>
		<category><![CDATA[buggy software]]></category>
		<category><![CDATA[critics]]></category>
		<category><![CDATA[intrusion detection system]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[硬膠]]></category>

		<guid isPermaLink="false">http://me.abelcheung.org/2008/06/10/%e8%a2%ab-snort-%e6%95%b4%e8%a0%b1%e4%ba%86/</guid>
		<description><![CDATA[<p><span class="drop">因</span>為有些東西想測試，早幾天在自己的伺服器裝了 <a href="http://www.snort.org/" target="_blank" class="liexternal">snort</a>，結果卻是被它玩了一頓。昨天看看 snort 寄給我的 mail，有大量 robots.txt access：</p>
<pre class="cmd script">
 # of  from             to               method
=========================================================================
   xx  xxx.xxx.xxx.xxx   202.134.73.141   WEB-MISC robots.txt access
   xx  xxx.xxx.xxx.xxx   202.134.73.141   WEB-MISC robots.txt access
......
</pre>
<p>[......]</p><p class='read-more'><a href='http://me.abelcheung.org/2008/06/10/%e8%a2%ab-snort-%e6%95%b4%e8%a0%b1%e4%ba%86/'>(Continue reading...)</a></p>]]></description>
			<content:encoded><![CDATA[<p><span class="drop">因</span>為有些東西想測試，早幾天在自己的伺服器裝了 <a href="http://www.snort.org/" target="_blank" class="liexternal">snort</a>，結果卻是被它玩了一頓。昨天看看 snort 寄給我的 mail，有大量 robots.txt access：</p>
<pre class="cmd script">
 # of  from             to               method
=========================================================================
   xx  xxx.xxx.xxx.xxx   202.134.73.141   WEB-MISC robots.txt access
   xx  xxx.xxx.xxx.xxx   202.134.73.141   WEB-MISC robots.txt access
......
</pre>
<p><span id="more-484"></span></p>
<p>OK, 讀 robots.txt 是很正常的一回事，很清楚那是 false alarm，但前幾天的 log 都有兩個不尋常的項目：</p>
<pre class="cmd script">
 # of  from             to               method
=========================================================================
   xx  xxx.xxx.xxx.xxx  202.134.73.141   WEB-PHP Mambo upload.php access
   xx  xxx.xxx.xxx.xxx  202.134.73.141   WEB-PHP IGeneric Free Shopping Cart page.php access
</pre>
<p>不單止數目都很高，最要命的是：全部都是我家中的 IP 地址發出的？因為 ISP 的緣故，家中的 IP 每天會改至少一次，但 log 裏的 IP address 和日期全部吻合！那時心就慌了，會不會是我的電腦被種了木馬而自己不知道？特別是近幾天都在用 <a href="http://www.flock.com/" target="_blank" class="liexternal">flock</a>，不會是被人借 flock 入侵吧？想想不對頭，立即將 flock 關掉。(現在想來，自己也覺自己可笑)</p>
<p>之後再看，還有更令我膽顫心驚的：</p>
<pre class="cmd script">
 # of  from             to               method
=========================================================================
   xx  xxx.xxx.xxx.xxx  202.134.73.141   MISC rsyncd overflow attempt
</pre>
<p>令我嚇壞的是，剛好我在那一天用過 rsync。其它日子沒有用過 rsync，也沒有這一句。第一個念頭：我的電腦被種了 keylogger，所以我用過甚麼服務全被人知道了？所有戶口的密碼怎麼辦？完了。</p>
<p>過一會後，再定下心神，想想有沒有別的可能性。抱着最後一絲希望，去看看這些警告代表甚麼意思。在 <a href="http://cvs.snort.org/viewcvs.cgi/snort/rules/web-php.rules" target="_blank" class="liexternal">有關的 snort 規則中</a>的全文是：</p>
<div class="cmd">alert tcp $EXTERNAL_NET any -> $HTTP_SERVERS $HTTP_PORTS (msg:&#8221;WEB-PHP Mambo upload.php access&#8221;; flow:to_server,established; <font color="red">uricontent:&#8221;/upload.php&#8221;;</font> reference:bugtraq,6572; classtype:web-application-activity; sid:2077; rev:2;)</div>
<div class="cmd">alert tcp $EXTERNAL_NET any -> $HTTP_SERVERS $HTTP_PORTS (msg:&#8221;WEB-PHP IGeneric Free Shopping Cart page.php access&#8221;; flow:to_server,established; <font color="red">uricontent:&#8221;/page.php&#8221;;</font> nocase; reference:bugtraq,9773; classtype:web-application-activity; sid:2410; rev:2;)</div>
<p><span style="font-size: 200%; font-weight: bold;">妖～!</span>果然全部是 false alarm。上面設定的意思是，只要詢問 web server 的 URL 中含有 &#8220;/page.php&#8221; 或 &#8220;/upload.php&#8221;，就會發出警報。這算甚麼？這世界上有 page.php 或 upload.php 的軟件何其多！恐怕 snort 還有不少這類漁翁撒網的規則吧。</p>
<p>而且 email 中完全不會提任何事件有多嚴重，不會分辨甚麼是 activity、甚麼是 attack，而且將 robots.txt 歸在比 IIS unicode attack 還重要的分類…… 我不知道預設用這種爛設定是為了讓商業軟件有生存空間，還是為了要提醒人必須更改設定以適合自己的需要，但這種爛設定真是會嚇壞新手的。不論如何，這幾句立即就被我用 suppress 去掉了：</p>
<pre class="brush: plain;">
suppress gen_id 1, sig_id 1852
suppress gen_id 1, sig_id 2077
suppress gen_id 1, sig_id 2410
</pre>
<p>總之就像 Vista 的 <abbr title="User Account Control">UAC</abbr> 一樣，日日都是狼來了。</p>
]]></content:encoded>
			<wfw:commentRss>http://me.abelcheung.org/2008/06/10/%e8%a2%ab-snort-%e6%95%b4%e8%a0%b1%e4%ba%86/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>消滅 nofollow</title>
		<link>http://me.abelcheung.org/2007/03/30/%e6%b6%88%e6%bb%85-nofollow/</link>
		<comments>http://me.abelcheung.org/2007/03/30/%e6%b6%88%e6%bb%85-nofollow/#comments</comments>
		<pubDate>Fri, 30 Mar 2007 02:40:25 +0000</pubDate>
		<dc:creator>Abel</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Site maintenance]]></category>
		<category><![CDATA[spam]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://me.abelcheung.org/2007/03/30/%e6%b6%88%e6%bb%85-nofollow/</guid>
		<description><![CDATA[剛看到一篇網誌，說 <a href="http://www.douglaskarr.com/2007/01/21/rel-nofollow/" target="_blank" class="liexternal">WordPress 使用 rel=&#8221;nofollow&#8221;</a> 毫無益處。rel=&#8221;nofollow&#8221; 是指搜尋器（例如 Google）在遇到加上 nofollow 的鏈結時不會經鏈結進入另一個網站來計算 PageRank，WordPres[......]<p class='read-more'><a href='http://me.abelcheung.org/2007/03/30/%e6%b6%88%e6%bb%85-nofollow/'>(Continue reading...)</a></p>]]></description>
			<content:encoded><![CDATA[<p><span class="drop">剛</span>看到一篇網誌，說 <a href="http://www.douglaskarr.com/2007/01/21/rel-nofollow/" target="_blank" class="liexternal">WordPress 使用 rel=&#8221;nofollow&#8221;</a> 毫無益處。rel=&#8221;nofollow&#8221; 是指搜尋器（例如 Google）在遇到加上 nofollow 的鏈結時不會經鏈結進入另一個網站來計算 PageRank，WordPress 加上這個的主要目的是為了防止 spammer 借用網誌來增加自己的站的 PageRank，<strike>但我很同意上面文章的說法，<a href="http://www.theregister.co.uk/2005/01/31/link_spamer_interview/" target="_blank" class="liexternal">spammer 要的不是 PageRank</a>，而是有人 click 就行。我留意了這些 spam 很久，很多 spam 中的網站鏈結都很迅速地換 hostname，根本等不及 Google 來搜尋，又何來 PageRank？況且 spammer 要 PageRank 來何用？賺錢而已，不必節外生枝。</strike></p>
<p>所以剛剛裝了 <a href="http://www.semiologic.com/software/dofollow/" target="_blank" class="liexternal">Dofollow plugin</a>，即是說各位的回應現在是可以增加 PageRank 的了。</p>
<p>2008-08-03 編輯：想了一想，其實和甚麼 PageRank 的毫無關係；nofollow 的目的是避免輕易被人加 spam link 而不自知，但一來我的站不會那麼輕易被 spam 穿透，二來 spam site 已經是打遊擊戰，封一個後可以隨時申請多十個域名再來，流動性太高，縱使 nofollow 了，過幾天後可能那個站已經不存在，所以 nofollow 也沒甚麼太大的用途。</p>
]]></content:encoded>
			<wfw:commentRss>http://me.abelcheung.org/2007/03/30/%e6%b6%88%e6%bb%85-nofollow/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PHP 安全性雜談</title>
		<link>http://me.abelcheung.org/2007/01/08/php-%e5%ae%89%e5%85%a8%e6%80%a7%e9%9b%9c%e8%ab%87/</link>
		<comments>http://me.abelcheung.org/2007/01/08/php-%e5%ae%89%e5%85%a8%e6%80%a7%e9%9b%9c%e8%ab%87/#comments</comments>
		<pubDate>Mon, 08 Jan 2007 00:13:28 +0000</pubDate>
		<dc:creator>Abel</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[Site maintenance]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[vulnerability]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://me.abelcheung.org/2007/01/08/php-%e5%ae%89%e5%85%a8%e6%80%a7%e9%9b%9c%e8%ab%87/</guid>
		<description><![CDATA[<img id="image205" src="/wp-content/uploads/2007/01/php-logo.png" alt="PHP logo" class="alignright" />
今天整天都在更新和 PHP 有關的東西：
<ul>
<li>因為看到 Wordpress 2.0.4 有些嚴重安全漏洞 <a href="http://www.hardened-php.net/advisory_022007.141.html" target="_blank" class="liexternal">[1]</a> <a href="http://www.hardened-php.net/advisory_012007.140.html" target="_blank" class="liexternal">[2]</a>，而且都是可以行使 admin 權力執行任意的 php code，所以更新至最新的 2.0.6。</li>
<li>安裝 <a href="http://www.hardened-[......]</li></ul><p class='read-more'><a href='http://me.abelcheung.org/2007/01/08/php-%e5%ae%89%e5%85%a8%e6%80%a7%e9%9b%9c%e8%ab%87/'>(Continue reading...)</a></p>]]></description>
			<content:encoded><![CDATA[<p><img id="image205" src="/wp-content/uploads/2007/01/php-logo.png" alt="PHP logo" class="alignright" /></p>
<p><span class="drop">今</span>天整天都在更新和 PHP 有關的東西：</p>
<ul>
<li>因為看到 Wordpress 2.0.4 有些嚴重安全漏洞 <a href="http://www.hardened-php.net/advisory_022007.141.html" target="_blank" class="liexternal">[1]</a> <a href="http://www.hardened-php.net/advisory_012007.140.html" target="_blank" class="liexternal">[2]</a>，而且都是可以行使 admin 權力執行任意的 php code，所以更新至最新的 2.0.6。</li>
<li>安裝 <a href="http://www.hardened-php.net/suhosin/index.html" target="_blank" class="liexternal">Suhosin</a>。從<a href="http://www.hardened-php.net/suhosin/a_feature_list.html" target="_blank" class="liexternal">它的功能列表</a>來看，有些似乎頗有用，例如可選擇禁止 include() 遠端的 URL。舉例說，phpbb_root_path 造成了多少死傷，該有很多人知道吧。<a href="http://linuxhall.org/" target="_blank" class="liexternal">LinuxHall</a> 不知中招中過多少次了，我已經不想去數。</li>
<li>重新編譯 PHP，本來以為這下可慘了，但竟然沒有發生甚麼問題 &mdash; Suhosin 的 PHP patch 部份出奇地少，和那十幾個 Ubuntu PHP package 的 patch 居然沒有發生任何衝突；這趙真是神仙打救。只是 Ubuntu 沒有 Suhosin 的套件，得從 Debian 那裏拿一個已經 outdate 的套件自行更新；而且給 PHP5 的 module 更是無法編譯，偏偏我現在仍是用 PHP4，不是神仙打救是甚麼？</li>
</ul>
<p>之前留意到三則和 PHP 有關的資料：</p>
<ul>
<li>用 PHP 寫的 web application <a href="http://www.securityfocus.com/brief/57" target="_blank" class="liexternal">成為主要攻擊目標之一</a>。（這個應算是常識吧）</li>
<li><a href="http://www.heise-security.co.uk/news/82500" target="_blank" class="liexternal">Stefan Esser 退出 PHP security team</a>，並抨擊 PHP 開發隊伍忽視安全性。</li>
<li>2006 年<a href="http://www.theregister.co.uk/2006/12/21/php_security_scrutinised/" target="_blank" class="liexternal">有 43% 的安全漏洞有 PHP 這個字</a>，其中 33 個是 PHP 本身的問題。2005 年只有 29%。<a href="http://blogs.zend.com/2006/12/28/specific-data-always-tell-more-than-generalities/" target="_blank" class="liexternal">Zend 的 blog</a> 有較詳盡資料分析這 33 個漏洞。</li>
</ul>
<p>我記得有人問過我，既然許多 PHP 的程式都不安全（<a href="http://phpnuke.org/" target="_blank" class="liexternal">phpNuke</a> 等等），那麼為甚麼不內置一些方法令 PHP 安全一些？說是一句話而已，做的話有許多時候是近乎不可能的。例如寫程式的人沒有安全意識，直接在網頁的 form 的文字欄位讀取內容，檢查也不檢查一下就直接放入資料庫，SQL injection 就是這樣來的。或許有人說，PHP 也有 magic_quotes_gpc 之類的保護啊！但這些設定到最後得不償失，有些程式開了設定後就無法使用，相反地另一些卻是關閉設定後無法使用，十分混亂。而且讀取一個變數，又有沒有可能預知它會怎樣用？可能不是放入資料庫而是直接印出來呢？當成是檔案名稱呢？人名呢？</p>
<p>但也有些問題是可以在 PHP 的層次解決的。例如 <a href="http://www.suphp.org/Home.html" target="_blank" class="liexternal">suphp</a>，就是執行 PHP 時順便改變 UID，就不會甚麼目錄都要開放給 Apache 的 UID 來讀寫了。不過因為它和 mod_php 不兼容（只能用 Apache + mod_suphp，再經一個 SUID 的 binary 執行 PHP 的 CGI 版本），覺得麻煩，所以就改為試用 Suhosin（雖然到最後發覺用 Suhosin 一樣麻煩 X-D）。</p>
<p>選用 PHP 寫的 web application 真的要當心。phpNuke 和 <a href="http://www.phpbb.com/" target="_blank" class="liexternal">phpBB</a> 早就入了我的黑名單的永久會籍，<a href="http://www.phpmyadmin.net/home_page/index.php" target="_blank" class="liexternal">phpMyAdmin</a> 也要很小心。淨是<a href="http://phpsec.org/projects/vulnerabilities/securityfocus.html" target="_blank" class="liexternal">這裏列出的</a> SecurityFocus 有關 PHP 的 advisory 也已經夠瞧了。</p>
<ul>
<li><a href="http://blog.php-security.org/" target="_blank" class="liexternal">blog.php-security.org</a>：是 Stefan Esser 自己的 blog，和 PHP 安全性有關的資料很多，學到的東西不少。不過不要理他的 comment，他的說話有不少都帶侮辱成分。</li>
<li><a href="http://phpsec.org/" target="_blank" class="liexternal">PHP security consortium</a>：雖然不覺得它本身有多少建樹，但統計資料倒是可以。相關的還有 <a href="http://www.webappsec.org/" target="_blank" class="liexternal">Web application security consortium</a>。</li>
<li><a href="http://templora.com/content/14" target="_blank" class="liexternal">一個簡單的 tutorial</a>，教人如何在寫 PHP 時避免最常見的三數種安全漏洞：SQL injection, Cross Site Scripting (XSS), Cross Site Request Forgery Attacks (CSRF), Input validation。</li>
</ul>
<p>我有點興趣想知道，所有開了 PHP safe mode 的網站怎麼辦，是否永遠不升級至 PHP 6？雖然承認了 safe mode 是失敗之作，但這麼快就<a href="http://hk2.php.net/manual/en/features.safe-mode.php" target="_blank" class="liexternal">要它消失</a>，只恐怕有大批管理員要叫苦連天。</p>
]]></content:encoded>
			<wfw:commentRss>http://me.abelcheung.org/2007/01/08/php-%e5%ae%89%e5%85%a8%e6%80%a7%e9%9b%9c%e8%ab%87/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Subversion 的 web 介面</title>
		<link>http://me.abelcheung.org/2007/01/04/subversion-%e7%9a%84-web-%e4%bb%8b%e9%9d%a2/</link>
		<comments>http://me.abelcheung.org/2007/01/04/subversion-%e7%9a%84-web-%e4%bb%8b%e9%9d%a2/#comments</comments>
		<pubDate>Wed, 03 Jan 2007 22:35:57 +0000</pubDate>
		<dc:creator>Abel</dc:creator>
				<category><![CDATA[Site maintenance]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[version control system]]></category>

		<guid isPermaLink="false">http://me.abelcheung.org/2007/01/04/subversion-%e7%9a%84-web-%e4%bb%8b%e9%9d%a2/</guid>
		<description><![CDATA[之前為自己的象棋盤程式架了一個 subversion repository，選擇 web 介面時因為以為 viewcvs 已經停止不再維護，所以試用了一下 <a href="http://websvn.tigris.org/" target="_blank" class="liexternal">w[......]</a><p class='read-more'><a href='http://me.abelcheung.org/2007/01/04/subversion-%e7%9a%84-web-%e4%bb%8b%e9%9d%a2/'>(Continue reading...)</a></p>]]></description>
			<content:encoded><![CDATA[<p><span class="drop">之</span>前為自己的象棋盤程式架了一個 subversion repository，選擇 web 介面時因為以為 viewcvs 已經停止不再維護，所以試用了一下 <a href="http://websvn.tigris.org/" target="_blank" class="liexternal">websvn</a>。用了一段時間，發覺基本功能好像稍為欠奉，又有點不習慣（始終是慣了用 viewcvs），所以昨晚下定決定找個好一點的，竟然發覺原來 viewcvs 沒有消失，而是換了名稱 &mdash; <a href="http://www.viewvc.org/" target="_blank" class="liexternal">ViewVC</a>。立即就下載回來試用，結果安裝方面完全不困難（我沒有開啟甚麼額外功能），樣子和版面配置也和 viewcvs 沒分別，於是立即架了起來用。</p>
<p>不過之前沒有檢查清楚 websvn 的設定，以為它不能用來下載 tarball，剛才準備刪除 websvn 之前再覆核一下設定，才發覺它也可以下載 tarball，和一樣有 syntax highlight。兩者比較起來，websvn 多了 RSS feed 和 bugtraq keyword 支援，而缺少了瀏覽舊版 source code 的功能；細心比較過之後，還是 viewvc 較適合我。</p>
<p>網站在哪裏？暫時還是 &mdash;&mdash; 秘～密。不過過一段時間後就會公開出來，因為遲些有時間的話打算將自己正在寫的東西都搬到公眾的 version control 站台（sourceforge 之類），到時我自己架的站就完全沒用了。 <img src='http://me.abelcheung.org/wp-includes/images/smilies/icon_biggrin.gif' alt=':-D' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://me.abelcheung.org/2007/01/04/subversion-%e7%9a%84-web-%e4%bb%8b%e9%9d%a2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>搜狐太過份了</title>
		<link>http://me.abelcheung.org/2006/12/24/%e6%90%9c%e7%8b%90%e5%a4%aa%e9%81%8e%e4%bb%bd%e4%ba%86/</link>
		<comments>http://me.abelcheung.org/2006/12/24/%e6%90%9c%e7%8b%90%e5%a4%aa%e9%81%8e%e4%bb%bd%e4%ba%86/#comments</comments>
		<pubDate>Sat, 23 Dec 2006 23:50:26 +0000</pubDate>
		<dc:creator>Abel</dc:creator>
				<category><![CDATA[Site maintenance]]></category>

		<guid isPermaLink="false">http://me.abelcheung.org/2006/12/24/%e6%90%9c%e7%8b%90%e5%a4%aa%e9%81%8e%e4%bb%bd%e4%ba%86/</guid>
		<description><![CDATA[我一直以來雖然發覺自己伺服器的 Apache 某些時候總是佔大量 CPU time，但都沒留意是誰搞的鬼，今天將伺服器更新至 Edgy 時才查根究底。原因？標題就已經寫了，原來是 sohu 的傑作。它的 crawler 會毫不留情地搶盡頻寬，後果怎樣，大致上可以想像得到吧。
可是它不仁，我不會不義，[......]<p class='read-more'><a href='http://me.abelcheung.org/2006/12/24/%e6%90%9c%e7%8b%90%e5%a4%aa%e9%81%8e%e4%bb%bd%e4%ba%86/'>(Continue reading...)</a></p>]]></description>
			<content:encoded><![CDATA[<p><span class="drop">我</span>一直以來雖然發覺自己伺服器的 Apache 某些時候總是佔大量 CPU time，但都沒留意是誰搞的鬼，今天將伺服器更新至 Edgy 時才查根究底。原因？標題就已經寫了，原來是 sohu 的傑作。它的 crawler 會毫不留情地搶盡頻寬，後果怎樣，大致上可以想像得到吧。</p>
<p>可是它不仁，我不會不義，出動 iptables 封殺這麼過份。（老實說，是不知為何 iptables 的 connlimit module 不能用）我只是在 Apache 設定裏將 sohu 的頻寬限制為 1kbit/s (128 byte/s)，另外只允許它開一個 connection 而已。隨便它慢慢搜吧，無任歡迎 <img src='http://me.abelcheung.org/wp-includes/images/smilies/icon_biggrin.gif' alt=':-D' class='wp-smiley' />  </p>
<p></p>
<p><small>07:53 附註：它的 IP 是 <strong>220.181.19.159</strong></small></p>
]]></content:encoded>
			<wfw:commentRss>http://me.abelcheung.org/2006/12/24/%e6%90%9c%e7%8b%90%e5%a4%aa%e9%81%8e%e4%bb%bd%e4%ba%86/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>隱形 blog spam</title>
		<link>http://me.abelcheung.org/2006/07/06/%e9%9a%b1%e5%bd%a2-blog-spam/</link>
		<comments>http://me.abelcheung.org/2006/07/06/%e9%9a%b1%e5%bd%a2-blog-spam/#comments</comments>
		<pubDate>Wed, 05 Jul 2006 21:49:13 +0000</pubDate>
		<dc:creator>Abel</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Site maintenance]]></category>
		<category><![CDATA[spam]]></category>

		<guid isPermaLink="false">http://me.abelcheung.org/2006/07/06/%e9%9a%b1%e5%bd%a2-blog-spam/</guid>
		<description><![CDATA[這趟見鬼了，兩個月來被 blog spam 轟炸，一直都毫髮無傷，連清理也不需要；但第一次通過雷達網的 spam 就讓我百思不得其解：在 Apache log 裏面竟然沒有紀錄！如果說是老天爺開的玩笑，那就沒甚麼好說了，但如果不是甚麼神或魔的惡作劇，那就更麻煩了，因為能夠這樣做的，一個可能性是 SQ[......]<p class='read-more'><a href='http://me.abelcheung.org/2006/07/06/%e9%9a%b1%e5%bd%a2-blog-spam/'>(Continue reading...)</a></p>]]></description>
			<content:encoded><![CDATA[<p><span class="drop">這</span>趟見鬼了，兩個月來被 blog spam 轟炸，一直都毫髮無傷，連清理也不需要；但第一次通過雷達網的 spam 就讓我百思不得其解：在 Apache log 裏面竟然沒有紀錄！如果說是老天爺開的玩笑，那就沒甚麼好說了，但如果不是甚麼神或魔的惡作劇，那就更麻煩了，因為能夠這樣做的，一個可能性是 SQL injection，另一個可能性是我的電腦已經被入侵了而我還不知道。</p>
]]></content:encoded>
			<wfw:commentRss>http://me.abelcheung.org/2006/07/06/%e9%9a%b1%e5%bd%a2-blog-spam/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
