Merge pull request #703 from FrankSpierings/skipacquired

Prevent deauth/assoc for AP's that have already been captured
This commit is contained in:
Simone Margaritelli 2020-07-03 14:26:17 +02:00 committed by GitHub
commit e3846cf416
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 34 additions and 0 deletions

View file

@ -51,6 +51,15 @@ func (mod *WiFiModule) doAssocOpen() bool {
return mod.assocOpen
}
func (mod *WiFiModule) doAssocAcquired() bool {
if err, is := mod.BoolParam("wifi.assoc.acquired"); err != nil {
mod.Warning("%v", err)
} else {
mod.assocAcquired = is
}
return mod.assocAcquired
}
func (mod *WiFiModule) startAssoc(to net.HardwareAddr) error {
// parse skip list
if err, assocSkip := mod.StringParam("wifi.assoc.skip"); err != nil {
@ -109,6 +118,8 @@ func (mod *WiFiModule) startAssoc(to net.HardwareAddr) error {
if ap.IsOpen() && !mod.doAssocOpen() {
mod.Debug("skipping association for open network %s (wifi.assoc.open is false)", ap.ESSID())
} else if ap.HasKeyMaterial() && !mod.doAssocAcquired() {
mod.Debug("skipping association for AP %s (key material already acquired)", ap.ESSID())
} else {
logger("sending association request to AP %s (channel:%d encryption:%s)", ap.ESSID(), ap.Channel, ap.Encryption)