-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Labels
Type: BugInconsistencies or issues which will cause an issue or problem for users or implementors.Inconsistencies or issues which will cause an issue or problem for users or implementors.
Description
Is there an existing issue for this?
- I have searched the existing issues.
Current Behavior
Getting panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV:segmentation violation code=0x2 addr=0x8 pc=0x1021c5600]
While running nuclei go library with headless template
Expected Behavior
Run the headless screenshot template and return the output
Steps To Reproduce
- Run the nuclei headless template using nuclei sdk
ctx := context.Background()
ne, err := nuclei.NewThreadSafeNucleiEngineCtx(ctx,
// nuclei.WithVerbosity(nuclei.VerbosityOptions{
// Verbose: true,
// Debug: true,
// }),
nuclei.EnableHeadlessWithOpts(&nuclei.HeadlessOpts{
PageTimeout: 30,
ShowBrowser: false,
UseChrome: false,
}),
)
if err != nil {
panic(err)
}
// setup waitgroup to handle concurrency
wg := &sync.WaitGroup{}
// scan 1 = run dns templates on scanme.sh
wg.Add(1)
go func() {
defer wg.Done()
err = ne.ExecuteNucleiWithOpts([]string{"scanme.sh"}, nuclei.WithTemplateFilters(nuclei.TemplateFilters{IDs: []string{"screenshot"}}))
if err != nil {
panic(err)
}
}()
// scan 2 = run http templates on honey.scanme.sh
wg.Add(1)
go func() {
defer wg.Done()
err = ne.ExecuteNucleiWithOpts([]string{"honey.scanme.sh"}, nuclei.WithTemplateFilters(nuclei.TemplateFilters{IDs: []string{"screenshot"}}))
if err != nil {
panic(err)
}
}()
// wait for all scans to finish
wg.Wait()
defer ne.Close()Relevant log output
[signal SIGSEGV: segmentation violation code=0x2 addr=0x8 pc=0x1021c5600]
goroutine 5325 [running]:
github.com/projectdiscovery/nuclei/v3/pkg/protocols/headless/engine.(*Browser).UserAgent(...)
/Users/jeya-12107/go/pkg/mod/github.com/projectdiscovery/nuclei/[email protected]/pkg/protocols/headless/engine/engine.go:134
github.com/projectdiscovery/nuclei/v3/pkg/protocols/headless.(*Request).ExecuteWithResults(0x1402424d600, 0x0?, 0x14027855b30, 0x14027855da0, 0x14027855e00)
/Users/jeya-12107/go/pkg/mod/github.com/projectdiscovery/nuclei/[email protected]/pkg/protocols/headless/request.go:50 +0x90
github.com/projectdiscovery/nuclei/v3/pkg/tmplexec/generic.(*Generic).ExecuteWithResults(0x14027f3bef0, 0x14000afbe00)
/Users/jeya-12107/go/pkg/mod/github.com/projectdiscovery/nuclei/[email protected]/pkg/tmplexec/generic/exec.go:61 +0x27c
github.com/projectdiscovery/nuclei/v3/pkg/tmplexec.(*TemplateExecuter).Execute(0x140045fd080, 0x14000afbe00)
/Users/jeya-12107/go/pkg/mod/github.com/projectdiscovery/nuclei/[email protected]/pkg/tmplexec/exec.go:212 +0x33c
github.com/projectdiscovery/nuclei/v3/pkg/core.(*Engine).executeTemplateWithTargets.func2.1(0x24cccd0?, 0x40?, 0x14003e2ed40)
/Users/jeya-12107/go/pkg/mod/github.com/projectdiscovery/nuclei/[email protected]/pkg/core/executors.go:139 +0x1a4
created by github.com/projectdiscovery/nuclei/v3/pkg/core.(*Engine).executeTemplateWithTargets.func2 in goroutine 5324
/Users/jeya-12107/go/pkg/mod/github.com/projectdiscovery/nuclei/[email protected]/pkg/core/executors.go:115 +0x484
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x8 pc=0x1021c5600]
goroutine 5249 [running]:
github.com/projectdiscovery/nuclei/v3/pkg/protocols/headless/engine.(*Browser).UserAgent(...)
/Users/jeya-12107/go/pkg/mod/github.com/projectdiscovery/nuclei/[email protected]/pkg/protocols/headless/engine/engine.go:134
github.com/projectdiscovery/nuclei/v3/pkg/protocols/headless.(*Request).ExecuteWithResults(0x1402424d600, 0x0?, 0x14027efc630, 0x14027efc960, 0x14027efc9c0)
/Users/jeya-12107/go/pkg/mod/github.com/projectdiscovery/nuclei/[email protected]/pkg/protocols/headless/request.go:50 +0x90
github.com/projectdiscovery/nuclei/v3/pkg/tmplexec/generic.(*Generic).ExecuteWithResults(0x14027f3bef0, 0x14000c66460)
/Users/jeya-12107/go/pkg/mod/github.com/projectdiscovery/nuclei/[email protected]/pkg/tmplexec/generic/exec.go:61 +0x27c
github.com/projectdiscovery/nuclei/v3/pkg/tmplexec.(*TemplateExecuter).Execute(0x140045fd080, 0x14000c66460)
/Users/jeya-12107/go/pkg/mod/github.com/projectdiscovery/nuclei/[email protected]/pkg/tmplexec/exec.go:212 +0x33c
github.com/projectdiscovery/nuclei/v3/pkg/core.(*Engine).executeTemplateWithTargets.func2.1(0x25e03c0?, 0x40?, 0x14004678c80)
/Users/jeya-12107/go/pkg/mod/github.com/projectdiscovery/nuclei/[email protected]/pkg/core/executors.go:139 +0x1a4
created by github.com/projectdiscovery/nuclei/v3/pkg/core.(*Engine).executeTemplateWithTargets.func2 in goroutine 5248
/Users/jeya-12107/go/pkg/mod/github.com/projectdiscovery/nuclei/[email protected]/pkg/core/executors.go:115 +0x484
exit status 2Environment
- OS: Mac darwin/arm64
- Nuclei: github.com/projectdiscovery/nuclei/v3 v3.3.7
- Go: go1.23.1 darwin/arm64Anything else?
Ref : https://discord.com/channels/695645237418131507/1313145260863393862 (dis
Metadata
Metadata
Assignees
Labels
Type: BugInconsistencies or issues which will cause an issue or problem for users or implementors.Inconsistencies or issues which will cause an issue or problem for users or implementors.
