new: experimental ipv6 ndp spoofer (closes #851)

This commit is contained in:
Simone Margaritelli 2021-04-03 22:55:03 +02:00
parent cbc1432358
commit 57436a811c
8 changed files with 256 additions and 13 deletions

View file

@ -305,7 +305,7 @@ func (s *Session) Start() error {
func (s *Session) Skip(ip net.IP) bool {
if ip.IsLoopback() {
return true
} else if ip.Equal(s.Interface.IP) {
} else if ip.Equal(s.Interface.IP) || ip.Equal(s.Interface.IPv6){
return true
} else if ip.Equal(s.Gateway.IP) {
return true
@ -324,6 +324,10 @@ func (s *Session) FindMAC(ip net.IP, probe bool) (net.HardwareAddr, error) {
from := s.Interface.IP
from_hw := s.Interface.HW
if ip.To4() == nil {
from = s.Interface.IPv6
}
if err, probe := packets.NewUDPProbe(from, from_hw, ip, 139); err != nil {
log.Error("Error while creating UDP probe packet for %s: %s", ip.String(), err)
} else {