nuclei icon indicating copy to clipboard operation
nuclei copied to clipboard

Nuclei return exit code 1 when no results are found

Open yaabdala opened this issue 1 year ago • 1 comments
trafficstars

https://github.com/projectdiscovery/nuclei/blob/e480d131f1b8545070fb0e7fef7a4aaac423d485/internal/runner/runner.go#L591-L601 Seems like this could be caused by an error not checked? or a deliberate action, I'm not quite sure where the exit code is being set. Regardless I don't think no results should cause a non zero exit code. It isn't really an error and can cause issues if you are using the exit code to handle errors in a script

yaabdala avatar Apr 23 '24 21:04 yaabdala

@yaabdala Could you provide the full nuclei command with output generating the status code 1?

I'm unable to reproduce, without results the exit status is 0 both on linux, osx, and windows (pasted here as latest tried):

> nuclei -id tech-detect -duc -u https://192.168.5.1

                     __     _
   ____  __  _______/ /__  (_)
  / __ \/ / / / ___/ / _ \/ /
 / / / / /_/ / /__/ /  __/ /
/_/ /_/\__,_/\___/_/\___/_/   v3.2.7

                projectdiscovery.io

[WRN] Found 26 template[s] loaded with deprecated paths, update before v3 for continued support.
[INF] Current nuclei version: v3.2.7 (outdated)
[INF] Current nuclei-templates version: v9.8.6 (latest)
[WRN] Scan results upload to cloud is disabled.
[INF] New templates added in latest release: 65
[INF] Templates loaded for current scan: 1
[INF] Executing 1 signed templates from projectdiscovery/nuclei-templates
[INF] Targets loaded for current scan: 1
[INF] No results found. Better luck next time!
> $LastExitCode
0

Mzack9999 avatar May 13 '24 08:05 Mzack9999