Does the sdk of nuclei not load the specified templates.Template directly? #4721
-
Does the sdk of nuclei not load the specified templates.Template directly? |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 5 replies
-
nuclei sdk does not execute directly with the parsed templates.Template structure, or do you need to use local or remote yaml to execute, and then add the parsed templates.Template to the sdk |
Beta Was this translation helpful? Give feedback.
-
I'm not sure I completely understand the question @sairson but you would need to parse the templates using the methods provided by the SDK and pass those to the nuclei SDK for processing. You should check out the examples here: https://github.com/projectdiscovery/nuclei/blob/dev/lib/README.md |
Beta Was this translation helpful? Give feedback.
-
I checked the relevant documents, I mean the specified data parsing as templates, Template structure, through the call, similar to the exec (target []string, templates []*templats.Template, resultCallback func()) structure |
Beta Was this translation helpful? Give feedback.
-
That is, I want to execute the nuclei engine from a template of bytes, not a path |
Beta Was this translation helpful? Give feedback.
-
@sairson ,you can parse a template from bytes using this method from v3 sdk ( see: https://pkg.go.dev/github.com/projectdiscovery/nuclei/[email protected]/lib#NucleiEngine.ParseTemplate )
and to execute this obtained template you can call execute method on that type/object tmpl ,err := nuclei.ParseTemplate(....)
if err != nil{
return err
}
tmpl.Executer.Execute(scanCtx) see: https://pkg.go.dev/github.com/projectdiscovery/nuclei/[email protected]/pkg/protocols#Executer |
Beta Was this translation helpful? Give feedback.
@sairson ,you can parse a template from bytes using this method from v3 sdk ( see: https://pkg.go.dev/github.com/projectdiscovery/nuclei/[email protected]/lib#NucleiEngine.ParseTemplate )
and to execute this obtained template you can call execute method on that type/object
see: https://pkg.go.dev/github.com/projectdiscovery/nuclei/v…