new: can.fuzz command

This commit is contained in:
Simone Margaritelli 2024-08-16 13:30:26 +02:00
commit 6f1920f478
5 changed files with 160 additions and 42 deletions

View file

@ -1,6 +1,7 @@
package can
import (
"fmt"
"time"
"github.com/bettercap/bettercap/v2/network"
@ -27,6 +28,7 @@ func (mod *CANModule) getRow(dev *network.CANDevice) []string {
return []string{
dev.Name,
dev.Description,
fmt.Sprintf("%d", dev.Frames),
humanize.Bytes(dev.Read),
seen,
}
@ -40,7 +42,7 @@ func (mod *CANModule) Show() (err error) {
rows = append(rows, mod.getRow(dev))
}
tui.Table(mod.Session.Events.Stdout, []string{"Name", "Description", "Data", "Seen"}, rows)
tui.Table(mod.Session.Events.Stdout, []string{"Name", "Description", "Frames", "Data", "Seen"}, rows)
if len(rows) > 0 {
mod.Session.Refresh()