强网杯2023 谍影重重2.0 wp

发布时间 2023-12-21 16:55:48作者: Smera1d0

题目描述

小明是某间谍组织的一员,他终日监听着我国某重点军事基地的飞行动态,妄图通过分析参数找到我国飞的最快的飞机。我国费尽千辛万苦抓住了他,并在他的电脑上找到了一段他监听的信息,请分析出这段信息中飞的最快的飞机。
格式为flag{md5(ICAO CODE of the fastest plane)}

附件内所涉及的信息均为公开信息,题目描述也均为虚构,切勿当真

1.首先我们使用tshark - r 文件名打印流量信息

image.png

发现都是tcp协议的流量

2.然后我们用tshark导出流量

命令:tshark -r '/home/kali/桌面/attach.pcapng' -Y "tcp" -T fields -e tcp.segment_data > tcp.txt

tshark -r [流量包文件] -Y "tcp" -T fields -e tcp.segment_data > [导出的文件名]

3.分析该流量

image.png

结合题干中的“飞得最快的飞机”,发现ADS-B流量最符合题目描述

然后去GitHub上搜索一波,发现了pyModeS库可以解析ADS-B流量

image.png

导出的tcp流量都含有相同的头,我们尝试将相同的头去掉,再用pyModeS进行解析

import pyModeS
with open(r"D:\qq文件\qwb2023\qwb2023\misc\谍影重重2.0\tcp.txt",'r')as f:
    lines = f.readlines()

for i in lines:
    print(len(i))
    print(pyModeS.decoder.tell(i[18:]))

发现只有i长度为47时才有正确的信息输出,于是我们增加限制条件,将len(i)==47的输出

import pyModeS
with open(r"D:\qq文件\qwb2023\qwb2023\misc\谍影重重2.0\tcp.txt",'r')as f:
    lines = f.readlines()

for i in lines:
    if len(i)==47:
        print(pyModeS.decoder.tell(i[18:]))

然后筛选解码信息中的Speed

with open(r"D:\qq文件\qwb2023\qwb2023\misc\谍影重重2.0\message.txt",'r',encoding='utf-8', errors='ignore') as file:
    for line_number, line in enumerate(file, 1):
        if 'Speed' in line:
            print( line.strip())

得到:

Speed: 163 knots
Speed: 160 knots
Speed: 159 knots
Speed: 156 knots
Speed: 156 knots
Speed: 154 knots
Speed: 154 knots
Speed: 150 knots
Speed: 150 knots
Speed: 160 knots
Speed: 160 knots
Speed: 153 knots
Speed: 152 knots
Speed: 152 knots
Speed: 152 knots
Speed: 151 knots
Speed: 151 knots
Speed: 151 knots
Speed: 151 knots
Speed: 150 knots
Speed: 150 knots
Speed: 150 knots
Speed: 150 knots
Speed: 150 knots
Speed: 149 knots
Speed: 149 knots
Speed: 149 knots
Speed: 149 knots
Speed: 148 knots
Speed: 148 knots
Speed: 148 knots
Speed: 148 knots
Speed: 148 knots
Speed: 147 knots
Speed: 145 knots
Speed: 145 knots
Speed: 144 knots
Speed: 143 knots
Speed: 143 knots
Speed: 142 knots
Speed: 371 knots

371是最快的飞机
image.png

再把ICAO address MD5一下就得到了flag,后来发现这个并不对,要把ICAO address先大写再MD5后得到:flag{4cf6729b9bc05686a79c1620b0b1967b}