cmd

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2021 License: MIT Imports: 19 Imported by: 1

Documentation

Overview

Package cmd - the "cmd" package is the core packaged used to reference and manage all grumble integrated commands/features of the application.

The "cmd" package houses all of the core "interface/application" code which is a mix of both user interface and logical functionality.

Index

Constants

This section is empty.

Variables

View Source
var App = lupoApp

App - Primary grumble CLI construction variable for switching nested app contexts

On initialization this is set to the "lupo" grumble config, but is used to switch to nested/sub-shells throughout the application where necessary.

The primary use case is switching between the "lupo" core shell and the nested "session" sub-shell that handles session management.

View Source
var SessionAppConfig = &grumble.Config{
	Name:                  "session",
	Description:           "Interactive Session CLI",
	HistoryFile:           ".lupo.history",
	Prompt:                "lupo session " + strconv.Itoa(core.ActiveSession) + " ☾ ",
	PromptColor:           color.New(color.FgMagenta, color.Bold),
	HelpHeadlineColor:     color.New(color.FgWhite),
	HelpHeadlineUnderline: true,
	HelpSubCommands:       true,
	Flags: func(f *grumble.Flags) {
		f.String("r", "resource", "", "resource file for lupo server, all commands in this file will be executed on startup, expects default filename to exist if not specified")
	},
}

SessionAppConfig - Primary session nested grumble CLI config construction This sets up the lupo "session" nested/sub-prompt and color scheme, defines a history logfile, and toggles various grumble sepcific parameters for help command options.

Functions

func ExecuteResourceFile

func ExecuteResourceFile(resourceFile string)

ExecuteResourceFile - executes a provided set of lupo commands from a specified file.

func InitializeSessionCLI

func InitializeSessionCLI(sessionApp *grumble.App, activeSession int)

InitializeSessionCLI - Initialize the nested session CLI arguments

"session" has no arguments and is not a grumble command in and of itself. It is a separate nested grumble application and contains all new base commands.

"session" base commands include:

"back" - resets the current active session to "-1" and closes the nested session sub-shell.

"session" - the actual "session" command which is used to switch sessions by specifying an argument of a session ID to switch to. This is identical to the interact command only it allows you to switch sessions while in the session sub-shell as "interact" is unavailable in the sub-shell.

"cmd" - built in command directive to denote commands that are intended to be executed as a system command of a specified session. These commands are usually sent to the client as JSON in the format of {"cmd":"<some command"}. It supports multi-line/multi-arg commands.

"kill" - takes an argument of "id" which is used to de-register the specified session.

"load" - will load any additional functions that were registered by an implant. Must be ran each time you interact with a different session unless the implants of those sessions use the same additional functions.

Types

type WolfPackServer

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

WolfPackServer - defines a wolfpack server structure composed of:

lhost - the "listening" host address. This tells a listener what interface to listen on based on the address it is tied to.

lport - the "listening" port. This tells a listener what port the lhost of the listener should open to receive connections on.

status - the current status of the wolfpack server to determine if it is online or not.

httpInstance - a pointer to an instance of the http.Server struct. This is used to reference the core HTTP Server itself when conducting operations such as starting/stopping a wolfpack server.

Jump to

Keyboard shortcuts

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