new: new wifi.deauth.open boolean parameter to optionally skip open networks while deauthing en masse

This commit is contained in:
evilsocket 2019-02-06 07:53:39 +01:00
commit 1d55083f75
No known key found for this signature in database
GPG key ID: 1564D7F30393A456
3 changed files with 28 additions and 5 deletions

View file

@ -36,6 +36,7 @@ type WiFiModule struct {
pktSourceChanClosed bool
deauthSkip []net.HardwareAddr
deauthSilent bool
deauthOpen bool
shakesFile string
apRunning bool
apConfig packets.Dot11ApConfig
@ -115,6 +116,10 @@ func NewWiFiModule(s *session.Session) *WiFiModule {
"false",
"If true, messages from wifi.deauth will be suppressed."))
w.AddParam(session.NewBoolParameter("wifi.deauth.open",
"true",
"Send wifi deauth packets to open networks."))
w.AddHandler(session.NewModuleHandler("wifi.ap", "",
"Inject fake management beacons in order to create a rogue access point.",
func(args []string) error {

View file

@ -59,6 +59,15 @@ func (w *WiFiModule) isDeauthSilent() bool {
return w.deauthSilent
}
func (w *WiFiModule) doDeauthOpen() bool {
if err, is := w.BoolParam("wifi.deauth.open"); err != nil {
log.Warning("%v", err)
} else {
w.deauthOpen = is
}
return w.deauthOpen
}
func (w *WiFiModule) startDeauth(to net.HardwareAddr) error {
// parse skip list
if err, deauthSkip := w.StringParam("wifi.deauth.skip"); err != nil {
@ -121,12 +130,17 @@ func (w *WiFiModule) startDeauth(to net.HardwareAddr) error {
client := deauth.Client
ap := deauth.Ap
if w.Running() {
if !w.isDeauthSilent() {
log.Info("deauthing client %s from AP %s (channel %d)", client.String(), ap.ESSID(), ap.Channel())
if ap.IsOpen() && !w.doDeauthOpen() {
log.Debug("skipping deauth for open network %s", ap.ESSID())
} else {
if !w.isDeauthSilent() {
log.Info("deauthing client %s from AP %s (channel %d)", client.String(), ap.ESSID(), ap.Channel())
}
w.onChannel(ap.Channel(), func() {
w.sendDeauthPacket(ap.HW, client.HW)
})
}
w.onChannel(ap.Channel(), func() {
w.sendDeauthPacket(ap.HW, client.HW)
})
}
}
}()

View file

@ -55,3 +55,7 @@ func (s *Station) Channel() int {
func (s *Station) HasWPS() bool {
return len(s.WPS) > 0
}
func (s *Station) IsOpen() bool {
return s.Encryption == ""
}