]> git.ipfire.org Git - thirdparty/suricata-verify.git/commitdiff
add tests for RFB parser
authorSascha Steinbiss <satta@debian.org>
Tue, 25 Feb 2020 17:16:16 +0000 (18:16 +0100)
committerJason Ish <jason.ish@oisf.net>
Fri, 20 Mar 2020 21:56:18 +0000 (15:56 -0600)
13 files changed:
tests/rfb-protocol-3.3/06-vnc-Password-3.3.pcap [new file with mode: 0644]
tests/rfb-protocol-3.3/suricata.yaml [new file with mode: 0644]
tests/rfb-protocol-3.3/test.yaml [new file with mode: 0644]
tests/rfb-protocol-3.7/00-vnc-openwall-3.7.pcap [new file with mode: 0644]
tests/rfb-protocol-3.7/suricata.yaml [new file with mode: 0644]
tests/rfb-protocol-3.7/test.yaml [new file with mode: 0644]
tests/rfb-protocol-3.8/04-vnc-openwall-3.8.pcap [new file with mode: 0644]
tests/rfb-protocol-3.8/suricata.yaml [new file with mode: 0644]
tests/rfb-protocol-3.8/test.yaml [new file with mode: 0644]
tests/rfb-rules/00-vnc-openwall-3.7.pcap [new file with mode: 0644]
tests/rfb-rules/suricata.yaml [new file with mode: 0644]
tests/rfb-rules/test.rules [new file with mode: 0644]
tests/rfb-rules/test.yaml [new file with mode: 0644]

diff --git a/tests/rfb-protocol-3.3/06-vnc-Password-3.3.pcap b/tests/rfb-protocol-3.3/06-vnc-Password-3.3.pcap
new file mode 100644 (file)
index 0000000..f49d629
Binary files /dev/null and b/tests/rfb-protocol-3.3/06-vnc-Password-3.3.pcap differ
diff --git a/tests/rfb-protocol-3.3/suricata.yaml b/tests/rfb-protocol-3.3/suricata.yaml
new file mode 100644 (file)
index 0000000..4aea57d
--- /dev/null
@@ -0,0 +1,18 @@
+%YAML 1.1
+---
+
+outputs:
+  - eve-log:
+      enabled: yes
+      filetype: regular
+      filename: eve.json
+      types:
+        - rfb
+        - flow
+
+app-layer:
+  protocols:
+    rfb:
+      enabled: yes
+      detection-ports:
+        dp: 5900
diff --git a/tests/rfb-protocol-3.3/test.yaml b/tests/rfb-protocol-3.3/test.yaml
new file mode 100644 (file)
index 0000000..5f23763
--- /dev/null
@@ -0,0 +1,40 @@
+requires:
+  features:
+    - HAVE_LIBJANSSON
+  files:
+    - rust/src/rfb/parser.rs
+
+checks:
+
+  - filter:
+      count: 1
+      match:
+        event_type: flow
+        app_proto: rfb
+
+  - filter:
+      count: 1
+      match:
+        event_type: rfb
+        rfb.server_protocol_version.major: "003"
+        rfb.server_protocol_version.minor: "003"
+        rfb.client_protocol_version.major: "003"
+        rfb.client_protocol_version.minor: "003"
+        rfb.authentication.security_type: 2
+        rfb.authentication.vnc.challenge: "263cd2330c2902a68c88aae131ba552c"
+        rfb.authentication.vnc.response: "3f0526502c716d0ed6a7de026af40c5a"
+        rfb.authentication.security_result: "OK"
+        rfb.screen_shared: false
+        rfb.framebuffer.width: 800
+        rfb.framebuffer.height: 600
+        rfb.framebuffer.name: "\\xa0"
+        rfb.framebuffer.pixel_format.bits_per_pixel: 32
+        rfb.framebuffer.pixel_format.depth: 24
+        rfb.framebuffer.pixel_format.big_endian: false
+        rfb.framebuffer.pixel_format.true_color: true
+        rfb.framebuffer.pixel_format.red_max: 255
+        rfb.framebuffer.pixel_format.green_max: 255
+        rfb.framebuffer.pixel_format.blue_max: 255
+        rfb.framebuffer.pixel_format.red_shift: 16
+        rfb.framebuffer.pixel_format.green_shift: 8
+        rfb.framebuffer.pixel_format.blue_shift: 0
diff --git a/tests/rfb-protocol-3.7/00-vnc-openwall-3.7.pcap b/tests/rfb-protocol-3.7/00-vnc-openwall-3.7.pcap
new file mode 100644 (file)
index 0000000..f1e91c2
Binary files /dev/null and b/tests/rfb-protocol-3.7/00-vnc-openwall-3.7.pcap differ
diff --git a/tests/rfb-protocol-3.7/suricata.yaml b/tests/rfb-protocol-3.7/suricata.yaml
new file mode 100644 (file)
index 0000000..4aea57d
--- /dev/null
@@ -0,0 +1,18 @@
+%YAML 1.1
+---
+
+outputs:
+  - eve-log:
+      enabled: yes
+      filetype: regular
+      filename: eve.json
+      types:
+        - rfb
+        - flow
+
+app-layer:
+  protocols:
+    rfb:
+      enabled: yes
+      detection-ports:
+        dp: 5900
diff --git a/tests/rfb-protocol-3.7/test.yaml b/tests/rfb-protocol-3.7/test.yaml
new file mode 100644 (file)
index 0000000..88b65be
--- /dev/null
@@ -0,0 +1,40 @@
+requires:
+  features:
+    - HAVE_LIBJANSSON
+  files:
+    - rust/src/rfb/parser.rs
+
+checks:
+
+  - filter:
+      count: 1
+      match:
+        event_type: flow
+        app_proto: rfb
+
+  - filter:
+      count: 1
+      match:
+        event_type: rfb
+        rfb.server_protocol_version.major: "003"
+        rfb.server_protocol_version.minor: "007"
+        rfb.client_protocol_version.major: "003"
+        rfb.client_protocol_version.minor: "007"
+        rfb.authentication.security_type: 2
+        rfb.authentication.vnc.challenge: "ea5150a99e0feb6343c045c6f95ce44c"
+        rfb.authentication.vnc.response: "c39d5ad5c8242ed6bea28a773dbd3a29"
+        rfb.authentication.security_result: "OK"
+        rfb.screen_shared: false
+        rfb.framebuffer.width: 1280
+        rfb.framebuffer.height: 800
+        rfb.framebuffer.name: "aneagles@localhost.localdomain"
+        rfb.framebuffer.pixel_format.bits_per_pixel: 32
+        rfb.framebuffer.pixel_format.depth: 24
+        rfb.framebuffer.pixel_format.big_endian: false
+        rfb.framebuffer.pixel_format.true_color: true
+        rfb.framebuffer.pixel_format.red_max: 255
+        rfb.framebuffer.pixel_format.green_max: 255
+        rfb.framebuffer.pixel_format.blue_max: 255
+        rfb.framebuffer.pixel_format.red_shift: 16
+        rfb.framebuffer.pixel_format.green_shift: 8
+        rfb.framebuffer.pixel_format.blue_shift: 0
diff --git a/tests/rfb-protocol-3.8/04-vnc-openwall-3.8.pcap b/tests/rfb-protocol-3.8/04-vnc-openwall-3.8.pcap
new file mode 100644 (file)
index 0000000..8826e51
Binary files /dev/null and b/tests/rfb-protocol-3.8/04-vnc-openwall-3.8.pcap differ
diff --git a/tests/rfb-protocol-3.8/suricata.yaml b/tests/rfb-protocol-3.8/suricata.yaml
new file mode 100644 (file)
index 0000000..4aea57d
--- /dev/null
@@ -0,0 +1,18 @@
+%YAML 1.1
+---
+
+outputs:
+  - eve-log:
+      enabled: yes
+      filetype: regular
+      filename: eve.json
+      types:
+        - rfb
+        - flow
+
+app-layer:
+  protocols:
+    rfb:
+      enabled: yes
+      detection-ports:
+        dp: 5900
diff --git a/tests/rfb-protocol-3.8/test.yaml b/tests/rfb-protocol-3.8/test.yaml
new file mode 100644 (file)
index 0000000..ed75672
--- /dev/null
@@ -0,0 +1,40 @@
+requires:
+  features:
+    - HAVE_LIBJANSSON
+  files:
+    - rust/src/rfb/parser.rs
+
+checks:
+
+  - filter:
+      count: 1
+      match:
+        event_type: flow
+        app_proto: rfb
+
+  - filter:
+      count: 1
+      match:
+        event_type: rfb
+        rfb.server_protocol_version.major: "003"
+        rfb.server_protocol_version.minor: "008"
+        rfb.client_protocol_version.major: "003"
+        rfb.client_protocol_version.minor: "008"
+        rfb.authentication.security_type: 2
+        rfb.authentication.vnc.challenge: "1d03c57f2dffcc72a5ae3ad559c9c3db"
+        rfb.authentication.vnc.response: "547b7a6f36a154db03a2575c6f2a4ec5"
+        rfb.authentication.security_result: "OK"
+        rfb.screen_shared: false
+        rfb.framebuffer.width: 800
+        rfb.framebuffer.height: 600
+        rfb.framebuffer.name: "\\xa0"
+        rfb.framebuffer.pixel_format.bits_per_pixel: 32
+        rfb.framebuffer.pixel_format.depth: 24
+        rfb.framebuffer.pixel_format.big_endian: false
+        rfb.framebuffer.pixel_format.true_color: true
+        rfb.framebuffer.pixel_format.red_max: 255
+        rfb.framebuffer.pixel_format.green_max: 255
+        rfb.framebuffer.pixel_format.blue_max: 255
+        rfb.framebuffer.pixel_format.red_shift: 16
+        rfb.framebuffer.pixel_format.green_shift: 8
+        rfb.framebuffer.pixel_format.blue_shift: 0
diff --git a/tests/rfb-rules/00-vnc-openwall-3.7.pcap b/tests/rfb-rules/00-vnc-openwall-3.7.pcap
new file mode 100644 (file)
index 0000000..f1e91c2
Binary files /dev/null and b/tests/rfb-rules/00-vnc-openwall-3.7.pcap differ
diff --git a/tests/rfb-rules/suricata.yaml b/tests/rfb-rules/suricata.yaml
new file mode 100644 (file)
index 0000000..cf76a6b
--- /dev/null
@@ -0,0 +1,17 @@
+%YAML 1.1
+---
+
+outputs:
+  - eve-log:
+      enabled: yes
+      filetype: regular
+      filename: eve.json
+      types:
+        - alert
+
+app-layer:
+  protocols:
+    rfb:
+      enabled: yes
+      detection-ports:
+        dp: 5900
diff --git a/tests/rfb-rules/test.rules b/tests/rfb-rules/test.rules
new file mode 100644 (file)
index 0000000..382e725
--- /dev/null
@@ -0,0 +1,7 @@
+alert rfb any any -> any any (msg:"rfb-name1"; rfb.name; pcre:"/.*\.localdomain/"; sid:1;)
+alert rfb any any -> any any (msg:"rfb-name2"; rfb.name; pcre:"/.*\.localdoom/"; sid:2;)
+alert rfb any any -> any any (msg:"rfb-sectype1"; rfb.sectype:2; sid:3;)
+alert rfb any any -> any any (msg:"rfb-sectype2"; rfb.sectype:>3; sid:4;)
+alert rfb any any -> any any (msg:"rfb-secresult1"; rfb.secresult:ok; sid:5;)
+alert rfb any any -> any any (msg:"rfb-secresult2"; rfb.secresult:unknown; sid:6;)
+
diff --git a/tests/rfb-rules/test.yaml b/tests/rfb-rules/test.yaml
new file mode 100644 (file)
index 0000000..3db1e12
--- /dev/null
@@ -0,0 +1,44 @@
+requires:
+  features:
+    - HAVE_LIBJANSSON
+  files:
+    - rust/src/rfb/parser.rs
+
+checks:
+
+  - filter:
+      count: 1
+      match:
+        event_type: alert
+        alert.signature: "rfb-name1"
+
+  - filter:
+      count: 1
+      match:
+        event_type: alert
+        alert.signature: "rfb-sectype1"
+
+  - filter:
+      count: 1
+      match:
+        event_type: alert
+        alert.signature: "rfb-secresult1"
+
+  - filter:
+      count: 0
+      match:
+        event_type: alert
+        alert.signature: "rfb-name2"
+
+  - filter:
+      count: 0
+      match:
+        event_type: alert
+        alert.signature: "rfb-sectype2"
+
+  - filter:
+      count: 0
+      match:
+        event_type: alert
+        alert.signature: "rfb-secresult2"
+