The recursive internet scanner for hackers. 🧡
Python asmattack-surface-managementautomationbugbountyclieasmhackingneo4josintosint-frameworkpentestingpythonreconrecursionscannersubdomain-enumerationsubdomain-scannersubdomainsthreat-intelligencethreatintel
Expose nuclei's newer template-selection options (#3479)
Paul Muellerc9f5e0ae9668
diff --git a/bbot/modules/nuclei.py b/bbot/modules/nuclei.pyindex a6d223770..2b1f570d5 100644--- a/bbot/modules/nuclei.py+++ b/bbot/modules/nuclei.py@@ -3,8 +3,11 @@ import jsonimport osimport shutilimport yaml+from pathlib import Pathfrom typing import Literal-from itertools import islice+from collections import Counter++from pydantic import field_validatorfrom bbot.modules.base import BaseModulefrom bbot.core.config.models import BaseModuleConfig, Field@@ -38,6 +41,26 @@ class nuclei(BaseModule):),)etags: str = Field("", description="tags to exclude from the scan")+ exclude_severity: str = Field("", description="Filter out templates with the given severities")+ include_tags: str = Field(+ "", description="tags to run even though nuclei excludes them by default (e.g. dos, fuzz, bruteforce)"+ )+ template_ids: str = Field("", description="Only run templates with the given IDs (wildcards allowed)")+ exclude_ids: str = Field("", description="Exclude templates with the given IDs")+ protocol_types: str = Field(+ "",+ description="Only run templates of the given protocol types (http, dns, ssl, tcp, javascript, etc.)",+ )+ profile: str = Field(+ "", description="nuclei template profile to run (built-in profile id, or path to a profile file)"+ )+ template_condition: str = Field(+ "", description='expression to filter templates by, e.g. "epss_score>=0.1 && max_request<=3"'+ )+ new_templates: bool = Field(False, description="Only run templates added in the latest templates release")+ new_templates_versions: str = Field(+ "", description="Only run templates added in the given templates releases, e.g. 'v10.4.8,v10.4.9'"+ )budget: int = Field(1, description="Used in budget mode to set the number of allowed requests per host")silent: bool = Field(False, description="Don't display nuclei's banner or status messages")directory_only: bool = Field(True, description="Filter out 'file' URL event (default True)")@@ -45,6 +68,36 @@ class nuclei(BaseModule):batch_size: int = Field(200, description="Number of targets to send to Nuclei per batch (default 200)")module_timeout: int = Field(21600, description="Max time in seconds to spend handling each batch of events")+ @field_validator("severity", "exclude_severity", "protocol_types", mode="before")+ @classmethod+ def _validate_nuclei_enums(cls, value, info):+ # nuclei rejects a bad value with exit code 2, but only after the scan has started and+ # the templates have updated. Catching it here fails at preset-validation time instead.+ # These lists are literals because Config bodies are exec'd without module globals;+ # TestNucleiEnumDrift pins them against what the nuclei binary advertises.+ allowed = {+ "severity": ("info", "low", "medium", "high", "critical", "unknown"),+ "exclude_severity": ("info", "low", "medium", "high", "critical", "unknown"),+ "protocol_types": (+ "dns",+ "file",+ "http",+ "headless",+ "tcp",+ "workflow",+ "ssl",+ "websocket",+ "whois",+ "code",+ "javascript",+ ),+ }[info.field_name]+ for entry in str(value or "").split(","):+ entry = entry.strip().lower()+ if entry and entry not in allowed:+ raise ValueError(f"Invalid {info.field_name} '{entry}'. Must be one of: {', '.join(allowed)}")+ return value+deps_ansible = [{"name": "Download nuclei",@@ -68,6 +121,8 @@ class nuclei(BaseModule):self.nuclei_config_dir = self.nuclei_state_dir / "config"self.nuclei_cache_dir = self.nuclei_state_dir / "cache"self.nuclei_templates_dir = self.nuclei_state_dir / "templates"+ # built-in template profiles ship inside the templates repo+ self.profiles_dir = self.nuclei_templates_dir / "profiles"self.nuclei_config_dir.mkdir(parents=True, exist_ok=True)self.nuclei_cache_dir.mkdir(parents=True, exist_ok=True)await self._update_templates()@@ -100,6 +155,49 @@ class nuclei(BaseModule):self.severity = self.config.get("severity")if self.mode != "severe" and self.severity != "":self.info(f"Limiting nuclei templates to the following severities: [{self.severity}]")++ # straight passthrough filters; nuclei validates these values itself and exits non-zero+ for option, label in (+ ("exclude_severity", "Excluding the following severities"),+ ("include_tags", "Force-including the following tags"),+ ("template_ids", "Limiting nuclei to the following template IDs"),+ ("exclude_ids", "Excluding the following template IDs"),+ ("protocol_types", "Limiting nuclei to the following protocol types"),+ ):+ value = self.config.get(option, "")+ setattr(self, option, value)+ if value:+ self.info(f"{label}: [{value}]")++ self.profile = self.config.get("profile", "")+ if self.profile:+ # nuclei prints an FTL line for an unknown profile but still exits 0, so resolve it ourselves+ if not Path(self.profile).is_file() and not (self.profiles_dir / f"{self.profile}.yml").is_file():+ available = ", ".join(sorted(p.stem for p in self.profiles_dir.glob("*.yml")))+ return False, (+ f"Invalid nuclei profile '{self.profile}'. Must be a path to a profile file, "+ f"or one of: {available}"+ )+ self.info(f"Using nuclei template profile: [{self.profile}]")++ self.template_condition = self.config.get("template_condition", "")+ if self.template_condition:+ self.info(f"Filtering nuclei templates by condition: [{self.template_condition}]")+ matched = await self._count_condition_templates(self.template_condition)+ if not matched:+ return False, (+ f"nuclei template_condition '{self.template_condition}' matched 0 templates. "+ "Note that nuclei silently ignores unrecognized field names."+ )+ self.verbose(f"template_condition matched {matched:,} templates")++ self.new_templates = self.config.get("new_templates", False)+ self.new_templates_versions = self.config.get("new_templates_versions", "")+ if self.new_templates:+ self.info("Limiting nuclei to templates added in the latest nuclei-templates release")+ if self.new_templates_versions:+ self.info(f"Limiting nuclei to templates added in release(s): [{self.new_templates_versions}]")+self.iserver = self.scan.config.get("interactsh_server", None)self.itoken = self.scan.config.get("interactsh_token", None)self.retries = self.config.get("retries")@@ -131,16 +229,16 @@ class nuclei(BaseModule):f"Running nuclei in BUDGET mode. This mode calculates which nuclei templates can be used, constrained by your 'budget' of number of requests. Current budget is set to: {self.budget}")- self.info("Processing nuclei templates to perform budget calculations...")-- self.nucleibudget = NucleiBudget(self)+ summary = await self._load_template_summary()+ self.nucleibudget = NucleiBudget(summary, self.budget)self.budget_templates_file = self.helpers.tempfile(self.nucleibudget.collapsible_templates, pipe=False)+ stats = self.nucleibudget.severity_statsself.info(- f"Loaded [{str(sum(self.nucleibudget.severity_stats.values()))}] templates based on a budget of [{str(self.budget)}] request(s)"+ f"Loaded [{str(sum(stats.values()))}] templates based on a budget of [{str(self.budget)}] request(s)")self.info(- f"Template Severity: Critical [{self.nucleibudget.severity_stats['critical']}] High [{self.nucleibudget.severity_stats['high']}] Medium [{self.nucleibudget.severity_stats['medium']}] Low [{self.nucleibudget.severity_stats['low']}] Info [{self.nucleibudget.severity_stats['info']}] Unknown [{self.nucleibudget.severity_stats['unknown']}]"+ f"Template Severity: Critical [{stats['critical']}] High [{stats['high']}] Medium [{stats['medium']}] Low [{stats['low']}] Info [{stats['info']}] Unknown [{stats['unknown']}]")return True@@ -233,13 +331,32 @@ class nuclei(BaseModule):for hk, hv in self.scan.custom_http_headers.items():command += ["-H", f"{hk}: {hv}"]- for cli_option in ("severity", "templates", "iserver", "itoken", "tags", "etags"):- option = getattr(self, cli_option)+ # (module attribute, nuclei flag) -- the two differ wherever nuclei's flag is hyphenated+ for attr, flag in (+ ("severity", "severity"),+ ("templates", "templates"),+ ("iserver", "iserver"),+ ("itoken", "itoken"),+ ("tags", "tags"),+ ("etags", "etags"),+ ("exclude_severity", "exclude-severity"),+ ("include_tags", "include-tags"),+ ("template_ids", "template-id"),+ ("exclude_ids", "exclude-id"),+ ("protocol_types", "type"),+ ("profile", "profile"),+ ("template_condition", "template-condition"),+ ("new_templates_versions", "new-templates-version"),+ ):+ option = getattr(self, attr)if option:- command.append(f"-{cli_option}")+ command.append(f"-{flag}")command.append(option)+ if self.new_templates:+ command.append("-new-templates")+if self.scan.config.get("interactsh_disable") is True:self.info("Disabling interactsh in accordance with global settings")command.append("-no-interactsh")@@ -344,6 +461,61 @@ class nuclei(BaseModule):env["XDG_CACHE_HOME"] = str(self.nuclei_cache_dir)return env+ async def _count_condition_templates(self, condition):+ """Ask nuclei how many templates a -template-condition expression selects.++ nuclei treats an unrecognized field name as a false match rather than an error, so a typo+ silently selects nothing. Counting up front turns that into a startup failure.+ """+ result = await self.run_process(+ [+ "nuclei",+ "-tl",+ "-no-stdin",+ "-disable-update-check",+ "-update-template-dir",+ self.nuclei_templates_dir,+ "-template-condition",+ condition,+ ],+ env=self._nuclei_env(),+ )+ return sum(1 for line in (result.stdout or "").splitlines() if line.strip().endswith(".yaml"))++ def _templates_version(self):+ config_file = self.nuclei_config_dir / "nuclei" / ".templates-config.json"+ try:+ return json.loads(config_file.read_text()).get("nuclei-templates-version", "")+ except (OSError, json.JSONDecodeError):+ return ""++ async def _load_template_summary(self):+ """Budget mode's view of the template tree, cached against the installed templates version.++ Parsing all ~13.5k templates takes about 35 seconds, and the result only changes when the+ templates do.+ """+ templates_version = self._templates_version()+ cache_key = f"nuclei_template_summary:{templates_version}"+ if templates_version:+ # the version is baked into the key, so entries only go stale when templates update+ cached = self.helpers.cache_get(cache_key, cache_hrs=24 * 365)+ if cached:+ try:+ return json.loads(cached)+ except json.JSONDecodeError:+ self.debug("Nuclei template summary cache is corrupt, rebuilding")+ else:+ self.debug("Could not determine nuclei templates version, skipping template summary cache")++ self.info("Processing nuclei templates to perform budget calculations...")+ summary = await self.helpers.run_in_executor_mp(+ summarize_nuclei_templates, str(self.nuclei_templates_dir), _timeout=600+ )+ if templates_version:+ self.helpers.cache_put(cache_key, json.dumps(summary))+ return summary+async def _update_templates(self):self.info("Updating Nuclei templates")# shield so an outer cancel can't kill the subprocess mid-extract and@@ -394,101 +566,81 @@ class nuclei(BaseModule):return True+def summarize_nuclei_templates(templates_dir):+ """Reduce every nuclei template to the minimal shape budget mode needs.++ Runs in a subprocess via run_in_executor_mp, so it lives at module level and returns plain data.+ """+ summary = {}+ for yf in Path(templates_dir).rglob("*.yaml"):+ try:+ parsed = yaml.safe_load(yf.read_text(errors="ignore"))+ except (yaml.YAMLError, OSError):+ continue+ if not isinstance(parsed, dict):+ continue+ requests = [r for r in parsed.get("http") or [] if isinstance(r, dict)]+ # nuclei only runs fuzzing (DAST) and headless templates with -dast / -headless, which bbot never passes+ if parsed.get("headless") or any(r.get("fuzzing") for r in requests):+ continue+ blocks = []+ has_raw = False+ for request in requests:+ if request.get("raw"):+ has_raw = True+ continue+ # a request is "clean" if nuclei can merge it with an identical one from another template+ clean = not any(+ (+ request.get("headers"),+ request.get("method", "GET") != "GET",+ request.get("max-redirects"),+ request.get("redirects"),+ request.get("cookie-reuse"),+ )+ )+ blocks.append({"paths": list(request.get("path") or []), "clean": clean})+ if not blocks:+ continue+ info = parsed.get("info")+ severity = info.get("severity", "unknown") if isinstance(info, dict) else "unknown"+ summary[str(yf)] = {"severity": severity, "has_raw": has_raw, "blocks": blocks}+ return summary++class NucleiBudget:- def __init__(self, nuclei_module):- self.parent = nuclei_module- self._yaml_files = {}- self.templates_dir = nuclei_module.nuclei_templates_dir- self.yaml_list = self.get_yaml_list()- self.budget_paths = self.find_budget_paths(nuclei_module.budget)- self.collapsible_templates, self.severity_stats = self.find_collapsible_templates()+ """Select the templates that collapse onto the fewest distinct requests.- def get_yaml_list(self):- return list(self.templates_dir.rglob("*.yaml"))+ nuclei merges templates that issue identical requests, so keeping only templates whose paths are+ all drawn from the N most common paths in the tree holds the request count near N however many+ templates are selected.+ """++ def __init__(self, summary, budget):+ self.summary = summary+ self.budget_paths = self.find_budget_paths(budget)+ self.collapsible_templates, self.severity_stats = self.find_collapsible_templates()- # Given the current budget setting, scan all of the templates for paths, sort them by frequency and select the first N (budget) itemsdef find_budget_paths(self, budget):- path_frequency = {}- for yf in self.yaml_list:- if yf:- for paths in self.get_yaml_request_attr(yf, "path"):- for path in paths:- if path in path_frequency.keys():- path_frequency[path] += 1- else:- path_frequency[path] = 1-- sorted_dict = dict(sorted(path_frequency.items(), key=lambda item: item[1], reverse=True))- return list(dict(islice(sorted_dict.items(), budget)).keys())-- def get_yaml_request_attr(self, yf, attr):- p = self.parse_yaml(yf)- requests = p.get("http", [])- for r in requests:- raw = r.get("raw")- if not raw:- res = r.get(attr)- if res is not None:- yield res-- def get_yaml_info_attr(self, yf, attr):- p = self.parse_yaml(yf)- info = p.get("info", [])- res = info.get(attr)- if res is not None:- yield res-- # Parse through all templates and locate those which match the conditions necessary to collapse down to the budget setting+ """The `budget` most common request paths across the whole template tree."""+ path_frequency = Counter()+ for template in self.summary.values():+ for block in template["blocks"]:+ path_frequency.update(block["paths"])+ return {path for path, _ in path_frequency.most_common(budget)}+def find_collapsible_templates(self):collapsible_templates = []- severity_dict = {}- for yf in self.yaml_list:- valid = True- if yf:- for paths in self.get_yaml_request_attr(yf, "path"):- if set(paths).issubset(self.budget_paths):- headers = self.get_yaml_request_attr(yf, "headers")- for header in headers:- if header:- valid = False-- method = self.get_yaml_request_attr(yf, "method")- for m in method:- if m != "GET":- valid = False-- max_redirects = self.get_yaml_request_attr(yf, "max-redirects")- for mr in max_redirects:- if mr:- valid = False-- redirects = self.get_yaml_request_attr(yf, "redirects")- for rd in redirects:- if rd:- valid = False-- cookie_reuse = self.get_yaml_request_attr(yf, "cookie-reuse")- for c in cookie_reuse:- if c:- valid = False-- if valid:- collapsible_templates.append(str(yf))- severity_gen = self.get_yaml_info_attr(yf, "severity")- severity = next(severity_gen)- if severity in severity_dict.keys():- severity_dict[severity] += 1- else:- severity_dict[severity] = 1- return collapsible_templates, severity_dict-- def parse_yaml(self, yamlfile):- if yamlfile not in self._yaml_files:- with open(yamlfile, "r") as stream:- try:- y = yaml.safe_load(stream)- self._yaml_files[yamlfile] = y- except yaml.YAMLError as e:- self.parent.warning(f"failed to load yaml file: {e}")- return {}- return self._yaml_files[yamlfile]+ severity_stats = Counter()+ for template_path, template in sorted(self.summary.items()):+ # nuclei runs every request block in a template, not just the one that fit the budget,+ # so a template only counts as collapsible if all of its blocks do+ if template["has_raw"]:+ continue+ if not all(+ block["clean"] and set(block["paths"]).issubset(self.budget_paths) for block in template["blocks"]+ ):+ continue+ collapsible_templates.append(template_path)+ severity_stats[template["severity"]] += 1+ return collapsible_templates, severity_statsdiff --git a/bbot/presets/nuclei/nuclei-new.yml b/bbot/presets/nuclei/nuclei-new.ymlnew file mode 100644index 000000000..f9d3c9a0e--- /dev/null+++ b/bbot/presets/nuclei/nuclei-new.yml@@ -0,0 +1,18 @@+description: Run nuclei scans against all discovered targets, using only the templates added in the latest nuclei-templates release++modules:+ - http+ - nuclei+ - portfilter++config:+ modules:+ nuclei:+ new_templates: true+ directory_only: true # Do not run nuclei on individual non-directory URLs++conditions:+ - |+ {% if config.web.spider_distance != 0 %}+ {{ warn("Running nuclei with spider enabled is generally not recommended. Consider removing 'spider' preset.") }}+ {% endif %}diff --git a/bbot/presets/nuclei/nuclei-recommended.yml b/bbot/presets/nuclei/nuclei-recommended.ymlnew file mode 100644index 000000000..96475e87c--- /dev/null+++ b/bbot/presets/nuclei/nuclei-recommended.yml@@ -0,0 +1,18 @@+description: Run nuclei scans against all discovered targets, using ProjectDiscovery's curated "recommended" template profile++modules:+ - http+ - nuclei+ - portfilter++config:+ modules:+ nuclei:+ profile: recommended+ directory_only: true # Do not run nuclei on individual non-directory URLs++conditions:+ - |+ {% if config.web.spider_distance != 0 %}+ {{ warn("Running nuclei with spider enabled is generally not recommended. Consider removing 'spider' preset.") }}+ {% endif %}diff --git a/bbot/test/test_step_2/module_tests/test_module_nuclei.py b/bbot/test/test_step_2/module_tests/test_module_nuclei.pyindex 1274a0c09..63c92f27e 100644--- a/bbot/test/test_step_2/module_tests/test_module_nuclei.py+++ b/bbot/test/test_step_2/module_tests/test_module_nuclei.py@@ -233,6 +233,213 @@ def test_nuclei_classify_update_stderr():assert c(None) == "failure"+def test_nuclei_budget_selection():+ """Budget mode must only keep templates whose every request block fits inside the budget.++ nuclei runs all of a template's request blocks, so a template that is only partly in-budget+ still costs the requests of its remaining blocks.+ """+ from bbot.modules.nuclei import NucleiBudget++ def clean_block(path):+ return {"paths": [path], "clean": True}++ summary = {+ "a.yaml": {"severity": "high", "has_raw": False, "blocks": [clean_block("{{BaseURL}}")]},+ "b.yaml": {"severity": "info", "has_raw": False, "blocks": [clean_block("{{BaseURL}}")]},+ "c.yaml": {"severity": "info", "has_raw": False, "blocks": [clean_block("{{BaseURL}}/login")]},+ "d.yaml": {"severity": "info", "has_raw": False, "blocks": [clean_block("{{BaseURL}}/login")]},+ # in-budget path, but the block needs custom headers / a non-GET method / redirects,+ # so nuclei can't merge it with anything+ "dirty.yaml": {+ "severity": "info",+ "has_raw": False,+ "blocks": [{"paths": ["{{BaseURL}}"], "clean": False}],+ },+ # one block in budget, one not+ "mixed.yaml": {+ "severity": "info",+ "has_raw": False,+ "blocks": [clean_block("{{BaseURL}}"), clean_block("{{BaseURL}}/expensive")],+ },+ # raw requests are never merged+ "raw.yaml": {"severity": "info", "has_raw": True, "blocks": [clean_block("{{BaseURL}}")]},+ }++ budget_1 = NucleiBudget(summary, 1)+ assert budget_1.budget_paths == {"{{BaseURL}}"}+ assert budget_1.collapsible_templates == ["a.yaml", "b.yaml"]+ assert budget_1.severity_stats == {"high": 1, "info": 1}+ # a severity with no templates reads as zero rather than raising+ assert budget_1.severity_stats["critical"] == 0++ # raising the budget pulls in the next most common path+ budget_2 = NucleiBudget(summary, 2)+ assert budget_2.budget_paths == {"{{BaseURL}}", "{{BaseURL}}/login"}+ assert budget_2.collapsible_templates == ["a.yaml", "b.yaml", "c.yaml", "d.yaml"]++ # with every path in budget, mixed.yaml qualifies but dirty and raw still don't+ budget_all = NucleiBudget(summary, 10)+ assert "mixed.yaml" in budget_all.collapsible_templates+ assert "dirty.yaml" not in budget_all.collapsible_templates+ assert "raw.yaml" not in budget_all.collapsible_templates+++def test_nuclei_budget_skips_dast_and_headless_templates(tmp_path):+ """Budget mode must not select fuzzing or headless templates, since nuclei skips them without -dast / -headless."""+ from bbot.modules.nuclei import summarize_nuclei_templates++ (tmp_path / "plain.yaml").write_text("info:\n severity: info\nhttp:\n - path:\n - '{{BaseURL}}'\n")+ (tmp_path / "dast.yaml").write_text(+ "info:\n severity: high\nhttp:\n - path:\n - '{{BaseURL}}'\n fuzzing:\n - part: query\n"+ )++ (tmp_path / "headless.yaml").write_text(+ "info:\n severity: info\nheadless:\n - steps:\n - action: navigate\nhttp:\n - path:\n - '{{BaseURL}}'\n"+ )++ summary = summarize_nuclei_templates(str(tmp_path))+ assert set(summary) == {str(tmp_path / "plain.yaml")}+++class TestNucleiProfile(TestNucleiRetries):+ config_overrides = {+ "interactsh_disable": True,+ "modules": {"nuclei": {"tags": "musictraveler", "profile": "recommended"}},+ }++ def check(self, module_test, events):+ assert "-profile" in open(module_test.scan.home / "debug.log").read()+++class TestNucleiNewTemplates(TestNucleiRetries):+ config_overrides = {+ "interactsh_disable": True,+ "modules": {"nuclei": {"tags": "musictraveler", "new_templates": True}},+ }++ def check(self, module_test, events):+ assert "-new-templates" in open(module_test.scan.home / "debug.log").read()+++class TestNucleiTemplateCondition(TestNucleiRetries):+ config_overrides = {+ "interactsh_disable": True,+ "modules": {"nuclei": {"tags": "musictraveler", "template_condition": "severity == 'info'"}},+ }++ def check(self, module_test, events):+ assert "-template-condition" in open(module_test.scan.home / "debug.log").read()+++class TestNucleiTemplateFilters(TestNucleiRetries):+ """Every straight-passthrough filter option reaches the nuclei command line."""++ config_overrides = {+ "interactsh_disable": True,+ "modules": {+ "nuclei": {+ "tags": "musictraveler",+ "exclude_severity": "info",+ "include_tags": "fuzz",+ "template_ids": "CVE-2024-0012",+ "exclude_ids": "CVE-2021-26855",+ "protocol_types": "http",+ }+ },+ }++ def check(self, module_test, events):+ log = open(module_test.scan.home / "debug.log").read()+ for flag in (+ "-exclude-severity info",+ "-include-tags fuzz",+ "-template-id CVE-2024-0012",+ "-exclude-id CVE-2021-26855",+ "-type http",+ ):+ assert flag in log, f"'{flag}' never reached the nuclei command line"+++class TestNucleiEnumDrift(TestNucleiRetries):+ """Pin our hardcoded severity/protocol lists against what the nuclei binary actually accepts.++ Those lists are literals inside the Config validator, because Config bodies are exec'd without+ module globals. A nuclei version bump that adds a value would otherwise make BBOT reject a+ config that nuclei supports, so fail here instead of in the field.+ """++ config_overrides = {+ "interactsh_disable": True,+ "modules": {"nuclei": {"tags": "musictraveler"}},+ }++ def check(self, module_test, events):+ import re+ import subprocess+ from bbot.scanner import Preset++ nuclei_bin = module_test.scan.helpers.tools_dir / "nuclei"+ result = subprocess.run([str(nuclei_bin), "-h"], capture_output=True, text=True)+ help_text = result.stdout + result.stderr++ def advertised(pattern):+ match = re.search(rf"{pattern}.*?Possible values: (.+)", help_text)+ assert match, f"could not find '{pattern}' in nuclei -h; the help format may have changed"+ return [v.strip() for v in match.group(1).split(",") if v.strip()]++ severities = advertised(r"-s, -severity value\[\]")+ protocol_types = advertised(r"-pt, -type value\[\]")+ assert severities and protocol_types++ for option, values in (+ ("severity", severities),+ ("exclude_severity", severities),+ ("protocol_types", protocol_types),+ ):+ for value in values:+ preset = Preset(config={"modules": {"nuclei": {option: value}}})+ # raises ValidationError if nuclei has added a value our validator doesn't know+ preset.validate()++ # and the validator is actually wired up, so the loop above isn't vacuously passing+ with pytest.raises(Exception):+ Preset(config={"modules": {"nuclei": {"severity": "notarealseverity"}}}).validate()+++async def test_nuclei_invalid_profile(caplog):+ """An unknown profile makes nuclei print FTL and exit 0, so the module has to catch it itself."""+ from bbot.errors import ScanError+ from bbot.scanner import Scanner++ scan = Scanner(+ "127.0.0.1",+ modules=["nuclei"],+ config={"interactsh_disable": True, "modules": {"nuclei": {"profile": "definitelynotaprofile"}}},+ )+ with pytest.raises(ScanError):+ await scan._prep()+ assert "Invalid nuclei profile 'definitelynotaprofile'" in caplog.text+++async def test_nuclei_invalid_template_condition(caplog):+ """nuclei treats an unrecognized field as a non-match rather than an error, so zero matching+ templates is the only signal that the expression was wrong."""+ from bbot.errors import ScanError+ from bbot.scanner import Scanner++ scan = Scanner(+ "127.0.0.1",+ modules=["nuclei"],+ config={"interactsh_disable": True, "modules": {"nuclei": {"template_condition": "bogus_field == 1"}}},+ )+ with pytest.raises(ScanError):+ await scan._prep()+ assert "matched 0 templates" in caplog.text++class TestNucleiCustomHeaders(TestNucleiManual):custom_headers = {"testheader1": "test1", "testheader2": "test2"}config_overrides = TestNucleiManual.config_overridesdiff --git a/docs/modules/nuclei.md b/docs/modules/nuclei.mdindex f9f9075c1..5666da072 100644--- a/docs/modules/nuclei.md+++ b/docs/modules/nuclei.md@@ -36,22 +36,31 @@ modules:The Nuclei module has many configuration options:<!-- BBOT MODULE OPTIONS NUCLEI -->-| Config Option | Type | Description | Default |-|-------------------------------|-----------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------|-| modules.nuclei.batch_size | int | Number of targets to send to Nuclei per batch (default 200) | 200 |-| modules.nuclei.budget | int | Used in budget mode to set the number of allowed requests per host | 1 |-| modules.nuclei.concurrency | int | maximum number of templates to be executed in parallel (default 25) | 25 |-| modules.nuclei.directory_only | bool | Filter out 'file' URL event (default True) | True |-| modules.nuclei.etags | str | tags to exclude from the scan | |-| modules.nuclei.mode | Literal['manual', 'technology', 'severe', 'budget'] | manual | technology | severe | budget. Technology: Only activate based on technology events that match nuclei tags (nuclei -as mode). Manual (DEFAULT): Fully manual settings. Severe: Only critical and high severity templates without intrusive. Budget: Limit Nuclei to a specified number of HTTP requests | manual |-| modules.nuclei.module_timeout | int | Max time in seconds to spend handling each batch of events | 21600 |-| modules.nuclei.ratelimit | int | maximum number of requests to send per second (default 150) | 150 |-| modules.nuclei.retries | int | number of times to retry a failed request (default 0) | 0 |-| modules.nuclei.severity | str | Filter based on severity field available in the template. | |-| modules.nuclei.silent | bool | Don't display nuclei's banner or status messages | False |-| modules.nuclei.tags | str | execute a subset of templates that contain the provided tags | |-| modules.nuclei.templates | str | template or template directory paths to include in the scan | |-| modules.nuclei.version | str | nuclei version | 3.11.1 |+| Config Option | Type | Description | Default |+|---------------------------------------|-----------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------|+| modules.nuclei.batch_size | int | Number of targets to send to Nuclei per batch (default 200) | 200 |+| modules.nuclei.budget | int | Used in budget mode to set the number of allowed requests per host | 1 |+| modules.nuclei.concurrency | int | maximum number of templates to be executed in parallel (default 25) | 25 |+| modules.nuclei.directory_only | bool | Filter out 'file' URL event (default True) | True |+| modules.nuclei.etags | str | tags to exclude from the scan | |+| modules.nuclei.exclude_ids | str | Exclude templates with the given IDs | |+| modules.nuclei.exclude_severity | str | Filter out templates with the given severities | |+| modules.nuclei.include_tags | str | tags to run even though nuclei excludes them by default (e.g. dos, fuzz, bruteforce) | |+| modules.nuclei.mode | Literal['manual', 'technology', 'severe', 'budget'] | manual | technology | severe | budget. Technology: Only activate based on technology events that match nuclei tags (nuclei -as mode). Manual (DEFAULT): Fully manual settings. Severe: Only critical and high severity templates without intrusive. Budget: Limit Nuclei to a specified number of HTTP requests | manual |+| modules.nuclei.module_timeout | int | Max time in seconds to spend handling each batch of events | 21600 |+| modules.nuclei.new_templates | bool | Only run templates added in the latest templates release | False |+| modules.nuclei.new_templates_versions | str | Only run templates added in the given templates releases, e.g. 'v10.4.8,v10.4.9' | |+| modules.nuclei.profile | str | nuclei template profile to run (built-in profile id, or path to a profile file) | |+| modules.nuclei.protocol_types | str | Only run templates of the given protocol types (http, dns, ssl, tcp, javascript, etc.) | |+| modules.nuclei.ratelimit | int | maximum number of requests to send per second (default 150) | 150 |+| modules.nuclei.retries | int | number of times to retry a failed request (default 0) | 0 |+| modules.nuclei.severity | str | Filter based on severity field available in the template. | |+| modules.nuclei.silent | bool | Don't display nuclei's banner or status messages | False |+| modules.nuclei.tags | str | execute a subset of templates that contain the provided tags | |+| modules.nuclei.template_condition | str |` expression to filter templates by, e.g. "epss_score>=0.1 && max_request<=3" `| |+| modules.nuclei.template_ids | str | Only run templates with the given IDs (wildcards allowed) | |+| modules.nuclei.templates | str | template or template directory paths to include in the scan | |+| modules.nuclei.version | str | nuclei version | 3.11.1 |<!-- END BBOT MODULE OPTIONS NUCLEI -->Most of these you probably will **NOT** want to change. In particular, we advise against changing the version of Nuclei, as it's possible the latest version won't work right with BBOT.@@ -86,10 +95,11 @@ For only the cost of one (or more) "extra" request(s) per host, it can activateThe budget parameter is the # of extra requests per host you are willing to send to "feed" Nuclei templates (defaults to 1).For those times when vulnerability scanning isn't the main focus, but you want to look for easy wins.-Of course, there is a rapidly diminishing return when you set the value to more than a handful. Eventually, this becomes 1 template per 1 budget value increase. However, in the 1-10 range there is a lot of value. This graphic should give you a rough visual idea of this concept.+To give a sense of scale: against a recent template set, a budget of 1 selects roughly 1,300 templates for about 2 requests per host, and a budget of 10 selects roughly 1,500. There is a rapidly diminishing return past a handful, and eventually this becomes 1 template per 1 budget value increase. However, in the 1-10 range there is a lot of value. This graphic should give you a rough visual idea of this concept.+Note that Nuclei's own `metadata.max-request` field is *not* the same thing, and `template_condition` is not a substitute for budget mode. `max-request` caps the requests made by each individual template, whereas budget mode caps the total requests made against each host by selecting templates that all land on the same handful of URLs.### Nuclei pass-through options@@ -99,6 +109,24 @@ The **ratelimit** and **concurrency** settings default to the same defaults that**templates** will allow you to set your own templates directory. This can be very useful if you have your own custom templates that you want to use with BBOT.+### Limiting templates++These options stack on top of whichever **mode** you've chosen, and on top of each other. Nuclei intersects them, so combining two filters gives you the templates that satisfy both.++**exclude_severity** is the counterpart to **severity**. Dropping `info` on its own removes about 5,000 templates, most of which are detections rather than vulnerabilities.++**template_ids** and **exclude_ids** select or drop templates by ID, and **template_ids** accepts wildcards (e.g. `CVE-2024-*`). **exclude_ids** is the clean way to suppress a template that false-positives against a particular client, without maintaining your own copy of the template tree.++**protocol_types** restricts the scan to given protocols: `http`, `dns`, `ssl`, `tcp`, `javascript`, `code`, `file`, `headless`, `websocket`, `whois`, `workflow`.++**include_tags** force-runs tags that Nuclei excludes by default. Nuclei ships an ignore list (`dos`, `local`, `fuzz`, `bruteforce`, `txt-service`) that applies before any option here, and this is the only way to reach those templates. Be careful with `fuzz` in particular: those templates carry very large payload lists and account for the overwhelming majority of Nuclei's potential request volume.++**profile** selects a Nuclei template profile, which is a curated bundle of filter settings. You can give it the id of one of the profiles that ships with nuclei-templates (`recommended`, `pentest`, `cves`, `kev`, `misconfigurations`, `wordpress`, and more -- run `nuclei -tpl` for the full list), or a path to a profile file of your own. The `recommended` profile is a good default: alongside a severity floor it carries a maintained list of templates known to produce false positives, and that list updates along with the templates.++**template_condition** is passed to Nuclei's `-template-condition` and filters on the template's metadata. Useful fields include `severity`, `max_request`, `epss_score`, `epss_percentile`, `cvss_score`, `cve_id`, `cwe_id`, `cpe`, `vendor`, `product` and `tags`. For example, `epss_score >= 0.1 || contains(tags, 'kev')` limits the scan to vulnerabilities with real-world exploitation evidence. Be aware that Nuclei treats an unrecognized field name as a non-match rather than an error, so BBOT counts the matching templates at startup and refuses to scan if the expression matches nothing.++**new_templates** limits the scan to templates added in the most recent nuclei-templates release, which is typically 100-130 templates. **new_templates_versions** does the same for specific releases, e.g. `v10.4.8,v10.4.9`. These are handy for re-scanning a target you've already covered, to see only what's new.+### Example Commands```bashdiff --git a/docs/scanning/configuration.md b/docs/scanning/configuration.mdindex a1af7458f..3e7363a55 100644--- a/docs/scanning/configuration.md+++ b/docs/scanning/configuration.md@@ -529,13 +529,22 @@ In addition to the stated options for each module, the following universal optio| modules.nuclei.concurrency | int | maximum number of templates to be executed in parallel (default 25) | 25 || modules.nuclei.directory_only | bool | Filter out 'file' URL event (default True) | True || modules.nuclei.etags | str | tags to exclude from the scan | |+| modules.nuclei.exclude_ids | str | Exclude templates with the given IDs | |+| modules.nuclei.exclude_severity | str | Filter out templates with the given severities | |+| modules.nuclei.include_tags | str | tags to run even though nuclei excludes them by default (e.g. dos, fuzz, bruteforce) | || modules.nuclei.mode | Literal['manual', 'technology', 'severe', 'budget'] | manual | technology | severe | budget. Technology: Only activate based on technology events that match nuclei tags (nuclei -as mode). Manual (DEFAULT): Fully manual settings. Severe: Only critical and high severity templates without intrusive. Budget: Limit Nuclei to a specified number of HTTP requests | manual || modules.nuclei.module_timeout | int | Max time in seconds to spend handling each batch of events | 21600 |+| modules.nuclei.new_templates | bool | Only run templates added in the latest templates release | False |+| modules.nuclei.new_templates_versions | str | Only run templates added in the given templates releases, e.g. 'v10.4.8,v10.4.9' | |+| modules.nuclei.profile | str | nuclei template profile to run (built-in profile id, or path to a profile file) | |+| modules.nuclei.protocol_types | str | Only run templates of the given protocol types (http, dns, ssl, tcp, javascript, etc.) | || modules.nuclei.ratelimit | int | maximum number of requests to send per second (default 150) | 150 || modules.nuclei.retries | int | number of times to retry a failed request (default 0) | 0 || modules.nuclei.severity | str | Filter based on severity field available in the template. | || modules.nuclei.silent | bool | Don't display nuclei's banner or status messages | False || modules.nuclei.tags | str | execute a subset of templates that contain the provided tags | |+| modules.nuclei.template_condition | str |` expression to filter templates by, e.g. "epss_score>=0.1 && max_request<=3" `| |+| modules.nuclei.template_ids | str | Only run templates with the given IDs (wildcards allowed) | || modules.nuclei.templates | str | template or template directory paths to include in the scan | || modules.nuclei.version | str | nuclei version | 3.11.1 || modules.oauth.try_all | bool | Check for OAUTH/IODC on every subdomain and URL. | False |diff --git a/docs/scanning/presets_list.md b/docs/scanning/presets_list.mdindex 53a41c4a4..674308798 100644--- a/docs/scanning/presets_list.md+++ b/docs/scanning/presets_list.md@@ -550,6 +550,66 @@ Category: nucleiModules: [0]("")+## **nuclei-new**++Run nuclei scans against all discovered targets, using only the templates added in the latest nuclei-templates release++??? note "`nuclei-new.yml`"+ ```yaml title="~/.bbot/presets/nuclei/nuclei-new.yml"+ description: Run nuclei scans against all discovered targets, using only the templates added in the latest nuclei-templates release++ modules:+ - http+ - nuclei+ - portfilter++ config:+ modules:+ nuclei:+ new_templates: true+ directory_only: true # Do not run nuclei on individual non-directory URLs++ conditions:+ - |+ {% if config.web.spider_distance != 0 %}+ {{ warn("Running nuclei with spider enabled is generally not recommended. Consider removing 'spider' preset.") }}+ {% endif %}+ ```++Category: nuclei++Modules: [0]("")++## **nuclei-recommended**++Run nuclei scans against all discovered targets, using ProjectDiscovery's curated "recommended" template profile++??? note "`nuclei-recommended.yml`"+ ```yaml title="~/.bbot/presets/nuclei/nuclei-recommended.yml"+ description: Run nuclei scans against all discovered targets, using ProjectDiscovery's curated "recommended" template profile++ modules:+ - http+ - nuclei+ - portfilter++ config:+ modules:+ nuclei:+ profile: recommended+ directory_only: true # Do not run nuclei on individual non-directory URLs++ conditions:+ - |+ {% if config.web.spider_distance != 0 %}+ {{ warn("Running nuclei with spider enabled is generally not recommended. Consider removing 'spider' preset.") }}+ {% endif %}+ ```++Category: nuclei++Modules: [0]("")+## **nuclei-technology**Run nuclei scans against all discovered targets, running templates which match discovered technologies@@ -1019,41 +1079,43 @@ Modules: [0]("")Here is a the same data, but in a table:<!-- BBOT PRESETS -->-| Preset | Category | Description | # Modules | Modules |-|-------------------|------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------|----------------------------------------------------------------------------------------------------|-| baddns | | Check for subdomain takeovers and other DNS issues. | 1 | baddns |-| baddns-heavy | | Run all baddns modules and submodules. | 3 | baddns, baddns_direct, baddns_zone |-| cloud-enum | | Enumerate cloud resources such as storage buckets, etc. | 0 | |-| code-enum | | Enumerate Git repositories, Docker images, etc. | 0 | |-| dotnet-audit | web | Comprehensive scan for all IIS/.NET specific modules and module settings | 8 | ajaxpro, aspnet_bin_exposure, badsecrets, dotnetnuke, http, telerik, webbrute, webbrute_shortnames |-| email-enum | | Enumerate email addresses from APIs, web crawling, etc. | 0 | |-| fast | | Scan only the provided targets as fast as possible - no extra discovery | 0 | |-| iis-shortnames | web | Recursively enumerate IIS shortnames | 0 | |-| js-audit | web | Hunt for leaked credentials and vulnerable libraries in client-side JavaScript | 7 | badsecrets, http, js_unpacker, retirejs, robots, trufflehog, wayback |-| kitchen-sink | | Everything everywhere all at once | 7 | baddns, baddns_direct, baddns_zone, http, hunt, reflected_parameters, webbrute |-| lightfuzz | web | Default fuzzing: all 9 submodules (cmdi, crypto, path, serial, sqli, ssti, xss, esi, ssrf) plus companion modules (badsecrets, hunt, reflected_parameters). POST fuzzing disabled but try_post_as_get enabled, so POST params are retested as GET. Skips confirmed WAFs. | 7 | badsecrets, http, hunt, lightfuzz, nowafpls, portfilter, reflected_parameters |-| lightfuzz-heavy | web | Aggressive fuzzing: everything in lightfuzz, plus paramminer brute-force parameter discovery (headers, GET params, cookies), POST request fuzzing enabled, try_get_as_post enabled (GET params retested as POST), and robots.txt parsing. Still skips confirmed WAFs. | 9 | badsecrets, http, hunt, lightfuzz, nowafpls, portfilter, reflected_parameters, robots, wayback |-| lightfuzz-light | web | Minimal fuzzing: only path traversal, SQLi, and XSS submodules. No POST requests. No companion modules. Safest option for running alongside larger scans with minimal overhead. | 3 | http, lightfuzz, portfilter |-| lightfuzz-max | web | Maximum fuzzing: everything in lightfuzz-heavy, plus the heavy paramminer variant (1-3 letter brute-force on GET params, case mutation on case-sensitive backends, recycle_words on all paramminer modules), WAF targets are no longer skipped, each unique parameter-value pair is fuzzed individually (no collapsing), common headers like X-Forwarded-For are fuzzed even if not observed, and potential parameters are speculated from JSON/XML response bodies. Significantly increases scan time. | 9 | badsecrets, http, hunt, lightfuzz, nowafpls, portfilter, reflected_parameters, robots, wayback |-| lightfuzz-xss | web | XSS-only: enables only the xss submodule with paramminer_getparams and reflected_parameters. POST fuzzing enabled and try_get_as_post retests every discovered GET parameter as POST, so the nowafpls body-padding bypass gets a chance on WAF-tagged targets (a padded-POST XSS is triggerable from an attacker-controlled form). | 6 | http, lightfuzz, nowafpls, paramminer_getparams, portfilter, reflected_parameters |-| nuclei | nuclei | Run nuclei scans against all discovered targets | 3 | http, nuclei, portfilter |-| nuclei-budget | nuclei | Run nuclei scans against all discovered targets, using budget mode to look for low hanging fruit with greatly reduced number of requests | 3 | http, nuclei, portfilter |-| nuclei-heavy | nuclei | Run nuclei scans against all discovered targets, allowing for spidering, against ALL URLs, and with additional discovery modules. | 6 | http, nuclei, portfilter, robots, urlscan, wayback |-| nuclei-technology | nuclei | Run nuclei scans against all discovered targets, running templates which match discovered technologies | 3 | http, nuclei, portfilter |-| paramminer | web | Discover new web parameters via brute-force, and analyze them with additional modules | 3 | http, hunt, reflected_parameters |-| paramminer-heavy | web | Aggressive paramminer brute-force: enables 1-3 letter combination brute-force on GET parameters and case mutation (camelCase / Title-case variants) on case-sensitive backends. Significantly increases scan time. | 3 | http, hunt, reflected_parameters |-| spider | | Recursive web spider | 1 | http |-| spider-heavy | | Recursive web spider with more aggressive settings | 1 | http |-| subdomain-enum | | Enumerate subdomains via APIs, brute-force | 0 | |-| tech-detect | | Detect technologies via Nuclei, FingerprintX, and favicon hashes | 3 | favicon, fingerprintx, nuclei |-| virtualhost | web | Virtual host discovery: subdomain brute-force and mutations against the target host's Host header / SNI. | 1 | virtualhost |-| virtualhost-heavy | web | Aggressive virtual host discovery: everything in virtualhost, plus special-host probing, certificate SAN extraction, and wordcloud-driven candidate testing. | 1 | virtualhost |-| waf-bypass | | WAF bypass detection with subdomain enumeration | 2 | http, waf_bypass |-| wayback | | Discover URLs and interesting archived files via the Wayback Machine | 1 | wayback |-| wayback-heavy | | Full Wayback Machine integration - URL discovery, parameter extraction, archived page retrieval, and interesting file detection | 2 | badsecrets, wayback |-| web | | Quick web scan | 0 | |-| web-heavy | | Aggressive web scan | 0 | |-| web-screenshots | | Take screenshots of webpages | 0 | |-| webbrute | web | Basic web directory brute-force (surface-level directories only) | 1 | webbrute |-| webbrute-heavy | web | Recursive web directory brute-force (aggressive) | 3 | http, wayback, webbrute |+| Preset | Category | Description | # Modules | Modules |+|--------------------|------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------|----------------------------------------------------------------------------------------------------|+| baddns | | Check for subdomain takeovers and other DNS issues. | 1 | baddns |+| baddns-heavy | | Run all baddns modules and submodules. | 3 | baddns, baddns_direct, baddns_zone |+| cloud-enum | | Enumerate cloud resources such as storage buckets, etc. | 0 | |+| code-enum | | Enumerate Git repositories, Docker images, etc. | 0 | |+| dotnet-audit | web | Comprehensive scan for all IIS/.NET specific modules and module settings | 8 | ajaxpro, aspnet_bin_exposure, badsecrets, dotnetnuke, http, telerik, webbrute, webbrute_shortnames |+| email-enum | | Enumerate email addresses from APIs, web crawling, etc. | 0 | |+| fast | | Scan only the provided targets as fast as possible - no extra discovery | 0 | |+| iis-shortnames | web | Recursively enumerate IIS shortnames | 0 | |+| js-audit | web | Hunt for leaked credentials and vulnerable libraries in client-side JavaScript | 7 | badsecrets, http, js_unpacker, retirejs, robots, trufflehog, wayback |+| kitchen-sink | | Everything everywhere all at once | 7 | baddns, baddns_direct, baddns_zone, http, hunt, reflected_parameters, webbrute |+| lightfuzz | web | Default fuzzing: all 9 submodules (cmdi, crypto, path, serial, sqli, ssti, xss, esi, ssrf) plus companion modules (badsecrets, hunt, reflected_parameters). POST fuzzing disabled but try_post_as_get enabled, so POST params are retested as GET. Skips confirmed WAFs. | 7 | badsecrets, http, hunt, lightfuzz, nowafpls, portfilter, reflected_parameters |+| lightfuzz-heavy | web | Aggressive fuzzing: everything in lightfuzz, plus paramminer brute-force parameter discovery (headers, GET params, cookies), POST request fuzzing enabled, try_get_as_post enabled (GET params retested as POST), and robots.txt parsing. Still skips confirmed WAFs. | 9 | badsecrets, http, hunt, lightfuzz, nowafpls, portfilter, reflected_parameters, robots, wayback |+| lightfuzz-light | web | Minimal fuzzing: only path traversal, SQLi, and XSS submodules. No POST requests. No companion modules. Safest option for running alongside larger scans with minimal overhead. | 3 | http, lightfuzz, portfilter |+| lightfuzz-max | web | Maximum fuzzing: everything in lightfuzz-heavy, plus the heavy paramminer variant (1-3 letter brute-force on GET params, case mutation on case-sensitive backends, recycle_words on all paramminer modules), WAF targets are no longer skipped, each unique parameter-value pair is fuzzed individually (no collapsing), common headers like X-Forwarded-For are fuzzed even if not observed, and potential parameters are speculated from JSON/XML response bodies. Significantly increases scan time. | 9 | badsecrets, http, hunt, lightfuzz, nowafpls, portfilter, reflected_parameters, robots, wayback |+| lightfuzz-xss | web | XSS-only: enables only the xss submodule with paramminer_getparams and reflected_parameters. POST fuzzing enabled and try_get_as_post retests every discovered GET parameter as POST, so the nowafpls body-padding bypass gets a chance on WAF-tagged targets (a padded-POST XSS is triggerable from an attacker-controlled form). | 6 | http, lightfuzz, nowafpls, paramminer_getparams, portfilter, reflected_parameters |+| nuclei | nuclei | Run nuclei scans against all discovered targets | 3 | http, nuclei, portfilter |+| nuclei-budget | nuclei | Run nuclei scans against all discovered targets, using budget mode to look for low hanging fruit with greatly reduced number of requests | 3 | http, nuclei, portfilter |+| nuclei-heavy | nuclei | Run nuclei scans against all discovered targets, allowing for spidering, against ALL URLs, and with additional discovery modules. | 6 | http, nuclei, portfilter, robots, urlscan, wayback |+| nuclei-new | nuclei | Run nuclei scans against all discovered targets, using only the templates added in the latest nuclei-templates release | 3 | http, nuclei, portfilter |+| nuclei-recommended | nuclei | Run nuclei scans against all discovered targets, using ProjectDiscovery's curated "recommended" template profile | 3 | http, nuclei, portfilter |+| nuclei-technology | nuclei | Run nuclei scans against all discovered targets, running templates which match discovered technologies | 3 | http, nuclei, portfilter |+| paramminer | web | Discover new web parameters via brute-force, and analyze them with additional modules | 3 | http, hunt, reflected_parameters |+| paramminer-heavy | web | Aggressive paramminer brute-force: enables 1-3 letter combination brute-force on GET parameters and case mutation (camelCase / Title-case variants) on case-sensitive backends. Significantly increases scan time. | 3 | http, hunt, reflected_parameters |+| spider | | Recursive web spider | 1 | http |+| spider-heavy | | Recursive web spider with more aggressive settings | 1 | http |+| subdomain-enum | | Enumerate subdomains via APIs, brute-force | 0 | |+| tech-detect | | Detect technologies via Nuclei, FingerprintX, and favicon hashes | 3 | favicon, fingerprintx, nuclei |+| virtualhost | web | Virtual host discovery: subdomain brute-force and mutations against the target host's Host header / SNI. | 1 | virtualhost |+| virtualhost-heavy | web | Aggressive virtual host discovery: everything in virtualhost, plus special-host probing, certificate SAN extraction, and wordcloud-driven candidate testing. | 1 | virtualhost |+| waf-bypass | | WAF bypass detection with subdomain enumeration | 2 | http, waf_bypass |+| wayback | | Discover URLs and interesting archived files via the Wayback Machine | 1 | wayback |+| wayback-heavy | | Full Wayback Machine integration - URL discovery, parameter extraction, archived page retrieval, and interesting file detection | 2 | badsecrets, wayback |+| web | | Quick web scan | 0 | |+| web-heavy | | Aggressive web scan | 0 | |+| web-screenshots | | Take screenshots of webpages | 0 | |+| webbrute | web | Basic web directory brute-force (surface-level directories only) | 1 | webbrute |+| webbrute-heavy | web | Recursive web directory brute-force (aggressive) | 3 | http, wayback, webbrute |<!-- END BBOT PRESETS -->