mirror of
https://github.com/bettercap/bettercap
synced 2025-08-14 02:36:57 -07:00
new: new wifi.rssi.min parameter
This commit is contained in:
parent
b503fdc6aa
commit
0bb9acf033
2 changed files with 26 additions and 12 deletions
|
@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue