banner
 .::*nix::. Cài đặt nhanh hệ thống phát hiện xâm nhập Go to original post Author: moonlight123 - Translator:  - Entry Date: 24/02/2009 15:10:52
Cài đặt nhanh hệ thống phát hiện xâm nhập dùng Snort+ACID :

Hướng dẫn cài đặt nhanh hệ thống phát hiện xâm nhập (IDS) trên Linux/Unix sử dụng Snort với cơ sở dữ liệu mysql để lưu log, alert và ACID làm giao diện theo dõi.

* Yêu cầu hệ thống:
- mysql-3.23+ http://www.mysql.org/
- apache-1.3+ http://httpd.apache.org/
- php-4.04+ http://www.php.net/
- snort-1.8.3+ http://www.snort.org/
- acid-0.9.6+ http://www.andrew.cmu.edu/~rdanyliw/snort/snortacid.html
- adodb-1.2+ http://php.weblogs.com/adodb
- phplot-4.4.6+ http://phplot.sourceforge.net/ (tuỳ chọn để xem các thống kê dạng biểu đồ đưọc vẽ bằng thư viện gd, yêu cầu php phải được biên dịch hỗ trợ gd)

* Giả thiết:
- Hệ thống đã được cài đặt mysql, apache, php và hoạt động tốt (ví dụ RH 7.2).
- Địa chỉ mạng cục bộ cần theo dõi: 192.168.1.0/24

* Cài đặt snort và cấu hình snort.

Download mã nguồn:
http://www.snort.org/dl/snort-1.8.6.tar.gz

# tar zxvf snort-1.8.6.tar.gz
# cd snort-1.8.6
# ./configure --with-mysql=/usr
# make
# make install
# mkdir /etc/snort
# cp *.rules classification.config snort.conf /etc/snort/

Tạo bảng dữ liệu để lưu trữ snort log, alert:

# mysql -u root -p
mysql> create database snort;
mysql> grant INSERT,SELECT on snort.* to snort@localhost identified by '';
mysql> exit
# mysql snort -u root -p < ./contrib/create_mysqlSửa các thông số sau trong file /etc/snort/snort.conf

var HOME_NET 192.168.1.0/24
...
output database: log, mysql, user=snort password= dbname=snort host=localhost
output database: alert, mysql, user=snort password= dbname=snort host=localhostKhởi động snort:
 

# /usr/local/bin/snort -D -d -v -i eth0 -c /etc/snort/snort.conf

* Cài đặt và cấu hình acid

Download mã nguồn:
http://www.andrew.cmu.edu/~rdanyliw/snort/...0.9.6b21.tar.gz
http://phplens.com/lens/dl/adodb190.tgz
http://prdownloads.sourceforge.net/phplot/...ot-4.4.6.tar.gz

Giải nén và đặt adodb, acid vào thư mục con của httpd DocumentRoot:

# cp acid-0.9.6b21.tar.gz /var/www/html
# tar zxvf acid-0.9.6b21.tar.gz
# cp adodb190.tgz /var/www/html
# tar zxvf adodb190.tgz
# cp phplot-4.4.6.tar.gz /var/www/html
# tar zxvf phplot-4.4.6.tar.gz

Kiểm tra xem php có được cấu hình đúng với gd không:
http://locolhost/phplot-4.4.6/examples/test_setup.php

Nếu không xem được các biểu đồ ví dụ, bạn phải xem lại php có được biên dịch với thư viện gd và đã bật hỗ trợ gd trong /etc/php.ini chưa (extension=gd.so).

Tạo bảng dữ liệu để lưu trữ các alert dành riêng cho acid:
# mysql -u root -p
mysql> create database snort_archive;
mysql> grant INSERT,SELECT on snort.* to snort_archive@localhost identified by '';
mysql> exit
# mysql snort -u root -p < create_acid_tbls_mysql.sql

Cấu hình các thông số cần thiết cho acid trong file acid_conf.php

$DBlib_path = "../adodb";

$DBtype = "mysql";

/* Alert DB connection parameters */

$alert_dbname = "snort";
$alert_host = "localhost";
$alert_port = "";
$alert_user = "snort";
$alert_password = "";

/* Archive DB connection parameters */

$archive_dbname = "snort_archive";
$archive_host = "localhost";
$archive_port = "";
$archive_user = "snort";
$archive_password = "";

$ChartLib_path = "../phplot-4.4.6"; // tuỳ chọn, nếu php hỗ trợ gd

/* File format of charts ('png', 'jpeg', 'gif') */
$chart_file_format = "png";
Để an toàn, nên thiết lập yêu cầu xác thực cho các truy xuất đến thư mục acid trên web server.

File /var/www/html/acid/.htaccess:

AuthName ACID Secure Area
AuthType Basic
AuthUserFile /var/www/html/acid/.htpasswd
Allow from all

require valid-user
 


File /var/www/html/acid/.htpasswd:
acid:

Thiết lập browser của bạn cho phép tất cả cookie từ host chạy acid. Hoàn tất quá trình cài đặt và bắt đầu sử dụng acid để theo dõi các hoạt động trên mạng được snort phát hiện:

http://localhost/acid/

* Tham khảo tại :

http://www.snort.org/
http://www.andrew.cmu.edu/~rdanyliw/snort/snortacid.htm
[digg] [delicious] [google] [yahoo] [technorati] [reddit] [stumbleupon]
Go to top Go to original post  

Powered by JForum - Extended by HVAOnline
 hvaonline.net  |  hvaforum.net  |  hvazone.net  |  hvanews.net  |  vnhacker.org
1999 - 2013 © v2012|0504|218|