From 3019f0c9de463c7a7c592cadc9437f7fdde80f1b Mon Sep 17 00:00:00 2001 From: nnposter Date: Wed, 20 May 2020 20:08:38 +0000 Subject: [PATCH] Fix DALC structure unmarshalling in TNS. Fixes #2010 The algorithm got broken in r37418 (4009f5fb172c5dd60ce0392c4cf2e514a2ed8aea), when string concatenation was replaced with table concatenation. --- CHANGELOG | 3 +++ nselib/tns.lua | 44 +++++++++++++++++--------------------------- 2 files changed, 20 insertions(+), 27 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 42ceb9830..780a89bd2 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -49,6 +49,9 @@ o [Windows] Add support for the new loopback behavior in Npcap 0.9983. This Adapter to be installed, which was a source of problems for some users. [Daniel Miller] +o [NSE][GH#2010] Oracle TNS parser was incorrectly unmarshalling DALC byte + arrays [nnposter] + o [NSE] Virtual host probing list, vhosts-full.lst, was missing numerous entries present in vhosts-default.lst [nnposter] diff --git a/nselib/tns.lua b/nselib/tns.lua index 37d484ca3..2d4e80f5f 100644 --- a/nselib/tns.lua +++ b/nselib/tns.lua @@ -1258,35 +1258,25 @@ Marshaller = { -- @param pos Position in the string at which the element begins -- @return table containing the last position read and the value parsed unmarshalKvpComponent = function( data, pos ) - local value_len - local has_multiple_chunks = false - local value = {} - -- read the 32-bit total length of the value - value_len, pos = string.unpack("