mirror of
https://github.com/bettercap/bettercap
synced 2025-08-14 02:36:57 -07:00
Some fixes on recon and probing.
This commit is contained in:
parent
0091ffdbb3
commit
6b89145e80
4 changed files with 18 additions and 7 deletions
6
.gitignore
vendored
6
.gitignore
vendored
|
@ -1,3 +1,7 @@
|
|||
*.cap
|
||||
bettercap
|
||||
*.sw*
|
||||
|
||||
core/build.go
|
||||
net/oui_compiled.go
|
||||
bettercap
|
||||
bettercap.history
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
package core
|
||||
const (
|
||||
BuildDate = "2017-11-16 19:24"
|
||||
)
|
|
@ -65,7 +65,7 @@ func (p Prober) OnSessionEnded(s *session.Session) {
|
|||
}
|
||||
}
|
||||
|
||||
func (p *Prober) sendUDP(from net.IP, from_hw net.HardwareAddr, ip net.IP) {
|
||||
func (p *Prober) sendProbe(from net.IP, from_hw net.HardwareAddr, ip net.IP) {
|
||||
name := fmt.Sprintf("%s:137", ip)
|
||||
if addr, err := net.ResolveUDPAddr("udp", name); err != nil {
|
||||
log.Errorf("Could not resolve %s.", name)
|
||||
|
@ -109,7 +109,7 @@ func (p *Prober) Start() error {
|
|||
continue
|
||||
}
|
||||
|
||||
p.sendUDP(from, from_hw, ip)
|
||||
p.sendProbe(from, from_hw, ip)
|
||||
|
||||
if throttle > 0 {
|
||||
time.Sleep(time.Duration(throttle) * time.Millisecond)
|
||||
|
|
|
@ -91,6 +91,17 @@ func (d *Discovery) Start() error {
|
|||
}
|
||||
|
||||
if len(new) > 0 || len(rem) > 0 {
|
||||
n_gw_shared := 0
|
||||
for ip, mac := range new {
|
||||
if ip != d.Session.Gateway.IpAddress && mac == d.Session.Gateway.HwAddress {
|
||||
n_gw_shared++
|
||||
}
|
||||
}
|
||||
|
||||
if n_gw_shared > 0 {
|
||||
log.Warningf("WARNING: %d endpoints share the same MAC of the gateway, there're might be some IP isolation going on.\n", n_gw_shared)
|
||||
}
|
||||
|
||||
// refresh target pool
|
||||
for ip, mac := range new {
|
||||
d.Session.Targets.AddIfNotExist(ip, mac)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue