●Qmail Scannerのテスト

 インストールが完了したら,実際に動作するかテストしてみよう。以下のコマンドを入力し,管理者宛にメールが届いていれば正常に動作している。

$ cd qmail-scanner-1.10
(qmail-scanner-1.10を展開したディレクトリへ移動)
$ su
Password:(パスワードを入力)
# ./contrib/test_installation.sh -doit
(-doit オプションで実際にメールが管理者宛に送られる)

setting QMAILQUEUE to /var/qmail/bin/qmail-scanner-queue.pl for this test...

Sending standard test message - no viruses...
done!

Sending eicar test virus - should be caught by perlscanner module...
done!

Sending eicar test virus with altered filename - should only be caught by commer
cial anti-virus modules (if you have any)...
Done!

Finished test. Now go and check Email for root@example.com


●スキャンを行うルールの設定

 Qmail Scannerでスキャンするファイルのルール設定ファイルは,「/var/spool/qmailscan/quarantine-attachments.txt」にある。初期設定では下記のように記述されている。

EICAR.COM 69 EICAR Test Virus
Happy99.exe 10000 Happy99 Trojan
zipped_files.exe 120495 W32/ExploreZip.worm.pak virus
ILOVEYOU Virus-Subject: Love Letter Virus/Trojan

 新たに加える際の記述方法は

ファイル名<TAB>サイズ(バイト)<TAB>ウイルスの種類等の説明

 となる。たとえばexeファイルとmp3ファイルを対象とするのであれば,

.exe 0 Executable binary
.mp3 0 MP3 files not allowed

 と記述する。これによりメールにexeファイルおよびMP3ファイルが添付されていると,それを受け付けないように設定できる。また,ファイルを編集した際には必ず「/var/qmail/bin/qmail-scanner-queue.pl -g」を実行し,変更を反映させておく必要がある。

 quarantine-attachments.txtの一例として,http://exe2bin.com/qmail-scanner/blacklist.txthttp://www.es.qmail.org/quarantine-attachments.txtなどを参照し,自分なりに手を加えながら利用するのもよいだろう。ここに上げたサイトの定義ファイルをそのまま利用したい場合は,

# cd /var/spool/qmailscan/
# cp quarantine-attachments.txt quarantine-attachments.txt.dist
# wget http://www.es.qmail.org/quarantine-attachments.txt
# /var/qmail/bin/qmail-scanner-queue.pl -g
perlscanner: generate new DB file
perlscannner: total of 152 entries.

のように,オリジナルを「quarantine-attachments.txt.dist」として保存してからコピーすればよい。

●外部よりウイルスメールを受信した場合

 では実際に,外部から自宅サーバに向けてウイルスを添付したメールを送信してみることにする。ウイルスが添付されたメールを受信すると,送信者と管理者に以下のようなメールが配信される。これでウイルスの添付されたメールからの感染を,未然に防ぐことができるわけだ。

Delivered-To: root@itmediahogehoge.org
Date: 25 Feb 2002 02:56:55 +0900
From: "System Anti-Virus Administrator" <root@itmedia.hogehoge.org>
To: virus@example.org
Cc: root@itmedia.hogehoge.org
Subject: Virus found in sent message "test"
X-Tnz-Problem-Type: 40
MIME-Version: 1.0

Attention: Virii <virus@example.org>. <<<<ウイルスメール送信者

A Virus was found in an Email message you sent.
This Email scanner intercepted it and stopped the entire message
reaching it's destination.

The Virus was reported to be:

EICAR-AV-Test

Please update your virus scanner or contact your I.T support
personnel as soon as possible as you have a virus on your system.

Your message was sent with the following envelope:

MAIL FROM: virus@example.org
RCPT TO: hoge@itmedia.hogehoge.org

... and with the following headers:

From: Virii <virus@example.org>
To: hoge@itmedia.hogehoge.org
Subject: Hello
Message-ID: <v05010000b89ec71c8b63@[192.168.1.2]>
Date: Mon, 25 Feb 2002 02:56:30 +0900

The original message is kept in:

itmedia.hogehoge.org:/var/spool/qmailscan/quarantine

where the System Anti-Virus Administrator can further diagnose it.

The Email scanner reported the following when it scanned that message:

---

---sweep results ---
>>> Virus 'EICAR-AV-Test' found in file /var/spool/qmailscan/10145734134044342/eicar.com

---


PREV 3/6 NEXT