mirror of
https://github.com/bettercap/bettercap
synced 2025-08-14 02:36:57 -07:00
Implemented a way to not send deauthentication and/or association packets to AP's for which key material was already acquired
This commit is contained in:
parent
8ae28f4b3d
commit
a0a0963cd5
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 {
|
||||
|
@ -110,6 +119,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