Documentation
¶
Index ¶
- func HistoryReplayable(conf *ffuf.Config) (bool, string)
- func ResultPassesFilters(result ffuf.Result, filters map[string]ffuf.FilterProvider, mode string) (bool, error)
- func WriteHistoryEntry(conf *ffuf.Config) (string, error)
- type ConfigOptionsHistory
- type Job
- func (j *Job) AddFilters(options map[string]string) error
- func (j *Job) BeginRunTransportAttempt()
- func (j *Job) Calibrate(input map[string][]byte) error
- func (j *Job) CalibrateForHost(host string, baseinput map[string][]byte) error
- func (j *Job) CalibrateIfNeeded(host string, input map[string][]byte) error
- func (j *Job) CheckStop()
- func (j *Job) DeleteQueueItem(index int)
- func (j *Job) EndRunTransportAttempt()
- func (j *Job) Next()
- func (j *Job) Pause()
- func (j *Job) QueuedJobs() []QueueJob
- func (j *Job) RecordRunTransportAttempt(attempt ffuf.RunTransportAttempt)
- func (j *Job) Reset(cycle bool)
- func (j *Job) Resume()
- func (j *Job) SetExternallyManaged(managed bool)
- func (j *Job) SkipQueue()
- func (j *Job) Snapshot() JobSnapshot
- func (j *Job) Start()
- func (j *Job) Stop()
- type JobSnapshot
- type QueueJob
- type RateThrottle
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ResultPassesFilters ¶
func ResultPassesFilters(result ffuf.Result, filters map[string]ffuf.FilterProvider, mode string) (bool, error)
ResultPassesFilters applies a filter set to the metrics retained for an already-observed result. It mirrors ffuf's OR/AND filter semantics without inventing response content that the high-throughput web output deliberately does not store. Regexp filtering is therefore unavailable post-start.
Types ¶
type ConfigOptionsHistory ¶
type ConfigOptionsHistory struct {
ffuf.ConfigOptions
Time time.Time `json:"time"`
}
func SearchHash ¶
func SearchHash(hash string) ([]ConfigOptionsHistory, int, error)
type Job ¶
type Job struct {
AuditLogger ffuf.AuditLogger
Config *ffuf.Config
Input ffuf.InputProvider
Runner ffuf.RunnerProvider
ReplayRunner ffuf.RunnerProvider
Scraper ffuf.Scraper
Output ffuf.OutputProvider
Jobhash string
Total int
Rate *RateThrottle
// contains filtered or unexported fields
}
Job ties together Config, Runner, Input and Output
func (*Job) AddFilters ¶
AddFilters atomically appends metric filters to a running job. Live filter changes are restricted to OR mode because appending a new predicate in AND mode can make previously hidden responses visible, and those responses were never retained by the output pipeline. In OR mode additions are monotonic: they affect future match decisions and can safely be replayed over persisted findings without requiring a scan restart.
func (*Job) BeginRunTransportAttempt ¶
func (j *Job) BeginRunTransportAttempt()
func (*Job) Calibrate ¶
CalibrateResponses returns slice of Responses for randomly generated filter autocalibration requests
func (*Job) CalibrateForHost ¶
CalibrateForHost runs autocalibration for a specific host
func (*Job) CalibrateIfNeeded ¶
CalibrateIfNeeded runs a self-calibration task for filtering options (if needed) by requesting random resources and
configuring the filters accordingly
func (*Job) CheckStop ¶
func (j *Job) CheckStop()
CheckStop stops the job if stopping conditions are met
func (*Job) DeleteQueueItem ¶
DeleteQueueItem deletes a recursion job from the queue by its index in the slice
func (*Job) EndRunTransportAttempt ¶
func (j *Job) EndRunTransportAttempt()
func (*Job) Pause ¶
func (j *Job) Pause()
Pause pauses the job process. The pause gate is a sync.RWMutex: while Pause holds the write lock, every worker blocks at its pauseCheckpoint (an RLock).
pauseStateMutex makes the paused-flag flip and the pauseMutex Lock/Unlock a single atomic step, so there is exactly one Lock per Unlock and no goroutine ever unlocks an unlocked mutex (a fatal panic), however Pause, Resume, and the SIGINT handler interleave.
Pausing is refused once the job is stopping (isRunning is false). Together with Stop() calling Resume(), that guarantees the gate always ends OPEN after a Stop regardless of ordering, so a Pause racing a Stop can never strand a worker at the checkpoint with no Resume left to wake it.
func (*Job) QueuedJobs ¶
QueuedJobs returns the slice of queued recursive jobs
func (*Job) RecordRunTransportAttempt ¶
func (j *Job) RecordRunTransportAttempt(attempt ffuf.RunTransportAttempt)
func (*Job) SetExternallyManaged ¶
SetExternallyManaged configures lifecycle ownership for an embedded Job. Call it before Start. Managed jobs leave process signal handling to their host and retain Pause/Resume support when Config.Noninteractive is true.
func (*Job) SkipQueue ¶
func (j *Job) SkipQueue()
SkipQueue allows to skip the current job and advance to the next queued recursion job
func (*Job) Snapshot ¶
func (j *Job) Snapshot() JobSnapshot
Snapshot returns a point-in-time view of lifecycle state and progress. All mutable fields are read through the same atomics and locks used by the engine.
type JobSnapshot ¶
type JobSnapshot struct {
Running bool `json:"running"`
RunningJob bool `json:"running_job"`
Paused bool `json:"paused"`
Progress ffuf.Progress `json:"progress"`
Error string `json:"error,omitempty"`
StartedAt time.Time `json:"started_at"`
StartedAtJob time.Time `json:"started_at_job"`
}
JobSnapshot is an immutable, race-safe view of a Job's lifecycle and progress. It is intended for embedders that need to render status while the job is running without reaching into Job's mutable internals.
type RateThrottle ¶
type RateThrottle struct {
Config *ffuf.Config
RateMutex sync.Mutex
RateLimiter *time.Ticker
// contains filtered or unexported fields
}
func NewRateThrottle ¶
func NewRateThrottle(conf *ffuf.Config) *RateThrottle
func (*RateThrottle) ChangeRate ¶
func (r *RateThrottle) ChangeRate(rate int)
func (*RateThrottle) CurrentConfiguredRate ¶
func (r *RateThrottle) CurrentConfiguredRate() int64
CurrentConfiguredRate returns the configured rate under the lock, for callers (e.g. the interactive handler) that only need to display it.
func (*RateThrottle) CurrentRate ¶
func (r *RateThrottle) CurrentRate() int64
CurrentRate reports processed wordlist inputs over a rolling one-second window. Progress rendering can poll every few milliseconds while HTTP/3 completions arrive in batches. Sampling those tiny intervals made the displayed value alternate between zero and implausibly high spikes. Keeping sparse snapshots makes the display stable; Tick only adds atomic counter/activity updates.
func (*RateThrottle) Tick ¶
func (r *RateThrottle) Tick()
Tick records one completed input. It remains lock-free and allocation-free; the timestamp lets CurrentRate prove a full quiet window even when progress rendering did not poll between the burst and the idle period.
func (*RateThrottle) Wait ¶
func (r *RateThrottle) Wait()
Wait blocks until a configured rate-limit token is available. The common unlimited path is one atomic load and no timer/channel operation. If the rate changes while a caller is waiting, changed wakes it to re-evaluate rather than leaving it blocked on a ticker that was just stopped.