mirror of
https://github.com/bettercap/bettercap
synced 2025-08-19 21:13:18 -07:00
refact: refactored syn.scan open port log as proper event
This commit is contained in:
parent
ce76c7258d
commit
42b08db0b0
3 changed files with 38 additions and 4 deletions
|
@ -94,6 +94,15 @@ func (s EventsStream) viewSnifferEvent(e session.Event) {
|
|||
se.Message)
|
||||
}
|
||||
|
||||
func (s EventsStream) viewSynScanEvent(e session.Event) {
|
||||
se := e.Data.(SynScanEvent)
|
||||
fmt.Printf("[%s] [%s] Found open port %d for %s\n",
|
||||
e.Time.Format(eventTimeFormat),
|
||||
core.Green(e.Tag),
|
||||
se.Port,
|
||||
core.Bold(se.Host.IpAddress))
|
||||
}
|
||||
|
||||
func (s *EventsStream) View(e session.Event, refresh bool) {
|
||||
if s.filter == "" || strings.Contains(e.Tag, s.filter) {
|
||||
if e.Tag == "sys.log" {
|
||||
|
@ -106,6 +115,8 @@ func (s *EventsStream) View(e session.Event, refresh bool) {
|
|||
s.viewModuleEvent(e)
|
||||
} else if strings.HasPrefix(e.Tag, "net.sniff.") {
|
||||
s.viewSnifferEvent(e)
|
||||
} else if strings.HasPrefix(e.Tag, "syn.scan") {
|
||||
s.viewSynScanEvent(e)
|
||||
} else {
|
||||
fmt.Printf("[%s] [%s] %v\n", e.Time.Format(eventTimeFormat), core.Green(e.Tag), e)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue