console

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2026 License: AGPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run() error

Run starts the readline-based interactive console.

func RunWith added in v0.1.4

func RunWith(mod sdk.Exploit) error

RunWith starts the readline-based console with an optional pre-selected module.

Types

type ClearOutputMsg added in v0.3.0

type ClearOutputMsg = types.ClearOutputMsg

Shared message type aliases (from pkg/types to break import cycles).

type Console

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

Console holds the state for the interactive REPL.

func New added in v0.3.0

func New() *Console

New creates a Console with registered commands.

func (*Console) ApplyFuzzyResult added in v0.3.0

func (c *Console) ApplyFuzzyResult(context, selected string)

ApplyFuzzyResult handles the result of a fuzzy selection.

func (*Console) BuildPrompt added in v0.3.0

func (c *Console) BuildPrompt() string

BuildPrompt returns the styled prompt string.

func (*Console) Exec added in v0.3.0

func (c *Console) Exec(line string) bool

Exec runs a console command line. Returns true if the console should exit.

func (*Console) Mod added in v0.3.0

func (c *Console) Mod() sdk.Exploit

Mod returns the currently selected module.

func (*Console) OptionNames added in v0.3.0

func (c *Console) OptionNames() []string

OptionNames returns option names for completion.

func (*Console) Options added in v0.3.0

func (c *Console) Options() []Option

Options returns the current module options.

func (*Console) Program added in v0.3.0

func (c *Console) Program() MsgSender

Program returns the message sender.

func (*Console) SendClear added in v0.3.0

func (c *Console) SendClear()

SendClear sends a clear message to the TUI.

func (*Console) SessionHandler added in v0.3.0

func (c *Console) SessionHandler() c2.SessionHandler

SessionHandler returns the C2 session handler, or nil.

func (*Console) SetMod added in v0.3.0

func (c *Console) SetMod(mod sdk.Exploit)

SetMod sets the current module and initializes options.

func (*Console) SetOpt added in v0.3.0

func (c *Console) SetOpt(name, value string) bool

SetOpt sets a module option value.

func (*Console) SetProgram added in v0.3.0

func (c *Console) SetProgram(p MsgSender)

SetProgram sets the message sender (TUI program) for async communication.

func (*Console) ShutdownBackend added in v0.3.0

func (c *Console) ShutdownBackend()

ShutdownBackend shuts down the C2 backend.

func (*Console) UseByName added in v0.3.0

func (c *Console) UseByName(name string)

UseByName selects a module by name or numeric index.

type FuzzyItem added in v0.3.0

type FuzzyItem = types.FuzzyItem

type FuzzySelectMsg added in v0.3.0

type FuzzySelectMsg = types.FuzzySelectMsg

type MsgSender added in v0.3.0

type MsgSender interface {
	Send(msg any)
}

MsgSender is an interface for sending messages to the TUI program. Avoids importing bubbletea in console package.

type Option added in v0.3.0

type Option = types.Option

Option is the shared option type.

type SessionInteractMsg added in v0.3.0

type SessionInteractMsg = types.SessionInteractMsg

Jump to

Keyboard shortcuts

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