27 lines
484 B
Go
27 lines
484 B
Go
|
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)
|
||
|
}
|