rpc

package
v0.0.0-...-cbfb2b3 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotAuth error = errors.New("client is not authenticated (no token)")

Functions

This section is empty.

Types

type AuthLoginReq

type AuthLoginReq struct {
	Method   string
	Username string
	Password string
}

auth.login request

type AuthLoginResp

type AuthLoginResp struct {
	Result Result `msgpack:"result"`
	Token  string `msgpack:"token"`
}

auth.login response

type AuthTokenAddReq

type AuthTokenAddReq struct {
	Method   string
	Token    string
	NewToken string
}

auth.token_add request

type AuthTokenGenerateResp

type AuthTokenGenerateResp struct {
	Result Result `msgpack:"result"`
	Token  string `msgpack:"token"`
}

auth.token_generate response

type AuthTokenListResp

type AuthTokenListResp struct {
	Tokens []string `msgpack:"tokens"`
}

auth.token_list response

type AuthTokenRemoveReq

type AuthTokenRemoveReq struct {
	Method   string
	Token    string
	DelToken string
}

auth.token_remove request

type ConsoleCreateResp

type ConsoleCreateResp struct {
	Id     int    `msgpack:"id"`
	Prompt string `msgpack:"prompt"`
	Busy   bool   `msgpack:"busy"`
}

console.create response

type ConsoleDestroyReq

type ConsoleDestroyReq struct {
	Method string
	Token  string
	Id     int
}

console.destroy request

type ConsoleListResp

type ConsoleListResp map[string][]struct {
	Id     int    `msgpack:"id"`
	Prompt string `msgpack:"prompt"`
	Busy   bool   `msgpack:"busy"`
}

console.list response

type ConsoleReadReq

type ConsoleReadReq struct {
	Method string
	Token  string
	Id     int
}

console.read request

type ConsoleReadResp

type ConsoleReadResp struct {
	Data   string `msgpack:"data"`
	Prompt string `msgpack:"prompt"`
	Busy   bool   `msgpack:"busy"`
}

conosle.read response

type ConsoleSessionDetachReq

type ConsoleSessionDetachReq struct {
	Method string
	Token  string
	Id     int
}

console.session_detach request

type ConsoleSessionKillReq

type ConsoleSessionKillReq struct {
	Method string
	Token  string
	Id     int
}

console.session_kill request

type ConsoleTabReq

type ConsoleTabReq struct {
	Method string
	Token  string
	Id     int
	Line   string
}

console.tab request

type ConsoleTabResp

type ConsoleTabResp struct {
	Tabs string `msgpack:"tabs"`
}

console.tab response

type ConsoleWriteReq

type ConsoleWriteReq struct {
	Method string
	Token  string
	Id     int
	Data   string
}

console.write request

type ConsoleWriteResp

type ConsoleWriteResp struct {
	Wrote uint `msgpack:"wrote"`
}

console.write response

type CoreAddModulePathResp

type CoreAddModulePathResp struct {
	Exploits  uint `msgpack:"exploits"`
	Auxiliary uint `msgpack:"auxiliary"`
	Post      uint `msgpack:"post"`
	Encoders  uint `msgpack:"encoders"`
	NOPs      uint `msgpack:"nops"`
	Payloads  uint `msgpack:"payloads"`
	Evasions  uint `msgpack:"evasions"`
}

core.add_module_path

type CoreModuleAddReq

type CoreModuleAddReq struct {
	Method string
	Token  string
	Path   string
}

core.add_module_path request

type CoreModuleStatsResp

type CoreModuleStatsResp struct {
	Exploits  uint `msgpack:"exploits"`
	Auxiliary uint `msgpack:"auxiliary"`
	Post      uint `msgpack:"post"`
	Encoders  uint `msgpack:"encoders"`
	NOPs      uint `msgpack:"nops"`
	Payloads  uint `msgpack:"payloads"`
	Evasions  uint `msgpack:"evasions"`
}

core.module_stats

type CoreReloadModulesResp

type CoreReloadModulesResp struct {
	Exploits  uint `msgpack:"exploits"`
	Auxiliary uint `msgpack:"auxiliary"`
	Post      uint `msgpack:"post"`
	Encoders  uint `msgpack:"encoders"`
	NOPs      uint `msgpack:"nops"`
	Payloads  uint `msgpack:"payloads"`
	Evasions  uint `msgpack:"evasions"`
}

core.reload_modules response

type CoreSetGReq

type CoreSetGReq struct {
	Method string
	Token  string
	V      string
	Val    string
}

core.setg request

type CoreThreadKillReq

type CoreThreadKillReq struct {
	Method string
	Token  string
	Tid    int
}

core.thread_kill request

type CoreThreadListResp

type CoreThreadListResp map[string][]struct {
	Status   string `msgpack:"status"`
	Critical bool   `msgpack:"critical"`
	Name     string `msgpack:"name"`
	Started  string `msgpack:"started"`
}

core.thread_list

type CoreUnsetGReq

type CoreUnsetGReq struct {
	Method string
	Token  string
	V      string
}

core.unsetg request

type CoreVersionResp

type CoreVersionResp struct {
	Version string `msgpack:"version"`
	Ruby    string `msgpack:"ruby"`
	Api     string `msgpack:"api"`
}

core.version response

type GenericRequest

type GenericRequest struct {
	Method string
	Token  string
}

Generic Request for most RPC Calls

type GenericResponse

type GenericResponse struct {
	Result Result `msgpack:"result"`
}

Generic Response Most RPC Calls receive

type JobInfoReq

type JobInfoReq struct {
	Method string
	Token  string
	Jid    int
}

job.info request

type JobInfoResp

type JobInfoResp struct {
	Jid       int                    `msgpack:"jid"`
	Name      string                 `msgpack:"name"`
	StartTime int                    `msgpack:"start_time"`
	Datastore map[string]interface{} `msgpack:"datastore,omitempty"`
}

job.info

type JobListResp

type JobListResp map[string]string

job.list

type JobStopReq

type JobStopReq struct {
	Method string
	Token  string
	Jid    int
}

job.stop request

type MeterpreterReadResp

type MeterpreterReadResp struct {
	Data string `msgpack:"data"`
}

session.interactive_read

type ModuleAuxiliaryResp

type ModuleAuxiliaryResp struct {
	Modules []string `msgpack:"modules"`
}

module.auxiliary

type ModuleCheckReq

type ModuleCheckReq struct {
	Method     string
	Token      string
	ModuleType string
	ModuleName string
	Options    map[string]string
}

module.check request

type ModuleCompatiblePayloadsReq

type ModuleCompatiblePayloadsReq struct {
	Method     string
	Token      string
	ModuleName string
}

module.compatible_payloads request

type ModuleCompatiblePayloadsResp

type ModuleCompatiblePayloadsResp struct {
	Payloads []string `msgpack:"payloads"`
}

module.compatible_payloads

type ModuleCompatibleSessionsReq

type ModuleCompatibleSessionsReq struct {
	Method     string
	Token      string
	ModuleName string
}

module.compatible_sessions request

type ModuleCompatibleSessionsResp

type ModuleCompatibleSessionsResp struct {
	Sessions []string `msgpack:"sessions"`
}

module.compatible_sessions

type ModuleEncodersResp

type ModuleEncodersResp struct {
	Modules []string `msgpack:"modules"`
}

module.encoders

type ModuleEvasionResp

type ModuleEvasionResp struct {
	Modules []string `msgpack:"modules"`
}

module.evasion

type ModuleExecuteReq

type ModuleExecuteReq struct {
	Method     string
	Token      string
	ModuleType string
	ModuleName string
	Options    map[string]string
}

module.execute request

type ModuleExecuteResp

type ModuleExecuteResp struct {
	Jid  int    `msgpack:"job_id"`
	UUID string `msgpack:"uuid"`
}

module.execute

type ModuleExploitsResp

type ModuleExploitsResp struct {
	Modules []string `msgpack:"modules"`
}

module.exploits

type ModuleInfoReq

type ModuleInfoReq struct {
	Method     string
	Token      string
	ModuleType string
	ModuleName string
}

module.info request

type ModuleInfoResp

type ModuleInfoResp struct {
	Name        string     `msgpack:"name"`
	Description string     `msgpack:"description"`
	License     string     `msgpack:"license"`
	FilePath    string     `msgpack:"filepath"`
	Version     string     `msgpack:"version"`
	Rank        string     `msgpack:"rank"`
	References  [][]string `msgpack:"references"`
	Authors     []string   `msgpack:"authors"`
}

module.info

type ModuleNopsResp

type ModuleNopsResp struct {
	Modules []string `msgpack:"modules"`
}

module.nops

type ModuleOptionsReq

type ModuleOptionsReq struct {
	Method     string
	Token      string
	ModuleType string
	ModuleName string
}

module.options request

type ModuleOptionsResp

type ModuleOptionsResp map[string]struct {
	Type     string      `msgpack:"type"`
	Required bool        `msgpack:"required"`
	Advanced bool        `msgpack:"advanced"`
	Evasion  bool        `msgpack:"evasion"`
	Desc     string      `msgpack:"desc"`
	Default  interface{} `msgpack:"default"`
	Enums    []string    `msgpack:"enums,omitempty"`
}

module.options

type ModulePayloadsResp

type ModulePayloadsResp struct {
	Modules []string `msgpack:"modules"`
}

module.payloads

type ModulePlatformsResp

type ModulePlatformsResp struct {
	Platforms []string `msgpack:"platforms"`
}

module.platforms

type ModulePostResp

type ModulePostResp struct {
	Modules []string `msgpack:"modules"`
}

module.post

type ModuleSearchReq

type ModuleSearchReq struct {
	Method string
	Token  string
	Match  string
}

module.search request

type ModuleSearchResp

type ModuleSearchResp struct {
	Matches []string `msgpack:"matches"`
}

module.search

type RPC

type RPC struct {
	Auth    *auth
	Console *console
	Core    *core
	Job     *job
	Module  *module
	Session *session
	// contains filtered or unexported fields
}

RPC object

func NewRPC

func NewRPC(http *http.Client, url string) *RPC

create RPC object

func (*RPC) Call

func (r *RPC) Call(request, response interface{}) error

make a call using rpc object

func (*RPC) GetToken

func (r *RPC) GetToken() string

get token from RPC client

func (*RPC) SetToken

func (r *RPC) SetToken(token string)

set token on RPC client

type Result

type Result string
var (
	Failure Result = "failure"
	Success Result = "success"
)

type SessionListResp

type SessionListResp map[int]struct {
	Type        string `msgpack:"type"`
	TunnelLocal string `msgpack:"tunnel_local"`
	TunnelPeer  string `msgpack:"tunnel_peer"`
	ViaExploit  string `msgpack:"via_exploit"`
	Description string `msgpack:"desc"`
	Info        string `msgpack:"info"`
	Workspace   string `msgpack:"workspace"`
	SessionHost string `msgpack:"session_host"`
	SessionPort int    `msgpack:"session_port"`
	TargetHost  string `msgpack:"target_host"`
	Username    string `msgpack:"Username"`
	Uuid        string `msgpack:"uuid"`
	ExploitUuid string `msgpack:"exploit_uuid"`
	Routes      string `msgpack:"routes"`
	Platform    string `msgpack:"platform"`
}

session.list

type SessionMeterpreterReadReq

type SessionMeterpreterReadReq struct {
	Method string
	Token  string
	Sid    int
}

session.interactive_read

type SessionMeterpreterWriteReq

type SessionMeterpreterWriteReq struct {
	Method string
	Token  string
	Sid    int
	Data   string
}

session.interactive_write

type SessionShellReadReq

type SessionShellReadReq struct {
	Method string
	Token  string
	Sid    int
}

session.shell_read

type SessionShellReadResp

type SessionShellReadResp struct {
	Seq  string `msgpack:"seq"`
	Data string `msgpack:"data"`
}

session.shell_read

type SessionShellUpgradeReq

type SessionShellUpgradeReq struct {
	Method string
	Token  string
	Sid    int
	LHost  string
	LPort  int
}

session.shell_upgrade

type SessionShellWriteReq

type SessionShellWriteReq struct {
	Method string
	Token  string
	Sid    int
	Data   string
}

session.shell_write

type SessionShellWriteResp

type SessionShellWriteResp struct {
	WriteCount int `msgpack:"write_count"`
}

session.shell_write

type SessionStopReq

type SessionStopReq struct {
	Method string
	Token  string
	Sid    int
}

session.stop request

Jump to

Keyboard shortcuts

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