mirror of
https://github.com/bettercap/bettercap
synced 2025-08-14 02:36:57 -07:00
misc: small fix or general refactoring i did not bother commenting
This commit is contained in:
parent
0fad2ad21c
commit
f6bc120a75
1 changed files with 0 additions and 22 deletions
|
@ -125,28 +125,6 @@ func (p *ArpSpoofer) sendArp(saddr net.IP, smac net.HardwareAddr, check_running
|
|||
log.Debug("Sending %d bytes of ARP packet to %s:%s.", len(pkt), ip.String(), hw.String())
|
||||
p.Session.Queue.Send(pkt)
|
||||
}
|
||||
|
||||
// full duplex since we need to route packets
|
||||
// in user land as netsh is dumb
|
||||
if runtime.GOOS == "windows" {
|
||||
// restoring
|
||||
if bytes.Compare(smac, p.Session.Gateway.HW) == 0 {
|
||||
if err, pkt := packets.NewARPReply(ip, hw, p.Session.Gateway.IP, p.Session.Gateway.HW); err != nil {
|
||||
log.Error("Error while creating ARP spoof packet for %s: %s", ip.String(), err)
|
||||
} else {
|
||||
log.Debug("Sending %d bytes of ARP packet to %s:%s.", len(pkt), ip.String(), hw.String())
|
||||
p.Session.Queue.Send(pkt)
|
||||
}
|
||||
|
||||
} else {
|
||||
if err, pkt := packets.NewARPReply(ip, smac, p.Session.Gateway.IP, p.Session.Gateway.HW); err != nil {
|
||||
log.Error("Error while creating ARP spoof packet for %s: %s", ip.String(), err)
|
||||
} else {
|
||||
log.Info("Sending %d bytes of ARP packet to %s:%s.", len(pkt), ip.String(), hw.String())
|
||||
p.Session.Queue.Send(pkt)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue