Documentation ¶
Index ¶
- type ChildExecuter
- type Engine
- func (e *Engine) ChildExecuter() *ChildExecuter
- func (e *Engine) Execute(templates []*templates.Template, target provider.InputProvider) *atomic.Bool
- func (e *Engine) ExecuteScanWithOpts(templatesList []*templates.Template, target provider.InputProvider, ...) *atomic.Bool
- func (e *Engine) ExecuteWithResults(templatesList []*templates.Template, target provider.InputProvider, ...) *atomic.Bool
- func (e *Engine) ExecuterOptions() protocols.ExecutorOptions
- func (e *Engine) GetWorkPool() *WorkPool
- func (e *Engine) SetExecuterOptions(options protocols.ExecutorOptions)
- func (e *Engine) WorkPool() *WorkPool
- type InputWorkPool
- type WorkPool
- type WorkPoolConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChildExecuter ¶
type ChildExecuter struct {
// contains filtered or unexported fields
}
func (*ChildExecuter) Close ¶
func (e *ChildExecuter) Close() *atomic.Bool
Close closes the executer returning bool results
func (*ChildExecuter) Execute ¶
func (e *ChildExecuter) Execute(template *templates.Template, value *contextargs.MetaInput)
Execute executes a template and URLs
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) ChildExecuter ¶
func (e *Engine) ChildExecuter() *ChildExecuter
ExecuteWithOpts executes with the full options
func (*Engine) Execute ¶
func (e *Engine) Execute(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(templatesList []*templates.Template, target provider.InputProvider, noCluster bool) *atomic.Bool
ExecuteScanWithOpts executes scan with given scanStrategy
func (*Engine) ExecuteWithResults ¶
func (e *Engine) ExecuteWithResults(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) 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 InputWorkPool ¶
type InputWorkPool struct {
WaitGroup *sizedwaitgroup.SizedWaitGroup
}
InputWorkPool is a work pool per-input
type WorkPool ¶
type WorkPool struct { Headless *sizedwaitgroup.SizedWaitGroup Default *sizedwaitgroup.SizedWaitGroup // 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) *InputWorkPool
InputPool returns a work pool for an input type
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