zoukankan      html  css  js  c++  java
  • Lua语言在Wireshark中使用(转)

    1.       检查Wireshark的版本是否支持Lua

    打开Wireshark,点击“HelpàAbout Wireshark”菜单,查看弹出的对话框,如果有“with Lua 5.1”表示支持Lua语言扩展,如果有“without Lua”表示不支持Lua扩展。

     

    2.       启用LUA

    在全局配置文件中启用LUA的方法是从init.lua文件中删除disable_lua这一行。该文件可以通过点击“HelpàAbout Wireshark”,在弹出的对话框中找到“FoldersàGlobal configuration”,获得init.lua的位置为C:/Program Files/Wireshark,打开该文件夹可以发现init.lua文件。

    -- Lua is disabled by default, comment out the following line to enable Lua support.

    --disable_lua = true; do return end;

    -- If set and we are running with special privileges this setting

    -- tells whether scripts other than this one are to be run.

    run_user_scripts_when_superuser = false

    缺省情况下Lua是不启用的,前面增加“--”注释掉这一行启用LUA。

    3.       创建测试脚本

    创建一个Hello World的LUA测试脚本来检查Lua是否启用。

    -- hello.lua

    -- Lua's implementation of D. Ritchie's hello world program.

    print ("Hello world!")

    4.       测试hello.lua脚本

    可以通过tshark命令来进行测试,进入到wireshark的安装目录中执行下面的命令。

    # cd c:Program FilesWireshark

    # tshark -x lua_script:hello.lua

    C:Program FilesWireshark>tshark -X lua_script:hello.lua

    Hello world!

    Capturing on Intel(R) 82567LM Gigabit Network Connection

    接下来您可以使用Lua语言来为Wireshark增加协议的解码器。

    http://blog.csdn.net/fan_hai_ping/article/details/6703468

  • 相关阅读:
    读书分析和读书步骤的方法
    如何在招聘中挖掘面试人员的能力
    接口测试自动化之Robot Framework
    电商后台系统产品逻辑全解析
    RobotFramework之环境安装、关键字、库详解(三)
    管理学相关系统知识
    软件测试岗位人员离职文档交接
    软件测试人员招聘计划
    测试总结过程中的质量分析报告
    测试人员应该怎么写测试总结?
  • 原文地址:https://www.cnblogs.com/softidea/p/5283687.html
Copyright © 2011-2022 走看看