Scapy 中的错误 - 忽略静态 ip 邻居 (ARP/NDP) 条目

问题描述 投票:0回答:1

我正在尝试将 IPv6 数据包发送到目标主机上禁用 IPv6 NDP(ARP 对应项)的子网:

  1. 静态指定ipv6邻居(目的主机):
2007::1 dev enp0s8 lladdr 08:00:27:a1:cd:f0 PERMANENT
  1. 运行脚本:
#!/bin/python3

from scapy.all import *
from scapy.contrib.gtp import *

ipv6 = IPv6(src="2007::2",dst="2007::1")
udp = UDP(sport=2152, dport=2152)

while True:
    sendp(Ether()/ipv6/udp/"Hello World!")

预期结果:
根据静态 IP 邻居条目,使用特定的目标 MAC 地址 (

08:00:27:a1:cd:f0
) 发送 Hello-world 数据包。

实际结果:
发送“谁有”NDP 数据包。没有答案后 - 在 Hello-world 数据包中设置广播目标 MAC 地址 (

ff:ff:ff:ff:ff:ff
)。发送 ping 数据包时,有的不发送。

似乎Scapy中有一个bug。

python linux networking ipv6 scapy
1个回答
0
投票

Scapy 不会从操作系统读取 NDP 缓存。您需要在 Scapy 中指定这一点:

conf.netcache.in6_neighbor[ip6] = mac

来自 https://github.com/secdev/scapy/issues/4122

© www.soinside.com 2019 - 2024. All rights reserved.