需要在WINDOWS下安裝Snort。過程比較麻煩,主要是配置麻煩。
有個專門介紹如何在windows下安裝Snort的網站,比較全面:http://www.winsnort.com/
網上有些文章介紹,但是都比較老,環境也很複雜,要用到mysql。我只想用命令列用用snort就OK了。
全面且官方的WinIDS Installation Guide:http://wenku.baidu.com/view/e676414f2b160b4e767fcf29.html
配置snort的過程:http://blog.sina.com.cn/s/blog_627b3f930100x5pe.html【這個講的相當仔細,而且還有所有需要的資源下載,NICE!!!】
Windows 平台下基於 snort的入侵偵測系統安裝 http://www.smatrix.org/bbs/read.php?tid=4366 snort-windows平台安裝http://wenku.baidu.com/view/a4bda62a3169a4517723a3e1.html
Snort 安裝指南(Windows2003平台)http://comic.sjtu.edu.cn/bbs/forum_posts.asp?TID=4100
Windows xp下snort部署入侵偵測系統ids詳解步驟http://hi.baidu.com/cia%D0%AD%BB%E1/blog/item/d8eb98177f45a44020a4e9e0.html
下面是上面文章中提到的Snort相關軟體:
首先得到我們需要的軟體包(最新軟體包):
1、snort2.0.exe(在windows平台下的snort最新版本,linux平台的已經是snort2.4.3)
http://www.snort.org
2、WinPcap_3_2_alpha1.exe(windows版本的PCAP)
http://winpcap.polito.it
3、idscenter11rc4.zip(windows版本的基於snort的圖形控制台)
http://www.packx.net
4、sam_20050206_bin.zip(*uinx、windows版本下的與snort配合使用的即時分析軟體<使用java編寫> )
http://www.lookandfeel.com
5、mysql-5.0.16-win32.zip(windows版本的mysql資料庫伺服器)
http://www.mysql.com
6、ACID-0.9.6b23.tar.gz(基於php的入侵檢測資料庫分析控制台)
http://www.cert.org/kb/acid
7、adodb465.tgz(ADOdb(Active Data Objects Data Base)庫for PHP)
http://jaist.dl.sourceforge.net/sourceforge/adodb/adodb465.zip
8、apache_2055-win32.msi(windows版本的apache Web伺服器)
http://www.apache.org
9、php-5.1.1-Win32.zip(windows版本的php指令碼環境支援)
http://www.php.net
10、jpgraph-2.0.tar.gz(php下面的圖形庫)
http://www.aditus.nu/jpgraph
11、phpMyAdmin-2.2.7-pl1-php3.zip(基於php的mysql資料庫管理程式)
http://www.phpmyadmin.net
12、BSAE 1.2.7 基於php 的入侵檢測資料庫分析控制台
http://sourceforge.net/project/showfiles.php?group_id=103348
這些軟體如何安裝在這裡就不具體將了,需要用時參考上面的文章。
這具體講snort的配置問題。
Snort安裝好後,需要配置etc裡面的snort.conf檔案。
#windows下snort.conf檔案必須修改的幾處:
原: var RULE_PATH ../rules
改為: var RULE_PATH C:\Snort\rules
原: #dynamicpreprocessor directory /usr/local/lib/snort_dynamicpreprocessor/
改為:dynamicpreprocessor directory C:\Snort\lib\snort_dynamicpreprocessor(後面一定不要有/)
原: #dynamicengine /usr/local/lib/snort_dynamicengine/libsf_engine.so
改為:dynamicengine C:\Snort\lib\snort_dynamicengine\sf_engine.dll
原:dynamicdetection directory /usr/local/lib/snort_dynamicrules
改為:dynamicdetection directory C:\Snort\lib\snort_dynamicrules
然後將C:\Snort\so_rules\precompiled\FC-9\i386\2.9.0.1裡的所有檔案拷貝到
C:\Snort\lib\snort_dynamicrules //上面的FC-9不一定對,可以先試一下。看各自的系統都不一樣。
原: include classification.config
改為: include C:\Snort\etc\classification.config
原: include reference.config
改為: include C:\Snort\etc\reference.config
原: # include threshold.conf
改為: include C:\Snort\etc\threshold.conf
原:# Does nothing in IDS mode
#preprocessor normalize_ip4
#preprocessor normalize_tcp: ips ecn stream
#preprocessor normalize_icmp4
#preprocessor normalize_ip6
#preprocessor normalize_icmp6
在之前加上#,注釋掉。
原:preprocessor http_inspect: global iis_unicode_map unicode.map 1252 compress_depth 65535 decompress_depth 65535
改為:preprocessor http_inspect: global iis_unicode_map C:\Snort\etc\unicode.map 1252 compress_depth 65535 decompress_depth 65535
因為在windows下unicode.map這個檔案在etc檔案夾下。
配置好後,儲存。
#下載規則庫
windows下安裝好snort後預設是沒有規則庫,需要自己下載。地址http://www.snort.org/snort-rules/#rules,需要註冊,可是我一直下不來來。。。
#設定前置處理器
在snort.conf裡面可以直接設定某些檢測的前置處理器,當然也可以通過某些前端軟體來實現,比如下面將要提到的IDSCENTER。
比如:
設定連接埠掃描的前置處理器,把第二行的注釋取消,並在最後加上log的儲存檔案。
# Portscan detection. For more information, see README.sfportscan
# preprocessor sfportscan: proto { all } memcap { 10000000 } sense_level { low }logfile { postscan.log }
設定arp欺騙的前置處理器,同樣取消注釋,把IP和MAC改為你的IP和MAC值。
# preprocessor arpspoof
# preprocessor arpspoof_detect_host: 172.26.75.114 BC:AE:C5:81:BE:95
其他前置處理器設定類似。
#設定輸出
在這下面設定你的輸出,需要輸出什麼就注釋掉對應的行。
###################################################
# Step #6: Configure output plugins
# For more information, see Snort Manual, Configuring Snort - Output Modules
###################################################
比如:
# syslog
# output alert_syslog: LOG_AUTH LOG_ALERT
# pcap
# output log_tcpdump: tcpdump.log
插入output alert_fast: alert.ids(輸出fast模式的警示日誌)
#選擇網卡:
進入命令列,在snort.exe檔案所在目錄用snort -W查看系統可用網路介面。記住需要監視的網卡的編號,比如為2,那麼在以後的使用中,用-i 2就可以選擇對應的網卡。
#將snort安裝為系統服務:
C:\Snort\bin>snort /SERVICE /INSTALL -c ../etc/snort.conf -i 2 -l ../snort/log -de
[SNORT_SERVICE] Successfully added the Snort service to the Services database. 如果看到上面的提示說明是成功的。
#將snort服務設定為自啟動
可以在services.msc中設定snort為自動啟動。
#如果改變了snort.conf,則需要重啟snort來載入設定檔:
net stop snortsvc
net start snortsvc
#如果有誤,可以刪除snort服務:
sc delete snortsvc
完成後通過命令啟動IDS模式的snort
snort -i2 -de -l ../log -c ../etc/snort.conf
也可以安裝IDSCENTER來進行圖形介面的Snort管理。