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

Improve error logging for unresolved variables #4447

Draft
wants to merge 4 commits into
base: dev
Choose a base branch
from

Conversation

RamanaReddy0M
Copy link
Contributor

@RamanaReddy0M RamanaReddy0M commented Nov 30, 2023

Proposed changes

test

✗ go run . -t ~/nuclei-templates/http/token-spray -v

                     __     _
   ____  __  _______/ /__  (_)
  / __ \/ / / / ___/ / _ \/ /
 / / / / /_/ / /__/ /  __/ /
/_/ /_/\__,_/\___/_/\___/_/   v3.1.0-dev

                projectdiscovery.io

[VER] Started metrics server at localhost:9092
[INF] Current nuclei version: v3.1.0-dev (development)
[INF] Current nuclei-templates version: v9.6.9 (latest)
[WRN] Scan results upload to cloud is disabled.
[INF] New templates added in latest release: 45
[INF] Templates loaded for current scan: 242
[INF] Executing 242 signed templates from projectdiscovery/nuclei-templates
[WRN] Failed 242 requests due to unresolved variables. Use -elabel=UNV to enable unresolved variables logs.
  • to toggle
go run . -v -elabel=UNV

Checklist

  • Pull request is created against the dev branch
  • All checks passed (lint, unit/integration/regression tests etc.) with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

@RamanaReddy0M RamanaReddy0M linked an issue Nov 30, 2023 that may be closed by this pull request
@RamanaReddy0M RamanaReddy0M self-assigned this Nov 30, 2023
Copy link
Member

@tarunKoyalwar tarunKoyalwar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

implementation lgtm !

$ ./nuclei  -t ~/nuclei-templates/http/token-spray -v  

                     __     _
   ____  __  _______/ /__  (_)
  / __ \/ / / / ___/ / _ \/ /
 / / / / /_/ / /__/ /  __/ /
/_/ /_/\__,_/\___/_/\___/_/   v3.1.0-dev

		projectdiscovery.io

[VER] Started metrics server at localhost:9092
[INF] Current nuclei version: v3.1.0-dev (outdated)
[INF] Current nuclei-templates version: v9.7.1 (latest)
[WRN] Scan results upload to cloud is disabled.
[INF] New templates added in latest release: 0
[INF] Templates loaded for current scan: 242
[INF] Executing 242 signed templates from projectdiscovery/nuclei-templates
[WRN] Failed 242 requests due to unresolved variables. Use -elabel=UNV to enable unresolved variables logs.
[INF] No results found. Better luck next time!

Notes:

I think we can change statement since this is expected behaviour and not a error
since unresolved behaviour normally happens when template did not match or required variable like password,username was not provided from user

[WRN] Failed 242 requests due to unresolved variables. Use -elabel=UNV to enable unresolved variables logs.

something like

[VER] Skipped 242 Requests due to missing variable in input or request precondition failed due to no match in template

or even better we can seperate these two statements/cases
What do you think ?
cc: @ehsandeep @RamanaReddy0M

@RamanaReddy0M RamanaReddy0M marked this pull request as draft April 16, 2024 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve Error logging of unresolved variables
2 participants