]> git.ipfire.org Git - thirdparty/suricata-verify.git/commitdiff
Adds test case four uri double encoding
authorPhilippe Antoine <contact@catenacyber.fr>
Fri, 17 May 2019 11:56:06 +0000 (13:56 +0200)
committerVictor Julien <victor@inliniac.net>
Tue, 28 May 2019 09:49:12 +0000 (11:49 +0200)
tests/http-double-encoded-uri/README.md [new file with mode: 0644]
tests/http-double-encoded-uri/input.pcap [new file with mode: 0644]
tests/http-double-encoded-uri/suricata.yaml [new file with mode: 0644]
tests/http-double-encoded-uri/test.rules [new file with mode: 0644]
tests/http-double-encoded-uri/test.yaml [new file with mode: 0644]

diff --git a/tests/http-double-encoded-uri/README.md b/tests/http-double-encoded-uri/README.md
new file mode 100644 (file)
index 0000000..da3aedb
--- /dev/null
@@ -0,0 +1,8 @@
+# Description
+
+Test http double encoded uri alert
+
+# PCAP
+
+The pcap comes from running
+`curl http://oisf.net/evil%2527sqli`
diff --git a/tests/http-double-encoded-uri/input.pcap b/tests/http-double-encoded-uri/input.pcap
new file mode 100644 (file)
index 0000000..171cfc5
Binary files /dev/null and b/tests/http-double-encoded-uri/input.pcap differ
diff --git a/tests/http-double-encoded-uri/suricata.yaml b/tests/http-double-encoded-uri/suricata.yaml
new file mode 100644 (file)
index 0000000..5060740
--- /dev/null
@@ -0,0 +1,12 @@
+%YAML 1.1
+---
+
+include: ../../etc/suricata-4.0.3.yaml
+
+app-layer:
+  protocols:
+    http:
+      libhtp:
+        default-config:
+          double-decode-path: yes
+          double-decode-query: yes
diff --git a/tests/http-double-encoded-uri/test.rules b/tests/http-double-encoded-uri/test.rules
new file mode 100644 (file)
index 0000000..4effef8
--- /dev/null
@@ -0,0 +1 @@
+alert http any any -> any any (msg:"SURICATA HTTP Request double encoded URI"; flow:established,to_server; app-layer-event:http.double_encoded_uri; flowint:http.anomaly.count,+,1; classtype:protocol-command-decode; sid:1; rev:1;)
diff --git a/tests/http-double-encoded-uri/test.yaml b/tests/http-double-encoded-uri/test.yaml
new file mode 100644 (file)
index 0000000..2fadf93
--- /dev/null
@@ -0,0 +1,15 @@
+requires:
+  features:
+    - HAVE_LIBJANSSON
+  min-version: 5.0.0
+
+# disables checksum verification
+args:
+  - -k none
+
+checks:
+  - filter:
+      count: 1
+      match:
+        event_type: alert
+        alert.signature_id: 1