Hướng dẫn chi tiết cài đặt và cấu hình snort (ai cũng làm theo được) - Pdf 16

Guide install + test snort trên ubuntu
1. Cấu hình cài đặt thử nghiệm:
• Snort 2.9.6.0
• Snort rule 2960
• Hệ điều hành Ubuntu 12.04
2. Các gói cần thiết phải có trước khi cài đặt snort.
Đầu tiên kiểm tra xem hệ thống ping được ra ngoài mạng không
sudo ping 8.8.8.8
Sau đó đặt ip tĩnh cho hệ thống:
sudo vim /etc/network/interfaces
Giải sử đặt địa chỉ tĩnh như sau:
• auto eth0
• iface eth0 inet static
• address 192.168.1.101
• netmask 255.255.255.0
• gateway 192.168.1.1
Sudo /etc/init.d/networking restart
Tiếp theo phải update source.list đảm bảo link tải các gói còn hoạt động:
sudo aptitude update
Tiến hành cài các gói với câu lệnh :
sudo aptitude install <tên gói>
• Apache2
• php5
• php5-gd
• php5-mysql
• php-pear
• mysql-client-5.5
• mysql-server-5.5 (chú ý khi cài đặt gói này phải đặt mật khẩu cho mysql)
• libpcap0.8-dev
• libmysqlclient-dev (tạo thư viện cho banyard 2)
• g++

groupadd snort
useradd -g snort snort
chown snort:snort /var/log/snort
- Download rules (download tại trang chủ: http://www.snort.org/snort-rules/)
tar xfzv snortrules-snapshot-2960.tar.gz -C /etc/snort/
mkdir /etc/snort/lib/snort_dynamicrules
cp /etc/snort/so_rules/precompiled/Ubuntu-12.04/i386/2.9.6.0/* /etc/snort/lib/snort_dynamicrules
touch /etc/snort/rules/white_list.rules
touch /etc/snort/rules/black_list.rules
ldconfig
- Cấu hình snort : chỉnh sửa file snort.conf
Edit snort.conf
vim /etc/snort/etc/snort.conf
#Edit
RULE_PATH > /etc/snort/rules
SO_RULE PATH > /etc/snort/rules
PREPROC_RULE_PATH > /etc/snort/rules
WHITELIST, BLACKLIST > /etc/snort/rules
# thay đổi đường dẫn
dynamicpreprocessor directory /etc/snort/lib/snort_dynamicpreprocessor/
dynamicengine /etc/snort/lib/snort_dynamicengine/libsf_engine.so
dynamicdetection directory /etc/snort/lib/snort_dynamicrules
# thêm dòng (nếu sử dụng banyard2 để import log vào cơ sở dữ liệu)
output unified2: filename snort.u2, limit 128
#Uncomment các luật trong dynamic library rules
- Kiểm tra snort đã hoạt động hay chưa:
/etc/snort/bin/snort -u snort -g snort -c /etc/snort/etc/snort.conf
class="bi x2 y52 w2 h4"
4. Cài đặt barnyard2 , mysql, base
- Cài đặt barnyard2

vim /etc/snort/etc/barnyard2.conf
#Edit
/etc/snort/etc/barnyard2.conf
config reference_file: /etc/snort/etc/reference.config
config classification_file: /etc/snort/etc/classification.config
config gen_file: /etc/snort/etc/gen-msg.map
config sid_file: /etc/snort/etc/sid-msg.map
config hostname: localhost
config interface: eth0
output database: log, mysql, user=snort password=yourpassword dbname=your database host=localhost
- Khởi động banyard2:
#khởi động snort trước :
/etc/snort/bin/snort -u snort -g snort -c /etc/snort/etc/snort.conf -i eth0
#Mở 1 tab khác và khởi động banyard
/usr/local/bin/barnyard2 -c /etc/snort/etc/barnyard2.conf -d /var/log/snort/ -f snort.u2 -w
/var/log/snort/barnyard2.waldo
- Cấu hình để snort chạy cùng hệ thống
sudo vi /etc/rc.local
#Edit
ifconfig eth0 up
/etc/snort/bin/snort -u snort -g snort -c /etc/snort/etc/snort.conf -i eth0
/usr/local/bin/barnyard2 -c /etc/snort/etc/barnyard2.conf \
-G /etc/snort/etc/gen-msg.map \
-S /etc/snort/etc/sid-msg.map \
-d /var/log/snort \
-f snort.u2 \
-w /var/log/snort/barnyard2.waldo
5. Cài đặt giao diện web adodb , b.a.s.e
- B.A.S.E ( Basic Analysis and Security Engine ) cung cấp giao diện Web cho việc truy vấn và phân tích các cảnh
báo từ Snort. Download B.A.S.E 1.4.4 tại :

Gedit /var/www/base-1.4.4/base-conf.php .Paste và Save
- Test thử hoạt động của snort thêm 1 luật ping vào local.rules
vim /etc/snort/rules/local.rules
thêm vào cuối dòng
alert icmp any any -> any any (msg: "ping goi tin"; sid: 01042014;)
Khởi chạy lại barnyard2 thì sẽ được như sau khi dùng 1 máy khác ping đến snort


Nhờ tải bản gốc

Tài liệu, ebook tham khảo khác

Music ♫

Copyright: Tài liệu đại học © DMCA.com Protection Status