| 1 | [[PageOutline]] |
| 2 | = Snort + Mysql + Base on Ubuntu = |
| 3 | |
| 4 | == 安裝所需要檔案 == |
| 5 | '''$ sudo apt-get install apache2 php5-mysql libphp-adodb''' |
| 6 | '''$ sudo apt-get install snort-mysql snort-doc''' |
| 7 | '''$ sudo apt-get install php5-gd php-pear''' |
| 8 | == 修改snort設定檔 == |
| 9 | '''$ sudo vim /etc/snort/snort.conf''' |
| 10 | |
| 11 | 增加 |
| 12 | > output database: log, mysql, user=snort password=snort dbname=snort host=localhost |
| 13 | 移除或註解以下此行(安裝 snort-mysql後才會出現): |
| 14 | > output database: log, mysql, |
| 15 | |
| 16 | == 設定Mysql資料庫 == |
| 17 | |
| 18 | {{{ |
| 19 | $ mysql -u root -p |
| 20 | |
| 21 | mysql> SET PASSWORD FOR root@localhost=PASSWORD('password'); |
| 22 | mysql> create database snort; |
| 23 | mysql> grant INSERT,SELECT on root.* to snort@localhost; |
| 24 | mysql> SET PASSWORD FOR snort@localhost=PASSWORD('snort'); |
| 25 | mysql> grant CREATE, INSERT, SELECT, DELETE, UPDATE on snort.* to snort@localhost; |
| 26 | mysql> grant CREATE, INSERT, SELECT, DELETE, UPDATE on snort.* to snort; |
| 27 | mysql> exit |
| 28 | |
| 29 | $ cp /usr/share/doc/snort-mysql/create_mysql.gz ./ |
| 30 | $ gzip -d create_mysql.gz |
| 31 | $ mysql -u root -p < ./create_mysql snort |
| 32 | |
| 33 | }}} |
| 34 | |
| 35 | == 設定snort網頁管理:BASE == |
| 36 | |
| 37 | 1 下載[http://base.secureideas.net/ BASE 專案] 並解開到/var/www之下,改名為base |
| 38 | 2 改BASE的設定檔 |
| 39 | {{{ |
| 40 | $ cd /var/www/base |
| 41 | $ sudo cp base_conf.php.dist base_conf.php |
| 42 | $ sudo vim base_conf.php |
| 43 | //設定以下參數如: |
| 44 | >$BASE_urlpath = '/base'; |
| 45 | |
| 46 | >$DBlib_path = '/usr/share/php/adodb'; |
| 47 | |
| 48 | >$alert_dbname = 'snort'; |
| 49 | |
| 50 | >$alert_host = 'localhost'; |
| 51 | |
| 52 | >$alert_port = ''; |
| 53 | |
| 54 | >$alert_user = 'snort'; |
| 55 | |
| 56 | >$alert_password = 'snort'; |
| 57 | |
| 58 | }}} |
| 59 | |
| 60 | 3 安裝php 額外套件 |
| 61 | |
| 62 | $ sudo pear install Image_Color |
| 63 | |
| 64 | $ sudo pear install Image_Canvas-alpha |
| 65 | |
| 66 | $ sudo pear install Image_Graph-alpha |
| 67 | |
| 68 | 4 解除封印 |
| 69 | |
| 70 | $ sudo rm /etc/snort/db-pending-config |
| 71 | |
| 72 | * ps : 可能可以直接安裝 $ sudo apt-get install acidbase省略掉以上步驟, 但沒試過 |
| 73 | |
| 74 | 5 奔跑吧!snort |
| 75 | |
| 76 | $ sudo /etc/init.d/snort start |
| 77 | |
| 78 | == 檢視網頁 == |
| 79 | |
| 80 | 看網頁是否成功開啟... |
| 81 | |
| 82 | == 故障排除 == |
| 83 | |
| 84 | 有空在寫囉! |