mirror of
https://github.com/bettercap/bettercap
synced 2025-08-21 05:53:20 -07:00
new: implemented wifi.deauth.skip variable (closes #375)
This commit is contained in:
parent
41084bec39
commit
ca734335fa
3 changed files with 50 additions and 1 deletions
|
@ -68,6 +68,26 @@ func NormalizeMac(mac string) string {
|
|||
return strings.ToLower(strings.Join(parts, ":"))
|
||||
}
|
||||
|
||||
func ParseMACs(targets string) (macs []net.HardwareAddr, err error) {
|
||||
macs = make([]net.HardwareAddr, 0)
|
||||
if targets = str.Trim(targets); targets == "" {
|
||||
return
|
||||
}
|
||||
|
||||
for _, mac := range macParser.FindAllString(targets, -1) {
|
||||
mac = NormalizeMac(mac)
|
||||
hw, err := net.ParseMAC(mac)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Error while parsing MAC '%s': %s", mac, err)
|
||||
}
|
||||
|
||||
macs = append(macs, hw)
|
||||
targets = strings.Replace(targets, mac, "", -1)
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
func ParseTargets(targets string, aliasMap *data.UnsortedKV) (ips []net.IP, macs []net.HardwareAddr, err error) {
|
||||
ips = make([]net.IP, 0)
|
||||
macs = make([]net.HardwareAddr, 0)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue