enochecker

package module
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2021 License: MIT Imports: 9 Imported by: 0

README

enochecker-go

CI PkgGoDev

Documentation

Index

Constants

View Source
const (
	ResultOk      = Result("OK")
	ResultError   = Result("INTERNAL_ERROR")
	ResultMumble  = Result("MUMBLE")
	ResultOffline = Result("OFFLINE")
)
View Source
const (
	TaskMessageMethodPutFlag  = TaskMessageMethod("putflag")
	TaskMessageMethodGetFlag  = TaskMessageMethod("getflag")
	TaskMessageMethodPutNoise = TaskMessageMethod("putnoise")
	TaskMessageMethodGetNoise = TaskMessageMethod("getnoise")
	TaskMessageMethodHavoc    = TaskMessageMethod("havoc")
	TaskMessageMethodExploit  = TaskMessageMethod("exploit")
)

Variables

View Source
var ErrFlagNotFound = NewMumbleError(errors.New("flag not found"))
View Source
var ErrNoiseNotFound = NewMumbleError(errors.New("noise not found"))
View Source
var ErrVariantIdOutOfRange = errors.New("variantId out of range")

Functions

This section is empty.

Types

type Checker

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

func NewChecker

func NewChecker(log Logger, handler Handler) *Checker

func (*Checker) ServeHTTP

func (c *Checker) ServeHTTP(writer http.ResponseWriter, request *http.Request)

type Handler

type Handler interface {
	PutFlag(ctx context.Context, message *TaskMessage) (*HandlerInfo, error)
	GetFlag(ctx context.Context, message *TaskMessage) error
	PutNoise(ctx context.Context, message *TaskMessage) error
	GetNoise(ctx context.Context, message *TaskMessage) error
	Havoc(ctx context.Context, message *TaskMessage) error
	Exploit(ctx context.Context, message *TaskMessage) (*HandlerInfo, error)
	GetServiceInfo() *InfoMessage
}

type HandlerInfo

type HandlerInfo struct {
	AttackInfo string
	Flag       string
}

func NewExploitInfo

func NewExploitInfo(flag string) *HandlerInfo

func NewPutFlagInfo

func NewPutFlagInfo(attackInfo string) *HandlerInfo

type InfoMessage

type InfoMessage struct {
	ServiceName     string `json:"serviceName"`
	FlagVariants    uint64 `json:"flagVariants"`
	NoiseVariants   uint64 `json:"noiseVariants"`
	HavocVariants   uint64 `json:"havocVariants"`
	ExploitVariants uint64 `json:"exploitVariants"`
}

type Logger

type Logger interface {
	Debugf(format string, args ...interface{})
	Infof(format string, args ...interface{})
	Warnf(format string, args ...interface{})
	Errorf(format string, args ...interface{})
}

Logger is a typical logger interface

type MumbleError

type MumbleError interface {
	error
	Mumble() bool
}

func NewMumbleError

func NewMumbleError(msg error) MumbleError

type OfflineError added in v1.2.0

type OfflineError interface {
	error
	Offline() bool
}

func NewOfflineError added in v1.2.0

func NewOfflineError(msg error) OfflineError

type Result

type Result string

type ResultMessage

type ResultMessage struct {
	Result     Result  `json:"result"`
	Message    *string `json:"message"`
	AttackInfo string  `json:"attackInfo,omitempty"`
	Flag       string  `json:"flag,omitempty"`
}

func NewResultMessageError

func NewResultMessageError(msg string) *ResultMessage

func NewResultMessageMumble

func NewResultMessageMumble(msg string) *ResultMessage

func NewResultMessageOffline

func NewResultMessageOffline(msg string) *ResultMessage

func NewResultMessageOk

func NewResultMessageOk() *ResultMessage

type TaskMessage

type TaskMessage struct {
	TaskId         uint64            `json:"taskId"`
	Method         TaskMessageMethod `json:"method"`
	Address        string            `json:"address"`
	TeamId         uint64            `json:"teamId"`
	TeamName       string            `json:"teamName"`
	CurrentRoundId uint64            `json:"currentRoundId"`
	RelatedRoundId uint64            `json:"relatedRoundId"`
	Flag           string            `json:"flag"`
	VariantId      uint64            `json:"variantId"`
	Timeout        uint64            `json:"timeout"`
	RoundLength    uint64            `json:"roundLength"`
	TaskChainId    string            `json:"taskChainId"`
	FlagRegex      string            `json:"flagRegex"`
	FlagHash       string            `json:"flagHash"`
	AttackInfo     string            `json:"attackInfo"`
}

type TaskMessageMethod

type TaskMessageMethod string

Jump to

Keyboard shortcuts

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