new: new wifi.rssi.min parameter

This commit is contained in:
evilsocket 2019-02-11 11:53:22 +01:00
commit 0bb9acf033
No known key found for this signature in database
GPG key ID: 1564D7F30393A456
2 changed files with 26 additions and 12 deletions

View file

@ -60,19 +60,23 @@ func (w *WiFiModule) discoverAccessPoints(radiotap *layers.RadioTap, dot11 *laye
}
if !network.IsZeroMac(from) && !network.IsBroadcastMac(from) {
var frequency int
bssid := from.String()
if int(radiotap.DBMAntennaSignal) >= w.minRSSI {
var frequency int
bssid := from.String()
if found, channel := packets.Dot11ParseDSSet(packet); found {
frequency = network.Dot11Chan2Freq(channel)
if found, channel := packets.Dot11ParseDSSet(packet); found {
frequency = network.Dot11Chan2Freq(channel)
} else {
frequency = int(radiotap.ChannelFrequency)
}
if ap, isNew := w.Session.WiFi.AddIfNew(ssid, bssid, frequency, radiotap.DBMAntennaSignal); !isNew {
ap.EachClient(func(mac string, station *network.Station) {
station.Handshake.SetBeacon(packet)
})
}
} else {
frequency = int(radiotap.ChannelFrequency)
}
if ap, isNew := w.Session.WiFi.AddIfNew(ssid, bssid, frequency, radiotap.DBMAntennaSignal); !isNew {
ap.EachClient(func(mac string, station *network.Station) {
station.Handshake.SetBeacon(packet)
})
log.Debug("skipping %s with %d dBm", from.String(), radiotap.DBMAntennaSignal)
}
}
}