]> git.ipfire.org Git - thirdparty/suricata-verify.git/commitdiff
base64_data: add tests for bug 5885 1163/head
authorShivani Bhardwaj <shivanib134@gmail.com>
Thu, 9 Mar 2023 07:34:35 +0000 (13:04 +0530)
committerVictor Julien <victor@inliniac.net>
Mon, 3 Apr 2023 05:02:45 +0000 (07:02 +0200)
tests/base64-decode-5885/README.md [new file with mode: 0644]
tests/base64-decode-5885/input.pcap [new file with mode: 0644]
tests/base64-decode-5885/test.rules [new file with mode: 0644]
tests/base64-decode-5885/test.yaml [new file with mode: 0644]

diff --git a/tests/base64-decode-5885/README.md b/tests/base64-decode-5885/README.md
new file mode 100644 (file)
index 0000000..2cd0c1b
--- /dev/null
@@ -0,0 +1,7 @@
+# Test Description
+
+This test demonsrates the issue with population of `base64_data` lately.
+
+## PCAP
+
+PCAP comes from redmine ticket [5885](https://redmine.openinfosecfoundation.org/issues/5885).
diff --git a/tests/base64-decode-5885/input.pcap b/tests/base64-decode-5885/input.pcap
new file mode 100644 (file)
index 0000000..46f89b5
Binary files /dev/null and b/tests/base64-decode-5885/input.pcap differ
diff --git a/tests/base64-decode-5885/test.rules b/tests/base64-decode-5885/test.rules
new file mode 100644 (file)
index 0000000..a9ab494
--- /dev/null
@@ -0,0 +1,2 @@
+alert tcp any any -> any any (msg:"Base64 data w/o url_decode"; http.request_body; content:"API="; startswith; base64_decode:offset 0, relative; base64_data; content:"cmVwb3J"; sid:1; rev:1;)
+alert tcp any any -> any any (msg:"Base64 data with url_decode"; http.request_body; url_decode; content:"API="; startswith; base64_decode:offset 0, relative; base64_data; content:"cmVwb3J"; sid:2; rev:1;)
diff --git a/tests/base64-decode-5885/test.yaml b/tests/base64-decode-5885/test.yaml
new file mode 100644 (file)
index 0000000..94ad21a
--- /dev/null
@@ -0,0 +1,15 @@
+args:
+- -k none
+
+checks:
+- filter:
+    count: 1
+    match:
+      event_type: alert
+      alert.signature_id: 2
+
+- filter:
+    count: 1
+    match:
+      event_type: alert
+      alert.signature_id: 1