Documentation ¶
Index ¶
- type Engine
- func (e *Engine) Execute(ctx context.Context, templates []*templates.Template, ...) *atomic.Bool
- func (e *Engine) ExecuteScanWithOpts(ctx context.Context, templatesList []*templates.Template, ...) *atomic.Bool
- func (e *Engine) ExecuteWithResults(ctx context.Context, templatesList []*templates.Template, ...) *atomic.Bool
- func (e *Engine) ExecuterOptions() protocols.ExecutorOptions
- func (e *Engine) GetWorkPool() *WorkPool
- func (e *Engine) GetWorkPoolConfig() WorkPoolConfig
- func (e *Engine) SetExecuterOptions(options protocols.ExecutorOptions)
- func (e *Engine) WorkPool() *WorkPool
- type WorkPool
- type WorkPoolConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Engine ¶
type Engine struct { Callback func(*output.ResultEvent) // Executed on results // contains filtered or unexported fields }
Engine is an executer for running Nuclei Templates/Workflows.
The engine contains multiple thread pools which allow using different concurrency values per protocol executed.
The engine does most of the heavy lifting of execution, from clustering templates to leading to the final execution by the work pool, it is handled by the engine.
func (*Engine) Execute ¶
func (e *Engine) Execute(ctx context.Context, templates []*templates.Template, target provider.InputProvider) *atomic.Bool
Execute takes a list of templates/workflows that have been compiled and executes them based on provided concurrency options.
All the execution logic for the templates/workflows happens in this part of the engine.
func (*Engine) ExecuteScanWithOpts ¶
func (e *Engine) ExecuteScanWithOpts(ctx context.Context, templatesList []*templates.Template, target provider.InputProvider, noCluster bool) *atomic.Bool
ExecuteScanWithOpts executes scan with given scanStrategy
func (*Engine) ExecuteWithResults ¶
func (e *Engine) ExecuteWithResults(ctx context.Context, templatesList []*templates.Template, target provider.InputProvider, callback func(*output.ResultEvent)) *atomic.Bool
ExecuteWithResults a list of templates with results
func (*Engine) ExecuterOptions ¶
func (e *Engine) ExecuterOptions() protocols.ExecutorOptions
ExecuterOptions returns protocols.ExecutorOptions for nuclei engine.
func (*Engine) GetWorkPool ¶
GetWorkPool returns a workpool from options
func (*Engine) GetWorkPoolConfig ¶ added in v3.2.5
func (e *Engine) GetWorkPoolConfig() WorkPoolConfig
func (*Engine) SetExecuterOptions ¶
func (e *Engine) SetExecuterOptions(options protocols.ExecutorOptions)
SetExecuterOptions sets the executer options for the engine. This is required before using the engine to perform any execution.
type WorkPool ¶
type WorkPool struct { Headless *syncutil.AdaptiveWaitGroup Default *syncutil.AdaptiveWaitGroup // contains filtered or unexported fields }
WorkPool implements an execution pool for executing different types of task with different concurrency requirements.
It also allows Configuration of such requirements. This is used for per-module like separate headless concurrency etc.
func NewWorkPool ¶
func NewWorkPool(config WorkPoolConfig) *WorkPool
NewWorkPool returns a new WorkPool instance
func (*WorkPool) InputPool ¶
func (w *WorkPool) InputPool(templateType types.ProtocolType) *syncutil.AdaptiveWaitGroup
InputPool returns a work pool for an input type
func (*WorkPool) RefreshWithConfig ¶ added in v3.2.5
func (w *WorkPool) RefreshWithConfig(config WorkPoolConfig)
type WorkPoolConfig ¶
type WorkPoolConfig struct { // InputConcurrency is the concurrency for inputs values. InputConcurrency int // TypeConcurrency is the concurrency for the request type templates. TypeConcurrency int // HeadlessInputConcurrency is the concurrency for headless inputs values. HeadlessInputConcurrency int // TypeConcurrency is the concurrency for the headless request type templates. HeadlessTypeConcurrency int }
WorkPoolConfig is the configuration for work pool