我正在使用scapy嗅探具有特定源ip/dest ip的IPv6数据包。Scapy中的IPv6过滤器
例子:
filter1 ="tcp port "+`port`+ " and ip6 host 2001::4 and tcp[tcpflags] & tcp-syn !=0 and !icmp and !arp and not host "+host_ip
a= sniff(count =1,filter=filter1,iface=eth)
这会抛出一个异常,如下图所示: scapy.error.Scapy_Exception:过滤解析错误
反引号被用于端口蟒蛇不允许串联地干扰(端口作为一个整数)与字符串,而主机的IP是一个字符串 –