mirror of
https://github.com/bettercap/bettercap
synced 2025-07-08 05:51:37 -07:00
misc: small fix or general refactoring i did not bother commenting
This commit is contained in:
parent
9a3c252c4f
commit
b7f4a3024b
1 changed files with 5 additions and 4 deletions
|
@ -37,8 +37,9 @@ func (mod *WiFiModule) discoverHandshakes(radiotap *layers.RadioTap, dot11 *laye
|
||||||
// in order to have a consistent association of AP, client and handshakes.
|
// in order to have a consistent association of AP, client and handshakes.
|
||||||
staIsUs := bytes.Equal(staMac, mod.iface.HW)
|
staIsUs := bytes.Equal(staMac, mod.iface.HW)
|
||||||
station, found := ap.Get(staMac.String())
|
station, found := ap.Get(staMac.String())
|
||||||
|
staAdded := false
|
||||||
if !found {
|
if !found {
|
||||||
station, _ = ap.AddClientIfNew(staMac.String(), ap.Frequency, ap.RSSI)
|
station, staAdded = ap.AddClientIfNew(staMac.String(), ap.Frequency, ap.RSSI)
|
||||||
}
|
}
|
||||||
|
|
||||||
rawPMKID := []byte(nil)
|
rawPMKID := []byte(nil)
|
||||||
|
@ -100,10 +101,10 @@ func (mod *WiFiModule) discoverHandshakes(radiotap *layers.RadioTap, dot11 *laye
|
||||||
// is persisted even after stations are pruned due to inactivity
|
// is persisted even after stations are pruned due to inactivity
|
||||||
ap.WithKeyMaterial(true)
|
ap.WithKeyMaterial(true)
|
||||||
}
|
}
|
||||||
|
// if we're only collecting handshakes from history or if we
|
||||||
// if we added ourselves as a client station but we didn't get any
|
// added ourselves as a client station but we didn't get any
|
||||||
// PMKID, just remove it from the list of clients of this AP.
|
// PMKID, just remove it from the list of clients of this AP.
|
||||||
if staIsUs && rawPMKID == nil {
|
if (readOnly && staAdded) || (staIsUs && rawPMKID == nil) {
|
||||||
ap.RemoveClient(staMac.String())
|
ap.RemoveClient(staMac.String())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue