new: new wifi.rssi.min parameter

This commit is contained in:
evilsocket 2019-02-11 11:53:22 +01:00
commit 0bb9acf033
No known key found for this signature in database
GPG key ID: 1564D7F30393A456
2 changed files with 26 additions and 12 deletions

View file

@ -27,6 +27,7 @@ type WiFiModule struct {
handle *pcap.Handle
source string
minRSSI int
channel int
hopPeriod time.Duration
hopChanges chan bool
@ -54,6 +55,7 @@ type WiFiModule struct {
func NewWiFiModule(s *session.Session) *WiFiModule {
w := &WiFiModule{
SessionModule: session.NewSessionModule("wifi", s),
minRSSI: -200,
channel: 0,
stickChan: 0,
hopPeriod: 250 * time.Millisecond,
@ -108,6 +110,10 @@ func NewWiFiModule(s *session.Session) *WiFiModule {
return err
}))
w.AddParam(session.NewIntParameter("wifi.rssi.min",
"-200",
"Minimum WiFi signal strength in dBm."))
w.AddHandler(session.NewModuleHandler("wifi.deauth BSSID", `wifi\.deauth ((?:[a-fA-F0-9:]{11,})|all|\*)`,
"Start a 802.11 deauth attack, if an access point BSSID is provided, every client will be deauthenticated, otherwise only the selected client. Use 'all', '*' or a broadcast BSSID (ff:ff:ff:ff:ff:ff) to iterate every access point with at least one client and start a deauth attack for each one.",
func(args []string) error {
@ -291,6 +297,10 @@ func (w *WiFiModule) Configure() error {
}
}
if err, w.minRSSI = w.IntParam("wifi.rssi.min"); err != nil {
return err
}
ifName := w.Session.Interface.Name()
if w.source != "" {
@ -354,7 +364,7 @@ func (w *WiFiModule) Configure() error {
if err = network.SetInterfaceChannel(ifName, 1); err != nil {
return fmt.Errorf("error while initializing %s to channel 1: %s", ifName, err)
}
log.Info("WiFi recon active with channel hopping.")
log.Info("wifi.recon started (min rssi: %d dBm)", w.minRSSI)
}
}