implantsvr

package
v0.0.1-beta.2 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2024 License: BSD-3-Clause Imports: 36 Imported by: 0

README

Implant Server

Listens for and handles connections from Implant

Documentation

Overview

Package implantsvr - Listen for and handle implant requests

Index

Constants

This section is empty.

Variables

View Source
var (
	// rawTemplate is the stock implant generation template.
	//
	//go:embed curlgen.tmpl
	RawTemplate string
)

Functions

This section is empty.

Types

type Server

type Server struct {
	Dir               string
	SL                *slog.Logger
	HTTPAddr          string /* Listen address. */
	HTTPSAddr         string /* Listen address. */
	LEDomainWhitelist []string
	LEStaging         bool
	SSDomainWhitelist []string
	LEEmail           string
	SM                *jpersist.Manager[state.State]
	ExfilMax          uint64
	// contains filtered or unexported fields
}

Server listens for and handles implant queries. Populate its public fields and call Start to start it. See the note on server.Config.LEDomainWhitelist for information about TLS certificate generation.

func (*Server) HTTPListenAddr

func (s *Server) HTTPListenAddr() string

HTTPListenAddr returns the address on which the server's listening. If it is not listening on HTTP, HTTPAddr returns "". This is meant for testing, which uses passes a port of 0 in s.HTTPAddr.

func (*Server) HTTPSListenAddr

func (s *Server) HTTPSListenAddr() string

HTTPSListenAddr is like HTTPListenAddr, for HTTPS.

func (*Server) Start

func (s *Server) Start() error

Start starts the server serving.

func (*Server) Stop

func (s *Server) Stop(defError error) error

Stop stops the server and returns the first error encountered while doing so, or should all go well, defError. After Stop is called, Wait will return a non-nil error.

func (*Server) Wait

func (s *Server) Wait() error

Wait waits for the server to stop. It returns nil if it stopped nicely.

type TemplateParams

type TemplateParams struct {
	PubkeyFP string `json:",omitempty"` /* Self-signed TLS fingerprint. */
	RandN    string /* Random base36 number, for ImplantID */
	URL      string /* C2 URL for /{t,o}/ImplantID */
}

TemplateParams holds the parameters we pass to the template.

Jump to

Keyboard shortcuts

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