Automatic scan does not include additional custom templates from default installed location
Nuclei version:
Nuclei Engine 2.6.9
Current Behavior:
The template is located under ~/nuclei-templates/ within a custom directory ~/nuclei-templates/specific/software/amazon.
It is interesting, because I have to give the -t template location in order to run the custom directories located in the default location.
This one works as expected:
nuclei -rl 7 -nts -u https://example.com -as -stats -t ~/nuclei-templates
This one not:
nuclei -rl 7 -nts -u https://example.com -as -stats
If used with manual set tags:
nuclei -rl 7 -nts -u https://example.com -tags amazon,cloudfront,web,services,s3
[...]
[INF] Templates loaded for scan: 2
[amazon-files] [http] [medium] https://example.com/awstats.conf
Expected Behavior:
Shouldn't this behave and work the same? Is it different to the -tags flag?
Tests to ensure the following conditions with automatic scan:
- [x] default templates from the default installed location are used.
- [x] additional templates from the default installed location are used.
- [x] additional templates from the custom location are used if specified.
@m-1tZ are you running a custom template? as I don't see any template with id as amazon-files in the template project, if so could you also include additional details to reproduce this behavior.
Indeed. But does it make a difference? I thought that -as is just using -tags with the identified values under the hood?
Template:
id: amazon-files
info:
name: AWS files Exposure
author: m1tZ
severity: medium
tags: aws,amazon
requests:
- method: GET
path:
- '{{BaseURL}}/awstats.conf'
- '{{BaseURL}}/aws.sh'
- '{{BaseURL}}/awstats.pl'
- '{{BaseURL}}/logs/awstats.pl'
- '{{BaseURL}}/webstats/awstats.pl'
- '{{BaseURL}}/awstats/'
matchers:
- type: status
status:
- 200
@m-1tZ yeah, it does make a difference as nuclei run the default templates based on available tags information as it doesn’t know where your custom templates are located.
so the question is, did you include your custom templates in the default installed location? otherwise, you can also specify the custom directory to include templates to run with -as, something we fixed n supported in the last release https://github.com/projectdiscovery/nuclei/issues/1791
The template is located under ~/nuclei-templates/ within a custom directory ~/nuclei-templates/specific/software/amazon.
It is interesting, because I have to give the -t template location in order to run the custom directories located in the default location.
This one works as expected:
nuclei -rl 7 -nts -u https://example.com -as -stats -t ~/nuclei-templates
This one not:
nuclei -rl 7 -nts -u https://example.com -as -stats
The template is located under ~/nuclei-templates/ within a custom directory ~/nuclei-templates/specific/software/amazon
Yes, this was the information I was looking for. Indeed this looks like a bug that needs to be fixed; thanks for reporting.
Thanks for responding this quickly, have a nice day!
@m-1tZ this is now fixed in the dev version of nuclei with - https://github.com/projectdiscovery/nuclei/pull/1968