Help us shape the future of Go! Take the 2026 Go Developer Survey

console

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 21, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFoundTask    = errors.New("task not found")
	ErrNotFoundSession = errors.New("session not found")
	Prompt             = "IOM"
	LogLevel           = logs.Warn
	Log                = logs.NewLogger(LogLevel)
	MuteLog            = logs.NewLogger(logs.Important)
)

Functions

func Start

func Start(bindCmds ...BindCmds) error

Start - Console entrypoint

Types

type ActiveTarget

type ActiveTarget struct {
	// contains filtered or unexported fields
}

func (*ActiveTarget) Background

func (s *ActiveTarget) Background()

Background - Background the active session

func (*ActiveTarget) Context

func (s *ActiveTarget) Context() context.Context

func (*ActiveTarget) Get

func (s *ActiveTarget) Get() *clientpb.Session

GetSessionInteractive - Get the active target(s)

func (*ActiveTarget) GetInteractive

func (s *ActiveTarget) GetInteractive() *clientpb.Session

func (*ActiveTarget) Set

func (s *ActiveTarget) Set(session *clientpb.Session)

Set - Change the active session

type BindCmds

type BindCmds func(console *Console)

BindCmds - Bind extra commands to the app object

type Client

type Client struct {
	*clientpb.Client
}

type Console

type Console struct {
	App          *grumble.App
	ActiveTarget *ActiveTarget
	Settings     *assets.Settings
	Callbacks    *sync.Map
	Observers    map[string]*Observer
	*ServerStatus
}

func (*Console) AddAliasCommand

func (c *Console) AddAliasCommand(cmd *grumble.Command)

func (*Console) AddExtensionCommand

func (c *Console) AddExtensionCommand(cmd *grumble.Command)

func (*Console) AddObserver

func (c *Console) AddObserver(session *clientpb.Session) string

AddObserver - Observers to notify when the active session changes

func (*Console) DisableImplantCommands

func (c *Console) DisableImplantCommands()

func (*Console) EnableImplantCommands

func (c *Console) EnableImplantCommands()

func (*Console) GetInteractive

func (c *Console) GetInteractive() *clientpb.Session

func (*Console) Login

func (c *Console) Login(config *mtls.ClientConfig) error

func (*Console) RefreshActiveSession

func (c *Console) RefreshActiveSession()

func (*Console) RemoveObserver

func (c *Console) RemoveObserver(observerID string)

func (*Console) SessionLog

func (c *Console) SessionLog(sid string) *logs.Logger

func (*Console) UpdatePrompt

func (c *Console) UpdatePrompt()

type Listener

type Listener struct {
	*clientpb.Listener
}

type Observer

type Observer struct {
	// contains filtered or unexported fields
}

Observer - A function to call when the sessions changes

func NewObserver

func NewObserver(session *clientpb.Session) *Observer

func (*Observer) Logger

func (o *Observer) Logger() *logs.Logger

func (*Observer) SessionId

func (o *Observer) SessionId() string

type ServerStatus

type ServerStatus struct {
	Rpc       clientrpc.MaliceRPCClient
	Info      *clientpb.Basic
	Clients   []*Client
	Listeners []*Listener
	Sessions  map[string]*clientpb.Session
	Callbacks *sync.Map
	Alive     bool
}

func InitServerStatus

func InitServerStatus(conn *grpc.ClientConn) (*ServerStatus, error)

func (*ServerStatus) AddCallback

func (s *ServerStatus) AddCallback(taskId uint32, callback TaskCallback)

func (*ServerStatus) CancelCallback

func (s *ServerStatus) CancelCallback(taskId uint32)

func (*ServerStatus) EventHandler

func (s *ServerStatus) EventHandler()

func (*ServerStatus) UpdateSession

func (s *ServerStatus) UpdateSession(sid string) error

func (*ServerStatus) UpdateSessions

func (s *ServerStatus) UpdateSessions(all bool) error

func (*ServerStatus) UpdateTasks

func (s *ServerStatus) UpdateTasks(session *clientpb.Session) error

type TaskCallback

type TaskCallback func(resp proto.Message)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL