Choosing Templates
Left to itself, a scan means the whole
collection: fourteen thousand templates
against every target. That is occasionally
what you want and usually not — it is slow,
it is loud, and most of what it returns will
be info findings you then have to read.
Nuclei's selection flags exist so that a scan
is a question you chose, not a census. All of
them filter on the name-card fields from
chapter 4, and all of them report what they
did in the same place: the Templates loaded
for current scan line, which is the receipt
you should read before believing anything
about the run.
The four selectors
The lab's three templates make the arithmetic easy to watch. Selecting by tag:
$ nuclei -duc -nc -ni -t examples/ -tags exposure -u http://127.0.0.1:18084
[INF] Templates loaded for current scan: 1
[lab-status-page] [http] [low] http://127.0.0.1:18084/status
Only lab-status-page carries the exposure
tag, so only it loaded, and only it could
fire. Selecting by severity:
$ nuclei -duc -nc -ni -t examples/ -severity info -u http://127.0.0.1:18084
[INF] Templates loaded for current scan: 2
—the two info templates loaded, the low
one stayed home, and the run found two
matches. Selecting by id loads exactly
the named templates (-id lab-status-page:
one loaded, one match) — and, as chapter 4
showed, an id with no -t is resolved
against the whole installed collection, which
is the normal way to run a single known
check. The fourth selector is subtraction:
-exclude-tags and -exclude-id remove from
whatever the other selectors gathered.
Before any of them, -tl lists what a set of
flags would load, paths and all, without
scanning:
$ nuclei -duc -nc -ni -t examples/ -tl
…/lab-appliance-detect.yaml
…/lab-server-banner.yaml
…/lab-status-page.yaml
Dry-list first, scan second: it is the cheapest habit in this guide, and the one that catches "I meant three templates and loaded three thousand."
What the defaults leave out
Even an unfiltered scan is not quite the
whole collection. Installing the templates
also installs an ignore file
(~/.config/nuclei/.nuclei-ignore, maintained
by nuclei itself) that excludes whole tags
from default scans — in the installed
version: dos, local, fuzz, bruteforce,
and txt-service. The reasoning is the
politeness chapter arriving early: those
categories are heavy, noisy, or aimed at the
machine nuclei runs on rather than at a
target, so they run only when you ask for
them by name. The same file also names
individual template files excluded for a
plainer reason, given in its own comment:
their matchers are weak and may generate
false positives — the project's own triage,
applied before yours. If a template you expect is
missing from a run, this file is one of the
places to check — chapter 12 lists the
others.
Noise, and what a match is worth
The collection's own statistics put the shape
of it plainly: thousands of templates carry
the vuln and cve tags, about fifteen
hundred carry exposure, about twelve
hundred carry tech. Those families differ
in what a match claims, and reading results
well means keeping them apart:
- Detection and tech templates say "this looks like product X." Usually true, occasionally fooled by anything that imitates X's fingerprints — and by itself, not an accusation.
- Exposure and misconfiguration templates say "this page/header/panel is reachable." The missing-headers template is the model: precise, checkable, and a judgement call about whether it matters here.
- CVE templates say "this looks like a version with a known flaw." Many judge by version evidence — a banner, a build string, a file's contents — rather than by exercising the flaw, because detection is the tool's job. Version evidence can lie in both directions: a distribution that backports a fix without changing the version string produces a false alarm; a suppressed banner produces false comfort.
None of that makes the output useless. It
makes it triage: a list of leads, sorted by
someone else's severity opinion, that a human
confirms before anyone acts. The working
habits that follow from that are simple.
Start narrow — a product you run, a tag you
care about, a handful of ids — and read every
finding while the pile is small enough to
read. Widen deliberately. Treat a finding you
cannot reproduce by hand (chapter 9 shows
every finding carries the means to reproduce
it) as a finding you do not yet understand.
And remember that severity is a property of
the template, not of your network: the info
status page on a machine that describes your
whole fleet may outrank a high about
software you don't run.
Check: a well-chosen scan's receipt says so — the loaded count matches the question you meant to ask, and every finding that comes back is one you can explain, reproduce, or consciously set aside.