Parsing pcap files with dpkt (Python)

前端 未结 3 1058
春和景丽
春和景丽 2021-01-05 14:15

I\'m trying to parse a previously-captured trace for HTTP headers using the dpkt module:

import dpkt
import sys

f=file(sys.argv[1],\"rb\")
pcap=dpkt.pcap.R         


        
3条回答
  •  广开言路
    2021-01-05 14:36

    I have encountered the same problem while working with HTTP Requests and dpkt.

    The problem is that the dpkt's HTTP headers parser uses wrong logic. This exception is raised when the HTTP doesn't end with \r\n\r\n. (And as you say, there are a lot of good packets with no \r\n\r\n at the end.)

    Here is the bug report to your problem.

自定义标题
段落格式
字体
字号
代码语言
提交回复
热议问题