smb

package
v2.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2023 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

Package smb contains a configurable client used for Windows-based SMB peer-to-peer Agent communications

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	sync.Mutex // used to lock the Client when changes are being made by one function or routine
	// contains filtered or unexported fields
}

Client is a type of MerlinClient that is used to send and receive Merlin messages from the Merlin server

func New

func New(Config) (*Client, error)

New instantiates and returns a Client that is constructed from the passed in Config

func (*Client) Authenticate

func (client *Client) Authenticate(messages.Base) (err error)

Authenticate is the top-level function used to authenticate an agent to server using a specific authentication protocol The function must take in a Base message for when the C2 server requests re-authentication through a message

func (*Client) Get

func (client *Client) Get(string) string

Get is a generic function used to retrieve the value of a Client's field

func (*Client) Initial

func (client *Client) Initial() error

Initial executes the specific steps required to establish a connection with the C2 server and checkin or register an agent

func (*Client) Listen

func (client *Client) Listen() (returnMessages []messages.Base, err error)

Listen waits for incoming data on an established TCP connection, deconstructs the data into a Base messages, and returns them

func (*Client) Send

func (client *Client) Send(messages.Base) (returnMessages []messages.Base, err error)

Send takes in a Merlin message structure, performs any encoding or encryption, converts it to a delegate and writes it to the output stream. This function DOES not wait or listen for response messages.

func (*Client) Set

func (client *Client) Set(key string, value string) error

Set is a generic function that is used to modify a Client's field values

func (*Client) Synchronous

func (client *Client) Synchronous() bool

Synchronous identifies if the client connection is synchronous or asynchronous, used to determine how and when messages can be sent/received.

type Config

type Config struct {
	Address      []string  // Address the interface and port the agent will bind to
	AgentID      uuid.UUID // AgentID the Agent's UUID
	AuthPackage  string    // AuthPackage the type of authentication the agent should use when communicating with the server
	ListenerID   uuid.UUID // ListenerID the UUID of the listener that this Agent is configured to communicate with
	Padding      string    // Padding the max amount of data that will be randomly selected and appended to every message
	PSK          string    // PSK the Pre-Shared Key secret the agent will use to start authentication
	Transformers string    // Transformers is an ordered comma seperated list of transforms (encoding/encryption) to apply when constructing a message
	Mode         string    // Mode the type of client or communication mode (e.g., BIND or REVERSE)
}

Config is a structure used to pass in all necessary information to instantiate a new Client

Jump to

Keyboard shortcuts

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