mirror of
https://github.com/bettercap/bettercap
synced 2025-08-14 02:36:57 -07:00
fix: showing more info for endpoint.lost event.
This commit is contained in:
parent
8cc54a3599
commit
77ada2f419
1 changed files with 16 additions and 7 deletions
|
@ -21,21 +21,30 @@ func (s EventsStream) viewLogEvent(e session.Event) {
|
|||
|
||||
func (s EventsStream) viewEndpointEvent(e session.Event) {
|
||||
t := e.Data.(*net.Endpoint)
|
||||
if e.Tag == "endpoint.new" {
|
||||
vend := ""
|
||||
if t.Vendor != "" {
|
||||
vend = fmt.Sprintf(" (%s)", t.Vendor)
|
||||
}
|
||||
vend := ""
|
||||
name := ""
|
||||
|
||||
if t.Vendor != "" {
|
||||
vend = fmt.Sprintf(" (%s)", t.Vendor)
|
||||
}
|
||||
|
||||
if t.Hostname != "" {
|
||||
name = fmt.Sprintf(" (%s)", t.Hostname)
|
||||
} else if t.Alias != "" {
|
||||
name = fmt.Sprintf(" (%s)", t.Alias)
|
||||
}
|
||||
|
||||
if e.Tag == "endpoint.new" {
|
||||
fmt.Printf("[%s] Endpoint %s detected as %s%s.\n",
|
||||
e.Time.Format(eventTimeFormat),
|
||||
core.Bold(t.IpAddress),
|
||||
core.Green(t.HwAddress),
|
||||
vend)
|
||||
} else if e.Tag == "endpoint.lost" {
|
||||
fmt.Printf("[%s] Endpoint %s lost.\n",
|
||||
fmt.Printf("[%s] Endpoint %s%s lost.\n",
|
||||
e.Time.Format(eventTimeFormat),
|
||||
core.Red(t.IpAddress))
|
||||
core.Red(t.IpAddress),
|
||||
name)
|
||||
} else {
|
||||
fmt.Printf("[%s] [%s] %s\n",
|
||||
e.Time.Format(eventTimeFormat),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue