|
導(dǎo)讀網(wǎng)絡(luò)技術(shù)是從1990年代中期發(fā)展起來(lái)的新技術(shù),它把互聯(lián)網(wǎng)上分散的資源融為有機(jī)整體,實(shí)現(xiàn)資源的全面共享和有機(jī)協(xié)作,使人們能夠透明地使用資源的整體能力并按需獲取信息。資源包括高性能計(jì)算機(jī)、存儲(chǔ)資源、數(shù)據(jù)... 網(wǎng)絡(luò)技術(shù)是從1990年代中期發(fā)展起來(lái)的新技術(shù),它把互聯(lián)網(wǎng)上分散的資源融為有機(jī)整體,實(shí)現(xiàn)資源的全面共享和有機(jī)協(xié)作,使人們能夠透明地使用資源的整體能力并按需獲取信息。資源包括高性能計(jì)算機(jī)、存儲(chǔ)資源、數(shù)據(jù)資源、信息資源、知識(shí)資源、專(zhuān)家資源、大型數(shù)據(jù)庫(kù)、網(wǎng)絡(luò)、傳感器等。 當(dāng)前的互聯(lián)網(wǎng)只限于信息共享,網(wǎng)絡(luò)則被認(rèn)為是互聯(lián)網(wǎng)發(fā)展的第三階段。 入侵檢測(cè)系統(tǒng)也叫IDS=instrusion detection system,他常常被網(wǎng)絡(luò)管理員用來(lái)檢測(cè)網(wǎng)絡(luò)受攻擊的程度和頻繁度,為他進(jìn)行下一步的管理提供充足的資料。 這里采用linux+snort,因?yàn)樗麄兌际敲赓M(fèi)的,并且采用源碼包安裝 軟件下載 libpcap http://www.tcpdump.org snort-1.9 http://www.snort.org 首先你必須有root權(quán)限 su passwd:********** 由于snort需要libpcap,所以先安裝他 cd /usr/src tar zxvf libpcap-0.6.2.tar.gz tar zxvf snort-1.9.0.tar.gz [root@SEC src]# cd libpcap-0.6.2 [root@SEC libpcap-0.6.2]# ./configure --prefix=/usr/local/libpcap-0.6.2 [root@SEC libpcap-0.6.2]#make [root@SEC libpcap-0.6.2]#make install 接著安裝snort,如果不需要把日志寫(xiě)到mysql數(shù)據(jù)庫(kù)的話(huà),配置很簡(jiǎn)單 [root@SEC libpcap-0.6.2]#cd ../snort-1.9.0 [root@SEC snort-1.9.0]#./configure --prefix=/usr/local/snort19 [root@SEC snort-1.9.0]#make [root@SEC snort-1.9.0]#make install OK,安裝完畢,如果在上述安裝過(guò)程中出現(xiàn)任何錯(cuò)誤,請(qǐng)查看README文件 接著,把當(dāng)前目錄下的etc目錄和rules目錄cp到snort的安裝目錄 [root@SEC snort-1.9.0]#cp etc /usr/local/snort19 -r [root@SEC snort-1.9.0]#cp rules /usr/local/snort19 -r 接著,把etc下的classification.config復(fù)制到/root/目錄下 再把etc里面的snort.conf復(fù)制到root目錄下并改名為.snortrc [root@SEC snort-1.9.0]#cp etc/classification.config /root/ [root@SEC snort-1.9.0]#cp etc/snort.conf /root/.snortrc 現(xiàn)在編輯snort的配置文件.snortrc vi /root/.snortrc 先在102行找到var RULE_PATH ../rules 把他改成var RULE_PATH /usr/local/snort19/rules 然后在590行看到 include $RULE_PATH/bad-traffic.rules 這些是SNORT的規(guī)則集,針對(duì)系統(tǒng)類(lèi)型和網(wǎng)絡(luò)環(huán)境選上你所需要的規(guī)則,OK,編輯完畢! 接著為了方便,我們把snort的可執(zhí)行程序復(fù)制/usr/sbin目錄 [root@SEC snort-1.9.0]#cp /usr/local/snort19/bin/snort /usr/sbin/snort 最后為snort放日志創(chuàng)建一個(gè)目錄 [root@SEC snort-1.9.0]#mkdir /var/log/snort 馬上測(cè)試一下 [root@SEC snort-1.9.0]#snort Initializing Output Plugins! Log directory = /var/log/snort Initializing Network Interface eth0 using config file /root/.snortrc Initializing Preprocessors! Initializing Plug-ins! Parsing Rules file /root/.snortrc 等等的輸出,如果你看到的是這樣的,那么恭喜你,你成功了! 下面讓我們一起來(lái)看看snort的參數(shù) [root@SEC snort-1.9.0]# snort --help Initializing Output Plugins! snort: invalid option -- - -*> Snort! <*- Version 1.9.0 (Build 209) By Martin Roesch (roesch@sourcefire.com, www.snort.org) USAGE: snort [-options] Options: -A Set alert mode: fast, full, console, or none (alert file alerts only) "unsock" enables UNIX socket logging (experimental). -a Display ARP packets -b Log packets in tcpdump format (much faster!) -c Use Rules File -C Print out payloads with character data only (no hex) -d Dump the Application Layer -D Run Snort in background (daemon) mode -e Display the second layer header info -f Turn off fflush() calls after binary log writes -F Read BPF filters from file -g Run snort gid as group (or gid) after initialization -G Add reference ids back into alert msgs (modes: basic, url) -h Home network = -i Listen on interface -I Add Interface name to alert output -l Log to directory -m Set umask = -n Exit after receiving packets -N Turn off logging (alerts still work) -o Change the rule testing order to Pass|Alert|Log -O Obfuscate the logged IP addresses -p Disable promiscuous mode sniffing -P set explicit snaplen of packet (default: 1514) -q Quiet. Don't show banner and status report -r Read and process tcpdump file -R Include 'id' in snort_intf.pid file name -s Log alert messages to syslog -S Set rules file variable n equal to value v -t Chroots process to after initialization -T Test and report on the current Snort configuration -u Run snort uid as user (or uid) after initialization -U Use UTC for timestamps -v Be verbose -V Show version number -w Dump 802.11 management and control frames -X Dump the raw packet data starting at the link layer -y Include year in timestamp in the alert and log files -z Set assurance mode, match on established sesions (for TCP) -? Show this information are standard BPF options, as seen in TCPDump 這里主要是要了解幾個(gè)重要的參數(shù) -A 設(shè)置報(bào)警模式,是快速,完全,或者是控制臺(tái),亦或是不報(bào)警 -a 捕獲ARP包 -b 使用tcpdump的格式來(lái)寫(xiě)入日志 -c 指定配置文件路徑 -d 捕獲應(yīng)用層數(shù)據(jù) -D 后臺(tái)運(yùn)行snort -e 顯示第二層頭信息 -h 設(shè)置監(jiān)聽(tīng)主機(jī) -m 設(shè)置掩碼 -z 只匹配已經(jīng)完全建立鏈接的會(huì)話(huà) 我一般是使用 snort -A fast -Db -e -z來(lái)運(yùn)行snort的 其他還有一些很有用的參數(shù),而且可以在配置文件那讓snort把日志寫(xiě)到mysql數(shù)據(jù)庫(kù),這樣對(duì)日志的處理就可以很方便了 如果需要知道更加多的信息,可以去www.snort.org看doc,或者看man page 這里先截取一個(gè)日志片段來(lái)說(shuō)明一些問(wèn)題 11/13-05:29:27.429801 UDP src: 24.24.146.64 dst: 202.196.64.30 sport: 1028 dport: 137 tgts: 6 ports: 6 event_id: 0 11/13-05:29:27.759801 UDP src: 24.24.146.64 dst: 202.196.64.32 sport: 1028 dport: 137 tgts: 7 ports: 7 event_id: 471 11/13-05:29:34.279801 UDP src: 24.24.146.64 dst: 202.196.64.72 sport: 1028 dport: 137 tgts: 8 ports: 8 event_id: 471 11/13-05:29:34.449801 UDP src: 24.24.146.64 dst: 202.196.64.73 sport: 1028 dport: 137 tgts: 9 ports: 9 event_id: 471 11/13-05:29:37.549801 UDP src: 24.24.146.64 dst: 202.196.64.92 sport: 1028 dport: 137 tgts: 10 ports: 10 event_id: 471 11/13-05:29:41.989801 UDP src: 24.24.146.64 dst: 202.196.64.119 sport: 1028 dport: 137 tgts: 11 ports: 11 event_id: 471 11/13-05:29:42.139801 UDP src: 24.24.146.64 dst: 202.196.64.120 sport: 1028 dport: 137 tgts: 12 ports: 12 event_id: 471 這段日志告訴我 今天早上5點(diǎn)左右,有個(gè)IP是24.24.146.64的朋友,在掃描202.196.64網(wǎng)段的共享或者是在使用一些低級(jí)的操作系統(tǒng)鑒別工具來(lái)鑒別這個(gè)網(wǎng)段的操作系統(tǒng)類(lèi)型(因?yàn)楦呒?jí)的系統(tǒng)指紋鑒別系統(tǒng)是不會(huì)掃描137端口的) 詳細(xì)的分析一條日志吧 11/13-05:29:27.429801 UDP src: 24.24.146.64 dst: 202.196.64.30 sport: 1028 dport: 137 tgts: 6 ports: 6 event_id: 0 UDP是使用的協(xié)議 SRC是源IP DST是目標(biāo)IP SPORT是源端口 DPORT是目標(biāo)端口 根據(jù)上面的內(nèi)容再結(jié)合攻擊手段的特征,很容易就可以發(fā)現(xiàn)對(duì)方在做什么了。(出處:secu.zzu.edu.cn) 網(wǎng)絡(luò)的神奇作用吸引著越來(lái)越多的用戶(hù)加入其中,正因如此,網(wǎng)絡(luò)的承受能力也面臨著越來(lái)越嚴(yán)峻的考驗(yàn)―從硬件上、軟件上、所用標(biāo)準(zhǔn)上......,各項(xiàng)技術(shù)都需要適時(shí)應(yīng)勢(shì),對(duì)應(yīng)發(fā)展,這正是網(wǎng)絡(luò)迅速走向進(jìn)步的催化劑。 |
溫馨提示:喜歡本站的話(huà),請(qǐng)收藏一下本站!