engine

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 8, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package engine orchestrates credential queuing, worker pools, per-attempt retry, timing hooks, and stop-on-success cancellation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Plugin     plugins.Plugin
	PluginArgs map[string]string

	Users     []string
	Passwords []string
	UserPass  []creds.Credential

	UserAgents []string

	Workers       int
	Randomize     bool
	Timing        timing.Policy
	StopOnSuccess bool

	ProxySource proxy.Source
	HTTPOpts    httpclient.Options

	Notifier notify.Notifier
	Output   *output.Sink

	// OperatorID is included in every notify.Event so chat backends can
	// distinguish concurrent operators. Empty string disables the prefix.
	OperatorID string

	// JSONOutput, when non-nil, receives every spray/password/attempt event
	// in parallel with the text Output sink. Nil disables JSON emission.
	JSONOutput *output.JSONSink

	// Checkpoint, when non-nil, is consulted in the dispatch loop to skip
	// already-recorded (user, password) pairs and called from handleOutcome
	// to record classified attempts. Nil disables resume support.
	Checkpoint *checkpoint.File

	// RetryBackoff is the sleep between retry attempts within a single
	// credential's attemptWithRetry loop. Zero defaults to 2 * time.Second.
	// Tests use a small value (e.g. 1 * time.Millisecond) to disable
	// production-time backoff and shave wall-clock time.
	RetryBackoff time.Duration
}

type Stats

type Stats struct {
	Started, Ended time.Time
	Duration       time.Duration
	Attempts       int // credential attempts (one per cred, regardless of retries)
	Requests       int // total HTTP requests issued (attempts + retries)
	Successes      []creds.Credential
	ValidUsers     []string
	TransportErrs  int
	Skipped        int // credentials filtered by --resume checkpoint state
	Cancelled      bool
}

func Run

func Run(ctx context.Context, cfg Config) (Stats, error)

Jump to

Keyboard shortcuts

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