

- WIRESHARK USE PROTOCOL LUA MANUAL
- WIRESHARK USE PROTOCOL LUA REGISTRATION
- WIRESHARK USE PROTOCOL LUA CODE
- WIRESHARK USE PROTOCOL LUA SERIES
WIRESHARK USE PROTOCOL LUA MANUAL
Wireshark’s Lua API Reference Manual can be found here. See Appendix B, "Files and Folders" of the Wireshark User's Guide for the location of those directories. The location of the directories containing these scripts are different on different platforms.
WIRESHARK USE PROTOCOL LUA SERIES
So, what you have to do is to register a series of functions that will be called while processing packets.
WIRESHARK USE PROTOCOL LUA REGISTRATION
lua and run them as scripts, and then will run all scripts passed with the -X lua_script: xxx.lua command line option in the given order.Īll these scripts will be run before packets are read, at the end of the dissector registration process. Otherwise, after that, it will run the a script in your personal configuration directory, if it exists, and then search your personal plugin directory for files ending in. as root but launched by another user) it will check if the variable run_user_scripts_when_superuser is set to true before loading any further scripts. Once this first script was run Wireshark will search the global plugin directory directory for files ending in. If the first init script sets the variable disable_lua to true Wireshark will stop reading scripts and shut down the Lua engine right after the script was run. Once /a has run that there are two variables that tell wireshark whether to continue looking for scripts. If Wireshark finds this file it will run the script. How Lua fits into WiresharkĮvery time wireshark starts it will search for a script called a located in the global configuration directory of Wireshark. This does not affect TShark, since it is a console program. If the console window is enabled it will be opened after the Lua engine is loaded. Please note: On Windows, you may not see any output when running Lua scripts in Wireshark. If you can read "hello world!" in the first line after you run tshark Lua is ready to go! Run tshark -X lua_script:a from the command prompt. Name this script a and place it in the current directory.

Make sure Lua is enabled in the global configuration as described below in How Lua Fits Into Wireshark To test Lua on your system, do the following: In some older versions Lua was available as a plugin. To see if your version of Wireshark supports Lua, go to Help→About Wireshark and look for Lua in the "Compiled with" paragraph. Lua has shipped with the Windows version of Wireshark since 0.99.4. Taps are used to collect information after the packet has been dissected. They can add items the dissection tree so they can be used to create your own extensions to the filtering mechanism. Post-dissectors are dissectors meant to run after every other dissector has run.
:max_bytes(150000):strip_icc()/ScreenShot2018-12-12at11.56.10AM-5c11763546e0fb0001f85895.jpg)
Lua is ok for prototyping dissectors, during Reverse Engineering you can use your time for finding out how things work instead of compiling and debugging your C dissector. Lua can be used to write dissectors, post-dissectors and taps.Īlthough it's possible to write dissectors in Lua, Wireshark dissectors are written in C, as C is several times faster than Lua. If it isn't clear to you what the GPL is and how it works please consult your lawyer.
WIRESHARK USE PROTOCOL LUA CODE
To distribute Lua code that uses Wireshark's bindings under different terms would be a clear violation of the GPL. There is at least one Wireshark author that will not allow to distribute derivative work under different terms. The code written in Lua that uses bindings to Wireshark must be distributed under the GPL terms. Wireshark is released under GPL so every derivative work based on Wireshark must be released under the terms of the GPL.Įven if the code you write in Lua does not need to be GPL'ed.
