Skip to content

Does the sdk of nuclei not load the specified templates.Template directly? #4721

Answered by tarunKoyalwar
sairson asked this question in Q&A
Discussion options

You must be logged in to vote

@sairson ,you can parse a template from bytes using this method from v3 sdk ( see: https://pkg.go.dev/github.com/projectdiscovery/nuclei/v3@v3.1.10/lib#NucleiEngine.ParseTemplate )

func (*NucleiEngine) ParseTemplate
added in v3.0.3
func (e NucleiEngine) ParseTemplate(data []byte) (templates.Template, error)
ParseTemplate parses a template from given data template verification status can be accessed from template.Verified

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/v…

Replies: 5 comments 5 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@sairson
Comment options

@sairson
Comment options

Comment options

You must be logged in to vote
1 reply
@olearycrew
Comment options

Comment options

You must be logged in to vote
2 replies
@sairson
Comment options

@sairson
Comment options

Answer selected by sairson
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants