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

Extending deny list to support filenames and folders #1260

Merged
merged 8 commits into from
Dec 16, 2021

Conversation

Mzack9999
Copy link
Member

@Mzack9999 Mzack9999 commented Nov 16, 2021

Proposed changes

This PR extends the deny list functionality in file requests in order to support file and directory exclusions

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)

@Mzack9999 Mzack9999 added the Type: Enhancement Most issues will probably ask for additions or changes. label Nov 16, 2021
@Mzack9999 Mzack9999 self-assigned this Nov 16, 2021
@Mzack9999 Mzack9999 linked an issue Nov 16, 2021 that may be closed by this pull request
Copy link
Member

@Ice3man543 Ice3man543 left a comment

Choose a reason for hiding this comment

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

lgtm!

Copy link
Member

@ehsandeep ehsandeep left a comment

Choose a reason for hiding this comment

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

@Mzack9999 it took some time but here are all the details we required related to file/folder exclusion for the file templates, currently, the 2nd and 5th rules are supported, and others need to be supported.

    denylist:
      - /Users/xx/nuclei-templates/cves/ # excludes all the directory / subdirectory under "/Users/xx/nuclei-templates/cves/*"
      - /Users/xx/nuclei-templates/vulnerabilities/jira/jira-unauthenticated-projects.yaml  # excludes specfic file /Users/xx/nuclei-templates/vulnerabilities/jira/jira-unauthenticated-projects.yaml
      - dns/ # excludes $INPUT_PATH/dns/*
      - exposed-panels/cortex-xsoar-login.yaml # excludes $INPUT_PATH/exposed-panels/cortex-xsoar-login.yaml
      - .txt  # excludes all the files with TXT extesioin

      # $INPUT_PATH is what we receive as an input directory/path to perform file scan using "-u" or "list" flag.
      # nuclei -t file/ -u http_data/, here "http_data" is $INPUT_PATH

Copy link
Member

@ehsandeep ehsandeep left a comment

Choose a reason for hiding this comment

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

Test fails are expected due to the use of old version of nuclei.

@ehsandeep ehsandeep added the Status: Completed Nothing further to be done with this issue. Awaiting to be closed. label Dec 16, 2021
@ehsandeep ehsandeep merged commit 07e7d07 into dev Dec 16, 2021
@ehsandeep ehsandeep deleted the issue-1093-file-template-exclude-paths branch December 16, 2021 10:51
@forgedhallpass
Copy link
Contributor

We might want to move the hard-coded

var defaultDenylist = []string{".3g2", ".3gp", ".7z", ".apk", ".arj", ".avi", ".axd", ".bmp", ".css", ".csv", ".deb", ".dll", ".doc", ".drv", ".eot", ".exe", ".flv", ".gif", ".gifv", ".gz", ".h264", ".ico", ".iso", ".jar", ".jpeg", ".jpg", ".lock", ".m4a", ".m4v", ".map", ".mkv", ".mov", ".mp3", ".mp4", ".mpeg", ".mpg", ".msi", ".ogg", ".ogm", ".ogv", ".otf", ".pdf", ".pkg", ".png", ".ppt", ".psd", ".rar", ".rm", ".rpm", ".svg", ".swf", ".sys", ".tar.gz", ".tar", ".tif", ".tiff", ".ttf", ".vob", ".wav", ".webm", ".wmv", ".woff", ".woff2", ".xcf", ".xls", ".xlsx", ".zip"}

to the default configuration as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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 this pull request may close these issues.

Add option to exclude file/directory in file template
4 participants