mirror of
https://github.com/bettercap/bettercap
synced 2025-08-14 02:36:57 -07:00
fix: every wifi frame injection operation on macOS will print an error (ref #448)
This commit is contained in:
parent
5858743b6e
commit
2499d5147f
3 changed files with 24 additions and 13 deletions
|
@ -5,23 +5,11 @@ import (
|
|||
"fmt"
|
||||
"net"
|
||||
"sort"
|
||||
"time"
|
||||
|
||||
"github.com/bettercap/bettercap/network"
|
||||
"github.com/bettercap/bettercap/packets"
|
||||
)
|
||||
|
||||
func (mod *WiFiModule) injectPacket(data []byte) {
|
||||
if err := mod.handle.WritePacketData(data); err != nil {
|
||||
mod.Error("could not inject WiFi packet: %s", err)
|
||||
mod.Session.Queue.TrackError()
|
||||
} else {
|
||||
mod.Session.Queue.TrackSent(uint64(len(data)))
|
||||
}
|
||||
// let the network card breath a little
|
||||
time.Sleep(10 * time.Millisecond)
|
||||
}
|
||||
|
||||
func (mod *WiFiModule) sendDeauthPacket(ap net.HardwareAddr, client net.HardwareAddr) {
|
||||
for seq := uint16(0); seq < 64 && mod.Running(); seq++ {
|
||||
if err, pkt := packets.NewDot11Deauth(ap, client, ap, seq); err != nil {
|
||||
|
@ -159,4 +147,4 @@ func (mod *WiFiModule) startDeauth(to net.HardwareAddr) error {
|
|||
}()
|
||||
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue