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

Markdown Export Sorting #3961

Merged
merged 3 commits into from
Jul 21, 2023

Conversation

kchason
Copy link
Contributor

@kchason kchason commented Jul 19, 2023

Proposed changes

Addresses #3596 by adding support for a MARKDOWN_EXPORT_SORT_MODE environment variable when the -me/-markdown-export is present. This allows the following options:

  • template sorts all markdown report files into a subdirectory based on the template ID
  • severity sorts all markdown report files into a subdirectory based on the severity of the template
  • host sorts all markdown report files into a subdirectory based on the hostname of the finding

Any other value keeps all markdown report files in the same root directory specified by the -me/-markdown-export flag.

In all cases, the index.md is at the root of the markdown export directory, and relative links are updated to include subdirectory paths if appropriate.

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)

@kchason
Copy link
Contributor Author

kchason commented Jul 20, 2023

Documentation has been updated in projectdiscovery/nuclei-docs#162

@tarunKoyalwar tarunKoyalwar linked an issue Jul 20, 2023 that may be closed by this pull request
@tarunKoyalwar tarunKoyalwar self-requested a review July 20, 2023 12:17
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.

lgtm !

$ MARKDOWN_EXPORT_SORT_MODE="severity" ./nuclei -l targets.txt -c 2000 -me data -stats 

                     __     _
   ____  __  _______/ /__  (_)
  / __ \/ / / / ___/ / _ \/ /
 / / / / /_/ / /__/ /  __/ /
/_/ /_/\__,_/\___/_/\___/_/   v2.9.9

		projectdiscovery.io

[INF] Current nuclei version: v2.9.9 (latest)
[INF] Current nuclei-templates version: v9.5.8 (latest)
[INF] New templates added in latest release: 113
[INF] Templates loaded for current scan: 6424
[INF] Targets loaded for current scan: 2
[INF] Templates clustered: 1179 (Reduced 2240 Requests)
[mismatched-ssl-certificate] [ssl] [low] scanme.sh:443 [CN: scanme]
[ssl-issuer] [ssl] [info] scanme.sh:443 [pd]
[self-signed-ssl] [ssl] [low] scanme.sh:443
[weak-cipher-suites:tls-1.0] [ssl] [medium] scanme.sh:443 [[tls10 TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA]]
[INF] Using Interactsh Server: oast.me
[weak-cipher-suites:tls-1.1] [ssl] [medium] scanme.sh:443 [[tls11 TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA]]
[ssl-issuer] [ssl] [info] hackerone.com:443 [DigiCert Inc]
[ssl-dns-names] [ssl] [info] hackerone.com:443 [hackerone.com,www.hackerone.com,api.hackerone.com]
[0:00:05] | Templates: 6424 | Hosts: 2 | RPS: 178 | Matched: 7 | Errors: 760 | Requests: 893/19486 (4%)
[xss-deprecated-header] [http] [info] https://hackerone.com [1; mode=block]

Screenshot 2023-07-20 at 6 56 29 PM

@tarunKoyalwar tarunKoyalwar added the Type: Enhancement Most issues will probably ask for additions or changes. label Jul 20, 2023
@ehsandeep
Copy link
Member

thank you @kchason for adding this.

@ehsandeep ehsandeep merged commit 759ee3d into projectdiscovery:dev Jul 21, 2023
8 of 11 checks passed
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 this pull request may close these issues.

Markdown results in separate directories.
3 participants