mirror of
https://github.com/bettercap/bettercap
synced 2025-08-20 13:33:21 -07:00
new: wifi.deauth and wifi.assoc now support autocompletion
This commit is contained in:
parent
49e2116d46
commit
a4aa5acbcd
3 changed files with 59 additions and 17 deletions
|
@ -8,7 +8,6 @@ import (
|
|||
"fmt"
|
||||
"io/ioutil"
|
||||
golog "log"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/bettercap/bettercap/modules/utils"
|
||||
|
@ -77,7 +76,7 @@ func NewBLERecon(s *session.Session) *BLERecon {
|
|||
return mod.enumAllTheThings(network.NormalizeMac(args[0]))
|
||||
})
|
||||
|
||||
enum.Complete("ble.enum", mod.macCompleter)
|
||||
enum.Complete("ble.enum", s.BLECompleter)
|
||||
|
||||
mod.AddHandler(enum)
|
||||
|
||||
|
@ -97,7 +96,7 @@ func NewBLERecon(s *session.Session) *BLERecon {
|
|||
return mod.writeBuffer(mac, uuid, data)
|
||||
})
|
||||
|
||||
write.Complete("ble.write", mod.macCompleter)
|
||||
write.Complete("ble.write", s.BLECompleter)
|
||||
|
||||
mod.AddHandler(write)
|
||||
|
||||
|
@ -116,16 +115,6 @@ func (mod BLERecon) Author() string {
|
|||
return "Simone Margaritelli <evilsocket@gmail.com>"
|
||||
}
|
||||
|
||||
func (mod *BLERecon) macCompleter(prefix string) []string {
|
||||
macs := []string{""}
|
||||
mod.Session.BLE.EachDevice(func(mac string, dev *network.BLEDevice) {
|
||||
if prefix == "" || strings.HasPrefix(mac, prefix) {
|
||||
macs = append(macs, mac)
|
||||
}
|
||||
})
|
||||
return macs
|
||||
}
|
||||
|
||||
func (mod *BLERecon) isEnumerating() bool {
|
||||
return mod.currDevice != nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue