mirror of
https://github.com/bettercap/bettercap
synced 2025-08-19 13:09:49 -07:00
fix: fixed wifi.client.handshake event json serialization
This commit is contained in:
parent
242f4cfece
commit
73710ba7d3
3 changed files with 10 additions and 12 deletions
|
@ -69,11 +69,11 @@ func (mod *EventsStream) viewWiFiClientProbeEvent(e session.Event) {
|
||||||
func (mod *EventsStream) viewWiFiHandshakeEvent(e session.Event) {
|
func (mod *EventsStream) viewWiFiHandshakeEvent(e session.Event) {
|
||||||
hand := e.Data.(wifi.HandshakeEvent)
|
hand := e.Data.(wifi.HandshakeEvent)
|
||||||
|
|
||||||
from := hand.Station.String()
|
from := hand.Station
|
||||||
to := hand.AP.String()
|
to := hand.AP
|
||||||
what := "handshake"
|
what := "handshake"
|
||||||
|
|
||||||
if ap, found := mod.Session.WiFi.Get(hand.AP.String()); found {
|
if ap, found := mod.Session.WiFi.Get(hand.AP); found {
|
||||||
to = fmt.Sprintf("%s (%s)", tui.Bold(ap.ESSID()), tui.Dim(ap.BSSID()))
|
to = fmt.Sprintf("%s (%s)", tui.Bold(ap.ESSID()), tui.Dim(ap.BSSID()))
|
||||||
what = fmt.Sprintf("%s handshake", ap.Encryption)
|
what = fmt.Sprintf("%s handshake", ap.Encryption)
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
package wifi
|
package wifi
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"net"
|
|
||||||
|
|
||||||
"github.com/bettercap/bettercap/network"
|
"github.com/bettercap/bettercap/network"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -20,9 +18,9 @@ type ProbeEvent struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
type HandshakeEvent struct {
|
type HandshakeEvent struct {
|
||||||
File string
|
File string `json:"file"`
|
||||||
NewPackets int
|
NewPackets int `json:"new_packets"`
|
||||||
AP net.HardwareAddr
|
AP string `json:"ap"`
|
||||||
Station net.HardwareAddr
|
Station string `json:"station"`
|
||||||
PMKID []byte
|
PMKID []byte `json:"pmkid"`
|
||||||
}
|
}
|
||||||
|
|
|
@ -88,8 +88,8 @@ func (mod *WiFiModule) discoverHandshakes(radiotap *layers.RadioTap, dot11 *laye
|
||||||
mod.Session.Events.Add("wifi.client.handshake", HandshakeEvent{
|
mod.Session.Events.Add("wifi.client.handshake", HandshakeEvent{
|
||||||
File: mod.shakesFile,
|
File: mod.shakesFile,
|
||||||
NewPackets: numUnsaved,
|
NewPackets: numUnsaved,
|
||||||
AP: apMac,
|
AP: apMac.String(),
|
||||||
Station: staMac,
|
Station: staMac.String(),
|
||||||
PMKID: rawPMKID,
|
PMKID: rawPMKID,
|
||||||
})
|
})
|
||||||
// make sure the info that we have key material for this AP
|
// make sure the info that we have key material for this AP
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue