mirror of
https://github.com/bettercap/bettercap
synced 2025-08-19 13:09:49 -07:00
misc: small fix or general refactoring i did not bother commenting
This commit is contained in:
parent
1d55083f75
commit
ae223d7110
2 changed files with 8 additions and 5 deletions
|
@ -130,13 +130,16 @@ func (w *WiFiModule) startDeauth(to net.HardwareAddr) error {
|
||||||
client := deauth.Client
|
client := deauth.Client
|
||||||
ap := deauth.Ap
|
ap := deauth.Ap
|
||||||
if w.Running() {
|
if w.Running() {
|
||||||
if ap.IsOpen() && !w.doDeauthOpen() {
|
logger := log.Info
|
||||||
log.Debug("skipping deauth for open network %s", ap.ESSID())
|
if w.isDeauthSilent() {
|
||||||
} else {
|
logger = log.Debug
|
||||||
if !w.isDeauthSilent() {
|
|
||||||
log.Info("deauthing client %s from AP %s (channel %d)", client.String(), ap.ESSID(), ap.Channel())
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ap.IsOpen() && !w.doDeauthOpen() {
|
||||||
|
logger("skipping deauth for open network %s (wifi.deauth.open is false)", ap.ESSID())
|
||||||
|
} else {
|
||||||
|
logger("deauthing client %s from AP %s (channel:%d encryption:%s)", client.String(), ap.ESSID(), ap.Channel(), ap.Encryption)
|
||||||
|
|
||||||
w.onChannel(ap.Channel(), func() {
|
w.onChannel(ap.Channel(), func() {
|
||||||
w.sendDeauthPacket(ap.HW, client.HW)
|
w.sendDeauthPacket(ap.HW, client.HW)
|
||||||
})
|
})
|
||||||
|
|
|
@ -57,5 +57,5 @@ func (s *Station) HasWPS() bool {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Station) IsOpen() bool {
|
func (s *Station) IsOpen() bool {
|
||||||
return s.Encryption == ""
|
return s.Encryption == "" || s.Encryption == "OPEN"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue