[問題] 確認 packet 的 protocol type (學校作業
大神們好
我需要在整個pcap file裡面找出arp packet。 條件是不能讀入library 的 pre-defined structure。
我目前是用 dpkt
import dpkt
f = open("xxx.pcap", "rb")
pcap = dpkt.pcap.reader(f)
for ts, but in pcap:
*
*
*
f.close()
對我什麼都沒有...
找到的資料都大概是
eth=dpkt.Ethernet.ethernet(buf)
ip= eth.data
然後就可以直接找protocol type了
但教授要求最多只能用library iterate thru the pcap file
剩下的要 parse in byte level programing
找完arp之後要print 所有arp header 裡的資料,那個我會再努力想辦法解決... 但我現在連起頭都有障礙
感謝大神們幫忙
知道有點晚了,任何提示都感激不盡!
-----
Sent from JPTT on my iPhone
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 130.245.192.21
※ 文章網址: https://www.ptt.cc/bbs/Python/M.1556548667.A.7B9.html
推
04/30 11:35,
6年前
, 1F
04/30 11:35, 1F
→
04/30 19:29,
6年前
, 2F
04/30 19:29, 2F
→
04/30 19:30,
6年前
, 3F
04/30 19:30, 3F
→
04/30 19:31,
6年前
, 4F
04/30 19:31, 4F
Python 近期熱門文章
PTT數位生活區 即時熱門文章