Anastasia
Anastasia

Reputation: 21

Bug in Scapy - ignoring static ip neighbour (ARP/NDP) entry

I'm trying to send IPv6 packet to subnet where IPv6 NDP(ARP counterpart) is disabled on destination host:

  1. Statically specify the ipv6 neighbor (destination host):
2007::1 dev enp0s8 lladdr 08:00:27:a1:cd:f0 PERMANENT
  1. Run the script:
#!/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!")

Expected Result:
Hello-world packet is sent with specific dst MAC-address (08:00:27:a1:cd:f0) according to static ip neighbour entry.

Actual result:
“Who has” NDP-packets are sent. After having no answer - broadcast dst MAC-address (ff:ff:ff:ff:ff:ff) is set in Hello-world packet. When sending ping packets who has are not sent.

Seem that there is a bug in Scapy.

Upvotes: 1

Views: 132

Answers (1)

red0ct
red0ct

Reputation: 5055

For some reason Scapy doesn't read the NDP cache from the OS. You can specify MAC within Scapy with:

conf.netcache.in6_neighbor['2007::1'] = '08:00:27:a1:cd:f0'

or with

eth = Ether(dst="08:00:27:a1:cd:f0")

Upvotes: 0

Related Questions