2023-12-04 04:42:15 +00:00
|
|
|
package radio
|
2023-01-09 03:13:40 +00:00
|
|
|
|
2023-06-17 11:38:06 +00:00
|
|
|
import "time"
|
|
|
|
|
|
|
|
// The structure of heartbeats which Wraiths send to c2 to register
|
2023-12-01 16:43:40 +00:00
|
|
|
// their existence.
|
|
|
|
type PacketHeartbeatReq struct {
|
2023-06-17 11:38:06 +00:00
|
|
|
// A unique fingerprint of the family/strain this Wraith belongs to.
|
|
|
|
StrainId string
|
|
|
|
|
|
|
|
// The time when this Wraith was initialised.
|
|
|
|
InitTime time.Time
|
|
|
|
|
|
|
|
// A list of the names of modules installed in this Wraith.
|
|
|
|
Modules []string
|
|
|
|
|
|
|
|
// The operating system Wraith is running on.
|
|
|
|
HostOS string
|
|
|
|
|
|
|
|
// The CPU architecture of the host.
|
|
|
|
HostArch string
|
|
|
|
|
|
|
|
// The system hostname.
|
|
|
|
Hostname string
|
|
|
|
|
|
|
|
// The name of the user under which Wraith is running.
|
|
|
|
HostUser string
|
|
|
|
|
|
|
|
// The ID of the user under which Wraith is running.
|
|
|
|
HostUserId string
|
2023-12-04 04:42:15 +00:00
|
|
|
|
|
|
|
// The host:port combo of this instance's management API.
|
|
|
|
ManagementAPI string
|
2023-11-26 21:14:47 +00:00
|
|
|
}
|
2023-06-17 11:38:06 +00:00
|
|
|
|
2023-12-01 16:43:40 +00:00
|
|
|
type PacketExchangeReq struct {
|
|
|
|
// Wraith SHM commands to be executed.
|
|
|
|
Set map[string]any
|
|
|
|
Get []string
|
|
|
|
Watch []string
|
|
|
|
Unwatch []struct {
|
|
|
|
CellName string
|
|
|
|
WatchId int
|
|
|
|
}
|
|
|
|
Dump bool
|
|
|
|
Prune bool
|
2023-06-17 11:38:06 +00:00
|
|
|
}
|
2023-11-26 21:14:47 +00:00
|
|
|
|
2023-12-01 16:43:40 +00:00
|
|
|
type PacketExchangeRes struct {
|
|
|
|
// Result of the executed SHM commands.
|
|
|
|
Set []string // The cells that have been updated.
|
|
|
|
Get map[string]any // The contents of the requested cells mapped to their names.
|
|
|
|
Watch map[string]int // The WatchIds of the cells that are watched because of this command, mapped to the cell names.
|
2023-12-04 01:23:53 +00:00
|
|
|
Unwatch []struct {
|
|
|
|
CellName string
|
|
|
|
WatchId int
|
|
|
|
} // The cell names of the cells that have been unwatched.
|
|
|
|
Dump map[string]any // The full contents of the memory (if requested).
|
|
|
|
Prune int // How many cells have been pruned.
|
2023-11-26 21:14:47 +00:00
|
|
|
}
|