creating a pcap file using python

前端 未结 3 2075
忘掉有多难
忘掉有多难 2020-12-20 06:41

I\'m trying to create a very simple PCAP file (1 UDP message).
Tried using dpkt (pcap.Writer), no luck, and the documentation is scarce.
Can anyone post a working ex

3条回答
  •  孤城傲影
    2020-12-20 07:10

    construct's cap (broken link) shows how to use construct for this. Construct also has a rudimentary ip stack (broken link) example. The nice thing about Construct is that it is symmetrical, i.e. you can put data into it, convert it to a set of Python objects and you can then dump out the objects to create the original data blob again.

提交回复
热议问题