# -*- coding: utf-8 -*-
"""
Created on Fri Nov 15 20:01:17 2019
about icmppcap extrct
将pcap导出成csv文件
@author: Lmindy
"""
import csv
from scapy.all import *
import pandas as pd
import re
import os
import numpy as np
pkts = rdpcap("icmp.pcap")
i=0
j=0
b=[]
e=[]
for pkt in pkts:
if 'Ethernet' in pkt:
a1=pkt['Ethernet'].dst
a2=pkt['Ethernet'].src
a3=pkt['Ethernet'].type
if 'ICMP' in pkt:
c1=pkt['ICMP'].type
c2=pkt['ICMP'].code
c3=pkt['ICMP'].chksum
c4=pkt['ICMP'].id
c5=pkt['ICMP'].seq
if 'IPv6' in pkt:
b1=pkt['IPv6'].version
b2=pkt['IPv6'].tc
b3=</
python 提取 icmp.pcap 存成CSV
最新推荐文章于 2024-06-23 14:49:24 发布