Giter VIP home page Giter VIP logo

zmtp-wireshark's Introduction

ZMTP Wireshark Dissector

This is a Lua dissector written for the ZMTP protocol. It supports both the "new" protocol (ZMTP version 3.0 and later), as well as the older version 2.

It supports the NULL and PLAIN authentication mechanisms.

Screenshot

Screenshot

Installation

This dissector requires Lua 5.2 or newer.

mkdir -p ~/.config/wireshark/plugins
git clone https://github.com/whitequark/zmtp-wireshark ~/.config/wireshark/plugins/zmtp-wireshark

Usage

As ZeroMQ ports are inherently application-specific, you need to use "Decode As -> ZMTP" on your zeromq packets. Alternatively, subdissectors can register the ZMTP dissector on specific TCP ports to automate decoding.

You can use expression zmtp to filter packets. TCP segments are automatically reassembled.

If you get frame errors, especially when capturing on lo, the problem is that libpcap cannot capture packets over 64 KiB (relevant bug); do sudo ip link set lo mtu 65500.

Subdissectors

This dissector supports calling subdissectors for an application-level protocol. As ZMTP does not have a generic way of specifying the inner protocol, the mapping is done using TCP ports.

A subdissector that wishes to observe ZMTP frames must register itself in the zmtp.protocol dissector table, using the TCP port as a key. Both source and dest ports are checked, so bidirectional links (request/response, for example) will need a dissector that can decode both directions.

-- Register a subdissector "my_subdissector" to the ZMTP protocol table for TCP port 1234
local zmtp = DissectorTable.get("zmtp.protocol")
zmtp:add(1234, my_subdissector_proto)
-- Register the ZMTP dissector as the default for that TCP port (so no "decode as" is needed)
local zmtp_dissector = Dissector.get("zmtp")
local tcp_table = DissectorTable.get("tcp.port")
tcp_table:add(1234, zmtp_dissector)

License

See LICENSE.

Acknowledgements

This dissector is based on a dissector for ZMTP 2, written by Robert G. Jakabosky.

zmtp-wireshark's People

Contributors

bluca avatar hackacad avatar jacobagilbert avatar lekensteyn avatar lucieboubee avatar mamoch avatar pulkomandy avatar stefbo avatar sweetgiorni avatar whitequark avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

zmtp-wireshark's Issues

Error when using Wireshark 2.0

After upgrading to Wireshark 2.0, I get this error when trying to decode a ZMQ stream.

Expert Info (Error/Undecoded): Lua Error: [string "/home/void/.wireshark/plugins/zmtp-wireshar..."]:397: attempt to index global 'bit32' (a nil value)

Flags field incorrect in Wireshark 4.x

In Wireshark 4.x, a hex string is no longer accepted as mask argument in the the Protofield.new() function. This causes flags.more, flags.64bit, and flags.command to be decoded incorrectly.

Packet in Wireshark 3.6.19:
Screenshot 2023-12-08 at 2 17 56 PM

Packet in Wireshark 4.2.0:
Screenshot 2023-12-08 at 2 17 39 PM

Missing 'tap_data' field for object Pinfo

When using this dissector with Wireshark 1.12.1 I get the following error:

Lua Error: [...]\zmtp-dissector.lua:436: No such 'tap_data' setter attribute/field for object type 'Pinfo'

I'm guessing this is due to a change in wireshark's pinfo definition. I couldn't find an equivalent field in the current pinfo definition so as to provide a patch.

Subdissector example

Hi,

Would it be possible to include a basic subdissector example or add some pointers in documentation?
I'm trying to add protobuf to wtmp subdissector without success.

Regards,
Vincent

Request for PDU tracking is blocking TCP reassembly

-- provide hints to tcp
if not pinfo.visited then
local remaining_bytes = tvb:len() - offset
if pdu_len > remaining_bytes then
pinfo.want_pdu_tracking = 2
pinfo.bytes_until_next_pdu = pdu_len - remaining_bytes
end
end

The request for PDU tracking is blocking TCP reassembly, if there are more than two segments. The reassembly is already requested by desegment_offset and desegment_len, which works fine, if there is no PDU tracking.

A description for TCP reassembly can be found here:
Lua/Dissectors – TCP reassembly
and a tutorial here:
A dissector tutorial with TCP-reassembly

Seeking help/advice on considering a builtin C-based dissector for ZMTP

Hi, I am a Wireshark core developer who met this protocol for the first time on a project recently. I have started work on a C-based dissector for ZMTP (it is currently in Draft at https://gitlab.com/wireshark/wireshark/-/merge_requests/14947). One motivation for writing it was to be able to add UAT preferences (as an alternative to the dissector table, which will still get checked if there are no matching UAT entries).

My use-case of ZeroMQ is really just to be clearly able to see/filter short text payloads, where the version will always be 3.1. I have tried to copy the various command types supported by the Lua dissector, but don't have any captures to test with. I guess I could download old source code versions of zeromq and play with sample code, but was hoping you could advise me:

  • if older versions are at all relevant today?
  • if you were able to share any capture files to check the coverage of the various commands?
  • are the curve and plain methods used much in practice? The only attempt at privacy I've seen is where the ZMTP session was just run over SSH...
  • features from the Lua dissector I might have missed? (I saw somewhere that you claim to support 'PLAIN', but I'm not sure how the username/password would be used in that case?)

Any help/advice/captures anyone can share would be greatly appreciated (including any downsides of merging my dissector!).
Best regards,
Martin Mathieson

doesn't work on MacOS High Sierra (10.13.4)

Oh dear ... recently upgraded from El Capitan to High Sierra, and the ZMTP dissector appears to be broken.

No errors, but filtering on zmtp now gives empty display.

I am able to confirm that the same capture file works with the same version of dissector on El Capitan.

Any suggestions would be welcome -- TIA!

Can't find ZMTP "Decode as" in Wireshark v3.2.1

Hello, I am new user for this.
Now I can't find the ZMTP in the list of "Decode as" in my Wireshark.
But in "Analyze" → "Enabled Protocols" I can find ZMTP..
So I wonder why I am like this situation.

Any help/support appreciated.

Is this still maintained?

Hi, I have a general question: Is this being maintained / are any of the existing developers interested in or available for fixing stuff? I've run into some weirdness for which the fixes aren't obvious (to me). Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.