mirror of
https://github.com/bettercap/bettercap
synced 2025-08-20 13:33:21 -07:00
new: WSD discovery agent for net.probe
This commit is contained in:
parent
632f7700bf
commit
b6adb2b65f
3 changed files with 65 additions and 0 deletions
|
@ -16,6 +16,7 @@ type Probes struct {
|
|||
NBNS bool
|
||||
MDNS bool
|
||||
UPNP bool
|
||||
WSD bool
|
||||
}
|
||||
|
||||
type Prober struct {
|
||||
|
@ -43,6 +44,10 @@ func NewProber(s *session.Session) *Prober {
|
|||
"true",
|
||||
"Enable UPNP discovery probes."))
|
||||
|
||||
p.AddParam(session.NewBoolParameter("net.probe.wsd",
|
||||
"true",
|
||||
"Enable WSD discovery probes."))
|
||||
|
||||
p.AddParam(session.NewIntParameter("net.probe.throttle",
|
||||
"10",
|
||||
"If greater than 0, probe packets will be throttled by this value in milliseconds."))
|
||||
|
@ -96,6 +101,8 @@ func (p *Prober) Configure() error {
|
|||
return err
|
||||
} else if err, p.probes.UPNP = p.BoolParam("net.probe.upnp"); err != nil {
|
||||
return err
|
||||
} else if err, p.probes.WSD = p.BoolParam("net.probe.wsd"); err != nil {
|
||||
return err
|
||||
} else {
|
||||
log.Debug("Throttling packets of %d ms.", p.throttle)
|
||||
}
|
||||
|
@ -135,6 +142,10 @@ func (p *Prober) Start() error {
|
|||
p.sendProbeUPNP(from, from_hw)
|
||||
}
|
||||
|
||||
if p.probes.WSD {
|
||||
p.sendProbeWSD(from, from_hw)
|
||||
}
|
||||
|
||||
for _, ip := range addresses {
|
||||
if !p.Running() {
|
||||
return
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue