controller

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SendError

func SendError(context *gin.Context, err string)

func SendFlag

func SendFlag(flag model.Flag, controller *Controller)

Types

type Config

type Config struct {
	DatabasePath   string
	ExploitsPath   string
	TickTime       int64
	FlagRegex      *regexp.Regexp
	TimeZone       string
	TimeFormat     string
	FlaggerCommand string
	ListeningAddr  string
}

type Controller

type Controller struct {
	DB            *database.Database
	Config        *Config
	ExploitRunner *ExploitRunner
	Logger        *log.Logger
}

func (*Controller) CreateExploit

func (c *Controller) CreateExploit(context *gin.Context)

func (*Controller) CreateTarget

func (c *Controller) CreateTarget(context *gin.Context)

func (*Controller) DeleteAllExploits

func (c *Controller) DeleteAllExploits(context *gin.Context)

func (*Controller) DeleteAllTargets

func (c *Controller) DeleteAllTargets(context *gin.Context)

func (*Controller) DeleteExploit

func (c *Controller) DeleteExploit(context *gin.Context)

func (*Controller) DeleteTarget

func (c *Controller) DeleteTarget(context *gin.Context)

func (*Controller) GetExploits

func (c *Controller) GetExploits(context *gin.Context)

func (*Controller) GetFlag

func (c *Controller) GetFlag(context *gin.Context)

func (*Controller) GetFlags

func (c *Controller) GetFlags(context *gin.Context)

func (*Controller) GetIndex

func (c *Controller) GetIndex(context *gin.Context)

func (*Controller) GetMain

func (c *Controller) GetMain(context *gin.Context)

func (*Controller) GetSettings

func (c *Controller) GetSettings(context *gin.Context)

func (*Controller) GetTargets

func (c *Controller) GetTargets(context *gin.Context)

func (*Controller) SaveConfig

func (c *Controller) SaveConfig(context *gin.Context)

func (*Controller) SearchFlags

func (c *Controller) SearchFlags(context *gin.Context)

func (*Controller) ToggleExploit

func (c *Controller) ToggleExploit(context *gin.Context)

func (*Controller) ToggleTarget

func (c *Controller) ToggleTarget(context *gin.Context)

type ExploitRunner

type ExploitRunner struct {
	ExploitAdder   chan *model.Exploit
	ExploitRemover chan *model.Exploit

	TargetAdder   chan *model.Target
	TargetRemover chan *model.Target

	Flagger chan *model.Flag
	Notify  chan string
	// contains filtered or unexported fields
}

func NewExploitRunner

func NewExploitRunner(controller *Controller) *ExploitRunner

func (*ExploitRunner) NewRunner

func (er *ExploitRunner) NewRunner(exploit *model.Exploit, target *model.Target) *Runner

func (*ExploitRunner) Run

func (er *ExploitRunner) Run()

func (*ExploitRunner) Stop

func (er *ExploitRunner) Stop()

type Runner

type Runner struct {
	Exploit    *model.Exploit
	Target     *model.Target
	Notify     chan string
	Flagger    chan *model.Flag
	Controller *Controller
}

func (*Runner) Run

func (r *Runner) Run()

Jump to

Keyboard shortcuts

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