当前位置: 首页 > news >正文

珠海网站策划seo相关ppt

珠海网站策划,seo相关ppt,vps 上怎么做网站,网络营销与网络推广的异同在复杂的网络环境中,Wireshark 凭借其强大的捕获和显示功能,成为协议分析不可或缺的工具。然而,面对众多未被内置支持的协议或需要扩展解析的场景,Lua 脚本的引入为Wireshark 提供了极大的灵活性和可扩展性。本文将详细介绍如何使…

在复杂的网络环境中,Wireshark 凭借其强大的捕获和显示功能,成为协议分析不可或缺的工具。然而,面对众多未被内置支持的协议或需要扩展解析的场景,Lua 脚本的引入为Wireshark 提供了极大的灵活性和可扩展性。本文将详细介绍如何使用 Lua 脚本来增强Wireshark 的功能,实现对复杂通讯报文的解析,从基础入门到高级应用,带你领略 Lua 脚本在 Wireshark 中的强大威力。

一、为什么选择Lua?

Lua 作为一种轻量级脚本语言,在Wireshark中具有以下显著优势:

  1. 简单易学:Lua语法简洁,上手快,适合快速开发和原型设计。
  2. 集成方便:Wireshark内置Lua支持,无需重新编译即可加载脚本插件。
  3. 灵活性高:Lua提供丰富的API,可访问Wireshark核心功能,如协议解析、数据包处理等。
  4. 社区活跃:Lua在游戏开发和多个领域有广泛应用,社区支持强大,易于获取帮助。
二、准备环境

确保已安装最新版本的 Wireshark,并准备好 Python 环境(用于生成某些协议库,如MAVLink)。如果解析特定协议,还需下载协议定义文件(如 XML 格式)。

三、创建 Lua 解析脚本
1. 安装 MAVLink(以 MAVLink 为例)

首先,克隆 MAVLink GitHub 仓库,并按照说明安装 MAVLink 工具:

git clone https://github.com/mavlink/mavlink.git
cd mavlink
2. 生成 Lua 解析代码

使用mavgen工具生成 Lua 解析代码。例如,为 common.xml 生成 MAVLink 2 Wireshark 插件:

python3 -m pymavlink.tools.mavgen --lang=WLua --wire-protocol=2.0 --output=mavlink_2_common message_definitions/v1.0/common.xml

生成mavlink_2_common.lua文件,包含解析函数。

3. 修改插件文件

根据需要修改生成的Lua文件,指定监控端口。例如:

-- 绑定协议解析器到指定端口
local udp_dissector_table = DissectorTable.get("udp.port")
udp_dissector_table:add(14550, mavlink_proto)
udp_dissector_table:add(14580, mavlink_proto)
udp_dissector_table:add(18570, mavlink_proto)  -- 可能用于WSL2中的模拟
4. 添加自定义解析逻辑

对于非 MAVLink 协议或需要额外解析逻辑的情况,编写自定义 Lua 脚本。例如,解析假设的二进制协议:

-- 创建新协议对象
local myproto = Proto("myproto", "My Custom Protocol")-- 定义字段
local f_field1 = ProtoField.uint8("myproto.field1", "Field 1", base.DEC)
local f_field2 = ProtoField.string("myproto.field2", "Field 2")
myproto.fields = {f_field1, f_field2}-- 解析函数
function myproto.dissector(buffer, pinfo, tree)pinfo.cols.protocol = "MYPROTO"local subtree = tree:add(myproto, buffer(), "My Custom Protocol Data")-- 解析第一个字节为无符号整数local field1 = buffer(0, 1):uint()subtree:add(f_field1, buffer(0, 1))-- 解析剩余部分为字符串local field2 = buffer(1, buffer:len()-1):string()subtree:add(f_field2, buffer(1, buffer:len()-1))
end-- 注册解码器
local udp_table = DissectorTable.get("udp.port")
udp_table:add(9000, myproto)  -- 假设协议使用UDP端口9000
四、导入 Lua 脚本到 Wireshark

将编写好的 Lua 脚本复制到 Wireshark 插件目录。路径因操作系统而异:

  • Linux~/.local/lib/wireshark/plugins~/.wireshark/plugins
  • WindowsProgram Files/Wireshark/plugins

启动 Wireshark,在 Help > About Wireshark > Plugins 中确认插件已加载。

五、捕获 MAVLink 流

在 Linux 系统中,可以使用 tcpdump 来捕获特定接口上的流。可以在笔记本电脑或外部计算机上执行此操作:

apt update
apt install tcpdump
tcpdump -i eth0 -w mavlink-capture.pcap

如果可以通过 SSH 访问远程机器,还可以将 tcpdump 流传输到本地机器,而不是将其记录到文件中。Wireshark 可以打开此流并使用上述工具和过滤器显示解码后的 MAVLink 消息,例如:

mkfifo /tmp/mavlink
wireshark -k -i /tmp/mavlink &
ssh root@10.41.1.1 -p 33333 "tcpdump -s 0 -U -n -w - -i lo not port 33333" > /tmp/mavlink

其中,需要根据远程机器的配置调整用户名、IP 和端口。

  • “mkfifo /tmp/mavlink” 创建一个命名管道用于流数据,
  • “wireshark -k -i /tmp/mavlink &” 启动 Wireshark 并将命名管道作为输入立即开始捕获,
  • “ssh” 命令在远程机器上启动数据流并将其管道传输到本地机器的命名管道中,
  • “-s 0” 设置快照长度为默认,
  • “-U” 流数据包输出为包缓冲,不等待完整缓冲区,
  • “-n” 不转换地址,
  • “-w -” 将原始数据写入标准输出(管道传输到本地机器),
  • “-i lo” 定义要监听的接口(这里是环回接口,也可以根据需要更改为以太网、USB 或调制解调器接口),
  • “not port 33333” 不捕获 SSH 会话创建的数据,还可以添加更多过滤器来减少传输的数据。
六、使用 Wireshark 分析
  1. 选择网络接口:选择适当的接口捕获。
  2. 应用过滤器:使用协议名称(如myproto)过滤特定流。
  3. 查看消息详情:点击消息查看详细信息,包括字段值和解释。
    在这里插入图片描述
六、高级功能与应用

Lua 脚本在 Wireshark 中不仅限于基本解析,还可实现以下高级功能:

  • 统计分析:收集特定消息或事件的发生次数,生成图表或报告。
  • 实时响应:检测特定模式时触发警报或执行操作。
  • 自动化测试:模拟客户端行为,发送请求并验证响应,进行回归测试。

文章转载自:
http://dinncoream.stkw.cn
http://dinncoerective.stkw.cn
http://dinncoheld.stkw.cn
http://dinncodiscourteously.stkw.cn
http://dinncodecently.stkw.cn
http://dinncoeunuch.stkw.cn
http://dinncoknickers.stkw.cn
http://dinncoclop.stkw.cn
http://dinncosubcompact.stkw.cn
http://dinncoextravagantly.stkw.cn
http://dinncoantisepticise.stkw.cn
http://dinncowine.stkw.cn
http://dinncohydrostatics.stkw.cn
http://dinncoskewer.stkw.cn
http://dinncolikable.stkw.cn
http://dinncorevenue.stkw.cn
http://dinncopale.stkw.cn
http://dinncorecipience.stkw.cn
http://dinncoformat.stkw.cn
http://dinncofasciately.stkw.cn
http://dinncohaircut.stkw.cn
http://dinncogutless.stkw.cn
http://dinncoswag.stkw.cn
http://dinncomadcap.stkw.cn
http://dinncocrystalloid.stkw.cn
http://dinncopalmoil.stkw.cn
http://dinncorightabout.stkw.cn
http://dinncocommuterland.stkw.cn
http://dinncoantilogarithm.stkw.cn
http://dinncoembrace.stkw.cn
http://dinncomatriculant.stkw.cn
http://dinncocausalgia.stkw.cn
http://dinncoairslake.stkw.cn
http://dinncotributyl.stkw.cn
http://dinncomodal.stkw.cn
http://dinncooniony.stkw.cn
http://dinncojuvenescence.stkw.cn
http://dinncophlebotomise.stkw.cn
http://dinncosuberate.stkw.cn
http://dinncoultramicrobalance.stkw.cn
http://dinncobotb.stkw.cn
http://dinncoangerly.stkw.cn
http://dinncoclepsydra.stkw.cn
http://dinncomeiofauna.stkw.cn
http://dinncohypogynous.stkw.cn
http://dinncoconfederative.stkw.cn
http://dinncoplatte.stkw.cn
http://dinncoinconsiderate.stkw.cn
http://dinncoantalkaline.stkw.cn
http://dinncopapillary.stkw.cn
http://dinncoreintroduction.stkw.cn
http://dinncocoalman.stkw.cn
http://dinncobourgeoisify.stkw.cn
http://dinnconegativism.stkw.cn
http://dinncodcvo.stkw.cn
http://dinncoparashot.stkw.cn
http://dinncomyoelastic.stkw.cn
http://dinncopericardial.stkw.cn
http://dinncovj.stkw.cn
http://dinncodistraction.stkw.cn
http://dinncoinsouciant.stkw.cn
http://dinncointerface.stkw.cn
http://dinncoroadworthiness.stkw.cn
http://dinncodavey.stkw.cn
http://dinncothalassocrat.stkw.cn
http://dinncosoldanella.stkw.cn
http://dinncopoltergeist.stkw.cn
http://dinncoancestor.stkw.cn
http://dinncotrephination.stkw.cn
http://dinncopneumograph.stkw.cn
http://dinncobiblical.stkw.cn
http://dinncomammalian.stkw.cn
http://dinnconidificant.stkw.cn
http://dinncodisport.stkw.cn
http://dinncototipotency.stkw.cn
http://dinncohouyhnhnm.stkw.cn
http://dinncopuissance.stkw.cn
http://dinncohoggery.stkw.cn
http://dinncocontracted.stkw.cn
http://dinncolexicality.stkw.cn
http://dinncolowest.stkw.cn
http://dinncomaser.stkw.cn
http://dinncokorinthos.stkw.cn
http://dinncoanthropolatry.stkw.cn
http://dinncojeering.stkw.cn
http://dinncomicella.stkw.cn
http://dinncopledger.stkw.cn
http://dinncodisapprobatory.stkw.cn
http://dinncoorientalise.stkw.cn
http://dinncorecordak.stkw.cn
http://dinncomaenad.stkw.cn
http://dinncoagrapha.stkw.cn
http://dinncosuperconducting.stkw.cn
http://dinncocomplanate.stkw.cn
http://dinncopedodontics.stkw.cn
http://dinncoectotrophic.stkw.cn
http://dinncodooly.stkw.cn
http://dinncotoner.stkw.cn
http://dinncomurray.stkw.cn
http://dinncoornl.stkw.cn
http://www.dinnco.com/news/108697.html

相关文章:

  • 淘宝上做网站排名免费的郑州网络推广服务
  • 高端大气装饰公司网站源码 百度网盘怎么搭建属于自己的网站
  • 手机网站无响应免费涨1000粉丝网站
  • 门户类网站建设大约多少钱百度app客服电话
  • 北京的网站建设搜索引擎营销分析
  • java script 做网站买卖链接网
  • 哪个网站可以做空比特币如何优化网站快速排名
  • 网站单页支付宝支付怎么做的廊坊百度推广电话
  • 一个人怎么做网站想做个网络推广
  • wordpress边栏浮动新河seo怎么做整站排名
  • 我国政府门户网站的建设营销推广方案包括哪些内容
  • 中山做百度网站的公司名称seo实战密码第三版
  • 虚拟主机怎么弄网站网站做优化好还是推广好
  • 济南网站制作工作室关键词林俊杰的寓意
  • 低学历吃香的十大职业武汉seo报价
  • 北京建设工程交易服务中心网站seo推广公司哪家好
  • 网站建设阶段的推广企业培训机构排名
  • 哪些公司的网站做的很好网络推广产品公司
  • 方法网站目录关键词搜索量查询
  • 天津企业网站设计制作国产十大erp软件
  • 免费公司网站建设百度2023免费下载
  • 一般网站建设公司有多少客户啊如何自己开个网站平台
  • 鞍山做网站排名网络营销和传统营销的关系
  • 南网站建设 首选搜点网络软文案例500字
  • 学做彩票网站有哪些搜索引擎网页
  • 石家庄58同城最新招聘信息靠谱的seo收费
  • 有什么做兼职的好的网站吗百度seo点击工具
  • 北京门户网站建设公司新品牌推广策划方案
  • 怎样注册商标申请东莞网络优化哪家好
  • 给别人做的网站要复杂做安全扫描最近一周的国内新闻