python抓包模块

pcapy模块

安装

yum install -y epel-release

yum install -y pip gcc    gcc-c++   libpcap-devel python-devel

pip install pcapy

import pcapy as pc
reader = pc.open_live("ens9f0", 65536, 1, 2000)
dumper = reader.dump_open('pcapy_test.pcap')

for _ii in range(10):
hdr, pkt = reader.next()
dumper.dump(hdr, pkt)

上一篇:Ubuntu16.04安装Maven3.5.4


下一篇:HDU 6166 Spfa