xxxx18一60岁hd中国/日韩女同互慰一区二区/西西人体扒开双腿无遮挡/日韩欧美黄色一级片 - 色护士精品影院www

  • 大小: 4.11KB
    文件類型: .py
    金幣: 1
    下載: 0 次
    發(fā)布日期: 2021-03-26
  • 語(yǔ)言: 其他
  • 標(biāo)簽: 其他??

資源簡(jiǎn)介


本代碼能對(duì)抓包工具抓下來(lái)的pcap包各個(gè)字段進(jìn)行精確的解析,包括文件頭,報(bào)文頭,協(xié)議頭,數(shù)據(jù)內(nèi)容等的解析。。

資源截圖

代碼片段和文件信息

#!/usr/bin/env?python
#?coding:?utf-8
‘‘‘
Created?on?2016年8月3日

@author:?dxl
‘‘‘

import?dpkt
import?os
import?socket
import?struct
#from?autotest.configure?import?filepath

tcp_or_udp?={}
tcp_or_udp[6]?=?‘tcp‘
tcp_or_udp[17]?=?‘udp‘
tcp_or_udp[1]?=?‘icmp‘
tcp_or_udp[2]?=?‘igmp‘

def?parseRadius(filepath):
????fpcap?=?open(filepath‘rb‘)
????source_pcap_name?=?os.path.basename(filepath).split(‘.‘)[0]
????string_data?=?fpcap.read()
????print?len(string_data)
????#pcap文件包頭解析
????pcap_header?=?{}
????pcap_header[‘magic_number‘]?=?string_data[0:4]
????pcap_header[‘version_major‘]?=?string_data[4:6]
????pcap_header[‘version_minor‘]?=?string_data[6:8]
????pcap_header[‘thiszone‘]?=?string_data[8:12]
????pcap_header[‘sigfigs‘]?=?string_data[12:16]
????pcap_header[‘snaplen‘]?=?string_data[16:20]
????pcap_header[‘linktype‘]?=?string_data[20:24]

????#pcap頭部長(zhǎng)度?24字節(jié)????
????pcap_header_str?=?string_data[:24]
????print?pcap_header_str
????
????#pcap文件的數(shù)據(jù)包解析
?

評(píng)論

共有 條評(píng)論