snort_and_suricata

Download Report

Transcript snort_and_suricata

snort and suricata
발표자 : 이경문
snort 개요

sourcefire사에서 만든 NDIS

실시간 traffic 분석&packet logging용으로 적합

수많은 개발자들에 의한 rule 제공

물론 상용 rule는 구하기 어려움(돈주고 사야 함)

다양한 OS를 지원

open source(GPL license)

국내 많은 업체에서 snort를 (몰래) 사용
http://snort.org
snort를 사용해야 하는 이유


새로 만든다 하더라도 snort 만큼
performance를 낼 수 있는 software는 만들기
어려움(시간이 많이 걸림)
snort에 적용된 수많은 최적화 algorithm을
배워서 구현한다는 것은 현실적으로 적합하지
않음
aho-corasick algorithmn

일반적으로 multi-string 검색에 적합

snort의 fast_pattern에 사용됨


http://en.wikipedia.org/wiki/Aho%E2%80%93C
orasick_string_matching_algorithm
http://www.prism.gatech.edu/~jgirata3/boyerm
oore/
boyer-moore algorithm

일반적으로 single string 검색에 적합

snort rule의 content에서 사용됨


http://en.wikipedia.org/wiki/Boyer%E2%80%93
Moore_string_search_algorithm
http://blog.ivank.net/aho-corasick-algorithm-inas3.html
suricata 개요

multi-core, multi-threading 지원

기존 snort rule과 완벽 호환

gpu 하드웨어 가속 지원

lua와 같은 script language와 interface 가능
http://suricata-ids.org/
snort vs suricata
http://wiki.aanval.com/wiki/Snort_vs_Suricata
suricata install

platform마다 compile&install 이 각기 다름

한번 익혀 두는 것이 좋음

https://redmine.openinfosecfoundation.org/proj
ects/suricata/wiki/Suricata_Installation
suricata install(Pre-installation
requirements)
sudo apt-get -y install libpcre3 libpcre3-dbg
libpcre3-dev \
build-essential autoconf automake libtool
libpcap-dev libnet1-dev \
libyaml-0-2 libyaml-dev zlib1g zlib1g-dev libcapng-dev libcap-ng0 \
make libmagic-dev
suricata install(HTP)
wget
http://www.openinfosecfoundation.org/download/l
ibhtp-0.2.3.tar.gz
tar -xzvf libhtp-0.2.3.tar.gz
cd libhtp-0.2.3
./configure
make
make install
suricata install(IPS)
sudo apt-get -y install libnetfilter-queue-dev
libnetfilter-queue1 libnfnetlink-dev libnfnetlink0
suricata install(suricata)
wget
http://www.openinfosecfoundation.org/download/
suricata-1.4.4.tar.gz
tar -xvzf suricata-1.4.4.tar.gz
cd suricata-1.4.4
suricata install(Compile and install
the engine)
./configure --enable-nfqueue --prefix=/usr -sysconfdir=/etc --localstatedir=/var
suricata install(Auto setup)
./configure
make
make install-conf
make install-rules
make install-full
suricata test(설치 확인)
“suricata” 명령어가 실행이 되는지 확인한다
suricata test(파일 수정)

/etc/suricata.yaml 파일을 수정한다
rule-files:을 찾아서 전부 주석(#)처리를 하고 " - test.rules " 내용을 추가한다.

/etc/suricata/rules/test.rules 파일에 다음과 같은 내용으로 저장한다.
alert tcp any any -> any 80 (msg:"test rule"; content:"GET /"; content:"Host:
www.gilgil.net"; sid:10001; rev:1;)
alert tcp any any -> any 80 (msg:"test rule"; content:"GET /"; content:"Host:
www.naver.com"; sid:10002; rev:1;)
suricata test(fast.log 확인)

/var/log/suricata/fast.log 파일을 확인한다
suricata test(log source 변경)


/src/alert-fastlog.c 파일의 AlertFastLogIPv4 함수 하단의 fprintf 문에 테스트
코드를 추가하여 컴파일한다
수정된 컴파일 모듈이 제대로 실행이 되는지 확인한다
감사합니다

발표자 : 이경문

홈페이지 : http://www.gilgil.net

이메일 : gilgil1973 at gmail.com

휴대폰 : 010-8725-팔구공팔