]> git.ipfire.org Git - thirdparty/suricata-verify.git/commitdiff
bug-4199: Tests for shared http request body
authorJeff Lucovsky <jeff@lucovsky.org>
Sat, 12 Dec 2020 15:04:25 +0000 (10:04 -0500)
committerVictor Julien <victor@inliniac.net>
Wed, 24 Feb 2021 13:26:58 +0000 (14:26 +0100)
tests/bug-4199/input.pcap [new file with mode: 0644]
tests/bug-4199/test.rules [new file with mode: 0644]
tests/bug-4199/test.yaml [new file with mode: 0644]

diff --git a/tests/bug-4199/input.pcap b/tests/bug-4199/input.pcap
new file mode 100644 (file)
index 0000000..b9eec15
Binary files /dev/null and b/tests/bug-4199/input.pcap differ
diff --git a/tests/bug-4199/test.rules b/tests/bug-4199/test.rules
new file mode 100644 (file)
index 0000000..2cb6dca
--- /dev/null
@@ -0,0 +1,2 @@
+alert http any any -> $HOME_NET any (msg: "detect (/etc/passwd) no transform"; flow:to_server,established; http.request_body;content:"/etc/passwd"; nocase; sid:1;)
+alert http any any -> $HOME_NET any (msg: "detect (/etc/passwd) with transform"; flow:to_server,established; http.request_body; url_decode; content:"/etc/passwd"; nocase; sid:2;)
diff --git a/tests/bug-4199/test.yaml b/tests/bug-4199/test.yaml
new file mode 100644 (file)
index 0000000..bea0b21
--- /dev/null
@@ -0,0 +1,15 @@
+requires:
+  min-version: 7
+
+checks:
+  - filter:
+      count: 0
+      match:
+        event_type: alert
+        alert.signature_id: 1
+
+  - filter:
+      count: 1
+      match:
+        event_type: alert
+        alert.signature_id: 2