mirror of
https://github.com/bettercap/bettercap
synced 2025-08-19 13:09:49 -07:00
new: new wifi.deauth.silent setting
This commit is contained in:
parent
ee83ce44b4
commit
b2cd841ce8
2 changed files with 18 additions and 1 deletions
|
@ -34,6 +34,7 @@ type WiFiModule struct {
|
||||||
pktSourceChan chan gopacket.Packet
|
pktSourceChan chan gopacket.Packet
|
||||||
pktSourceChanClosed bool
|
pktSourceChanClosed bool
|
||||||
deauthSkip []net.HardwareAddr
|
deauthSkip []net.HardwareAddr
|
||||||
|
deauthSilent bool
|
||||||
apRunning bool
|
apRunning bool
|
||||||
apConfig packets.Dot11ApConfig
|
apConfig packets.Dot11ApConfig
|
||||||
writes *sync.WaitGroup
|
writes *sync.WaitGroup
|
||||||
|
@ -51,6 +52,7 @@ func NewWiFiModule(s *session.Session) *WiFiModule {
|
||||||
skipBroken: true,
|
skipBroken: true,
|
||||||
apRunning: false,
|
apRunning: false,
|
||||||
deauthSkip: []net.HardwareAddr{},
|
deauthSkip: []net.HardwareAddr{},
|
||||||
|
deauthSilent: false,
|
||||||
writes: &sync.WaitGroup{},
|
writes: &sync.WaitGroup{},
|
||||||
reads: &sync.WaitGroup{},
|
reads: &sync.WaitGroup{},
|
||||||
chanLock: &sync.Mutex{},
|
chanLock: &sync.Mutex{},
|
||||||
|
@ -106,6 +108,10 @@ func NewWiFiModule(s *session.Session) *WiFiModule {
|
||||||
"",
|
"",
|
||||||
"Comma separated list of BSSID to skip while sending deauth packets."))
|
"Comma separated list of BSSID to skip while sending deauth packets."))
|
||||||
|
|
||||||
|
w.AddParam(session.NewBoolParameter("wifi.deauth.silent",
|
||||||
|
"false",
|
||||||
|
"If true, messages from wifi.deauth will be suppressed."))
|
||||||
|
|
||||||
w.AddHandler(session.NewModuleHandler("wifi.ap", "",
|
w.AddHandler(session.NewModuleHandler("wifi.ap", "",
|
||||||
"Inject fake management beacons in order to create a rogue access point.",
|
"Inject fake management beacons in order to create a rogue access point.",
|
||||||
func(args []string) error {
|
func(args []string) error {
|
||||||
|
|
|
@ -50,6 +50,15 @@ func (w *WiFiModule) skipDeauth(to net.HardwareAddr) bool {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (w *WiFiModule) isDeauthSilent() bool {
|
||||||
|
if err, is := w.BoolParam("wifi.deauth.silent"); err != nil {
|
||||||
|
log.Warning("%v", err)
|
||||||
|
} else {
|
||||||
|
w.deauthSilent = is
|
||||||
|
}
|
||||||
|
return w.deauthSilent
|
||||||
|
}
|
||||||
|
|
||||||
func (w *WiFiModule) startDeauth(to net.HardwareAddr) error {
|
func (w *WiFiModule) startDeauth(to net.HardwareAddr) error {
|
||||||
// parse skip list
|
// parse skip list
|
||||||
if err, deauthSkip := w.StringParam("wifi.deauth.skip"); err != nil {
|
if err, deauthSkip := w.StringParam("wifi.deauth.skip"); err != nil {
|
||||||
|
@ -112,7 +121,9 @@ 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 !w.isDeauthSilent() {
|
||||||
log.Info("deauthing client %s from AP %s (channel %d)", client.String(), ap.ESSID(), ap.Channel())
|
log.Info("deauthing client %s from AP %s (channel %d)", client.String(), ap.ESSID(), ap.Channel())
|
||||||
|
}
|
||||||
w.onChannel(ap.Channel(), func() {
|
w.onChannel(ap.Channel(), func() {
|
||||||
w.sendDeauthPacket(ap.HW, client.HW)
|
w.sendDeauthPacket(ap.HW, client.HW)
|
||||||
})
|
})
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue