정보보안/패킷 포렌식

악성코드 패킷 탐지

MDIN1 2021. 2. 26. 15:16

오픈 소스 IDS <Snort>

www.snort.org/

 

Snort - Network Intrusion Detection & Prevention System

With over 5 million downloads and over 600,000 registered users, it is the most widely deployed intrusion prevention system in the world.

www.snort.org

Snort_2_9_2_3_Installer.exe
3.50MB

 

이번 글에서는 위의 snort 2.9.2.3 installer를 이용해 설치함

 

설치 시작
설치 1

 

설치 2
설치 완료

 

 

base 설치

 

sourceforge.net/projects/secureideas/files/BASE/base-1.4.5/base-1.4.5.tar.gz/download

 

 

 

 

 

설치한 base 파일을 APM_SETUP - htdocs 에 복사해넣기

 

 

 

ADOdb 설치

 

sourceforge.net/projects/adodb/?source=directory

 

 

 

 

 

설치한 adodb 폴더를 APM_SETUP - htdocs 폴더에 복사해넣기

 

 

 

 

Snort DB 생성 및 Schema 적용

1. mysqladmin -u root -p create snort

 

2. mysql -D snort -u root -p < create_mysql

 

3. mysql -u root -p

 

4. use snort;

 

5. show tables;

 

 

 

base 설정

 

base_action.inc.php 파일

 

 

29, 30 라인 주석 처리 (전)

 

 

29, 30 라인 주석 처리 (후)

 

 

127.0.0.1/base

 

adodb path 설정

Path to ADODB : C:\APM_Setup_0226\htdocs\adodb5

 

 

 

 

Step 2 of 5

 

 

 

 

Step 3 of 5

 

 

 

 

오른쪽의 Create BASE AG 버튼 클릭

 

 

 

 

성공적으로 설정 완료 

Successfully가 출력 되며 정상적으로 설정되었음을 알 수 있으며

아래에 Step5를 눌러 메인 페이지로 이동

 

base 메인 화면

 

 

base 설정은 끝났고 이제 Snort 설정을 해주어야 한다.

 

 

Snort 설정

 

 

C:\Snort/etc/snort.conf

Snort - etc 폴더의 snort.conf 파일을 수정해주어야 한다.

 

 

104~106 Line (변경 후)

 

104~106 Line (변경 후)

 

 

113~114 Line (변경 전)
113~114 Line (변경 후)

 

 

246~253 Line (변경 전)
246~253 Line (변경 후)
265~269 Line (변경 전)
265~269 Line (변경 후)
510~511 Line (변경 전)
510~511 Line (변경 후)
자기 자신의 database 정보 추가 (변경 전)
자기 자신의 database 정보 추가 (변경 후)

 

portvar를 var 로 변경
ipvar를 var로 변경

 

 

556~609 Line 주석처리(변경 후)

 

554 Line user.rules (변경 전)
554 Line user.rules (변경 후)

 

 

 

 

 

 

 

 

C:\Snort\rules\user.rules 파일 생성

 

user.rules 파일 수정

 

white_list.rules 파일과 black_list.rules 파일 생성(빈파일)

 

snort_dynamicrules 폴더 생성

snort_dynamicrules 폴더를 생성해주어야 에러가 발생하지 않는다.

 

Snort.exe
-T Snort 설정 파일에 대해 정상 여부 테스트
-l 로그 파일 저장 위치 지정
-c Snort 설정 파일 위치 지정
-i 모니터링할 NIC 번호 지정
-W 모니터링할 NIC 번호 확인

 

 

 

 

 

정상적으로 동작

 

 

 

vm을 이용한 칼리리눅스에서 ping을 전송

ICMP 패킷 탐지

왼쪽의 Total Number of Alerts 의 숫자를 누르면 상세 내용을 볼 수 있는데 나는 숫자를 불렀을때 다음 그림과 같이

에러가 발생했다.

 

 

그래서 에러가 뜨는 부분을 가서 주석처리를 해주니 정상적으로 되더라 ..

 

330 Line 주석 처리(변경 전)
330 Line 주석 처리(변경 후)

 

 

 

 

Community 룰 

www.snort.org/downloads/#rule-downloads

 

Snort Rules and IDS Software Download

Security Onion is a Linux distro for intrusion detection, network security monitoring, and log management. It's based on Ubuntu and contains Snort, Suricata, Bro, OSSEC, Sguil, Squert, Snorby, ELSA, Xplico, NetworkMiner, and many other security tools. The

www.snort.org

community-rules.tar.gz
0.32MB

 

Snort 설치&amp;실습.pdf
1.98MB