yon11b

[SK 쉴더스 루키즈] Snort 네트워크 침입 탐지 실습 본문

보안/SK 쉴더스 루키즈

[SK 쉴더스 루키즈] Snort 네트워크 침입 탐지 실습

yon11b 2026. 4. 15. 13:16
반응형

 

전체 단계 명령어

단계1] nano/etc/snort/local.rules   # Rule 생성
단계2] snort –T –c /etc/snort/snort.conf   # Rule 테스트및오류검사
단계3] snort –i eth0 –c /etc/snort/snort.conf   # Rule 을인터페이스에적용

<공격자 Kali> telnet 192.168.10.20
단계4] tail -f /var/log/snort/snort.alert.fast

 

Port Scan Attack Detection

[단계1] rule 생성

alert tcp 192.168.10.10 any -> 192.168.10.20 any (msg:"XmasPort Scan Detection";flags:UPF;sid:3000003;)

 

UPF → urg, psh, fin → xmas scan 탐지

sid: 룰의 번호

msg: 룰에 대한 설명.

 

[단계2] 테스트 검사

 

[단계3] 룰 적용

 

 

공격자의 화면 (X-mas 공격)

 

NIDS 관제 화면

이미 있었던 룰.1228 / 300001은 내가 만든 룰

 

+ threshold 설정을 통해 공격 의심 패킷의 개수를 지정할 수 있다.

시험에서는 threshold: type threshold track by_src 문법이 주로 나오고

현업에서는 detection_filter:track by_src 문법이 쓰인다.

 

공격자 pc에서 피해자 pc로 접속(telnet)한 후 wireshark로 패킷을 수집하면 전송한 내용들이 다 보인다.

 

 

msfadmin의 일부. ms

 

 

Password Cracking Attack Detection

로그인 실패 시도 메시지가 너무 많이 등장하면 공격으로 간주하고 탐지해보자

 

[단계1] rule 생성: /etc/snort/rules/local.rules

alert tcp 192.168.10.20 23 -> 192.168.10.10 any 
( msg: “Telnet Attack“;  
content:“login incorrect“; nocase;
threshold:type both, track by_src, count 3, seconds 20; 
sid:3000004;)

 

no case: 대소문자 구분하지 않고 contet의 문자열이 들어오면 감지한다.

 

[단계2] 테스트 검사

snort –T –c /etc/snort/snort.conf

 

[단계3] 룰 적용

snort –i eth0 –c /etc/snort/snort.conf

 

관제 화면

 

SYN Flooding Attack Detection

[단계1] rule 설정

alert tcp any any-> 192.168.10.0/24 80
(msg:"TCP SYN Flooding Attack"; 
flags:S; 
threshold:type threshold, track by_src, count 2, seconds 10;
sid:3000005;)

 

[단계2] 테스트 검사

snort –T –c /etc/snort/snort.conf

 

[단계3] 룰 적용

snort –i eth0 –c /etc/snort/snort.conf

 

 

관제 화면

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

728x90