Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

VNC is not registered as a dissector. See end of packet-vnc.c:

#define VNC_PORT_RANGE "5500-5501,5900-5901"
    vnc_handle = create_dissector_handle(dissect_vnc, proto_vnc);

    dissector_add_uint_range_with_preference("tcp.port", VNC_PORT_RANGE, vnc_handle);
    heur_dissector_add("tcp", test_vnc_protocol, "VNC over TCP", "vnc_tcp", proto_vnc, HEURISTIC_ENABLE);

It's a subdissector to the tcp.port table.
There is an example of getting a subdissector at the end of the Wiki page for Lua/Dissectors:

        local tcp_dissector_table = DissectorTable.get("tcp.port")
        original_http_dissector = tcp_dissector_table:get_dissector(80) 

Here is an example getting the VNC dissector based on the port number 5500:

local tcp_port_table = DissectorTable.get("tcp.port")
local vnc_dissector = tcp_port_table:get_dissector(5500)
print (vnc_dissector)
print "----------"
10/17/2021 1:34:40 PM Console opened
10/17/2021 1:35:08 PM VNC
10/17/2021 1:35:08 PM ----------