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

-matcher-status option to generate result event for errored cases #4299

Closed
ehsandeep opened this issue Oct 27, 2023 · 0 comments · Fixed by #4373
Closed

-matcher-status option to generate result event for errored cases #4299

ehsandeep opened this issue Oct 27, 2023 · 0 comments · Fixed by #4373
Assignees
Labels
Type: Enhancement Most issues will probably ask for additions or changes.
Milestone

Comments

@ehsandeep
Copy link
Member

Please describe your feature request:

When I use nuclei to run my test cases using matcher-status option that generates a result event for failed matchers, it doesn't include results when the host got errored out for multiple reasons, which nuclei failed to report.

nuclei have a separate option to track errored hosts with error information using -elog option, and unfortunately, it can not be mapped directly with the result itself.

Describe the use case of this feature:

I'm running nuclei in my CI pipeline, nuclei reported multiple results upon 1st run; as a result of one vulnerability, I've taken down the vulnerable host, upon next nuclei run, nuclei failed to report the same vulnerabilities as it silently failed to run as host is not accessible.

Instead, nuclei can still generate failed match events and populate error information as it does when using with -elog option.

Here is example run with this support:

1. Test Template
id: failed_test

info:
  name: Test HTTP Template
  author: pdteam
  severity: info

http:
  - method: GET
    path:
      - "{{BaseURL}}"

    matchers:
      - type: word
        words:
          - "This is test matcher text"
2. Test Run
echo https://googleaaaaaaaaa.com | nuclei -t test.yaml -matcher-status -jsonl

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

		projectdiscovery.io

[INF] Current nuclei version: v3.0.2 (latest)
[INF] Current nuclei-templates version: v9.6.7 (latest)
[INF] New templates added in latest release: 1
[INF] Templates loaded for current scan: 1
[WRN] Executing 1 unsigned templates. Use with caution.
[INF] Targets loaded for current scan: 1
3. Test Result
{
  "template-id": "failed_test",
  "template-path": "/Users/geekboy/Github/nuclei-templates/test.yaml",
  "info": {
    "name": "Test HTTP Template",
    "author": [
      "pdteam"
    ],
    "tags": null,
    "severity": "info"
  },
  "type": "http",
  "host": "https://gggggggggggle.com",
  "request": "GET / HTTP/1.1\r\nHost: gggggggggggle.com\r\nUser-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2866.71 Safari/537.36\r\nConnection: close\r\nAccept: */*\r\nAccept-Language: en\r\nAccept-Encoding: gzip\r\n\r\n",
-  "response": "XXXX",
  "timestamp": "2023-10-27T18:08:24.24882+05:30",
+  "error": "context deadline exceeded",
  "matcher-status": false
}

Note:

  • This support needs to be reflected for SDK uses as well.
@ehsandeep ehsandeep added the Type: Enhancement Most issues will probably ask for additions or changes. label Oct 27, 2023
@ehsandeep ehsandeep changed the title matcher status option to generate result event for errored cases -matcher-status option to generate result event for errored cases Oct 27, 2023
@dogancanbakir dogancanbakir linked a pull request Nov 15, 2023 that will close this issue
4 tasks
@ehsandeep ehsandeep added this to the nuclei v3.1.0 milestone Nov 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement Most issues will probably ask for additions or changes.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants