앞마당에서 snort의 SID 메시지 매핑 파일이 누락되었습니다.

앞마당에서 snort의 SID 메시지 매핑 파일이 누락되었습니다.

snort(현재 버전 2.9.7.0-5)를 설치한 다음 Barnyard2 버전 2.1.14(빌드 337)를 컴파일했습니다. 첫 시도:

sudo ./barnyard2 -c ../etc/barnyard2.conf -o /var/log/snort/snort.alert

알겠어요 Unable to open SID file '/etc/snort/sid-msg.map' (No such file or directory). 이는 사실입니다. /etc/snort/sid-msg.map이 실제로 누락되었습니다. 기존 /etc/snort/community-sid-msg.map을 사용해 보았지만 다음과 같은 결과를 얻었습니다.

ERROR: [ParseSidMapLine()]: Unknown sidmap file version [0]

뭔가 빠졌나요? 아니면 제대로 작동하게 하려면 어떻게 해야 하나요?

lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.4 LTS
Release:    16.04
Codename:   xenial

답변1

/etc/snort/community-sid-msg.map을 사용할 수 있는 것으로 보이지만 포함 주석을 제거한 후에만 가능합니다. 예를 들면 다음과 같습니다.

cd ~
sudo grep -v -P "^#" /etc/snort/community-sid-msg.map > community-sid-msg-no-comments.map
# dir required by barnyard2 at runtime
sudo mkdir /var/log/barnyard2
# comment the line "config sid_file: /etc/snort/sid-msg.map" in your barnyard2/etc/barnyard2.conf
sudo ~/apps/opt/barnyard2/bin/barnyard2 -c ~/apps/opt/barnyard2/etc/barnyard2.conf -S community-sid-msg-no-comments.map -o -q /var/log/snort/snort.log

하지만 작업 출력이 완전히 완료되지는 않았습니다. 이 줄은 샘플 출력입니다.

04/05-23:18:39.268639  [**] [1:485:4] Snort Alert [1:485:4] [**] [Classification: Misc activity] [Priority: 3] {ICMP} 46.223.181.179 -> 188.26.13.70

동등하고 더 나은 방법은 다음과 같습니다.

04/05-23:18:39.268639  [**] [1:485:4] ICMP Destination Unreachable Communication Administratively Prohibited [**] [Classification: Misc activity] [Priority: 3] {ICMP} 46.223.181.179 -> 188.26.13.70

두 번째 줄(더 나은 줄)은 다음을 통해 생성된 sid 파일을 사용하여 생성되었습니다.

python ~/compile/py-idstools/idstools/scripts/gensidmsgmap.py /etc/snort/rules/ > sid-msg-v1.map

gensidmsgmap.py를 다음에서 가져옵니다.https://github.com/jasonish/py-idstools/tree/master/idstools/scripts.

관련 정보