mirror of
https://github.com/bettercap/bettercap
synced 2025-08-14 02:36:57 -07:00
new: net.show.filter, net.show.limit, net.show.sort and net.show.sort_by parameters to control net.show
This commit is contained in:
parent
431e84ea79
commit
28f8586abb
4 changed files with 178 additions and 29 deletions
|
@ -10,6 +10,7 @@ import (
|
|||
|
||||
type Discovery struct {
|
||||
session.SessionModule
|
||||
selector *ViewSelector
|
||||
}
|
||||
|
||||
func NewDiscovery(s *session.Session) *Discovery {
|
||||
|
@ -36,33 +37,17 @@ func NewDiscovery(s *session.Session) *Discovery {
|
|||
d.AddHandler(session.NewModuleHandler("net.show", "",
|
||||
"Show cache hosts list (default sorting by ip).",
|
||||
func(args []string) error {
|
||||
return d.Show("address", "")
|
||||
}))
|
||||
|
||||
d.AddHandler(session.NewModuleHandler("net.show by seen", "",
|
||||
"Show cache hosts list (sort by last seen).",
|
||||
func(args []string) error {
|
||||
return d.Show("seen", "")
|
||||
}))
|
||||
|
||||
d.AddHandler(session.NewModuleHandler("net.show by sent", "",
|
||||
"Show cache hosts list (sort by sent packets).",
|
||||
func(args []string) error {
|
||||
return d.Show("sent", "")
|
||||
}))
|
||||
|
||||
d.AddHandler(session.NewModuleHandler("net.show by rcvd", "",
|
||||
"Show cache hosts list (sort by received packets).",
|
||||
func(args []string) error {
|
||||
return d.Show("rcvd", "")
|
||||
return d.Show("")
|
||||
}))
|
||||
|
||||
d.AddHandler(session.NewModuleHandler("net.show ADDRESS1, ADDRESS2", `net.show (.+)`,
|
||||
"Show information about a specific list of addresses (by IP or MAC).",
|
||||
func(args []string) error {
|
||||
return d.Show("address", args[0])
|
||||
return d.Show(args[0])
|
||||
}))
|
||||
|
||||
d.selector = ViewSelectorFor(&d.SessionModule, "net.show", []string{"ip", "mac", "seen", "sent", "rcvd"}, "")
|
||||
|
||||
return d
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue