From 3e7aa68184c9fb5729daf59401082be06c51a3b1 Mon Sep 17 00:00:00 2001 From: evilsocket Date: Fri, 15 Feb 2019 12:48:32 +0100 Subject: [PATCH] misc: both wifi.assoc and wifi.deauth will wait for wifi.hop.period*2 on the channel in order to improve key material capturing --- modules/wifi/wifi_assoc.go | 4 ++++ modules/wifi/wifi_deauth.go | 3 +++ 2 files changed, 7 insertions(+) diff --git a/modules/wifi/wifi_assoc.go b/modules/wifi/wifi_assoc.go index ff3524cd..ad8362ac 100644 --- a/modules/wifi/wifi_assoc.go +++ b/modules/wifi/wifi_assoc.go @@ -5,6 +5,7 @@ import ( "fmt" "net" "sort" + "time" "github.com/bettercap/bettercap/network" "github.com/bettercap/bettercap/packets" @@ -115,6 +116,9 @@ func (mod *WiFiModule) startAssoc(to net.HardwareAddr) error { mod.onChannel(ap.Channel(), func() { mod.sendAssocPacket(ap) + // let's stick to this channel for a while in order + // to capture key material from the AP + time.Sleep(mod.hopPeriod * 2) }) } } diff --git a/modules/wifi/wifi_deauth.go b/modules/wifi/wifi_deauth.go index a4522a13..01cfd7e6 100644 --- a/modules/wifi/wifi_deauth.go +++ b/modules/wifi/wifi_deauth.go @@ -141,6 +141,9 @@ func (mod *WiFiModule) startDeauth(to net.HardwareAddr) error { mod.onChannel(ap.Channel(), func() { mod.sendDeauthPacket(ap.HW, client.HW) + // let's stick to this channel for a while in order + // to capture key material from the AP + time.Sleep(mod.hopPeriod * 2) }) } }