intermediate

package
v0.0.4 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	GroupEncode   = "encode"
	GroupArtifact = "artifact"
)
View Source
const (
	BeaconPackage  = "beacon"
	RpcPackage     = "rpc"
	ArmoryPackage  = "armory"
	BuiltinPackage = "builtin"
)

Variables

View Source
var (
	ErrFunctionNotFound = errors.New("function not found")
	WarnArgsMismatch    = errors.New("arguments mismatch")
	WarnReturnMismatch  = errors.New("return values mismatch")
)
View Source
var InternalFunctions = make(map[string]*InternalFunc)

Functions

func AddHelper added in v0.0.3

func AddHelper(name string, helper *Helper) error

func ConvertArgsToExpectedTypes added in v0.0.3

func ConvertArgsToExpectedTypes(args []interface{}, argTypes []reflect.Type) ([]interface{}, error)

Convert the []interface{} and map[string]interface{} to the expected types defined in ArgTypes

func ConvertGoValueToLua

func ConvertGoValueToLua(L *lua.LState, value interface{}) lua.LValue

将 Lua 的 lua.LValue 转换为 Go 的 interface{}

func ConvertGoValueToLuaType

func ConvertGoValueToLuaType(L *lua.LState, t reflect.Type) string

func ConvertLuaTableToGo added in v0.0.3

func ConvertLuaTableToGo(tbl *lua.LTable) interface{}

ConvertLuaTableToGo takes a Lua table and converts it into a Go slice or map

func ConvertLuaValueToGo

func ConvertLuaValueToGo(value lua.LValue) interface{}

func ConvertNumericType

func ConvertNumericType(value int64, kind reflect.Kind) interface{}

func GetGlobalResourceFile added in v0.0.3

func GetGlobalResourceFile(filename string) (string, error)

func GetResourceFile added in v0.0.3

func GetResourceFile(pluginName, filename string) (string, error)

func GetResult added in v0.0.3

func GetResult(rpc clientrpc.MaliceRPCClient, task *clientpb.Task, index int32) (*clientpb.TaskContext, error)

func NewBinary added in v0.0.3

func NewBinary(module string, path string, args []string, output bool, timeout uint32, arch string, process string, sac *implantpb.SacrificeProcess) (*implantpb.ExecuteBinary, error)

func NewExecutable added in v0.0.3

func NewExecutable(module string, path string, args []string, arch string, sac *implantpb.SacrificeProcess) (*implantpb.ExecuteBinary, error)

func NewSacrificeProcessMessage added in v0.0.3

func NewSacrificeProcessMessage(ppid int64, hidden, block_dll, disable_etw bool, argue string) (*implantpb.SacrificeProcess, error)

func ParseAssembly added in v0.0.3

func ParseAssembly(spite *implantpb.Spite) (string, error)

func ParseStatus added in v0.0.3

func ParseStatus(spite *implantpb.Spite) (bool, error)

func PrintTask added in v0.0.3

func PrintTask(task *clientpb.TaskContext) (*implantpb.Spite, error)

func RegisterBuiltin added in v0.0.3

func RegisterBuiltin(rpc clientrpc.MaliceRPCClient)

func RegisterCustomBuiltin added in v0.0.3

func RegisterCustomBuiltin(rpc clientrpc.MaliceRPCClient)

func RegisterEncodeFunc added in v0.0.3

func RegisterEncodeFunc(rpc clientrpc.MaliceRPCClient)

func RegisterFunction

func RegisterFunction(name string, fn interface{})

func RegisterGRPCBuiltin added in v0.0.3

func RegisterGRPCBuiltin(rpc clientrpc.MaliceRPCClient)

func RegisterInternalDoneCallback added in v0.0.3

func RegisterInternalDoneCallback(name string, callback ImplantCallback) error

func RegisterInternalFunc

func RegisterInternalFunc(pkg, name string, fn *InternalFunc, callback ImplantCallback) error

RegisterInternalFunc 注册并生成 Lua 定义文件

func WaitResult added in v0.0.3

func WaitResult(rpc clientrpc.MaliceRPCClient, task *clientpb.Task) (*clientpb.TaskContext, error)

func WrapFuncForLua

func WrapFuncForLua(fn *InternalFunc) lua.LGFunction

Types

type BuiltinCallback added in v0.0.3

type BuiltinCallback func(content interface{}) (bool, error)

type EventCondition added in v0.0.3

type EventCondition struct {
	Type        string
	Op          string
	MessageType string
	TaskId      string
	SessionId   string
	ListenerId  string
	PipelineId  string
}

func (*EventCondition) Match added in v0.0.3

func (cond *EventCondition) Match(e *clientpb.Event) bool

type Helper added in v0.0.3

type Helper struct {
	Group   string
	Short   string
	Long    string
	Input   []string
	Output  []string
	Example string
	CMDName string
}

func (*Helper) FormatInput added in v0.0.3

func (help *Helper) FormatInput() ([]string, []string)

func (*Helper) FormatOutput added in v0.0.3

func (help *Helper) FormatOutput() ([]string, []string)

type ImplantCallback

type ImplantCallback func(content *clientpb.TaskContext) (string, error)

callback to callee, like lua or go, return string

type InternalFunc

type InternalFunc struct {
	Name           string
	Package        string
	RawName        string
	Raw            interface{}
	Func           func(...interface{}) (interface{}, error)
	HasLuaCallback bool
	NoCache        bool
	FinishCallback ImplantCallback // implant callback
	DoneCallback   ImplantCallback
	ArgTypes       []reflect.Type
	ReturnTypes    []reflect.Type
	*Helper
}

func GetInternalFuncSignature

func GetInternalFuncSignature(fn interface{}) *InternalFunc

获取函数的参数和返回值类型

func WrapInternalFunc

func WrapInternalFunc(fun interface{}) *InternalFunc

func (*InternalFunc) String added in v0.0.3

func (fn *InternalFunc) String() string

type OnEventFunc added in v0.0.3

type OnEventFunc func(*clientpb.Event) (bool, error)

Jump to

Keyboard shortcuts

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