]> git.ipfire.org Git - thirdparty/suricata-verify.git/commitdiff
tests: add bug 7842 test
authorVictor Julien <victor@inliniac.net>
Sat, 10 Jan 2026 19:52:41 +0000 (20:52 +0100)
committerVictor Julien <vjulien@oisf.net>
Fri, 16 Jan 2026 21:07:35 +0000 (21:07 +0000)
tests/bug-7842-01/base64_0x27_detptr_bug.pcap [new file with mode: 0644]
tests/bug-7842-01/test.rules [new file with mode: 0644]
tests/bug-7842-01/test.yaml [new file with mode: 0644]

diff --git a/tests/bug-7842-01/base64_0x27_detptr_bug.pcap b/tests/bug-7842-01/base64_0x27_detptr_bug.pcap
new file mode 100644 (file)
index 0000000..e524254
Binary files /dev/null and b/tests/bug-7842-01/base64_0x27_detptr_bug.pcap differ
diff --git a/tests/bug-7842-01/test.rules b/tests/bug-7842-01/test.rules
new file mode 100644 (file)
index 0000000..3b818c1
--- /dev/null
@@ -0,0 +1,8 @@
+alert http any any -> any any (flow:established,to_server; http.method; content:"POST"; http.request_body; content:"|27|"; base64_decode:relative; base64_data; content:"|ff ff ff ff|"; within:16; content:".PSObject"; distance:0; content:"|2f|RunspaceInvoke"; sid:2;)
+
+alert http any any -> any any (flow:established,to_server; http.method; content:"POST"; http.request_body; content:"|27|"; base64_decode:relative; base64_data; content:"|ff 01|"; within:2; content:".PSObject"; distance:0; content:"|2f|RunspaceInvoke"; sid:3;)
+
+# strict depth version
+alert http any any -> any any (flow:established,to_server; http.method; content:"POST"; http.request_body; content:"|27|"; base64_decode:relative; base64_data; content:"|00 01 00 00 00 ff ff ff ff|"; depth:9; content:".PSObject"; distance:0; content:"|2f|RunspaceInvoke"; sid:11;)
+# strict within version
+alert http any any -> any any (flow:established,to_server; http.method; content:"POST"; http.request_body; content:"|27|"; base64_decode:relative; base64_data; content:"|00 01 00 00 00 ff ff ff ff|"; within:9; content:".PSObject"; distance:0; content:"|2f|RunspaceInvoke"; sid:12;)
diff --git a/tests/bug-7842-01/test.yaml b/tests/bug-7842-01/test.yaml
new file mode 100644 (file)
index 0000000..b78d776
--- /dev/null
@@ -0,0 +1,27 @@
+requires:
+  min-version: 9
+
+args:
+  - -k none
+
+checks:
+  - filter:
+      count: 1
+      match:
+        event_type: alert
+        alert.signature_id: 2
+  - filter:
+      count: 0
+      match:
+        event_type: alert
+        alert.signature_id: 3
+  - filter:
+      count: 1
+      match:
+        event_type: alert
+        alert.signature_id: 11
+  - filter:
+      count: 1
+      match:
+        event_type: alert
+        alert.signature_id: 12