mirror of
https://github.com/bettercap/bettercap
synced 2025-07-16 10:03:39 -07:00
misc: small fix or general refactoring i did not bother commenting
This commit is contained in:
parent
c2467ac7a4
commit
b48c75a7fc
1 changed files with 13 additions and 11 deletions
|
@ -256,20 +256,22 @@ func (w *WDiscovery) sendDeauthPacket(ap net.HardwareAddr, client net.HardwareAd
|
||||||
}
|
}
|
||||||
|
|
||||||
func (w *WDiscovery) startDeauth() error {
|
func (w *WDiscovery) startDeauth() error {
|
||||||
switch {
|
isTargetingAP := len(w.apTarget) > 0
|
||||||
case len(w.apTarget) > 0 && len(w.cliTarget) > 0:
|
isTargetingCLI := len(w.cliTarget) > 0
|
||||||
w.sendDeauthPacket(w.apTarget, w.cliTarget)
|
|
||||||
|
|
||||||
case len(w.apTarget) > 0:
|
if isTargetingAP {
|
||||||
for _, t := range w.Stations.Stations {
|
if isTargetingCLI {
|
||||||
w.sendDeauthPacket(w.apTarget, t.Endpoint.HW)
|
// deauth a specific client
|
||||||
|
w.sendDeauthPacket(w.apTarget, w.cliTarget)
|
||||||
|
} else {
|
||||||
|
// deauth all AP's clients
|
||||||
|
for _, t := range w.Stations.Stations {
|
||||||
|
w.sendDeauthPacket(w.apTarget, t.Endpoint.HW)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
return nil
|
||||||
default:
|
|
||||||
return errors.New("Base station is not set.")
|
|
||||||
}
|
}
|
||||||
|
return errors.New("No base station or client set.")
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (w *WDiscovery) discoverAccessPoints(packet gopacket.Packet) {
|
func (w *WDiscovery) discoverAccessPoints(packet gopacket.Packet) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue