nuclei icon indicating copy to clipboard operation
nuclei copied to clipboard

通过SDK 如何获得not found的output.ResultEvent

Open zephyrzzw opened this issue 1 year ago • 7 comments
trafficstars

通过sdk ExecuteWithCallback函数只能获取result(only if results are found),found && not found 的 result 我都想要,有没有方法可以实现?

zephyrzzw avatar Apr 15 '24 12:04 zephyrzzw

Hi @zhoujubhong ! Thanks for your request. We'll take a look into this - just dropping a translation here for reference:

'Through the sdk ExecuteWithCallback function, I can only get the result (only if results are found), and I want the results of found && not found. Is there any way to achieve this?'

GeorginaReeder avatar Apr 16 '24 10:04 GeorginaReeder

@GeorginaReeder When executing a scanning task using the SDK's ExecuteWithCallback function, only events can be obtained (only when results are found). However, I want to capture both results and when no results are found, analyzing the information of requests and responses within the task.

zephyrzzw avatar Apr 16 '24 11:04 zephyrzzw

Try with WithMatcherStatus(true)

Mzack9999 avatar Apr 16 '24 11:04 Mzack9999

@Mzack9999 thank you!

zephyrzzw avatar Apr 16 '24 11:04 zephyrzzw

@Mzack9999 Hi,This method does not solve the problem, I expect to get the debug message of each POC and read it through the io.WriteCloser.

zephyrzzw avatar Apr 16 '24 13:04 zephyrzzw

func(){ writer, err := output.NewWriter(
		output.WithMatcherStatus(true),
		output.WithJson(true, true),
		
	)
	if err != nil {
		panic(err)
	}
	var ne *nuclei.NucleiEngine
	ne, err = nuclei.NewNucleiEngine(
		nuclei.UseOutputWriter(writer),
	)}

zephyrzzw avatar Apr 16 '24 13:04 zephyrzzw

type NucleiEngine struct {
	// user options
	resultCallbacks             []func(event *output.ResultEvent)
	onFailureCallback           func(event *output.InternalEvent)
	disableTemplatesAutoUpgrade bool
	enableStats                 bool
	onUpdateAvailableCallback   func(newVersion string)
        ……
}

I want to get "onFailureCallback           func(event *output.InternalEvent)"

zephyrzzw avatar Apr 16 '24 14:04 zephyrzzw