Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I add a custom protocol analyzer to wireshark?

I have a custom protocol that I'm looking at in wireshark. I thought it'd be useful if wireshark could disect it for me so that I don't have to decode the hex. Although I'm doing this in my program logs, wireshark captures the whole conversation with timing info so it'd be more useful there.

Can this be easily done?

like image 852
hookenz Avatar asked Feb 05 '11 03:02

hookenz


People also ask

How do I add a protocol to Wireshark?

To enable or disable protocols select Analyze → Enabled Protocols… ​. Wireshark will pop up the “Enabled Protocols” dialog box as shown in Figure 11.4, “The “Enabled Protocols” dialog box”. To disable or enable a protocol, simply click the checkbox using the mouse.

How do I add a Lua dissector to Wireshark?

Setup. If you go to Help –> About Wireshark –> Folders, you'll find all the folders Wireshark reads Lua scripts from. Choose either the Personal Lua Plugins, Global Lua Plugins or Personal configuration folder.


1 Answers

You can write dissectors using Wireshark's LUA API. That way you can write a quick-and dirty dissector without downloading Wireshark's code, or even a compiler. A very simple, yet powerful example is shown in the documentation. Such a LUA dissector is perfectly fine for debugging use, and even distribution with your project.

If you intend to commit your dissector to the official Wireshark repository, you should of course implement it in C for performance and integration reasons.

To use your dissector, create a file my_dissector.lua and invoke Wireshark like this: wireshark -X lua_script:my_dissector.lua

like image 57
mic_e Avatar answered Oct 20 '22 07:10

mic_e