This is the code:
package main
import (
"fmt"
"github.com/google/gopacket"
"github.com/google/gopacket/pcap"
)
func main() {
handle, err := pcap.OpenLive("\\Device\\NPF_{d6194530-0e27-4c84-b489-2cfe18d4af24}", 65536, true, pcap.BlockForever)
if err != nil {
fmt.Println(err)
}
defer handle.Close()
packets := gopacket.NewPacketSource(handle, handle.LinkType())
for packet := range packets.Packets() {
fmt.Println(packet)
}
}
I have a computer with network card monitoring enabled and windows, with wireshark or scapy (with monitor = True) I can sniff packets, but not with gopacket. I start to enable monitor mode with "wlanhelper "Wi-Fi" mode monitor" and it returns "Success", when I run the code there is no error whatsoever. Sniffing only works when I'm not in monitor mode or I'm sniffing the loopback. Apparently there is no function to enable monitor mode on gopacket like scapy, i don't know. help me pls
get me the solution for enable monitor mode in gopacket (windows)