Đăng Nhập

Vui lòng khai báo chính xác tên truy cập và mật khẩu!

Quên mật khẩu?

    Cài đặt nhanh hệ thống phát hiện xâm nhập dùng Snort+ACID

      Admin
      Admin

      Giới tính : Nam

      Đến từ : TPHCM

      Ngày Tham gia : 03/04/2011

      Tổng số bài gửi : 2292

      #1

       Fri Nov 18, 2011 4:37 pm

      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+ [You must be registered and logged in to see this link.]
      - apache-1.3+ [You must be registered and logged in to see this link.]
      - php-4.04+ [You must be registered and logged in to see this link.]
      - snort-1.8.3+ [You must be registered and logged in to see this link.]
      - acid-0.9.6+ [You must be registered and logged in to see this link.]
      - adodb-1.2+ [You must be registered and logged in to see this link.]
      - phplot-4.4.6+ [You must be registered and logged in to see this link.] (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:
      [You must be registered and logged in to see this link.]
      Code:
      # 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:

      CODE:
      Code:
      # mysql -u root -p
      mysql> create database snort;
      mysql> grant INSERT,SELECT on snort.* to snort@localhost identified by '<password>';
      mysql> exit
      # mysql snort -u root -p < ./contrib/create_mysql

      Sửa các thông số sau trong file /etc/snort/snort.conf

      CODE:
      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=localhost

      Khởi động snort:

      CODE:
      Code:

      # /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:
      [You must be registered and logged in to see this link.]

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

      CODE:
      Code:

      # 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:
      [You must be registered and logged in to see this link.]

      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:

      CODE:
      Code:

      # mysql -u root -p
      mysql> create database snort_archive;
      mysql> grant INSERT,SELECT on snort.* to snort_archive@localhost identified by '<password>';
      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

      CODE:
      Code:

      $DBlib_path = "../adodb";
      $DBtype = "mysql";

      /* Alert DB connection parameters */

      $alert_dbname = "snort";
      $alert_host = "localhost";
      $alert_port = "";
      $alert_user = "snort";
      $alert_password = "<password>";

      /* Archive DB connection parameters */

      $archive_dbname = "snort_archive";
      $archive_host = "localhost";
      $archive_port = "";
      $archive_user = "snort";
      $archive_password = "<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.

      CODE:
      Code:

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

      AuthName ACID Secure Area
      AuthType Basic
      AuthUserFile /var/www/html/acid/.htpasswd
      Allow from all
      <limit GET POST>
      require valid-user
      </limit>

      File /var/www/html/acid/.htpasswd:
      acid:<encrypted password>


      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:

      [You must be registered and logged in to see this link.]

      * Tham khảo:

      [You must be registered and logged in to see this link.]