projectdiscovery / nuclei

Fast and customizable vulnerability scanner based on simple YAML based DSL.
https://docs.projectdiscovery.io/tools/nuclei
MIT License
19.93k stars 2.45k forks source link

Error when pressing Ctrl+C while scanning not creating resume file #5475

Closed islamomar27 closed 1 month ago

islamomar27 commented 1 month ago

Nuclei version:

3.3.0

Current Behavior:

When I press Ctrl+C to stop the scan it gives me this error and doesn't create the resume.cfg file

[INF] Creating resume file: path/resume-cql65g2epb7rduo231j0.cfg
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xc73c58]

goroutine 24975477 [running]:
github.com/projectdiscovery/fastdialer/fastdialer.(*Dialer).DialTLS(0x0, {0x35aa088, 0xc0005cbea0}, {0x2aeff05, 0x3}, {0xc019b40210, 0x16})
        github.com/projectdiscovery/fastdialer@v0.1.6/fastdialer/dialer.go:212 +0x38
github.com/projectdiscovery/nuclei/v3/pkg/protocols/http/httpclientpool.wrappedGet.func1({0x35aa088?, 0xc0005cbea0?}, {0x2aeff05?, 0x35a9e10?}, {0xc019b40210?, 0x266e720?})
        github.com/projectdiscovery/nuclei/v3/pkg/protocols/http/httpclientpool/clientpool.go:244 +0xb0
net/http.(*Transport).customDialTLS(0x28836c0?, {0x35aa088?, 0xc0005cbea0?}, {0x2aeff05?, 0xc012cf3ab0?}, {0xc019b40210?, 0x7b0685?})
        net/http/transport.go:1335 +0x4a
net/http.(*Transport).dialConn(0xc00055ea00, {0x35aa088, 0xc0005cbea0}, {{}, 0x0, {0xc003cdeea0, 0x5}, {0xc019b40210, 0x16}, 0x0})
        net/http/transport.go:1601 +0x3df
net/http.(*Transport).dialConnFor(0x7bb785?, 0xc0005458c0)
        net/http/transport.go:1467 +0x9f
created by net/http.(*Transport).queueForDial in goroutine 24578111
        net/http/transport.go:1436 +0x3cb

Expected Behavior:

stops the scan and creates the resume.cfg file

Steps To Reproduce:

press Ctrl+C while the scan is running

Anything else:

some times the error happens and other times it stop the scan as expected

dogancanbakir commented 1 month ago

I tried many times to reproduce the issue, but nothing worked! Something could be causing a race condition. Could you share the command you used for further investigation? Thanks!

dogancanbakir commented 1 month ago

Also, can you retry it with the remove_redundant_code branch when you can?