c2

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2021 License: MIT Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddAgent

func AddAgent(agent *Agent)

AddAgent adds a new agent to the list of seen agents.

func AgentExists

func AgentExists(ID string) bool

AgentExists checks if a given agent ID is in the list of agents.

Types

type Agent

type Agent struct {
	ID       string
	LastSeen time.Time
	Addr     net.Addr
	// contains filtered or unexported fields
}

An Agent represents a malware client that has connected to the server.

func AgentByID

func AgentByID(ID string) *Agent

AgentByID returns an agent instance given the corresponding Agent ID.

func Agents

func Agents() []*Agent

Agents returns the list of agents that have been seen.

func (*Agent) SendCommand

func (a *Agent) SendCommand(command interface{})

SendCommand instructs the agent to run the given command.

type DownloadCommand

type DownloadCommand struct {
	Source      string
	Destination string
}

DownloadCommand represents the data needed to download a file from a given agent.

type ExecuteCommand

type ExecuteCommand struct {
	Name string
	Args []string
}

ExecuteCommand represents a command to run on an agent.

type Server

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

A Server represents a running mock C2 server.

func NewServer

func NewServer(protocol string, address string) (*Server, error)

NewServer creates a new mock C2 server and starts it listening on the provided address.

func (*Server) Shutdown

func (s *Server) Shutdown()

Shutdown gracefully shuts down the C2 server without interrupting any active connections.

type UploadCommand

type UploadCommand struct {
	Source      string
	Destination string
}

UploadCommand represents the data needed to upload a file to a given agent.

Jump to

Keyboard shortcuts

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