[IDS]
alert tcp 10.10.10.1 23 -> any any (content:"Last login";msg:"telnet success"; sid:1000001;)
alert tcp 10.10.10.1 23 -> any any (content:"Login incorrect";msg:"telnet failed";sid:1000002;)
alert tcp !10.10.10.0/24 any -> 10.10.10.1 80 (flags:S;msg:"external connect";sid:1000003;)
→ alert tcp !10.10.10.0/24 any -> 10.10.10.1 80 (content:"GET";http_method;msg:"external connect";sid:1000003;)
→ alert tcp !10.10.10.0/24 any -> 10.10.10.1 80 (content:"GET";depth:5;msg:"external connect";sid:1000003;)
→ (favicon.ico 제외) alert tcp !10.10.10.0/24 any -> 10.10.10.1 80 (content:"GET";depth:5;content:!"favicon";content:!"/admin";nocase;flags:PA;msg:"external connect";sid:1000003;)
alert tcp !10.10.10.0/24 any -> 10.10.10.1 80 (content:"admin";http_uri;msg:"ADMIN PAGE connect";sid:1000004;)
→ alert tcp !10.10.10.0/24 any -> 10.10.10.1 80 (content:"GET";http_method;content:"/admin";nocase;content:!"favicon";flags:PA;msg:"external connect";sid:1000003;
alert icmp any any -> any any (sameip;msg:"LAND ATTACK";sid:1000005;)
→ (10.10.10.1 밖에 없을 때 적용 가능, 특정 타입과 코드만 지엽적으로 탐지)
alert icmp 10.10.10.1 any -> 10.10.10.1 any (itype:8;icode:0;msg:"LAND ATTACK";sid:1000005;)
→ (10.10.10.1 이 서비스하는 telnet, dns, web 등 tcp 의 SYN (tcp 는 SYN 으로 통신 시작하니까 갑자기 다른 flag 오면 drop 하니까 SYN 으로 공격), udp 등 추가로 막기)
alert tcp any any -> any any (sameip;flags:S;msg:"LAND ATTACK";sid:1000005;)
alert icmp any any -> 10.10.10.1 any (dsize:>1000;msg:"PING OF DEATH";sid:1000006;)
→ (시그니쳐 값 활용)
alert icmp any any -> 10.10.10.1 any (content:"XXXXXXXXX";msg:"PING OF DEATH";sid:1000006;)
alert tcp any any -> 10.10.10.1 any (flags:S;threshold:type both,track by_dst, count 1000, seconds 1;msg:"SYN FLOODING";sid:1000010;)
→ (hping3 으로 공격 시 window size 가 512 로 고정인 것 추가 탐지)
alert tcp any any -> 10.10.10.1 any (flags:S;window:512;threshold:type both,track by_dst, count 1000, seconds 1;msg:"SYN FLOODING";sid:1000010;)
→ (land attack 과 구분하기 위해 출발지 주소 변경)
alert tcp !10.10.10.1 any -> 10.10.10.1 any (flags:S;window:512;threshold:type both,track by_dst, count 1000, seconds 1;msg:"SYN FLOODING";sid:1000010;)
alert udp any any -> 10.10.10.1 any (threshold:type both,track by_dst, count 1000, seconds 1;msg:"UDP FLOODING";sid:1000011;)
alert icmp any any -> 10.10.10.1 any (threshold:type both,track by_dst, count 1000, seconds 1;msg:"ICMP FLOODING";sid:1000012;)
→ 정상 ping 통신과 다르게 hping3 으로 공격 시 Frags 비트 비워서 보냄. 그러나 라우터에서 ping 통신 할 때도 Frags 비트 비워서 보내서 해당 정보를 기준으로는 공격을 선별 탐지 불가
alert tcp any any -> 10.10.10.1 any (flags:S;threshold:type both,track by_src, count 100, seconds 1;msg:"SYN FLOODING(same src)";sid:1000007;)
alert udp any any -> 10.10.10.1 any (threshold:type both,track by_src, count 100, seconds 1;msg:"UDP FLOODING(same src)";sid:1000008;)
alert icmp any any -> 10.10.10.1 any (threshold:type both,track by_src, count 100, seconds 1;msg:"ICMP FLOODING(same src)";sid:1000009;)
snort 탐지 실행
snort 탐지 확인
[hacker]
탐지 확인용 공격
위 순서와 반대로, 공격 받은 경험 (로그) 을 바탕으로 탐지 정책을 세울 수 있음