From c587e91db57e417e23db5d1e1426a337340fd383 Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Thu, 12 Oct 2023 13:52:54 +0200 Subject: [PATCH] tests: add test for issue 6397 --- tests/rules/http_uri/test.rules | 2 ++ tests/rules/http_uri/test.yaml | 14 ++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/tests/rules/http_uri/test.rules b/tests/rules/http_uri/test.rules index e4d3ac653..2fbc8b43f 100644 --- a/tests/rules/http_uri/test.rules +++ b/tests/rules/http_uri/test.rules @@ -4,3 +4,5 @@ alert http $HOME_NET any -> $EXTERNAL_NET any (flow:established,to_server; urile alert http $HOME_NET any -> $EXTERNAL_NET any (flow:established,to_server; http.uri; content:".php?"; content:"=01&"; distance:4; within:4; fast_pattern; sid:4;) # urilen followed by "raw" content, make sure the urilen doesn't act as http.uri sticky buffer alert http1 any any -> any any (urilen:44; content:"abc"; sid:5;) +# make sure there is a single uri list. Based on 2016816:3 +alert http $HOME_NET any -> $EXTERNAL_NET any (flow:to_server,established; content:"a"; fast_pattern:only; http_uri; content:"b"; http_uri; content:"Mozilla"; http_user_agent; pcre:"/^$/RV"; content:!"Referer|3a 20|"; http_header; pcre:"/abcdef$/Ui"; sid:6;) diff --git a/tests/rules/http_uri/test.yaml b/tests/rules/http_uri/test.yaml index 45bd5c59e..42d0e7c01 100644 --- a/tests/rules/http_uri/test.yaml +++ b/tests/rules/http_uri/test.yaml @@ -85,3 +85,17 @@ checks: engines[1].name: "http_uri" engines[1].app_proto: "http" engines[1].matches[0].name: "urilen" +- filter: + filename: rules.json + count: 1 + match: + id: 6 + mpm.buffer: "http_uri" + mpm.pattern: "a" + engines[0].name: "http_uri" + engines[0].app_proto: "http" + engines[0].matches[0].name: "content" + engines[0].matches[1].name: "content" + engines[0].matches[2].name: "pcre" + engines[1].name: "http_user_agent" + engines[2].name: "http_header" -- 2.47.2