Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(engine): Resolve issue with ExecuteWithResults function not returning expected results #5376

Merged
merged 1 commit into from
Jul 15, 2024

Conversation

boy-hack
Copy link
Contributor

@boy-hack boy-hack commented Jul 5, 2024

When attempting to use the ExecuteWithResults function, users were finding that the function was not returning the expected results. This fix addresses the root cause of this problem.

example code

	v := nuclei.VerbosityOptions{
		Verbose:       true,
		Silent:        false,
		Debug:         true,
		DebugRequest:  false,
		DebugResponse: false,
		ShowVarDump:   false,
	}
	ne, err := nuclei.NewNucleiEngine(
		nuclei.WithVerbosity(v),
	)
	if err != nil {
		panic(err)
	}
	defer ne.Close()
	httpProvider := provider.NewSimpleInputProvider()
	httpProvider.Set("https://x.hacking8.com")

	filename := "1.yaml"
	data, err := ioutil.ReadFile(filename)
	if err != nil {
		panic(err)
	}
	poc, err := ne.ParseTemplate(data)
	if err != nil {
		panic(err)
	}
	pocList := []*templates.Template{
		poc,
	}
	engine := ne.Engine()
	engine.ExecuteWithResults(context.Background(), pocList, httpProvider, func(event *output.ResultEvent) {
		fmt.Println(1)
		fmt.Println(event)
	})
	engine.WorkPool().Wait()

Proposed changes

Checklist

  • Pull request is created against the dev branch
  • All checks passed (lint, unit/integration/regression tests etc.) with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

…ning expected results

fix(engine): Resolve issue with ExecuteWithResults function not returning expected results

When attempting to use the `ExecuteWithResults` function, users were finding that the function was not returning the expected results. This fix addresses the root cause of this problem.
@ehsandeep ehsandeep requested a review from tarunKoyalwar July 5, 2024 18:14
Copy link
Member

@tarunKoyalwar tarunKoyalwar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for fixing this issue @boy-hack

@tarunKoyalwar tarunKoyalwar requested a review from ehsandeep July 8, 2024 10:35
@ehsandeep ehsandeep merged commit deb0dd2 into projectdiscovery:dev Jul 15, 2024
9 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants