mirror of
https://github.com/bettercap/bettercap
synced 2025-08-19 13:09:49 -07:00
fix: using active udp probes if arp.spoof fails to resolve an IP to its MAC
This commit is contained in:
parent
64af0c4290
commit
da2d837dfb
2 changed files with 22928 additions and 22929 deletions
|
@ -120,7 +120,7 @@ func (p *ArpSpoofer) Start() error {
|
||||||
defer p.waitGroup.Done()
|
defer p.waitGroup.Done()
|
||||||
|
|
||||||
for p.Running() {
|
for p.Running() {
|
||||||
p.sendArp(from, from_hw, true, false)
|
p.sendArp(from, from_hw, true, true)
|
||||||
time.Sleep(1 * time.Second)
|
time.Sleep(1 * time.Second)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -166,7 +166,7 @@ func (p *ArpSpoofer) sendArp(saddr net.IP, smac net.HardwareAddr, check_running
|
||||||
// do we have this ip mac address?
|
// do we have this ip mac address?
|
||||||
hw, err := findMAC(p.Session, ip, probe)
|
hw, err := findMAC(p.Session, ip, probe)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Debug("Error while looking up hardware address for %s: %s", ip.String(), err)
|
log.Warning("Could not find hardware address for %s, retrying in one second.", ip.String())
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -176,7 +176,7 @@ func (p *ArpSpoofer) sendArp(saddr net.IP, smac net.HardwareAddr, check_running
|
||||||
for _, hw := range p.macs {
|
for _, hw := range p.macs {
|
||||||
ip, err := network.ArpInverseLookup(p.Session.Interface.Name(), hw.String(), false)
|
ip, err := network.ArpInverseLookup(p.Session.Interface.Name(), hw.String(), false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Debug("Error while looking up ip address for %s: %s", hw.String(), err)
|
log.Warning("Could not find IP address for %s, retrying in one second.", hw.String())
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
var oui = map[string]string {
|
var oui = map[string]string{
|
||||||
"681605": "Systems And Electronic Development Fzco",
|
"681605": "Systems And Electronic Development Fzco",
|
||||||
"74dbd1": "Ebay",
|
"74dbd1": "Ebay",
|
||||||
"000099": "MTX",
|
"000099": "MTX",
|
||||||
|
@ -22931,7 +22931,6 @@ var oui = map[string]string {
|
||||||
"784b87": "Murata Manufacturing Co.",
|
"784b87": "Murata Manufacturing Co.",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
func OuiLookup(mac string) string {
|
func OuiLookup(mac string) string {
|
||||||
octects := strings.Split(mac, ":")
|
octects := strings.Split(mac, ":")
|
||||||
if len(octects) > 3 {
|
if len(octects) > 3 {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue