mirror of
https://github.com/bettercap/bettercap
synced 2025-08-20 13:33:21 -07:00
Merge pull request #703 from FrankSpierings/skipacquired
Prevent deauth/assoc for AP's that have already been captured
This commit is contained in:
commit
e3846cf416
3 changed files with 34 additions and 0 deletions
|
@ -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)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue