]> git.ipfire.org Git - people/stevee/suricata-verify.git/commitdiff
tests: ICMPv4 header tests
authorJeff Lucovsky <jeff@lucovsky.org>
Thu, 5 Nov 2020 12:44:53 +0000 (07:44 -0500)
committerVictor Julien <victor@inliniac.net>
Fri, 20 Nov 2020 08:22:08 +0000 (09:22 +0100)
tests/icmp-hdr-01/input.pcap [new file with mode: 0644]
tests/icmp-hdr-01/input.rules [new file with mode: 0644]
tests/icmp-hdr-01/test.yaml [new file with mode: 0644]
tests/icmp-hdr-02/input.pcap [new file with mode: 0644]
tests/icmp-hdr-02/input.rules [new file with mode: 0644]
tests/icmp-hdr-02/test.yaml [new file with mode: 0644]

diff --git a/tests/icmp-hdr-01/input.pcap b/tests/icmp-hdr-01/input.pcap
new file mode 100644 (file)
index 0000000..170b5e8
Binary files /dev/null and b/tests/icmp-hdr-01/input.pcap differ
diff --git a/tests/icmp-hdr-01/input.rules b/tests/icmp-hdr-01/input.rules
new file mode 100644 (file)
index 0000000..1b5c895
--- /dev/null
@@ -0,0 +1 @@
+alert icmp any any -> any any (msg:"icmp hdr test"; icmpv4.hdr; content:"|0a 0e 50 54 42|"; sid:1; rev:1;)
diff --git a/tests/icmp-hdr-01/test.yaml b/tests/icmp-hdr-01/test.yaml
new file mode 100644 (file)
index 0000000..15983c6
--- /dev/null
@@ -0,0 +1,11 @@
+requires:
+  min-version: 6
+
+checks:
+- filter:
+    count: 1
+    match:
+      event_type: alert
+      proto: "ICMP"
+      icmp_code: 0
+      icmp_type: 9
diff --git a/tests/icmp-hdr-02/input.pcap b/tests/icmp-hdr-02/input.pcap
new file mode 100644 (file)
index 0000000..bf5c4e5
Binary files /dev/null and b/tests/icmp-hdr-02/input.pcap differ
diff --git a/tests/icmp-hdr-02/input.rules b/tests/icmp-hdr-02/input.rules
new file mode 100644 (file)
index 0000000..b8c187d
--- /dev/null
@@ -0,0 +1 @@
+alert icmp any any -> any any (msg:"icmp hdr test"; icmpv4.hdr; content: "|be 0a 7b 00 03|"; sid:1; rev:1;)
diff --git a/tests/icmp-hdr-02/test.yaml b/tests/icmp-hdr-02/test.yaml
new file mode 100644 (file)
index 0000000..8b5f98f
--- /dev/null
@@ -0,0 +1,11 @@
+requires:
+  min-version: 6
+
+checks:
+- filter:
+    count: 1
+    match:
+      event_type: alert
+      proto: "ICMP"
+      icmp_code: 1
+      icmp_type: 5