fix: fixed wifi.client.handshake event json serialization

This commit is contained in:
evilsocket 2019-03-14 17:11:45 +01:00
commit 73710ba7d3
No known key found for this signature in database
GPG key ID: 1564D7F30393A456
3 changed files with 10 additions and 12 deletions

View file

@ -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)
}

View file

@ -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"`
}

View file

@ -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