mirror of
https://github.com/bettercap/bettercap
synced 2025-07-30 03:29:57 -07:00
fix: made arp.spoof debug logs less verbose when mac addresses can't be resolved (ref #483)
This commit is contained in:
parent
6d4d47a326
commit
c49a57893a
1 changed files with 7 additions and 9 deletions
|
@ -218,20 +218,18 @@ func (mod *ArpSpoofer) getTargets(probe bool) map[string]net.HardwareAddr {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
// do we have this ip mac address?
|
// do we have this ip mac address?
|
||||||
if hw, err := mod.Session.FindMAC(ip, probe); err != nil {
|
if hw, err := mod.Session.FindMAC(ip, probe); err == nil {
|
||||||
mod.Debug("could not find hardware address for %s", ip.String())
|
|
||||||
} else {
|
|
||||||
targets[ip.String()] = hw
|
targets[ip.String()] = hw
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// add targets specified by MAC address
|
// add targets specified by MAC address
|
||||||
for _, hw := range mod.macs {
|
for _, hw := range mod.macs {
|
||||||
if ip, err := network.ArpInverseLookup(mod.Session.Interface.Name(), hw.String(), false); err != nil {
|
if ip, err := network.ArpInverseLookup(mod.Session.Interface.Name(), hw.String(), false); err == nil {
|
||||||
mod.Warning("could not find IP address for %s", hw.String())
|
if mod.Session.Skip(net.ParseIP(ip)) {
|
||||||
} else if mod.Session.Skip(net.ParseIP(ip)) {
|
mod.Debug("skipping address %s from arp spoofing.", ip)
|
||||||
mod.Debug("skipping address %s from arp spoofing.", ip)
|
} else {
|
||||||
} else {
|
targets[ip] = hw
|
||||||
targets[ip] = hw
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue