Merge pull request #171 from peperunas/arptargets

[ARP Spoof] Multiple IPs are now correctly parsed
This commit is contained in:
Simone Margaritelli 2018-03-13 19:04:44 +01:00 committed by GitHub
commit c778032545
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -153,12 +153,11 @@ func (p *ArpSpoofer) parseTargets(targets string) (err error) {
targets = strings.Replace(targets, mac, "", -1) targets = strings.Replace(targets, mac, "", -1)
} }
targets = strings.TrimLeft(targets, ", ") targets = strings.Trim(targets, ", ")
targets = strings.TrimRight(targets, ", ")
log.Debug("Parsing IP range %s", targets) log.Debug("Parsing IP range %s", targets)
if len(p.macs) == 0 || targets != "" { if len(p.macs) == 0 || targets != "" {
list, err := iprange.Parse(targets) list, err := iprange.ParseList(targets)
if err != nil { if err != nil {
return fmt.Errorf("Error while parsing arp.spoof.targets variable '%s': %s.", targets, err) return fmt.Errorf("Error while parsing arp.spoof.targets variable '%s': %s.", targets, err)
} }