diff --git a/pkg/input/provider/list/hmap_test.go b/pkg/input/provider/list/hmap_test.go index c3fb4a6699..95fc57f2d9 100644 --- a/pkg/input/provider/list/hmap_test.go +++ b/pkg/input/provider/list/hmap_test.go @@ -13,6 +13,7 @@ import ( "github.com/projectdiscovery/nuclei/v3/pkg/protocols/common/protocolstate" "github.com/projectdiscovery/nuclei/v3/pkg/types" "github.com/projectdiscovery/nuclei/v3/pkg/utils/expand" + "github.com/projectdiscovery/utils/auth/pdcp" "github.com/stretchr/testify/require" ) @@ -153,6 +154,13 @@ func Test_scanallips_normalizeStoreInputValue(t *testing.T) { } func Test_expandASNInputValue(t *testing.T) { + // skip this test if pdcp keys are not present + h := pdcp.PDCPCredHandler{} + creds, err := h.GetCreds() + if err != nil || creds == nil || creds.APIKey == "" { + t.Logf("Skipping asnmap test as pdcp keys are not present") + t.SkipNow() + } tests := []struct { asn string expectedOutputFile string diff --git a/pkg/tmplexec/exec.go b/pkg/tmplexec/exec.go index fc504171e6..c510131da2 100644 --- a/pkg/tmplexec/exec.go +++ b/pkg/tmplexec/exec.go @@ -205,9 +205,25 @@ func (e *TemplateExecuter) Execute(ctx *scan.ScanContext) (bool, error) { // ExecuteWithResults executes the protocol requests and returns results instead of writing them. func (e *TemplateExecuter) ExecuteWithResults(ctx *scan.ScanContext) ([]*output.ResultEvent, error) { - err := e.engine.ExecuteWithResults(ctx) - ctx.LogError(err) - return ctx.GenerateResult(), err + var errx error + if e.options.Flow != "" { + flowexec, err := flow.NewFlowExecutor(e.requests, ctx, e.options, e.results, e.program) + if err != nil { + ctx.LogError(err) + return nil, fmt.Errorf("could not create flow executor: %s", err) + } + if err := flowexec.Compile(); err != nil { + ctx.LogError(err) + return nil, err + } + errx = flowexec.ExecuteWithResults(ctx) + } else { + errx = e.engine.ExecuteWithResults(ctx) + } + if errx != nil { + ctx.LogError(errx) + } + return ctx.GenerateResult(), errx } // getTemplateType returns the template type of the template