Documentation
¶
Overview ¶
Package cirrus is the primary package container for the Cirrus ReST service.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Cmdline ¶
func Cmdline()
Cmdline will attempt to build and run a Cirrus instance. This function will block until completion.
func Listen ¶
Listen is a quick utility function that allows for creation of a new Cirrus REST service and will start it immediately.
This function will block until the server is closed.
Quick version of "NewContext(context.Background(), s, log, key).Listen(addr)".
func ListenContext ¶
ListenContext is a quick utility function that allows for creation of a new Cirrus REST service and will start it immediately.
This function will block until the server is closed.
Quick version of "NewContext(x, s, log, key).Listen(addr)".
This function allows specifying a Context to aid in cancellation.
Types ¶
type Cirrus ¶
Cirrus is a struct that enables and hosts the ReST API that controls a ThunderStorm C2 server able to control clients.
Cirrus also supplies a stats module that can be used to log and track event counts.
func New ¶
New creates a new Cirrus REST server instance using the supplied C2 Server.
The provided key can be used to authenticate to the Rest service with the 'X-CirrusAuth' HTTP header containing the supplied key.
If empty, authentication is disabled.
func NewContext ¶
NewContext creates a new Cirrus REST server instance using the supplied C2 Server instance.
This function allows specifying a Context to aid in cancellation.
func (*Cirrus) Close ¶
Close stops all Cirrus instances and listening endpoints.
This will NOT close any Sessions or Listeners created.
func (*Cirrus) Listen ¶
Listen will bind to the specified address and begin serving requests. This function will return when the server is closed.
func (*Cirrus) ListenTLS ¶
ListenTLS will bind to the specified address and use the provided certificate and key file paths to listen using a secure TLS tunnel. This function will return when the server is closed.
func (*Cirrus) Load ¶
Load will attempt to load in a previously saved Cirrus state from the provided JSON file. If the path does not exist, this function will return without an error (allows loading from an empty state file).
Any environment variables will be parsed and expanded before loading.
This function will bail and return any encoding or reading errors that may occur during the operation.
func (*Cirrus) Save ¶
Save will attempt to save the current state of Cirrus (Listeners, Scripts and Profiles) to the supplied file path as pretty JSON. If successful, the file will be truncated (if it exists) and overwritten.
Any environment variables will be parsed and expanded before writing.
This function will bail and return any encoding or writing errors that may occur during the operation.
func (*Cirrus) TrackStats ¶
TrackStats will enable the CSV and Tracker files. This function can enable Cirrus to log every event (Job/Session/Packet Actions) to a CSV formatted file (if not-empty) and a tracking file (if not-empty) that will be updated every minute in UNIX fashion (cleared and rewritten) with statistics about current Job and Session info.
Returns an error if setting up any of the supplied files fails.