exploit

package
v2.4.2 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2023 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrFinishedUnexpectedly = errors.New("service finished unexpectedly")
)

Functions

func CreateExploitJobs

func CreateExploitJobs(
	ex *State,
	teams map[string]string,
	environ []string,
	sender joblogger.Sender,
) (jobs []*queue.Job)

Types

type Cache

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

Cache represents the client local in-memory executable cache. Cache is NOT persistent now, so any client restart will cause a re-download of the all exploits.

func NewCache

func NewCache() *Cache

func (*Cache) Diff

func (c *Cache) Diff(exs []*epb.ExploitState) []*epb.ExploitState

func (*Cache) Exploit

func (c *Cache) Exploit(id string) (res *State, ok bool)

func (*Cache) Exploits

func (c *Cache) Exploits() (res []*State)

func (*Cache) Update

func (c *Cache) Update(exs []*State)

func (*Cache) UpdateLastRun

func (c *Cache) UpdateLastRun(exploitID string, t time.Time)

type FarmRequest

type FarmRequest struct {
	Flag    string `json:"flag"`
	Exploit string `json:"sploit"`
	Team    string `json:"team"`
}

type FullResult

type FullResult struct {
	Exploit *models.Exploit
	Target  *models.Target
	Flag    string
}

func NewFullResult

func NewFullResult(exploit *models.Exploit, target *models.Target, flag string) *FullResult

func (*FullResult) FarmRequest

func (r *FullResult) FarmRequest() *FarmRequest

func (*FullResult) MetricLabels

func (r *FullResult) MetricLabels() prometheus.Labels

type Metrics

type Metrics struct {
	FlagsSubmitted *prometheus.CounterVec
	Teams          prometheus.Gauge
}

func NewMetrics

func NewMetrics(namespace string) *Metrics

type Runner

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

func NewRunner

func NewRunner(
	clientID string,
	maxJobs, maxEndlessJobs int,
	clientConfig *client.Config,
	c *client.Client,
	logSender joblogger.Sender,
) *Runner

func (*Runner) Run

func (r *Runner) Run(ctx context.Context) error

type State

type State struct {
	ID       string
	Version  int64
	Dir      string
	Path     string
	Disabled bool
	Endless  bool
	RunEvery time.Duration
	LastRun  time.Time
	Timeout  time.Duration
}

func (*State) ExploitType

func (s *State) ExploitType() models.ExploitType

func (*State) ToModel

func (s *State) ToModel() *models.Exploit

type Storage

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

func NewStorage

func NewStorage(cache *Cache, exploitDir string, client *client.Client) *Storage

func (*Storage) Exploit

func (s *Storage) Exploit(id string) (res *State, ok bool)

func (*Storage) Exploits

func (s *Storage) Exploits() (res []*State)

func (*Storage) UpdateExploits

func (s *Storage) UpdateExploits(ctx context.Context, exs []*epb.ExploitState) bool

func (*Storage) UpdateLastRun

func (s *Storage) UpdateLastRun(exploitID string, t time.Time)

Jump to

Keyboard shortcuts

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