У меня есть поток пакетов, который включает зашифрованную полезную нагрузку XML. Я работаю над плагином Wireshark/Lua для отображения данных XML после их расшифровки. Вот что у меня есть прямо сейчас:
decoded_buffer = ProtoField.string("tacserver.decoded_buffer", "XML")
.....
function tacserver_protocol.dissector(buffer, pinfo, tree)
.....
local decoded_string = decode(buffer(10))
subtree:add(decoded_buffer, decoded_string)
local xml_dis = Dissector.get("xml")
local byte_array = ByteArray.new(decoded_string)
local tvb = ByteArray.tvb(byte_array, "XMLdata");
xml_dis:call(tvb, pinfo, tree)
Я вызываю функцию декодирования, чтобы расшифровать полезную нагрузку XML и сохранить результат в decoded_string. В Wireshark, когда данные отображаются в виде строки, вывод правильный.
XML [truncated]: <?xml version="1.0" encoding="UTF-8" ?>\n<body>\n<TacServerInfo...
eXtensible Markup Language
Однако вызов диссектора XML не генерирует никаких выходных данных. Что мне нужно сделать, чтобы вывести декодированные данные в виде XML-дерева? Спасибо!
Вот информация о версии:
Version 2.6.10 (Git v2.6.10 packaged as 2.6.10-1~ubuntu18.04.0)
Copyright 1998-2019 Gerald Combs <[email protected]> and contributors. License GPLv2+: GNU GPL version 2 or later <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html> This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Compiled (64-bit) with Qt 5.9.5, with libpcap, with POSIX capabilities (Linux), with libnl 3, with GLib 2.56.4, with zlib 1.2.11, with SMI 0.4.8, with c-ares 1.14.0, with Lua 5.2.4, with GnuTLS 3.5.18, with Gcrypt 1.8.1, with MIT Kerberos, with MaxMind DB resolver, with nghttp2 1.30.0, with LZ4, with Snappy, with libxml2 2.9.4, with QtMultimedia, with SBC, with SpanDSP, without bcg729.
Running on Linux 5.3.0-61-generic, with Intel(R) Core(TM) i5-7440HQ CPU @ 2.80GHz (with SSE4.2), with 3864 MB of physical memory, with locale en_US.UTF-8, with libpcap version 1.8.1, with GnuTLS 3.5.18, with Gcrypt 1.8.1, with zlib 1.2.11, binary plugins supported (14 loaded). Built using gcc 7.4.0.
Wireshark is Open Source Software released under the GNU General Public License.
Check the man page and http://www.wireshark.org for more information.