]> git.ipfire.org Git - people/stevee/suricata-verify.git/commitdiff
Adds test case for url-decode transform keyword
authorPhilippe Antoine <contact@catenacyber.fr>
Wed, 6 Nov 2019 12:23:21 +0000 (13:23 +0100)
committerVictor Julien <victor@inliniac.net>
Fri, 20 Nov 2020 08:22:08 +0000 (09:22 +0100)
tests/http-urldecode-body/README.md [new file with mode: 0644]
tests/http-urldecode-body/client.py [new file with mode: 0644]
tests/http-urldecode-body/input.pcap [new file with mode: 0644]
tests/http-urldecode-body/test.rules [new file with mode: 0644]
tests/http-urldecode-body/test.yaml [new file with mode: 0644]

diff --git a/tests/http-urldecode-body/README.md b/tests/http-urldecode-body/README.md
new file mode 100644 (file)
index 0000000..49e48c7
--- /dev/null
@@ -0,0 +1,8 @@
+# Description
+
+Test url_decode keyword against http client body
+
+# PCAP
+
+The pcap comes from running
+`python3 -m http.server` as a server  and the client.py script as a client
diff --git a/tests/http-urldecode-body/client.py b/tests/http-urldecode-body/client.py
new file mode 100644 (file)
index 0000000..2364e76
--- /dev/null
@@ -0,0 +1,3 @@
+import requests
+d = {'mail': 'test@oisf.net'}
+requests.post("http://localhost:8000", data=d)
diff --git a/tests/http-urldecode-body/input.pcap b/tests/http-urldecode-body/input.pcap
new file mode 100644 (file)
index 0000000..2f24f34
Binary files /dev/null and b/tests/http-urldecode-body/input.pcap differ
diff --git a/tests/http-urldecode-body/test.rules b/tests/http-urldecode-body/test.rules
new file mode 100644 (file)
index 0000000..4c0d517
--- /dev/null
@@ -0,0 +1 @@
+alert http any any -> any any (http.request_body; url_decode; content:"mail=test@oisf.net"; sid:1;)
diff --git a/tests/http-urldecode-body/test.yaml b/tests/http-urldecode-body/test.yaml
new file mode 100644 (file)
index 0000000..ca175f6
--- /dev/null
@@ -0,0 +1,15 @@
+requires:
+  features:
+    - HAVE_LIBJANSSON
+  min-version: 6.0.0
+
+# disables checksum verification
+args:
+  - -k none
+
+checks:
+  - filter:
+      count: 1
+      match:
+        event_type: alert
+        alert.signature_id: 1