Skip to content

reconFTW is a tool designed to perform automated recon on a target domain by running the best set of tools to perform scanning and finding out vulnerabilities

New vulns nuclei -dast approach

six2dezc9c1b696a651
diff --git a/CHANGELOG.md b/CHANGELOG.md
index efdb4cf..a5310bd 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,6 +5,36 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+## [Unreleased]
+
+### Added
+- `nuclei_dast` module: dedicated `nuclei -dast` pass over `webs/`, `url_extract`, and `gf/` candidates (outputs `nuclei_output/dast_json.txt`, `vulns/nuclei_dast.txt`).
+- Portscan strategy `PORTSCAN_STRATEGY=naabu_nmap`: naabu pre-discovery + targeted nmap outputs (`hosts/naabu_open.txt`, `hosts/portscan_active_targeted.*`).
+- Optional UDP scan: `PORTSCAN_UDP=true` produces `hosts/portscan_active_udp.*`.
+- Subdomain permutation engine `alterx` and `PERMUTATIONS_ENGINE=both` (gotator + alterx merged), with `PERMUTATIONS_OPTION` kept as a legacy alias.
+- Monitor alert threshold `MONITOR_MIN_SEVERITY` (critical|high|medium|low|info).
+- SSRF alternate protocol payload pass via `config/ssrf_payloads.txt` (output `vulns/ssrf_alt_protocols.txt`).
+- Katana headless profile selection: `KATANA_HEADLESS_PROFILE=off|smart|full`.
+- DEEP-only ffuf recursion: `FUZZ_RECURSION_DEPTH`.
+- CDN origin discovery (best-effort) via `hakoriginfinder` with `CDN_BYPASS=true` (output `hosts/origin_ips.txt`).
+- Password dictionary engine `cewl` (Ruby gem) with tuning knobs.
+
+### Changed
+- Fixed `webprobe_simple()` httpx merge bug (probe output now correctly merged with prior cache).
+- Wrapped local `wafw00f` execution with `run_command` for dry-run/log consistency.
+- `PORTSCAN_ACTIVE_OPTIONS` default no longer includes `--script vulners`; moved to `PORTSCAN_DEEP_OPTIONS`.
+- `ssti`: if `tinja` is missing, the module warns and skips (no automatic ffuf fallback).
+- `iishortname`: uses `shortscan` only (sns removed).
+- `nuclei_dast`: when vuln scanning is enabled (`VULNS_GENERAL=true`, e.g. `-a`), the DAST pass is force-enabled to avoid accidental coverage loss.
+
+### Removed
+- Obsolete tool-based modules: `cors` (Corsy), `open_redirect` (Oralyzer), `prototype_pollution` (ppmap), favicon real-IP discovery (fav-up).
+- Deprecated/removed config flags: `CORS`, `OPEN_REDIRECT`, `PROTO_POLLUTION`, `FAVICON`.
+
+### Migration Notes
+- Prefer Nuclei templates (and `nuclei_dast`) for CORS/open-redirect/prototype-pollution coverage.
+- Use `PERMUTATIONS_ENGINE` (legacy `PERMUTATIONS_OPTION` is still accepted with a warning for a compatibility window).
+
## [v4.0] - 2026-02-06
### Added
diff --git a/README.md b/README.md
index 3281cea..8108703 100644
--- a/README.md
+++ b/README.md
@@ -123,7 +123,7 @@ reconFTW is packed with features to make reconnaissance thorough and efficient.
- **Certificate Transparency**: Queries certificate transparency logs ([crt](https://github.com/cemulus/crt)).
- **NOERROR Discovery**: Identifies subdomains with DNS NOERROR responses ([dnsx](https://github.com/projectdiscovery/dnsx), more info [here](https://www.securesystems.de/blog/enhancing-subdomain-enumeration-ents-and-noerror/)).
- **Bruteforce**: Performs DNS bruteforcing with customizable wordlists ([puredns](https://github.com/d3mondev/puredns) and custom wordlists).
-- **Permutations**: Generates subdomain permutations using AI, regex and tools ([Gotator](https://github.com/Josue87/gotator), [ripgen](https://github.com/resyncgg/ripgen), [regulator](https://github.com/cramppet/regulator) and [subwiz](https://github.com/hadriansecurity/subwiz)).
+- **Permutations**: Generates subdomain permutations using AI, regex and tools ([Gotator](https://github.com/Josue87/gotator), [ripgen](https://github.com/resyncgg/ripgen), [alterx](https://github.com/projectdiscovery/alterx), [regulator](https://github.com/cramppet/regulator) and [subwiz](https://github.com/hadriansecurity/subwiz)).
- **Web Scraping**: Extracts subdomains from passive URL sources and live web metadata ([urlfinder](https://github.com/projectdiscovery/urlfinder), [waymore](https://github.com/xnl-h4ck3r/waymore), [httpx](https://github.com/projectdiscovery/httpx), [csprecon](https://github.com/edoardottt/csprecon)).
- **DNS Records**: Resolves DNS records for subdomains ([dnsx](https://github.com/projectdiscovery/dnsx)).
- **Google Analytics**: Identifies subdomains via Analytics IDs ([AnalyticsRelationships](https://github.com/Josue87/AnalyticsRelationships)).
@@ -139,8 +139,8 @@ reconFTW is packed with features to make reconnaissance thorough and efficient.
- **IP Information**: Retrieves geolocation and WHOIS data ([ipinfo](https://www.ipinfo.io/)).
- **CDN Detection**: Identifies IPs behind CDNs ([cdncheck](https://github.com/projectdiscovery/cdncheck)).
- **WAF Detection**: Detects Web Application Firewalls ([wafw00f](https://github.com/EnableSecurity/wafw00f)).
-- **Port Scanning**: Active scanning with [nmap](https://github.com/nmap/nmap) and passive scanning with [smap](https://github.com/s0md3v/Smap).
-- **Service Vulnerabilities**: Checks for vulnerabilities in open ports ([vulners](https://github.com/vulnersCom/nmap-vulners)).
+- **Port Scanning**: Active scanning with [nmap](https://github.com/nmap/nmap) (optionally preceded by [naabu](https://github.com/projectdiscovery/naabu)) and passive scanning with [smap](https://github.com/s0md3v/Smap).
+- **Service Vulnerabilities (Optional)**: Deep portscan profile can enrich results with CVE matching via [vulners](https://github.com/vulnersCom/nmap-vulners).
- **Password Spraying**: Attempts password spraying on identified services ([brutespray](https://github.com/x90skysn3k/brutespray)).
- **Geolocation**: Maps IP addresses to geographic locations ([ipinfo](https://www.ipinfo.io/)).
- **IPv6 Discovery**: Optionally enumerates and scans discovered IPv6 targets when `IPV6_SCAN` is enabled.
@@ -153,7 +153,7 @@ reconFTW is packed with features to make reconnaissance thorough and efficient.
- **CMS Detection**: Identifies content management systems ([CMSeeK](https://github.com/Tuhinshubhra/CMSeeK)).
- **URL Extraction**: Collects URLs passively and actively ([urlfinder](https://github.com/projectdiscovery/urlfinder), [waymore](https://github.com/xnl-h4ck3r/waymore), [katana](https://github.com/projectdiscovery/katana), [github-endpoints](https://gist.github.com/six2dez/d1d516b606557526e9a78d7dd49cacd3) and [JSA](https://github.com/w9w/JSA)).
- **URL Pattern Analysis**: Classifies URLs using patterns ([urless](https://github.com/xnl-h4ck3r/urless), [gf](https://github.com/tomnomnom/gf) and [gf-patterns](https://github.com/1ndianl33t/Gf-Patterns)).
-- **Favicon Analysis**: Discovers real IPs behind favicons ([fav-up](https://github.com/pielco11/fav-up)) and identifies technologies from favicon hashes ([favirecon](https://github.com/edoardottt/favirecon)).
+- **Favicon Tech Recon**: Identifies technologies from favicon hashes ([favirecon](https://github.com/edoardottt/favirecon)).
- **JavaScript Analysis**: Extracts secrets and endpoints from JS files ([subjs](https://github.com/lc/subjs), [JSA](https://github.com/w9w/JSA), [xnLinkFinder](https://github.com/xnl-h4ck3r/xnLinkFinder), [getjswords](https://github.com/m4ll0k/BBTz), [mantra](https://github.com/MrEmpy/mantra), [jsluice](https://github.com/BishopFox/jsluice)).
- **Source Map Extraction**: Retrieves sensitive data from JavaScript source maps ([sourcemapper](https://github.com/denandz/sourcemapper)).
- **GraphQL Detection**: Discovers GraphQL endpoints with nuclei and optionally performs in-depth introspection ([GQLSpection](https://github.com/doyensec/GQLSpection)).
@@ -163,24 +163,22 @@ reconFTW is packed with features to make reconnaissance thorough and efficient.
- **Fuzzing**: Performs directory and parameter fuzzing ([ffuf](https://github.com/ffuf/ffuf)).
- **File Extension Sorting**: Organizes URLs by file extensions.
- **Wordlist Generation**: Creates custom wordlists for fuzzing.
-- **Password Dictionary**: Generates password dictionaries ([pydictor](https://github.com/LandGrey/pydictor)).
-- **IIS Shortname Scanning**: Detects IIS shortname vulnerabilities ([shortscan](https://github.com/bitquark/shortscan) and [sns](https://github.com/sw33tLie/sns)).
+- **Password Dictionary**: Generates password dictionaries from live content ([cewl](https://github.com/digininja/CeWL)).
+- **IIS Shortname Scanning**: Detects IIS shortname vulnerabilities ([shortscan](https://github.com/bitquark/shortscan)).
### Vulnerability Checks
- **CVEs**: Checks for CVE and common vulnerabilites [nuclei](https://github.com/projectdiscovery/nuclei)
+- **Nuclei DAST**: Runs `nuclei -dast` templates over collected URLs and GF candidates for additional DAST coverage.
- **XSS**: Tests for cross-site scripting vulnerabilities ([dalfox](https://github.com/hahwul/dalfox)).
-- **CORS**: Identifies CORS misconfigurations ([Corsy](https://github.com/s0md3v/Corsy)).
- **SSL/TLS**: Checks for SSL/TLS misconfigurations ([testssl](https://github.com/drwetter/testssl.sh)).
-- **Open Redirects**: Detects open redirect vulnerabilities ([Oralyzer](https://github.com/r0075h3ll/Oralyzer)).
-- **SSRF**: Tests for server-side request forgery ([interactsh](https://github.com/projectdiscovery/interactsh) and param values with [ffuf](https://github.com/ffuf/ffuf)).
+- **SSRF**: Tests for server-side request forgery ([interactsh](https://github.com/projectdiscovery/interactsh), parameter values with [ffuf](https://github.com/ffuf/ffuf), and optional alternate protocol payloads).
- **CRLF**: Checks for CRLF injection vulnerabilities ([crlfuzz](https://github.com/dwisiswant0/crlfuzz)).
- **LFI**: Tests for local file inclusion via fuzzing ([ffuf](https://github.com/ffuf/ffuf)).
-- **SSTI**: Detects server-side template injection ([TInjA](https://github.com/Hackmanit/TInjA), with legacy ffuf mode available).
+- **SSTI**: Detects server-side template injection ([TInjA](https://github.com/Hackmanit/TInjA), with optional legacy ffuf mode if explicitly selected).
- **SQLi**: Tests for SQL injection ([SQLMap](https://github.com/sqlmapproject/sqlmap) and [ghauri](https://github.com/r0oth3x49/ghauri)).
- **Broken Links**: Identifies broken links and external references likely to be takeover-prone ([second-order](https://github.com/mhmdiaa/second-order), with legacy katana mode available).
- **Command Injection**: Tests for command injection vulnerabilities ([commix](https://github.com/commixproject/commix)).
-- **Prototype Pollution**: Detects JavaScript prototype pollution ([ppmap](https://github.com/kleiton0x00/ppmap)).
- **HTTP Request Smuggling**: Checks for request smuggling vulnerabilities ([smugglex](https://github.com/hahwul/smugglex)).
- **Web Cache**: Identifies web cache vulnerabilities ([Web-Cache-Vulnerability-Scanner](https://github.com/Hackmanit/Web-Cache-Vulnerability-Scanner) and [toxicache](https://github.com/xhzeem/toxicache)).
- **4XX Bypassing**: Attempts to bypass 4XX responses ([nomore403](https://github.com/devploit/nomore403)).
@@ -562,7 +560,7 @@ SUBSCRAPING=true # Subdomains extraction from passive URLs and live web metadata
SUBPERMUTE=true # DNS permutations
SUBIAPERMUTE=true # Permutations by AI analysis
SUBREGEXPERMUTE=true # Permutations by regex analysis
-PERMUTATIONS_OPTION=gotator # The alternative is "ripgen" (faster, not deeper)
+PERMUTATIONS_ENGINE=gotator # gotator|ripgen|alterx|both (PERMUTATIONS_OPTION is a legacy alias)
GOTATOR_FLAGS=" -depth 1 -numbers 3 -mindup -adv -md" # Flags for gotator
SUBTAKEOVER=true # Check subdomain takeovers, false by default cuz nuclei already check this
SUB_RECURSIVE_PASSIVE=false # Uses a lot of API keys queries
@@ -582,14 +580,21 @@ VIRTUALHOSTS=false # Check virtualhosts by fuzzing HOST header
UNCOMMON_PORTS_WEB="81,300,591,593,832,981,1010,1311,1099,2082,2095,2096,2480,3000,3001,3002,3003,3128,3333,4243,4567,4711,4712,4993,5000,5104,5108,5280,5281,5601,5800,6543,7000,7001,7396,7474,8000,8001,8008,8014,8042,8060,8069,8080,8081,8083,8088,8090,8091,8095,8118,8123,8172,8181,8222,8243,8280,8281,8333,8337,8443,8500,8834,8880,8888,8983,9000,9001,9043,9060,9080,9090,9091,9092,9200,9443,9502,9800,9981,10000,10250,11371,12443,15672,16080,17778,18091,18092,20720,32000,55440,55672"
# Host
-FAVICON=true # Check Favicon domain discovery
FAVIRECON=true # Favicon-based technology recon for discovered web targets
PORTSCANNER=true # Enable or disable the whole Port scanner module
GEO_INFO=true # Fetch Geolocalization info
PORTSCAN_PASSIVE=true # Port scanner with Shodan
PORTSCAN_ACTIVE=true # Port scanner with nmap
-PORTSCAN_ACTIVE_OPTIONS="--top-ports 200 -sV -n -Pn --open --max-retries 2 --script vulners"
+PORTSCAN_ACTIVE_OPTIONS="--top-ports 200 -sV -n -Pn --open --max-retries 2"
+PORTSCAN_DEEP_OPTIONS="--top-ports 1000 -sV -n -Pn --open --max-retries 2 --script vulners"
+PORTSCAN_STRATEGY=legacy # legacy|naabu_nmap
+NAABU_ENABLE=true
+NAABU_RATE=1000
+NAABU_PORTS="--top-ports 1000"
+PORTSCAN_UDP=false
+PORTSCAN_UDP_OPTIONS="--top-ports 20 -sU -sV -n -Pn --open"
CDN_IP=true # Check which IPs belongs to CDN
+CDN_BYPASS=true # Try origin IP discovery on CDN-fronted hosts with hakoriginfinder
# Web analysis
WAF_DETECTION=true # Detect WAFs
@@ -600,6 +605,7 @@ NUCLEI_EXTRA_ARGS="" # Additional nuclei extra flags, don't set the severity her
#NUCLEI_EXTRA_ARGS="-etags openssh,ssl -eid node-express-dev-env,keycloak-xss,CVE-2023-24044,CVE-2021-20323,header-sql,header-reflection" # Additional nuclei extra flags, don't set the severity here but the exclusions like " -etags openssh"
NUCLEI_FLAGS="-silent -retries 2" # Additional nuclei extra flags, don't set the severity here but the exclusions like " -etags openssh"
NUCLEI_FLAGS_JS="-silent -tags exposure,token -severity info,low,medium,high,critical" # Additional nuclei extra flags for js secrets
+NUCLEI_DAST=true # Run additional nuclei -dast module over webs/urls/gf candidates (forced on when VULNS_GENERAL=true, e.g. -a)
URL_CHECK=true # Enable or disable URL collection
URL_CHECK_PASSIVE=true # Search for urls, passive methods from Archive, OTX, CommonCrawl, etc
URL_CHECK_ACTIVE=true # Search for urls by crawling the websites
@@ -609,21 +615,22 @@ URL_GF=true # Url patterns classification
URL_EXT=true # Returns a list of files divided by extension
JSCHECKS=true # JS analysis
FUZZ=true # Web fuzzing
+FUZZ_RECURSION_DEPTH=2 # ffuf recursion depth used in DEEP mode
IIS_SHORTNAME=true
CMS_SCANNER=true # CMS scanner
WORDLIST=true # Wordlist generation
ROBOTSWORDLIST=true # Check historic disallow entries on waybackMachine
PASSWORD_DICT=true # Generate password dictionary
+PASSWORD_DICT_ENGINE=cewl # cewl|pydictor
PASSWORD_MIN_LENGTH=5 # Min password length
PASSWORD_MAX_LENGTH=14 # Max password length
-CLOUDHUNTER_PERMUTATION=NORMAL # Options: DEEP (very slow), NORMAL (slow), NONE
+KATANA_HEADLESS_PROFILE=off # off|smart|full
+CLOUDHUNTER_PERMUTATION=NORMAL # Options: DEEP (very slow), NORMAL (slow), NONE
# Vulns
VULNS_GENERAL=false # Enable or disable the vulnerability module (very intrusive and slow)
XSS=true # Check for xss with dalfox
-CORS=true # CORS misconfigs
TEST_SSL=true # SSL misconfigs
-OPEN_REDIRECT=true # Check open redirects
SSRF_CHECKS=true # SSRF checks
CRLF_CHECKS=true # CRLF checks
LFI=true # LFI by fuzzing
@@ -636,7 +643,6 @@ BROKENLINKS=true # Check for brokenlinks
BROKENLINKS_ENGINE="second-order" # Broken links engine: second-order|legacy
SPRAY=true # Performs password spraying
COMM_INJ=true # Check for command injections with commix
-PROTO_POLLUTION=true # Check for prototype pollution flaws
SMUGGLING=true # Check for HTTP request smuggling flaws
WEBCACHE=true # Check for Web Cache issues
WEBCACHE_TOXICACHE=true # Complement web cache checks with toxicache
diff --git a/Terraform/files/reconftw.cfg b/Terraform/files/reconftw.cfg
index 4d020d1..30c625d 100644
--- a/Terraform/files/reconftw.cfg
+++ b/Terraform/files/reconftw.cfg
@@ -64,7 +64,8 @@ SUBBRUTE=true # DNS bruteforcing
SUBSCRAPING=true # Subdomains extraction from web crawling
SUBPERMUTE=true # DNS permutations
SUBREGEXPERMUTE=true # Permutations by regex analysis
-PERMUTATIONS_OPTION=gotator # The alternative is "ripgen" (faster, not deeper)
+PERMUTATIONS_ENGINE=gotator # gotator|ripgen|alterx|both
+PERMUTATIONS_OPTION="" # Legacy alias (deprecated)
GOTATOR_FLAGS=" -depth 1 -numbers 3 -mindup -adv -md" # Flags for gotator
SUBTAKEOVER=true # Check subdomain takeovers, false by default cuz nuclei already check this
SUB_RECURSIVE_PASSIVE=false # Uses a lot of API keys queries
@@ -84,11 +85,16 @@ VIRTUALHOSTS=false # Check virtualhosts by fuzzing HOST header
UNCOMMON_PORTS_WEB="81,300,591,593,832,981,1010,1311,1099,2082,2095,2096,2480,3000,3001,3002,3003,3128,3333,4243,4567,4711,4712,4993,5000,5104,5108,5280,5281,5601,5800,6543,7000,7001,7396,7474,8000,8001,8008,8014,8042,8060,8069,8080,8081,8083,8088,8090,8091,8095,8118,8123,8172,8181,8222,8243,8280,8281,8333,8337,8443,8500,8834,8880,8888,8983,9000,9001,9043,9060,9080,9090,9091,9092,9200,9443,9502,9800,9981,10000,10250,11371,12443,15672,16080,17778,18091,18092,20720,32000,55440,55672"
# Host
-FAVICON=true # Check Favicon domain discovery
-PORTSCANNER=true # Enable or disable the whole Port scanner module
-PORTSCAN_PASSIVE=true # Port scanner with Shodan
-PORTSCAN_ACTIVE=true # Port scanner with nmap
-CDN_IP=true # Check which IPs belongs to CDN
+PORTSCANNER=true # Enable or disable the whole Port scanner module
+PORTSCAN_PASSIVE=true # Port scanner with Shodan
+PORTSCAN_ACTIVE=true # Port scanner with nmap
+PORTSCAN_STRATEGY=legacy # legacy|naabu_nmap
+NAABU_ENABLE=true # Use naabu pre-discovery when strategy is naabu_nmap
+NAABU_RATE=1000
+NAABU_PORTS="--top-ports 1000"
+PORTSCAN_UDP=false
+PORTSCAN_UDP_OPTIONS="--top-ports 20 -sU -sV -n -Pn --open"
+CDN_IP=true # Check which IPs belongs to CDN
# Web analysis
WAF_DETECTION=true # Detect WAFs
@@ -114,10 +120,8 @@ PASSWORD_MAX_LENGTH=14 # Max password length
# Vulns
VULNS_GENERAL=false # Enable or disable the vulnerability module (very intrusive and slow)
XSS=true # Check for xss with dalfox
-CORS=true # CORS misconfigs
-TEST_SSL=true # SSL misconfigs
-OPEN_REDIRECT=true # Check open redirects
-SSRF_CHECKS=true # SSRF checks
+TEST_SSL=true # SSL misconfigs
+SSRF_CHECKS=true # SSRF checks
CRLF_CHECKS=true # CRLF checks
LFI=true # LFI by fuzzing
SSTI=true # SSTI by fuzzing
@@ -126,11 +130,10 @@ SQLMAP=true # Check SQLI with sqlmap
GHAURI=false # Check SQLI with ghauri
BROKENLINKS=true # Check for brokenlinks
SPRAY=true # Performs password spraying
-COMM_INJ=true # Check for command injections with commix
-PROTO_POLLUTION=true # Check for prototype pollution flaws
-SMUGGLING=true # Check for HTTP request smuggling flaws
-WEBCACHE=true # Check for Web Cache issues
-BYPASSER4XX=true # Check for 4XX bypasses
+COMM_INJ=true # Check for command injections with commix
+SMUGGLING=true # Check for HTTP request smuggling flaws
+WEBCACHE=true # Check for Web Cache issues
+BYPASSER4XX=true # Check for 4XX bypasses
FUZZPARAMS=true # Fuzz parameters values
# Extra features
diff --git a/config/reconftw_full.cfg b/config/reconftw_full.cfg
index 2f14c40..3b81f60 100644
--- a/config/reconftw_full.cfg
+++ b/config/reconftw_full.cfg
@@ -43,13 +43,14 @@ WEBPROBESIMPLE=true
WEBPROBEFULL=true
WEBSCREENSHOT=true
VIRTUALHOSTS=true
-FAVICON=true
FAVIRECON=true
# Host
PORTSCANNER=true
PORTSCAN_PASSIVE=true
PORTSCAN_ACTIVE=true
+PORTSCAN_STRATEGY=naabu_nmap
+NAABU_ENABLE=true
CDN_IP=true
WAF_DETECTION=true
GEO_INFO=true
@@ -75,9 +76,7 @@ PASSWORD_DICT=true
# Vulnerabilities: all enabled
VULNS_GENERAL=true
XSS=true
-CORS=true
TEST_SSL=true
-OPEN_REDIRECT=true
SSRF_CHECKS=true
CRLF_CHECKS=true
LFI=true
@@ -90,12 +89,12 @@ BROKENLINKS=true
BROKENLINKS_ENGINE="second-order"
SPRAY=true
COMM_INJ=true
-PROTO_POLLUTION=true
SMUGGLING=true
WEBCACHE=true
WEBCACHE_TOXICACHE=true
BYPASSER4XX=true
FUZZPARAMS=true
+NUCLEI_DAST=true
# Extras
NUCLEICHECK=true
diff --git a/config/reconftw_quick.cfg b/config/reconftw_quick.cfg
index a9e4116..8a577fb 100644
--- a/config/reconftw_quick.cfg
+++ b/config/reconftw_quick.cfg
@@ -40,9 +40,7 @@ PASSWORD_DICT=false
# Disable all vulnerability checks
VULNS_GENERAL=false
XSS=false
-CORS=false
TEST_SSL=false
-OPEN_REDIRECT=false
SSRF_CHECKS=false
CRLF_CHECKS=false
LFI=false
@@ -53,14 +51,14 @@ GHAURI=false
BROKENLINKS=false
SPRAY=false
COMM_INJ=false
-PROTO_POLLUTION=false
SMUGGLING=false
WEBCACHE=false
BYPASSER4XX=false
FUZZPARAMS=false
+NUCLEI_DAST=false
WEBCACHE_TOXICACHE=false
BROKENLINKS_ENGINE="legacy"
-SSTI_ENGINE="legacy"
+SSTI_ENGINE="tinja"
# Disable heavy extras
GRAPHQL_CHECK=false
diff --git a/config/reconftw_stealth.cfg b/config/reconftw_stealth.cfg
index 245fdcf..3dd6841 100644
--- a/config/reconftw_stealth.cfg
+++ b/config/reconftw_stealth.cfg
@@ -46,7 +46,6 @@ WEBSCREENSHOT=false
VIRTUALHOSTS=false
# Host: passive only
-FAVICON=false
FAVIRECON=false
PORTSCANNER=true
PORTSCAN_PASSIVE=true
@@ -76,9 +75,7 @@ PASSWORD_DICT=false
# No vulnerability scanning
VULNS_GENERAL=false
XSS=false
-CORS=false
TEST_SSL=false
-OPEN_REDIRECT=false
SSRF_CHECKS=false
CRLF_CHECKS=false
LFI=false
@@ -89,14 +86,14 @@ GHAURI=false
BROKENLINKS=false
SPRAY=false
COMM_INJ=false
-PROTO_POLLUTION=false
SMUGGLING=false
WEBCACHE=false
BYPASSER4XX=false
FUZZPARAMS=false
+NUCLEI_DAST=false
WEBCACHE_TOXICACHE=false
BROKENLINKS_ENGINE="legacy"
-SSTI_ENGINE="legacy"
+SSTI_ENGINE="tinja"
# Nuclei: only safe templates
NUCLEICHECK=true
diff --git a/config/ssrf_payloads.txt b/config/ssrf_payloads.txt
new file mode 100644
index 0000000..1e2eb3b
--- /dev/null
+++ b/config/ssrf_payloads.txt
@@ -0,0 +1,43 @@
+# reconFTW - SSRF alternate-protocol payloads
+#
+# Used by: modules/vulns.sh:ssrf_checks()
+# Syntax:
+# - One payload per line.
+# - Lines starting with '#' are comments.
+# - Placeholders:
+# - {COLLAB} -> callback token/host (no scheme)
+# - {COLLAB_URL} -> callback URL with scheme
+#
+# Notes:
+# - These payloads are best-effort and may not apply to all SSRF sinks.
+# - Matching is controlled via SSRF_ALT_MATCH_REGEX in reconftw.cfg.
+
+# AWS IMDSv1
+http://169.254.169.254/latest/meta-data/
+http://169.254.169.254/latest/meta-data/iam/security-credentials/
+
+# AWS IMDSv2 hint (some sinks ignore headers; still useful for response matching)
+http://169.254.169.254/latest/api/token
+
+# GCP metadata (common)
+http://metadata.google.internal/computeMetadata/v1/
+http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/default/token
+
+# Azure IMDS
+http://169.254.169.254/metadata/instance?api-version=2021-02-01
+
+# Local file (rare, but high impact)
+file:///etc/passwd
+
+# Loopback/common local panels
+http://127.0.0.1/
+http://localhost/
+
+# Alternate protocols (support varies by client libraries)
+gopher://127.0.0.1:80/_
+dict://127.0.0.1:11211/stats
+
+# Callback-based alternates (when sink allows non-http scheme)
+gopher://{COLLAB}:80/_
+dict://{COLLAB}:11211/stats
+
diff --git a/install.sh b/install.sh
index eff8dc2..13c3d29 100755
--- a/install.sh
+++ b/install.sh
@@ -214,6 +214,7 @@ declare -A gotools=(
["interactsh-client"]="go install -v github.com/projectdiscovery/interactsh/cmd/interactsh-client@latest"
["analyticsrelationships"]="go install -v github.com/Josue87/analyticsrelationships@latest"
["gotator"]="go install -v github.com/Josue87/gotator@latest"
+ ["alterx"]="go install -v github.com/projectdiscovery/alterx/cmd/alterx@latest"
["roboxtractor"]="go install -v github.com/Josue87/roboxtractor@latest"
["mapcidr"]="go install -v github.com/projectdiscovery/mapcidr/cmd/mapcidr@latest"
["cdncheck"]="go install -v github.com/projectdiscovery/cdncheck/cmd/cdncheck@latest"
@@ -231,9 +232,9 @@ declare -A gotools=(
["crt"]="go install -v github.com/cemulus/crt@latest"
["s3scanner"]="go install -v github.com/sa7mon/s3scanner@latest"
["nmapurls"]="go install -v github.com/sdcampbell/nmapurls@latest"
+ ["naabu"]="go install -v github.com/projectdiscovery/naabu/v2/cmd/naabu@latest"
["shortscan"]="go install -v github.com/bitquark/shortscan/cmd/shortscan@latest"
- ["sns"]="go install github.com/sw33tLie/sns@latest"
- ["ppmap"]="go install -v github.com/kleiton0x00/ppmap@latest"
+ ["hakoriginfinder"]="go install -v github.com/hakluke/hakoriginfinder@latest"
["sourcemapper"]="go install -v github.com/denandz/sourcemapper@latest"
["jsluice"]="go install -v github.com/BishopFox/jsluice/cmd/jsluice@latest"
["urlfinder"]="go install -v github.com/projectdiscovery/urlfinder/cmd/urlfinder@latest"
@@ -246,6 +247,7 @@ declare -A gotools=(
["favirecon"]="go install -v github.com/edoardottt/favirecon/cmd/favirecon@latest"
["second-order"]="go install -v github.com/mhmdiaa/second-order@latest"
["tinja"]="go install -v github.com/Hackmanit/TInjA@latest"
+ ["cewl"]="gem install cewl --no-document"
)
# Declare pipx tools and their paths
@@ -273,16 +275,12 @@ declare -A repos=(
["gf"]="tomnomnom/gf"
["Gf-Patterns"]="1ndianl33t/Gf-Patterns"
["sus_params"]="g0ldencybersec/sus_params"
- ["Corsy"]="s0md3v/Corsy"
["CMSeeK"]="Tuhinshubhra/CMSeeK"
- ["fav-up"]="pielco11/fav-up"
["massdns"]="blechschmidt/massdns"
- ["Oralyzer"]="r0075h3ll/Oralyzer"
["testssl.sh"]="drwetter/testssl.sh"
["JSA"]="w9w/JSA"
["CloudHunter"]="belane/CloudHunter"
["ultimate-nmap-parser"]="shifty0g/ultimate-nmap-parser"
- ["pydictor"]="LandGrey/pydictor"
["gitdorks_go"]="damit5/gitdorks_go"
["Web-Cache-Vulnerability-Scanner"]="Hackmanit/Web-Cache-Vulnerability-Scanner"
["regulator"]="cramppet/regulator"
diff --git a/lib/parallel.sh b/lib/parallel.sh
index bb6f210..64f71d0 100644
--- a/lib/parallel.sh
+++ b/lib/parallel.sh
@@ -782,9 +782,10 @@ parallel_injection_vulns() {
# Usage: parallel_server_vulns
parallel_server_vulns() {
local funcs=(
+ "crlf_checks"
+ "xss"
"ssrf_checks"
- "prototype_pollution"
- "smuggling"
+ "lfi"
)
if [[ "${OUTPUT_VERBOSITY:-1}" -ge 2 ]]; then
@@ -792,7 +793,7 @@ parallel_server_vulns() {
"${bblue:-}" "${#funcs[@]}" "${reset:-}"
fi
- parallel_funcs "${PAR_VULNS_GROUP3_SIZE:-3}" "${funcs[@]}"
+ parallel_funcs "${PAR_VULNS_GROUP1_SIZE:-4}" "${funcs[@]}"
}
###############################################################################
diff --git a/modules/core.sh b/modules/core.sh
index 988bb80..e299987 100644
--- a/modules/core.sh
+++ b/modules/core.sh
@@ -165,8 +165,6 @@ function check_version() {
function tools_installed() {
local all_installed=true
local missing_tools=()
- local tools_start
- tools_start=$(date +%s)
# Check environment variables
local env_vars=("GOPATH" "GOROOT" "PATH")
@@ -182,10 +180,6 @@ function tools_installed() {
declare -A tools_files=(
["dorks_hunter"]="${tools}/dorks_hunter/dorks_hunter.py"
["dorks_hunter_python"]="${tools}/dorks_hunter/venv/bin/python3"
- ["fav-up"]="${tools}/fav-up/favUp.py"
- ["fav-up_python"]="${tools}/fav-up/venv/bin/python3"
- ["Corsy"]="${tools}/Corsy/corsy.py"
- ["Corsy_python"]="${tools}/Corsy/venv/bin/python3"
["testssl.sh"]="${tools}/testssl.sh/testssl.sh"
["CMSeeK"]="${tools}/CMSeeK/cmseek.py"
["CMSeeK_python"]="${tools}/CMSeeK/venv/bin/python3"
@@ -202,7 +196,6 @@ function tools_installed() {
["CloudHunter"]="${tools}/CloudHunter/cloudhunter.py"
["CloudHunter_python"]="${tools}/CloudHunter/venv/bin/python3"
["nmap-parse-output"]="${tools}/ultimate-nmap-parser/ultimate-nmap-parser.sh"
- ["pydictor"]="${tools}/pydictor/pydictor.py"
["regulator"]="${tools}/regulator/main.py"
["regulator_python"]="${tools}/regulator/venv/bin/python3"
["nomore403"]="${tools}/nomore403/nomore403"
@@ -214,8 +207,6 @@ function tools_installed() {
["postleaksNg"]="${tools}/postleaksNg/.venv/bin/postleaksNg"
["LeakSearch"]="${tools}/LeakSearch/LeakSearch.py"
["LeakSearch_python"]="${tools}/LeakSearch/venv/bin/python3"
- ["Oralyzer"]="${tools}/Oralyzer/oralyzer.py"
- ["Oralyzer_python"]="${tools}/Oralyzer/venv/bin/python3"
["msftrecon"]="${tools}/msftrecon/msftrecon/msftrecon.py"
["msftrecon_python"]="${tools}/msftrecon/venv/bin/python3"
["Scopify"]="${tools}/Scopify/scopify.py"
@@ -271,7 +262,6 @@ function tools_installed() {
["puredns"]="puredns"
["analyticsrelationships"]="analyticsrelationships"
["mapcidr"]="mapcidr"
- ["ppmap"]="ppmap"
["cdncheck"]="cdncheck"
["interactsh-client"]="interactsh-client"
["tlsx"]="tlsx"
@@ -292,9 +282,12 @@ function tools_installed() {
["s3scanner"]="s3scanner"
["mantra"]="mantra"
["nmapurls"]="nmapurls"
+ ["naabu"]="naabu"
+ ["alterx"]="alterx"
["porch-pirate"]="porch-pirate"
["shortscan"]="shortscan"
- ["sns"]="sns"
+ ["cewl"]="cewl"
+ ["hakoriginfinder"]="hakoriginfinder"
["sourcemapper"]="sourcemapper"
["jsluice"]="jsluice"
["commix"]="commix"
@@ -341,10 +334,6 @@ function tools_installed() {
fi
done
- local tools_end
- tools_end=$(date +%s)
- local tools_dur=$((tools_end - tools_start))
-
if [[ $all_installed == true ]]; then
: # Tools check OK, no output
else
@@ -376,23 +365,20 @@ function check_critical_dependencies() {
)
local missing_critical=()
- local all_critical_ok=true
- local dep_start
- dep_start=$(date +%s)
for item in "${critical_tools[@]}"; do
local tool="${item%%:*}"
if ! command -v "$tool" >/dev/null 2>&1; then
missing_critical+=("$tool")
- all_critical_ok=false
fi
done
- local dep_end
- dep_end=$(date +%s)
- local dep_dur=$((dep_end - dep_start))
-
+ if (( ${#missing_critical[@]} > 0 )); then
+ _print_msg WARN "Missing critical dependencies: ${missing_critical[*]}"
+ return 1
+ fi
+ return 0
}
@@ -708,6 +694,35 @@ _hash_string() {
fi
}
+_monitor_severity_rank() {
+ case "${1,,}" in
+ critical) echo 5 ;;
+ high) echo 4 ;;
+ medium) echo 3 ;;
+ low) echo 2 ;;
+ info) echo 1 ;;
+ *) echo 0 ;;
+ esac
+}
+
+_monitor_selected_severities() {
+ local min_sev="${MONITOR_MIN_SEVERITY:-high}"
+ local min_rank
+ min_rank=$(_monitor_severity_rank "$min_sev")
+ if [[ "$min_rank" -eq 0 ]]; then
+ log_note "monitor: invalid MONITOR_MIN_SEVERITY='${min_sev}', defaulting to high" "${FUNCNAME[0]}" "${LINENO}"
+ min_rank=4
+ fi
+
+ local sev rank
+ for sev in critical high medium low info; do
+ rank=$(_monitor_severity_rank "$sev")
+ if ((rank >= min_rank)); then
+ printf '%s\n' "$sev"
+ fi
+ done
+}
+
_monitor_mark_alert_seen() {
local category="$1"
local value="$2"
@@ -726,22 +741,37 @@ _monitor_mark_alert_seen() {
_monitor_alert_summary() {
local snap="$1"
- local critical_u=0 high_u=0 subs_u=0 webs_u=0
- local critical_s=0 high_s=0 subs_s=0 webs_s=0
+ local critical_u=0 high_u=0 medium_u=0 low_u=0 info_u=0
+ local critical_s=0 high_s=0 medium_s=0 low_s=0 info_s=0
+ local nuclei_u=0 nuclei_s=0 subs_u=0 webs_u=0 subs_s=0 webs_s=0
local line
- if [[ -s "$snap/critical_new.txt" ]]; then
- while IFS= read -r line; do
- [[ -z "$line" ]] && continue
- if _monitor_mark_alert_seen "critical" "$line"; then ((critical_u++)); else ((critical_s++)); fi
- done <"$snap/critical_new.txt"
- fi
- if [[ -s "$snap/high_new.txt" ]]; then
- while IFS= read -r line; do
- [[ -z "$line" ]] && continue
- if _monitor_mark_alert_seen "high" "$line"; then ((high_u++)); else ((high_s++)); fi
- done <"$snap/high_new.txt"
- fi
+ local sev
+ while IFS= read -r sev; do
+ [[ -z "$sev" ]] && continue
+ local sev_u=0 sev_s=0
+ local sev_file="$snap/${sev}_new.txt"
+ if [[ -s "$sev_file" ]]; then
+ while IFS= read -r line; do
+ [[ -z "$line" ]] && continue
+ if _monitor_mark_alert_seen "$sev" "$line"; then
+ ((sev_u++))
+ else
+ ((sev_s++))
+ fi
+ done <"$sev_file"
+ fi
+ case "$sev" in
+ critical) critical_u=$sev_u; critical_s=$sev_s ;;
+ high) high_u=$sev_u; high_s=$sev_s ;;
+ medium) medium_u=$sev_u; medium_s=$sev_s ;;
+ low) low_u=$sev_u; low_s=$sev_s ;;
+ info) info_u=$sev_u; info_s=$sev_s ;;
+ esac
+ nuclei_u=$((nuclei_u + sev_u))
+ nuclei_s=$((nuclei_s + sev_s))
+ done < <(_monitor_selected_severities)
+
if [[ -s "$snap/subdomains_new.txt" ]]; then
while IFS= read -r line; do
[[ -z "$line" ]] && continue
@@ -759,26 +789,44 @@ _monitor_alert_summary() {
jq -n \
--arg ts "$(date -Iseconds)" \
--arg cycle "${MONITOR_CYCLE:-0}" \
+ --arg min_sev "${MONITOR_MIN_SEVERITY:-high}" \
+ --argjson nuclei_new "$nuclei_u" \
--argjson critical_new "$critical_u" \
--argjson high_new "$high_u" \
+ --argjson medium_new "$medium_u" \
+ --argjson low_new "$low_u" \
+ --argjson info_new "$info_u" \
--argjson subdomains_new "$subs_u" \
--argjson webs_new "$webs_u" \
+ --argjson nuclei_suppressed "$nuclei_s" \
--argjson critical_suppressed "$critical_s" \
--argjson high_suppressed "$high_s" \
+ --argjson medium_suppressed "$medium_s" \
+ --argjson low_suppressed "$low_s" \
+ --argjson info_suppressed "$info_s" \
--argjson subdomains_suppressed "$subs_s" \
--argjson webs_suppressed "$webs_s" \
'{
timestamp:$ts,
cycle:($cycle|tonumber),
+ monitor_min_severity:$min_sev,
alerts:{
+ nuclei_new:$nuclei_new,
critical_new:$critical_new,
high_new:$high_new,
+ medium_new:$medium_new,
+ low_new:$low_new,
+ info_new:$info_new,
subdomains_new:$subdomains_new,
webs_new:$webs_new
},
suppressed:{
+ nuclei:$nuclei_suppressed,
critical:$critical_suppressed,
high:$high_suppressed,
+ medium:$medium_suppressed,
+ low:$low_suppressed,
+ info:$info_suppressed,
subdomains:$subdomains_suppressed,
webs:$webs_suppressed
}
@@ -786,8 +834,8 @@ _monitor_alert_summary() {
fi
printf '%s %s %s %s %s %s %s %s\n' \
- "$critical_u" "$high_u" "$subs_u" "$webs_u" \
- "$critical_s" "$high_s" "$subs_s" "$webs_s"
+ "$nuclei_u" "$subs_u" "$webs_u" "$nuclei_s" \
+ "$subs_s" "$webs_s" "$critical_u" "$high_u"
}
# Monitor snapshots and delta tracking.
@@ -806,14 +854,20 @@ function monitor_snapshot() {
for src in \
"subdomains/subdomains.txt" \
"webs/webs_all.txt" \
- "nuclei_output/high.txt" \
- "nuclei_output/critical.txt" \
"report/report.json" \
"hotlist.txt"; do
if [[ -s "$src" ]]; then
cp "$src" "$snap/$(basename "$src")"
fi
done
+ local -a monitor_severities=()
+ mapfile -t monitor_severities < <(_monitor_selected_severities)
+ local sev
+ for sev in "${monitor_severities[@]}"; do
+ if [[ -s "nuclei_output/${sev}.txt" ]]; then
+ cp "nuclei_output/${sev}.txt" "$snap/${sev}.txt"
+ fi
+ done
prev_link=".incremental/history/latest"
prev_dir=""
@@ -821,7 +875,9 @@ function monitor_snapshot() {
prev_dir=$(cd "$prev_link" 2>/dev/null && pwd -P || true)
fi
- local subs_new=0 webs_new=0 high_new=0 critical_new=0 delta_total=0
+ local subs_new=0 webs_new=0
+ local critical_new=0 high_new=0 medium_new=0 low_new=0 info_new=0
+ local nuclei_new_total=0 delta_total=0
if [[ -n "$prev_dir" ]]; then
if [[ -s "$snap/subdomains.txt" ]] && [[ -s "$prev_dir/subdomains.txt" ]]; then
comm -13 <(sort -u "$prev_dir/subdomains.txt") <(sort -u "$snap/subdomains.txt") >"$snap/subdomains_new.txt"
@@ -831,46 +887,72 @@ function monitor_snapshot() {
comm -13 <(sort -u "$prev_dir/webs_all.txt") <(sort -u "$snap/webs_all.txt") >"$snap/webs_new.txt"
webs_new=$(wc -l <"$snap/webs_new.txt" 2>/dev/null | tr -d ' ')
fi
- if [[ -s "$snap/high.txt" ]] && [[ -s "$prev_dir/high.txt" ]]; then
- comm -13 <(sort -u "$prev_dir/high.txt") <(sort -u "$snap/high.txt") >"$snap/high_new.txt"
- high_new=$(wc -l <"$snap/high_new.txt" 2>/dev/null | tr -d ' ')
- fi
- if [[ -s "$snap/critical.txt" ]] && [[ -s "$prev_dir/critical.txt" ]]; then
- comm -13 <(sort -u "$prev_dir/critical.txt") <(sort -u "$snap/critical.txt") >"$snap/critical_new.txt"
- critical_new=$(wc -l <"$snap/critical_new.txt" 2>/dev/null | tr -d ' ')
- fi
+ for sev in "${monitor_severities[@]}"; do
+ local sev_new_file="$snap/${sev}_new.txt"
+ local sev_count=0
+ if [[ -s "$snap/${sev}.txt" ]] && [[ -s "$prev_dir/${sev}.txt" ]]; then
+ comm -13 <(sort -u "$prev_dir/${sev}.txt") <(sort -u "$snap/${sev}.txt") >"$sev_new_file"
+ sev_count=$(wc -l <"$sev_new_file" 2>/dev/null | tr -d ' ')
+ fi
+ case "$sev" in
+ critical) critical_new=$sev_count ;;
+ high) high_new=$sev_count ;;
+ medium) medium_new=$sev_count ;;
+ low) low_new=$sev_count ;;
+ info) info_new=$sev_count ;;
+ esac
+ nuclei_new_total=$((nuclei_new_total + sev_count))
+ done
else
# Baseline cycle: don't alert as "new", just record baseline.
subs_new=0
webs_new=0
- high_new=0
critical_new=0
+ high_new=0
+ medium_new=0
+ low_new=0
+ info_new=0
+ nuclei_new_total=0
fi
subs_new=${subs_new:-0}
webs_new=${webs_new:-0}
- high_new=${high_new:-0}
critical_new=${critical_new:-0}
- delta_total=$((subs_new + webs_new + high_new + critical_new))
+ high_new=${high_new:-0}
+ medium_new=${medium_new:-0}
+ low_new=${low_new:-0}
+ info_new=${info_new:-0}
+ nuclei_new_total=${nuclei_new_total:-0}
+ delta_total=$((subs_new + webs_new + nuclei_new_total))
if command -v jq >/dev/null 2>&1; then
jq -n \
--arg ts "$(date -Iseconds)" \
--arg cycle "${MONITOR_CYCLE:-0}" \
--arg baseline "$( [[ -z "$prev_dir" ]] && echo true || echo false )" \
+ --arg min_sev "${MONITOR_MIN_SEVERITY:-high}" \
--argjson subs_new "$subs_new" \
--argjson webs_new "$webs_new" \
- --argjson high_new "$high_new" \
--argjson critical_new "$critical_new" \
+ --argjson high_new "$high_new" \
+ --argjson medium_new "$medium_new" \
+ --argjson low_new "$low_new" \
+ --argjson info_new "$info_new" \
+ --argjson nuclei_new_total "$nuclei_new_total" \
--argjson total_new "$delta_total" \
'{
timestamp:$ts,
cycle:($cycle|tonumber),
baseline:($baseline=="true"),
+ monitor_min_severity:$min_sev,
deltas:{
subdomains_new:$subs_new,
webs_new:$webs_new,
high_findings_new:$high_new,
critical_findings_new:$critical_new,
+ medium_findings_new:$medium_new,
+ low_findings_new:$low_new,
+ info_findings_new:$info_new,
+ nuclei_findings_new_total:$nuclei_new_total,
total_new:$total_new
}
}' >"$snap/delta.json"
@@ -879,17 +961,20 @@ function monitor_snapshot() {
if [[ -z "$prev_dir" ]]; then
notification "Monitor baseline snapshot stored (${snap})" info
elif [[ "$delta_total" -gt 0 ]]; then
- local alert_stats critical_u high_u subs_u webs_u critical_s high_s subs_s webs_s
+ local alert_stats nuclei_u subs_u webs_u nuclei_s subs_s webs_s critical_u high_u
alert_stats=$(_monitor_alert_summary "$snap")
- read -r critical_u high_u subs_u webs_u critical_s high_s subs_s webs_s <<<"$alert_stats"
+ read -r nuclei_u subs_u webs_u nuclei_s subs_s webs_s critical_u high_u <<<"$alert_stats"
+ if [[ "${nuclei_u:-0}" -gt 0 ]]; then
+ notification "[ALERT] New nuclei findings (>=${MONITOR_MIN_SEVERITY:-high}): ${nuclei_u:-0}" warn
+ fi
if [[ "${critical_u:-0}" -gt 0 || "${high_u:-0}" -gt 0 ]]; then
notification "[ALERT] New high-impact findings: critical=${critical_u:-0}, high=${high_u:-0}" warn
fi
if [[ "${subs_u:-0}" -gt 0 || "${webs_u:-0}" -gt 0 ]]; then
notification "New assets detected: subdomains=${subs_u:-0}, webs=${webs_u:-0}" good
fi
- if [[ "${critical_u:-0}" -eq 0 && "${high_u:-0}" -eq 0 && "${subs_u:-0}" -eq 0 && "${webs_u:-0}" -eq 0 ]]; then
+ if [[ "${nuclei_u:-0}" -eq 0 && "${subs_u:-0}" -eq 0 && "${webs_u:-0}" -eq 0 ]]; then
notification "Monitor detected deltas but all were suppressed by fingerprint history" info
fi
else
@@ -1144,7 +1229,7 @@ function end_func() {
warn|WARN) badge="WARN" ;;
error|ERROR) badge="FAIL" ;;
good|SUCCESS) badge="OK" ;;
- OK|WARN|FAIL|SKIP|CACHE) badge="$status" ;;
+ OK|FAIL|SKIP|CACHE) badge="$status" ;;
SKIP_CONFIG) badge="SKIP"; reason_code="config" ;;
SKIP_NOINPUT) badge="SKIP"; reason_code="noinput" ;;
CACHE_HIT) badge="CACHE"; reason_code="cache" ;;
diff --git a/modules/modes.sh b/modules/modes.sh
index 3566978..5f8dbef 100644
--- a/modules/modes.sh
+++ b/modules/modes.sh
@@ -114,8 +114,10 @@ function start() {
# Initialize structured logging if enabled
log_init
- # Reset incidents for this run
+ # Reset incidents for this run (global arrays consumed by lib/common.sh helpers)
+ # shellcheck disable=SC2034
INCIDENTS_LEVELS=()
+ # shellcheck disable=SC2034
INCIDENTS_ITEMS=()
# Initialize cache for wordlists/resolvers
@@ -372,12 +374,14 @@ function build_hotlist() {
[[ -s $s ]] || continue
while read -r h; do score["$h"]=$((${score["$h"]:-0} + 6)); done < <(awk '{print $1}' "$s")
done
- # Real IPs via favicon
- if [[ -s hosts/favicontest.txt ]]; then
- while read -r ip; do
- [[ -z $ip ]] && continue
- score["$ip"]=$((${score["$ip"]:-0} + 4))
- done <hosts/favicontest.txt
+ # Favicon technology fingerprints (favirecon)
+ if [[ -s webs/favirecon.txt ]]; then
+ while read -r line; do
+ [[ -z $line ]] && continue
+ host=$(printf '%s' "$line" | awk '{print $1}' | awk -F/ '{print $3}' | sed 's/:.*$//')
+ [[ -z $host ]] && continue
+ score["$host"]=$((${score["$host"]:-0} + 4))
+ done <webs/favirecon.txt
fi
# New assets bonus
for p in .tmp/subs_new_only.txt webs/url_extract.txt; do
@@ -441,7 +445,6 @@ function passive() {
_print_section "Web Detection"
- favicon
cdnprovider
# shellcheck disable=SC2034 # PORTSCAN_ACTIVE controls scan behavior
PORTSCAN_ACTIVE=false
@@ -473,7 +476,6 @@ function osint() {
apileaks
third_party_misconfigs
zonetransfer
- favicon
mail_hygiene
cloud_enum_scan
}
@@ -484,7 +486,7 @@ function vulns() {
if [[ "${PARALLEL_MODE:-true}" == "true" ]] && declare -f parallel_funcs &>/dev/null; then
# Parallel execution - group independent checks
[[ "${OUTPUT_VERBOSITY:-1}" -ge 2 ]] && printf "%b[*] Running vulnerability checks in parallel mode%b\n" "$bblue" "$reset"
- parallel_funcs "${PAR_VULNS_GROUP1_SIZE:-4}" cors open_redirect crlf_checks xss
+ parallel_funcs "${PAR_VULNS_GROUP1_SIZE:-4}" crlf_checks xss ssrf_checks lfi
local vulns_g1_rc=$?
if ((vulns_g1_rc > 0)); then
if [[ "${CONTINUE_ON_TOOL_ERROR:-true}" == "true" ]]; then
@@ -495,7 +497,7 @@ function vulns() {
return 1
fi
fi
- parallel_funcs "${PAR_VULNS_GROUP2_SIZE:-4}" ssrf_checks lfi ssti sqli
+ parallel_funcs "${PAR_VULNS_GROUP2_SIZE:-4}" ssti sqli command_injection smuggling
local vulns_g2_rc=$?
if ((vulns_g2_rc > 0)); then
if [[ "${CONTINUE_ON_TOOL_ERROR:-true}" == "true" ]]; then
@@ -506,17 +508,6 @@ function vulns() {
return 1
fi
fi
- parallel_funcs "${PAR_VULNS_GROUP3_SIZE:-3}" command_injection prototype_pollution smuggling
- local vulns_g3_rc=$?
- if ((vulns_g3_rc > 0)); then
- if [[ "${CONTINUE_ON_TOOL_ERROR:-true}" == "true" ]]; then
- RECON_PARTIAL_RUN=true
- notification "Parallel vulns group 3 completed with ${vulns_g3_rc} warning(s); continuing" warn
- else
- notification "Parallel vulns batch failed (group 3)" error
- return 1
- fi
- fi
parallel_funcs "${PAR_VULNS_GROUP4_SIZE:-3}" webcache spraying brokenLinks
local vulns_g4_rc=$?
if ((vulns_g4_rc > 0)); then
@@ -529,24 +520,23 @@ function vulns() {
fi
fi
fuzzparams
+ nuclei_dast
4xxbypass
test_ssl
else
- cors
- open_redirect
- ssrf_checks
crlf_checks
+ xss
+ ssrf_checks
lfi
ssti
sqli
- xss
command_injection
- prototype_pollution
smuggling
webcache
spraying
brokenLinks
fuzzparams
+ nuclei_dast
4xxbypass
test_ssl
fi
@@ -616,7 +606,6 @@ function multi_osint() {
apileaks
third_party_misconfigs
zonetransfer
- favicon
done <"$list"
cd "$workdir" || {
print_errorf "Failed to cd directory '%s' in %s @ line %s" "$workdir" "${FUNCNAME[0]}" "${LINENO}"
@@ -645,8 +634,8 @@ function recon() {
RECON_PARTIAL_RUN=true
RECON_OSINT_PARALLEL_FAILURES=$((RECON_OSINT_PARALLEL_FAILURES + osint_g1_rc))
fi
- # Group 2: remaining OSINT + zonetransfer + favicon (were sequential, now parallel)
- parallel_funcs "${PAR_OSINT_GROUP2_SIZE:-5}" github_repos metadata apileaks zonetransfer favicon
+ # Group 2: remaining OSINT + zonetransfer
+ parallel_funcs "${PAR_OSINT_GROUP2_SIZE:-4}" github_repos metadata apileaks zonetransfer
local osint_g2_rc=$?
if ((osint_g2_rc > 0)); then
RECON_PARTIAL_RUN=true
@@ -663,7 +652,6 @@ function recon() {
apileaks
third_party_misconfigs
zonetransfer
- favicon
fi
ui_module_end "OSINT" "osint/dorks.txt" "osint/emails.txt" "osint/domain_info.txt"
@@ -843,7 +831,6 @@ function multi_recon() {
apileaks
third_party_misconfigs
zonetransfer
- favicon
currently=$(date +"%H:%M:%S")
loopend=$(date +%s)
getElapsedTime "$loopstart" "$loopend"
diff --git a/modules/subdomains.sh b/modules/subdomains.sh
index e76edf2..2a8d99e 100644
--- a/modules/subdomains.sh
+++ b/modules/subdomains.sh
@@ -200,9 +200,6 @@ _subdomains_init() {
return 1
fi
- NUMOFLINES_subs="0"
- NUMOFLINES_probed="0"
-
# Escape domain for safe use in grep regex (dots are literal, not wildcards)
DOMAIN_ESCAPED=$(escape_domain_regex "$domain")
@@ -357,15 +354,6 @@ _subdomains_finalize() {
fi
fi
- # Count new results
- if [[ -s "subdomains/subdomains.txt" ]]; then
- NUMOFLINES_subs=$(cat "subdomains/subdomains.txt" 2>>"$LOGFILE" | anew ".tmp/subdomains_old.txt" | sed '/^$/d' | wc -l) || NUMOFLINES_subs=0
- fi
-
- if [[ -s "webs/webs.txt" ]]; then
- NUMOFLINES_probed=$(cat "webs/webs.txt" 2>>"$LOGFILE" | anew ".tmp/probed_old.txt" | sed '/^$/d' | wc -l) || NUMOFLINES_probed=0
- fi
-
# Display results
TOTAL_SUBS=$(sed '/^$/d' "subdomains/subdomains.txt" 2>/dev/null | wc -l | tr -d ' ')
@@ -1260,6 +1248,59 @@ function sub_analytics() {
fi
}
+_permutations_engine_selected() {
+ local engine="${PERMUTATIONS_ENGINE:-}"
+ if [[ -z "$engine" ]] && [[ -n "${PERMUTATIONS_OPTION:-}" ]]; then
+ engine="${PERMUTATIONS_OPTION}"
+ fi
+ [[ -z "$engine" ]] && engine="gotator"
+
+ case "$engine" in
+ gotator|ripgen|alterx|both)
+ printf '%s\n' "$engine"
+ ;;
+ *)
+ log_note "sub_permut: invalid permutations engine '${engine}', defaulting to gotator" "${FUNCNAME[0]}" "${LINENO}"
+ printf '%s\n' "gotator"
+ ;;
+ esac
+}
+
+_run_permutation_engine_single() {
+ local engine="$1"
+ local source_file="$2"
+ case "$engine" in
+ gotator)
+ run_command gotator -sub "$source_file" -perm "${tools}/permutations_list.txt" $GOTATOR_FLAGS -silent 2>>"$LOGFILE"
+ ;;
+ ripgen)
+ run_command ripgen -d "$source_file" -w "${tools}/permutations_list.txt" 2>>"$LOGFILE"
+ ;;
+ alterx)
+ # alterx interface can vary by version; try list mode then stdin mode.
+ run_command alterx -l "$source_file" 2>>"$LOGFILE" || run_command alterx <"$source_file" 2>>"$LOGFILE"
+ ;;
+ esac
+}
+
+_generate_permutation_candidates() {
+ local source_file="$1"
+ local output_file="$2"
+ local engine
+ engine=$(_permutations_engine_selected)
+ : >"$output_file"
+ [[ -s "$source_file" ]] || return 0
+
+ if [[ "$engine" == "both" ]]; then
+ {
+ _run_permutation_engine_single "gotator" "$source_file"
+ _run_permutation_engine_single "alterx" "$source_file"
+ } | sed '/^\s*$/d' | head -c "$PERMUTATIONS_LIMIT" >"$output_file"
+ else
+ _run_permutation_engine_single "$engine" "$source_file" | sed '/^\s*$/d' | head -c "$PERMUTATIONS_LIMIT" >"$output_file"
+ fi
+}
+
function sub_permut() {
ensure_dirs .tmp subdomains
@@ -1288,32 +1329,11 @@ function sub_permut() {
# Check if DEEP mode is enabled or subdomains are within DEEP_LIMIT
if [[ $DEEP == true ]] || [[ $subdomain_count -le $DEEP_LIMIT ]]; then
- # Select the permutations tool
- if [[ $PERMUTATIONS_OPTION == "gotator" ]]; then
- if [[ -s "subdomains/subdomains.txt" ]]; then
- run_command gotator -sub subdomains/subdomains.txt -perm "${tools}/permutations_list.txt" $GOTATOR_FLAGS \
- -silent 2>>"$LOGFILE" | head -c "$PERMUTATIONS_LIMIT" >.tmp/gotator1.txt
- fi
- else
- if [[ -s "subdomains/subdomains.txt" ]]; then
- run_command ripgen -d subdomains/subdomains.txt -w "${tools}/permutations_list.txt" \
- 2>>"$LOGFILE" | head -c "$PERMUTATIONS_LIMIT" >.tmp/gotator1.txt
- fi
- fi
+ _generate_permutation_candidates "subdomains/subdomains.txt" ".tmp/gotator1.txt"
elif [[ "$subs_no_resolved_count" -le $DEEP_LIMIT2 ]]; then
- if [[ $PERMUTATIONS_OPTION == "gotator" ]]; then
- if [[ -s ".tmp/subs_no_resolved.txt" ]]; then
- run_command gotator -sub .tmp/subs_no_resolved.txt -perm "${tools}/permutations_list.txt" $GOTATOR_FLAGS \
- -silent 2>>"$LOGFILE" | head -c "$PERMUTATIONS_LIMIT" >.tmp/gotator1.txt
- fi
- else
- if [[ -s ".tmp/subs_no_resolved.txt" ]]; then
- run_command ripgen -d .tmp/subs_no_resolved.txt -w "${tools}/permutations_list.txt" \
- 2>>"$LOGFILE" | head -c "$PERMUTATIONS_LIMIT" >.tmp/gotator1.txt
- fi
- fi
+ _generate_permutation_candidates ".tmp/subs_no_resolved.txt" ".tmp/gotator1.txt"
else
end_subfunc "Skipping Permutations: Too Many Subdomains" "${FUNCNAME[0]}"
@@ -1338,17 +1358,7 @@ function sub_permut() {
fi
# Generate second round of permutations
- if [[ $PERMUTATIONS_OPTION == "gotator" ]]; then
- if [[ -s ".tmp/permute1.txt" ]]; then
- run_command gotator -sub .tmp/permute1.txt -perm "${tools}/permutations_list.txt" \
- $GOTATOR_FLAGS -silent 2>>"$LOGFILE" | head -c "$PERMUTATIONS_LIMIT" >.tmp/gotator2.txt
- fi
- else
- if [[ -s ".tmp/permute1.txt" ]]; then
- run_command ripgen -d .tmp/permute1.txt -w "${tools}/permutations_list.txt" \
- 2>>"$LOGFILE" | head -c "$PERMUTATIONS_LIMIT" >.tmp/gotator2.txt
- fi
- fi
+ _generate_permutation_candidates ".tmp/permute1.txt" ".tmp/gotator2.txt"
# Resolve the second round of permutations
if [[ $AXIOM != true ]]; then
@@ -1705,17 +1715,7 @@ function sub_recursive_brute() {
done
# Generate permutations
- if [[ $PERMUTATIONS_OPTION == "gotator" ]]; then
- if [[ -s ".tmp/brute_recursive.txt" ]]; then
- run_command gotator -sub .tmp/brute_recursive.txt -perm "${tools}/permutations_list.txt" $GOTATOR_FLAGS -silent \
- 2>>"$LOGFILE" | head -c "$PERMUTATIONS_LIMIT" >.tmp/gotator1_recursive.txt
- fi
- else
- if [[ -s ".tmp/brute_recursive.txt" ]]; then
- run_command ripgen -d .tmp/brute_recursive.txt -w "${tools}/permutations_list.txt" \
- 2>>"$LOGFILE" | head -c "$PERMUTATIONS_LIMIT" >.tmp/gotator1_recursive.txt
- fi
- fi
+ _generate_permutation_candidates ".tmp/brute_recursive.txt" ".tmp/gotator1_recursive.txt"
# Resolve permutations
if [[ $AXIOM != true ]]; then
@@ -1737,17 +1737,7 @@ function sub_recursive_brute() {
fi
# Second round of permutations
- if [[ $PERMUTATIONS_OPTION == "gotator" ]]; then
- if [[ -s ".tmp/permute1_recursive.txt" ]]; then
- run_command gotator -sub .tmp/permute1_recursive.txt -perm "${tools}/permutations_list.txt" $GOTATOR_FLAGS -silent \
- 2>>"$LOGFILE" | head -c "$PERMUTATIONS_LIMIT" >.tmp/gotator2_recursive.txt
- fi
- else
- if [[ -s ".tmp/permute1_recursive.txt" ]]; then
- run_command ripgen -d .tmp/permute1_recursive.txt -w "${tools}/permutations_list.txt" \
- 2>>"$LOGFILE" | head -c "$PERMUTATIONS_LIMIT" >.tmp/gotator2_recursive.txt
- fi
- fi
+ _generate_permutation_candidates ".tmp/permute1_recursive.txt" ".tmp/gotator2_recursive.txt"
# Resolve second round of permutations
if [[ $AXIOM != true ]]; then
diff --git a/modules/utils.sh b/modules/utils.sh
index ffc481f..2fa755c 100644
--- a/modules/utils.sh
+++ b/modules/utils.sh
@@ -107,6 +107,28 @@ function validate_config() {
warnings=$((warnings + 1))
fi
+ # Compat / deprecations (one-release window).
+ if [[ -n "${PERMUTATIONS_OPTION:-}" && -z "${PERMUTATIONS_ENGINE:-}" ]]; then
+ print_warnf "PERMUTATIONS_OPTION is deprecated; use PERMUTATIONS_ENGINE (got '%s')" "$PERMUTATIONS_OPTION"
+ warnings=$((warnings + 1))
+ fi
+ for deprecated in CORS OPEN_REDIRECT PROTO_POLLUTION FAVICON; do
+ if [[ -n "${!deprecated:-}" ]]; then
+ print_warnf "%s flag is deprecated/removed; set it in config has no effect anymore" "$deprecated"
+ warnings=$((warnings + 1))
+ fi
+ done
+
+ if [[ -n "${MONITOR_MIN_SEVERITY:-}" ]]; then
+ case "${MONITOR_MIN_SEVERITY,,}" in
+ critical|high|medium|low|info) : ;;
+ *)
+ print_warnf "MONITOR_MIN_SEVERITY invalid: '%s' (use critical|high|medium|low|info)" "$MONITOR_MIN_SEVERITY"
+ warnings=$((warnings + 1))
+ ;;
+ esac
+ fi
+
# Validate numeric thread/rate variables
for var in FFUF_THREADS HTTPX_THREADS DALFOX_THREADS KATANA_THREADS HTTPX_RATELIMIT NUCLEI_RATELIMIT FFUF_RATELIMIT; do
if [[ -n "${!var:-}" && ! "${!var}" =~ ^[0-9]+$ ]]; then
@@ -539,12 +561,14 @@ function sanitize_domain() {
# Check for basic domain format (at least one dot for TLD)
if [[ ! "$sanitized" =~ \. ]]; then
- print_warnf "Domain '%s' has no TLD, may be invalid" "$sanitized"
+ # Important: sanitize_domain is commonly used in command substitution (domain=$(sanitize_domain ...)).
+ # Emit warnings to stderr so they don't pollute the captured value.
+ print_warnf "Domain '%s' has no TLD, may be invalid" "$sanitized" >&2
fi
# If sanitization removed characters, warn user
if [[ "$input_domain" != "$sanitized" ]]; then
- print_notice INFO "sanitize_domain" "Domain sanitized from '${input_domain}' to '${sanitized}'"
+ print_notice INFO "sanitize_domain" "Domain sanitized from '${input_domain}' to '${sanitized}'" >&2
fi
echo "$sanitized"
diff --git a/modules/vulns.sh b/modules/vulns.sh
index da46e27..bf0edf5 100644
--- a/modules/vulns.sh
+++ b/modules/vulns.sh
@@ -1,9 +1,9 @@
#!/bin/bash
# shellcheck disable=SC2154 # Variables defined in reconftw.cfg
# reconFTW - Vulnerability scanning module
-# Contains: xss, cors, open_redirect, ssrf_checks, crlf_checks, lfi, ssti,
+# Contains: xss, ssrf_checks, crlf_checks, lfi, ssti,
# sqli, test_ssl, spraying, command_injection, 4xxbypass,
-# prototype_pollution, smuggling, webcache, fuzzparams
+# smuggling, webcache, fuzzparams, nuclei_dast
# This file is sourced by reconftw.sh - do not execute directly
[[ -z "${SCRIPTPATH:-}" ]] && {
echo "Error: This module must be sourced by reconftw.sh" >&2
@@ -90,90 +90,6 @@ function xss() {
}
-function cors() {
-
- # Create necessary directories
- if ! ensure_dirs .tmp webs vulns; then return 1; fi
-
- # Check if the function should run
- if { [[ ! -f "$called_fn_dir/.${FUNCNAME[0]}" ]] || [[ $DIFF == true ]]; } && [[ $CORS == true ]] \
- && ! [[ $domain =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
-
- start_func "${FUNCNAME[0]}" "CORS Scan"
-
- # Combine webs.txt and webs_uncommon_ports.txt into webs_all.txt if it doesn't exist
- if [[ ! -s "webs/webs_all.txt" ]]; then
- cat webs/webs.txt webs/webs_uncommon_ports.txt 2>/dev/null | anew -q "webs/webs_all.txt"
- fi
-
- # Proceed only if webs_all.txt exists and is non-empty
- if [[ -s "webs/webs_all.txt" ]]; then
- _print_msg INFO "Running: Corsy for CORS Scan"
- run_command "${tools}/Corsy/venv/bin/python3" "${tools}/Corsy/corsy.py" -i "webs/webs_all.txt" -o "vulns/cors.txt" 2>>"$LOGFILE" >/dev/null
- else
- end_func "No webs/webs_all.txt file found, CORS Scan skipped." "${FUNCNAME[0]}"
- return
- fi
-
- end_func "Results are saved in vulns/cors.txt" "${FUNCNAME[0]}"
-
- else
- # Handle cases where CORS is false, no vulnerable URLs, or already processed
- if [[ $CORS == false ]]; then
- pt_msg_warn "${FUNCNAME[0]} skipped due to configuration"
- elif [[ ! -s "gf/xss.txt" ]]; then
- pt_msg_warn "${FUNCNAME[0]} skipped: no candidate URLs for CORS"
- else
- pt_msg_warn "${FUNCNAME[0]} already processed. To force, delete ${called_fn_dir}/.${FUNCNAME[0]}"
- fi
- fi
-
-}
-
-function open_redirect() {
-
- # Create necessary directories
- if ! ensure_dirs .tmp webs vulns; then return 1; fi
-
- # Check if the function should run
- if { [[ ! -f "$called_fn_dir/.${FUNCNAME[0]}" ]] || [[ $DIFF == true ]]; } && [[ $OPEN_REDIRECT == true ]] \
- && [[ -s "gf/redirect.txt" ]] && ! [[ $domain =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
-
- start_func "${FUNCNAME[0]}" "Open Redirects Checks"
-
- # Determine whether to proceed based on DEEP flag or number of URLs
- URL_COUNT=$(wc -l <"gf/redirect.txt")
- if [[ $DEEP == true ]] || [[ $URL_COUNT -le $DEEP_LIMIT ]]; then
-
- _print_msg INFO "Running: Open Redirects Payload Generation"
-
- # Process redirect.txt with qsreplace and filter lines containing 'FUZZ'
- run_command qsreplace FUZZ <"gf/redirect.txt" | sed '/FUZZ/!d' | anew -q ".tmp/tmp_redirect.txt"
-
- # Run Oralyzer with the generated payloads
- run_command "${tools}/Oralyzer/venv/bin/python3" "${tools}/Oralyzer/oralyzer.py" -l ".tmp/tmp_redirect.txt" -p "${tools}/Oralyzer/payloads.txt" >"vulns/redirect.txt" 2>>"$LOGFILE"
-
- # Remove ANSI color codes from the output
- sed -r -i "s/\x1B\[([0-9]{1,3}(;[0-9]{1,2})?)?[mGK]//g" "vulns/redirect.txt"
-
- end_func "Results are saved in vulns/redirect.txt" "${FUNCNAME[0]}"
- else
- end_func "Skipping Open Redirects: Too many URLs to test, try with --deep flag." "${FUNCNAME[0]}"
- printf "${bgreen}#######################################################################${reset}\n"
- fi
- else
- # Handle cases where OPEN_REDIRECT is false, no vulnerable URLs, or already processed
- if [[ $OPEN_REDIRECT == false ]]; then
- pt_msg_warn "${FUNCNAME[0]} skipped due to configuration"
- elif [[ ! -s "gf/redirect.txt" ]]; then
- pt_msg_warn "${FUNCNAME[0]} skipped: no candidate URLs for open redirect"
- else
- pt_msg_warn "${FUNCNAME[0]} already processed. To force, delete ${called_fn_dir}/.${FUNCNAME[0]}"
- fi
- fi
-
-}
-
function ssrf_checks() {
# Create necessary directories
@@ -206,29 +122,45 @@ function ssrf_checks() {
_print_msg INFO "Running: SSRF Payload Generation"
- # Generate temporary SSRF payloads
+ # Generate classic callback payloads.
run_command qsreplace "$COLLAB_SERVER_FIX" <"gf/ssrf.txt" | anew -q ".tmp/tmp_ssrf.txt"
-
run_command qsreplace "$COLLAB_SERVER_URL" <"gf/ssrf.txt" | anew -q ".tmp/tmp_ssrf.txt"
- # Run FFUF to find requested URLs
- _print_msg INFO "Running: FFUF for SSRF Requested URLs"
- run_command ffuf -v -H "${HEADER}" -t "$FFUF_THREADS" -rate "$FFUF_RATELIMIT" -w ".tmp/tmp_ssrf.txt" -u "FUZZ" 2>/dev/null \
- | anew -q "vulns/ssrf_requested.txt"
-
- # Run FFUF with header injection for SSRF
- _print_msg INFO "Running: FFUF for SSRF Requested Headers with COLLAB_SERVER_FIX"
- run_command ffuf -v -w ".tmp/tmp_ssrf.txt:W1,${tools}/headers_inject.txt:W2" -H "${HEADER}" -H "W2: ${COLLAB_SERVER_FIX}" -t "$FFUF_THREADS" \
- -rate "$FFUF_RATELIMIT" -u "W1" 2>/dev/null | anew -q "vulns/ssrf_requested_headers.txt"
-
- _print_msg INFO "Running: FFUF for SSRF Requested Headers with COLLAB_SERVER_URL"
- run_command ffuf -v -w ".tmp/tmp_ssrf.txt:W1,${tools}/headers_inject.txt:W2" -H "${HEADER}" -H "W2: ${COLLAB_SERVER_URL}" -t "$FFUF_THREADS" \
- -rate "$FFUF_RATELIMIT" -u "W1" 2>/dev/null | anew -q "vulns/ssrf_requested_headers.txt"
+ # Run FFUF to find requested URLs.
+ _print_msg INFO "Running: FFUF for SSRF Requested URLs"
+ run_command ffuf -v -H "${HEADER}" -t "$FFUF_THREADS" -rate "$FFUF_RATELIMIT" -w ".tmp/tmp_ssrf.txt" -u "FUZZ" 2>/dev/null \
+ | anew -q "vulns/ssrf_requested.txt"
+
+ # Run FFUF with header injection for SSRF.
+ _print_msg INFO "Running: FFUF for SSRF Requested Headers with callback tokens"
+ run_command ffuf -v -w ".tmp/tmp_ssrf.txt:W1,${tools}/headers_inject.txt:W2" -H "${HEADER}" -H "W2: ${COLLAB_SERVER_FIX}" -t "$FFUF_THREADS" \
+ -rate "$FFUF_RATELIMIT" -u "W1" 2>/dev/null | anew -q "vulns/ssrf_requested_headers.txt"
+ run_command ffuf -v -w ".tmp/tmp_ssrf.txt:W1,${tools}/headers_inject.txt:W2" -H "${HEADER}" -H "W2: ${COLLAB_SERVER_URL}" -t "$FFUF_THREADS" \
+ -rate "$FFUF_RATELIMIT" -u "W1" 2>/dev/null | anew -q "vulns/ssrf_requested_headers.txt"
+
+ # Additional protocol payloads (gopher/dict/file/metadata endpoints).
+ local ssrf_payloads_file="${SCRIPTPATH}/config/ssrf_payloads.txt"
+ if [[ -s "$ssrf_payloads_file" ]]; then
+ : >".tmp/tmp_ssrf_protocols.txt"
+ while IFS= read -r payload || [[ -n "$payload" ]]; do
+ [[ -z "$payload" || "$payload" =~ ^# ]] && continue
+ payload="${payload//\{COLLAB\}/$COLLAB_SERVER_FIX}"
+ payload="${payload//\{COLLAB_URL\}/$COLLAB_SERVER_URL}"
+ run_command qsreplace "$payload" <"gf/ssrf.txt" | anew -q ".tmp/tmp_ssrf_protocols.txt"
+ done <"$ssrf_payloads_file"
+
+ if [[ -s ".tmp/tmp_ssrf_protocols.txt" ]]; then
+ _print_msg INFO "Running: FFUF for SSRF alternate protocols"
+ run_command ffuf -v -H "${HEADER}" -t "$FFUF_THREADS" -rate "$FFUF_RATELIMIT" -w ".tmp/tmp_ssrf_protocols.txt" -u "FUZZ" \
+ -mr "${SSRF_ALT_MATCH_REGEX:-169\\.254\\.169\\.254|latest/meta-data|root:|127\\.0\\.0\\.1|localhost|gopher://|dict://|file://}" 2>/dev/null \
+ | grep "URL" | sed 's/| URL | //' | anew -q "vulns/ssrf_alt_protocols.txt"
+ fi
+ fi
- # Allow time for callbacks to be received
+ # Allow time for callbacks to be received.
sleep 5
- # Process SSRF callback results if INTERACT is enabled
+ # Process SSRF callback results if INTERACT is enabled.
if [[ $INTERACT == true ]] && [[ -s ".tmp/ssrf_callback.txt" ]]; then
tail -n +11 .tmp/ssrf_callback.txt | anew -q "vulns/ssrf_callback.txt"
if ! NUMOFLINES=$(tail -n +12 .tmp/ssrf_callback.txt | sed '/^$/d' | wc -l); then
@@ -237,7 +169,7 @@ function ssrf_checks() {
notification "SSRF: ${NUMOFLINES} callbacks received" info
fi
- end_func "Results are saved in vulns/ssrf_*" "${FUNCNAME[0]}"
+ end_func "Results are saved in vulns/ssrf_* (including alternate protocols)" "${FUNCNAME[0]}"
else
end_func "Skipping SSRF: Too many URLs to test, try with --deep flag." "${FUNCNAME[0]}"
printf "${bgreen}#######################################################################${reset}\n"
@@ -367,6 +299,9 @@ function ssti() {
# Ensure gf/ssti.txt is not empty
if [[ -s "gf/ssti.txt" ]]; then
local ssti_engine="${SSTI_ENGINE:-tinja}"
+ if [[ "$ssti_engine" != "tinja" ]]; then
+ _print_msg WARN "SSTI_ENGINE='${ssti_engine}' is deprecated; using TInjA."
+ fi
_print_msg INFO "Running: SSTI Payload Generation"
@@ -378,36 +313,32 @@ function ssti() {
if [[ $DEEP == true ]] || [[ $URL_COUNT -le $DEEP_LIMIT ]]; then
: >".tmp/ssti_candidates.txt"
- if [[ "$ssti_engine" == "tinja" ]] && command -v tinja >/dev/null 2>&1; then
- _print_msg INFO "Running: SSTI Checks with TInjA"
- local tinja_report_dir="$dir/.tmp/tinja"
- mkdir -p "$tinja_report_dir"
- local -a tinja_cmd=(tinja url --reportpath "${tinja_report_dir}/" --ratelimit "${TINJA_RATELIMIT:-0}" --timeout "${TINJA_TIMEOUT:-15}" --verbosity 0)
- if [[ -n "${HEADER:-}" ]]; then
- tinja_cmd+=(-H "${HEADER}")
- fi
- while IFS= read -r u; do
- [[ -n "$u" ]] && tinja_cmd+=(--url "$u")
- done <".tmp/tmp_ssti.txt"
+ if ! command -v tinja >/dev/null 2>&1; then
+ end_func "Skipping SSTI: TInjA not installed (no legacy fallback)." "${FUNCNAME[0]}" "SKIP_MISSING_TOOL"
+ return 0
+ fi
- if ! run_command "${tinja_cmd[@]}" 2>>"$LOGFILE" >/dev/null; then
- log_note "ssti: tinja execution failed, no findings collected" "${FUNCNAME[0]}" "${LINENO}"
- fi
+ _print_msg INFO "Running: SSTI Checks with TInjA"
+ local tinja_report_dir="$dir/.tmp/tinja"
+ mkdir -p "$tinja_report_dir"
+ local -a tinja_cmd=(tinja url --reportpath "${tinja_report_dir}/" --ratelimit "${TINJA_RATELIMIT:-0}" --timeout "${TINJA_TIMEOUT:-15}" --verbosity 0)
+ if [[ -n "${HEADER:-}" ]]; then
+ tinja_cmd+=(-H "${HEADER}")
+ fi
+ while IFS= read -r u; do
+ [[ -n "$u" ]] && tinja_cmd+=(--url "$u")
+ done <".tmp/tmp_ssti.txt"
- local report_file=""
- report_file=$(ls -1t "${tinja_report_dir}"/*.jsonl 2>/dev/null | head -n 1 || true)
- if [[ -n "$report_file" && -s "$report_file" ]]; then
- jq -r 'select((.isWebpageVulnerable == true) or any(.parameters[]?; .isParameterVulnerable == true)) | (.url // empty) + " [certainty:" + (.certainty // "unknown") + "]"' "$report_file" 2>/dev/null \
- | sed '/^\s*$/d' \
- | anew -q ".tmp/ssti_candidates.txt"
- fi
- else
- [[ "$ssti_engine" == "tinja" ]] && _print_msg WARN "TInjA not found. Falling back to legacy SSTI check."
- _print_msg INFO "Running: SSTI Fuzzing with FFUF"
+ if ! run_command "${tinja_cmd[@]}" 2>>"$LOGFILE" >/dev/null; then
+ log_note "ssti: tinja execution failed, no findings collected" "${FUNCNAME[0]}" "${LINENO}"
+ fi
- # Use Interlace to parallelize FFUF scanning
- run_command interlace -tL ".tmp/tmp_ssti.txt" -threads "$INTERLACE_THREADS" -c "ffuf -v -r -t ${FFUF_THREADS} -rate ${FFUF_RATELIMIT} -H \"${HEADER}\" -w \"${ssti_wordlist}\" -u \"_target_\" -mr \"ssti49\"" 2>>"$LOGFILE" \
- | grep "URL" | sed 's/| URL | //' | anew -q ".tmp/ssti_candidates.txt"
+ local report_file=""
+ report_file=$(ls -1t "${tinja_report_dir}"/*.jsonl 2>/dev/null | head -n 1 || true)
+ if [[ -n "$report_file" && -s "$report_file" ]]; then
+ jq -r 'select((.isWebpageVulnerable == true) or any(.parameters[]?; .isParameterVulnerable == true)) | (.url // empty) + " [certainty:" + (.certainty // "unknown") + "]"' "$report_file" 2>/dev/null \
+ | sed '/^\s*$/d' \
+ | anew -q ".tmp/ssti_candidates.txt"
fi
if [[ -s ".tmp/ssti_candidates.txt" ]]; then
@@ -675,62 +606,6 @@ function 4xxbypass() {
}
-function prototype_pollution() {
-
- # Create necessary directories
- if ! ensure_dirs .tmp webs vulns; then return 1; fi
-
- # Check if the function should run
- if { [[ ! -f "$called_fn_dir/.${FUNCNAME[0]}" ]] || [[ $DIFF == true ]]; } && [[ $PROTO_POLLUTION == true ]] \
- && ! [[ $domain =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
-
- start_func "${FUNCNAME[0]}" "Prototype Pollution Checks"
-
- if [[ ! -s "webs/url_extract_nodupes.txt" ]]; then
- _print_msg WARN "File webs/url_extract_nodupes.txt is missing or empty."
- end_func "Skipping prototype pollution: missing URL candidates." "${FUNCNAME[0]}" "SKIP"
- return
- fi
-
- # Determine whether to proceed based on DEEP flag or number of URLs
- URL_COUNT=$(wc -l <"webs/url_extract_nodupes.txt" 2>/dev/null || echo 0)
- if [[ $DEEP == true ]] || [[ $URL_COUNT -le $DEEP_LIMIT ]]; then
-
- # Ensure fuzzing_full.txt exists and has content
- if [[ -s "webs/url_extract_nodupes.txt" ]]; then
- _print_msg INFO "Running: Prototype Pollution Mapping"
-
- # Process URL list with ppmap and save results
- ppmap <"webs/url_extract_nodupes.txt" >".tmp/prototype_pollution.txt" 2>>"$LOGFILE"
-
- # Filter and save relevant results
- if [[ -s ".tmp/prototype_pollution.txt" ]]; then
- grep "EXPL" ".tmp/prototype_pollution.txt" | anew -q "vulns/prototype_pollution.txt"
- fi
-
- end_func "Results are saved in vulns/prototype_pollution.txt" "${FUNCNAME[0]}"
- else
- end_func "Skipping prototype pollution: missing URL candidates." "${FUNCNAME[0]}" "SKIP"
- return
- fi
-
- else
- end_func "Skipping Prototype Pollution: Too many URLs to test, try with --deep flag." "${FUNCNAME[0]}"
- fi
-
- else
- # Handle cases where PROTO_POLLUTION is false, no vulnerable URLs, or already processed
- if [[ $PROTO_POLLUTION == false ]]; then
- pt_msg_warn "${FUNCNAME[0]} skipped due to configuration"
- elif [[ ! -s "webs/url_extract_nodupes.txt" ]]; then
- pt_msg_warn "${FUNCNAME[0]} skipped: no candidate URLs for prototype pollution"
- else
- pt_msg_warn "${FUNCNAME[0]} already processed. To force, delete ${called_fn_dir}/.${FUNCNAME[0]}"
- fi
- fi
-
-}
-
function smuggling() {
# Create necessary directories
@@ -942,3 +817,92 @@ function fuzzparams() {
fi
}
+
+_nuclei_dast_collect_targets() {
+ : >".tmp/nuclei_dast_targets.txt"
+
+ # Baseline web targets.
+ if [[ -s "webs/webs_all.txt" ]]; then
+ grep -aE '^https?://' "webs/webs_all.txt" | anew -q ".tmp/nuclei_dast_targets.txt"
+ fi
+ if [[ -s "webs/url_extract_nodupes.txt" ]]; then
+ grep -aE '^https?://' "webs/url_extract_nodupes.txt" | anew -q ".tmp/nuclei_dast_targets.txt"
+ fi
+
+ # Candidate URLs generated by GF patterns across vuln modules.
+ local gf_file
+ for gf_file in gf/*.txt; do
+ [[ -s "$gf_file" ]] || continue
+ grep -aE '^https?://' "$gf_file" | anew -q ".tmp/nuclei_dast_targets.txt"
+ done
+
+ sort -u ".tmp/nuclei_dast_targets.txt" -o ".tmp/nuclei_dast_targets.txt" 2>/dev/null || true
+}
+
+function nuclei_dast() {
+
+ if ! ensure_dirs .tmp webs gf vulns nuclei_output; then return 1; fi
+
+ # nuclei_dast is part of the vulnerability scanning pipeline.
+ # If the user enables vulns (e.g. `-a`), force-enable this DAST pass to replace deprecated single-purpose modules.
+ local dast_enabled="${NUCLEI_DAST:-true}"
+ if [[ ${VULNS_GENERAL:-false} == true ]]; then
+ if [[ ${NUCLEI_DAST:-true} != true ]]; then
+ _print_msg WARN "NUCLEI_DAST is forced enabled when VULNS_GENERAL=true (e.g. -a)."
+ fi
+ dast_enabled=true
+ fi
+
+ if { [[ ! -f "$called_fn_dir/.${FUNCNAME[0]}" ]] || [[ $DIFF == true ]]; } && [[ "$dast_enabled" == true ]]; then
+ start_func "${FUNCNAME[0]}" "Nuclei DAST Scanner"
+ maybe_update_nuclei
+
+ _nuclei_dast_collect_targets
+ if [[ ! -s ".tmp/nuclei_dast_targets.txt" ]]; then
+ end_func "No DAST targets available from webs/url/gf inputs." "${FUNCNAME[0]}" "SKIP_NOINPUT"
+ return 0
+ fi
+
+ local url_count
+ url_count=$(wc -l <".tmp/nuclei_dast_targets.txt" 2>/dev/null || echo 0)
+ if [[ $DEEP != true ]] && [[ "$url_count" -gt "${DEEP_LIMIT2:-1500}" ]]; then
+ end_func "Skipping Nuclei DAST: too many targets (${url_count}), use --deep." "${FUNCNAME[0]}"
+ return 0
+ fi
+
+ local dast_templates="${NUCLEI_DAST_TEMPLATE_PATH:-${NUCLEI_TEMPLATES_PATH}/dast}"
+ if [[ $AXIOM != true ]]; then
+ # shellcheck disable=SC2086 # Intentionally allow user-provided nuclei args
+ run_command nuclei -l ".tmp/nuclei_dast_targets.txt" -dast -nh -rl "$NUCLEI_RATELIMIT" -silent -retries 2 \
+ $NUCLEI_EXTRA_ARGS $NUCLEI_DAST_EXTRA_ARGS -t "$dast_templates" -j -o ".tmp/nuclei_dast_json_raw.txt" \
+ 2>>"$LOGFILE" >/dev/null
+ else
+ # shellcheck disable=SC2086 # Intentionally allow user-provided nuclei args
+ run_command axiom-scan ".tmp/nuclei_dast_targets.txt" -m nuclei -dast -nh -rl "$NUCLEI_RATELIMIT" -silent -retries 2 \
+ $NUCLEI_EXTRA_ARGS $NUCLEI_DAST_EXTRA_ARGS -t "$dast_templates" -j -o ".tmp/nuclei_dast_json_raw.txt" \
+ $AXIOM_EXTRA_ARGS 2>>"$LOGFILE" >/dev/null
+ fi
+
+ if [[ -s ".tmp/nuclei_dast_json_raw.txt" ]]; then
+ jq -c '. + {scan_scope:"dast"}' ".tmp/nuclei_dast_json_raw.txt" 2>/dev/null >"nuclei_output/dast_json.txt"
+ jq -r '["[" + .["template-id"] + (if .["matcher-name"] != null then ":" + .["matcher-name"] else "" end) + "] [" + .["type"] + "] [" + .info.severity + "] " + (.["matched-at"] // .host)] | .[]' \
+ "nuclei_output/dast_json.txt" 2>/dev/null | anew -q "vulns/nuclei_dast.txt"
+ else
+ : >"nuclei_output/dast_json.txt"
+ fi
+
+ if [[ $FARADAY == true ]] && [[ -s "nuclei_output/dast_json.txt" ]]; then
+ if faraday-cli status 2>>"$LOGFILE" >/dev/null; then
+ faraday-cli tool report -w "$FARADAY_WORKSPACE" --plugin-id nuclei "nuclei_output/dast_json.txt" 2>>"$LOGFILE" >/dev/null
+ fi
+ fi
+
+ end_func "Results are saved in nuclei_output/dast_json.txt and vulns/nuclei_dast.txt" "${FUNCNAME[0]}"
+ else
+ if [[ "$dast_enabled" == false ]]; then
+ pt_msg_warn "${FUNCNAME[0]} skipped due to configuration"
+ else
+ pt_msg_warn "${FUNCNAME[0]} already processed. To force, delete ${called_fn_dir}/.${FUNCNAME[0]}"
+ fi
+ fi
+}
diff --git a/modules/web.sh b/modules/web.sh
index d71f06f..100a549 100644
--- a/modules/web.sh
+++ b/modules/web.sh
@@ -1,7 +1,7 @@
#!/bin/bash
# shellcheck disable=SC2154 # Variables defined in reconftw.cfg
# reconFTW - Web analysis module
-# Contains: webprobe_simple, webprobe_full, screenshot, virtualhosts, favicon,
+# Contains: webprobe_simple, webprobe_full, screenshot, virtualhosts,
# favirecon_tech,
# portscan, cdnprovider, waf_checks, nuclei_check, graphql_scan,
# param_discovery, grpc_reflection, fuzz, iishortname, cms_scanner,
@@ -121,8 +121,8 @@ function webprobe_simple() {
-o .tmp/web_full_info_probe.txt "$AXIOM_EXTRA_ARGS" 2>>"$LOGFILE" >/dev/null
fi
- # Merge web_full_info files
- cat .tmp/web_full_info.txt 2>>"$LOGFILE" \
+ # Merge current probe output with prior cache/state.
+ cat .tmp/web_full_info_probe.txt .tmp/web_full_info.txt 2>>"$LOGFILE" \
| jq -s 'try .' | jq 'try unique_by(.input)' | jq 'try .[]' 2>>"$LOGFILE" >webs/web_full_info.txt
# Extract URLs
@@ -350,72 +350,6 @@ function virtualhosts() {
############################################# HOST SCAN #######################################################
###############################################################################################################
-function favicon() {
-
- # Create necessary directories
- if ! ensure_dirs hosts .tmp/virtualhosts; then return 1; fi
-
- # Check if the function should run
- if { [[ ! -f "$called_fn_dir/.${FUNCNAME[0]}" ]] || [[ $DIFF == true ]]; } \
- && [[ $FAVICON == true ]] \
- && ! [[ $domain =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
-
- start_func "${FUNCNAME[0]}" "Favicon IP Lookup"
-
- # Navigate to the fav-up tool directory
- if ! pushd "${tools}/fav-up" >/dev/null; then
- print_warnf "Failed to change directory to %s in %s @ line %s." \
- "${tools}/fav-up" "${FUNCNAME[0]}" "${LINENO}"
- return 1
- fi
-
- # Run the favicon IP lookup tool
- if [[ -n "${TIMEOUT_CMD:-}" ]]; then
- if ! run_command "$TIMEOUT_CMD" -k 10s 10m "${tools}/fav-up/venv/bin/python3" "${tools}/fav-up/favUp.py" -w "$domain" -sc -o favicontest.json 2>>"$LOGFILE" >/dev/null; then
- log_note "favicon: fav-up failed or timed out; skipping" "${FUNCNAME[0]}" "${LINENO}"
- fi
- else
- if ! run_command "${tools}/fav-up/venv/bin/python3" "${tools}/fav-up/favUp.py" -w "$domain" -sc -o favicontest.json 2>>"$LOGFILE" >/dev/null; then
- log_note "favicon: fav-up failed; skipping" "${FUNCNAME[0]}" "${LINENO}"
- fi
- fi
-
- # Process the results if favicontest.json exists and is not empty
- if [[ -s "favicontest.json" ]]; then
- jq -r 'try .found_ips' favicontest.json 2>>"$LOGFILE" \
- | grep -v "not-found" >favicontest.txt
-
- # Replace '|' with newlines
- sed_i "s/|/\n/g" favicontest.txt
-
- # Move the processed IPs to the hosts directory
- mv favicontest.txt "$dir/hosts/favicontest.txt" 2>>"$LOGFILE"
-
- # Remove the JSON file
- rm -f favicontest.json 2>>"$LOGFILE"
- fi
-
- # Return to the original directory
- if ! popd >/dev/null; then
- print_warnf "Failed to return to the previous directory in %s @ line %s." \
- "${FUNCNAME[0]}" "${LINENO}"
- fi
-
- end_func "Results are saved in hosts/favicontest.txt" "${FUNCNAME[0]}"
-
- else
- if [[ $FAVICON == false ]]; then
- _print_msg WARN "${FUNCNAME[0]} skipped due to configuration settings."
- elif [[ $domain =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
- # Domain is an IP, do nothing
- return
- else
- _print_msg WARN "${FUNCNAME[0]} already processed. To force execution, delete ${called_fn_dir}/.${FUNCNAME[0]}"
- fi
- fi
-
-}
-
function favirecon_tech() {
# Create necessary directories
@@ -512,13 +446,36 @@ function portscan() {
fi
if [[ -s "hosts/ips.txt" ]]; then
- # Remove CDN IPs
+ # Remove CDN IPs.
comm -23 <(sort -u hosts/ips.txt) <(cut -d'[' -f1 hosts/cdn_providers.txt | sed 's/[[:space:]]*$//' | sort -u) \
| grep -aEiv "^(127|10|169\.254|172\.1[6-9]|172\.2[0-9]|172\.3[0-1]|192\.168)\." | grep -oE '\b([0-9]{1,3}\.){3}[0-9]{1,3}\b' \
| sort -u | anew -q .tmp/ips_nocdn.txt || true
fi
- # Display resolved IPs without CDN
+ # Optional CDN bypass to recover origin IPs.
+ if [[ ${CDN_BYPASS:-true} == true ]] && command -v hakoriginfinder >/dev/null 2>&1; then
+ : >".tmp/origin_input_hosts.txt"
+ if [[ -s "subdomains/subdomains.txt" ]]; then
+ cat subdomains/subdomains.txt | anew -q ".tmp/origin_input_hosts.txt"
+ elif [[ -s "webs/webs_all.txt" ]]; then
+ awk -F/ '{print $3}' webs/webs_all.txt | sed 's/:.*$//' | sed '/^$/d' | sort -u | anew -q ".tmp/origin_input_hosts.txt"
+ fi
+ if [[ -s ".tmp/origin_input_hosts.txt" ]]; then
+ if run_command hakoriginfinder <".tmp/origin_input_hosts.txt" >".tmp/hakoriginfinder_raw.txt" 2>>"$LOGFILE"; then
+ grep -aoE '\b([0-9]{1,3}\.){3}[0-9]{1,3}\b' ".tmp/hakoriginfinder_raw.txt" \
+ | grep -aEiv "^(127|10|169\.254|172\.1[6-9]|172\.2[0-9]|172\.3[0-1]|192\.168)\." \
+ | sort -u >"hosts/origin_ips.txt"
+ if [[ -s "hosts/origin_ips.txt" ]]; then
+ cat hosts/origin_ips.txt | anew -q .tmp/ips_nocdn.txt
+ cat hosts/origin_ips.txt | anew -q hosts/ips.txt
+ fi
+ else
+ log_note "portscan: hakoriginfinder failed, skipping CDN bypass origins" "${FUNCNAME[0]}" "${LINENO}"
+ fi
+ fi
+ fi
+
+ # Display resolved IPs without CDN.
ips_nocdn_count=0
if [[ -s ".tmp/ips_nocdn.txt" ]]; then
ips_nocdn_count=$(sort -u ".tmp/ips_nocdn.txt" | wc -l | tr -d ' ')
@@ -535,13 +492,13 @@ function portscan() {
ips_file="${dir}/hosts/ips.txt"
- # Discover IPv6 addresses from DNS JSON if enabled
+ # Discover IPv6 addresses from DNS JSON if enabled.
if [[ $IPV6_SCAN == true ]]; then
if [[ -s "subdomains/subdomains_dnsregs.json" ]]; then
jq -r '.. | strings | select(test("^[0-9a-fA-F:]+$"))' <"subdomains/subdomains_dnsregs.json" \
| grep -v '\\.' | sort -u | anew -q hosts/ips_v6.txt || true
fi
- # Add target if it's an IPv6 literal
+ # Add target if it's an IPv6 literal.
if [[ $domain =~ : ]]; then echo "$domain" | anew -q hosts/ips_v6.txt || true; fi
fi
@@ -576,30 +533,92 @@ function portscan() {
fi
if [[ $PORTSCAN_ACTIVE == true ]]; then
- # Split PORTSCAN_ACTIVE_OPTIONS safely even with IFS set to \n\t
+ # Resolve active nmap options (deep profile optional).
+ local active_opts_raw
+ active_opts_raw="${PORTSCAN_ACTIVE_OPTIONS:-}"
+ if [[ $DEEP == true ]] && [[ -n "${PORTSCAN_DEEP_OPTIONS:-}" ]]; then
+ active_opts_raw="${PORTSCAN_DEEP_OPTIONS}"
+ fi
local portscan_opts=()
- if declare -p PORTSCAN_ACTIVE_OPTIONS 2>/dev/null | grep -q 'declare -a'; then
- portscan_opts=("${PORTSCAN_ACTIVE_OPTIONS[@]}")
- elif [[ -n "${PORTSCAN_ACTIVE_OPTIONS:-}" ]]; then
+ if [[ -n "$active_opts_raw" ]]; then
local _ifs="$IFS"
IFS=' '
- read -r -a portscan_opts <<<"$PORTSCAN_ACTIVE_OPTIONS"
+ read -r -a portscan_opts <<<"$active_opts_raw"
IFS="$_ifs"
fi
- if [[ $AXIOM != true ]]; then
- if [[ -s ".tmp/ips_nocdn.txt" ]]; then
- run_command "$SUDO" nmap "${portscan_opts[@]}" -iL .tmp/ips_nocdn.txt -oA hosts/portscan_active 2>>"$LOGFILE" >/dev/null
- fi
- if [[ $IPV6_SCAN == true && -s "hosts/ips_v6.txt" ]]; then
- run_command "$SUDO" nmap -6 "${portscan_opts[@]}" -iL hosts/ips_v6.txt -oA hosts/portscan_active_v6 2>>"$LOGFILE" >/dev/null
+ local strategy="${PORTSCAN_STRATEGY:-legacy}"
+ local used_targeted_output=false
+
+ if [[ "$strategy" == "naabu_nmap" ]] && [[ ${NAABU_ENABLE:-true} == true ]] && [[ $AXIOM != true ]]; then
+ if command -v naabu >/dev/null 2>&1; then
+ local naabu_ports_raw="${NAABU_PORTS:---top-ports 1000}"
+ local naabu_opts=()
+ if [[ -n "$naabu_ports_raw" ]]; then
+ local _ifs="$IFS"
+ IFS=' '
+ read -r -a naabu_opts <<<"$naabu_ports_raw"
+ IFS="$_ifs"
+ fi
+
+ if [[ -s ".tmp/ips_nocdn.txt" ]]; then
+ run_command naabu -list ".tmp/ips_nocdn.txt" -silent -rate "${NAABU_RATE:-1000}" "${naabu_opts[@]}" -o "hosts/naabu_open.txt" 2>>"$LOGFILE" >/dev/null
+ fi
+
+ if [[ -s "hosts/naabu_open.txt" ]]; then
+ local naabu_ports_csv=""
+ naabu_ports_csv=$(cut -d':' -f2 "hosts/naabu_open.txt" | sed '/^$/d' | sort -un | paste -sd, -)
+ if [[ -n "$naabu_ports_csv" ]]; then
+ run_command "$SUDO" nmap "${portscan_opts[@]}" -p "$naabu_ports_csv" -iL ".tmp/ips_nocdn.txt" -oA "hosts/portscan_active_targeted" 2>>"$LOGFILE" >/dev/null
+ used_targeted_output=true
+ fi
+ fi
+ else
+ _print_msg WARN "PORTSCAN_STRATEGY=naabu_nmap requested but naabu is missing. Falling back to legacy nmap."
fi
- else
- if [[ -s ".tmp/ips_nocdn.txt" ]]; then
- run_command axiom-scan .tmp/ips_nocdn.txt -m nmapx "${portscan_opts[@]}" \
- -oA hosts/portscan_active "$AXIOM_EXTRA_ARGS" 2>>"$LOGFILE" >/dev/null
+ elif [[ "$strategy" == "naabu_nmap" ]] && [[ $AXIOM == true ]]; then
+ _print_msg WARN "PORTSCAN_STRATEGY=naabu_nmap is not enabled for AXIOM yet. Falling back to legacy nmapx."
+ fi
+
+ # Legacy fallback.
+ if [[ "$used_targeted_output" != true ]]; then
+ if [[ $AXIOM != true ]]; then
+ if [[ -s ".tmp/ips_nocdn.txt" ]]; then
+ run_command "$SUDO" nmap "${portscan_opts[@]}" -iL .tmp/ips_nocdn.txt -oA hosts/portscan_active 2>>"$LOGFILE" >/dev/null
+ fi
+ else
+ if [[ -s ".tmp/ips_nocdn.txt" ]]; then
+ run_command axiom-scan .tmp/ips_nocdn.txt -m nmapx "${portscan_opts[@]}" \
+ -oA hosts/portscan_active "$AXIOM_EXTRA_ARGS" 2>>"$LOGFILE" >/dev/null
+ fi
fi
fi
+
+ # Keep compatibility output names if targeted flow ran.
+ if [[ "$used_targeted_output" == true ]] && [[ ! -s "hosts/portscan_active.xml" ]] && [[ -s "hosts/portscan_active_targeted.xml" ]]; then
+ cp "hosts/portscan_active_targeted.xml" "hosts/portscan_active.xml"
+ [[ -s "hosts/portscan_active_targeted.gnmap" ]] && cp "hosts/portscan_active_targeted.gnmap" "hosts/portscan_active.gnmap"
+ [[ -s "hosts/portscan_active_targeted.nmap" ]] && cp "hosts/portscan_active_targeted.nmap" "hosts/portscan_active.nmap"
+ fi
+
+ if [[ $IPV6_SCAN == true && -s "hosts/ips_v6.txt" ]] && [[ $AXIOM != true ]]; then
+ run_command "$SUDO" nmap -6 "${portscan_opts[@]}" -iL hosts/ips_v6.txt -oA hosts/portscan_active_v6 2>>"$LOGFILE" >/dev/null
+ fi
+ fi
+
+ # Optional UDP top-ports scan (local-only, requires privileges).
+ if [[ ${PORTSCAN_UDP:-false} == true ]] && [[ $AXIOM != true ]] && [[ -s ".tmp/ips_nocdn.txt" ]]; then
+ local udp_opts_raw="${PORTSCAN_UDP_OPTIONS:---top-ports 20 -sU -sV -n -Pn --open}"
+ local udp_opts=()
+ if [[ -n "$udp_opts_raw" ]]; then
+ local _ifs="$IFS"
+ IFS=' '
+ read -r -a udp_opts <<<"$udp_opts_raw"
+ IFS="$_ifs"
+ fi
+ run_command "$SUDO" nmap "${udp_opts[@]}" -iL ".tmp/ips_nocdn.txt" -oA "hosts/portscan_active_udp" 2>>"$LOGFILE" >/dev/null
+ elif [[ ${PORTSCAN_UDP:-false} == true ]] && [[ $AXIOM == true ]]; then
+ _print_msg WARN "PORTSCAN_UDP is local-only for now; skipped in AXIOM mode."
fi
if [[ -s "hosts/portscan_active.xml" ]]; then
@@ -611,13 +630,16 @@ function portscan() {
fi
if [[ $FARADAY == true ]]; then
- # Check if the Faraday server is running
+ # Check if the Faraday server is running.
if ! faraday-cli status 2>>"$LOGFILE" >/dev/null; then
print_warnf "Faraday server is not running. Skipping Faraday integration."
else
if [[ -s "hosts/portscan_active.xml" ]]; then
faraday-cli tool report -w "$FARADAY_WORKSPACE" --plugin-id nmap hosts/portscan_active.xml 2>>"$LOGFILE" >/dev/null
fi
+ if [[ -s "hosts/portscan_active_udp.xml" ]]; then
+ faraday-cli tool report -w "$FARADAY_WORKSPACE" --plugin-id nmap hosts/portscan_active_udp.xml 2>>"$LOGFILE" >/dev/null
+ fi
fi
fi
@@ -630,7 +652,7 @@ function portscan() {
append_assets_from_file web url hosts/webs.txt
fi
- end_func "Results are saved in hosts/portscan_[passive|active|shodan].[txt|xml]" "${FUNCNAME[0]}"
+ end_func "Results are saved in hosts/portscan_[passive|active|active_targeted|active_udp|shodan].*" "${FUNCNAME[0]}"
else
if [[ $PORTSCANNER == false ]]; then
@@ -702,10 +724,10 @@ function waf_checks() {
fi
# Proceed only if webs_all.txt exists and is non-empty
- if [[ -s "webs/webs_all.txt" ]]; then
- if [[ $AXIOM != true ]]; then
+ if [[ -s "webs/webs_all.txt" ]]; then
+ if [[ $AXIOM != true ]]; then
# Run wafw00f on webs_all.txt
- wafw00f -i "webs/webs_all.txt" -o ".tmp/wafs.txt" 2>>"$LOGFILE" >/dev/null
+ run_command wafw00f -i "webs/webs_all.txt" -o ".tmp/wafs.txt" 2>>"$LOGFILE" >/dev/null
else
# Run axiom-scan with wafw00f module on webs_all.txt
run_command axiom-scan "webs/webs_all.txt" -m wafw00f -o ".tmp/wafs.txt" "$AXIOM_EXTRA_ARGS" 2>>"$LOGFILE" >/dev/null
@@ -807,17 +829,19 @@ _nuclei_scan_local() {
_print_msg INFO "Running: Nuclei Severity: ${crit}"
# Non-WAF at default rate
if [[ -s "$NOWAF_LIST" ]]; then
+ # shellcheck disable=SC2086 # Intentionally allow user-provided nuclei args
run_with_heartbeat "nuclei ${crit} (normal targets)" nuclei \
-l "$NOWAF_LIST" -severity "$crit" -nh -rl "$NUCLEI_RATELIMIT" -silent -retries 2 \
- "${NUCLEI_EXTRA_ARGS}" -t "${NUCLEI_TEMPLATES_PATH}" -j -o "nuclei_output/${crit}_json.txt"
+ $NUCLEI_EXTRA_ARGS -t "${NUCLEI_TEMPLATES_PATH}" -j -o "nuclei_output/${crit}_json.txt"
fi
# WAF hosts at slower rate
if [[ -s "$WAF_LIST" ]]; then
local slow_rl
slow_rl=$((NUCLEI_RATELIMIT / 3 + 1))
+ # shellcheck disable=SC2086 # Intentionally allow user-provided nuclei args
run_with_heartbeat "nuclei ${crit} (waf targets)" nuclei \
-l "$WAF_LIST" -severity "$crit" -nh -rl "$slow_rl" -silent -retries 2 \
- "${NUCLEI_EXTRA_ARGS}" -t "${NUCLEI_TEMPLATES_PATH}" -j -o "nuclei_output/${crit}_waf_json.txt"
+ $NUCLEI_EXTRA_ARGS -t "${NUCLEI_TEMPLATES_PATH}" -j -o "nuclei_output/${crit}_waf_json.txt"
[[ -s "nuclei_output/${crit}_waf_json.txt" ]] && cat "nuclei_output/${crit}_waf_json.txt" >>"nuclei_output/${crit}_json.txt"
fi
_nuclei_parse_results "$crit"
@@ -832,10 +856,11 @@ _nuclei_scan_axiom() {
for crit in "${severity_array[@]}"; do
_print_msg INFO "Running: Axiom Nuclei Severity: ${crit}. Check results in nuclei_output folder."
+ # shellcheck disable=SC2086 # Intentionally allow user-provided nuclei args
run_with_heartbeat "axiom nuclei ${crit}" axiom-scan .tmp/webs_subs.txt -m nuclei \
--nuclei-templates "$NUCLEI_TEMPLATES_PATH" \
-severity "$crit" -nh -rl "$NUCLEI_RATELIMIT" \
- -silent -retries 2 "$NUCLEI_EXTRA_ARGS" -j -o "nuclei_output/${crit}_json.txt" "$AXIOM_EXTRA_ARGS"
+ -silent -retries 2 $NUCLEI_EXTRA_ARGS -j -o "nuclei_output/${crit}_json.txt" "$AXIOM_EXTRA_ARGS"
_nuclei_parse_results "$crit"
done
printf "\n\n"
@@ -1027,11 +1052,15 @@ _fuzz_classify_targets() {
# Run ffuf locally with interlace, handling normal and slow targets separately
_fuzz_run_local() {
_fuzz_classify_targets
+ local ffuf_recursion_flags=""
+ if [[ ${DEEP:-false} == true ]]; then
+ ffuf_recursion_flags="-recursion -recursion-depth ${FUZZ_RECURSION_DEPTH:-2}"
+ fi
if [[ -s .tmp/webs_normal.txt ]]; then
run_with_heartbeat "ffuf normal targets" interlace \
-tL .tmp/webs_normal.txt -threads "${INTERLACE_THREADS}" \
- -c "ffuf ${FFUF_FLAGS} -t ${FFUF_THREADS} -rate ${FFUF_RATELIMIT} -H \"${HEADER}\" -w ${fuzz_wordlist} -maxtime ${FFUF_MAXTIME} -u _target_/FUZZ -o _output_/_cleantarget_.json" \
+ -c "ffuf ${FFUF_FLAGS} ${ffuf_recursion_flags} -t ${FFUF_THREADS} -rate ${FFUF_RATELIMIT} -H \"${HEADER}\" -w ${fuzz_wordlist} -maxtime ${FFUF_MAXTIME} -u _target_/FUZZ -o _output_/_cleantarget_.json" \
-o "$dir/.tmp/fuzzing"
fi
@@ -1042,7 +1071,7 @@ _fuzz_run_local() {
[[ ${FFUF_RATELIMIT:-0} -eq 0 ]] && slow_rate=50 || slow_rate=$((FFUF_RATELIMIT / 3 + 1))
run_with_heartbeat "ffuf slow targets" interlace \
-tL .tmp/webs_slow.txt -threads "${INTERLACE_THREADS}" \
- -c "ffuf ${FFUF_FLAGS} -t ${slow_threads} -rate ${slow_rate} -H \"${HEADER}\" -w ${fuzz_wordlist} -maxtime ${FFUF_MAXTIME} -u _target_/FUZZ -o _output_/_cleantarget_.json" \
+ -c "ffuf ${FFUF_FLAGS} ${ffuf_recursion_flags} -t ${slow_threads} -rate ${slow_rate} -H \"${HEADER}\" -w ${fuzz_wordlist} -maxtime ${FFUF_MAXTIME} -u _target_/FUZZ -o _output_/_cleantarget_.json" \
-o "$dir/.tmp/fuzzing"
fi
}
@@ -1119,8 +1148,8 @@ function iishortname() {
# Proceed only if iis_sites.txt exists and is non-empty
if [[ -s ".tmp/iis_sites.txt" ]]; then
- # Create necessary directories
- mkdir -p "$dir/vulns/iis-shortname-shortscan/" "$dir/vulns/iis-shortname-sns/"
+ # Create necessary directory
+ mkdir -p "$dir/vulns/iis-shortname-shortscan/"
# Run shortscan using interlace
run_command interlace -tL .tmp/iis_sites.txt -threads "$INTERLACE_THREADS" \
@@ -1134,18 +1163,6 @@ function iishortname() {
fi
done < <(find "$dir/vulns/iis-shortname-shortscan/" -type f -iname "*.txt" -print0 2>/dev/null)
- # Run sns using interlace
- run_command interlace -tL .tmp/iis_sites.txt -threads "$INTERLACE_THREADS" \
- -c "sns -u _target_ > _output_/_cleantarget_.txt" \
- -o "$dir/vulns/iis-shortname-sns/" 2>>"$LOGFILE" >/dev/null
-
- # Remove non-vulnerable sns results
- while IFS= read -r -d '' file; do
- if grep -q 'Target is not vulnerable' "$file" 2>/dev/null; then
- rm -f "$file" 2>>"$LOGFILE"
- fi
- done < <(find "$dir/vulns/iis-shortname-sns/" -type f -iname "*.txt" -print0 2>/dev/null)
-
fi
end_func "Results are saved in vulns/iis-shortname/" "${FUNCNAME[0]}"
else
@@ -1241,6 +1258,26 @@ function cms_scanner() {
fi
}
+_katana_headless_flags() {
+ local target_count="${1:-0}"
+ local profile="${KATANA_HEADLESS_PROFILE:-off}"
+ case "$profile" in
+ off) echo "" ;;
+ full) echo "-headless" ;;
+ smart)
+ if [[ "$target_count" -le "${KATANA_HEADLESS_SMART_LIMIT:-15}" ]]; then
+ echo "-headless"
+ else
+ echo ""
+ fi
+ ;;
+ *)
+ log_note "urlchecks: invalid KATANA_HEADLESS_PROFILE='${profile}', using off" "${FUNCNAME[0]}" "${LINENO}"
+ echo ""
+ ;;
+ esac
+}
+
function urlchecks() {
# Create necessary directories
@@ -1252,6 +1289,7 @@ function urlchecks() {
local end_message="Results are saved in $domain/webs/url_extract.txt"
local katana_timeout_cmd="${TIMEOUT_CMD:-timeout}"
local waymore_timeout_cmd="${TIMEOUT_CMD:-timeout}"
+ local katana_headless_flags=""
# Combine webs.txt and webs_uncommon_ports.txt if webs_all.txt doesn't exist
if [[ ! -s "webs/webs_all.txt" ]]; then
@@ -1259,6 +1297,9 @@ function urlchecks() {
fi
if [[ -s "webs/webs_all.txt" ]]; then
+ local katana_target_count=0
+ katana_target_count=$(wc -l <"webs/webs_all.txt" 2>/dev/null || echo 0)
+ katana_headless_flags=$(_katana_headless_flags "$katana_target_count")
if [[ $URL_CHECK_PASSIVE == true ]]; then
if [[ -s ".tmp/url_extract_tmp.txt" ]]; then
@@ -1317,15 +1358,15 @@ function urlchecks() {
LINES=$(wc -l <.tmp/katana_targets_normal.txt)
if [[ $LINES -gt ${CHUNK_LIMIT:-2000} ]]; then
if [[ $DEEP == true ]]; then
- process_in_chunks .tmp/katana_targets_normal.txt "${CHUNK_LIMIT:-2000}" "katana -silent -list _chunk_ -jc -kf all -c $KATANA_THREADS -d 3 -fs rdn >> .tmp/katana.txt 2>>\"$LOGFILE\" >/dev/null"
+ process_in_chunks .tmp/katana_targets_normal.txt "${CHUNK_LIMIT:-2000}" "katana -silent -list _chunk_ ${katana_headless_flags} -jc -kf all -c $KATANA_THREADS -d 3 -fs rdn >> .tmp/katana.txt 2>>\"$LOGFILE\" >/dev/null"
else
- process_in_chunks .tmp/katana_targets_normal.txt "${CHUNK_LIMIT:-2000}" "katana -silent -list _chunk_ -jc -kf all -c $KATANA_THREADS -d 2 -fs rdn >> .tmp/katana.txt 2>>\"$LOGFILE\""
+ process_in_chunks .tmp/katana_targets_normal.txt "${CHUNK_LIMIT:-2000}" "katana -silent -list _chunk_ ${katana_headless_flags} -jc -kf all -c $KATANA_THREADS -d 2 -fs rdn >> .tmp/katana.txt 2>>\"$LOGFILE\""
fi
else
if [[ $DEEP == true ]]; then
- run_with_heartbeat_shell "katana normal targets (deep)" "$katana_timeout_cmd 4h katana -silent -list .tmp/katana_targets_normal.txt -jc -kf all -c $KATANA_THREADS -d 3 -fs rdn >> .tmp/katana.txt 2>> \"$LOGFILE\""
+ run_with_heartbeat_shell "katana normal targets (deep)" "$katana_timeout_cmd 4h katana -silent -list .tmp/katana_targets_normal.txt ${katana_headless_flags} -jc -kf all -c $KATANA_THREADS -d 3 -fs rdn >> .tmp/katana.txt 2>> \"$LOGFILE\""
else
- run_with_heartbeat_shell "katana normal targets" "$katana_timeout_cmd 3h katana -silent -list .tmp/katana_targets_normal.txt -jc -kf all -c $KATANA_THREADS -d 2 -fs rdn >> .tmp/katana.txt 2>> \"$LOGFILE\""
+ run_with_heartbeat_shell "katana normal targets" "$katana_timeout_cmd 3h katana -silent -list .tmp/katana_targets_normal.txt ${katana_headless_flags} -jc -kf all -c $KATANA_THREADS -d 2 -fs rdn >> .tmp/katana.txt 2>> \"$LOGFILE\""
fi
fi
fi
@@ -1337,15 +1378,15 @@ function urlchecks() {
LINES=$(wc -l <.tmp/katana_targets_slow.txt)
if [[ $LINES -gt ${CHUNK_LIMIT:-2000} ]]; then
if [[ $DEEP == true ]]; then
- process_in_chunks .tmp/katana_targets_slow.txt "${CHUNK_LIMIT:-2000}" "katana -silent -list _chunk_ -jc -kf all -c $slow_c -d 3 -fs rdn >> .tmp/katana.txt 2>>\"$LOGFILE\""
+ process_in_chunks .tmp/katana_targets_slow.txt "${CHUNK_LIMIT:-2000}" "katana -silent -list _chunk_ ${katana_headless_flags} -jc -kf all -c $slow_c -d 3 -fs rdn >> .tmp/katana.txt 2>>\"$LOGFILE\""
else
- process_in_chunks .tmp/katana_targets_slow.txt "${CHUNK_LIMIT:-2000}" "katana -silent -list _chunk_ -jc -kf all -c $slow_c -d 2 -fs rdn >> .tmp/katana.txt 2>>\"$LOGFILE\""
+ process_in_chunks .tmp/katana_targets_slow.txt "${CHUNK_LIMIT:-2000}" "katana -silent -list _chunk_ ${katana_headless_flags} -jc -kf all -c $slow_c -d 2 -fs rdn >> .tmp/katana.txt 2>>\"$LOGFILE\""
fi
else
if [[ $DEEP == true ]]; then
- run_with_heartbeat_shell "katana slow targets (deep)" "$katana_timeout_cmd 4h katana -silent -list .tmp/katana_targets_slow.txt -jc -kf all -c $slow_c -d 3 -fs rdn >> .tmp/katana.txt 2>> \"$LOGFILE\""
+ run_with_heartbeat_shell "katana slow targets (deep)" "$katana_timeout_cmd 4h katana -silent -list .tmp/katana_targets_slow.txt ${katana_headless_flags} -jc -kf all -c $slow_c -d 3 -fs rdn >> .tmp/katana.txt 2>> \"$LOGFILE\""
else
- run_with_heartbeat_shell "katana slow targets" "$katana_timeout_cmd 3h katana -silent -list .tmp/katana_targets_slow.txt -jc -kf all -c $slow_c -d 2 -fs rdn >> .tmp/katana.txt 2>> \"$LOGFILE\""
+ run_with_heartbeat_shell "katana slow targets" "$katana_timeout_cmd 3h katana -silent -list .tmp/katana_targets_slow.txt ${katana_headless_flags} -jc -kf all -c $slow_c -d 2 -fs rdn >> .tmp/katana.txt 2>> \"$LOGFILE\""
fi
fi
fi
@@ -1361,9 +1402,9 @@ function urlchecks() {
if [[ $diff_webs != "0" ]] || [[ ! -s ".tmp/katana.txt" ]]; then
if [[ $URL_CHECK_ACTIVE == true ]]; then
if [[ $DEEP == true ]]; then
- run_with_heartbeat "axiom katana (deep)" axiom-scan webs/webs_all.txt -m katana -jc -kf all -d 3 -fs rdn --max-runtime 4h -o .tmp/katana.txt "$AXIOM_EXTRA_ARGS"
+ run_with_heartbeat "axiom katana (deep)" axiom-scan webs/webs_all.txt -m katana $katana_headless_flags -jc -kf all -d 3 -fs rdn --max-runtime 4h -o .tmp/katana.txt "$AXIOM_EXTRA_ARGS"
else
- run_with_heartbeat "axiom katana" axiom-scan webs/webs_all.txt -m katana -jc -kf all -d 2 -fs rdn --max-runtime 3h -o .tmp/katana.txt "$AXIOM_EXTRA_ARGS"
+ run_with_heartbeat "axiom katana" axiom-scan webs/webs_all.txt -m katana $katana_headless_flags -jc -kf all -d 2 -fs rdn --max-runtime 3h -o .tmp/katana.txt "$AXIOM_EXTRA_ARGS"
fi
fi
fi
@@ -1862,7 +1903,7 @@ function wordlist_gen_roboxtractor() {
function password_dict() {
# Create necessary directories
- if ! mkdir -p "$dir/webs"; then
+ if ! mkdir -p "$dir/webs" "$dir/.tmp"; then
print_warnf "Failed to create directories."
return 1
fi
@@ -1873,11 +1914,74 @@ function password_dict() {
start_func "${FUNCNAME[0]}" "Password Dictionary Generation"
- # Extract the first part of the domain
- word="${domain%%.*}"
+ local dict_engine="${PASSWORD_DICT_ENGINE:-cewl}"
+ local dict_output="$dir/webs/password_dict.txt"
+ : >"$dict_output"
+
+ # Ensure web targets exist for cewl.
+ if [[ ! -s "webs/webs_all.txt" ]]; then
+ cat webs/webs.txt webs/webs_uncommon_ports.txt 2>/dev/null | anew -q "webs/webs_all.txt"
+ fi
+
+ if [[ "$dict_engine" == "cewl" ]]; then
+ local cewl_cmd=()
+ if command -v cewl >/dev/null 2>&1; then
+ cewl_cmd=(cewl)
+ elif [[ -f "${tools}/CeWL/cewl.rb" ]]; then
+ cewl_cmd=(ruby "${tools}/CeWL/cewl.rb")
+ fi
+
+ if [[ ${#cewl_cmd[@]} -gt 0 ]] && [[ -s "webs/webs_all.txt" ]]; then
+ local max_targets="${PASSWORD_DICT_MAX_TARGETS:-50}"
+ if [[ ${DEEP:-false} == true ]]; then
+ max_targets=0
+ fi
+ if [[ "$max_targets" -gt 0 ]]; then
+ head -n "$max_targets" "webs/webs_all.txt" >".tmp/password_dict_targets.txt"
+ else
+ cp "webs/webs_all.txt" ".tmp/password_dict_targets.txt"
+ fi
+
+ : >".tmp/password_dict_raw.txt"
+ while IFS= read -r target; do
+ [[ -z "$target" ]] && continue
+ if [[ -n "${TIMEOUT_CMD:-}" ]]; then
+ run_command "$TIMEOUT_CMD" -k 5s "${PASSWORD_DICT_CEWL_TIMEOUT:-45}" "${cewl_cmd[@]}" "$target" \
+ -d "${PASSWORD_DICT_CEWL_DEPTH:-1}" -m "${PASSWORD_MIN_LENGTH:-5}" \
+ -w ".tmp/password_dict_part.txt" 2>>"$LOGFILE" >/dev/null || true
+ else
+ run_command "${cewl_cmd[@]}" "$target" \
+ -d "${PASSWORD_DICT_CEWL_DEPTH:-1}" -m "${PASSWORD_MIN_LENGTH:-5}" \
+ -w ".tmp/password_dict_part.txt" 2>>"$LOGFILE" >/dev/null || true
+ fi
+ if [[ -s ".tmp/password_dict_part.txt" ]]; then
+ cat ".tmp/password_dict_part.txt" >>".tmp/password_dict_raw.txt"
+ : >".tmp/password_dict_part.txt"
+ fi
+ done <".tmp/password_dict_targets.txt"
+
+ if [[ -s ".tmp/password_dict_raw.txt" ]]; then
+ awk -v min="${PASSWORD_MIN_LENGTH:-5}" -v max="${PASSWORD_MAX_LENGTH:-14}" '
+ {
+ w=tolower($0);
+ gsub(/[^a-z0-9._-]/, "", w);
+ if (length(w) >= min && length(w) <= max) print w;
+ }' ".tmp/password_dict_raw.txt" | sort -u >"$dict_output"
+ fi
+ fi
+ fi
+
+ # Fallback to pydictor when cewl is unavailable/empty or explicitly requested.
+ if [[ ! -s "$dict_output" ]] || [[ "$dict_engine" == "pydictor" ]]; then
+ local word="${domain%%.*}"
+ if [[ -s "${tools}/pydictor/pydictor.py" ]]; then
+ run_command python3 "${tools}/pydictor/pydictor.py" -extend "$word" --leet 0 1 2 11 21 --len "$PASSWORD_MIN_LENGTH" "$PASSWORD_MAX_LENGTH" -o "$dict_output" 2>>"$LOGFILE" >/dev/null
+ [[ "$dict_engine" == "cewl" ]] && log_note "password_dict: cewl unavailable/empty, pydictor fallback used" "${FUNCNAME[0]}" "${LINENO}"
+ elif [[ "$dict_engine" == "cewl" ]]; then
+ log_note "password_dict: cewl and pydictor unavailable, skipping output generation" "${FUNCNAME[0]}" "${LINENO}"
+ fi
+ fi
- # Run pydictor.py with specified parameters
- run_command python3 "${tools}/pydictor/pydictor.py" -extend "$word" --leet 0 1 2 11 21 --len "$PASSWORD_MIN_LENGTH" "$PASSWORD_MAX_LENGTH" -o "$dir/webs/password_dict.txt" 2>>"$LOGFILE" >/dev/null
end_func "Results are saved in $domain/webs/password_dict.txt" "${FUNCNAME[0]}"
# Optionally, create a marker file to indicate the function has been processed
@@ -1962,13 +2066,15 @@ function brokenLinks() {
fi
done <"webs/webs_all.txt"
else
+ local katana_legacy_headless=""
+ katana_legacy_headless=$(_katana_headless_flags "$(wc -l <webs/webs_all.txt 2>/dev/null || echo 0)")
if [[ $AXIOM != true ]]; then
# Use katana for scanning
if [[ ! -s ".tmp/katana.txt" ]]; then
if [[ $DEEP == true ]]; then
- timeout 4h katana -silent -list "webs/webs_all.txt" -jc -kf all -c "$KATANA_THREADS" -d 3 -o ".tmp/katana.txt" 2>>"$LOGFILE" >/dev/null
+ timeout 4h katana -silent -list "webs/webs_all.txt" $katana_legacy_headless -jc -kf all -c "$KATANA_THREADS" -d 3 -o ".tmp/katana.txt" 2>>"$LOGFILE" >/dev/null
else
- timeout 3h katana -silent -list "webs/webs_all.txt" -jc -kf all -c "$KATANA_THREADS" -d 2 -o ".tmp/katana.txt" 2>>"$LOGFILE" >/dev/null
+ timeout 3h katana -silent -list "webs/webs_all.txt" $katana_legacy_headless -jc -kf all -c "$KATANA_THREADS" -d 2 -o ".tmp/katana.txt" 2>>"$LOGFILE" >/dev/null
fi
fi
# Remove lines longer than 2048 characters
@@ -1979,9 +2085,9 @@ function brokenLinks() {
# Use axiom-scan for scanning
if [[ ! -s ".tmp/katana.txt" ]]; then
if [[ $DEEP == true ]]; then
- run_command axiom-scan "webs/webs_all.txt" -m katana -jc -kf all -d 3 --max-runtime 4h -o ".tmp/katana.txt" $AXIOM_EXTRA_ARGS 2>>"$LOGFILE" >/dev/null
+ run_command axiom-scan "webs/webs_all.txt" -m katana $katana_legacy_headless -jc -kf all -d 3 --max-runtime 4h -o ".tmp/katana.txt" $AXIOM_EXTRA_ARGS 2>>"$LOGFILE" >/dev/null
else
- run_command axiom-scan "webs/webs_all.txt" -m katana -jc -kf all -d 2 --max-runtime 3h -o ".tmp/katana.txt" $AXIOM_EXTRA_ARGS 2>>"$LOGFILE" >/dev/null
+ run_command axiom-scan "webs/webs_all.txt" -m katana $katana_legacy_headless -jc -kf all -d 2 --max-runtime 3h -o ".tmp/katana.txt" $AXIOM_EXTRA_ARGS 2>>"$LOGFILE" >/dev/null
fi
# Remove lines longer than 2048 characters
if [[ -s ".tmp/katana.txt" ]]; then
diff --git a/reconftw.cfg b/reconftw.cfg
index 3503648..82e47c2 100644
--- a/reconftw.cfg
+++ b/reconftw.cfg
@@ -30,6 +30,7 @@ INCREMENTAL_MODE=false # Only scan new findings since last run (use --incrementa
MONITOR_MODE=false # Continuous monitor mode (enabled by --monitor)
MONITOR_INTERVAL_MIN=60 # Minutes between monitoring cycles
MONITOR_MAX_CYCLES=0 # 0 = run forever until interrupted
+MONITOR_MIN_SEVERITY=high # Monitor nuclei deltas at/above: critical|high|medium|low|info
ALERT_SUPPRESSION=true # Suppress repeated monitor alerts using fingerprint history
ALERT_SEEN_FILE=".incremental/alerts_seen.hashes" # Fingerprint store for alert suppression
@@ -131,7 +132,8 @@ SUBSCRAPING=true # Subdomains extraction from web crawling
SUBPERMUTE=true # DNS permutations
SUBIAPERMUTE=true # Permutations by AI analysis
SUBREGEXPERMUTE=true # Permutations by regex analysis
-PERMUTATIONS_OPTION=gotator # The alternative is "ripgen" (faster, not deeper)
+PERMUTATIONS_ENGINE=gotator # gotator|ripgen|alterx|both
+PERMUTATIONS_OPTION="" # Legacy alias (deprecated): use PERMUTATIONS_ENGINE
GOTATOR_FLAGS=" -depth 1 -numbers 3 -mindup -adv -md" # Flags for gotator
SUBTAKEOVER=true # Check subdomain takeovers, false by default cuz nuclei already check this
SUB_RECURSIVE_PASSIVE=false # Uses a lot of API keys queries
@@ -151,7 +153,6 @@ VIRTUALHOSTS=false # Check virtualhosts by fuzzing HOST header
UNCOMMON_PORTS_WEB=$(cat "${SCRIPTPATH}/config/uncommon_ports_web.txt" 2>/dev/null | tr -d '\n') # Uncommon web ports for full probing
# Host
-FAVICON=true # Check Favicon domain discovery
FAVIRECON=true # Favicon-based technology recon over discovered web targets
FAVIRECON_CONCURRENCY=50 # favirecon concurrency
FAVIRECON_TIMEOUT=10 # favirecon timeout seconds
@@ -161,8 +162,16 @@ PORTSCANNER=true # Enable or disable the whole Port scanner module
GEO_INFO=true # Fetch Geolocalization info
PORTSCAN_PASSIVE=true # Port scanner with Shodan
PORTSCAN_ACTIVE=true # Port scanner with nmap
-PORTSCAN_ACTIVE_OPTIONS="--top-ports 200 -sV -n -Pn --open --max-retries 2 --script vulners"
+PORTSCAN_ACTIVE_OPTIONS="--top-ports 200 -sV -n -Pn --open --max-retries 2"
+PORTSCAN_DEEP_OPTIONS="--top-ports 1000 -sV -n -Pn --open --max-retries 2 --script vulners"
+PORTSCAN_STRATEGY=legacy # legacy|naabu_nmap
+NAABU_ENABLE=true # Use naabu pre-discovery when PORTSCAN_STRATEGY=naabu_nmap
+NAABU_RATE=1000 # naabu requests per second
+NAABU_PORTS="--top-ports 1000" # e.g. "--top-ports 1000" or "-p -"
+PORTSCAN_UDP=false # Optional UDP scan (requires privileges)
+PORTSCAN_UDP_OPTIONS="--top-ports 20 -sU -sV -n -Pn --open"
CDN_IP=true # Check which IPs belongs to CDN
+CDN_BYPASS=true # Try origin IP discovery for CDN-fronted assets with hakoriginfinder
# Web analysis
WAF_DETECTION=true # Detect WAFs
@@ -188,26 +197,32 @@ GETJSWORDS_PYTHON=python3
# Example: GETJSWORDS_VENV="$SCRIPTPATH/.venv"
GETJSWORDS_VENV="$SCRIPTPATH/.venv"
FUZZ=true # Web fuzzing
+FUZZ_RECURSION_DEPTH=2 # ffuf recursion depth used in DEEP mode
IIS_SHORTNAME=true
CMS_SCANNER=true # CMS scanner
WORDLIST=true # Wordlist generation
ROBOTSWORDLIST=true # Check historic disallow entries on waybackMachine
PASSWORD_DICT=true # Generate password dictionary
+PASSWORD_DICT_ENGINE=cewl # cewl|pydictor
+PASSWORD_DICT_MAX_TARGETS=50 # Max web targets processed by cewl when not DEEP
+PASSWORD_DICT_CEWL_DEPTH=1 # cewl crawl depth
+PASSWORD_DICT_CEWL_TIMEOUT=45 # timeout (seconds) per target when cewl runs
PASSWORD_MIN_LENGTH=5 # Min password length
PASSWORD_MAX_LENGTH=14 # Max password length
+KATANA_HEADLESS_PROFILE=off # off|smart|full
+KATANA_HEADLESS_SMART_LIMIT=15 # smart mode enables headless only for small target sets
CLOUDHUNTER_PERMUTATION=NORMAL # Options: DEEP (very slow), NORMAL (slow), NONE
# Vulns
VULNS_GENERAL=false # Enable or disable the vulnerability module (very intrusive and slow)
XSS=true # Check for xss with dalfox
-CORS=true # CORS misconfigs
TEST_SSL=true # SSL misconfigs
-OPEN_REDIRECT=true # Check open redirects
SSRF_CHECKS=true # SSRF checks
+SSRF_ALT_MATCH_REGEX="169\\.254\\.169\\.254|latest/meta-data|root:|127\\.0\\.0\\.1|localhost|gopher://|dict://|file://" # Body/content regex for alternate SSRF payload checks
CRLF_CHECKS=true # CRLF checks
LFI=true # LFI by fuzzing
SSTI=true # SSTI by fuzzing
-SSTI_ENGINE="tinja" # SSTI engine: tinja|legacy
+SSTI_ENGINE="tinja" # SSTI engine (legacy mode removed)
TINJA_RATELIMIT=0 # TInjA requests per second (0 = unlimited)
TINJA_TIMEOUT=15 # TInjA request timeout seconds
SQLI=true # Check SQLI
@@ -221,7 +236,6 @@ SECOND_ORDER_THREADS=10 # second-order thread count
SECOND_ORDER_INSECURE=false # second-order accept invalid TLS
SPRAY=true # Performs password spraying
COMM_INJ=true # Check for command injections with commix
-PROTO_POLLUTION=true # Check for prototype pollution flaws
SMUGGLING=true # Check for HTTP request smuggling flaws
WEBCACHE=true # Check for Web Cache issues
WEBCACHE_TOXICACHE=true # Complement webcache module with toxicache engine
@@ -229,6 +243,9 @@ TOXICACHE_THREADS=70 # toxicache worker threads
TOXICACHE_USER_AGENT="Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0" # toxicache user-agent
BYPASSER4XX=true # Check for 4XX bypasses
FUZZPARAMS=true # Fuzz parameters values
+NUCLEI_DAST=true # Run dedicated nuclei -dast module (forced on when VULNS_GENERAL=true, e.g. -a) over webs/urls/gf candidates
+NUCLEI_DAST_TEMPLATE_PATH="${NUCLEI_TEMPLATES_PATH}/dast" # DAST templates path
+NUCLEI_DAST_EXTRA_ARGS="" # Optional extra args only for nuclei_dast
# Parallelization
PARALLEL_MODE=true # Run independent functions in parallel (faster, uses more resources). Disable with --no-parallel or set false.
@@ -252,7 +269,6 @@ PAR_SUB_BRUTE_GROUP_SIZE=2
PAR_WEB_DETECT_GROUP_SIZE=3
PAR_VULNS_GROUP1_SIZE=4
PAR_VULNS_GROUP2_SIZE=4
-PAR_VULNS_GROUP3_SIZE=3
PAR_VULNS_GROUP4_SIZE=3
# Terminal output verbosity
diff --git a/tests/unit/test_monitor.bats b/tests/unit/test_monitor.bats
index 43fa164..a24fd17 100644
--- a/tests/unit/test_monitor.bats
+++ b/tests/unit/test_monitor.bats
@@ -64,3 +64,28 @@ teardown() {
run _monitor_mark_alert_seen "critical" "https://a.example.com"
[ "$status" -eq 1 ]
}
+
+@test "monitor_snapshot honors MONITOR_MIN_SEVERITY=medium and includes medium deltas" {
+ mkdir -p nuclei_output
+ export MONITOR_MIN_SEVERITY="medium"
+
+ printf 'a.example.com\n' > subdomains/subdomains.txt
+ printf 'https://a.example.com\n' > webs/webs_all.txt
+ printf '[tpl-c] [http] [critical] https://a.example.com\n' > nuclei_output/critical.txt
+ printf '[tpl-m] [http] [medium] https://a.example.com\n' > nuclei_output/medium.txt
+
+ export MONITOR_CYCLE=1
+ monitor_snapshot
+
+ printf 'b.example.com\n' >> subdomains/subdomains.txt
+ printf 'https://b.example.com\n' >> webs/webs_all.txt
+ printf '[tpl-m] [http] [medium] https://b.example.com\n' >> nuclei_output/medium.txt
+
+ export MONITOR_CYCLE=2
+ run monitor_snapshot
+ [ "$status" -eq 0 ]
+
+ latest_dir=".incremental/history/$(readlink .incremental/history/latest)"
+ [ -f "$latest_dir/medium_new.txt" ]
+ grep -q "b.example.com" "$latest_dir/medium_new.txt"
+}
diff --git a/tests/unit/test_new_tool_integrations.bats b/tests/unit/test_new_tool_integrations.bats
index 14ee17f..5a2fcf3 100644
--- a/tests/unit/test_new_tool_integrations.bats
+++ b/tests/unit/test_new_tool_integrations.bats
@@ -188,3 +188,45 @@ SH
[ -s "osint/postman_leaks.txt" ]
grep -q "postman.new.example.com" "osint/postman_leaks.txt"
}
+
+@test "nuclei_dast is forced on when VULNS_GENERAL=true" {
+ mkdir -p webs .tmp gf vulns nuclei_output
+ printf 'https://target.example.com\n' > webs/webs_all.txt
+
+ # Mock nuclei: write one JSON line when -o <file> is used; no-op for update calls.
+ cat > "$MOCK_BIN/nuclei" <<'SH'
+#!/usr/bin/env bash
+outfile=""
+while [[ $# -gt 0 ]]; do
+ case "$1" in
+ -o)
+ outfile="$2"
+ shift 2
+ ;;
+ *)
+ shift
+ ;;
+ esac
+done
+if [[ -n "$outfile" ]]; then
+ mkdir -p "$(dirname "$outfile")"
+ printf '%s\n' '{"template-id":"mock-dast","type":"http","info":{"severity":"high"},"host":"https://target.example.com","matched-at":"https://target.example.com/"}' > "$outfile"
+fi
+exit 0
+SH
+ chmod +x "$MOCK_BIN/nuclei"
+
+ export VULNS_GENERAL=true
+ export NUCLEI_DAST=false
+ export NUCLEI_RATELIMIT=10
+ export DEEP=false
+ export DEEP_LIMIT2=1500
+ export NUCLEI_TEMPLATES_PATH="$TEST_DIR/nuclei-templates"
+ mkdir -p "$NUCLEI_TEMPLATES_PATH/dast"
+
+ run nuclei_dast
+ [ "$status" -eq 0 ]
+ [ -s "nuclei_output/dast_json.txt" ]
+ [ -s "vulns/nuclei_dast.txt" ]
+ grep -q "mock-dast" "vulns/nuclei_dast.txt"
+}
diff --git a/tests/unit/test_webprobe_simple_merge.bats b/tests/unit/test_webprobe_simple_merge.bats
new file mode 100644
index 0000000..27b6c2b
--- /dev/null
+++ b/tests/unit/test_webprobe_simple_merge.bats
@@ -0,0 +1,65 @@
+#!/usr/bin/env bats
+
+setup() {
+ local project_root
+ project_root="$(cd "$(dirname "$BATS_TEST_FILENAME")/../.." && pwd)"
+ export SCRIPTPATH="$project_root"
+ export LOGFILE="/dev/null"
+ export bred='' bblue='' bgreen='' byellow='' yellow='' reset=''
+
+ export TEST_DIR="$BATS_TEST_TMPDIR/reconftw_webprobe_merge"
+ mkdir -p "$TEST_DIR"
+ export dir="$TEST_DIR/example.com"
+ export called_fn_dir="$dir/.called_fn"
+ mkdir -p "$called_fn_dir" "$dir"
+ cd "$dir"
+
+ export MOCK_BIN="$TEST_DIR/mockbin"
+ mkdir -p "$MOCK_BIN"
+ export PATH="$MOCK_BIN:$PATH"
+
+ source "$project_root/reconftw.sh" --source-only
+ export domain="example.com"
+ export DIFF=false
+ export AXIOM=false
+ export WEBPROBESIMPLE=true
+ export HTTPX_FLAGS=""
+ export HTTPX_THREADS=10
+ export HTTPX_RATELIMIT=0
+ export HTTPX_TIMEOUT=10
+}
+
+teardown() {
+ [[ -d "$TEST_DIR" ]] && rm -rf "$TEST_DIR"
+}
+
+@test "webprobe_simple merges current probe output with prior web_full_info cache" {
+ mkdir -p .tmp webs subdomains
+ printf "a.example.com\n" > subdomains/subdomains.txt
+ printf '%s\n' '{"input":"old","url":"https://old.example.com"}' > .tmp/web_full_info.txt
+
+ cat > "$MOCK_BIN/httpx" <<'SH'
+#!/usr/bin/env bash
+out=""
+while [[ $# -gt 0 ]]; do
+ case "$1" in
+ -o)
+ out="$2"
+ shift 2
+ ;;
+ *)
+ shift
+ ;;
+ esac
+done
+printf '%s\n' '{"input":"new","url":"https://new.example.com"}' > "$out"
+SH
+ chmod +x "$MOCK_BIN/httpx"
+
+ run webprobe_simple
+ [ "$status" -eq 0 ]
+ [ -s "webs/web_full_info.txt" ]
+ grep -q "old.example.com" "webs/web_full_info.txt"
+ grep -q "new.example.com" "webs/web_full_info.txt"
+}
+