This repository has been archived on 2024-03-03. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
adlin/pkg/arp-spoofer/cmd/main.go
Pierre-Olivier Mercier 4cf006c4f8
All checks were successful
continuous-integration/drone/push Build is passing
arp-spoofer: Use netip package
2023-02-19 23:33:26 +01:00

27 lines
525 B
Go

package main
import (
"flag"
"log"
"net"
"net/netip"
)
func main() {
var ifacestr = flag.String("iface", "eth0", "Interface to use")
var ipspoof = flag.String("ip-spoof", "", "IP to ARP spoof")
flag.Parse()
iface, err := net.InterfaceByName(*ifacestr)
if err != nil {
log.Fatal("Unable to find interface to do ARP spoof:", err)
}
ipS, err := netip.ParseAddr(*ipspoof)
if err != nil {
log.Fatalf("No IP given to ARP spoof (%s). Skipping it", err.Error())
}
// Start ARP spoofing
ARPSpoof(iface, ipS)
}