]> git.ipfire.org Git - thirdparty/suricata-verify.git/commitdiff
tests: add test for bug 3286
authorVictor Julien <victor@inliniac.net>
Thu, 9 Feb 2023 15:41:17 +0000 (16:41 +0100)
committerVictor Julien <victor@inliniac.net>
Thu, 9 Feb 2023 15:41:17 +0000 (16:41 +0100)
tests/bug-3286-01-no-evasion/test.rules [new file with mode: 0644]
tests/bug-3286-01-no-evasion/test.yaml [new file with mode: 0644]
tests/bug-3286-01-no-evasion/without_evasion.pcap [new file with mode: 0644]
tests/bug-3286-02-linux-evasion/test.rules [new file with mode: 0644]
tests/bug-3286-02-linux-evasion/test.yaml [new file with mode: 0644]
tests/bug-3286-02-linux-evasion/with_evasion_linux.pcap [new file with mode: 0644]
tests/bug-3286-03-windows-evasion/test.rules [new file with mode: 0644]
tests/bug-3286-03-windows-evasion/test.yaml [new file with mode: 0644]
tests/bug-3286-03-windows-evasion/with_evasion_windows.pcap [new file with mode: 0644]

diff --git a/tests/bug-3286-01-no-evasion/test.rules b/tests/bug-3286-01-no-evasion/test.rules
new file mode 100644 (file)
index 0000000..a6a8ff2
--- /dev/null
@@ -0,0 +1 @@
+alert http any any -> any any (content:"THIS_IS_A_TEST"; nocase; sid:1;)
diff --git a/tests/bug-3286-01-no-evasion/test.yaml b/tests/bug-3286-01-no-evasion/test.yaml
new file mode 100644 (file)
index 0000000..b52cf4c
--- /dev/null
@@ -0,0 +1,25 @@
+requires:
+  features:
+    - HAVE_LIBJANSSON
+
+args:
+- --set stats.decoder-events=true
+#- --set stats.stream-events=true
+
+checks:
+  - filter:
+      count: 1
+      match:
+        event_type: alert
+        alert.signature_id: 1
+  - filter:
+      count: 1
+      match:
+        event_type: fileinfo
+        fileinfo.state: CLOSED
+  - filter:
+      count: 1
+      match:
+        event_type: http
+        http.status: 200
+        http.length: 14
diff --git a/tests/bug-3286-01-no-evasion/without_evasion.pcap b/tests/bug-3286-01-no-evasion/without_evasion.pcap
new file mode 100644 (file)
index 0000000..fbf5c09
Binary files /dev/null and b/tests/bug-3286-01-no-evasion/without_evasion.pcap differ
diff --git a/tests/bug-3286-02-linux-evasion/test.rules b/tests/bug-3286-02-linux-evasion/test.rules
new file mode 100644 (file)
index 0000000..44a006e
--- /dev/null
@@ -0,0 +1,2 @@
+alert http any any -> any any (content:"THIS_IS_A_TEST"; nocase; sid:1;)
+alert tcp any any -> any any (msg:"SURICATA STREAM Packet with invalid timestamp"; stream-event:pkt_invalid_timestamp; classtype:protocol-command-decode; sid:2210044; rev:2;)
diff --git a/tests/bug-3286-02-linux-evasion/test.yaml b/tests/bug-3286-02-linux-evasion/test.yaml
new file mode 100644 (file)
index 0000000..499154e
--- /dev/null
@@ -0,0 +1,41 @@
+requires:
+  features:
+    - HAVE_LIBJANSSON
+
+args:
+- --set stats.decoder-events=true
+#- --set stats.stream-events=true
+
+checks:
+  - filter:
+      count: 3
+      match:
+        event_type: alert
+  - filter:
+      count: 1
+      match:
+        event_type: alert
+        alert.signature_id: 1
+  - filter:
+      count: 1
+      match:
+        event_type: alert
+        alert.signature_id: 2210044
+        pcap_cnt: 2
+  - filter:
+      count: 1
+      match:
+        event_type: alert
+        alert.signature_id: 2210044
+        pcap_cnt: 3
+  - filter:
+      count: 1
+      match:
+        event_type: fileinfo
+        fileinfo.state: CLOSED
+  - filter:
+      count: 1
+      match:
+        event_type: http
+        http.status: 200
+        http.length: 14
diff --git a/tests/bug-3286-02-linux-evasion/with_evasion_linux.pcap b/tests/bug-3286-02-linux-evasion/with_evasion_linux.pcap
new file mode 100644 (file)
index 0000000..bdad7c0
Binary files /dev/null and b/tests/bug-3286-02-linux-evasion/with_evasion_linux.pcap differ
diff --git a/tests/bug-3286-03-windows-evasion/test.rules b/tests/bug-3286-03-windows-evasion/test.rules
new file mode 100644 (file)
index 0000000..44a006e
--- /dev/null
@@ -0,0 +1,2 @@
+alert http any any -> any any (content:"THIS_IS_A_TEST"; nocase; sid:1;)
+alert tcp any any -> any any (msg:"SURICATA STREAM Packet with invalid timestamp"; stream-event:pkt_invalid_timestamp; classtype:protocol-command-decode; sid:2210044; rev:2;)
diff --git a/tests/bug-3286-03-windows-evasion/test.yaml b/tests/bug-3286-03-windows-evasion/test.yaml
new file mode 100644 (file)
index 0000000..499154e
--- /dev/null
@@ -0,0 +1,41 @@
+requires:
+  features:
+    - HAVE_LIBJANSSON
+
+args:
+- --set stats.decoder-events=true
+#- --set stats.stream-events=true
+
+checks:
+  - filter:
+      count: 3
+      match:
+        event_type: alert
+  - filter:
+      count: 1
+      match:
+        event_type: alert
+        alert.signature_id: 1
+  - filter:
+      count: 1
+      match:
+        event_type: alert
+        alert.signature_id: 2210044
+        pcap_cnt: 2
+  - filter:
+      count: 1
+      match:
+        event_type: alert
+        alert.signature_id: 2210044
+        pcap_cnt: 3
+  - filter:
+      count: 1
+      match:
+        event_type: fileinfo
+        fileinfo.state: CLOSED
+  - filter:
+      count: 1
+      match:
+        event_type: http
+        http.status: 200
+        http.length: 14
diff --git a/tests/bug-3286-03-windows-evasion/with_evasion_windows.pcap b/tests/bug-3286-03-windows-evasion/with_evasion_windows.pcap
new file mode 100644 (file)
index 0000000..432bf3e
Binary files /dev/null and b/tests/bug-3286-03-windows-evasion/with_evasion_windows.pcap differ