mirror of
https://github.com/bettercap/bettercap
synced 2025-08-19 13:09:49 -07:00
balls
This commit is contained in:
parent
90b720f1b6
commit
8e5f514d92
1 changed files with 14 additions and 1 deletions
|
@ -138,8 +138,21 @@ func (tp *Targets) Remove(ip, mac string) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (tp *Targets) shouldIgnore(ip string) bool {
|
func (tp *Targets) shouldIgnore(ip string) bool {
|
||||||
|
// skip our own address
|
||||||
|
if ip == tp.Interface.IpAddress {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
// skip the gateway
|
||||||
|
if ip == tp.Gateway.IpAddress {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
// skip broadcast addresses
|
||||||
|
if strings.HasSuffix(ip, ".255") {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
// skip everything which is not in our subnet (multicast noise)
|
||||||
addr := net.ParseIP(ip)
|
addr := net.ParseIP(ip)
|
||||||
return (ip == tp.Interface.IpAddress || ip == tp.Gateway.IpAddress || tp.Session.Interface.Net.Contains(addr) == false)
|
return tp.Session.Interface.Net.Contains(addr) == false
|
||||||
}
|
}
|
||||||
|
|
||||||
func (tp *Targets) Has(ip string) bool {
|
func (tp *Targets) Has(ip string) bool {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue