Ask Your Question
0

register packet menu from plugin

asked 2025-01-04 10:55:04 +0000

rtommy gravatar image

updated 2025-01-10 08:58:48 +0000

Guy Harris gravatar image

From a lua plugin is it possible to register new menu items via register_menu() and register new packet menu items via register_packet_menu().

Registering a menu item has options from C code as well such as - using register_stat_tap_table_ui() for a Simple Statistics Dialog with a table inside - implementing a plugin GUI menu (README.plugins)

However, it seems it is not possible to use register_stat_tap_table_ui() for a packet menu item (right click on a packet and add a menu item to that window).

I would like to add a packet menu item and not to the bar menu on top, and I would like that packet menu item to open a Dialog where I provide result of packet analysis.

Is this supported?

Thank you.

edit retag flag offensive close merge delete

Comments

What is an example of this in the base Wireshark?

Chuckc gravatar imageChuckc ( 2025-01-04 13:30:26 +0000 )edit

For an example and idea representation, let's consider a TLS Server Hello packet (as follows).

Now, I want to reuse this information and in a Dialog Box I want to reformat/filter some of that information:

"

This is a Handshake Protocol: Server Hello packet.

Cipher Suite: TLS_RSA_WITH_AES_256_GCM_SHA384 (0x009d)

"

Copied from Wireshark:

` Transport Layer Security

TLSv1.2 Record Layer: Handshake Protocol: Server Hello
    Content Type: Handshake (22)
   Version: TLS 1.2 (0x0303)
    Length: 62
    Handshake Protocol: Server Hello
        Handshake Type: Server Hello (2)
        Length: 58
        Version: TLS 1.2 (0x0303)
        Random: 7310a9c38eb09efbc990a84538bfc0cbba43080730a6c01a8090d335b46666cf
        Session ID Length: 0
        Cipher Suite: TLS_RSA_WITH_AES_256_GCM_SHA384 (0x009d)
        Compression Method: null (0)
        Extensions Length: 18
        Extension: server_name (len=0)
        Extension: renegotiation_info (len=1)
        Extension: session_ticket (len=0)
        Extension: heartbeat (len=1)
        [JA3S Fullstring: 771,157,0-65281-35-15]
        [JA3S: 99d8ee07623beda7cdac70b0bb182874]
TLSv1.2 Record Layer: Handshake Protocol: Certificate
    Content Type: Handshake (22)
    Version: TLS 1.2 (0x0303)
    Length: 1260
    Handshake Protocol ...
(more)
rtommy gravatar imagertommy ( 2025-01-04 13:45:35 +0000 )edit

From a lua plugin is it

"is it" or "it is" ?

Would WSDG: 10.4. Example: Listener written in Lua work if registered with register_packet_menu() ?

Chuckc gravatar imageChuckc ( 2025-01-04 14:51:26 +0000 )edit

yes, in lua "it is", there is a function call register_packet_menu().

However, I am not writing a lua plugin, I am considering a wiretap in C code.

rtommy gravatar imagertommy ( 2025-01-04 14:53:09 +0000 )edit

OK. Takes me awhile to digest the original question. :-)
All of the existing calls to register_stat_tap_table_ui() are in dissectors.
You would like to call it from a "C" plugin. Correct?

From doc/README.plugins it would seem not possible (says to see epan/plugin_if.h).

Chuckc gravatar imageChuckc ( 2025-01-04 14:59:47 +0000 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2025-01-14 10:44:12 +0000

rtommy gravatar image

I found a way to do it... based on they way the lua engine uses funnel_register_packet_menu, it is possible to mimic that from a C plugin and it works, I tested it.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2025-01-04 10:55:04 +0000

Seen: 114 times

Last updated: Jan 14