arp-spoofer: new package
This commit is contained in:
parent
671427649d
commit
58b6a827d0
5 changed files with 150 additions and 1 deletions
26
pkg/arp-spoofer/cmd/main.go
Normal file
26
pkg/arp-spoofer/cmd/main.go
Normal 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)
|
||||
}
|
||||
Reference in a new issue