Cyber Monday: 2XCYBER doubles your top-up, up to $2,000.Double my top-up

nc://nuclei

v0.1.0Pinned
Backnodecode-ai
ThomSharksecurity cells: harden scope, Nuclei containment, ffuf authority and scrub (#183)245fa9c· 2 Dec2 commits
test1 filecell.lisp5.4 KBcli.lisp10.4 KBscope.lisp11.1 KBtools.lisp14.9 KB

nodecode-nuclei

Template-based vulnerability scans with Nuclei, only against targets you list as in scope: known CVEs, misconfigurations, exposed panels and files, read down to one line per finding. Written for Nodecode from Nuclei's documented command line and JSON lines.

Get it

Tell the agent "add the nuclei cell", or run nodecode add nc://nuclei.

Set it up

The cell runs the Nuclei CLI and the templates you install; nothing here vendors either. Install it once (releases), or:

go install github.com/projectdiscovery/nuclei/v3/cmd/nuclei@latest

then fetch the templates with /nuclei update (or nuclei -ut).

Then set the scope: the targets you are authorized to test. An empty scope refuses every scan. See config.example.jsonc:

"nuclei": { "scope": ["app.example.com", "*.staging.example.com", "192.0.2.0/24"] }

A scope entry is a host, *.domain (any subdomain, not the apex), an IPv4 or IPv6 address, or an address block (192.0.2.0/24, 2001:db8::/32). A loopback, private, link-local, multicast or reserved address (IPv4-mapped and NAT64 forms included), or localhost, is reached only through an entry that names it or its block; a wildcard never reaches one, and a zoned IPv6 address (fe80::1%eth0) is never reached. A target with userinfo (user@), a backslash, a control character or a space in its host is refused, so the host checked is the host reached.

Key Default What it does
command ["nuclei"] The argv prefix that runs Nuclei: on PATH, or its absolute path.
scope [] What scans may reach. Only the operator sets it.
timeout_seconds 1800 One run's ceiling; the whole process tree is killed past it.
max_output_chars 20000 How much one tool answer carries.
max_findings 200 How many finding lines one answer lists; the count covers every one.
rate_limit 50 Requests per second, a ceiling a call may only lower.
concurrency 10 Templates in parallel, a ceiling a call may only lower.
exclude_tags ["dos", "intrusive"] Template tags every scan leaves out.
interactsh false Let out-of-band templates use Nuclei's public interaction servers.

Use it

Tool Runs For
nuclei_scan nuclei -u ... -jsonl Templates against targets in scope. Narrow with templates, tags, exclude_tags, template_ids, exclude_ids, severity, exclude_severity, protocol_types, automatic_scan; tune with follow_redirects (same host only), headers, rate_limit, concurrency, timeout, retries.
nuclei_templates nuclei -tl The installed templates a filter selects, without scanning.
3 findings on 2 hosts: CRITICAL 1, HIGH 1, INFO 1
  CRITICAL CVE-2021-41773 (Apache 2.4.49 - Path Traversal) at https://app.example.com/cgi-bin/.%2e/etc/passwd
  HIGH aws-access-key (AWS Access Key ID) at https://api.staging.example.com/config.js 2 extracted values not shown (the template looks for credentials; open the URL to see)
  INFO tech-detect (Wappalyzer Technology Detection) at https://app.example.com [nginx] extracted: nginx/1.25.3

/nuclei answers Nuclei's version; /nuclei update fetches the newest templates.

How a run is contained

Every scan carries -silent -nc -duc -or -ot -ept=code,file,headless,javascript (no banner, no colour, no update check, no request/response bodies or template source in the output, and no template that runs code, reads files or drives a browser on this machine, whatever the call asks), -ni unless interactsh is on, and -lna unless the scan's targets are local or private addresses the scope names. One scan never mixes local or private targets with public ones, so -lna is never dropped for a public host.

  • A target is one host. It is an http:// or https:// URL, or a bare host or host:port. A comma (Nuclei splits -u on it), a schemeless host/NN (Nuclei expands it to a whole network) and an ASnnn number (expanded to the AS's networks) are refused before the scope is checked. Redirects are followed only on the same host (-fhr).

  • Scope. Every target's host must be in the section's scope; the model cannot change it.

  • Templates are local. A template URL is refused, and so is a path that climbs out of the templates tree with ... protocol_types offers http, dns, ssl, tcp, websocket and whois: never code, file, headless or javascript.

  • Ceilings. A call may lower rate_limit and concurrency, never raise them; exclude_tags always apply.

  • Secrets stay out of the answer. Every header value but Host, Accept, Content-Type, User-Agent, Origin and Referer is masked in the echoed command and scrubbed from the output, a token too short to scrub included. A finding's curl-command, request and response are never read. A template tagged as a credential hunt (token, secret, exposure, key, password, ...) has its extracted values counted, not shown.

  • No flag injection. Every value rides its flag as one argument, and a value that opens with a dash is refused.

Test

.github/test-cell.sh tools/nodecode-nuclei

Nineteen tests, offline: every Nuclei run goes through one stubbed seam, so the scope, the argv and the findings read from -jsonl are asserted with no CLI, no templates and no network.

License

MIT. See LICENSE. Nuclei is MIT and is not included; its templates are their authors'.

Add nc://nuclei

  1. 1

    Install Nodecode

    Once per machine.

    $ curl -fsSL https://nodecode.ai/install.sh | sh
  2. 2

    Add the cell

    Pinned at 245fa9c.

    $ nodecode add nc://nuclei

    Or tell the agent add the nuclei cell.