mirror of
https://github.com/bettercap/bettercap
synced 2025-08-20 21:43:18 -07:00
new: new wifi.handshakes.aggregate parameter to control how handshakes get saved
This commit is contained in:
parent
672a9f2706
commit
da565afa9a
4 changed files with 63 additions and 26 deletions
|
@ -1,7 +1,14 @@
|
|||
package network
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"regexp"
|
||||
"strconv"
|
||||
"strings"
|
||||
)
|
||||
|
||||
var (
|
||||
pathNameCleaner = regexp.MustCompile("[^a-zA-Z0-9]+")
|
||||
)
|
||||
|
||||
type Station struct {
|
||||
|
@ -56,3 +63,11 @@ func (s *Station) HasWPS() bool {
|
|||
func (s *Station) IsOpen() bool {
|
||||
return s.Encryption == "" || s.Encryption == "OPEN"
|
||||
}
|
||||
|
||||
func (s *Station) PathFriendlyName() string {
|
||||
name := strings.Replace(s.HwAddress, ":", "", -1)
|
||||
if essid := pathNameCleaner.ReplaceAllString(s.Hostname, ""); essid != "" {
|
||||
name = fmt.Sprintf("%s_%s", name, essid)
|
||||
}
|
||||
return name
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue