]> git.ipfire.org Git - thirdparty/suricata-verify.git/commitdiff
tests: add 2 simple nfs tests
authorVictor Julien <victor@inliniac.net>
Mon, 18 Jan 2021 07:46:00 +0000 (08:46 +0100)
committerVictor Julien <victor@inliniac.net>
Mon, 18 Jan 2021 07:46:00 +0000 (08:46 +0100)
tests/nfs3-01/README.md [new file with mode: 0644]
tests/nfs3-01/input.pcap [new file with mode: 0644]
tests/nfs3-01/test.yaml [new file with mode: 0644]
tests/nfs4-01/README.md [new file with mode: 0644]
tests/nfs4-01/input.pcap [new file with mode: 0644]
tests/nfs4-01/test.yaml [new file with mode: 0644]

diff --git a/tests/nfs3-01/README.md b/tests/nfs3-01/README.md
new file mode 100644 (file)
index 0000000..374f30b
--- /dev/null
@@ -0,0 +1,4 @@
+PCAP
+====
+
+Pcap from https://wiki.wireshark.org/SampleCaptures#NFS_Protocol_Family
diff --git a/tests/nfs3-01/input.pcap b/tests/nfs3-01/input.pcap
new file mode 100644 (file)
index 0000000..9a94efd
Binary files /dev/null and b/tests/nfs3-01/input.pcap differ
diff --git a/tests/nfs3-01/test.yaml b/tests/nfs3-01/test.yaml
new file mode 100644 (file)
index 0000000..0fab953
--- /dev/null
@@ -0,0 +1,83 @@
+# *** Add configuration here ***
+
+args:
+- -k none
+
+checks:
+- filter:
+    count: 1
+    match:
+      dest_ip: 139.25.22.2
+      dest_port: 1022
+      event_type: nfs
+      nfs.file_tx: false
+      nfs.filename: ''
+      nfs.id: 2
+      nfs.procedure: FSINFO
+      nfs.status: OK
+      nfs.type: response
+      nfs.version: 3
+      proto: UDP
+      rpc.auth_type: UNIX
+      rpc.creds.gid: 0
+      rpc.creds.machine_name: werrmsche
+      rpc.creds.uid: 0
+      rpc.status: ACCEPTED
+      rpc.xid: 1578961885
+      src_ip: 139.25.22.102
+      src_port: 2049
+- filter:
+    count: 1
+    match:
+      app_proto: nfs
+      dest_ip: 139.25.22.2
+      dest_port: 1022
+      event_type: fileinfo
+      fileinfo.filename: bln
+      fileinfo.gaps: false
+      fileinfo.md5: 3a8614dc01881ca20e07e1b9cbc03dc0
+      fileinfo.sha1: 7035ba04df3785719585929f63ed36f8ba347b62
+      fileinfo.sha256: cb39bdb9ce305c91be125134205144c2d5fbf458291711f90f4d2276c69821d8
+      fileinfo.size: 11
+      fileinfo.state: CLOSED
+      fileinfo.stored: false
+      fileinfo.tx_id: 38
+      nfs.file_tx: true
+      nfs.filename: bln
+      nfs.hhash: a5fcf973
+      nfs.id: 39
+      nfs.procedure: READ
+      nfs.read.chunks: 1
+      nfs.read.first: true
+      nfs.read.last: true
+      nfs.read.last_xid: 1578961922
+      nfs.status: OK
+      nfs.type: response
+      nfs.version: 3
+      proto: UDP
+      rpc.auth_type: UNIX
+      rpc.creds.gid: 0
+      rpc.creds.machine_name: werrmsche
+      rpc.creds.uid: 0
+      rpc.status: ACCEPTED
+      rpc.xid: 1578961922
+      src_ip: 139.25.22.102
+      src_port: 2049
+- filter:
+    count: 1
+    match:
+      app_proto: nfs
+      dest_ip: 139.25.22.102
+      dest_port: 2049
+      event_type: flow
+      flow.age: 0
+      flow.alerted: false
+      flow.bytes_toclient: 11038
+      flow.bytes_toserver: 10398
+      flow.pkts_toclient: 57
+      flow.pkts_toserver: 57
+      flow.reason: shutdown
+      flow.state: established
+      proto: UDP
+      src_ip: 139.25.22.2
+      src_port: 1022
diff --git a/tests/nfs4-01/README.md b/tests/nfs4-01/README.md
new file mode 100644 (file)
index 0000000..374f30b
--- /dev/null
@@ -0,0 +1,4 @@
+PCAP
+====
+
+Pcap from https://wiki.wireshark.org/SampleCaptures#NFS_Protocol_Family
diff --git a/tests/nfs4-01/input.pcap b/tests/nfs4-01/input.pcap
new file mode 100644 (file)
index 0000000..c894988
Binary files /dev/null and b/tests/nfs4-01/input.pcap differ
diff --git a/tests/nfs4-01/test.yaml b/tests/nfs4-01/test.yaml
new file mode 100644 (file)
index 0000000..6e2d12f
--- /dev/null
@@ -0,0 +1,79 @@
+# *** Add configuration here ***
+
+args:
+- -k none
+
+checks:
+- filter:
+    count: 1
+    match:
+      app_proto: nfs
+      dest_ip: 192.168.0.61
+      dest_port: 2049
+      event_type: fileinfo
+      fileinfo.gaps: false
+      fileinfo.size: 5
+      fileinfo.state: CLOSED
+      fileinfo.stored: false
+      fileinfo.tx_id: 0
+      nfs.file_tx: true
+      nfs.filename: ''
+      nfs.hhash: a4c60877
+      nfs.id: 1
+      nfs.procedure: WRITE
+      nfs.status: OK
+      nfs.type: response
+      nfs.version: 4
+      proto: TCP
+      rpc.auth_type: 'NULL'
+      rpc.status: ACCEPTED
+      rpc.xid: 2731791399
+      src_ip: 192.168.0.26
+      src_port: 880
+- filter:
+    count: 1
+    match:
+      dest_ip: 192.168.0.61
+      dest_port: 2049
+      event_type: nfs
+      nfs.file_tx: true
+      nfs.filename: ''
+      nfs.hhash: a4c60877
+      nfs.id: 1
+      nfs.procedure: WRITE
+      nfs.status: OK
+      nfs.type: response
+      nfs.version: 4
+      pcap_cnt: 81
+      proto: TCP
+      rpc.auth_type: 'NULL'
+      rpc.status: ACCEPTED
+      rpc.xid: 2731791399
+      src_ip: 192.168.0.26
+      src_port: 880
+- filter:
+    count: 1
+    match:
+      app_proto: nfs
+      dest_ip: 192.168.0.61
+      dest_port: 2049
+      event_type: flow
+      flow.age: 4
+      flow.alerted: false
+      flow.bytes_toclient: 8392
+      flow.bytes_toserver: 8742
+      flow.pkts_toclient: 38
+      flow.pkts_toserver: 43
+      flow.reason: shutdown
+      flow.state: closed
+      proto: TCP
+      src_ip: 192.168.0.26
+      src_port: 880
+      tcp.ack: true
+      tcp.fin: true
+      tcp.psh: true
+      tcp.state: closed
+      tcp.syn: true
+      tcp.tcp_flags: 1b
+      tcp.tcp_flags_tc: 1b
+      tcp.tcp_flags_ts: 1b