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

202312_Dest0g3_StrageTraiffic

Tags:流量分析,Modbus,pyshark

0x00. 题目

Dest0g3迎新赛

附件路径:https://pan.baidu.com/s/1GyH7kitkMYywGC9YJeQLJA?pwd=Zmxh#list/path=/CTF附件

附件名称:202312_Dest0g3_StrageTraiffic.zip

0x01. WP

1. 浏览流量请求,定位数据存放位置

(modbus) && (ip.src == 192.168.219.139)

image

2. 编写exp.py抽取数据

import pyshark
import base64strTsharkPath = "D:\\=Green=\\Wireshark\\App\\Wireshark\\"
strCapPath = ".\\StrangeTraffic.pcapng"# 根据wireshark过滤表达式筛选有效数据帧
filter_slow = 'modbus && ip.src == 192.168.219.139'
sDT=""
sTmp="" 
# 第一次读取:找到高延迟的响应包,记录对应的请求帧号
with pyshark.FileCapture(strCapPath, display_filter=filter_slow, tshark_path=strTsharkPath) as cap:for pkt in cap:print(f"\rProcessing frame: {pkt.number} ", end="")# print(pkt.tcp.payload)# 01:17:00:00:00:17:01:03:14:00:49:00:31:00:4e:00:7a:00:45:00:77:00:4f:00:45:00:4a:00:39# 截取有效TCP数据,根据显示数据从30位开始 tmpDT=pkt.tcp.payload[30:]# 初始有效数据帧为'ABCDEFGHIJ'if len(sDT)==0:sDT=tmpDTprint(sDT)# 为保证效率,仅当所有字符位都刷新后再读取数据if tmpDT[-2:] != sDT[-2:]:sDT=tmpDT# print(sDT)lstDT = sDT.split(":")for dt in lstDT:# 抛弃无效00数据if dt=="00":continue# 将有效十六进制字符转为字符串并进行拼接else:sTmp += bytes.fromhex(dt).decode("utf-8")# 替换初始帧和结束帧
sTmp=sTmp.replace('ABCDEFGHIJ','')
print("\n")
print(sTmp)
# RGVzdDBnM3szMUE1QkVBNi1GMjBELUYxOEEtRThFQS0yOUI0RjI1NzEwOEJ9# Base64转码获得flag
print(base64.b64decode(sTmp).decode("utf-8"))# Dest0g3{31A5BEA6-F20D-F18A-E8EA-29B4F257108B}
http://www.zskr.cn/news/9405.html

相关文章:

  • 【前端高频面试题】- React篇 - 指南
  • PDF24 Creator(完全免费多功能PDF工具箱) 易于使用 多语言支持 - 教程
  • 彩笔运维勇闯机器学习--lasso回归
  • IP地址的配置
  • vscode彻底删除安装过的插件和个人配置信息
  • 冰箱 EMC 测试中 RE 超标?近场探头定位干扰源实操指南
  • Codeforces Round 1052 (Div. 2) E. Yet Another MEX Problem
  • 9.21 判断推理 6/10
  • pc.vivo.com vivo办公套件网页,拼图验证失败的原因
  • J-link RTT 助手,串口助手,数据可视化,波形图显示,多多盒子
  • 第五届电子信息工程与计算机技术国际学术会议(EIECT 2025)
  • 2025年污染治理与可持续发展国际学术会议(PGSD 2025)
  • 深入解析:对比:ClickHouse/MySQL/Apache Doris
  • 深入解析:2025-09-05 CSS3——盒子模型
  • JDK 25 正式发布,长期支持
  • linux驱动制作
  • Android普通应用切到后台后,多长时间会被系统回收 - 教程
  • 2025.9.22——1橙
  • huggingface.co 无法访问
  • 【GitHub每日速递 250922】开源 AI 搜索引擎 Perplexica:本地大模型 + 多模式搜索,免费又强大!
  • 大厂是怎么识别“高潜员工”的?
  • Day05-1-C:\Users\Lenovo\Desktop\note\code\JavaSE\Basic\src\com\David\scanner-Demo01~05(简易计算器)
  • Day05-C:\Users\Lenovo\Desktop\note\code\JavaSE\Basic\src\com\David\struct-ifDemo01~03+shunxuDemo
  • Codeforces Round 1052 (Div. 2)
  • PatternMatcher-Pytorch
  • uboot启动流程
  • 内存泄漏
  • Context Engineering
  • github/网盘/公众号信息收集
  • AtCoder Regular Contest 206 (Div. 2) 部分题解