Closed thehijacker closed 1 month ago
I made some changes to the internal/scan/arpscan.go:
-func scanIface(iface string) string {
+func scanIface(iface []string) string {
- cmd, err := exec.Command("arp-scan", "-glNx", "-I", iface).Output()
+ cmd, err := exec.Command("arp-scan", iface...).Output()
if err != nil {
return string("")
}
return string(cmd)
}
// Scan all interfaces
func arpScan(allIfaces string) []models.Host {
var text string
var foundHosts = []models.Host{}
perString := strings.Split(allIfaces, ",")
for _, iface := range perString {
log.Println("INFO: scanning interface", iface)
- text = scanIface(iface)
+ text = scanIface(strings.Split("-gNx " + strings.TrimSpace(iface), " "))
log.Println("INFO: found IPs:", text)
foundHosts = append(foundHosts, parseOutput(text)...)
}
return foundHosts
}
Basically the parameters can be anything and it will pass them as array of parameters. For example:
IFACE=-l -I vmbr0, 10.0.208.0/24 -Q 208 -I vmbr0, 10.0.107.0/24 -Q 107 -I vmbr0
or long syntax
IFACE=-l --interface=vmbr0, 10.0.208.0/24 --vlan=208 --interface=vmbr0, 10.0.107.0/24 --vlan=107 --interface=vmbr0
Using this changes and IFACE parameters, all three of my home networks are scanned. Could this be included in next version? Or possible improved. First time I looked at a go code :)
Next I need to figure out how to put this new binary inside my docker container.
+1 for the feature. Segmented my network into VLANs recently and realized that WatchYourLAN can only see within its subnet...
Just set up an instance myself and noticed there wasnt an option for specifying what subnets to scan. I have a few subnets, based on wifi, homelab, hardwire, guest, iot devices, etc. I dont want to have to run an instance for each.
+1 for this
Multiple subnets/vlans would be wonderful!
Agreed. I just tried this (and the various forks of Pi Alert) trying to find one that would work for my multi-VLAN setup. This feature would be amazing.
This feature would be awsome! sadly im not a dev and cant help :(
I will try to get my head into how to fix that like @thehijacker advertised, maybe you could provide a little guide for non devs?
thx in advance
Done in v2.0.1 - see docs/VLAN_ARP_SCAN.md for a howto.
Looking for alternative to PiAlert. This looks like much simpler version of it with simillar features. But one is missing that I need so I can capture all my subnets. Arp-scan can also scan VLAN subnets with syntax:
arp-scan --ignoredups --retry=6 10.0.107.0/24 -vlan=107 --interface=eth0
Can this vlan parameter be added as well as option to scan multiple subnets?
Thank you.