From: Victor Julien Date: Thu, 9 Feb 2023 15:41:17 +0000 (+0100) Subject: tests: add test for bug 3286 X-Git-Tag: suricata-6.0.12~39 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a253a00727b65118d0db2d18ed33ce44394c52d1;p=thirdparty%2Fsuricata-verify.git tests: add test for bug 3286 --- diff --git a/tests/bug-3286-01-no-evasion/test.rules b/tests/bug-3286-01-no-evasion/test.rules new file mode 100644 index 000000000..a6a8ff2a0 --- /dev/null +++ b/tests/bug-3286-01-no-evasion/test.rules @@ -0,0 +1 @@ +alert http any any -> any any (content:"THIS_IS_A_TEST"; nocase; sid:1;) diff --git a/tests/bug-3286-01-no-evasion/test.yaml b/tests/bug-3286-01-no-evasion/test.yaml new file mode 100644 index 000000000..b52cf4c3d --- /dev/null +++ b/tests/bug-3286-01-no-evasion/test.yaml @@ -0,0 +1,25 @@ +requires: + features: + - HAVE_LIBJANSSON + +args: +- --set stats.decoder-events=true +#- --set stats.stream-events=true + +checks: + - filter: + count: 1 + match: + event_type: alert + alert.signature_id: 1 + - filter: + count: 1 + match: + event_type: fileinfo + fileinfo.state: CLOSED + - filter: + count: 1 + match: + event_type: http + http.status: 200 + http.length: 14 diff --git a/tests/bug-3286-01-no-evasion/without_evasion.pcap b/tests/bug-3286-01-no-evasion/without_evasion.pcap new file mode 100644 index 000000000..fbf5c09e0 Binary files /dev/null and b/tests/bug-3286-01-no-evasion/without_evasion.pcap differ diff --git a/tests/bug-3286-02-linux-evasion/test.rules b/tests/bug-3286-02-linux-evasion/test.rules new file mode 100644 index 000000000..44a006e3b --- /dev/null +++ b/tests/bug-3286-02-linux-evasion/test.rules @@ -0,0 +1,2 @@ +alert http any any -> any any (content:"THIS_IS_A_TEST"; nocase; sid:1;) +alert tcp any any -> any any (msg:"SURICATA STREAM Packet with invalid timestamp"; stream-event:pkt_invalid_timestamp; classtype:protocol-command-decode; sid:2210044; rev:2;) diff --git a/tests/bug-3286-02-linux-evasion/test.yaml b/tests/bug-3286-02-linux-evasion/test.yaml new file mode 100644 index 000000000..499154eb8 --- /dev/null +++ b/tests/bug-3286-02-linux-evasion/test.yaml @@ -0,0 +1,41 @@ +requires: + features: + - HAVE_LIBJANSSON + +args: +- --set stats.decoder-events=true +#- --set stats.stream-events=true + +checks: + - filter: + count: 3 + match: + event_type: alert + - filter: + count: 1 + match: + event_type: alert + alert.signature_id: 1 + - filter: + count: 1 + match: + event_type: alert + alert.signature_id: 2210044 + pcap_cnt: 2 + - filter: + count: 1 + match: + event_type: alert + alert.signature_id: 2210044 + pcap_cnt: 3 + - filter: + count: 1 + match: + event_type: fileinfo + fileinfo.state: CLOSED + - filter: + count: 1 + match: + event_type: http + http.status: 200 + http.length: 14 diff --git a/tests/bug-3286-02-linux-evasion/with_evasion_linux.pcap b/tests/bug-3286-02-linux-evasion/with_evasion_linux.pcap new file mode 100644 index 000000000..bdad7c00f Binary files /dev/null and b/tests/bug-3286-02-linux-evasion/with_evasion_linux.pcap differ diff --git a/tests/bug-3286-03-windows-evasion/test.rules b/tests/bug-3286-03-windows-evasion/test.rules new file mode 100644 index 000000000..44a006e3b --- /dev/null +++ b/tests/bug-3286-03-windows-evasion/test.rules @@ -0,0 +1,2 @@ +alert http any any -> any any (content:"THIS_IS_A_TEST"; nocase; sid:1;) +alert tcp any any -> any any (msg:"SURICATA STREAM Packet with invalid timestamp"; stream-event:pkt_invalid_timestamp; classtype:protocol-command-decode; sid:2210044; rev:2;) diff --git a/tests/bug-3286-03-windows-evasion/test.yaml b/tests/bug-3286-03-windows-evasion/test.yaml new file mode 100644 index 000000000..499154eb8 --- /dev/null +++ b/tests/bug-3286-03-windows-evasion/test.yaml @@ -0,0 +1,41 @@ +requires: + features: + - HAVE_LIBJANSSON + +args: +- --set stats.decoder-events=true +#- --set stats.stream-events=true + +checks: + - filter: + count: 3 + match: + event_type: alert + - filter: + count: 1 + match: + event_type: alert + alert.signature_id: 1 + - filter: + count: 1 + match: + event_type: alert + alert.signature_id: 2210044 + pcap_cnt: 2 + - filter: + count: 1 + match: + event_type: alert + alert.signature_id: 2210044 + pcap_cnt: 3 + - filter: + count: 1 + match: + event_type: fileinfo + fileinfo.state: CLOSED + - filter: + count: 1 + match: + event_type: http + http.status: 200 + http.length: 14 diff --git a/tests/bug-3286-03-windows-evasion/with_evasion_windows.pcap b/tests/bug-3286-03-windows-evasion/with_evasion_windows.pcap new file mode 100644 index 000000000..432bf3e19 Binary files /dev/null and b/tests/bug-3286-03-windows-evasion/with_evasion_windows.pcap differ