我想使用 pyshark 捕获数据包。但我无法在 Windows 7 上捕获数据包。
这是我的python代码
import pyshark
def NetCap():
print 'capturing...'
livecapture = pyshark.LiveCapture(interface="eth0", output_file='./test.pcapng')
livecapture.sniff(packet_count=10)
print 'end of capture.'
print livecapture
if __name__ == "__main__":
NetCap()
这是结果
capturing...
end of capture.
<LiveCapture (0 packets)>
实时捕获为 0 个数据包。我不知道怎么回事。请帮我。