From c4f7153c226f0eeea1ff9116dc95d38aa885e048 Mon Sep 17 00:00:00 2001 From: nnposter Date: Thu, 9 Jan 2020 22:36:35 +0000 Subject: [PATCH] RPC protocol parsing workaround for NetApp 5.0 Dump response lists protocols with trailing null byte --- nselib/rpc.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nselib/rpc.lua b/nselib/rpc.lua index 1e9a98615..20df51174 100644 --- a/nselib/rpc.lua +++ b/nselib/rpc.lua @@ -719,6 +719,8 @@ Portmap = local len len, pos = string.unpack(">I4", data, pos) pos, protocol = Util.unmarshall_vopaque(len, data, pos) + -- workaround for NetApp 5.0: trim trailing null bytes + protocol = protocol:match("[^\0]*") len, pos = string.unpack(">I4", data, pos) pos, addr = Util.unmarshall_vopaque(len, data, pos) len, pos = string.unpack(">I4", data, pos)