Compare commits

...

12 Commits

12 changed files with 354 additions and 342 deletions

45
.gitignore vendored

@ -1,39 +1,6 @@
protomol.code-workspace
.vscode/launch.json
16ways.json
.eros-data/devices/000000000.data
.eros-data/devices/config.json
.eros-data/devices/lock
.eros-data/exploits/000000000.data
.eros-data/exploits/config.json
.eros-data/exploits/lock
.logs/2021-05-09T10:03:08-07:00.log
.logs/2021-05-09T13:48:07-07:00.log
.logs/2021-05-09T13:49:43-07:00.log
.logs/2021-05-09T13:50:42-07:00.log
.logs/2021-05-09T13:57:18-07:00.log
.logs/2021-05-09T14:08:07-07:00.log
.logs/2021-05-09T14:08:55-07:00.log
.logs/2021-05-09T14:13:26-07:00.log
.logs/2021-05-09T14:19:12-07:00.log
.logs/2021-05-09T14:28:16-07:00.log
.logs/2021-05-09T14:37:11-07:00.log
.logs/2021-05-09T15:42:20-07:00.log
.logs/2021-05-09T16:02:40-07:00.log
.logs/2021-05-09T16:18:04-07:00.log
.logs/2021-05-09T16:19:39-07:00.log
.logs/2021-05-09T16:20:09-07:00.log
.logs/2021-05-09T16:21:32-07:00.log
.logs/2021-05-09T16:26:12-07:00.log
.logs/2021-05-09T16:27:26-07:00.log
.logs/2021-05-09T16:29:45-07:00.log
.logs/2021-05-09T16:30:46-07:00.log
.logs/2021-05-09T16:31:54-07:00.log
.logs/2021-05-09T16:32:42-07:00.log
.logs/2021-05-09T16:34:17-07:00.log
.logs/2021-05-09T16:48:56-07:00.log
.logs/2021-05-09T17:03:18-07:00.log
.logs/2021-05-09T18:00:31-07:00.log
.logs/2021-05-09T18:02:48-07:00.log
.UUIDs.txt.swp
.gitignore
*.code-workspace
.idea/
*.json
.eros-data/*
.logs/*
*.txt

90
cmd.go

@ -2,17 +2,20 @@ package main
import (
"fmt"
cli "git.tcp.direct/tcp.direct/go-prompt"
"os"
"strconv"
"strings"
cli "git.tcp.direct/Mirrors/go-prompt"
. "github.com/logrusorgru/aurora"
"github.com/rs/zerolog"
"github.com/rs/zerolog/log"
"os"
"protomolecule/src/eros"
"strconv"
//"protomolecule/src/wrath"
// "protomolecule/src/wrath"
projVars "protomolecule/src/config"
"protomolecule/src/deimos"
projVars "protomolecule/src/vars"
"strings"
)
var suggestions = []cli.Suggest{
@ -55,7 +58,7 @@ var suggestions = []cli.Suggest{
}
func completer(in cli.Document) []cli.Suggest {
c := in.GetWordBeforeCursor()
c := in.CurrentLineBeforeCursor()
if c == "" {
return []cli.Suggest{}
}
@ -63,12 +66,6 @@ func completer(in cli.Document) []cli.Suggest {
return cli.FilterHasPrefix(suggestions, c, true)
}
// commands that we will list when the user runs "help"
var cmds = []string{
"scan",
"adapter",
}
// Interpret is where we will actuall define our commands
func executor(cmd string) {
cmd = strings.TrimSpace(cmd)
@ -101,16 +98,17 @@ func executor(cmd string) {
os.Exit(0)
case "debug":
if projVars.Debug {
switch log.Logger.GetLevel() {
case zerolog.DebugLevel:
zerolog.SetGlobalLevel(zerolog.InfoLevel)
projVars.Debug = false
log.Info().
Msg("Debug mode turned " + Sprintf(BrightRed("OFF\n").Bold()))
} else {
case zerolog.InfoLevel:
zerolog.SetGlobalLevel(zerolog.DebugLevel)
projVars.Debug = true
log.Debug().
Msg("Debug mode turned " + Sprintf(BrightGreen("ON\n").Bold()))
default:
return
}
case "eros":
@ -142,7 +140,7 @@ func executor(cmd string) {
log.Info().
Str("Name", fromEros.Name).
Str("Addr", fromEros.Addr).
Str("ManuF", fromEros.Manufacturer). //needs to be changed back to fromEros.Manufacturer
Str("ManuF", fromEros.Manufacturer). // needs to be changed back to fromEros.Manufacturer
Int16("Current_RSSI", fromEros.RSSIlast).
Int("Service_Count", len(fromEros.Services)).
Msg("EROS_RECALL")
@ -173,7 +171,7 @@ func executor(cmd string) {
println()
}
projVars.ManuFile = args[1]
projVars.GlobalConfig.ManuFile = args[1]
eros.ManufLoad()
case "adapter":
@ -218,11 +216,11 @@ func executor(cmd string) {
if len(args) > 2 {
switch args[2] {
case "tracking":
projVars.TrackingMode = true
projVars.AttackMode = false
*projVars.GlobalConfig.CooleanFlags.Tracking = true
*projVars.GlobalConfig.CooleanFlags.Attack = false
case "attack":
projVars.TrackingMode = false
projVars.AttackMode = true
*projVars.GlobalConfig.CooleanFlags.Tracking = false
*projVars.GlobalConfig.CooleanFlags.Attack = true
default:
// getHelp(getArgs(args))
log.Error().Msg("unknown sub command: " + args[2])
@ -265,7 +263,7 @@ func executor(cmd string) {
case "clear":
print("\033[H\033[2J")
//termenv.ClearScreen()
// termenv.ClearScreen()
default:
log.Error().Msg("unknown command: " + cmd)
@ -275,28 +273,32 @@ func executor(cmd string) {
}
func getHelp(target string) {
var lines []string
fmt.Println("pRaNkeD! (help not available just yet.)")
fmt.Println()
return
/*
var lines []string
lines = append(lines, "help: "+target)
lines = append(lines, "help: "+target)
switch target {
switch target {
case "meta":
var list string
for _, cmd := range cmds {
list = list + cmd + ", "
case "meta":
var list string
for _, cmd := range cmds {
list = list + cmd + ", "
}
fmt.Println("Enabled commands: ")
list = strings.TrimSuffix(list, ", ")
fmt.Println(list)
fmt.Println()
default:
log.Error().Msg("Help entry not found!")
fmt.Println()
}
fmt.Println("Enabled commands: ")
list = strings.TrimSuffix(list, ", ")
fmt.Println(list)
fmt.Println()
default:
log.Error().Msg("Help entry not found!")
fmt.Println()
}
*/
}
func StartCLI() {
@ -306,14 +308,14 @@ func StartCLI() {
executor,
completer,
cli.OptionPrefix("ProtoMolecule"+"> "),
//cli.OptionPrefixBackgroundColor(cli.Black),
// cli.OptionPrefixBackgroundColor(cli.Black),
cli.OptionPrefixTextColor(cli.Cyan),
cli.OptionHistory(hist),
cli.OptionSuggestionBGColor(cli.Black),
cli.OptionSuggestionTextColor(cli.White),
cli.OptionSelectedSuggestionBGColor(cli.Black),
cli.OptionSelectedSuggestionTextColor(cli.Cyan),
//prompt.OptionLivePrefix
// prompt.OptionLivePrefix
cli.OptionTitle("ProtoMolecule"),
)

43
go.mod

@ -1,22 +1,37 @@
module protomolecule
go 1.16
go 1.19
require (
git.tcp.direct/kayos/prototooth v0.3.1-0.20210513000132-e440008138af
git.tcp.direct/tcp.direct/go-prompt v0.2.7-0.20210712015119-a962cc8abe10
github.com/go-ole/go-ole v1.2.5 // indirect
github.com/godbus/dbus/v5 v5.0.4 // indirect
git.tcp.direct/Mirrors/go-prompt v0.3.0
git.tcp.direct/kayos/prototooth v0.5.1
github.com/google/gopacket v1.1.19
github.com/json-iterator/go v1.1.6
github.com/json-iterator/go v1.1.12
github.com/logrusorgru/aurora v2.0.3+incompatible
github.com/mattn/go-runewidth v0.0.10 // indirect
github.com/muka/go-bluetooth v0.0.0-20201211051136-07f31c601d33 // indirect
github.com/prologic/bitcask v0.3.10
github.com/rs/zerolog v1.21.0
github.com/sirupsen/logrus v1.8.1 // indirect
github.com/stretchr/testify v1.7.0 // indirect
golang.org/x/sys v0.0.0-20210414055047-fe65e336abe0 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
tinygo.org/x/bluetooth v0.3.0
github.com/rs/zerolog v1.27.0
tinygo.org/x/bluetooth v0.5.0
)
require (
github.com/JuulLabs-OSS/cbgo v0.0.2 // indirect
github.com/fatih/structs v1.1.0 // indirect
github.com/go-ole/go-ole v1.2.6 // indirect
github.com/godbus/dbus/v5 v5.1.0 // indirect
github.com/mattn/go-colorable v0.1.12 // indirect
github.com/mattn/go-isatty v0.0.14 // indirect
github.com/mattn/go-runewidth v0.0.13 // indirect
github.com/mattn/go-tty v0.0.4 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/muka/go-bluetooth v0.0.0-20220819143208-8b1989180f4c // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pkg/term v1.1.0 // indirect
github.com/plar/go-adaptive-radix-tree v1.0.4 // indirect
github.com/rivo/uniseg v0.2.0 // indirect
github.com/sirupsen/logrus v1.9.0 // indirect
golang.org/x/crypto v0.7.0 // indirect
golang.org/x/exp v0.0.0-20200228211341-fcea875c7e85 // indirect
golang.org/x/sys v0.6.0 // indirect
golang.org/x/term v0.6.0 // indirect
)

116
go.sum

@ -11,10 +11,10 @@ cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqCl
cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I=
cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
git.tcp.direct/kayos/prototooth v0.3.1-0.20210513000132-e440008138af h1:+J2MfTQvW1DmX1HYIQUsrCd5l0Il9JMYTOowIs8ju1Y=
git.tcp.direct/kayos/prototooth v0.3.1-0.20210513000132-e440008138af/go.mod h1:kk4oyPgWq6Rijn30Js4ITQC5DFwmpyzWL3+8V6q9wdM=
git.tcp.direct/tcp.direct/go-prompt v0.2.7-0.20210712015119-a962cc8abe10 h1:P32iohMBsZcCaimaTqotr9MNa4jPun92zyKkbuBj9ow=
git.tcp.direct/tcp.direct/go-prompt v0.2.7-0.20210712015119-a962cc8abe10/go.mod h1:4E08LRVmW6/2cT0+PaglopcbBZ23bN9fquplcKCFnyQ=
git.tcp.direct/Mirrors/go-prompt v0.3.0 h1:4IXTCPeuMfoemcJ+riSuKQhAx1rJo5hTtuSkr/IFq+A=
git.tcp.direct/Mirrors/go-prompt v0.3.0/go.mod h1:x8Gs5SGQbFzTglOjiK16geOcdw1dVZas3HYkfx0o6ls=
git.tcp.direct/kayos/prototooth v0.5.1 h1:j/WOekGSZLGCt1gqLFAedWEooprTyxYEIyQKei4kcew=
git.tcp.direct/kayos/prototooth v0.5.1/go.mod h1:sRAZ69v83VhnR037/DylbPPBwKb5UCoqEurDFNum0fM=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/JuulLabs-OSS/cbgo v0.0.2 h1:gCDyT0+EPuI8GOFyvAksFcVD2vF4CXBAVwT6uVnD9oo=
@ -29,6 +29,7 @@ github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs=
github.com/bgould/http v0.0.0-20190627042742-d268792bdee7/go.mod h1:BTqvVegvwifopl4KTEDth6Zezs9eR+lCWhvGKvkxJHE=
github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84=
github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
@ -38,6 +39,7 @@ github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc
github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
github.com/coreos/go-systemd/v22 v22.3.3-0.20220203105225-a9a7ef127534/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
@ -58,12 +60,13 @@ github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2
github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
github.com/go-ole/go-ole v1.2.4/go.mod h1:XCwSNxSkXRo4vlyPy93sltvi/qJq0jqQhjqQNIwKuxM=
github.com/go-ole/go-ole v1.2.5 h1:t4MGB5xEDZvXI+0rMjjsfBsD7yAgp/s9ZDkL1JndXwY=
github.com/go-ole/go-ole v1.2.5/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0=
github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY=
github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0=
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
github.com/godbus/dbus/v5 v5.0.3/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
github.com/godbus/dbus/v5 v5.0.4 h1:9349emZab16e7zQvpmsbtjc18ykshndd8y2PG3sgJbA=
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
github.com/godbus/dbus/v5 v5.1.0 h1:4KLkAxT3aOY8Li4FRJe/KvhoNFFxo0m6fNuFUO8QJUk=
github.com/godbus/dbus/v5 v5.1.0/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
@ -79,6 +82,7 @@ github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/gopacket v1.1.19 h1:ves8RnFZPGiFnTS0uPQStjwru6uO6h+nlr9j6fL7kF8=
github.com/google/gopacket v1.1.19/go.mod h1:iJ8V8n6KS+z2U1A8pUwu8bW5SyEMkXJB8Yo/Vo+TKTo=
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
@ -116,15 +120,15 @@ github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2p
github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc=
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo=
github.com/json-iterator/go v1.1.6 h1:MrUvLMLTMxbqFJ9kzlvat/rYZqZnW3u4wkLzWTaFwKs=
github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
@ -137,19 +141,18 @@ github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czP
github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
github.com/mattn/go-colorable v0.1.7 h1:bQGKb3vps/j0E9GfJQ03JyhRuxsvdAanXlT9BTw3mdw=
github.com/mattn/go-colorable v0.1.7/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
github.com/mattn/go-colorable v0.1.12 h1:jF+Du6AlPIjs2BiUiQlKOX0rt3SujHxPnksPKZbaA40=
github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4=
github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84=
github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY=
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
github.com/mattn/go-runewidth v0.0.6/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
github.com/mattn/go-runewidth v0.0.10 h1:CoZ3S2P7pvtP45xOtBw+/mDL2z0RKI576gSkzRRpdGg=
github.com/mattn/go-runewidth v0.0.10/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk=
github.com/mattn/go-tty v0.0.3 h1:5OfyWorkyO7xP52Mq7tB36ajHDG5OHrmBGIS/DtakQI=
github.com/mattn/go-tty v0.0.3/go.mod h1:ihxohKRERHTVzN+aSVRwACLCeqIoZAWpoICkkvrWyR0=
github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y=
github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94=
github.com/mattn/go-runewidth v0.0.7/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
github.com/mattn/go-runewidth v0.0.13 h1:lTGmDsbAYt5DmK6OnoV7EuIF1wEIFAcxld6ypU4OSgU=
github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
github.com/mattn/go-tty v0.0.4 h1:NVikla9X8MN0SQAqCYzpGyXv0jY7MNl3HOWD2dkle7E=
github.com/mattn/go-tty v0.0.4/go.mod h1:u5GGXBtZU6RQoKV8gY5W6UhMudbR5vXnUe7j3pxse28=
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg=
github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc=
@ -160,13 +163,15 @@ github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS4
github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY=
github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI=
github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
github.com/muka/go-bluetooth v0.0.0-20200619025933-f6113f7141c5/go.mod h1:yV39+EVOWdnoTe75NyKdo9iuyI3Slyh4t7eQvElUbWE=
github.com/muka/go-bluetooth v0.0.0-20201211051136-07f31c601d33 h1:p3srutpE8TpQmOUQ5Qw94jYFUdoG2jBbILeYLroQNoI=
github.com/muka/go-bluetooth v0.0.0-20201211051136-07f31c601d33/go.mod h1:dMCjicU6vRBk34dqOmIZm0aod6gUwZXOXzBROqGous0=
github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
github.com/muka/go-bluetooth v0.0.0-20210812063148-b6c83362e27d/go.mod h1:dMCjicU6vRBk34dqOmIZm0aod6gUwZXOXzBROqGous0=
github.com/muka/go-bluetooth v0.0.0-20220819143208-8b1989180f4c h1:CTU9zYG49RMMVTZwRcC78uBJ5gGmvLSgQXCDn1n4jJY=
github.com/muka/go-bluetooth v0.0.0-20220819143208-8b1989180f4c/go.mod h1:dMCjicU6vRBk34dqOmIZm0aod6gUwZXOXzBROqGous0=
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U=
@ -178,8 +183,8 @@ github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/term v1.2.0-beta.2 h1:L3y/h2jkuBVFdWiJvNfYfKmzcCnILw7mJWm2JQuMppw=
github.com/pkg/term v1.2.0-beta.2/go.mod h1:E25nymQcrSllhX42Ok8MRm1+hyBdHY0dCeiKZ9jpNGw=
github.com/pkg/term v1.1.0 h1:xIAAdCMh3QIAy+5FrE8Ad8XoDhEU4ufwbaSozViP9kk=
github.com/pkg/term v1.1.0/go.mod h1:E25nymQcrSllhX42Ok8MRm1+hyBdHY0dCeiKZ9jpNGw=
github.com/plar/go-adaptive-radix-tree v1.0.4 h1:Ucd8R6RH2E7RW8ZtDKrsWyOD3paG2qqJO0I20WQ8oWQ=
github.com/plar/go-adaptive-radix-tree v1.0.4/go.mod h1:Ot8d28EII3i7Lv4PSvBlF8ejiD/CtRYDuPsySJbSaK8=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
@ -196,13 +201,13 @@ github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y8
github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU=
github.com/rivo/uniseg v0.1.0 h1:+2KBaVoUmb9XzDsrx/Ct0W/EYOSFf/nWTauy++DprtY=
github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY=
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ=
github.com/rs/zerolog v1.21.0 h1:Q3vdXlfLNT+OftyBHsU0Y445MD+8m8axjKgf2si0QcM=
github.com/rs/zerolog v1.21.0/go.mod h1:ZPhntP/xmq1nnND05hhpAh2QMhSsA4UN3MGZ6O2J3hM=
github.com/rs/xid v1.3.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
github.com/rs/zerolog v1.27.0 h1:1T7qCieN22GVc8S4Q2yuexzBb1EqjbgjSH9RohbMjKs=
github.com/rs/zerolog v1.27.0/go.mod h1:7frBqO0oezxmnO7GF86FY++uy8I0Tk/If5ni1G9Qc0U=
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc=
@ -211,8 +216,8 @@ github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPx
github.com/sirupsen/logrus v1.5.0/go.mod h1:+F7Ogzej0PZc/94MaYx/nvG9jOFMD2osvC3s+Squfpo=
github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88=
github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE=
github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0=
github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM=
@ -234,7 +239,6 @@ github.com/stretchr/objx v0.2.0 h1:Hbg2NidpLE8veEBkEZTL3CvlkUIVzuU9jDplZO54c48=
github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
@ -245,6 +249,7 @@ github.com/tidwall/match v1.0.1/go.mod h1:LujAq0jyVjBy028G1WhWfIzbpQfMO8bBZ6Tyb0
github.com/tidwall/redcon v1.4.0/go.mod h1:IGzxyoKE3Ea5AWIXo/ZHP+hzY8sWXaMKr7KlFgcWSZU=
github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc=
github.com/valyala/fastjson v1.6.3/go.mod h1:CLCAqky6SMuOcxStkYQvblddUtoRxhYMGLrsQns1aXY=
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU=
github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
@ -260,8 +265,9 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk
golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.7.0 h1:AvwMYaRytfdeVt3u6mLaxYtErKYjxA2OXjJ1HHq6t3A=
golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
@ -302,8 +308,8 @@ golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR
golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
golang.org/x/net v0.0.0-20201021035429-f5854403a974 h1:IX6qOQeG5uLjB/hjjwjedwfjND0hgjPMMyO1RoIXQNI=
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
@ -312,9 +318,7 @@ golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
@ -335,23 +339,24 @@ golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200728102440-3e129f6d46b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200826173525-f9321e4c35a6/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200909081042-eff7692f9009/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200918174421-af09f7315aff/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210414055047-fe65e336abe0 h1:g9s1Ppvvun/fI+BptTMj909BBIcGrzQ32k9FNlcevOE=
golang.org/x/sys v0.0.0-20210414055047-fe65e336abe0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.6.0 h1:clScbb1cHjoCkyRbWwBEUZ5H/tIFu5TAXIqaZD0Gcjw=
golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
@ -375,7 +380,6 @@ golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtn
golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200925191224-5d1fdd8fa346/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU=
golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
@ -414,16 +418,20 @@ gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bl
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo=
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
tinygo.org/x/bluetooth v0.3.0 h1:xy6f1aCAA5VzaXcx+qs4od6ZpiNu6pa/ufnZP7Db2ss=
tinygo.org/x/bluetooth v0.3.0/go.mod h1:zg3FxlQIY6vtbtpK5dU8h5BzQiLoE3hGthXTR0GNEn0=
tinygo.org/x/bluetooth v0.5.0 h1:UftQTmx/snuTbeoS/R6+ZixmxSl5d6BvyfxlmD8eDng=
tinygo.org/x/bluetooth v0.5.0/go.mod h1:3rm7IKtmhP7aU2XRJI/Ods3J9Lqc3BAPPTNZmTtb42Q=
tinygo.org/x/drivers v0.14.0/go.mod h1:uT2svMq3EpBZpKkGO+NQHjxjGf1f42ra4OnMMwQL2aI=
tinygo.org/x/drivers v0.15.1/go.mod h1:uT2svMq3EpBZpKkGO+NQHjxjGf1f42ra4OnMMwQL2aI=
tinygo.org/x/drivers v0.16.0/go.mod h1:uT2svMq3EpBZpKkGO+NQHjxjGf1f42ra4OnMMwQL2aI=
tinygo.org/x/drivers v0.20.0/go.mod h1:uJD/l1qWzxzLx+vcxaW0eY464N5RAgFi1zTVzASFdqI=
tinygo.org/x/tinyfont v0.2.1/go.mod h1:eLqnYSrFRjt5STxWaMeOWJTzrKhXqpWw7nU3bPfKOAM=
tinygo.org/x/tinyfs v0.1.0/go.mod h1:ysc8Y92iHfhTXeyEM9+c7zviUQ4fN9UCFgSOFfMWv20=
tinygo.org/x/tinyterm v0.1.0/go.mod h1:/DDhNnGwNF2/tNgHywvyZuCGnbH3ov49Z/6e8LPLRR4=

49
main.go

@ -3,15 +3,14 @@ package main
import (
"flag"
"os"
"os/exec"
"os/signal"
"syscall"
"time"
projVars "protomolecule/src/config"
"protomolecule/src/dust"
"protomolecule/src/eros"
"protomolecule/src/protogen"
projVars "protomolecule/src/vars"
"runtime"
"syscall"
"time"
"github.com/rs/zerolog"
"github.com/rs/zerolog/log"
@ -23,17 +22,6 @@ var (
BuildDate string
)
func handleExit() {
if runtime.GOOS == "windows" {
return
}
rawModeOff := exec.Command("/bin/stty", "-raw", "echo")
rawModeOff.Stdin = os.Stdin
_ = rawModeOff.Run()
rawModeOff.Wait()
}
func loginit() {
// setup json logfile
// TODO: make this a command line argument
@ -63,28 +51,14 @@ func loginit() {
func cliFlags() {
flag.Parse()
if *projVars.AFlag {
projVars.AttackMode = true
}
if *projVars.DFlag {
projVars.Debug = true
if *projVars.GlobalConfig.CooleanFlags.Debug {
zerolog.SetGlobalLevel(zerolog.DebugLevel)
}
if *projVars.TFlag {
projVars.TrackingMode = true
}
if *projVars.MFlag != "0" {
projVars.ManuFile = *projVars.MFlag
manufLoad = true
}
manufLoad = *projVars.GlobalConfig.StringFlags.MACVendorFile != ""
}
func sigHandler() {
c := make(chan os.Signal)
c := make(chan os.Signal, 1)
signal.Notify(c, os.Interrupt, syscall.SIGTERM)
for {
select {
@ -92,14 +66,12 @@ func sigHandler() {
log.Warn().
Msg("Interrupt detected, stopping scan...")
for _, scan := range protogen.ScanMgr.Scans {
projVars.TrackingMode = false
projVars.AttackMode = false
for _, dev := range scan.Device {
if dev.Connected {
dev.Conn.Disconnect()
_ = dev.Conn.Disconnect()
}
}
scan.Stop()
_ = scan.Stop()
}
}
}
@ -179,12 +151,11 @@ func bleScan() {
scan = protogen.ScanMgr.NewScan()
//time.Sleep(30 * time.Millisecond)
// time.Sleep(30 * time.Millisecond)
go dust.Must("Scan", scan.Start())
}
func main() {
defer handleExit()
defer eros.Slumber()
StartCLI()
}

@ -2,9 +2,11 @@
package arboghast
import (
bluetooth "git.tcp.direct/kayos/prototooth"
projVars "protomolecule/src/vars"
"sync"
bluetooth "git.tcp.direct/kayos/prototooth"
projVars "protomolecule/src/config"
)
type Circus struct {
@ -37,8 +39,8 @@ func NewEntropicFuzzer() *Fuzzy {
}
mutex := &sync.Mutex{}
ad := projVars.ScanAdapter.DefaultAdvertisement()
ad.Configure(options)
ad := projVars.GlobalConfig.GetScanAdapter().DefaultAdvertisement()
ad.Configure(*options)
return &Fuzzy{
config: options,

@ -11,6 +11,6 @@ import "git.tcp.direct/kayos/prototooth"
func pathways(target bluetooth.ScanResult) {
println("Discovery")
//device, err := projVars.ScanAdapter.Connect(bluetooth.ScanResult.Address, bluetooth.ConnectionParams{})
//srvcs, err := projVars.ScanAdapter.
// device, err := projVars.GlobalConfig.GetScanAdapter().Connect(bluetooth.ScanResult.Address, bluetooth.ConnectionParams{})
// srvcs, err := projVars.GlobalConfig.GetScanAdapter().
}

99
src/config/config.go Normal file

@ -0,0 +1,99 @@
package common
import (
"flag"
bluetooth "git.tcp.direct/kayos/prototooth"
)
type Mode uint32
const (
ModeNone Mode = iota
ModeScan
ModeTrack
ModeAttack
)
func (m Mode) String() string {
return [...]string{"None", "Track", "Attack"}[m]
}
// Tooth is a bluetooth adapter.
type Tooth struct {
ID int
Usecase Mode
*bluetooth.Adapter
}
type Config struct {
// ManuFile is a place holder for a file with list of all known Manufacturers
// this is actually stored by eros and likely deprecated.
ManuFile string
Teeth []*Tooth
CooleanFlags struct {
Debug *bool
Attack *bool
Tracking *bool
}
StringFlags struct {
MACVendorFile *string
MACTarget *string
}
}
func (c *Config) GetScanAdapter() *bluetooth.Adapter {
if len(c.Teeth) == 1 {
return c.Teeth[0].Adapter
}
var choice *bluetooth.Adapter
for _, v := range c.Teeth {
if v.Usecase == ModeScan || v.Usecase == ModeTrack {
choice = v.Adapter
break
}
}
return choice
}
var DefaultConfig = Config{
ManuFile: DefManuFile,
Teeth: []*Tooth{
&Tooth{
ID: 0,
Usecase: ModeNone,
Adapter: bluetooth.DefaultAdapter,
},
},
CooleanFlags: struct {
Debug *bool
Attack *bool
Tracking *bool
}{
Debug: flag.Bool("d", false, "global debug logging and pretty printing"),
Attack: flag.Bool("a", false, "attack mode"),
Tracking: flag.Bool("t", false, "device tracking mode"),
},
StringFlags: struct {
MACVendorFile *string
MACTarget *string
}{
MACVendorFile: flag.String("m", DefManuFile, "json file with manufacturer identifying data to preload into eros"),
MACTarget: flag.String("w", "00:00:00:00:00:00", "MAC address of target"),
},
}
const DefManuFile = "./ManufUUID.json"
// Service UUIDs for testing
var (
SonosScanTest = bluetooth.New16BitUUID(0xfe07)
AppleScanTest = bluetooth.New16BitUUID(0x004c)
GlobalConfig *Config
)
func init() {
GlobalConfig = &DefaultConfig
}

@ -5,31 +5,26 @@
// Raw Advertisement Packet (Advertisement)
// Services UUIDs (Services)
// TODO:
// Output to report
// TODO:
//
// Output to report
package eros
import (
"bufio"
jsoniter "github.com/json-iterator/go"
"os"
projVars "protomolecule/src/vars"
"strconv"
"strings"
"sync"
"time"
jsoniter "github.com/json-iterator/go"
projVars "protomolecule/src/config"
bluetooth "git.tcp.direct/kayos/prototooth"
"github.com/prologic/bitcask"
"github.com/rs/zerolog/log"
structs "protomolecule/src/eros/structs"
"github.com/labstack/echo/middleware"
"github.com/labstack/echo"
"net/http"
"fmt"
)
var (
@ -44,7 +39,7 @@ var (
err error
Manufacturers ManufData
Exploits Exploit
// Exploits Exploit
// DataDir - should be defined by config or cmd flag
DataDir string = "./.eros-data/"
@ -87,7 +82,7 @@ func (d *Device) ConnectHandler(target bluetooth.Addresser, c bool) {
// ManufLoad loads data from a json file containing UUID manufacturer associations
func ManufLoad() {
path := projVars.ManuFile
path := *projVars.GlobalConfig.StringFlags.MACVendorFile
var uuid bluetooth.UUID
log.Info().
@ -112,7 +107,7 @@ func ManufLoad() {
utmp, err := strconv.ParseUint(mf.UString, 0, 16)
if err != nil {
log.Fatal().Str("file", projVars.ManuFile).
log.Fatal().Str("file", path).
Str("string", mf.UString).
Err(err).Msg("MANUFACTURER_PARSE_ERROR")
}
@ -123,8 +118,8 @@ func ManufLoad() {
log.Debug().
Str("Manufacturer", mf.Name).
Str("UUID_String", mf.UString).
//Interface("UUID_Type", uuid).
//Str("Website", mf.Website).
// Interface("UUID_Type", uuid).
// Str("Website", mf.Website).
Msg("LOADED_MANUFACTURER_DATA")
mf.UString = ""
@ -147,7 +142,7 @@ func ManufLoad() {
log.Debug().Str("Manufacturer", mf.Name).
Int("UUID_Count", len(mf.UUIDs)).
//Interface("UUIDs", mf.UUIDs).
// Interface("UUIDs", mf.UUIDs).
Msg("EXISTING_MANUFACTURER_FOUND")
}
@ -180,19 +175,26 @@ func ManufLoad() {
func Awaken() {
DB = make(map[string]*bitcask.Bitcask)
for _, name := range dbs {
DB[name], err = bitcask.Open(DataDir + name)
DB[name], err = bitcask.Open(DataDir+name, bitcask.WithMaxValueSize(1024*1024*1024))
if err != nil {
panic(err.Error())
}
}
}
func logErr(err error) {
if err != nil {
log.Error().Err(err).
Msg("EROS_DATABASE_ERROR")
}
}
// Slumber - Clean up database entries, sync them to persistent storage, and safelty close the database.
func Slumber() {
for _, db := range DB {
db.Merge()
db.Sync()
db.Close()
logErr(db.Merge())
logErr(db.Sync())
logErr(db.Close())
}
}
@ -246,14 +248,16 @@ func Recall(Addr string) (Device, error) {
return member, err
}
json.Unmarshal(bytes, &member)
if err := json.Unmarshal(bytes, &member); err != nil {
log.Panic().Err(err).Msg("Failed to unmarshal device")
}
return member, err
}
func Backup(path string) error {
for _, db := range DB {
db.Merge()
db.Sync()
logErr(db.Merge())
logErr(db.Sync())
err := db.Backup(path)
if err != nil {
return err
@ -262,6 +266,7 @@ func Backup(path string) error {
return nil
}
/*
// Hypnosis - retrieve new exploits/attacks from a remote http repository
func Hypnosis(repo string) {
@ -272,7 +277,7 @@ func Hypnosis(repo string) {
AllowMethods: []string{echo.GET, echo.HEAD, echo.PUT, echo.PATCH, echo.POST, echo.DELETE} //TODO: possibly trim the methods
}))
// GET
// GET
e.GET("/exploits", func(c echo.Context) error { // This will definitely need to be updated
// Build request
req, err := http.NewRequest("GET", repo, nil)
@ -294,7 +299,7 @@ func Hypnosis(repo string) {
caCertPool := x509.NewCertPool()
caCertPool.AppendCertsFromPEM(caCert)
// Create client
// Create client
client := &http.Client{
Transport: &http.Transport{
TLSClientConfig: &tls.Config{
@ -313,7 +318,7 @@ func Hypnosis(repo string) {
// Defer body close
defer res.Body.Close()
// Late binding data from JSON
// Late binding data from JSON
var exp Exploit
// Decode JSON stream
@ -357,15 +362,12 @@ func FinalizeExploit(bigidea Exploit) *Exploit {
bigidea.mu = &sync.RWMutex{}
return &bigidea
}
*/
// Known - check if an exploit is present in the database
func Known(Addr string) bool {
if DB["exploits"].Has([]byte(Addr)) {
return true
}
return false
return DB["exploits"].Has([]byte(Addr))
}
// Flashback - retrieve details for the named exploit/attack
func Flashback(Addr string) (Exploit, error) {
var err error
@ -379,6 +381,8 @@ func Flashback(Addr string) (Exploit, error) {
return member, err
}
json.Unmarshal(bytes, &member)
if err := json.Unmarshal(bytes, &member); err != nil {
log.Panic().Err(err).Msg("Failed to unmarshal exploit")
}
return member, err
}
}

@ -1,15 +1,17 @@
package protogen
import (
projVars "protomolecule/src/vars"
"sync"
"time"
projVars "protomolecule/src/config"
"github.com/rs/zerolog"
"github.com/rs/zerolog/log"
"protomolecule/src/eros"
bluetooth "git.tcp.direct/kayos/prototooth"
"sync"
"time"
)
// ScanMgr will keep track of concurrently running scans
@ -26,7 +28,6 @@ var ScanMgr *Meta
// In these examples we are sending an instance of a struct with some data to eros; allowing it to finish filling out the rest
// This can be done with just structs, but becomes problematic when trying to refer to them later
//
//TODO: implement Mutex locking from sync in most of these structs to prevent concurrent read/write operations from causing a race w̶a̶r̶ condition
// ref: https://gobyexample.com/mutexes
// ref: https://golang.org/pkg/sync/#Mutex
// ref: https://www.geeksforgeeks.org/mutex-in-golang-with-examples/
@ -95,18 +96,18 @@ func (s *Scan) resultHandler(scanAdapter *bluetooth.Adapter, result bluetooth.Sc
addr := result.Address.String()
lname := result.LocalName()
//adbytes := payload.Bytes()
// adbytes := payload.Bytes()
rssi := result.RSSI
EnumedManuf := ""
// TODO: probably make this a function or a method in eros(?)
//
//---attempts to set the manufacturer value----
//range through the uuids in the payload and compare
//known manufacturers list
// ---attempts to set the manufacturer value----
// range through the uuids in the payload and compare
// known manufacturers list
uuids := payload.ServiceUUIDOut()
for range uuids {
//for every element within the manufacturers list
// for every element within the manufacturers list
// check each UUID
for _, man := range eros.Manufacturers.Entries {
// pull the UUID the current element of the manufacturer list
@ -114,7 +115,7 @@ func (s *Scan) resultHandler(scanAdapter *bluetooth.Adapter, result bluetooth.Sc
// for each manufacturer's UUID: compare the advertisment payload for a match
for _, manusss := range currManufErosOut {
manufBool := payload.HasServiceUUID(manusss)
//if there is a UUID match then assign the Manufacturer's name
// if there is a UUID match then assign the Manufacturer's name
// to the output variable EnumedManuf
if manufBool == true {
EnumedManuf = man.Name
@ -125,11 +126,13 @@ func (s *Scan) resultHandler(scanAdapter *bluetooth.Adapter, result bluetooth.Sc
}
//ManufOut := ManfCheck(payload)
// ManufOut := ManfCheck(payload)
layToRest := func(dev *eros.Device) {
sublog.Debug().Msg("Storing data with Eros")
eros.Remember(dev)
if err := eros.Remember(dev); err != nil {
log.Warn().Err(err).Msg("EROS_REMEMBER_FAILURE")
}
// simple eros test
fromEros, err := eros.Recall(addr)
@ -140,7 +143,7 @@ func (s *Scan) resultHandler(scanAdapter *bluetooth.Adapter, result bluetooth.Sc
log.Info().
Str("Name", fromEros.Name).
Str("Addr", fromEros.Addr).
Str("ManuF", fromEros.Manufacturer). //needs to be changed back to fromEros.Manufacturer
Str("ManuF", fromEros.Manufacturer). // needs to be changed back to fromEros.Manufacturer
Int16("Current_RSSI", fromEros.RSSIlast).
Int("Service_Count", len(fromEros.Services)).
Msg("EROS_RECALL")
@ -157,7 +160,7 @@ func (s *Scan) resultHandler(scanAdapter *bluetooth.Adapter, result bluetooth.Sc
Int16("RSSI", rssi).Logger()
// Skipping duplicate results unless tracking mode enabled (to store RSSI as devices move)
if projVars.TrackingMode == false {
if !*projVars.GlobalConfig.CooleanFlags.Tracking {
for _, dev := range s.Device {
if addr == dev.Addr {
return
@ -168,7 +171,8 @@ func (s *Scan) resultHandler(scanAdapter *bluetooth.Adapter, result bluetooth.Sc
// Upon finding new and valid info we update the time for last activity
s.Activity = time.Now()
dev := s.NewDevice(lname, addr, EnumedManuf, rssi)
projVars.ScanAdapter.SetConnectHandler(dev.ConnectHandler)
projVars.GlobalConfig.GetScanAdapter().SetConnectHandler(dev.ConnectHandler)
// Record all the services advertised, append them into the nested struct within Device
for _, uuid := range uuids {
@ -180,7 +184,7 @@ func (s *Scan) resultHandler(scanAdapter *bluetooth.Adapter, result bluetooth.Sc
sublog.Info().Str("UUID", svc.UUID).Msg("SERVICE_DISCOVERED")
}
if !projVars.AttackMode {
if !*projVars.GlobalConfig.CooleanFlags.Attack {
layToRest(dev)
return
}
@ -193,7 +197,9 @@ func (s *Scan) resultHandler(scanAdapter *bluetooth.Adapter, result bluetooth.Sc
// TODO: make timeout values and intervals command line arguments instead of hard coding them
timeout := bluetooth.NewDuration(time.Duration(3) * time.Second)
interval := bluetooth.NewDuration(time.Duration(20) * time.Millisecond)
dev.Conn, connErr = projVars.ScanAdapter.Connect(result.Address, bluetooth.ConnectionParams{ConnectionTimeout: timeout, MinInterval: interval})
dev.Conn, connErr = projVars.GlobalConfig.GetScanAdapter().
Connect(result.Address, bluetooth.ConnectionParams{ConnectionTimeout: timeout, MinInterval: interval})
if connErr != nil {
sublog.Error().Err(connErr).Msg("CONNECT_ERROR")
@ -212,7 +218,7 @@ func (s *Scan) resultHandler(scanAdapter *bluetooth.Adapter, result bluetooth.Sc
return
}
//ServBuf := make([]byte, 255)
// ServBuf := make([]byte, 255)
Charbuf := make([]byte, 255)
targetServices, err = dev.Conn.DiscoverServices(nil)
@ -220,15 +226,15 @@ func (s *Scan) resultHandler(scanAdapter *bluetooth.Adapter, result bluetooth.Sc
sublog.Error().Err(err).Msg("DISCOVER_SERVICE_ERROR")
}
//for SerReadPos, srvcs := range targetServices {
// for SerReadPos, srvcs := range targetServices {
for _, srvcs := range targetServices {
charSer := eros.Service{
UUID: srvcs.String(),
}
sublog.Info().Str("Service UUID", charSer.UUID).
//Int("Bytes", SerReadPos).
//Str("Value", string(ServBuf[:SerReadPos])).
// Int("Bytes", SerReadPos).
// Str("Value", string(ServBuf[:SerReadPos])).
Msg("GATT_SERVICE")
sublog.Debug().Str("status", "Attempting to Retrieve Characteristic List").Msg("ADAPTER_STATUS")
@ -238,31 +244,31 @@ func (s *Scan) resultHandler(scanAdapter *bluetooth.Adapter, result bluetooth.Sc
for _, char := range chars {
ReadPos, _ := char.Read(Charbuf)
//flags := char.Flags
// flags := char.Flags
sublog.Info().Str("UUID", char.UUID().String()).
//Int("Bytes", ReadPos).
// Int("Bytes", ReadPos).
Str("Value", string(Charbuf[:ReadPos])).
//Bool("Read", flags.Read()).
//Bool("Write", flags.Write()).
// Bool("Read", flags.Read()).
// Bool("Write", flags.Write()).
Msg("SERVICE_CHARACTERISTIC")
}
}
// finished with this device
dev.Conn.Disconnect()
_ = dev.Conn.Disconnect()
dev.Connected = false
sublog.Info().Str("Adapter", "Successfully Disconnected From Target").Msg("ADAPTER_STATUS")
layToRest(dev)
//TODO: stop scan and call bluestuff func and pass it the local name value
// TODO: stop scan and call bluestuff func and pass it the local name value
}
func (s *Scan) Stop() error {
// TODO: fix this adapterId situation
err := projVars.ScanAdapter.StopScan()
err := projVars.GlobalConfig.GetScanAdapter().StopScan()
if err != nil {
return err
}
@ -273,24 +279,24 @@ func (s *Scan) Start() error {
s.Started = time.Now()
// create list of devices in the Area of Operation
//log.Debug().Msg("Creating Device Map")
// log.Debug().Msg("Creating Device Map")
// Enable BLE interface
log.Debug().Msg("Enabling Adapter")
err := projVars.ScanAdapter.Enable()
err := projVars.GlobalConfig.GetScanAdapter().Enable()
if err != nil {
return err
}
adapterId := projVars.ScanAdapter.ID
adapterId := projVars.GlobalConfig.GetScanAdapter().ID
log.Info().
Str("ID", adapterId).
Bool("MODE_TRACK", projVars.TrackingMode).
Bool("MODE_ATTACK", projVars.AttackMode).
Bool("MODE_TRACK", *projVars.GlobalConfig.CooleanFlags.Tracking).
Bool("MODE_ATTACK", *projVars.GlobalConfig.CooleanFlags.Attack).
Msg("Starting new ProtoMolecule BLE Scan")
err = projVars.ScanAdapter.Scan(s.resultHandler)
err = projVars.GlobalConfig.GetScanAdapter().Scan(s.resultHandler)
if err != nil {
return err
}

@ -1,63 +0,0 @@
package projVars
import (
"flag"
bluetooth "git.tcp.direct/kayos/prototooth"
"github.com/rs/zerolog"
)
//The initial list of device in the area
var ScanList map[string]string
var InitResults []string
// Place holder for
// File with list of all known Manufacturers
// is probably unneeded*****
var ManuFile = "./ManufUUID.json"
//var to hold service UUIDs
var SrvcUUID bluetooth.UUID
var AdapterInUse = *&bluetooth.Adapter{}
var AttackMode bool = false
var TrackingMode bool = false
//var SrvcUUIDList map[uint32]string
//hold the values for the initial ble scan results..
// ... i.e. the mac and broadcast name string
var C = make(chan bluetooth.ScanResult)
//the BLE adapter --duh
//var Adapter = bluetooth.DefaultAdapter
var ScanAdapter = bluetooth.DefaultAdapter
var AttackAdapter = bluetooth.DefaultAdapter
//Device to be targeted --not fully implemented
//var Target = flag.String("t", "00:00:00:00:00:00", "Target device to attack")
var DFlag = flag.Bool("d", false, "global debug logging and pretty printing")
var AFlag = flag.Bool("a", false, "attack mode")
var TFlag = flag.Bool("t", false, "device tracking mode")
var MFlag = flag.String("m", "0", "json file with manufacturer identifying data to preload into eros")
var WAFlag = flag.String("w", "00:00:00:00:00:00", "MAC address of target")
var Debug bool = false
//flag.Parse()
//var attacker bluetooth.Addresser
var log *zerolog.Logger
//Service UUIDs for testing
var SonosScanTest = bluetooth.New16BitUUID(0xfe07)
var AppleScanTest = bluetooth.New16BitUUID(0x004c)
//var ServiceUUID16Out
//target to attack with wrath
var WrathTarget = bluetooth.Address{}

@ -4,11 +4,12 @@ import (
bluetooth "git.tcp.direct/kayos/prototooth"
"github.com/rs/zerolog"
"github.com/rs/zerolog/log"
projVars "protomolecule/src/vars"
"tinygo.org/x/bluetooth/rawterm"
projVars "protomolecule/src/config"
)
//used for offensive operations
// used for offensive operations
/*
func targetPicture() bluetooth.MAC {
@ -34,16 +35,16 @@ func targetPicture() bluetooth.MAC {
}
*/
func Start() {
func Start(targetUUID bluetooth.UUID) {
var sublog zerolog.Logger
//bluetooth.DefaultAdapter.Connect(targetPicture(), bluetooth.ConnectionParams{})
// bluetooth.DefaultAdapter.Connect(targetPicture(), bluetooth.ConnectionParams{})
//TargetDevice, connectError := projVars.ScanAdapter.Connect(result.Address, bluetooth.ConnectionParams{})
// TargetDevice, connectError := projVars.GlobalConfig.GetScanAdapter().Connect(result.Address, bluetooth.ConnectionParams{})
// Enable BLE interface.
err := projVars.ScanAdapter.Enable()
err := projVars.GlobalConfig.GetScanAdapter().Enable()
if err != nil {
log.Error().
Err(err).
@ -55,16 +56,16 @@ func Start() {
var foundDevice bluetooth.ScanResult
// Scan for NUS peripheral.
log.Info().Msg("Scanning...")
err = projVars.ScanAdapter.Scan(func(adapter *bluetooth.Adapter, foundDevice bluetooth.ScanResult) {
if !foundDevice.AdvertisementPayload.HasServiceUUID() {
err = projVars.GlobalConfig.GetScanAdapter().Scan(func(adapter *bluetooth.Adapter, foundDevice bluetooth.ScanResult) {
if !foundDevice.AdvertisementPayload.HasServiceUUID(targetUUID) {
return
}
// Stop the scan.
err := projVars.ScanAdapter.StopScan()
err := projVars.GlobalConfig.GetScanAdapter().StopScan()
if err != nil {
// Unlikely, but we can't recover from this.
log.Error().Err(err).
log.Panic().Err(err).
Msg("failed to stop scan")
}
})
@ -83,7 +84,7 @@ func Start() {
}
// Found a NUS peripheral. Connect to it.
device, err := projVars.ScanAdapter.Connect(foundDevice.Address, bluetooth.ConnectionParams{})
device, err := projVars.GlobalConfig.GetScanAdapter().Connect(foundDevice.Address, bluetooth.ConnectionParams{})
if err != nil {
sublog.Error().Err(err).
Msg("Failed to connect")
@ -92,7 +93,7 @@ func Start() {
// Connected. Look up the Nordic UART Service.
sublog.Info().Msg("Discovering services...")
services, err := device.DiscoverServices([]bluetooth.UUID{serviceUUID})
services, err := device.DiscoverServices([]bluetooth.UUID{targetUUID})
if err != nil {
log.Error().Err(err).
Msg("Failed to discover the Nordic UART Service")
@ -100,8 +101,8 @@ func Start() {
}
service := services[0]
// Get the two characteristics present in this service.
chars, err := service.DiscoverCharacteristics([]bluetooth.UUID{rxUUID, txUUID})
// Discover all characteristics (we'll filter later)
chars, err := service.DiscoverCharacteristics([]bluetooth.UUID{})
if err != nil {
log.Error().Err(err).
Msg("Failed to discover RX and TX characteristics")