Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nuclei return exit code 1 when no results are found #5086

Open
yaabdala opened this issue Apr 23, 2024 · 1 comment
Open

Nuclei return exit code 1 when no results are found #5086

yaabdala opened this issue Apr 23, 2024 · 1 comment
Labels
Type: Question A query or seeking clarification on parts of the spec. Probably doesn't need the attention of all.

Comments

@yaabdala
Copy link

yaabdala commented Apr 23, 2024

// todo: error propagation without canonical straight error check is required by cloud?
// use safe dereferencing to avoid potential panics in case of previous unchecked errors
if v := ptrutil.Safe(results); !v.Load() {
gologger.Info().Msgf("No results found. Better luck next time!")
}
// check if a passive scan was requested but no target was provided
if r.options.OfflineHTTP && len(r.options.Targets) == 0 && r.options.TargetsFilePath == "" {
return errors.Wrap(err, "missing required input (http response) to run passive templates")
}
return err

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

@Mzack9999
Copy link
Member

@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 Mzack9999 added the Type: Question A query or seeking clarification on parts of the spec. Probably doesn't need the attention of all. label May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Question A query or seeking clarification on parts of the spec. Probably doesn't need the attention of all.
Projects
None yet
Development

No branches or pull requests

2 participants