agents

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: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AllAgents = &Agents{Mutex: sync.RWMutex{}, List: map[string]*Agent{}}

AllAgents is a global variable that holds all the agents

Functions

func AgentCreate

func AgentCreate(data string, listenerName string, agentKey string, externalIP string) string

AgentCreate will take in the initilization sent by a new agent and do the following: add it to the list of current agents and add it to the database

func AgentKey

func AgentKey() string

AgentKey Generate UUID for agent key

func GetJobs

func GetJobs(agentKey string) []byte

GetJobs returns the jobs for the agent requesting them

func JobsExist

func JobsExist(agentKey string) bool

JobsExist will return true is there are jobs for the agent in question

func ParseSocket

func ParseSocket(fname string, data interface{}, ws *websocket.Conn, userID string, username string)

ParseSocket takes in data from the websocket and does what it needs to with it

func PivotListener

func PivotListener(agentKey string, privKey []byte, port string, userID string, username string) bool

PivotListener creates the necessary job for the listener to be started

func ReInitAgents

func ReInitAgents()

ReInitAgents puts all the active agents back into memory

func RemoveAgent

func RemoveAgent(agentKey string)

RemoveAgent will remove an agent from the list

func SetJob

func SetJob(job AgentJob, userID string, username string) bool

SetJob will set a new job for the specified agent

Types

type Agent

type Agent struct {
	Key         string     //Agent UUID4 key
	Name        string     //Custom agent name set by user
	OS          string     //Agent's OS
	OSType      string     //Type of Operating System and/or Distro
	OSVers      string     //Version of OS
	AV          []string   //AntiVirus Running
	Hostname    string     //Agent's hostname
	Username    string     //Username of victim
	LocalIP     string     //Local IP
	ExternalIP  string     //External IP
	AgentPath   string     //Agent Path
	Shellz      []string   //Available System Shells
	Pid         int        //Get PID of agent
	Jobs        []AgentJob //Holds the jobs for that agent
	IsAdmin     bool       //Is admin user
	IsElevated  bool       //Is elevated on Windows
	ListenerKey string     //Listener that the agent is attached too
	LowerLinks  []string   //List of agents using this one as a pivot listener
	LastCheckin time.Time  //Last Checkin Time
}

Agent struct is the datatype for agent checkins

type AgentJob

type AgentJob struct {
	AgentKey  string   //Name 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 structure of a job Upload -> {"upload": {"filename": "pwn.bat", "path": "C:\\"}} Download -> {"download": "full path to file"} Options -> {"options": {"option to change": "new value"}} Shell Commands -> {"shell": commands} Shellcode Injection -> {"shellInject": {"shellcode": "sc", "pid": "1"} Module -> {"module":"module to execute"} changed

type Agents

type Agents struct {
	Mutex sync.RWMutex
	List  map[string]*Agent
}

Agents is the struct for a list of all agents

type PivotJob

type PivotJob struct {
	Name string
	Job  []AgentJob
}

PivotJob holds the job to pass on to the next link in the chain

Directories

Path Synopsis
techniques

Jump to

Keyboard shortcuts

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