fix: made wifi.deauth asynchronous

This commit is contained in:
evilsocket 2019-01-18 16:06:24 +01:00
commit 41084bec39
No known key found for this signature in database
GPG key ID: 1564D7F30393A456

View file

@ -51,9 +51,6 @@ func (w *WiFiModule) startDeauth(to net.HardwareAddr) error {
defer w.handle.Close() defer w.handle.Close()
} }
w.writes.Add(1)
defer w.writes.Done()
type flow struct { type flow struct {
Ap *network.AccessPoint Ap *network.AccessPoint
Client *network.Station Client *network.Station
@ -71,9 +68,13 @@ func (w *WiFiModule) startDeauth(to net.HardwareAddr) error {
} }
if len(toDeauth) == 0 { if len(toDeauth) == 0 {
return fmt.Errorf("%s is an unknown BSSID or doesn't have detected clients.", to.String()) return fmt.Errorf("%s is an unknown BSSID, is in the deauth skip list, or doesn't have detected clients.", to.String())
} }
go func() {
w.writes.Add(1)
defer w.writes.Done()
// since we need to change the wifi adapter channel for each // since we need to change the wifi adapter channel for each
// deauth packet, let's sort by channel so we do the minimum // deauth packet, let's sort by channel so we do the minimum
// amount of hops possible // amount of hops possible
@ -92,6 +93,7 @@ func (w *WiFiModule) startDeauth(to net.HardwareAddr) error {
}) })
} }
} }
}()
return nil return nil
} }