介绍
Wireshark二次开发使用Lua语言,wireshark对Lua插件初始化是由安装路径下的init.lua来完成的。从"关于"对话框的Folder选项卡中可以找到个人和全局Lua插件路径(我们计划将插件放到此路径下),如图,全局Lua插件路径为D:Program FilesWiresharkplugins。
![df9bd5537a12fad439de56a2e514485e.png](https://img-blog.csdnimg.cn/img_convert/df9bd5537a12fad439de56a2e514485e.png)
我们可以在wireshark中直接测试Lua脚本,点击"Tools|Lua|Evaluate"菜单,在打开的菜单中输入local nw = TextWindow.new("hello world")点击Evaluate按钮就会弹出如下图的窗口,窗口的标题为hello world。
![202b85d0081d9b970a9d71ef96757798.png](https://img-blog.csdnimg.cn/img_convert/202b85d0081d9b970a9d71ef96757798.png)
Wireshark根据端口或数据格式进行协议解析,通过View|Internals|Dissector tables可以查看解析器表,从图中可以看出端口7是echo服务。