题目附件给了 modbus.pcap 存在多个协议 但是这道题多半是 考 modbus image.png image.png 会发现 每次的 Query 末尾的两个字符 存在规律 猜测是base家族 可以尝试提取流量中的数据 其中Word Count字段中的22871 是10进制转16进制在转ascii字符串 先提取 过滤器判断字段 tshark -r modbus.pcap -Y "modbus" -T json > 1.json image.png tshark -r modbus.pcap -Y "modbus" -T json -e modbus.word_cnt > 2.json image.png 当作字典正常提取即可 以为部分不存在 modbus.word_cnt字段 image.pngtry-catch 处理 异常空白

import json
import libnum
with open('2.json') as f:
    data = json.load(f)
    a=[]
for i in data:
    try:
        a.append(i['_source']['layers']['modbus.word_cnt'][0])
    except:
        continue
result=b""
for i in a:
    if i != '5':
        result+=libnum.n2s(int(i))
print(result)

image.png 得到数据 MMYWMX3GNEYWOXZRGAYDA=== image.png 解密后是base32编码 c1f_fi1g_1000 NSSCTF{c1f_fi1g_1000}