Personal tools
You are here: Home コンピュータ Linux Tips Mail Server Tips Clamavでウィルスメールチェック
Document Actions

Clamavでウィルスメールチェック

by すぎお last modified 2007-10-09 06:41

Postfix Clamavでウィルス添付メールをチェックする。

ウィルス添付のメールを配信している場合には、受信メールサーバーのブラックリストに登録されて、その後のメールの受信が拒否される場合がある。

Postfix + Amavis-new + Clamavでメールのウィルスフィルタリングを行う。ウィルスチェックは、出入りの双方に対して行う。

必要パッケージをインストールする。

# aptitude install postfix clamav amavisd-new clamav-daemon  clamav-freshclam

/etc/postfix/main.cfに以下を付け足す。

content_filter = smtp-amavis:[127.0.0.1]:10024

/etc/postfix/master.cfに以下を付け加える。

smtp-amavis unix -      -       n       -       2  smtp
    -o smtp_data_done_timeout=1200
    -o disable_dns_lookups=yes

Postfixを再起動する。

# /etc/init.d/postfix restart

クライアント側のウィルス対策ソフトウェアを終了して、擬似ウィルスファイルを添付して送信する。

他人に迷惑をかけないのと、自分のサーバーの名誉のために、送信元、送信先は共にローカルマシン上のアカウントを使用する。

※各自の責任で行ってください。各自の使用方法とWindows(他のOSでも)でウィルス対策ソフトウェアを終了するリスクを考慮してください。

BANNED message from you (multipart/mixed | application/x-zip-compressed,.zip,eicar_com.zip | .asc,eicar.com)

なるSubjectのメールが返信されてくると、フィルタリングは成功している。

以下、メールサーバーから返信されてきたメールソースです。

From - Mon Oct 01 00:40:01 2007
X-Account-Key: account2
X-UIDL: UID447-1188045308
X-Mozilla-Status: 0001
X-Mozilla-Status2: 10000000
X-Mozilla-Keys:                                                                                
Return-Path: <>
X-Original-To: メールアドレス
Delivered-To: メールアドレス
Received: from localhost (localhost [127.0.0.1])
    by mail.sugio-garden.com (Postfix) with ESMTP id EE031C48156
    for <メールアドレス>; Mon,  1 Oct 2007 00:39:52 +0900 (JST)
Content-Type: multipart/report; report-type=delivery-status;
 boundary="----------=_1191166792-8552-1"
Content-Transfer-Encoding: 7bit
MIME-Version: 1.0
Subject: BANNED message from you (multipart/mixed |
 application/x-zip-compressed,.zip,eicar_com.zip | .asc,eicar.com)
In-Reply-To: <46FFC343.4080306@ドメイン>
Message-ID: <VSSv2WdLYM1Q1t@メールサーバー>
From: "Content-filter at メールサーバー" <postmaster@メールサーバー>
To: <メールアドレス>
Date: Mon,  1 Oct 2007 00:39:52 +0900 (JST)

This is a multi-part message in MIME format...

------------=_1191166792-8552-1
Content-Type: text/plain; charset="iso-8859-1"
Content-Disposition: inline
Content-Transfer-Encoding: 7bit

BANNED CONTENTS ALERT

Our content checker found
    banned name: multipart/mixed |
      application/x-zip-compressed,.zip,eicar_com.zip | .asc,eicar.com

in email presumably from you <メールアドレス>
to the following recipient:
-> メールアドレス

Our internal reference code for your message is 08552-05/Sv2WdLYM1Q1t


Return-Path: <メールアドレス>
Message-ID: <46FFC343.4080306@ドメイン>
Subject: =?ISO-2022-JP?B?KBskQjdvTD4kSiQ3GyhCKQ==?=

Delivery of the email was stopped!

The message has been blocked because it contains a component
(as a MIME part or nested within) with declared name
or MIME type or contents type violating our access policy.

To transfer contents that may be considered risky or unwanted
by site policies, or simply too large for mailing, please consider
publishing your content on the web, and only sending an URL of the
document to the recipient.

Depending on the recipient and sender site policies, with a little
effort it might still be possible to send any contents (including
viruses) using one of the following methods:

- encrypted using pgp, gpg or other encryption methods;

- wrapped in a password-protected or scrambled container or archive
  (e.g.: zip -e, arj -g, arc g, rar -p, or other methods)

Note that if the contents is not intended to be secret, the
encryption key or password may be included in the same message
for recipient's convenience.

We are sorry for inconvenience if the contents was not malicious.

The purpose of these restrictions is to cut the most common propagation
methods used by viruses and other malware. These often exploit automatic
mechanisms and security holes in more popular mail readers (Microsoft
mail readers and browsers are a common target). By requiring an explicit
and decisive action from the recipient to decode mail, the danger of
automatic malware propagation is largely reduced.


------------=_1191166792-8552-1
Content-Type: message/delivery-status; name="dsn_status"
Content-Disposition: inline; filename="dsn_status"
Content-Transfer-Encoding: 7bit
Content-Description: Delivery error report

Reporting-MTA: dns; メールサーバー
Received-From-MTA: smtp; mail.sugio-garden.com ([127.0.0.1])
Arrival-Date: Mon,  1 Oct 2007 00:39:52 +0900 (JST)

Original-Recipient: rfc822;メールアドレス
Final-Recipient: rfc822;メールアドレス
Action: failed
Status: 5.7.1
Diagnostic-Code: smtp; 554-5.7.1 Rejected, id=08552-05 - BANNED:
 554-5.7.1 multipart/mixed | application/x-zip-compressed,.zip,eicar_com.zip |
 554 5.7.1 .asc,eicar.com
Last-Attempt-Date: Mon,  1 Oct 2007 00:39:52 +0900 (JST)

------------=_1191166792-8552-1
Content-Type: text/rfc822-headers; name="header"
Content-Disposition: inline; filename="header"
Content-Transfer-Encoding: 7bit
Content-Description: Message headers

Return-Path: <メールアドレス>
Received: by mail.sugio-garden.com (Postfix, from userid 119)
    id A1044C48155; Mon,  1 Oct 2007 00:39:52 +0900 (JST)
X-Spam-Checker-Version: SpamAssassin 3.1.7-deb (2006-10-05) on
    メールサーバー
X-Spam-Level:
X-Spam-Status: No, score=-1.4 required=9.0 tests=ALL_TRUSTED autolearn=failed
    version=3.1.7-deb
Received: from [192.168.0.40] (unknown [192.168.0.40])
    by mail.sugio-garden.com (Postfix) with ESMTP id 67CD4C480AF
    for <メールアドレス>; Mon,  1 Oct 2007 00:39:45 +0900 (JST)
Message-ID: <46FFC343.4080306@ドメイン>
Date: Mon, 01 Oct 2007 00:39:47 +0900
From: =?ISO-2022-JP?B?GyRCP3lIeCEhT0JCJxsoQg==?=
 <メールアドレス>
Reply-To:  メールアドレス
Organization: Sugio Garden
User-Agent: Thunderbird 2.0.0.6 (Windows/20070728)
MIME-Version: 1.0
To:  メールアドレス
Subject: =?ISO-2022-JP?B?KBskQjdvTD4kSiQ3GyhCKQ==?=
Content-Type: multipart/mixed;
 boundary="------------010905050502020706010800"

送受信が完了したら、ウィルス対策ソフトウェアを再起動する。

« January 2009 »
Su Mo Tu We Th Fr Sa
123
45678910
11121314151617
18192021222324
25262728293031
 

Powered by Plone CMS, the Open Source Content Management System

This site conforms to the following standards: