repl

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2024 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFoundSession = errors.New("session not found")
	Prompt             = "IOM"
)
View Source
var (
	ErrorAlreadyScriptName = errors.New("already exist script name")
)

Functions

func CmdExists

func CmdExists(name string, cmd *cobra.Command) bool

func Login

func Login(con *Console, config *mtls.ClientConfig) error

func NewConfigLogin

func NewConfigLogin(con *Console, yamlFile string)

func WrapImplantCallback

func WrapImplantCallback(callback ImplantPluginCallback) intermediate.ImplantCallback

func WrapImplantFunc

func WrapImplantFunc(con *Console, fun interface{}, callback ImplantPluginCallback) *intermediate.InternalFunc

func WrapServerFunc

func WrapServerFunc(con *Console, fun interface{}) *intermediate.InternalFunc

Types

type BindCmds

type BindCmds func(console *Console) console.Commands

BindCmds - Bind extra commands to the app object

type Console

type Console struct {
	//*core.ActiveTarget
	*core.ServerStatus
	*Plugins
	Log      *core.Logger
	App      *console.Console
	Settings *assets.Settings
}

func NewConsole

func NewConsole() (*Console, error)

Start - Console entrypoint

func (*Console) Context

func (c *Console) Context() context.Context

func (*Console) GetPrompt

func (c *Console) GetPrompt() string

func (*Console) GetSession

func (c *Console) GetSession(sessionID string) *core.Session

func (*Console) ImplantMenu

func (c *Console) ImplantMenu() *cobra.Command

func (*Console) NewConsole

func (c *Console) NewConsole()

func (*Console) RefreshActiveSession

func (c *Console) RefreshActiveSession()

func (*Console) RegisterImplantFunc

func (c *Console) RegisterImplantFunc(name string, fn interface{},
	bname string, bfn interface{},
	pluginCallback ImplantPluginCallback, implantCallback intermediate.ImplantCallback)

func (*Console) RegisterServerFunc

func (c *Console) RegisterServerFunc(name string, fn interface{}) error

func (*Console) Start

func (c *Console) Start(bindCmds ...BindCmds) error

func (*Console) SwitchImplant

func (c *Console) SwitchImplant(sess *core.Session)

type ImplantPluginCallback

type ImplantPluginCallback func(content *clientpb.TaskContext) (interface{}, error)

type Plugin

type Plugin struct {
	*plugin.Plugin
	LuaVM *lua.LState
	CMDs  []*cobra.Command
}

func NewPlugin

func NewPlugin(manifest *plugin.MalManiFest, con *Console) (*Plugin, error)

func (*Plugin) InitLua

func (plug *Plugin) InitLua(con *Console) error

type Plugins

type Plugins struct {
	Plugins map[string]*Plugin
}

func NewPlugins

func NewPlugins() *Plugins

func (*Plugins) LoadLuaScript

func (plugins *Plugins) LoadLuaScript(manifest *plugin.MalManiFest, con *Console) (*Plugin, error)

func (*Plugins) LoadPlugin

func (plugins *Plugins) LoadPlugin(manifest *plugin.MalManiFest, con *Console) (*Plugin, error)

Jump to

Keyboard shortcuts

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