Nuclei is a fast, customizable vulnerability scanner powered by the global security community and built on a simple YAML-based DSL, enabling collaboration to tackle trending vulnerabilities on the internet. It helps you find vulnerabilities in your applications, APIs, networks, DNS, and cloud configurations.
We would like to request a new method in the Nuclei SDK module that allows users to specify targets, templates, and a callback method for execution.
This method should:
Targets: Accept one or multiple targets as input for scanning.
Templates: Specify a set of templates to use, allowing users to choose from predefined templates or define their own template files.
Callback Method: Allow users to provide a callback method that processes scan results after execution (e.g., for logging or report generation).
Describe the use case of the feature
This is a version I implemented, but I am unable to control using a separate callback for each execution, as I need to carry task-specific information for different tasks. Therefore, I cannot use the same result_callback.
func (e *NucleiEngine) ExecuteWithProvider(ctx context.Context, target provider.InputProvider, templateIds []string, callback func(event *output.ResultEvent)) error {
if target.Count() == 0 {
return ErrNoTargetsAvailable
}
var filtered []func(event *output.ResultEvent)
if callback != nil {
filtered = append(filtered, callback)
}
templatesAndWorkflows := append(e.store.Templates(), e.store.Workflows()...)
if len(templatesAndWorkflows) == 0 {
return ErrNoTemplatesAvailable
}
// load templates
var finalTemplates []*templates.Template
for _, id := range templateIds {
tmpl := e.templateMaps[FormatName(id)]
if tmpl != nil {
finalTemplates = append(finalTemplates, tmpl)
}
}
_ = e.engine.ExecuteScanWithOpts(ctx, finalTemplates, target, false)
defer e.engine.WorkPool().Wait()
return nil
}
Describe your feature request
We would like to request a new method in the Nuclei SDK module that allows users to specify targets, templates, and a callback method for execution.
This method should:
Targets: Accept one or multiple targets as input for scanning. Templates: Specify a set of templates to use, allowing users to choose from predefined templates or define their own template files. Callback Method: Allow users to provide a callback method that processes scan results after execution (e.g., for logging or report generation).
Describe the use case of the feature
This is a version I implemented, but I am unable to control using a separate callback for each execution, as I need to carry task-specific information for different tasks. Therefore, I cannot use the same result_callback.
Describe alternatives you've considered
No response
Additional context
No response