Skip to content

Commit

Permalink
fix: check ssid probes for non printable characters
Browse files Browse the repository at this point in the history
  • Loading branch information
evilsocket committed Apr 7, 2021
1 parent db27542 commit 5b8cb9a
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion modules/graph/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package graph
import (
"fmt"
"time"
"unicode"
)

type NodeType string
Expand Down Expand Up @@ -50,7 +51,20 @@ func (n Node) String() string {
func (n Node) Label() string {
switch n.Type {
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:
return fmt.Sprintf("%s\\n(%s)",
n.Entity.(map[string]interface{})["mac"].(string),
Expand Down

0 comments on commit 5b8cb9a

Please sign in to comment.