Snort 预处理器 `http_inspect` 无法生成警告的问题

我目前正在为一个项目测试 Snort IDS,我遵循了 Snort 2.9.5.3 安装指南。

我遇到一个问题是正确配置了http_inspect预处理器之后,通过自定义的规则进行测试,无法触发报警。

规则如下:

alert tcp any any -> 192.168.9.30 80 (msg:"Potential File Inclusion of /etc/passwd"; flow:to_server,established; classtype:attempted-recon; content:"/etc/passwd"; nocase; sid:1122; rev:1;)

我相信我已经配置了http_inspect来生成 URL 编码。运行 evasion 方法后,我检查 Snort 的终端输出,它显示它确实检测到这些方法的使用,但它不会生成警报。

snort.conf中预处理器配置如下:

# HTTP normalization and anomaly detection.  For more information, see README.http_inspect
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 { 36 80 81 82 83 84 85 86 87 88 89 90 311 383 591 593 631 801 818 901 972 1158 1220 1414 1533 1741 1830 2301 2381 2809 3029 3037 3057 3128 3443 3702 4000 4343 4848 5117 5250 6080 6988 7000 7001 7144 7145 7510 7770 7777 7779 8000 8008 8014 8028 8080 8082 8085 8088 8090 8118 8123 8180 8181 8222 8243 8280 8300 8500 8509 8800 8888 8899 9000 9060 9080 9090 9091 9443 9999 10000 11371 12601 34443 34444 41080 50000 50002 55252 55555 } \
    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 yes \
    bare_byte no \
    directory yes \
    double_decode yes \
    iis_backslash no \
    iis_delimiter no \
    iis_unicode no \
    multi_slash yes \
    utf_8 yes \
    u_encode yes \
    webroot no

通过运气发现了答案,原来我需要稍微修改一下规则,其中的content字段需要更改为uricontent

修改后的规则如下:

alert tcp any any -> 192.168.9.30 80 (msg:"Potential File Inclusion of /etc/passwd"; flow:to_server,established; classtype:attempted-recon; uricontent:"/etc/passwd"; nocase; sid:1122; rev:1;)

通过此修改,http_inspect预处理器将检查任何数据包的URI字段。

你可能感兴趣的:(Snort)