Skip to main content

Nuclei

License Apache-2.0GitHub release (latest SemVer)OWASP Incubator ProjectArtifact HUBGitHub Repo starsTwitter Follower

What is Nuclei#

Nuclei is used to send requests across targets based on a template leading to zero false positives and providing fast scanning on large number of hosts. Nuclei offers scanning for a variety of protocols including TCP, DNS, HTTP, File, etc. With powerful and flexible templating, all kinds of security checks can be modelled with Nuclei.

To learn more about the Nuclei scanner itself visit Nuclei GitHub or Nuclei Website.

Deployment#

The nuclei chart can be deployed via helm:

# Install HelmChart (use -n to configure another namespace)helm upgrade --install nuclei secureCodeBox/nuclei

Scanner Configuration#

The following security scan configuration example are based on the Nuclei Documentation, please take a look at the original documentation for more configuration examples.

nuclei -hNuclei is a fast, template based vulnerability scanner focusingon extensive configurability, massive extensibility and ease of use.
Usage:  nuclei [flags]
Flags:TARGET:   -u, -target string[]  target URLs/hosts to scan   -l, -list string      path to file containing a list of target URLs/hosts to scan (one per line)
TEMPLATES:   -tl                      list all available templates   -t, -templates string[]  template or template directory paths to include in the scan   -w, -workflows string[]  list of workflows to run   -nt, -new-templates      run newly added templates only   -validate                validate the passed templates to nuclei
FILTERING:   -tags string[]                         execute a subset of templates that contain the provided tags   -include-tags string[]                 tags from the default deny list that permit executing more intrusive templates   -etags, -exclude-tags string[]         exclude templates with the provided tags   -include-templates string[]            templates to be executed even if they are excluded either by default or configuration   -exclude-templates, -exclude string[]  template or template directory paths to exclude   -severity, -impact string[]            execute templates that match the provided severities only   -author string[]                       execute templates that are (co-)created by the specified authors
OUTPUT:   -o, -output string            output file to write found issues/vulnerabilities   -silent                       display findings only   -v, -verbose                  show verbose output   -vv                           display extra verbose information   -nc, -no-color                disable output content coloring (ANSI escape codes)   -json                         write output in JSONL(ines) format   -irr, -include-rr             include request/response pairs in the JSONL output (for findings only)   -nm, -no-meta                 don't display match metadata   -rdb, -report-db string       local nuclei reporting database (always use this to persist report data)   -me, -markdown-export string  directory to export results in markdown format   -se, -sarif-export string     file to export results in SARIF format
CONFIGURATIONS:   -config string              path to the nuclei configuration file   -rc, -report-config string  nuclei reporting module configuration file   -H, -header string[]        custom headers in header:value format   -V, -var value              custom vars in var=value format   -r, -resolvers string       file containing resolver list for nuclei   -system-resolvers           use system DNS resolving as error fallback   -passive                    enable passive HTTP response processing mode   -env-vars                   Enable environment variables support
INTERACTSH:   -no-interactsh                     do not use interactsh server for blind interaction polling   -interactsh-url string             self-hosted Interactsh Server URL (default "https://interact.sh")   -interactions-cache-size int       number of requests to keep in the interactions cache (default 5000)   -interactions-eviction int         number of seconds to wait before evicting requests from cache (default 60)   -interactions-poll-duration int    number of seconds to wait before each interaction poll request (default 5)   -interactions-cooldown-period int  extra time for interaction polling before exiting (default 5)
RATE-LIMIT:   -rl, -rate-limit int          maximum number of requests to send per second (default 150)   -rlm, -rate-limit-minute int  maximum number of requests to send per minute   -bs, -bulk-size int           maximum number of hosts to be analyzed in parallel per template (default 25)   -c, -concurrency int          maximum number of templates to be executed in parallel (default 10)
OPTIMIZATIONS:   -timeout int               time to wait in seconds before timeout (default 5)   -retries int               number of times to retry a failed request (default 1)   -project                   use a project folder to avoid sending same request multiple times   -project-path string       set a specific project path (default "/var/folders/xq/zxykn5wd0tx796f0xhxf94th0000gp/T/")   -spm, -stop-at-first-path  stop processing HTTP requests after the first match (may break template/workflow logic)
HEADLESS:   -headless          enable templates that require headless browser support   -page-timeout int  seconds to wait for each page in headless mode (default 20)   -show-browser      show the browser on the screen when running templates with headless mode
DEBUG:   -debug                     show all requests and responses   -debug-req                 show all sent requests   -debug-resp                show all received responses   -proxy, -proxy-url string  URL of the HTTP proxy server   -proxy-socks-url string    URL of the SOCKS proxy server   -trace-log string          file to write sent requests trace log   -version                   show nuclei version   -tv, -templates-version    shows the version of the installed nuclei-templates
UPDATE:   -update                        update nuclei to the latest released version   -ut, -update-templates         update the community templates to latest released version   -nut, -no-update-templates     Do not check for nuclei-templates updates   -ud, -update-directory string  overwrite the default nuclei-templates directory (default "/Users/robert/nuclei-templates")
STATISTICS:   -stats                    display statistics about the running scan   -stats-json               write statistics data to an output file in JSONL(ines) format   -si, -stats-interval int  number of seconds to wait between showing a statistics update (default 5)   -metrics                  expose nuclei metrics on a port   -metrics-port int         port to expose nuclei metrics on (default 9092)

Requirements#

Kubernetes: >=v1.11.0-0

Values#

KeyTypeDefaultDescription
cascadingRules.enabledbooltrueEnables or disables the installation of the default cascading rules for this scanner
nucleiTemplateCache.enabledbooltrueEnables or disables the use of an persistent volume to cache the always downloaded nuclei-templates for all scans.
nucleiTemplateCache.schedulestring"0 */1 * * *"
parser.envlist[]Optional environment variables mapped into each parseJob (see: https://kubernetes.io/docs/tasks/inject-data-application/define-environment-variable-container/)
parser.image.repositorystring"docker.io/securecodebox/parser-nuclei"Parser image repository
parser.image.tagstringnilParser image tag
parser.ttlSecondsAfterFinishedstringnilseconds after which the kubernetes job for the parser will be deleted. Requires the Kubernetes TTLAfterFinished controller: https://kubernetes.io/docs/concepts/workloads/controllers/ttlafterfinished/
scanner.activeDeadlineSecondsstringnilThere are situations where you want to fail a scan Job after some amount of time. To do so, set activeDeadlineSeconds to define an active deadline (in seconds) when considering a scan Job as failed. By default 43.200s = 12h are defined (see: https://kubernetes.io/docs/concepts/workloads/controllers/job/#job-termination-and-cleanup)
scanner.backoffLimitint5There are situations where you want to fail a scan Job after some amount of retries due to a logical error in configuration etc. To do so, set backoffLimit to specify the number of retries before considering a scan Job as failed. (see: https://kubernetes.io/docs/concepts/workloads/controllers/job/#pod-backoff-failure-policy)
scanner.envlist[]Optional environment variables mapped into each scanJob (see: https://kubernetes.io/docs/tasks/inject-data-application/define-environment-variable-container/)
scanner.extraContainerslist[]Optional additional Containers started with each scanJob (see: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/)
scanner.extraVolumeMountslist[]Optional VolumeMounts mapped into each scanJob (see: https://kubernetes.io/docs/concepts/storage/volumes/)
scanner.extraVolumeslist[]Optional Volumes mapped into each scanJob (see: https://kubernetes.io/docs/concepts/storage/volumes/)
scanner.image.pullPolicystring"IfNotPresent"Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. More info: https://kubernetes.io/docs/concepts/containers/images#updating-images
scanner.image.repositorystring"docker.io/projectdiscovery/nuclei"Container Image to run the scan
scanner.image.tagstring"latest"defaults to the charts version
scanner.nameAppendstringnilappend a string to the default scantype name.
scanner.resourcesobject{}CPU/memory resource requests/limits (see: https://kubernetes.io/docs/tasks/configure-pod-container/assign-memory-resource/, https://kubernetes.io/docs/tasks/configure-pod-container/assign-cpu-resource/)
scanner.securityContextobject{}Optional securityContext set on scanner container (see: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/)
scanner.ttlSecondsAfterFinishedstringnilseconds after which the kubernetes job for the scanner will be deleted. Requires the Kubernetes TTLAfterFinished controller: https://kubernetes.io/docs/concepts/workloads/controllers/ttlafterfinished/

License#

License

Code of secureCodeBox is licensed under the Apache License 2.0.

Examples#

example.com#

# SPDX-FileCopyrightText: 2021 iteratec GmbH## SPDX-License-Identifier: Apache-2.0
apiVersion: "execution.securecodebox.io/v1"kind: Scanmetadata:  name: "nuclei-example-scan"spec:  scanType: "nuclei"  parameters:    # Target domain name of the finding and start a nuclei scan    - "-u"    - "example.com"

secureCodeBox.io#

# SPDX-FileCopyrightText: 2021 iteratec GmbH## SPDX-License-Identifier: Apache-2.0
apiVersion: "execution.securecodebox.io/v1"kind: Scanmetadata:  name: "nuclei-securecodebox-scan"spec:  scanType: "nuclei"  parameters:    # Target domain name of the finding and start a nuclei scan    - "-u"    - "www.secureCodeBox.io"