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

Option to exclude results based on matcher names #2082

Closed
ehsandeep opened this issue May 29, 2022 · 2 comments · Fixed by #2218
Closed

Option to exclude results based on matcher names #2082

ehsandeep opened this issue May 29, 2022 · 2 comments · Fixed by #2218
Assignees
Labels
Priority: Low This issue can probably be picked up by anyone looking to contribute to the project, as an entry fix Status: Completed Nothing further to be done with this issue. Awaiting to be closed. Type: Enhancement Most issues will probably ask for additions or changes.
Milestone

Comments

@ehsandeep
Copy link
Member

Describe the use case of this feature:

For the cases where excluding the template is not an option as the template may contain multiple results, it's not possible to exclude any desired matches in the results, to support this scenario, a new CLI flag needs to be introduced to filter results based on a given matcher or list of matcher names.

Please describe your feature request:

CLI flag:

   -em, -exclude-matchers string[]  template matchers to exclude in result (comma-separated, file)

Exclude matchers using CLI Flag:

-em http-missing-security-headers:cross-origin-resource-policy,tech-detect:google-font-api

Exclude matchers using file input:

$ cat exclude.matchers.txt

http-missing-security-headers:cross-origin-resource-policy
tech-detect:google-font-api
-em exclude.matchers.txt

Exclude matchers using the config file:

exclude-matchers:
  - "http-missing-security-headers:cross-origin-resource-policy"
  - "tech-detect:google-font-api"

Discussed in projectdiscovery/nuclei-templates#3808

Originally posted by carlin-q-scott March 2, 2022
I'd like to be able to use part of a template by excluding certain matchers.

For instance, I'm using misconfiguration/http-missing-security-headers.yaml, but I don't want to get results for the less important headers. The template has them all set at "info" severity, but they're not equally important. If we could set severity at the matcher level, then I could update the template to raise the severity for the more important security headers.

Alternatively, if I could exclude matchers by name, that would solve my issue and would save people from having to argue about matcher severity. I'd imagine my config.yml would look something like this:

exclude-matchers:
  - "http-missing-security-headers:cross-origin-resource-policy"
  - "tech-detect:google-font-api"
@ehsandeep ehsandeep added Type: Enhancement Most issues will probably ask for additions or changes. Priority: Low This issue can probably be picked up by anyone looking to contribute to the project, as an entry fix labels May 29, 2022
@Ice3man543 Ice3man543 self-assigned this Jun 23, 2022
@Ice3man543 Ice3man543 linked a pull request Jun 23, 2022 that will close this issue
4 tasks
@ehsandeep ehsandeep added the Status: Completed Nothing further to be done with this issue. Awaiting to be closed. label Jun 24, 2022
@ehsandeep
Copy link
Member Author

@carlin-q-scott this is now supported in dev version with #2218

@ehsandeep ehsandeep added this to the v2.7.4 milestone Jul 18, 2022
@Bisstocuz
Copy link
Contributor

Hi, maybe its member needs a yaml field name? Check this: #2218 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: Low This issue can probably be picked up by anyone looking to contribute to the project, as an entry fix Status: Completed Nothing further to be done with this issue. Awaiting to be closed. Type: Enhancement Most issues will probably ask for additions or changes.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants