摘要:
import dpktimport structimport sys,osf=file(sys.argv[1],"rb")pcap=dpkt.pcap.Reader(f)for ts, buf in pcap: eth=dpkt.ethernet.Ethernet(buf) ip=eth.data tcp=ip.data if eth.type == dpkt.ethernet.ETH_TYPE_IP: src_tuple = map(ord, ip.src) print "src ip addr: (%d.%d.%d.%d)" % ((sr... 阅读全文