arp-spoofer: new package

This commit is contained in:
nemunaire 2021-02-18 03:14:39 +01:00
commit 58b6a827d0
5 changed files with 150 additions and 1 deletions

View file

@ -0,0 +1,26 @@
package main
import (
"flag"
"log"
"net"
)
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 := net.ParseIP(*ipspoof)
if ipS == nil {
log.Fatal("No IP given to ARP spoof. Skipping it")
}
// Start ARP spoofing
ARPSpoof(iface, ipS)
}