# This file posits that you're trying to defend the 192.168.1.0 class C network # we're trying to log data to "sensitive" ports, plus alert on truly suspicious activity # some of these things may not be suspicious in your network environment, but we run a # fairly tight network (access wise) where I work, so most every alert rule for specific # network rules shown here applies in my case # if you need help writing a specific rule, feel free to drop me a line! # -Marty (roesch@clark.net) ################################## # alert on interesting packets ################################## # look for stealth port scans/sweeps alert tcp any any -> 192.168.1.0/24 any {SF} alert tcp any any -> 192.168.1.0/24 any {F} alert tcp any any -> 192.168.1.0/24 any {} alert tcp any any -> 192.168.1.0/24 any {FPU} # find backdoor attempts alert udp any any -> 192.168.1.0/24 31337 alert tcp any any -> 192.168.1.0/24 12345 alert tcp any any -> 192.168.1.0/24 12346 alert tcp any any -> 192.168.1.0/24 10752 alert udp any any -> 192.168.1.0/24 2140 # NT SNMP user list alert udp any any -> 192.168.1.0/24 161 [|2b 06 01 04 01 4d 01 02 19|] # other interesting ports.... alert udp any any -> 192.168.1.0/24 161 alert tcp any any -> 192.168.1.0/24 143 alert tcp any any -> 192.168.1.0/24 512 alert tcp any any -> 192.168.1.0/24 513 alert tcp any any -> 192.168.1.0/24 514 alert udp any any -> 192.168.1.0/24 194 alert tcp any any -> 192.168.1.0/24 194 alert tcp any any -> 192.168.1.0/24 111 alert udp any any -> 192.168.1.0/24 111 alert tcp any any -> 192.168.1.0/24 32771 alert udp any any -> 192.168.1.0/24 32771 # token DoS detector alert udp 192.168.1.0/24 7 -> 192.168.1.0/24 19 alert udp 192.168.1.0/24 19 -> 192.168.1.0/24 7 # alert on incoming phf attacks alert tcp any any -> 192.168.1.0/24 80 [/cgi-bin/phf] # x86 buffer overflows, put the specifics before the general case alert tcp any any -> 192.168.1.0/24 143 [|E8 C0FF FFFF|/bin/sh] alert tcp any any -> 192.168.1.0/24 53 [|80E8 D7FF FFFF|/bin/sh] # this one looks for the bunch of NOP's before the actual exploit string alert tcp any any -> 192.168.1.0/24 any [|9090 9090 9090 9090 9090|] # netbios crap alert udp any any -> 192.168.1.0/24 137 [CKAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA|00 00|] alert tcp any any -> 192.168.1.0/24 139 [|00|Unix|00|Samba] alert tcp any any -> 192.168.1.0/24 139 [\...|00 00 00|] alert tcp any any -> 192.168.1.0/24 139 [\..|2f 00 00 00|] alert tcp any any -> 192.168.1.0/24 139 [\C$|00 41 3a 00|] alert tcp any any -> 192.168.1.0/24 139 [\D$|00 41 3a 00|] alert tcp any any -> 192.168.1.0/24 139 [\ADMIN$|00 41 3a 00|] # alert on stuff going where it probably shouldn't be alert tcp any 53 -> 192.168.1.0/24 :1024 alert tcp any 25 -> 192.168.1.0/24 :1024 alert tcp any :1024 -> 192.168.1.0/24 :1024 #log all ICMP traffic log icmp any any -> any any #log all TCP/UDP traffic # all tcp traffic below port 1024 log tcp any any -> 192.168.1.0/24 :1024 # grab xwindows traffic log tcp any any -> 192.168.1.0/24 6000:6010 # high port RPC stuff too log tcp any any -> 192.168.1.0/24 32000:33000 # do the same for UDP log udp any any -> 192.168.1.0/24 :2000 log udp any any -> 192.168.1.0/24 32000:33000