new: added number of captured full handshakes in wifi.show

This commit is contained in:
evilsocket 2019-02-05 19:56:21 +01:00
commit a90f63b643
No known key found for this signature in database
GPG key ID: 1564D7F30393A456
3 changed files with 50 additions and 12 deletions

View file

@ -279,16 +279,32 @@ func (w *WiFiModule) Show() (err error) {
tui.Table(os.Stdout, w.colNames(nrows), rows)
}
numHandshakes := w.Session.WiFi.NumHandshakes()
w.Session.Queue.Stats.RLock()
fmt.Printf("\n%s (ch. %d) / %s %s / %s %s / %d pkts / %d errs\n\n",
w.Session.Interface.Name(),
network.GetInterfaceChannel(w.Session.Interface.Name()),
tui.Red("↑"),
humanize.Bytes(w.Session.Queue.Stats.Sent),
tui.Green("↓"),
humanize.Bytes(w.Session.Queue.Stats.Received),
w.Session.Queue.Stats.PktReceived,
w.Session.Queue.Stats.Errors)
if numHandshakes > 0 {
fmt.Printf("\n%s (ch. %d) / %s %s / %s %s / %d pkts / %d errs / %d handshakes\n\n",
w.Session.Interface.Name(),
network.GetInterfaceChannel(w.Session.Interface.Name()),
tui.Red("↑"),
humanize.Bytes(w.Session.Queue.Stats.Sent),
tui.Green("↓"),
humanize.Bytes(w.Session.Queue.Stats.Received),
w.Session.Queue.Stats.PktReceived,
w.Session.Queue.Stats.Errors,
numHandshakes)
} else {
fmt.Printf("\n%s (ch. %d) / %s %s / %s %s / %d pkts / %d errs\n\n",
w.Session.Interface.Name(),
network.GetInterfaceChannel(w.Session.Interface.Name()),
tui.Red("↑"),
humanize.Bytes(w.Session.Queue.Stats.Sent),
tui.Green("↓"),
humanize.Bytes(w.Session.Queue.Stats.Received),
w.Session.Queue.Stats.PktReceived,
w.Session.Queue.Stats.Errors)
}
w.Session.Queue.Stats.RUnlock()
w.Session.Refresh()