|
||||||||
|
||||||||
|
Linux Applications Tập hợp các bài viếc hướng dẫn cài đặt các ứng dụng phổ biến trên Linux (CentOS) |
![]() ![]() |
![]() |
|
Công Cụ | Xếp Bài | ![]() |
![]() |
#1 |
Administrator
Gia nhập: Jul 2009
Trả Lời: 245
![]() |
Triển khai hệ thống snort trên CentOS
Giới thiệu Snort là một dạng IDS (Instruction Detection System). IDS là một hệ thống được cài đặt trên mạng làm nhiệm vụ giám sát những packet vào ra hệ thống mạng. Khi Snort phát hiện một cuộc tấn công thì nó có thể phản ứng bằng nhiều cách khác nhau tùy thuộc vào cấu hình mà người quản trị mạng thiết lập, chẳng hạn như nó có thể gởi thông điệp cảnh báo đến nhà quản trị hay loại bỏ gói tin khi phát hiện có sự bất thường trong các gói tin đó. Snort hoạt động dựa trên các luật – rule xây dựng sẵn và phải được cập nhật thường xuyên. Mỗi luật đại diện cho một cuộc tấn công. Khi có một packet đến hệ thống nó sẽ được áp vào tập luật, nếu có sự so trùng snort sẽ phản ứng. ví dụ về 1 rule: alert tcp !192.168.1.0/24 any -> 192.168.1.0/24 111 (content: "|00 01 86 a5|"; msg: "external mountd access" ![]() Phần đầu của luật mô tả cách hành động (rule's action) là alert, giao thức (tcp) và địa chỉ IP nguồn, đích cũng như thông tin về port. Phần này gọi là “rule header”. Phần còn lại của luật, được biết như “rule option”, chứa thông điệp báo động và thông tin sẽ được snort sử dụng để kiểm tra xem liệu luật đó có phù hợp (match) với gói tin không. Snort server: cài phần mềm snort ![]() 1. Cài đặt Snort - Lần lượt cài các gói phụ thuộc: - mysql - mysql-bench - mysql-server - mysql-devel - yum-utils - php-mysql - httpd - gcc - pcre-devel - php-gd - gd - distcache-devel - mod_ssl - glib2-devel - gcc-c++ - libpcap-devel - php - php-pear Trường hợp các hàm thư viện và các gói phần mềm cần thiết chưa được cài bạn có thể thực hiệc các bước sau cho nhanh: b1. tạo thư mục trong root: mkdir media/CentOS b2. mount dvd vào thư mục: mount dev/cdrom /media/CentOS b3. import key PGP: rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5 b4. cài đặt yum với 4 gói sau đây: yum --disablerepo=\* --enablerepo=c5-media groupinstall "Development Tools" yum --disablerepo=\* --enablerepo=c5-media groupinstall "Development Libraries" Sau đó kiểm tra nếu thiếu gói nào thì cài thêm gói đó 1.2. Cài đặt Snort chép snort vào /snort cd /soft Giải nén snort tar -zxvf snort-2.8.4.1.tar.gz cd snort-2.8.4.1 - Lần lượt thực hiện các sau để cài đặt snort #./configure --with-mysql --enable-dynamicplugin ![]() #Make ![]() #make install ![]() 1.3. Cấu hình snort - Tạo các thư mục hoạt động cho snort mkdir /etc/snort mkdir /etc/snort/rules mkdir /var/log/snort - Chép các file cấu hình cd etc/ cp * /etc/snort - Tạo nhóm & người dùng cho snort groupadd snort useradd -g snort snort -s /sbin/nologin - Set quyền sở hữu và cho phép Snort ghi log vào thư mục chứa log chown snort:snort /var/log/snort/ 2. Cài đặt tập rule cho SNORT - Tải rule mới nhất từ http://www.snort.org - Giải nén tar -xzvf snortrules-snapshot-2.8.tar.gz cd rules cp * /etc/snort/rules 3. Cấu hình snort File cấu hình /etc/snort/snort.conf - Sửa dòng 46 var HOME_NET 192.168.9.0/24 - Sửa dòng 49 var EXTERNAL_NET !$HOME_NET Sửa dòng: 110: var RULE_PATH /etc/snort/rules 688: output database: log, mysql, user=snort password=123456 dbname=snort host=localhost Save lại Thiết Lập Snort khởi động cùng hệ thống: Tạo một liên kết mềm (symbolic link) của file snort binary đến /usr/sbin/snort ln -s /usr/local/bin/snort /usr/sbin/snort Snort cung cấp các scrip để khởi động trong thư mục rpm/ ; (thư mục giải nén snort) cp /snort/snort-2.8.4.1/rpm/snortd /etc/init.d/ cp /snort/snort-2.8.4.1/rpm/snort.sysconfig /etc/sysconfig/snort Đặt quyền lại cho file snortd : chmod 755 /etc/init.d/snortd chkconfig snortd on service snortd start Để khởi động snort ở chế độ debug nếu bạn muốn kiểm tra lỗi: /snort/snort-2.8.4.1/src/snort -u snort -g snort -d -c /etc/snort/snort.conf Quản lý snort bằng webmin: (bước này có thể bỏ qua làm tiếp phần 4) - Cài webmin ![]() Log vào Webmin, chọn chức năng Webmin Modules, import thêm Snort module vào Webmin: ![]() - Tích hợp snort vào webmin: chép snort-1.1.wbm vào thư mục bung snort http:/localhost:10000 Webmin, chọn Webmin Configuration, Webmin Modules, From uploaded file, chỉ đến thư mục chứa snort-1.1.wbm tiến hành cài đặt ![]() ![]() 4. Tạo CSDL snort với MySQL #service mysqld start Trước tiên ta cần set password cho root trong MySQL. #mysqladmin -u root password 123456 #mysql -p Tạo password cho tài khoản snort. mysql> use mysql; mysql> CREATE USER 'snort'@'localhost' IDENTIFIED BY '123456'; Tạo CSDL cho snort. mysql> create database snort; mysql> GRANT CREATE, INSERT, SELECT, DELETE, UPDATE ON snort.* to snort@localhost; mysql> flush privileges; mysql> exit Tạo các table từ /snort/snort-2.8.4.1/schemas/create_mysql cho database snort (thư mục gải nén snort) mysql -u root -p < /snort/snort-2.8.4.1/schemas/create_mysql snort mysql -p show databases; use snort; show tables; Quan sát các tables 5. Cài đặt BASE và ADODB Web server và PHP đã cài đặt sẵn ta cần cài thêm vài gói pear cho PHP. cd snort/snort-2.8.4.1 pear install Image_Graph-alpha Image_Canvas-alpha Image_Color Numbers_Roman ; (máy phải online) Cài đặt ADODB Tải ADODB tại: http://nchc.dl.sourceforge.net/sourceforge/adodb/ cp adodb480.tgz /var/www/html/ cd /var/www/html/ tar -xzvf adodb480.tgz Cài BASE Tải BASE tại: http://nchc.dl.sourceforge.net/sourc...e-1.4.2.tar.gz #cp /snort/base-1.4.4.tar.gz /var/www/html/ #tar -zxvf base-1.4.4.tar.gz #mv base-1.4.4/ base/ #cd base #cp base_conf.php.dist base_conf.php #vi base_conf.php Sửa các dòng sau: 57 $BASE_urlpath = '/base'; 79 $DBlib_path = '/var/www/html/adodb'; 101 $alert_dbname = 'snort'; 105 $alert_password = '123456'; 108 $archive_exists = 1; # Set this to 1 if you have an archive DB 109 $archive_dbname = 'snort'; 112 $archive_user = 'snort'; 113 $archive_password = '123456'; 355 $external_whois_link = 'index.php'; 382 $external_dns_link = 'index.php'; 385 $external_all_link = 'index.php'; Save lại #service snortd restart #service httpd restart Tại máy win2k3 chạy Nmap, nhập địa chỉ máy Linux 192.168.1.10 để tiến hành do thám ![]() Mở IE truy cập Snort: 192.168.1.10/base Cửa sổ hiện thị thông tin tóm tắt về các cảnh báo mà Snort bắt được ![]() Chọn Most recent 15 Unique Alerts xem 15 cảnh báo gần đây nhất ![]() Chọn Most frequent 5 Unique Alerts: xem thông tin về 5 cảnh báo xảy ra nhiều nhất ![]() Source addres: Số lượng host tham gia cuộc tấn công Trong trường hợp này là 1, chọn số 1 ![]() - Src IP address: địa chỉ máy thực hiệc cuộc do thám 192.168.1.2 ![]() |
![]() |
![]() |
The Following 3 Users Say Thank You to emailhoc For This Useful Post: |
![]() |
#2 |
Newbie
Gia nhập: Jul 2010
Trả Lời: 15
![]() |
Thanks bài viết rất bổ ích
|
![]() |
![]() |
![]() |
#3 |
Newbie
Gia nhập: Feb 2011
Nơi cư ngụ: california
Trả Lời: 1
![]() |
anyone know a good place for auto insurance?
I realize in which talking about insurance coverage Auto Insurance California is never an important enjoyable issue, nonetheless we need to remember this keep in mind this guards California Auto Insurance many of our property also property. It may possibly moreover guard your family mainly because they are often essentially the most valuable details within our exists. Subsequently in the present day I actually desired to offer that you gentlemen some recommendations on obtaining one of the best auto Insurance California insurance coverage coverage as well as precisely what towards appear over with regard to when you are researching from the internet and even throughout person. One can find a whole lot among inquiries that you could wind up being saying to and therefore when you do not question the correct questions California Insurance then you may find yourself having a policy your isn't likely to get superb for you personally and your household. 1st it's worthwhile to store all around since the prices that you'll acquire from your registered brokers should differ via lots of cash. So , after you've got obtained at the very least 5 assorted quotes then you definately could certainly get started pestering concerns. Factors like what exactly is excellent tax deductible, what's my monthly price, is usually furthermore there the loan cost, is usually today any finance broker charge? All of these unquestionably are each and every one truly crucial Auto Insurance San Diego inquiries given that many of the duration the most affordable price tag is just not the best policy that you can apply for. That being said tell all the ingredient so what San Diego Auto Insurance sort from protection you'll have and how do they begin to deal with demands.
|
![]() |
![]() |
![]() |
|
|