mirror of
https://github.com/bettercap/bettercap
synced 2025-07-30 11:40:33 -07:00
new: gateway.change event for MITM monitoring
This commit is contained in:
parent
43a93fd866
commit
c47e3f6195
8 changed files with 144 additions and 5 deletions
|
@ -129,6 +129,8 @@ func (mod *EventsStream) Render(output io.Writer, e session.Event) {
|
|||
mod.viewUpdateEvent(output, e)
|
||||
} else if strings.HasPrefix(e.Tag, "graph.") {
|
||||
mod.viewGraphEvent(output, e)
|
||||
} else if e.Tag == "gateway.change" {
|
||||
mod.viewGatewayEvent(output, e)
|
||||
} else if e.Tag != "tick" {
|
||||
fmt.Fprintf(output, "[%s] [%s] %v\n", e.Time.Format(mod.timeFormat), tui.Green(e.Tag), e)
|
||||
}
|
||||
|
|
23
modules/events_stream/events_view_gateway.go
Normal file
23
modules/events_stream/events_view_gateway.go
Normal file
|
@ -0,0 +1,23 @@
|
|||
package events_stream
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"github.com/bettercap/bettercap/session"
|
||||
|
||||
"github.com/evilsocket/islazy/tui"
|
||||
)
|
||||
|
||||
func (mod *EventsStream) viewGatewayEvent(output io.Writer, e session.Event) {
|
||||
change := e.Data.(session.GatewayChange)
|
||||
|
||||
fmt.Fprintf(output, "[%s] [%s] %s gateway changed: '%s' (%s) -> '%s' (%s)\n",
|
||||
e.Time.Format(mod.timeFormat),
|
||||
tui.Red(e.Tag),
|
||||
string(change.Type),
|
||||
change.Prev.IP,
|
||||
change.Prev.MAC,
|
||||
change.New.IP,
|
||||
change.New.MAC)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue