mirror of
https://github.com/bettercap/bettercap
synced 2025-08-19 13:09:49 -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) {
|
func (s EventsStream) viewEndpointEvent(e session.Event) {
|
||||||
t := e.Data.(*net.Endpoint)
|
t := e.Data.(*net.Endpoint)
|
||||||
if e.Tag == "endpoint.new" {
|
vend := ""
|
||||||
vend := ""
|
name := ""
|
||||||
if t.Vendor != "" {
|
|
||||||
vend = fmt.Sprintf(" (%s)", t.Vendor)
|
|
||||||
}
|
|
||||||
|
|
||||||
|
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",
|
fmt.Printf("[%s] Endpoint %s detected as %s%s.\n",
|
||||||
e.Time.Format(eventTimeFormat),
|
e.Time.Format(eventTimeFormat),
|
||||||
core.Bold(t.IpAddress),
|
core.Bold(t.IpAddress),
|
||||||
core.Green(t.HwAddress),
|
core.Green(t.HwAddress),
|
||||||
vend)
|
vend)
|
||||||
} else if e.Tag == "endpoint.lost" {
|
} 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),
|
e.Time.Format(eventTimeFormat),
|
||||||
core.Red(t.IpAddress))
|
core.Red(t.IpAddress),
|
||||||
|
name)
|
||||||
} else {
|
} else {
|
||||||
fmt.Printf("[%s] [%s] %s\n",
|
fmt.Printf("[%s] [%s] %s\n",
|
||||||
e.Time.Format(eventTimeFormat),
|
e.Time.Format(eventTimeFormat),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue