mirror of
https://github.com/bettercap/bettercap
synced 2025-07-08 05:51:37 -07:00
fix: increase channel hopping time if we have both 2.4ghz and 5.0ghz capabilities
This commit is contained in:
parent
8d0e4ed0b1
commit
efeedc7558
1 changed files with 10 additions and 2 deletions
|
@ -377,13 +377,21 @@ func (w *WiFiRecon) updateStats(dot11 *layers.Dot11, packet gopacket.Packet) {
|
||||||
func (w *WiFiRecon) channelHopper() {
|
func (w *WiFiRecon) channelHopper() {
|
||||||
log.Info("Channel hopper started.")
|
log.Info("Channel hopper started.")
|
||||||
for w.Running() == true {
|
for w.Running() == true {
|
||||||
|
delay := 250 * time.Millisecond
|
||||||
|
// if we have both 2.4 and 5ghz capabilities, we have
|
||||||
|
// more channels, therefore we need to increase the time
|
||||||
|
// we hop on each one otherwise me lose information
|
||||||
|
if len(w.frequencies) > 14 {
|
||||||
|
delay = 500 * time.Millisecond
|
||||||
|
}
|
||||||
|
|
||||||
for _, frequency := range w.frequencies {
|
for _, frequency := range w.frequencies {
|
||||||
channel := mhz2chan(frequency)
|
channel := mhz2chan(frequency)
|
||||||
if err := network.SetInterfaceChannel(w.Session.Interface.Name(), channel); err != nil {
|
if err := network.SetInterfaceChannel(w.Session.Interface.Name(), channel); err != nil {
|
||||||
log.Warning("Error while hopping to channel %d: %s", channel, err)
|
log.Warning("Error while hopping to channel %d: %s", channel, err)
|
||||||
}
|
}
|
||||||
// this is the default for airodump-ng, good for them, good for us.
|
|
||||||
time.Sleep(250 * time.Millisecond)
|
time.Sleep(delay)
|
||||||
if w.Running() == false {
|
if w.Running() == false {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue