helper

package
v0.0.0-...-8083d74 Latest Latest
Warning

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

Go to latest
Published: May 19, 2023 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LANG_GO  = 0x01
	LANG_CPP = 0x02
)

Client language types.

View Source
const (
	OS_WIN = 0x01
	OS_NIX = 0x02
)

Client operating system types.

View Source
const (
	APP_NAME = "Pout C2"
)

Toast notification variables.

View Source
const CONFIG_PATH = "./client/config.go"

Path to replace the contents of with the CONFIG_TEMPLATE. This is the file that the client uses to get the server host and port to connect to.

View Source
const CONFIG_TEMPLATE = `` /* 168-byte string literal not displayed */

Config template to replace the host and port of, and write to the CONFIG_PATH.

Variables

View Source
var CHARS = "ABCDEF123456789"

Selection of characters to use in the key generation process.

Functions

func Decrypt

func Decrypt(ciphertext, key []byte) ([]byte, error)

func Encrypt

func Encrypt(plaintext, key []byte) ([]byte, error)

func FormatBytes

func FormatBytes(n int) string

`FormatBytes` formats the passed number of bytes into a string with a byte size suffix.

func GenerateSessionKey

func GenerateSessionKey(length int) string

`GenerateSessionKey` generates a random string from numbers and letters.

func NewClientNotification

func NewClientNotification(rawAddr string) error

`NewClientNotification` pushes a Windows toast notification for each new client.

func ServerStartedNotification

func ServerStartedNotification(port string) error

`ServerStartedNotification` pushes a Windows toast notification for the server starting.

func WriteTextToClipboard

func WriteTextToClipboard(text string) bool

Types

type ClientBuildConfig

type ClientBuildConfig struct {
	// Type of client to build.
	OS   byte
	Lang byte

	// Basic client build configuration settings.
	File        string
	Host        string
	Port        int32
	CompressUPX bool
	NoConsoleUI bool

	// Persistence options
	StartupPersistence   bool
	SchedulerPersistence bool

	// Folder and file to store the persistent executable.
	AppDataFolderName string
	AppDataFileName   string

	// Updating build status.
	Status string
}

`ClientBuildConfig` represents the configuration settings needed to build the client.

func NewBuilderConfig

func NewBuilderConfig() *ClientBuildConfig

`NewBuilderConfig` returns a new ClientBuildConfig with its default configuration settings.

func (*ClientBuildConfig) BuildClient

func (build *ClientBuildConfig) BuildClient() error

`ClientBuildConfig.BuildClient` executes the commands to build the client directory and compress it using UPX if it's set in the build config, along with additional flags.

func (*ClientBuildConfig) UpdateStatus

func (build *ClientBuildConfig) UpdateStatus(status string)

`ClientBuildConfig.UpdateStatus` sets the current build status to the formatted passed text. This function is currently only implemented so that it will be easier to modify all status updates, instead of having to modify the formatting scheme at a later date.

func (*ClientBuildConfig) WriteConfig

func (build *ClientBuildConfig) WriteConfig() error

`ClientBuildConfig.WriteConfig` resets the clients config file and replaces its contents with the formatted CONFIG_TEMPLATE, which includes the passed host and port.

type Logs

type Logs struct {
	Entries []string
}

`Logs` represents a list of log entries.

func (*Logs) Add

func (logs *Logs) Add(log string)

`Logs.Add` appends the passed log to the Logs.Entries field.

func (*Logs) Clear

func (logs *Logs) Clear()

`Logs.Clear` empties all logs from the Logs.Entries field.

Jump to

Keyboard shortcuts

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