Benutzer-Werkzeuge

Webseiten-Werkzeuge


ne:scapy_read_write_pcap

read packets

rdpcap(filename, count=-1 )

reads a pcap file and returns the list of read packets. If count is positive, only the first count packets are read.

rdpcap("ike.cap")
<ike.cap: UDP:45 TCP:0 ICMP:0 Other:0>
rdpcap("ike.cap", count=10)
<ike.cap: UDP:10 TCP:0 ICMP:0 Other:0>

write packets

wrpcap(filename, pkt, linktype=None)

Write a packet or list of packets to a pcap file. linktype can be used to force the link type value written into the file.

wrpcap("my.cap", packet-list)

Quelle

ne/scapy_read_write_pcap.txt · Zuletzt geändert: 2019/01/16 14:44 von admin