mirror of
https://github.com/bettercap/bettercap
synced 2025-08-19 13:09:49 -07:00
fix: using tui.Table for wifi.show.wps output
This commit is contained in:
parent
62db3a0be0
commit
696c056b56
1 changed files with 14 additions and 5 deletions
|
@ -331,14 +331,20 @@ func (w *WiFiModule) ShowWPS(bssid string) (err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
sort.Sort(ByBssidSorter(toShow))
|
sort.Sort(ByBssidSorter(toShow))
|
||||||
|
|
||||||
|
colNames := []string{"Name", "Value"}
|
||||||
|
|
||||||
for _, station := range toShow {
|
for _, station := range toShow {
|
||||||
ssid := station.ESSID()
|
ssid := station.ESSID()
|
||||||
if ssid == "<hidden>" {
|
if ssid == "<hidden>" {
|
||||||
ssid = tui.Dim(ssid)
|
ssid = tui.Dim(ssid)
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Println()
|
rows := [][]string{
|
||||||
fmt.Printf("* %s (%s ch:%d):\n", tui.Bold(ssid), tui.Dim(station.BSSID()), station.Channel())
|
[]string{tui.Green("essid"), ssid},
|
||||||
|
[]string{tui.Green("bssid"), station.BSSID()},
|
||||||
|
}
|
||||||
|
|
||||||
keys := []string{}
|
keys := []string{}
|
||||||
for name := range station.WPS {
|
for name := range station.WPS {
|
||||||
keys = append(keys, name)
|
keys = append(keys, name)
|
||||||
|
@ -346,11 +352,14 @@ func (w *WiFiModule) ShowWPS(bssid string) (err error) {
|
||||||
sort.Strings(keys)
|
sort.Strings(keys)
|
||||||
|
|
||||||
for _, name := range keys {
|
for _, name := range keys {
|
||||||
fmt.Printf(" %s: %s\n", name, tui.Yellow(station.WPS[name]))
|
rows = append(rows, []string{
|
||||||
}
|
tui.Green(name),
|
||||||
|
tui.Yellow(station.WPS[name]),
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Println()
|
tui.Table(os.Stdout, colNames, rows)
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue