diff --git a/lib/sdk.go b/lib/sdk.go index 9bd46f4766..7f2ec5bcc2 100644 --- a/lib/sdk.go +++ b/lib/sdk.go @@ -112,6 +112,14 @@ func (e *NucleiEngine) GetTemplates() []*templates.Template { return e.store.Templates() } +// GetWorkflows returns all nuclei workflows that are loaded +func (e *NucleiEngine) GetWorkflows() []*templates.Template { + if !e.templatesLoaded { + _ = e.LoadAllTemplates() + } + return e.store.Workflows() +} + // LoadTargets(urls/domains/ips only) adds targets to the nuclei engine func (e *NucleiEngine) LoadTargets(targets []string, probeNonHttp bool) { for _, target := range targets { @@ -271,6 +279,11 @@ func (e *NucleiEngine) Engine() *core.Engine { return e.engine } +// Store returns store of nuclei +func (e *NucleiEngine) Store() *loader.Store { + return e.store +} + // NewNucleiEngineCtx creates a new nuclei engine instance with given context func NewNucleiEngineCtx(ctx context.Context, options ...NucleiSDKOptions) (*NucleiEngine, error) { // default options