Replies: 1 comment 3 replies
-
|
Config loading1 in Nuclei is intentionally based on std
So Nuclei is already compliant with platform conventions. For distro setups, you can run it once with $ nuclei -update-template-dir /tmp/nuclei-templates
__ _
____ __ _______/ /__ (_)
/ __ \/ / / / ___/ / _ \/ /
/ / / / /_/ / /__/ / __/ /
/_/ /_/\__,_/\___/_/\___/_/ v3.6.1
projectdiscovery.io
[INF] nuclei-templates are not installed, installing...
[INF] Successfully installed nuclei-templates at /tmp/nuclei-templates
[INF] Current nuclei version: v3.6.1 (latest)
[INF] Current nuclei-templates version: v10.3.6 (latest)
[INF] New templates added in latest release: 176
[INF] Templates loaded for current scan: 9080
[INF] Executing 9078 signed templates from projectdiscovery/nuclei-templates
[WRN] Loading 2 unsigned templates for scan. Use with caution.
[INF] Scan completed in 89.400172ms. No results found.
$ jq -r . ~/.config/nuclei/.templates-config.json
{
"nuclei-templates-directory": "/tmp/nuclei-templates",
"custom-s3-templates-directory": "/tmp/nuclei-templates/s3",
"custom-github-templates-directory": "/tmp/nuclei-templates/github",
"custom-gitlab-templates-directory": "/tmp/nuclei-templates/gitlab",
"custom-azure-templates-directory": "/tmp/nuclei-templates/azure",
"nuclei-templates-version": "v10.3.6",
"nuclei-ignore-hash": "1a666944243307efff85d5bbd943b190",
"nuclei-latest-version": "v3.6.1",
"nuclei-templates-latest-version": "v10.3.6",
"nuclei-latest-ignore-hash": "1a666944243307efff85d5bbd943b190"
}And that path gets saved in the config, and Nuclei will keep using it from then on. If there are edge cases or distro-specific requirements where that approach falls short, feedback would be very welcome so we can evaluate potential improvements. Footnotes
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
The idea would be to follows XDG Base Directory Specification standard.
Instead of only looking at
~/.config/nuclei/config.yaml, nuclei would resolve$XDG_CONFIG_HOMEand try global config too. So with default value, for example, it could look for (in order):$XDG_CONFIG_HOME/nuclei/config.yaml(in most cases would resolve to ~/.config/nuclei/config.yaml) to look for user-defined config~/.config/nuclei/config.yamlfallbackSame for templates, instead of dumping them at
~/nuclei-templates, it would look at:$XDG_DATA_HOME/nuclei/templates/(in most cases would resolve to$HOME/.local/share/nuclei/templates/)$XDG_DATA_DIRS/nuclei/templates/1st value (in most cases would resolve to/usr/local/share/nuclei/templates/)$XDG_DATA_DIRS/nuclei/templates/2nd value (in most cases would resolve to/usr/share/nuclei/templates/)~/nuclei-templatesfallbackThat would help to comply with standard paths, ensure to respect users custom structures, ease distribution packaging, unmess the root of user home directory.
Related issues on BlackArch Linux for packaging nuclei
Beta Was this translation helpful? Give feedback.
All reactions