mirror of
https://github.com/bettercap/bettercap
synced 2025-07-15 01:23:42 -07:00
new: parsing BLE flags and company identifiers from advertisements
This commit is contained in:
parent
7f68d0d82c
commit
f72dac0c95
253 changed files with 37143 additions and 487 deletions
|
@ -11,6 +11,7 @@ import (
|
|||
|
||||
"github.com/evilsocket/islazy/data"
|
||||
"github.com/evilsocket/islazy/str"
|
||||
"github.com/evilsocket/islazy/tui"
|
||||
|
||||
"github.com/malfunkt/iprange"
|
||||
)
|
||||
|
@ -286,3 +287,18 @@ func GatewayProvidedByUser(iface *Endpoint, gateway string) (*Endpoint, error) {
|
|||
}
|
||||
return nil, fmt.Errorf("Provided gateway %s not a valid IPv4 address! Revert to find default gateway.", gateway)
|
||||
}
|
||||
|
||||
func ColorRSSI(n int) string {
|
||||
// ref. https://www.metageek.com/training/resources/understanding-rssi-2.html
|
||||
rssi := fmt.Sprintf("%d dBm", n)
|
||||
if n >= -67 {
|
||||
rssi = tui.Green(rssi)
|
||||
} else if n >= -70 {
|
||||
rssi = tui.Dim(tui.Green(rssi))
|
||||
} else if n >= -80 {
|
||||
rssi = tui.Yellow(rssi)
|
||||
} else {
|
||||
rssi = tui.Dim(tui.Red(rssi))
|
||||
}
|
||||
return rssi
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue