본문 바로가기

웹서비스개발/웹 서버 관리

Snort 설치 중 Dynamic Preprocessor/Rules 문제 (CentOS 6)

<문제 상황>

CentOS 6에서 Snorts를 설치하던 중

Dynamic Preprocessor와 Dynamic Rules를 찾을 수 없는 문제가 발생한다.

 

관련 키워드: snort_dynamicpreprocessor, white_list.rules, black_list.rules

 

<해결 방안>

 

1. snort_dynamicpreprocessor 문제

Snort는 preprocessor라는 기능을 지원하는데 이때 컴파일 된 라이브러리를 /usr/local/lib에 담게된다.

일반적으로 CentOS 환경이라면 제공되는 rpm 파일을 통해 설치하지만, 실제 진행하면 라이브러리가 설치가 안되는 모양이다.

 

그럴땐 rpm(yum)을 통해 필요한 내용을 모두 설치한 다음, 코드 컴파일로 daq와 snort 설치를 한번 더 해주자.

 

# wget https://www.snort.org/downloads/snort/daq-2.0.4.tar.gz
# wget https://www.snort.org/downloads/snort/snort-2.9.7.2.tar.gz

# tar xvfz daq-2.0.4.tar.gz
# cd daq-2.0.4
# ./configure
# make
# sudo make install

# tar xvfz snort-2.9.7.2.tar.gz
# cd snort-2.9.7.2
# ./configure --enable-sourcefire
# make
# sudo make install

 

2. dynamic rules 문제

Snort의 preprocessor 중에는 reputation 항목이 존재한다. (/etc/snort/snort.conf 참고)

 

여기서 화이트 리스트, 블랙 리스트 룰을 불러오는 내용이 있는데

초기 상태의 snort 설치에서 이런 룰이 준비되어 있을리 만무하다. 있는게 수상한거다(?)

이럴 땐 공란 파일하나 만들어주자.

 

# touch /etc/snort/rules/while_list.rules

# touch /etc/snort/rules/black_list.rules

 

다 되었다면 정상 작동되는지 테스트해보자. 아래처럼 결과가 나오면 성공한 것이다.

# snort -T -i eth0 -u snort -g snort -c /etc/snort/snort.conf

 

(앞 내용 생략)

        --== Initialization Complete ==--

   ,,_     -*> Snort! <*-
  o"  )~   Version 2.9.7.2 GRE (Build 177)
   ''''    By Martin Roesch & The Snort Team: http://www.snort.org/contact#team
           Copyright (C) 2014 Cisco and/or its affiliates. All rights reserved.
           Copyright (C) 1998-2013 Sourcefire, Inc., et al.
           Using libpcap version 1.4.0
           Using PCRE version: 7.8 2008-09-05
           Using ZLIB version: 1.2.3

           Rules Engine: SF_SNORT_DETECTION_ENGINE  Version 2.4  <Build 1>
           Preprocessor Object: SF_MODBUS  Version 1.1  <Build 1>
           Preprocessor Object: SF_REPUTATION  Version 1.1  <Build 1>
           Preprocessor Object: SF_DNS  Version 1.1  <Build 4>
           Preprocessor Object: SF_SSLPP  Version 1.1  <Build 4>
           Preprocessor Object: SF_POP  Version 1.0  <Build 1>
           Preprocessor Object: SF_SIP  Version 1.1  <Build 1>
           Preprocessor Object: SF_DCERPC2  Version 1.0  <Build 3>
           Preprocessor Object: SF_GTP  Version 1.1  <Build 1>
           Preprocessor Object: SF_DNP3  Version 1.1  <Build 1>
           Preprocessor Object: SF_SSH  Version 1.1  <Build 3>
           Preprocessor Object: SF_SDF  Version 1.1  <Build 1>
           Preprocessor Object: SF_IMAP  Version 1.0  <Build 1>
           Preprocessor Object: SF_SMTP  Version 1.1  <Build 9>
           Preprocessor Object: SF_FTPTELNET  Version 1.2  <Build 13>

Snort successfully validated the configuration!
Snort exiting

 

이제 Snort를 하나씩 즐겨보면 된다.