我正在使用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是一個字符串 –