Documentation ¶
Index ¶
- Constants
- Variables
- func Command(s string) *com.Packet
- func Download(s string, b []byte) *com.Packet
- func DownloadFile(s, r string) (*com.Packet, error)
- func DownloadReader(s string, r io.Reader) (*com.Packet, error)
- func Execute(e *Process) *com.Packet
- func RegisterEngine(i uint8, s Engine) error
- func Run(s ...string) *com.Packet
- func Upload(s string) *com.Packet
- type Code
- type Engine
- type Process
- type Tasker
Constants ¶
const ( TvRefresh uint8 = 0xC0 TvUpload uint8 = 0xC1 TvDownload uint8 = 0xC2 TvExecute uint8 = 0xC3 TvCode uint8 = 0xC4 )
Custom Task Message ID Values
TvRefresh - 192: TvUpload - 193: TvDownload - 194: TvExecute - 195: TvCode - 196:
Variables ¶
var Mappings = [256]Tasker{ TvRefresh: simpleTask(TvRefresh), TvUpload: simpleTask(TvUpload), TvDownload: simpleTask(TvDownload), TvExecute: simpleTask(TvExecute), TvCode: simpleTask(TvCode), wintask.DLLTask: wintask.DLLTask, }
Mappings is an fixed size array that contains the Tasker mappings for each ID value. Values that are less than 22 are ignored. Adding a mapping to here will allow it to be executed via the client Scheduler.
Functions ¶
func Command ¶
Command returns a Packet with the 'TvExecute' ID value and a Process struct in the payload that is based on the supplied command, which is parsed using 'cmd.Split'. By default, this will wait for the Process to complete before the client returns the output.
func Download ¶
Download returns a Packet that will instruct a Client to save the specified bytes to the local file location.
func DownloadFile ¶
DownloadFile returns a Packet that will instruct a Client to save the contents of the supplied local file to the remote file location. This will return an error if any errors occur during reading or opening the local file.
func DownloadReader ¶
DownloadReader returns a Packet that will instruct a Client to save the contents of the supplied reader to the remote file location. This will return an error if any errors occur during reading.
func Execute ¶
Execute returns a Packet with the 'TvExecute' ID value and the provided Process struct as the Payload.
func RegisterEngine ¶
RegisterEngine is a function that can be used to register a Scripting engine into the XMT client tasking runtime. Script engines can increase the footprint of the compiled binary, so engines must be registed manually.
See the 'cmd/script' package for scripting engines.
Types ¶
type Code ¶
Code is a struct that is similar to the 'cmd.Code' struct. This is used to Task a Client with running shellcode on devices. This struct has many of the functionallies of the standard 'cmd.Code' function. The 'SetParent' function will attempt to set the target that runs the shellcode. If none are specified, the shellcode will be injected into the current process.
func (Code) MarshalStream ¶
MarshalStream writes the data for this Code thread to the supplied Writer.
type Engine ¶
Engine is an interface that allows for extending XMT with non-compiled code for easy deployability and flexibility. Each Script interface contains a single function that will take a Context, an environment block and the script code string.
The result of this function will be the output of the script and any errors that may occur. By default, the 'ID', 'OS', 'PID' 'PPID', 'OSVER' and 'HOSTNAME' variables are built-in to assist with code runtime.
type Process ¶
type Process struct { Dir string Env, Args []string Stdin []byte Timeout time.Duration Flags uint32 Filter *cmd.Filter Wait bool }
Process is a struct that is similar to the 'cmd.Process' struct. This is used to Task a Client with running a specified command.
func (Process) MarshalStream ¶
MarshalStream writes the data for this Process to the supplied Writer.
func (*Process) SetFlags ¶
SetFlags will set the startup Flag values used for Windows programs. This function overrites many of the 'Set*' functions. Has no effect if the device is not running Windows.
func (*Process) SetParent ¶
SetParent will instruct the Process to choose a parent with the supplied process Filter. If the Filter is nil this will use the current process (default). This function has no effect if the device is not running Windows. Setting the Parent process will automatically set 'SetNewConsole' to true.