zoukankan      html  css  js  c++  java
  • Misc_pcap_ping

    1 题目分析

    给了一个 pcap 包,文件名是 MISC_ping,用 wireshark 打开。
    由于文件名指出是 ping,所以直接过滤 ICMP 协议。观察一下,数据部分都是字母,但没什么规律。
    注意到每条报文的长度两两重复,大概扫了一眼,基本都是 32 - 127 的可打印字符,所以应该是把所有长度取出来再分析。

    image

    2 脚本编写

    利用 python 的 dpkt 库取出报文长度,相同的只取一个

    import dpkt
    import os
    
    
    def main():
        curpath = os.path.dirname(os.path.realpath(__file__))
        p = "4.pcapng"
        p = os.path.join(curpath, p)
        f = open(p, 'rb')
    
        index = 0
        res_arr = []
    
        try:
            pcap = dpkt.pcap.Reader(f)
        except Exception as e:
            f.seek(0, 0)
            pcap = dpkt.pcapng.Reader(f)
    
        for timestamp, buf in pcap:
            index += 1
            eth = dpkt.ethernet.Ethernet(buf)
    
            if not isinstance(eth.data, dpkt.ip.IP):
                print('Non IP Packet type not supported %s
    ' % eth.data.__class__.__name__)
                continue
    
            ip = eth.data
    
            if isinstance(ip.data, dpkt.icmp.ICMP) and index % 2 == 0:
                res_arr.append(len(eth))
    
        print(res_arr)
    
        res_str = ""
        for item in res_arr:
            res_str += chr(item)
    
        print(res_str)
    
    if __name__ == "__main__":
        main()
    

    得到一个字符串:zMXHz3TIDdCYm284BhaYmdL1AxD9,看着像 BaseX 编码,试了一遍 Base64/32/84。。。,统统不行。

    尝试变化大小写,print(res_str.swapcase()),再用 Base 解码,Base64 解码可以得到 flag。

    Over。

  • 相关阅读:
    Y+的一些讨论
    MATLAB中FFT的使用方法
    插入排序、冒泡排序、选择排序——转载
    输出控制中时间延迟的几种方法
    模拟通信调制方式与通信设备
    模拟通信主要特点
    模拟通信数字信号
    模拟通信
    传真存储变换设备与入网方式
    静止图像通信
  • 原文地址:https://www.cnblogs.com/ainsliaea/p/15228996.html
Copyright © 2011-2022 走看看