mirror of
https://github.com/bettercap/bettercap
synced 2025-08-20 13:33:21 -07:00
fix: fixed a bug in arp.spoof that caused targets not to be spoofed if not previously known to the attacker computer in terms of Mac address
This commit is contained in:
parent
badd13181d
commit
0e2fd008e4
1 changed files with 44 additions and 40 deletions
|
@ -175,7 +175,7 @@ func (mod *ArpSpoofer) Start() error {
|
||||||
gwIP := mod.Session.Gateway.IP
|
gwIP := mod.Session.Gateway.IP
|
||||||
myMAC := mod.Session.Interface.HW
|
myMAC := mod.Session.Interface.HW
|
||||||
for mod.Running() {
|
for mod.Running() {
|
||||||
mod.arpSpoofTargets(gwIP, myMAC, true, false)
|
mod.arpSpoofTargets(gwIP, myMAC, true, true)
|
||||||
for _, address := range neighbours {
|
for _, address := range neighbours {
|
||||||
if !mod.Session.Skip(address) {
|
if !mod.Session.Skip(address) {
|
||||||
mod.arpSpoofTargets(address, myMAC, true, false)
|
mod.arpSpoofTargets(address, myMAC, true, false)
|
||||||
|
@ -281,7 +281,10 @@ func (mod *ArpSpoofer) arpSpoofTargets(saddr net.IP, smac net.HardwareAddr, chec
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for ip, mac := range mod.getTargets(probe) {
|
if targets := mod.getTargets(probe); len(targets) == 0 {
|
||||||
|
mod.Warning("could not find spoof targets")
|
||||||
|
} else {
|
||||||
|
for ip, mac := range targets {
|
||||||
if check_running && !mod.Running() {
|
if check_running && !mod.Running() {
|
||||||
return
|
return
|
||||||
} else if mod.isWhitelisted(ip, mac) {
|
} else if mod.isWhitelisted(ip, mac) {
|
||||||
|
@ -327,3 +330,4 @@ func (mod *ArpSpoofer) arpSpoofTargets(saddr net.IP, smac net.HardwareAddr, chec
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue