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

rpc

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: 43 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Transport contextKey = iota
	Operator
)

Variables

View Source
var (
	// ErrInvalidSessionID - Invalid Session ID in request
	ErrInvalidSessionID = status.Error(codes.InvalidArgument, "Invalid session ID")

	// ErrMissingRequestField - Returned when a request does not contain a  implantpb.Request
	ErrMissingRequestField = status.Error(codes.InvalidArgument, "Missing session request field")
	// ErrAsyncNotSupported - Unsupported mode / command type
	ErrAsyncNotSupported = status.Error(codes.Unavailable, "Async not supported for this command")
	// ErrDatabaseFailure - Generic database failure error (real error is logged)
	ErrDatabaseFailure = status.Error(codes.Internal, "Database operation failed")

	// ErrInvalidName - Invalid name
	ErrInvalidName     = status.Error(codes.InvalidArgument, "Invalid session name, alphanumerics and _-. only")
	ErrNotFoundSession = status.Error(codes.NotFound, "Session ID not found")
	ErrNotFoundTask    = status.Error(codes.NotFound, "Task ID not found")

	ErrNotFoundListener    = status.Error(codes.NotFound, "Listener not found")
	ErrNotFoundPipeline    = status.Error(codes.NotFound, "Pipeline not found")
	ErrNotFoundClientName  = status.Error(codes.NotFound, "Client name not found")
	ErrNotFoundTaskContent = status.Error(codes.NotFound, "Task content not found")
	ErrTaskIndexExceed     = status.Error(codes.NotFound, "task index id exceed total")
)

Functions

func InitLogs

func InitLogs(debug bool)

func StartClientListener

func StartClientListener(address string) (*grpc.Server, net.Listener, error)

StartClientListener - Start a mutual TLS listener

Types

type GenericRequest

type GenericRequest struct {
	proto.Message
	Task    *core.Task
	Count   int
	Session *core.Session
}

func (*GenericRequest) HandlerResponse added in v0.0.2

func (r *GenericRequest) HandlerResponse(ch chan *implantpb.Spite, typ types.MsgName, callbacks ...func(spite *implantpb.Spite))

func (*GenericRequest) InitSpite added in v0.0.2

func (r *GenericRequest) InitSpite() (*implantpb.Spite, error)

func (*GenericRequest) NewSpite

func (r *GenericRequest) NewSpite(msg proto.Message) (*implantpb.Spite, error)

func (*GenericRequest) SetCallback

func (r *GenericRequest) SetCallback(callback func())

type Server

func NewServer

func NewServer() *Server

NewServer - Create new server instance

func (*Server) AddClient

func (rpc *Server) AddClient(ctx context.Context, req *rootpb.Operator) (*rootpb.Response, error)

func (*Server) AddListener

func (rpc *Server) AddListener(ctx context.Context, req *rootpb.Operator) (*rootpb.Response, error)

func (*Server) BasicSessionOP

func (rpc *Server) BasicSessionOP(ctx context.Context, req *clientpb.BasicUpdateSession) (*clientpb.Empty, error)

func (*Server) Broadcast

func (rpc *Server) Broadcast(ctx context.Context, req *clientpb.Event) (*clientpb.Empty, error)

func (*Server) Bypass added in v0.0.2

func (rpc *Server) Bypass(ctx context.Context, req *implantpb.BypassRequest) (*clientpb.Task, error)

func (*Server) CancelTask added in v0.0.2

func (rpc *Server) CancelTask(ctx context.Context, req *implantpb.Request) (*clientpb.Task, error)

func (*Server) Cat

func (rpc *Server) Cat(ctx context.Context, req *implantpb.Request) (*clientpb.Task, error)

func (*Server) Cd

func (rpc *Server) Cd(ctx context.Context, req *implantpb.Request) (*clientpb.Task, error)

func (*Server) Chmod

func (rpc *Server) Chmod(ctx context.Context, req *implantpb.Request) (*clientpb.Task, error)

func (*Server) Chown

func (rpc *Server) Chown(ctx context.Context, req *implantpb.ChownRequest) (*clientpb.Task, error)

func (*Server) Clear added in v0.0.2

func (rpc *Server) Clear(ctx context.Context, req *implantpb.Request) (*clientpb.Task, error)

func (*Server) Cp

func (rpc *Server) Cp(ctx context.Context, req *implantpb.Request) (*clientpb.Task, error)

func (*Server) Curl

func (rpc *Server) Curl(ctx context.Context, req *implantpb.CurlRequest) (*clientpb.Task, error)

func (*Server) Download

func (rpc *Server) Download(ctx context.Context, req *implantpb.DownloadRequest) (*clientpb.Task, error)

Download - Download a file from implant

func (*Server) Env

func (rpc *Server) Env(ctx context.Context, req *implantpb.Request) (*clientpb.Task, error)

func (*Server) Events

func (rpc *Server) Events(_ *clientpb.Empty, stream clientrpc.MaliceRPC_EventsServer) error

func (*Server) Execute

func (rpc *Server) Execute(ctx context.Context, req *implantpb.ExecRequest) (*clientpb.Task, error)

func (*Server) ExecuteAddon added in v0.0.2

func (rpc *Server) ExecuteAddon(ctx context.Context, req *implantpb.ExecuteAddon) (*clientpb.Task, error)

func (*Server) ExecuteArmory added in v0.0.2

func (rpc *Server) ExecuteArmory(ctx context.Context, req *implantpb.ExecuteBinary) (*clientpb.Task, error)

func (*Server) ExecuteAssembly

func (rpc *Server) ExecuteAssembly(ctx context.Context, req *implantpb.ExecuteBinary) (*clientpb.Task, error)

func (*Server) ExecuteBof

func (rpc *Server) ExecuteBof(ctx context.Context, req *implantpb.ExecuteBinary) (*clientpb.Task, error)

func (*Server) ExecuteDll

func (rpc *Server) ExecuteDll(ctx context.Context, req *implantpb.ExecuteBinary) (*clientpb.Task, error)

func (*Server) ExecuteEXE added in v0.0.2

func (rpc *Server) ExecuteEXE(ctx context.Context, req *implantpb.ExecuteBinary) (*clientpb.Task, error)

func (*Server) ExecutePowershell

func (rpc *Server) ExecutePowershell(ctx context.Context, req *implantpb.ExecuteBinary) (*clientpb.Task, error)

func (*Server) ExecuteShellcode

func (rpc *Server) ExecuteShellcode(ctx context.Context, req *implantpb.ExecuteBinary) (*clientpb.Task, error)

func (*Server) GenericHandler added in v0.0.2

func (rpc *Server) GenericHandler(ctx context.Context, req *GenericRequest) (chan *implantpb.Spite, error)

func (*Server) GetAlivedSessions

func (rpc *Server) GetAlivedSessions(ctx context.Context, _ *clientpb.Empty) (*clientpb.Sessions, error)

func (*Server) GetAllTaskContent

func (rpc *Server) GetAllTaskContent(ctx context.Context, req *clientpb.Task) (*clientpb.TaskContexts, error)

func (*Server) GetBasic

func (rpc *Server) GetBasic(ctx context.Context, _ *clientpb.Empty) (*clientpb.Basic, error)

func (*Server) GetClients

func (rpc *Server) GetClients(ctx context.Context, req *clientpb.Empty) (*clientpb.Clients, error)

func (*Server) GetListeners

func (rpc *Server) GetListeners(ctx context.Context, req *clientpb.Empty) (*clientpb.Listeners, error)

func (*Server) GetSession

func (rpc *Server) GetSession(ctx context.Context, req *clientpb.SessionRequest) (*clientpb.Session, error)

func (*Server) GetSessions

func (rpc *Server) GetSessions(ctx context.Context, _ *clientpb.Empty) (*clientpb.Sessions, error)

func (*Server) GetTaskContent

func (rpc *Server) GetTaskContent(ctx context.Context, req *clientpb.Task) (*clientpb.TaskContext, error)

func (*Server) GetTaskFiles added in v0.0.2

func (rpc *Server) GetTaskFiles(ctx context.Context, req *clientpb.Session) (*clientpb.Files, error)

func (*Server) GetTasks

func (rpc *Server) GetTasks(ctx context.Context, session *clientpb.Session) (*clientpb.Tasks, error)

func (*Server) Info

func (rpc *Server) Info(ctx context.Context, req *implantpb.Request) (*clientpb.Task, error)

func (*Server) JobStream

func (rpc *Server) JobStream(stream listenerrpc.ListenerRPC_JobStreamServer) error

func (*Server) Kill

func (rpc *Server) Kill(ctx context.Context, req *implantpb.Request) (*clientpb.Task, error)

func (*Server) ListAddon added in v0.0.2

func (rpc *Server) ListAddon(ctx context.Context, req *implantpb.Request) (*clientpb.Task, error)

func (*Server) ListClientsAuth added in v0.0.2

func (rpc *Server) ListClientsAuth(ctx context.Context, req *rootpb.Operator) (*clientpb.Clients, error)

func (*Server) ListJobs added in v0.0.2

func (rpc *Server) ListJobs(ctx context.Context, req *clientpb.Empty) (*lispb.Pipelines, error)

func (*Server) ListListenersAuth added in v0.0.2

func (rpc *Server) ListListenersAuth(ctx context.Context, req *rootpb.Operator) (*clientpb.Listeners, error)

func (*Server) ListModule added in v0.0.2

func (rpc *Server) ListModule(ctx context.Context, req *implantpb.Request) (*clientpb.Task, error)

func (*Server) ListTcpPipelines added in v0.0.2

func (rpc *Server) ListTcpPipelines(ctx context.Context, req *lispb.ListenerName) (*lispb.Pipelines, error)

func (*Server) ListWebsites

func (rpc *Server) ListWebsites(ctx context.Context, req *lispb.ListenerName) (*lispb.Websites, error)

func (*Server) LoadAddon added in v0.0.2

func (rpc *Server) LoadAddon(ctx context.Context, req *implantpb.LoadAddon) (*clientpb.Task, error)

func (*Server) LoadModule

func (rpc *Server) LoadModule(ctx context.Context, req *implantpb.LoadModule) (*clientpb.Task, error)

func (*Server) LoginClient

func (rpc *Server) LoginClient(ctx context.Context, req *clientpb.LoginReq) (*clientpb.Client, error)

func (*Server) Ls

func (rpc *Server) Ls(ctx context.Context, req *implantpb.Request) (*clientpb.Task, error)

func (*Server) Mkdir

func (rpc *Server) Mkdir(ctx context.Context, req *implantpb.Request) (*clientpb.Task, error)

func (*Server) Mv

func (rpc *Server) Mv(ctx context.Context, req *implantpb.Request) (*clientpb.Task, error)

func (*Server) Netstat

func (rpc *Server) Netstat(ctx context.Context, req *implantpb.Request) (*clientpb.Task, error)

func (*Server) NewPipeline added in v0.0.2

func (rpc *Server) NewPipeline(ctx context.Context, req *lispb.Pipeline) (*clientpb.Empty, error)

func (*Server) NewWebsite added in v0.0.2

func (rpc *Server) NewWebsite(ctx context.Context, req *lispb.Pipeline) (*clientpb.Empty, error)

func (*Server) Notify added in v0.0.2

func (rpc *Server) Notify(ctx context.Context, req *clientpb.Event) (*clientpb.Empty, error)

func (*Server) Ping

func (rpc *Server) Ping(ctx context.Context, req *implantpb.Ping) (*implantpb.Empty, error)

func (*Server) Ps

func (rpc *Server) Ps(ctx context.Context, req *implantpb.Request) (*clientpb.Task, error)

func (*Server) Pwd

func (rpc *Server) Pwd(ctx context.Context, req *implantpb.Request) (*clientpb.Task, error)

func (*Server) RefreshModule added in v0.0.2

func (rpc *Server) RefreshModule(ctx context.Context, req *implantpb.Request) (*clientpb.Task, error)

func (*Server) Register

func (rpc *Server) Register(ctx context.Context, req *lispb.RegisterSession) (*implantpb.Empty, error)

func (*Server) RegisterListener

func (rpc *Server) RegisterListener(ctx context.Context, req *lispb.RegisterListener) (*implantpb.Empty, error)

func (*Server) RegisterPipeline

func (rpc *Server) RegisterPipeline(ctx context.Context, req *lispb.Pipeline) (*implantpb.Empty, error)

func (*Server) RegisterWebsite

func (rpc *Server) RegisterWebsite(ctx context.Context, req *lispb.Pipeline) (*implantpb.Empty, error)

func (*Server) RemoveClient

func (rpc *Server) RemoveClient(ctx context.Context, req *rootpb.Operator) (*rootpb.Response, error)

func (*Server) RemoveListener

func (rpc *Server) RemoveListener(ctx context.Context, req *rootpb.Operator) (*rootpb.Response, error)

func (*Server) Rm

func (rpc *Server) Rm(ctx context.Context, req *implantpb.Request) (*clientpb.Task, error)

func (*Server) SessionEvent added in v0.0.2

func (rpc *Server) SessionEvent(ctx context.Context, req *clientpb.Event) (*clientpb.Empty, error)

func (*Server) Setenv

func (rpc *Server) Setenv(ctx context.Context, req *implantpb.Request) (*clientpb.Task, error)

func (*Server) SpiteStream

func (rpc *Server) SpiteStream(stream listenerrpc.ListenerRPC_SpiteStreamServer) error

func (*Server) StartTcpPipeline

func (rpc *Server) StartTcpPipeline(ctx context.Context, req *lispb.CtrlPipeline) (*clientpb.Empty, error)

func (*Server) StartWebsite

func (rpc *Server) StartWebsite(ctx context.Context, req *lispb.CtrlPipeline) (*clientpb.Empty, error)

func (*Server) StopTcpPipeline

func (rpc *Server) StopTcpPipeline(ctx context.Context, req *lispb.CtrlPipeline) (*clientpb.Empty, error)

func (*Server) StopWebsite

func (rpc *Server) StopWebsite(ctx context.Context, req *lispb.CtrlPipeline) (*clientpb.Empty, error)

func (*Server) StreamGenericHandler added in v0.0.2

func (rpc *Server) StreamGenericHandler(ctx context.Context, req *GenericRequest) (chan *implantpb.Spite, chan *implantpb.Spite, error)

StreamGenericHandler - Generic handler for async request/response's for beacon tasks

func (*Server) Sync

func (rpc *Server) Sync(ctx context.Context, req *clientpb.Sync) (*clientpb.SyncResp, error)

func (*Server) SysInfo

func (rpc *Server) SysInfo(ctx context.Context, req *implantpb.SysInfo) (*implantpb.Empty, error)

func (*Server) Unsetenv

func (rpc *Server) Unsetenv(ctx context.Context, req *implantpb.Request) (*clientpb.Task, error)

func (*Server) Upload

func (rpc *Server) Upload(ctx context.Context, req *implantpb.UploadRequest) (*clientpb.Task, error)

Upload - Upload a file from the remote file system

func (*Server) UploadWebsite added in v0.0.2

func (rpc *Server) UploadWebsite(ctx context.Context, req *lispb.WebsiteAssets) (*clientpb.Empty, error)

func (*Server) WaitTaskContent

func (rpc *Server) WaitTaskContent(ctx context.Context, req *clientpb.Task) (*clientpb.TaskContext, error)

func (*Server) WaitTaskFinish added in v0.0.2

func (rpc *Server) WaitTaskFinish(ctx context.Context, req *clientpb.Task) (*clientpb.TaskContext, error)

func (*Server) Website

func (rpc *Server) Website(ctx context.Context, req *lispb.Website) (*lispb.Website, error)

Website - Get one website

func (*Server) WebsiteAddContent

func (rpc *Server) WebsiteAddContent(ctx context.Context, req *lispb.WebsiteAddContent) (*lispb.Website, error)

WebsiteAddContent - Add content to a website, the website is created if `name` does not exist

func (*Server) WebsiteRemove

func (rpc *Server) WebsiteRemove(ctx context.Context, req *lispb.Website) (*clientpb.Empty, error)

func (*Server) WebsiteRemoveContent

func (rpc *Server) WebsiteRemoveContent(ctx context.Context, req *lispb.WebsiteRemoveContent) (*lispb.Website, error)

WebsiteRemoveContent - Remove specific content from a website

func (*Server) WebsiteUpdateContent

func (rpc *Server) WebsiteUpdateContent(ctx context.Context, req *lispb.WebsiteAddContent) (*lispb.Website, error)

WebsiteUpdateContent - Update specific content from a website, currently you can only the update Content-type field

func (*Server) Websites

func (rpc *Server) Websites(ctx context.Context, _ *clientpb.Empty) (*lispb.Websites, error)

func (*Server) Whoami

func (rpc *Server) Whoami(ctx context.Context, req *implantpb.Request) (*clientpb.Task, error)

Jump to

Keyboard shortcuts

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