From 73710ba7d3ef5dbd61b4f5717fbf1ac604ae9c88 Mon Sep 17 00:00:00 2001 From: evilsocket Date: Thu, 14 Mar 2019 17:11:45 +0100 Subject: [PATCH] fix: fixed wifi.client.handshake event json serialization --- modules/events_stream/events_view_wifi.go | 6 +++--- modules/wifi/wifi_events.go | 12 +++++------- modules/wifi/wifi_recon_handshakes.go | 4 ++-- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/modules/events_stream/events_view_wifi.go b/modules/events_stream/events_view_wifi.go index 23463d99..66f1ce36 100644 --- a/modules/events_stream/events_view_wifi.go +++ b/modules/events_stream/events_view_wifi.go @@ -69,11 +69,11 @@ func (mod *EventsStream) viewWiFiClientProbeEvent(e session.Event) { func (mod *EventsStream) viewWiFiHandshakeEvent(e session.Event) { hand := e.Data.(wifi.HandshakeEvent) - from := hand.Station.String() - to := hand.AP.String() + from := hand.Station + to := hand.AP 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())) what = fmt.Sprintf("%s handshake", ap.Encryption) } diff --git a/modules/wifi/wifi_events.go b/modules/wifi/wifi_events.go index 66ae528f..15e27c1e 100644 --- a/modules/wifi/wifi_events.go +++ b/modules/wifi/wifi_events.go @@ -1,8 +1,6 @@ package wifi import ( - "net" - "github.com/bettercap/bettercap/network" ) @@ -20,9 +18,9 @@ type ProbeEvent struct { } type HandshakeEvent struct { - File string - NewPackets int - AP net.HardwareAddr - Station net.HardwareAddr - PMKID []byte + File string `json:"file"` + NewPackets int `json:"new_packets"` + AP string `json:"ap"` + Station string `json:"station"` + PMKID []byte `json:"pmkid"` } diff --git a/modules/wifi/wifi_recon_handshakes.go b/modules/wifi/wifi_recon_handshakes.go index d7701be9..a8eb676e 100644 --- a/modules/wifi/wifi_recon_handshakes.go +++ b/modules/wifi/wifi_recon_handshakes.go @@ -88,8 +88,8 @@ func (mod *WiFiModule) discoverHandshakes(radiotap *layers.RadioTap, dot11 *laye mod.Session.Events.Add("wifi.client.handshake", HandshakeEvent{ File: mod.shakesFile, NewPackets: numUnsaved, - AP: apMac, - Station: staMac, + AP: apMac.String(), + Station: staMac.String(), PMKID: rawPMKID, }) // make sure the info that we have key material for this AP