Go网络编程练习
基于Go Scan项目,修改代码以适配在windows上运行.
- Scan the whole IPv4 address space
- Scan your local network with ARP packets
- Display the IP address, MAC address,
hostnameand vendor associated Using SMB(Windows devices) and mDNS(Apple devices) to detect hostname
handle.SetBPFFilter("arp or rarp")
在windows下失效,使用过滤器后无法接收到包.handle, err := pcap.OpenLive(pcapName, 1024, false, 20*time.Second)
网卡打开名称在windows下需要修改.
# install dependencies
$ go mod tidy
# build
$ go build
# or run
$ go run .