mirror of
https://github.com/bettercap/bettercap
synced 2025-08-20 21:43:18 -07:00
fix: collect additional frames for stations with key material (ref #810)
This commit is contained in:
parent
c68c88030d
commit
cea53b969e
3 changed files with 73 additions and 1 deletions
|
@ -245,7 +245,7 @@ func (w *WiFi) SaveHandshakesTo(fileName string, linkType layers.LinkType) error
|
|||
for _, ap := range w.aps {
|
||||
for _, station := range ap.Clients() {
|
||||
// if half (which includes also complete) or has pmkid
|
||||
if station.Handshake.Half() || station.Handshake.HasPMKID() {
|
||||
if station.Handshake.Any() {
|
||||
err = nil
|
||||
station.Handshake.EachUnsavedPacket(func(pkt gopacket.Packet) {
|
||||
if err == nil {
|
||||
|
|
|
@ -79,6 +79,12 @@ func (h *Handshake) AddFrame(n int, pkt gopacket.Packet) {
|
|||
h.unsaved = append(h.unsaved, pkt)
|
||||
}
|
||||
|
||||
func (h *Handshake) AddExtra(pkt gopacket.Packet) {
|
||||
h.Lock()
|
||||
defer h.Unlock()
|
||||
h.unsaved = append(h.unsaved, pkt)
|
||||
}
|
||||
|
||||
func (h *Handshake) Complete() bool {
|
||||
h.RLock()
|
||||
defer h.RUnlock()
|
||||
|
@ -115,6 +121,10 @@ func (h *Handshake) HasPMKID() bool {
|
|||
return h.hasPMKID
|
||||
}
|
||||
|
||||
func (h *Handshake) Any() bool {
|
||||
return h.HasPMKID() || h.Half() || h.Complete()
|
||||
}
|
||||
|
||||
func (h *Handshake) NumUnsaved() int {
|
||||
h.RLock()
|
||||
defer h.RUnlock()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue