agentfunctions

package
v0.0.0-...-9d62925 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2023 License: MIT Imports: 19 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AllOutput = Output{Mutex: sync.RWMutex{}, List: map[int]*agentscommon.JobOutput{}}

AllOutput is a global variable that holds the jobOutputs

View Source
var AllPivotJobs = PivotJobHolder{Mutex: sync.RWMutex{}, List: map[string]*PivotJobs{}}

AllPivotJobs is used to hold all of the jobs needing to be passed down the link

View Source
var JobCount int

JobCount is a global variable containing the number of jobs

Functions

func AgentFileBrowsers

func AgentFileBrowsers(location string)

AgentFileBrowsers will send back every file and directory in the path location specified

func CheckTime

func CheckTime(liveHours string)

CheckTime sees if the current time is between the allowed hours, if not sleep until it is

func Download

func Download(data string)

Download takes in the file to be sent back to the server This should be edited to just add to job output. results should be {filename: "blah", filedata: "0x40,0x32"}

func ErrHandling

func ErrHandling(err string)

ErrHandling handles the agent's errors

func FirstTime

func FirstTime(key string) []byte

FirstTime is used to initalize an agent

func Kill

func Kill()

Kill will delete the agent and return the message "Dying" to the server

func KillNetList

func KillNetList(tcpL net.Listener, l *PivotList)

KillNetList will kill of the listener

func SaveFile

func SaveFile(data []byte, loc string, fileName string) string

SaveFile is used by the agents to save a file to disk

func Shell

func Shell(command []string, r bool) []byte

Shell is used to execute shell commands

func ShouldIDie

func ShouldIDie(eol string)

ShouldIDie determines if the agent should die or not

func SleepDelay

func SleepDelay(delay float64, jitter float64)

SleepDelay sleeps between each loop of the agent with a jitter % to make it less patterned

func Upload

func Upload(location string, fileName string, file string)

Upload is used to upload files to the victim machine, the base64'd filedata is passed in the actual job.

Types

type AgentJob

type AgentJob struct {
	AgentKey  string   //Key of the agent to create the job for
	JobType   string   //Type of job
	Arguments []string //Job arguments adhering to the above formats
}

AgentJob is the standard struct for all jobs

type Output

type Output struct {
	Mutex sync.RWMutex
	List  map[int]*agentscommon.JobOutput
}

Output is the struct for a list of all output

type PivotJobHolder

type PivotJobHolder struct {
	Mutex sync.RWMutex
	List  map[string]*PivotJobs
}

PivotJobHolder is used to hold of the pivot jobs that agents will request back

type PivotJobs

type PivotJobs struct {
	Jobs []AgentJob
}

PivotJobs hows a slice of jobs for the lower agents to grab

type PivotList

type PivotList struct {
	Listener net.Listener
	ListChan chan bool
}

PivotList is used to hold the listener object

Jump to

Keyboard shortcuts

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