mirror of
https://github.com/bettercap/bettercap
synced 2025-08-19 13:09:49 -07:00
fix: check ssid probes for non printable characters
This commit is contained in:
parent
db275429c2
commit
5b8cb9a82c
1 changed files with 15 additions and 1 deletions
|
@ -3,6 +3,7 @@ package graph
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"time"
|
"time"
|
||||||
|
"unicode"
|
||||||
)
|
)
|
||||||
|
|
||||||
type NodeType string
|
type NodeType string
|
||||||
|
@ -50,7 +51,20 @@ func (n Node) String() string {
|
||||||
func (n Node) Label() string {
|
func (n Node) Label() string {
|
||||||
switch n.Type {
|
switch n.Type {
|
||||||
case SSID:
|
case SSID:
|
||||||
return n.Entity.(string)
|
s := n.Entity.(string)
|
||||||
|
allPrint := true
|
||||||
|
|
||||||
|
for _, rn := range s {
|
||||||
|
if !unicode.IsPrint(rune(rn)) {
|
||||||
|
allPrint = false
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if !allPrint {
|
||||||
|
s = fmt.Sprintf("0x%x", s)
|
||||||
|
}
|
||||||
|
return s
|
||||||
case BLEServer:
|
case BLEServer:
|
||||||
return fmt.Sprintf("%s\\n(%s)",
|
return fmt.Sprintf("%s\\n(%s)",
|
||||||
n.Entity.(map[string]interface{})["mac"].(string),
|
n.Entity.(map[string]interface{})["mac"].(string),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue