mirror of
https://github.com/bettercap/bettercap
synced 2025-08-14 02:36:57 -07:00
fix: do not discover new endpoints from packets queue if net.recon module is not running.
This commit is contained in:
parent
208d63e29d
commit
6e8e489412
1 changed files with 14 additions and 5 deletions
|
@ -271,7 +271,11 @@ func (s *Session) Start() error {
|
|||
// keep reading network events in order to add / update endpoints
|
||||
go func() {
|
||||
for event := range s.Queue.Activities {
|
||||
if event.Source == true {
|
||||
if s.Active == false {
|
||||
return
|
||||
}
|
||||
|
||||
if s.IsOn("net.recon") == true && event.Source == true {
|
||||
addr := event.IP.String()
|
||||
mac := event.MAC.String()
|
||||
|
||||
|
@ -280,10 +284,6 @@ func (s *Session) Start() error {
|
|||
existing.LastSeen = time.Now()
|
||||
}
|
||||
}
|
||||
|
||||
if s.Active == false {
|
||||
return
|
||||
}
|
||||
}
|
||||
}()
|
||||
|
||||
|
@ -292,6 +292,15 @@ func (s *Session) Start() error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func (s *Session) IsOn(moduleName string) bool {
|
||||
for _, m := range s.Modules {
|
||||
if m.Name() == moduleName {
|
||||
return m.Running()
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (s *Session) Refresh() {
|
||||
s.Input.SetPrompt(s.Prompt.Render(s))
|
||||
s.Input.Refresh()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue