Snort mailing list archives

Simple IPS config for snort


From: kay <kay.diam () gmail com>
Date: Wed, 4 Jul 2012 18:37:08 +0400

I've just compiled snort-inline:

snort-inline-plain -V
   ,,_     -*> Snort! <*-
  o"  )~   Version 2.9.2.3 IPv6 GRE (Build 205)
   ''''    By Martin Roesch & The Snort Team: http://www.snort.org/snort/snort-team
           Copyright (C) 1998-2012 Sourcefire, Inc., et al.
           Using libpcap version 1.0.0
           Using PCRE version: 7.8 2008-09-05
           Using ZLIB version: 1.2.3

snort-inline-plain --daq-list
Available DAQ modules:
pcap(v3): readback live multi unpriv
nfq(v6): live inline multi
dump(v1): readback live inline multi unpriv
afpacket(v4): live inline multi unpriv

And trying to block something to test. I wrote the following rule:
drop tcp any any -> any 80 (msg:"ROOTtest"; content:"USERroot";
nocase; sid:123123;)

Then send the following packet to IPS server:

echo "USERroot" | netcat ipstest 80
wget "http://ipstest/USERroot";

Snort detects it and that's all... It should block, but it doesn't:

Allow:           15 (100.000%)

Here is the command I run:

snort-inline-plain -vv -Q --daq nfq --daq-var queue=1 -c
/etc/snort/snort.conf -A full

Here is the iptables-save:

iptables-save
# Generated by iptables-save v1.4.7 on Wed Jul  4 18:31:43 2012
*filter
:INPUT ACCEPT [23450:9358484]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [12016:2551103]
COMMIT
# Completed on Wed Jul  4 18:31:43 2012
# Generated by iptables-save v1.4.7 on Wed Jul  4 18:31:43 2012
*nat
:PREROUTING ACCEPT [2722:367273]
:POSTROUTING ACCEPT [2:123]
:OUTPUT ACCEPT [2:123]
-A PREROUTING -p tcp -m tcp --dport 80 -j NFQUEUE --queue-num 1
COMMIT
# Completed on Wed Jul  4 18:31:43 2012

Here is my config:

ipvar HOME_NET any
ipvar EXTERNAL_NET any
ipvar HTTP_SERVERS $HOME_NET
portvar HTTP_PORTS [80,8080]
var RULE_PATH rules
var SO_RULE_PATH so_rules
var PREPROC_RULE_PATH preproc_rules
config disable_decode_alerts
config disable_tcpopt_experimental_alerts
config disable_tcpopt_obsolete_alerts
config disable_tcpopt_ttcp_alerts
config disable_tcpopt_alerts
config disable_ipopt_alerts
config checksum_mode: all
config pcre_match_limit: 3500
config pcre_match_limit_recursion: 1500
config detection: search-method ac-split search-optimize max-pattern-len 20
config event_queue: max_queue 8 log 3 order_events content_length
config paf_max: 16000
dynamicpreprocessor directory /usr/lib64/snort-2.9.2.3_dynamicpreprocessor
dynamicengine /usr/lib64/snort-2.9.2.3_dynamicengine/libsf_engine.so
preprocessor normalize_ip4
preprocessor normalize_tcp: ips ecn stream
preprocessor normalize_icmp4
preprocessor normalize_ip6
preprocessor normalize_icmp6
preprocessor frag3_global: max_frags 65536
preprocessor frag3_engine: policy windows detect_anomalies
overlap_limit 10 min_fragment_length 100 timeout 180
preprocessor stream5_global: track_tcp yes, \
   track_udp yes, \
   track_icmp no, \
   max_tcp 262144, \
   max_udp 131072, \
   max_active_responses 2, \
   min_response_seconds 5
preprocessor stream5_tcp: policy windows, detect_anomalies, require_3whs 180, \
   overlap_limit 10, small_segments 3 bytes 150, timeout 180, \
    ports client 21 22 23 25 42 53 79 109 110 111 113 119 135 136 137 139 143 \
        161 445 513 514 587 593 691 1433 1521 1741 2100 3306 6070 6665
6666 6667 6668 6669 \
        7000 8181 32770 32771 32772 32773 32774 32775 32776 32777 32778 32779, \
    ports both 80 81 311 443 465 563 591 593 636 901 989 992 993 994
995 1220 1414 1830 2301 2381 2809 3128 3702 4343 4848 5250 7907 7001
7145 7510 7802 7777 7779 \
        7801 7900 7901 7902 7903 7904 7905 7906 7908 7909 7910 7911
7912 7913 7914 7915 7916 \
        7917 7918 7919 7920 8000 8008 8014 8028 8080 8088 8090 8118
8123 8180 8243 8280 8800 8888 8899 9080 9090 9091 9443 9999 11371
55555
preprocessor stream5_udp: timeout 180
preprocessor http_inspect: global iis_unicode_map unicode.map 1252
compress_depth 65535 decompress_depth 65535
preprocessor http_inspect_server: server default \
    http_methods { GET POST PUT SEARCH MKCOL COPY MOVE LOCK UNLOCK
NOTIFY POLL BCOPY BDELETE BMOVE LINK UNLINK OPTIONS HEAD DELETE TRACE
TRACK CONNECT SOURCE SUBSCRIBE UNSUBSCRIBE PROPFIND PROPPATCH
BPROPFIND BPROPPATCH RPC_CONNECT PROXY_SUCCESS BITS_POST CCM_POST
SMS_POST RPC_IN_DATA RPC_OUT_DATA RPC_ECHO_DATA } \
    chunk_length 500000 \
    server_flow_depth 0 \
    client_flow_depth 0 \
    post_depth 65495 \
    oversize_dir_length 500 \
    max_header_length 750 \
    max_headers 100 \
    max_spaces 200 \
    small_chunk_length { 10 5 } \
    ports { 80 } \
    non_rfc_char { 0x00 0x01 0x02 0x03 0x04 0x05 0x06 0x07 } \
    enable_cookie \
    extended_response_inspection \
    inspect_gzip \
    normalize_utf \
    unlimited_decompress \
    normalize_javascript \
    apache_whitespace no \
    ascii no \
    bare_byte no \
    directory no \
    double_decode no \
    iis_backslash no \
    iis_delimiter no \
    iis_unicode no \
    multi_slash no \
    utf_8 no \
    u_encode yes \
    webroot no
output alert_syslog: LOG_AUTH LOG_ALERT
include classification.config
include reference.config
include $RULE_PATH/test.rules

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Snort-users mailing list
Snort-users () lists sourceforge net
Go to this URL to change user options or unsubscribe:
https://lists.sourceforge.net/lists/listinfo/snort-users
Snort-users list archive:
http://www.geocrawler.com/redir-sf.php3?list=snort-users

Please visit http://blog.snort.org to stay current on all the latest Snort news!


Current thread: