antivirus avast avg antivir clamav

いずれも個人で使うなら無料ってことで…
nepenthesの検体を検出するのに入れてみました


avast install

http://www.avast.com/jpn/download-avast-for-linux-edition.html
より
avast4workstation_1.0.8-2_i386.deb
落としてきて
dpkg -i avast4workstation_1.0.8-2_i386.deb
パターンファイルのアップデート
avast-update
使い方
avast --help


avg install

http://free.grisoft.com/doc/5390/jp/frt/0?prd=afl
より
avg75fld-r51-a1243.i386.deb
落としてきて
dpkg -i avg75fld-r51-a1243.i386.deb
パターンファイルのアップデート
avgupdate -o
使い方
avgscan -help

/opt/grisoft/に放り込まれる。/以下が少なくなったので消去


antivir install

http://www.free-av.com/en/download/download_servers.php
より
antivir-workstation-pers.tar.gz
をとってきます。解答してinstallを実行
tar zxf antivir-workstation-pers.tar.gz
cd antivir-workstation-pers-2.1.11-21
./install
Do you agree to the license terms? [n] y ←もちろん y
Would you like to install the internet update daemon? [n] ←いらないのでそのまま
How should AvGuard be installed? [n] ←いらないのでそのまま
Would you like to install the GUI (+ SMC support)? [y] n ←いらないのでそのまま
Would you like to configure the AntiVir updater now? [y]
Would you like email notification about updates? [n]
Would you like the updater to log to a custom file? [y]
? [/var/log/avupdater.log]
Does this machine use an HTTP proxy server? [n]
Press to continue.



Here are some commands that you should remember...

configure updater: /usr/lib/AntiVir/configantivir

Press to continue.


Installation of the following features complete:
AntiVir command line scanner
AntiVir Guard (previously installed)


Note: It is highly recommended that you perform an update now to
ensure up-to-date protection. This can be done by running:

antivir --update

Be sure to read the README file for additional information.
Thank you for your interest in Avira AntiVir Workstation (UNIX).

これでinstallは終了

パターンファイルのアップデート
antivir --update
使い方
antivir --help


clamav install

公式のclamavは古い(0.90.1)ので、vloatile(0.92.1)を使う
deb http://ftp2.jp.debian.org/debian-volatile sarge/volatile main
を/etc/apt/source.listに追加する

apt-get update
apt-get install clamav clamav-base clamav-freshclam libclamav3
パターンファイルアップデート
freshclam
使い方
clamscan --help

他に bitdefender とか f-port とかあります
antivir入ったら入れる気が…

参考:
http://www12.atwiki.jp/linux2ch/pages/78.html

Debian EtchにNepenthesしこむ

ハニーポットで検体収集したかったのでnepenthes仕込んでみた
http://nepenthes.mwcollect.org/


Debian etchにはパッケージがあるので

apt-get update
apt-get install nepenthes
で入る。バージョンは0.1.7-3。最新は0.2.2
設定ファイルとかは/etc/nepenthes/
ログは/var/log/nepenthes.log /var/log/nepenthes/

hexdumpsに溜まったファイルをチェック

/usr/sbin/nepenthes -f rmknown,rmnonop,dononp /var/lib/nepenthes/hexdumps

/var/lib/nepenthes/binaries/
に溜まったファイルをhttp://www.virustotal.com/に投げるプログラム


MailSend.pmはここから
http://www.mukairiku.net/PerlModule/MailSend.pm.html

#!/usr/bin/perl
use strict;
use MailSend;


my $dir = "/var/lib/nepenthes/binaries/";
my @file;
my $file;


opendir(DIR, $dir) or die;
@file = sort grep { -f "$dir/$_"} readdir(DIR);
closedir(DIR);


my $msg = < '',
"From" => '', #このアドレスに結果が届きます
"Subject" => 'SCAN',
"Msg" => "$msg",
"Server" => 'localhost',
"User" => '',
"Pass" => '',
"Attach" => "$dir/$file",
);
MailSend(\%data);
}

48時間たったものを送ってますが、この辺はCronを24時間ごとにまわすとかお好みで

せっかく捕獲した検体をviruschekしてみたいなら(avast,avg,antivir)
http://www12.atwiki.jp/linux2ch/pages/78.html
http://www.avast.com/jpn/download-avast-for-linux-edition.html
http://free.grisoft.com/doc/5390/jp/frt/0?prd=afl
http://www.free-av.com/en/download/download_servers.php
とかを利用するとよいかな

Monitを入れてみた

DAGよりredhat9用取得
# wget http://dag.wieers.com/rpm/packages/monit/monit-4.9-2.rh9.rf.i386.rpm
# rpm -Uvh monit-4.9-2.rh9.rf.i386.rpm

# vi /etc/monit.conf

set daemon 120
set logfile syslog facility log_daemon
set mailserver localhost
set alert server@example.jp


set httpd port 2812 and
use address localhost # only accept connection from localhost
allow localhost # allow localhost to connect to the server and
allow admin:monit # require user 'admin' with password 'monit'


check process nagios with pidfile /var/run/nagios.pid
group nagios
start program = "/etc/init.d/nagios start"
stop program = "/etc/init.d/nagios stop"
if 5 restarts within 5 cycles then timeout


check process nrpe with pidfile /var/run/nrpe.pid
group nagios
start program = "/etc/init.d/nrpe start"
stop program = "/etc/init.d/nrpe stop"
# if failed host localhost port 5666 then restart
if 5 restarts within 5 cycles then timeout

#include /etc/monit.d/*

nagiosとnrpeが死んでいたら起動するように設定
2812のWEBサーバーは自動で必ず起動するようなのでlocalhostしかアクセスできないように

# /etc/init.d/monit start


しばらくしてnagiosとめる
# /etc/init.d/nagios stop
ログでもながめておく
# tail -f /var/log/messages

/var/run/nagios.pidが無いので/etc/init.d/nagios startしてくれるのを確認
これでnagiosが止まることは無いな…

公式のexampleとかいろいろのってます
http://www.tildeslash.com/monit/doc/examples.php

参考
http://labs.unoh.net/2008/03/_monit.html
http://www.simplegimmick.com/2007/08/monitor-processes-using-monit-1-about/
http://d.hatena.ne.jp/sakamoto_yuki/20060512/p1

ドコモメール

会社のnagiosはnagiosml@example.comのようなアドレスで携帯をML登録して
リブート依頼かけたとかわかるようにしているのだが
qmailSPFとかいれてないからなのか、DoCoMo迷惑メール対策でDOMAIN解除
しているにもかかわらず携帯からMLに送ったメール(ezweb.ne.jp or docomo.ne.jp)
が届かなかったりする不便さ

ふと迷惑メール設定のドメイン設定をすべて解除して放置してみたら
携帯からML経由でメールが届いている


やっぱり迷惑メール設定なのかSPF


http://www.nttdocomo.co.jp/service/mail/imode_mail/sender_id/
暇見て理解しとかんと…

追記(08/04/07)
MLとかはこの設定で届くと
http://www.nttdocomo.co.jp/info/news_release/page/080121_01.html

Mailbox sizeでwarning出す

初期状態ではこんな感じなので

/usr/share/logwatch/default.conf/services/sendmail-largeboxes.conf
Title = "sendmail-largeboxes (large mail spool files)"
LogFile = NONE
$sendmail_largeboxes_size = 40MB

mailboxの容量をいじっているなら変更する
/var/spool/mail/username
のときだけ有効なのかなぁ

/home/username/Mailbox
とかどういじるのか調べる…sendmail-largeboxesだからmbox形式のみか…

Debian Etch Xen

Pentium4 Prescott 4Mhzの修理が終わりAOPENから帰ってきたのでDebian Etchを放り込んでXenで仮想サーバーを構築することに


必要なもの全てをaptで入れる
# apt-get install xen-linux-system-2.6.18-5-xen-686 libc6-xen xen-tools bridge-utils


grubも自動で変えてくれる
# cat /boot/grub/menu.lst


# uname -a
Linux debian 2.6.18-5-xen-686 #1 SMP Wed Oct 3 04:02:16 UTC 2007 i686 GNU/Linux


HVM完全仮想化パッケージ(CPUが対応しているならいれる)
# apt-get install xen-ioemu-3.0.3-1
less /etc/xen/xend-config.sxp


HVM(Hardware Virtual Machine)
VT(Virtualization Technology)
対応CPUは本家より
http://wiki.xensource.com/xenwiki/HVM_Compatible_Processors