Skip to content

Commit

Permalink
fix: do not trigger deauth events for frames sent by client stations …
Browse files Browse the repository at this point in the history
…or unknown access points
  • Loading branch information
evilsocket committed Apr 10, 2021
1 parent bc7d1d9 commit 88a8319
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 7 deletions.
4 changes: 3 additions & 1 deletion _example/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ function onDeauthentication(event) {
'Reason: ' + data.reason + "\n" +
'Address1: ' + data.address1 + "\n" +
'Address2: ' + data.address2 + "\n" +
'Address3: ' + data.address3;
'Address3: ' + data.address3 + "\n"
'AP:\n' + JSON.stringify(data.ap, null, 2);


// send to telegram bot
sendMessage(message);
Expand Down
11 changes: 6 additions & 5 deletions modules/wifi/wifi_events.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ type ClientEvent struct {
}

type DeauthEvent struct {
RSSI int8 `json:"rssi"`
Address1 string `json:"address1"`
Address2 string `json:"address2"`
Address3 string `json:"address3"`
Reason string `json:"reason"`
RSSI int8 `json:"rssi"`
AP *network.AccessPoint `json:"ap"`
Address1 string `json:"address1"`
Address2 string `json:"address2"`
Address3 string `json:"address3"`
Reason string `json:"reason"`
}

type ProbeEvent struct {
Expand Down
11 changes: 10 additions & 1 deletion modules/wifi/wifi_recon.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,11 +202,20 @@ func (mod *WiFiModule) discoverDeauths(radiotap *layers.RadioTap, dot11 *layers.
reason = deauth.Reason.String()
}

// trigger events only if the deauth is coming from an AP we know of
source := dot11.Address1.String()
ap, found := mod.Session.WiFi.Get(source)
if !found {
mod.Debug("skipping deauth frame from %s", source)
return
}

mod.Debug("deauth radio %#v", radiotap)

mod.Session.Events.Add("wifi.deauthentication", DeauthEvent{
RSSI: radiotap.DBMAntennaSignal,
Address1: dot11.Address1.String(),
AP: ap,
Address1: source,
Address2: dot11.Address2.String(),
Address3: dot11.Address3.String(),
Reason: reason,
Expand Down

0 comments on commit 88a8319

Please sign in to comment.