exploit

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2025 License: GPL-3.0 Imports: 22 Imported by: 0

Documentation

Overview

Package exploit provides functions to parse flags from JSON output.

Package exploit provides functions to execute exploits and manage their output.

Index

Constants

View Source
const (
	INFO    = "info"         // Status indicating informational output
	EXPLOIT = "exploit_info" // Status indicating exploit-specific informational output
	FAILED  = "failed"       // Status indicating flag submission failure
	ERROR   = "error"        // Status indicating a general error in flag submission
	FATAL   = "fatal"        // Status indicating a fatal error in the exploiter
	SUCCESS = "success"      // Status indicating successful flag submission
	STATS   = "stats"        // Status indicating a batch of statistics
	DEBUG   = "debug"        // Status indicating debug information
)

Variables

This section is empty.

Functions

func Cleanup

func Cleanup(pid int)

Cleanup removes an exploit from the configuration

func Create

func Create(name string) (string, error)

Create creates a new exploit template file with the given name

func Detach

func Detach()

func List

func List() (string, error)

List retrieves and lists all currently running exploits

func ParseLine

func ParseLine(line string) (models.ClientData, string, error)

ParseLine parses a JSON line into a Flag struct.

func Remove

func Remove(name string) (string, error)

Remove deletes an existing exploit template file with the given name

func RestartGlobal

func RestartGlobal()

func Setup

func Setup(detach bool) error

SetupClient handles the full initialization process for the attack command

func Stop

func Stop(pid int) (string, error)

Stop terminates the exploit process with the given PID

func SubmitFlag

func SubmitFlag(flag models.ClientData) (string, error)

func SubmitFlags

func SubmitFlags(flagsChan <-chan models.ClientData)

func ValidateArgs

func ValidateArgs(args config.ArgsAttack) error

ValidateArgs validates the arguments passed to the program

Types

type ExecutionResult

type ExecutionResult struct {
	Cmd        *exec.Cmd
	FlagsChan  chan models.ClientData
	OutputChan chan string
	// contains filtered or unexported fields
}
var (
	GlobalResult *ExecutionResult
	MutexResult  sync.Mutex
)

func Start

func Start(exploitPath string, tickTime int, threadCount int, port uint16, test bool) (*ExecutionResult, error)

func (*ExecutionResult) Shutdown

func (e *ExecutionResult) Shutdown() error

Shutdown end the exploit process.

type ParsedFlagOutput

type ParsedFlagOutput struct {
	TeamID      uint16 `json:"team_id"`      // ID of the team the flag was extracted from
	PortService uint16 `json:"port_service"` // Port of the service that produced the flag
	Status      string `json:"status"`       // Status of the flag submission (eg "success", "failed", "error", "fatal")
	FlagCode    string `json:"flag_code"`    // The actual flag string
	NameService string `json:"name_service"` // Human-readable name of the service
	Message     string `json:"message"`      // Additional message or error information
}

ParsedFlagOutput represents the output of a parsed flag returned by an exploit run in the exploit_manager, ready to be submitted.

type StatusBatchOutput

type StatusBatchOutput struct {
	Status      string `json:"status"`       // Status of the flag submission (eg "success", "failed", "error", "fatal")
	Message     string `json:"message"`      // Additional message or error information
	NameService string `json:"name_service"` // Human-readable name of the service
	PortService uint16 `json:"port_service"` // Port of the service that produced the flag
	TotalFlag   int    `json:"total_flag"`   // Total flag collected in the batch
	SuccessTeam int    `json:"success_team"` // Total number of teams from which flags were successfully extracted
	FailedTeam  int    `json:"failed_team"`  // Total number of teams from which flag extraction failed
}

type StreamingResult

type StreamingResult struct {
	OutputChan chan string
	ErrorChan  chan error
	ExitChan   chan struct{}
	PID        int
}

StreamingResult contains the result channels for RunFuncTui

func Run

func Run(exploitPath string, tickTime int, threads int, servicePort uint16, test bool) (*StreamingResult, error)

Run executes the exploit with the given parameters and returns a StreamingResult

Jump to

Keyboard shortcuts

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