<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>BLUECOARA.NET</title>
    <link>http://bluecoara.net/</link>
    <description></description>
    <!-- optional tags -->
    <language>ja</language>           <!-- valid langugae goes here -->
    <generator>Nucleus CMS v3.22</generator>
    <copyright>ｩ</copyright>             <!-- Copyright notice -->
    <category>Weblog</category>
    <docs>http://backend.userland.com/rss</docs>
    <image>
      <url>http://bluecoara.net//nucleus/nucleus2.gif</url>
      <title>BLUECOARA.NET</title>
      <link>http://bluecoara.net/</link>
    </image>
    <item>
 <title><![CDATA[mixiにて]]></title>
 <link>http://bluecoara.net/index.php?itemid=48</link>
<description><![CDATA[<p>男なのに女の子っぽい名前をつけてたり、プロフィールに女の子の写真を使ってたりする人が気持ち悪い・・・。<br />
(と書いたら怒られるかな？)</p>
<p># あー、決して私の登録リストに入ってる方に対してではないですよ(笑)</p>
]]></description>
 <category>BLOG</category>
<comments>http://bluecoara.net/index.php?itemid=48</comments>
 <pubDate>Sun, 20 Nov 2005 21:15:17 +0900</pubDate>
</item><item>
 <title><![CDATA[セキュリティ意識が低すぎる]]></title>
 <link>http://bluecoara.net/index.php?itemid=47</link>
<description><![CDATA[<p>とある商用のウェブメールだが、i-modeやezweb端末でメールを読めるようなモバイル機能を持っています。</p>
<p>皆さんご存じのように、携帯端末の多くはcookieをサポートしていない場合があるため、ウェブアプリケーション側でセッションを利用するためにはGETメソッドの引数やPOSTメソッド時のhiddenが一般的に使用されます。</p>
<p>このシステムはGETの引数としてユーザIDやパスワードなどがmd5()されたような値を用いていました。<br />
http://www.example.com/のような文字列を本文に含ませてメーラからメールを送信、ezweb端末から見ると、この文字列はご丁寧にaタグで囲まれているわけです。</p>
<p>リンククリックしたらHTTP_REFERERがウェブサーバ側に送られること、開発者の方々ご存じないのかな。<br />
特に何も工夫することなくセッションハイジャックできるのですが・・・。</p>
<p>たとえば、REFERERとして残されるURIが<br />
http://www.example.com/mail.cgi?hogeid=nomo@bluecoara,net&sess=abcdefg<br />
のような場合、後々googleでmail.cgi hogeidという文字列を検索すると、どこかのサイトのAnalogやAWstatsの中にアドレス記録されるんじゃないの？</p>
<p>しかもウェブメールサーバをリブートしてもセッション情報は破棄されていませんでした。trussとかすれば詳しい動き追えますが、そこまでやる義理は正直無し。</p>
<p>約1日の簡単な検証なのに、見つかったバグや脆弱性4件ほどですか。<br />
テスト項目どうなっているのか、是非教えて頂きたい限りでした。</p>
<p>あんまりこういう情報を自分の日記に書くのは好きではありませんが、未だにこんな化石が存在していたのか！という戒め的な意味で綴ってみた。</p>
]]></description>
 <category>BLOG</category>
<comments>http://bluecoara.net/index.php?itemid=47</comments>
 <pubDate>Wed, 9 Nov 2005 00:07:13 +0900</pubDate>
</item><item>
 <title><![CDATA[密かに告知]]></title>
 <link>http://bluecoara.net/index.php?itemid=46</link>
<description><![CDATA[<p>どなたか<a href="http://www.kvh.co.jp/">弊社</a>で働いてみたい方いらっしゃいませんか？<br />
高価なネットワーク機器やSolarisに沢山触るチャンスです．</p>
<p>漠然としか書けませんが，興味のある方いらっしゃいましたらメールください．詳細お話しましょう．</p>
<p>個人的な条件(全部が必須というわけではない)<br />
・Solaris/Linux/FreeBSD等のオペレーティング可能<br />
・各種サーバ構築経験あり<br />
・ファイアウォールやL3スイッチ設定経験あり<br />
・LB(F5社BigIP)設定経験あり<br />
・プログラミングは必須ではないですが，簡単なシェルスクリプトなどは書ける</p>
<p>申し訳ないですが，実力は？だけどISPでの仕事を経験してみたいから〜のようなものは歓迎されません。<br />
ある程度即戦力なかた期待です．</p>
]]></description>
 <category>BLOG</category>
<comments>http://bluecoara.net/index.php?itemid=46</comments>
 <pubDate>Fri, 28 Oct 2005 01:00:16 +0900</pubDate>
</item><item>
 <title><![CDATA[不便利メモ 閉鎖]]></title>
 <link>http://bluecoara.net/index.php?itemid=45</link>
<description><![CDATA[<p>久しぶりにアクセスログみてたら、こんな検索語が(笑)<br />
探せばちょっとまじめ路線で復活されてるかもしれませんよ。</p>
]]></description>
 <category>BLOG</category>
<comments>http://bluecoara.net/index.php?itemid=45</comments>
 <pubDate>Thu, 20 Oct 2005 00:18:42 +0900</pubDate>
</item><item>
 <title><![CDATA[mod_antispam]]></title>
 <link>http://bluecoara.net/index.php?itemid=44</link>
<description><![CDATA[<p>mod_antispam is an apache module which can control referer spam.</p>
<p>mod_antispam for Apache-2.0 / Apache-2.1</p>
<h2> WHAT IS THIS ?
</h2>
<p>By using this module, you can control referer spam accesses.</p>
<p>As you know, sometimes you can see referer spam access in your log files. their purpose is to lead you to spam website by recording their website address in your log files.</p>
<p>about referer spam, see http://www.spywareinfo.com/articles/referer_spam/</p>
<p>spammers always use bots/tools to connect your website with invalid referer.</p>
<p>when http server gets some HTTP_REFERER from clients, mod_antispam will connect to that website and try to find link to your website from the target.</p>
<p>if address is not found, module will update blacklist file automatically not to connect there later. and if your address found, update whitelist automatically not to connect here later.</p>
<p>also you can edit white/black lists by hands using regular expressions.</p>
<h2> REFERER spam MECHANISM
</h2>
<p>The most important thing is HTTP_REFERER in your log files is generated from client's web browser. therefore, people who knows referer mechanism can fake their HTTP_REFERER using some tools or by hands.</p>
<p>I'll give you an example.</p>
<pre class="command">
  % telnet your.website.example.com 80
  GET / HTTP/1.1
  Host: your.website.example.com
  Referer: http://www.google.com/
  Connection: close

  (contents will be displayed here)
</pre>
<p>Then http://www.google.com/ is added in your access log files, however http://www.google.com/ doesn't have any link to your website.</p>
<h2> mod_antispam ACTION
</h2>
<p>When this module finds any spam URI, you can choose some actions.</p>
<p>(1) [Test]<br />
record spam address into blacklist and access is allowed (test mode)</p>
<p>(2) [Replace]<br />
Rejectrecord spam address into blacklist and rewrite HTTP_REFERER to none and access allowd.<br />
by this method, access is allowed and spam address is not added in your logfile</p>
<p>(3) [Reject]<br />
record spam address into blacklist and return HTTP_FORBIDDEN (access denied)</p>
<p>(4) [ReplaceReject]<br />
record spam address into blacklist and rewrite HTTP_REFERER to none and access denied.<br />
by this method, access is denied and spam address is not added in your logfile</p>
<p>in some case (3) or (4) is dangerous. because some websites need cookie to display their website, some site is protected by authentication. (e.g. BBS in the groupware) or some HTTP_REFERER maybe intranet address.<br />
(e.g. http://127.0.0.1/bookmark.html, http://intranet/bookmarks.html)</p>
<p>this module doesn't support cookie and can't connect to authorized website, because module doesn't know that username or password.</p>
<p>first you should use Test or Replace mode and choose another methods when you can analyze spam URI if you need.</p>
<h2> INSTALL
</h2>
<p>If your apache supports shared modules, install is very easy.</p>
<pre class="command">
# /usr/local/apache2/bin/apxs -a -i -c mod_antispam.c
</pre>
<h2> CONFIGURATION
</h2>
<h3> required section
</h3>
<ul><li>AntispamEnable (on/off, default=off)
</li></ul>
<p>Enable or not this module</p>
<ul><li>AntispamWhiteList (filename, default=none)
</li></ul>
<p>Whitelist file path. you can edit by hands with regular expressions. this file is not created automatically. you have to create this file and set proper permissions (writable by http user) before running Apache.</p>
<ul><li>AntispamBlackList (filename, default=none)
</li></ul>
<p>Blacklist file path. you can edit by hands with regular expressions. this file is not created automatically. you have to create this file and set proper permissions (writable by http user) before running Apache.</p>
<ul><li>AntispamAutoWhiteList (filename, default=none)
</li></ul>
<p>Whitelist file that will be automatically created. you shouldn't edit by hands. this file is not created automatically. you have to create this file and set proper permissions (writable by http user) before running Apache.</p>
<ul><li>AntispamAutoBlackList (filename, default=none)
</li></ul>
<p>Blacklist file that will be automatically created. you shouldn't edit by hands. this file is not created automatically. you have to create this file and set proper permissions (writable by http user) before running Apache.</p>
<h3>optional section
</h3>
<ul><li>AntispamAction (Test/Replace/Reject/ReplaceReject, default=Test)
</li></ul>
<p>you can define actions after getting spam.<br />
Test: update white/black lists. all accesses allowed.<br />
Replace: update white/black lists. and replace spam referer to none. all accesses allowed.<br />
Reject: update white/black lists. deny referer spam by HTTP_FORBIDDEN. spam URI will be stored in the log files.<br />
ReplaceReject: update white/black lists. replace spam referer to none. deny referer spam by HTTP_FORBIDDEN.</p>
<ul><li>AntispamTarget (FQDN/FULL, default=FULL)
</li></ul>
<p>mod_antispam updates white/black lists automatically by adding spam/ham URI into files. if this setting is FQDN, only FQDN part of the HTTP_REFERER is saved in the datafile. and in case FULL, full URI is saved.</p>
<ul><li>AntispamSizeLimit (integer: bytes, default=100000)
</li></ul>
<p>when this module gets HTTP_REFERER from clients, it will connect to that target and download their contents. you can define download size limit.</p>
<ul><li>AntispamTimeout (integer: seconds, default=5)
</li></ul>
<p>timeout of the connection.</p>
<ul><li>AntispamRetry (integer, default=3)
</li></ul>
<p>retry count for connection error. in case some errors after retry count, update black list.</p>
<h2> STEP BY STEP
</h2>
<p>when you install this module at first, these configurations are recommended. as I explained, you have to create black/white list files and set proper permissions to update them by http owner.</p>
<pre class="list">
AntispamEnable on
AntispamAction Test
AntispamWhiteList logs/antispam.white
AntispamBlackList logs/antispam.black
AntispamAutoWhiteList logs/antispam.white.auto
AntispamAutoBlackList logs/antispam.black.auto
</pre>
<p>some days or months later, you can find many spam accesses in the antispam.black.auto. then you should copy spam URI and paste to antispam.black by hands. and also if you find nonspam URI in the autnsiapm.black.auto, you should copy them and paste to antispam.white. of course you can define them by regular expressions.</p>
<p>I'll give you an example.</p>
<p>after some weeks, you can get some address like this.<br />
(notice: no-spam URI is recorded in the blacklist in this case)</p>
<ul><li> logs/antispam.black.auto
</li></ul>
<pre class="list">
http://spam1.example.com/
http://spam2.example.net/
</pre>
<ul><li> logs/antispam.white.auto
</li></ul>
<pre class="list">
http://bluecoara.net/
http://foo.bar.example.org/foo/bar.html
</pre>
<ul><li> logs/antispam.black
</li></ul>
<pre class="list">
(empty unless you edit by hands)
</pre>
<ul><li> logs/antispam.white
</li></ul>
<pre class="list">
(empty unless you edit by hands)
</pre>
<p>you should edit these files by hands. this is not required but recommended to manage/understand spam.</p>
<ul><li> logs/antispam.black.auto
</li></ul>
<pre class="list">
(empty)
</pre>
<ul><li> logs/antispam.white.auto
</li></ul>
<pre class="list">
(empty)
</pre>
<ul><li> logs/antispam.black
</li></ul>
<pre class="list">
http://spam1.example.com/
http://spam2.example.net/
</pre>
<ul><li> logs/antispam.white
</li></ul>
<pre class="list">
http://bluecoara.net/
http://foo.bar.example.org/foo/bar.html
http://www.example.net/this/is/not/spam.html
</pre>
<p>after editing, modify httpd.conf and change AntispamAction to Replace, Reject, or ReplaceReject.</p>
<h2> USEFUL SAMPLE
</h2>
<ul><li> allow all *.jp referer
</li></ul>
<pre class="list">
 ^http://[^/]+\.jp
</pre>
<ul><li> allow google referer
</li></ul>
<pre class="list">
 ^http://([^/]+\.|)google\.com
</pre>
<h2> LOOP ?
</h2>
<p>If you are using this module on "http://www.example.com/" and someone connect your website with modifying HTTP_REFERER to "http://www.example.com/", mod_antispam will connect to your own website.</p>
<p>but once this module connects to some website, white/black lists will be updated and if their address is already in your lists, module never connect to their website if you have proper settings. therefore you don't need to worry about connection loop.</p>
<h2> USER-AGENT
</h2>
<p>when mod_antispam connect to the target, it will send "User-Agent: mod_antispam" by default. you can modify this source and change User-Agent.</p>
<h2> PERFORMANCE
</h2>
<p>when some clients connect to Apache, this module will connect to that HTTP_REFERER, it takes some seconds at the first time.<br />
and once mod_antispam connect to the target, this will update white/black lists. and after that, module will not refer to white/black lists on the server. but it takes some seconds to read white/black lists and compare spam with them. therefore, if white/black lists are too large, apache performance will be slow.</p>
<p>I'll give you the performance data.</p>
<ul><li> apache default
</li></ul>
<pre class="list">
    Concurrency Level:      10
    Time taken for tests:   0.267426 seconds
    Complete requests:      1000
    Failed requests:        0
    Write errors:           0
    Total transferred:      271000 bytes
    HTML transferred:       27000 bytes
    Requests per second:    3739.35 [#/sec] (mean)
    Time per request:       2.674 [ms] (mean)
    Time per request:       0.267 [ms] (mean, across all concurrent requests)
    Transfer rate:          987.19 [Kbytes/sec] received
</pre>
<ul><li> mod_antispam enabled (each 1000 lines)
</li></ul>
<p>and I made each 1000 lines white/black/autowhite/autoblack lists, and added target URI in the bottom of the black list.</p>
<pre class="list">
    Concurrency Level:      10
    Time taken for tests:   41.905376 seconds
    Complete requests:      1000
    Failed requests:        0
    Write errors:           0
    Total transferred:      271000 bytes
    HTML transferred:       27000 bytes
    Requests per second:    23.86 [#/sec] (mean)
    Time per request:       419.054 [ms] (mean)
    Time per request:       41.905 [ms] (mean, across all concurrent requests)
    Transfer rate:          6.30 [Kbytes/sec] received
</pre>
<ul><li> mod_antispam enabled (each 100 lines)
</li></ul>
<p>and I made each 100 lines white/black/autowhite/autoblack lists, and added target URI in the bottom of the black list.</p>
<pre class="list">
    Concurrency Level:      10
    Time taken for tests:   4.387564 seconds
    Complete requests:      1000
    Failed requests:        0
    Write errors:           0
    Total transferred:      272084 bytes
    HTML transferred:       27108 bytes
    Requests per second:    227.92 [#/sec] (mean)
    Time per request:       43.876 [ms] (mean)
    Time per request:       4.388 [ms] (mean, across all concurrent requests)
    Transfer rate:          60.40 [Kbytes/sec] received
</pre>
<p>you should write rules by regular expressions not make large white/black lists. and I'll support BerkeleyDB to get good performance in future.</p>
<h2> DOWNLOAD
</h2>
<p><a href="http://bluecoara.net/download/mod_antispam/">Download</a></p>
<h2> BLACKLISTS
</h2>
<p>Here is my current <a href="/scripts/blacklist.php">blacklist</a>.</p>
<h2> TODO
</h2>
<ul><li> SSL support
</li></ul>
<p>apache API don't spport SSL connection ?</p>
<ul><li> BerkeleyDB support
</li></ul>
<p>faster than text, but can't use regular expressions.</p>
<ul><li> DNSBL support
</li></ul>
<p>to share spam databases. it will supported in next version.</p>
]]></description>
 <category>Apache</category>
<comments>http://bluecoara.net/index.php?itemid=44</comments>
 <pubDate>Mon, 17 Oct 2005 22:17:25 +0900</pubDate>
</item><item>
 <title><![CDATA[ファイル上にファイルシステム]]></title>
 <link>http://bluecoara.net/index.php?itemid=42</link>
<description><![CDATA[<p>SolarisやLinux中に存在するファイルの中にファイルシステムを作る遊びです．<br />
時と場合によっては非常に役立つことも．</p>
<h2> Solarisの場合
</h2>
<p>まず，Solarisの場合は次のように空のファイルを作成しておきます．</p>
<pre class="command">
# dd if=/dev/zero of=$PWD/10MB bs=1024k count=10
</pre>
<p>これで10MBの空ファイルができました．次にlofiadmコマンドを使って，このファイルをファイルシステムとして使うための準備をし，newfsでファイルシステムを作成します．</p>
<pre class="command">
# lofiadm -a /home/nomo/10MB
# newfs /dev/lofi/1
</pre>
<p>最後に適当なマウントポイントを作ってマウントします．</p>
<pre class="command">
# mkdir /tmp/mnt
# mount /dev/lofi/1 /tmp/mnt
</pre>
<p>最後に/tmp/mntの中でファイル書き込みの実験をしてみます．</p>
<pre class="command">
# cd /tmp/mnt
# mkfile 100m 100m
100m: initialized 8437760 of 104857600 bytes: No space left on device
# du -hs
 8.1M   .
</pre>
<h2> Linuxの場合
</h2>
<p>Linuxの場合は，lofiadmコマンドの代わりに直接ファイルシステムを作成することができます．</p>
<pre class="command">
# dd if=/dev/zero of=$PWD/10MB bs=1024k count=10
# mkfs.ext3 10MB
mke2fs 1.38 (30-Jun-2005)
10MB is not a block special device.
Proceed anyway? (y,n) y
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
2560 inodes, 10240 blocks
512 blocks (5.00%) reserved for the super user
First data block=1
2 block groups
8192 blocks per group, 8192 fragments per group
1280 inodes per group
Superblock backups stored on blocks:
        8193

Writing inode tables: done
Creating journal (1024 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 37 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
# mkdir /tmp/mnt
# mount -o loop 10MB /tmp/mnt
# cd /tmp/mnt
# dd if=/dev/zero of=$PWD/10MB bs=1024k count=100
dd: writing `/tmp/mnt/10MB': デバイスに空き領域がありません
読み込んだブロック数は 9+0
書き込んだブロック数は 8+0
# du -hs
8.7M    .
</pre>
<h2> 何の役に立つのか
</h2>
<p>インターネットサーバで特定のサービスをchrootさせて特定の領域で動作させるのはセキュリティ上一般的ですが，今回の手法を用いることで，侵入者をファイルシステムではなくファイルの中に閉じこめることができます．<br />
また，OSのシステムQuotaを使用することなく領域を確保できるのもメリットの1つです．</p>
<h2> といっても
</h2>
<p>ファイルをファイルシステムとして使用するということで，読み書きのパフォーマンスもかなり低下します．これが難点．</p>
]]></description>
 <category>Solaris</category>
<comments>http://bluecoara.net/index.php?itemid=42</comments>
 <pubDate>Sat, 8 Oct 2005 20:36:16 +0900</pubDate>
</item><item>
 <title><![CDATA[Postfix]]></title>
 <link>http://bluecoara.net/index.php?itemid=41</link>
<description><![CDATA[<p>どうもキュー管理にバグがあるような気がする．<br />
もうちょっと調べてみないと分からないけど，deliver_request_get()とかこの辺の挙動がちょっとおかしい．</p>
]]></description>
 <category>BLOG</category>
<comments>http://bluecoara.net/index.php?itemid=41</comments>
 <pubDate>Wed, 7 Sep 2005 13:40:06 +0900</pubDate>
</item><item>
 <title><![CDATA[日本語は正しく]]></title>
 <link>http://bluecoara.net/index.php?itemid=40</link>
<description><![CDATA[<p><img src="/images/2005.08.20.01.jpg"></p>
<p>最後の一言は余計だがな・・・．</p>
]]></description>
 <category>BLOG</category>
<comments>http://bluecoara.net/index.php?itemid=40</comments>
 <pubDate>Sat, 20 Aug 2005 18:49:09 +0900</pubDate>
</item><item>
 <title><![CDATA[遊びに行ってきたー]]></title>
 <link>http://bluecoara.net/index.php?itemid=39</link>
<description><![CDATA[<p>某不便利な人のうちに遊びに行ってきたのですが，アノ噂は本当だったのか．(知ってたけどネ)</p>
<p><img src="/images/2005.08.15.01.jpg"><br />
証拠写真</p>
<p>ちなみにDVDに閉じこめられたオレ<br />
<img src="/images/2005.08.15.02.jpg"><br />
証拠写真</p>
]]></description>
 <category>BLOG</category>
<comments>http://bluecoara.net/index.php?itemid=39</comments>
 <pubDate>Mon, 15 Aug 2005 00:59:33 +0900</pubDate>
</item><item>
 <title><![CDATA[戦利品まとめ]]></title>
 <link>http://bluecoara.net/index.php?itemid=38</link>
<description><![CDATA[<p>んー，連休で結構買ってしまったよ．<br />
節約生活しないと．</p>
<p>買ったものまとめ</p>
<table>
<tr>
  <td><img src="/images/2005.07.18.01.jpg"><br>Panasonic Lumix + SDカード</td>
  <td><img src="/images/2005.07.18.02.jpg"><br>PRADA</td>
  <td><img src="/images/2005.07.18.03.jpg"><br>PRADA</td>
</tr>
<tr>
  <td><img src="/images/2005.07.18.04.jpg"><br>Ray-Ban</td>
  <td><img src="/images/2005.07.18.05.jpg"><br>ARMANI COLLEZIONI</td>
  <td><img src="/images/2005.07.18.06.jpg"><br>ARMANI COLLEZIONI</td>
</tr>
<tr>
  <td><img src="/images/2005.07.18.07.jpg"><br>吉田カバン/PORTER</td>
  <td><img src="/images/2005.07.18.08.jpg"><br>FRANK DANIE</td>
  <td><img src="/images/2005.07.18.09.jpg"><br>GRENSON</td>
</tr>
<tr>
  <td><img src="/images/2005.07.18.10.jpg"><br>National ionity</td>
  <td><img src="/images/noimage.jpg"><br>ARMANI COLLEZIONIスーツ</td>
  <td><br></td>
</tr>
</table>
<p>30万円超えてしまったけど，最近高い買い物したなかったので良しとする．<br />
ちなむと帰りに初めて漫画喫茶(新宿の大塚家具の近くにあるやつ)に入ってみた．個室の広さがイマイチで，結構疲れたなぁ．</p>
]]></description>
 <category>BLOG</category>
<comments>http://bluecoara.net/index.php?itemid=38</comments>
 <pubDate>Mon, 18 Jul 2005 18:37:26 +0900</pubDate>
</item>
  </channel>
</rss>