關於SNORT無法插入範例的preprocessor - 資安

Catherine avatar
By Catherine
at 2007-09-16T00:02

Table of Contents


請教各位有使用過SNORT的先進
我在FreeBSD 6.2上安裝SNORT 2.6.1.5的版本
我參考以下這個網頁來插入範例的preprocessor,結果遇到一些問題
http://afrodita.unicauca.edu.co/~cbedon/snort/spp_kickstart.html

我的操作步驟如下:

1.複製$SNORT_DIR/templates/spp_template.c和spp_template.h的檔案到
$SNORT_DIR/src/preprocessors/下

2.修改to $SNORT_DIR/src/plugbase.c,如下:

In the includes section:
/* built-in preprocessors */
/*My preprocessor*/
#include "preprocessors/spp_template.h"

(...)

In the function InitPreprocessors:
void InitPreprocessors(){
/*My preprocessor*/
SetupTemplate();


3.修改$SNORT_DIR/src/preprocessors/Makefile.in,如下

libspp_a_SOURCES = spp_arpspoof.c spp_arpspoof.h spp_bo.c spp_bo.h \
(...)
spp_template.c spp_template.h

am_libspp_a_OBJECTS = spp_arpspoof.$(OBJEXT) spp_bo.$(OBJEXT) \
spp_template.$(OBJEXT)


4.執行configure和make,訊息如下:
##################################################################
gcc -DHAVE_CONFIG_H -I. -I. -I../.. -I../.. -I../../src -I../../src/sfutil
-I../../src/output-plugins -I../../src/detection-plugins
-I../../src/dynamic-plugins -I../../src/preprocessors
-I../../src/preprocessors/flow -I../../src/preprocessors/portscan
-I../../src/preprocessors/flow/int-snort
-I../../src/preprocessors/HttpInspect/include
-I../../src/preprocessors/Stream5 -I/usr/local/include -g -O2 -Wall
-DDYNAMIC_PLUGIN -c spp_template.c
spp_template.c: In function `SetupTemplate':
spp_template.c:100: warning: implicit declaration of function `DebugMessage'
spp_template.c:100: error: `DEBUG_PLUGIN' undeclared (first use in this
function)
spp_template.c:100: error: (Each undeclared identifier is reported only once
spp_template.c:100: error: for each function it appears in.)
spp_template.c: In function `TemplateInit':
spp_template.c:117: error: `DEBUG_PLUGIN' undeclared (first use in this
function)
spp_template.c:131: warning: passing arg 1 of `AddFuncToPreprocList' from
incompatible pointer type
spp_template.c:131: error: too few arguments to function
`AddFuncToPreprocList'
*** Error code 1

Stop in /usr/src/literkid/snort-2.6.1.5/src/preprocessors.
*** Error code 1

Stop in /usr/src/literkid/snort-2.6.1.5/src/preprocessors.
*** Error code 1

Stop in /usr/src/literkid/snort-2.6.1.5/src.
*** Error code 1

Stop in /usr/src/literkid/snort-2.6.1.5.
*** Error code 1

Stop in /usr/src/literkid/snort-2.6.1.5.
##################################################################


5.因為範例程式碼裡的DEBUG_PLUGIN未定義,所以在spp_template.c加入debug.h函式庫
#include "debug.h"

編譯後的訊息如下:
##################################################################
spp_template.c: In function `SetupTemplate':
spp_template.c:102: warning: implicit declaration of function `DebugMessage'
spp_template.c: In function `TemplateInit':
spp_template.c:133: warning: passing arg 1 of `AddFuncToPreprocList' from
incompatible pointer type
spp_template.c:133: error: too few arguments to function
`AddFuncToPreprocList'
*** Error code 1

Stop in /usr/src/literkid/snort-2.6.1.5/src/preprocessors.
*** Error code 1
##################################################################


6.用DEBUG_WRAP()把DebugMessage()包起來

100:
DEBUG_WRAP(DebugMessage(DEBUG_PLUGIN,"Preprocessor: Template is
setup...\n"););
117:
DEBUG_WRAP(DebugMessage(DEBUG_PLUGIN,"Preprocessor: Template
Initialized\n"););

編譯後的訊息如下:
##################################################################
spp_template.c: In function `TemplateInit':
spp_template.c:133: warning: passing arg 1 of `AddFuncToPreprocList' from
incompatible pointer type
spp_template.c:133: error: too few arguments to function
`AddFuncToPreprocList'
*** Error code 1

Stop in /usr/src/literkid/snort-2.6.1.5/src/preprocessors.
*** Error code 1
##################################################################


7.新版的SNORT似乎修改了AddFuncToPreprocList()的參數,故修改如下

131:
AddFuncToPreprocList(PreprocFunction, 0, 0);


8.編譯後沒有錯誤訊息,故把範例的preprocessor加入$SNORT/etc/snort.conf的設定
執行snort -c $SNORT/etc/snort.conf的結果如下:

##################################################################
etc/snort.conf(803) unknown dynamic preprocessor "template"
ERROR: Misconfigured dynamic preprocessor(s)
Fatal Error, Quitting..
##################################################################


有人遇過相同的問題嗎?可以幫我解答嗎?非常謝謝!



--
Tags: 資安

All Comments

關於SSL在網站上的使用

Hardy avatar
By Hardy
at 2007-09-10T22:30
請問一下版上的強者~ 假如說一個網站有申請憑證 他要在使用者個人資料的網頁做加密(假設) index.php(非加密) -andgt; member.php(非加密) -andgt; https://mydata.php (加密) 截至目前為止應該沒問題 可是使用者修改完資料按鈕要回到 http://mem ...

關於WIN2000登入網域很慢的問題

Kama avatar
By Kama
at 2007-09-10T13:03
學校有一台電腦近日登入網域很慢 之前都是正常的 쀊檢查網卡及網路線都沒問題 隔壁教室也都網路順暢 唯獨此電腦開機正常 但輸入帳號密碼後 執行就很慢 大概二十分鐘還沒跑完 想請教有人知道問題在哪嗎 謝謝 -- 愛的故事有很多 你一定聽過 她們說 最美的愛情像湖泊 美的忍不住停留 而任性的風 吹 ...

請問...我被盜了該怎麼找回密碼

Daph Bay avatar
By Daph Bay
at 2007-09-08T20:32
我被盜了... 盜我帳號很過分 還把密碼改掉... 奇摩要查詢密碼需要出生年月日(註冊後就不能改了)郵遞區號跟聯絡電話 我今天查詢密碼... 發現他把我的郵遞區號或者聯絡電話改掉 所以系統根本就不能發新的密碼給我T______________T 加上奇摩跟無名整合帳密 連無名也不能上了 裡面 ...

開網頁或檔案被吃上傳頻寬要如何設定?

Xanthe avatar
By Xanthe
at 2007-09-06T18:30
使用軟體為 小紅傘 + AVGanti-spyware + COMODO 先前防火牆用jetico 最近改用COMODO 設定也有爬文看了一下 掃毒也沒發現病毒跟廣告 問題是開某些網頁或是從連結下載檔案時 會變成該網頁或該下載檔案狂上傳佔去所有的頻寬 造成其他網頁(如BBS)或連線軟 ...

關於一些網路的問題

Daph Bay avatar
By Daph Bay
at 2007-09-05T15:16
※ 引述《wingshi (anyway...)》之銘言: : 不好意思 最近修了一門關於linux的課 : 找了一些資料 還是不知道怎麼寫這些作業 : 這些作業比較像是and#34;網路and#34;方面的問題 不清楚可以不可以po在這邊 敬請見諒 : 想請教板上的高手提點一下 : 1.今天你發現到你所管理 ...