Merge branch 'development' of ssh://git.tcp.direct:2222/freqy/protomolecule into development

This commit is contained in:
freqy 2021-06-10 12:25:49 -07:00
commit ea531e6665
5 changed files with 3722 additions and 15 deletions

File diff suppressed because it is too large Load Diff

Binary file not shown.

34
src/cortazar/cortazar.go Normal file

@ -0,0 +1,34 @@
package cortazar
//Intended to be used as the target analysis package
//for example
/*
1. attempt bonding (LTK exchange) with target, while in aggressive attack mode
2. store current LTK associated with target to device in eros
3. disconnect and forget target
4. recconect to target, pair, bond, store LTK, disconnect, forget -- repeatTK
5. compare LTKs for entropy
** could also be used for link key which is the pin established during pairing
*/
//---------
/*
device metrics
- location and device type/manufacturer/etc...
- when and where a device is seen over time
*/
//-----------
/*
*/

@ -1,13 +1,15 @@
package eros
import (
"git.tcp.direct/kayos/prototooth"
"time"
bluetooth "git.tcp.direct/kayos/prototooth"
)
type Permissions struct {
Read string
Write string
Read string
Write string
Notify string
}
type Characteristic struct {
@ -25,7 +27,6 @@ type Service struct {
Characteristic []Characteristic
}
type ManufData struct {
Entries []Manufacturer
}
@ -45,7 +46,7 @@ type Manufacturer struct {
// Exploit - BLE service exploit details to be marshalled into json before stored in bitcask
type Exploit struct {
Name string
Target string
Target string // Should prabably be a struct of some sort since exploits target service chars
Category string
Vector Vector
Payload Payload
@ -63,11 +64,14 @@ type Payload struct {
// Device will hold details about the discoverd device
type Device struct {
Name string
Addr string
Manufacturer string
RSSIlast int16
RSSIhist map[time.Time]int16
Name string // local name of the device
Addr string // Broadcast MAC
Manufacturer string // Manufacturer Data if broadcast
RSSIlast int16 // Most Current RSSI
RSSIhist map[time.Time]int16 // Last RSSI readings
Alias string // Alias given to device
Trusted bool // Is is in the trusted devices
WakeAllowed bool // Does the device allow wake
// Services - see Service struct
Services []Service

@ -250,7 +250,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 = TargetDevice.DiscoverServices(nil)
@ -258,14 +258,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")
@ -275,8 +276,13 @@ func (s *Scan) resultHandler(scanAdapter *bluetooth.Adapter, result bluetooth.Sc
for _, char := range chars {
ReadPos, _ := char.Read(Charbuf)
//flags := char.Flags
sublog.Info().Str("UUID", char.UUID().String()).
Int("Bytes", ReadPos).Str("Value", string(Charbuf[:ReadPos])).
//Int("Bytes", ReadPos).
Str("Value", string(Charbuf[:ReadPos])).
//Bool("Read", flags.Read()).
//Bool("Write", flags.Write()).
Msg("SERVICE_CHARACTERISTIC")
}