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
Shell bug-bountybugbountybugbounty-tooldnshackingnucleiosintpenetration-testingpentestpentest-toolpentestingreconreconnaissancescannersecuritysecurity-toolssubdomainsubdomain-enumerationvulnerabilities
new output
six2dez774461dbcab8
diff --git a/lib/common.sh b/lib/common.shindex d177447..390b044 100644--- a/lib/common.sh+++ b/lib/common.sh@@ -18,7 +18,7 @@ ensure_dirs() {return 0fiif ! mkdir -p "$@" 2>/dev/null; then- printf "%b[!] Failed to create directories: %s%b\n" "${bred:-}" "$*" "${reset:-}" >&2+ _print_error "Failed to create directories: $*"return 1fireturn 0@@ -79,6 +79,54 @@ count_lines_stdin() {echo "${count:-0}"}+###############################################################################+# Output Primitives+###############################################################################++# Section header for major phases (OSINT, Subdomains, Web, Vulns, etc.)+# Usage: _print_section "OSINT"+# Output: ══════════════════ OSINT ══════════════════+_print_section() {+ [[ "${OUTPUT_VERBOSITY:-1}" -lt 1 ]] && return 0+ local title="$1"+ printf "\n%b══════════════════ %s ══════════════════%b\n\n" "${bgreen:-}" "$title" "${reset:-}"+}++# Compact status line for OK/FAIL/WARN/SKIP/INFO+# Usage: _print_status OK "sub_passive" "12s"+# _print_status SKIP "sub_crt" "(disabled)"+_print_status() {+ [[ "${OUTPUT_VERBOSITY:-1}" -lt 1 ]] && return 0+ local badge="$1" text="$2" detail="${3:-}"+ local color+ case "$badge" in+ OK) color="${bgreen:-}" ;;+ FAIL) color="${bred:-}" ;;+ WARN) color="${yellow:-}" ;;+ SKIP) color="${yellow:-}" ;;+ *) color="${bblue:-}" ;;+ esac+ if [[ -n "$detail" ]]; then+ printf " %b[%-4s]%b %-38s %s\n" "$color" "$badge" "${reset:-}" "$text" "$detail"+ else+ printf " %b[%-4s]%b %s\n" "$color" "$badge" "${reset:-}" "$text"+ fi+}++# Error that always shows (even in quiet mode)+# Usage: _print_error "something failed"+_print_error() {+ local msg="$1"+ printf "%b[%s] ERROR: %s%b\n" "${bred:-}" "$(date +'%Y-%m-%d %H:%M:%S')" "$msg" "${reset:-}" >&2+}++# Thin decorative rule (replaces heavy ###...### separators)+# Usage: _print_rule+_print_rule() {+ [[ "${OUTPUT_VERBOSITY:-1}" -lt 1 ]] && return 0+ printf "%b──────────────────────────────────────────────────────────────%b\n" "${bgreen:-}" "${reset:-}"+}+################################################################################ Notifications###############################################################################diff --git a/lib/parallel.sh b/lib/parallel.shindex e962973..f0ea9ce 100644--- a/lib/parallel.sh+++ b/lib/parallel.sh@@ -320,10 +320,11 @@ parallel_passive_enum() {"sub_passive""sub_crt")-- printf "%b[*] Running passive enumeration in parallel (%d functions)%b\n" \- "${bblue:-}" "${#funcs[@]}" "${reset:-}"-++ [[ "${OUTPUT_VERBOSITY:-1}" -ge 1 ]] && \+ printf "%b[*] Running passive enumeration in parallel (%d functions)%b\n" \+ "${bblue:-}" "${#funcs[@]}" "${reset:-}"+parallel_funcs 2 "${funcs[@]}"}@@ -336,10 +337,11 @@ parallel_active_enum() {"sub_noerror""sub_dns")-- printf "%b[*] Running active enumeration in parallel (%d functions)%b\n" \- "${bblue:-}" "${#funcs[@]}" "${reset:-}"-++ [[ "${OUTPUT_VERBOSITY:-1}" -ge 1 ]] && \+ printf "%b[*] Running active enumeration in parallel (%d functions)%b\n" \+ "${bblue:-}" "${#funcs[@]}" "${reset:-}"+parallel_funcs 3 "${funcs[@]}"}@@ -351,10 +353,11 @@ parallel_postactive_enum() {"sub_tls""sub_analytics")-- printf "%b[*] Running post-active enumeration in parallel (%d functions)%b\n" \- "${bblue:-}" "${#funcs[@]}" "${reset:-}"-++ [[ "${OUTPUT_VERBOSITY:-1}" -ge 1 ]] && \+ printf "%b[*] Running post-active enumeration in parallel (%d functions)%b\n" \+ "${bblue:-}" "${#funcs[@]}" "${reset:-}"+parallel_funcs 2 "${funcs[@]}"}@@ -368,9 +371,10 @@ parallel_brute_enum() {)# Brute force is resource intensive, run with limit of 2- printf "%b[*] Running brute force enumeration (limited parallelism)%b\n" \- "${bblue:-}" "${reset:-}"-+ [[ "${OUTPUT_VERBOSITY:-1}" -ge 1 ]] && \+ printf "%b[*] Running brute force enumeration (limited parallelism)%b\n" \+ "${bblue:-}" "${reset:-}"+parallel_funcs 2 "${funcs[@]}"}@@ -388,9 +392,10 @@ parallel_web_vulns() {"xss")- printf "%b[*] Running web vulnerability checks in parallel (%d checks)%b\n" \- "${bblue:-}" "${#funcs[@]}" "${reset:-}"-+ [[ "${OUTPUT_VERBOSITY:-1}" -ge 1 ]] && \+ printf "%b[*] Running web vulnerability checks in parallel (%d checks)%b\n" \+ "${bblue:-}" "${#funcs[@]}" "${reset:-}"+parallel_funcs 4 "${funcs[@]}"}@@ -404,9 +409,10 @@ parallel_injection_vulns() {"command_injection")- printf "%b[*] Running injection vulnerability checks in parallel (%d checks)%b\n" \- "${bblue:-}" "${#funcs[@]}" "${reset:-}"-+ [[ "${OUTPUT_VERBOSITY:-1}" -ge 1 ]] && \+ printf "%b[*] Running injection vulnerability checks in parallel (%d checks)%b\n" \+ "${bblue:-}" "${#funcs[@]}" "${reset:-}"+parallel_funcs 4 "${funcs[@]}"}@@ -419,9 +425,10 @@ parallel_server_vulns() {"smuggling")- printf "%b[*] Running server-side vulnerability checks in parallel (%d checks)%b\n" \- "${bblue:-}" "${#funcs[@]}" "${reset:-}"-+ [[ "${OUTPUT_VERBOSITY:-1}" -ge 1 ]] && \+ printf "%b[*] Running server-side vulnerability checks in parallel (%d checks)%b\n" \+ "${bblue:-}" "${#funcs[@]}" "${reset:-}"+parallel_funcs 3 "${funcs[@]}"}@@ -440,9 +447,10 @@ parallel_osint() {"domain_info")- printf "%b[*] Running OSINT gathering in parallel (%d sources)%b\n" \- "${bblue:-}" "${#funcs[@]}" "${reset:-}"-+ [[ "${OUTPUT_VERBOSITY:-1}" -ge 1 ]] && \+ printf "%b[*] Running OSINT gathering in parallel (%d sources)%b\n" \+ "${bblue:-}" "${#funcs[@]}" "${reset:-}"+parallel_funcs 4 "${funcs[@]}"}@@ -454,8 +462,9 @@ parallel_osint() {# Usage: parallel_subdomains_full# This replaces the sequential execution in subdomains_full()parallel_subdomains_full() {- printf "%b[*] Starting parallelized subdomain enumeration%b\n" \- "${bblue:-}" "${reset:-}"+ [[ "${OUTPUT_VERBOSITY:-1}" -ge 1 ]] && \+ printf "%b[*] Starting parallelized subdomain enumeration%b\n" \+ "${bblue:-}" "${reset:-}"# Phase 1: Passive enumeration (parallel - no dependencies)parallel_passive_enum@@ -479,15 +488,17 @@ parallel_subdomains_full() {[[ ${SUBSCRAPING:-false} == true ]] && sub_scraping[[ ${SUB_RECURSIVE_BRUTE:-false} == true ]] && sub_recursive_brute- printf "%b[*] Parallelized subdomain enumeration complete%b\n" \- "${bgreen:-}" "${reset:-}"+ [[ "${OUTPUT_VERBOSITY:-1}" -ge 1 ]] && \+ printf "%b[*] Parallelized subdomain enumeration complete%b\n" \+ "${bgreen:-}" "${reset:-}"}# Orchestrate full vulnerability scanning with parallelization# Usage: parallel_vulns_fullparallel_vulns_full() {- printf "%b[*] Starting parallelized vulnerability scanning%b\n" \- "${bblue:-}" "${reset:-}"+ [[ "${OUTPUT_VERBOSITY:-1}" -ge 1 ]] && \+ printf "%b[*] Starting parallelized vulnerability scanning%b\n" \+ "${bblue:-}" "${reset:-}"# Run nuclei first (it's comprehensive)nuclei_check@@ -497,6 +508,7 @@ parallel_vulns_full() {parallel_injection_vulnsparallel_server_vulns- printf "%b[*] Parallelized vulnerability scanning complete%b\n" \- "${bgreen:-}" "${reset:-}"+ [[ "${OUTPUT_VERBOSITY:-1}" -ge 1 ]] && \+ printf "%b[*] Parallelized vulnerability scanning complete%b\n" \+ "${bgreen:-}" "${reset:-}"}diff --git a/modules/axiom.sh b/modules/axiom.shindex a8436b4..bf2d977 100644--- a/modules/axiom.sh+++ b/modules/axiom.sh@@ -112,7 +112,7 @@ function axiom_launch() {# To re-enable: [[ -n ${AXIOM_FLEET_REGIONS-} ]] && AXIOM_FLEET_ARGS+=( --regions="${AXIOM_FLEET_REGIONS}" )# Show the exact command with proper quoting- printf 'axiom-fleet %q' "${AXIOM_FLEET_NAME}"+ printf 'axiom-fleet2 %q' "${AXIOM_FLEET_NAME}"printf ' %q' "${AXIOM_FLEET_ARGS[@]}"echoaxiom-fleet2 "${AXIOM_FLEET_NAME}" "${AXIOM_FLEET_ARGS[@]}"diff --git a/modules/core.sh b/modules/core.shindex 5f1c2bc..a6ca278 100644--- a/modules/core.sh+++ b/modules/core.sh@@ -11,15 +11,8 @@exit 1}-# ---------------------------------------# Classic UI wrappers (no tput/icons)-# ---------------------------------------+# pt_header kept as no-op for backward compatibility (used by help())pt_header() { :; }-pt_msg_run() { printf "\n%b[%s] %s%b\n" "$yellow" "$(date +'%Y-%m-%d %H:%M:%S')" "$1" "$reset"; }-pt_msg_ok() { printf "\n%b[%s] %s%b\n" "$bgreen" "$(date +'%Y-%m-%d %H:%M:%S')" "$1" "$reset"; }-pt_msg_warn() { printf "\n%b[%s] %s%b\n" "$yellow" "$(date +'%Y-%m-%d %H:%M:%S')" "$1" "$reset"; }-pt_msg_err() { printf "\n%b[%s] %s%b\n" "$bred" "$(date +'%Y-%m-%d %H:%M:%S')" "$1" "$reset"; }# Ensure a safe default for early log redirections# If LOGFILE is unset or empty, send logs to /dev/null until later initialization@@ -66,8 +59,7 @@ enable_command_trace() {fi[[ -z ${LOGFILE:-} ]] && return- printf "%b[%s] WARNING: Command tracing enabled. Logs may contain sensitive data.%b\n" \- "$yellow" "$(date +'%Y-%m-%d %H:%M:%S')" "$reset" >&2+ _print_status WARN "Command tracing enabled" "Logs may contain sensitive data"# Close any previous trace descriptor (native bash {varname} redirect syntax)if [[ -n ${TRACE_FD:-} ]]; then@@ -132,19 +124,19 @@ function check_version() {# Check if git is installedif ! command -v git >/dev/null 2>&1; then- printf "\n%bGit is not installed. Cannot check for updates.%b\n\n" "$bred" "$reset"+ _print_error "Git is not installed. Cannot check for updates"return 1fi# Check if current directory is a git repositoryif ! git rev-parse --is-inside-work-tree >/dev/null 2>&1; then- printf "\n%bCurrent directory is not a git repository. Cannot check for updates.%b\n\n" "$bred" "$reset"+ _print_error "Current directory is not a git repository. Cannot check for updates"return 1fi# Fetch updates with a timeout (supports gtimeout on macOS)if ! { [[ -n $TIMEOUT_CMD ]] && $TIMEOUT_CMD 10 git fetch >/dev/null 2>&1; } && ! git fetch >/dev/null 2>&1; then- printf "\n%bUnable to check updates (git fetch timed out).%b\n\n" "$bred" "$reset"+ _print_error "Unable to check updates (git fetch timed out)"return 1fi@@ -156,7 +148,7 @@ function check_version() {local UPSTREAMUPSTREAM=$(git rev-parse --abbrev-ref --symbolic-full-name "@{u}" 2>/dev/null)if [[ -z $UPSTREAM ]]; then- printf "\n%bNo upstream branch set for '%s'. Cannot check for updates.%b\n\n" "$bred" "$BRANCH" "$reset"+ _print_error "No upstream branch set for '${BRANCH}'. Cannot check for updates"return 1fi@@ -167,14 +159,13 @@ function check_version() {# Compare local and remote hashesif [[ $LOCAL != "$REMOTE" ]]; then- printf "\n%bThere is a new version available. Run ./install.sh to get the latest version.%b\n\n" "$yellow" "$reset"+ _print_status WARN "New version available" "Run ./install.sh to update"fi}function tools_installed() {# Check if all tools are installed- printf "\n\n%b#######################################################################%b\n" "$bgreen" "$reset"- printf "%b[%s] Checking installed tools %b\n\n" "$bblue" "$(date +'%Y-%m-%d %H:%M:%S')" "$reset"+ _print_section "Tools Check"local all_installed=truelocal missing_tools=()@@ -183,7 +174,7 @@ function tools_installed() {local env_vars=("GOPATH" "GOROOT" "PATH")for var in "${env_vars[@]}"; doif [[ -z ${!var} ]]; then- printf "%b [*] %s variable\t\t[NO]%b\n" "$bred" "$var" "$reset"+ _print_status FAIL "${var} variable"all_installed=falsemissing_tools+=("$var environment variable")fi@@ -348,20 +339,16 @@ function tools_installed() {doneif [[ $all_installed == true ]]; then- printf "%b\n Good! All tools are installed! %b\n\n" "$bgreen" "$reset"+ _print_status OK "All tools are installed"else- printf "\n%bSome tools or directories are missing:%b\n\n" "$yellow" "$reset"+ _print_status WARN "Some tools or directories are missing"for tool in "${missing_tools[@]}"; do- printf "%b - %s %b\n" "$bred" "$tool" "$reset"+ _print_status FAIL "$tool"doneprintf "\n%bTry running the installer script again: ./install.sh%b\n" "$yellow" "$reset"- printf "%bIf it fails, try installing the missing tools manually.%b\n" "$yellow" "$reset"- printf "%bEnsure that the %b\$tools%b variable is correctly set at the start of this script.%b\n" "$yellow" "$bred" "$yellow" "$reset"- printf "%bIf you need assistance, feel free to contact me! :D%b\n\n" "$yellow" "$reset"fi- printf "%b[%s] Tools check finished%b\n" "$bblue" "$(date +'%Y-%m-%d %H:%M:%S')" "$reset"- printf "%b#######################################################################\n%b" "$bgreen" "$reset"+ _print_status INFO "Tools check finished"if [[ $CHECK_TOOLS_OR_EXIT == true && $all_installed != true ]]; thenexit 2@@ -386,15 +373,14 @@ function check_critical_dependencies() {local missing_critical=()local all_critical_ok=true- printf "\n%b#######################################################################%b\n" "$bgreen" "$reset"- printf "%b[%s] Checking critical dependencies%b\n\n" "$bblue" "$(date +'%Y-%m-%d %H:%M:%S')" "$reset"+ _print_section "Critical Dependencies"for item in "${critical_tools[@]}"; dolocal tool="${item%%:*}"local description="${item#*:}"if ! command -v "$tool" >/dev/null 2>&1; then- printf "%b [✗] %s (%s) - MISSING%b\n" "$bred" "$description" "$tool" "$reset"+ _print_status FAIL "${description} (${tool})" "MISSING"missing_critical+=("$tool")all_critical_ok=falseelse@@ -410,28 +396,33 @@ function check_critical_dependencies() {version=$($tool --version 2>&1 | head -n1 || echo "installed");;esac- printf "%b [✓] %s (%s) - %s%b\n" "$bgreen" "$description" "$tool" "$version" "$reset"+ _print_status OK "${description} (${tool})" "${version}"fidone- printf "\n"-if [[ $all_critical_ok == false ]]; then- printf "%b[%s] ERROR: Critical dependencies missing!%b\n" "$bred" "$(date +'%Y-%m-%d %H:%M:%S')" "$reset"- printf "%bThe following tools are required for reconFTW to function:%b\n" "$yellow" "$reset"+ _print_error "Critical dependencies missing!"for tool in "${missing_critical[@]}"; do- printf "%b - %s%b\n" "$bred" "$tool" "$reset"+ _print_status FAIL "$tool"done- printf "\n%bPlease install these tools and try again.%b\n" "$yellow" "$reset"- printf "%bYou can run: ./install.sh to install all dependencies.%b\n" "$yellow" "$reset"- printf "%b#######################################################################%b\n\n" "$bgreen" "$reset"+ printf "\n%bPlease install these tools and try again: ./install.sh%b\n" "$yellow" "$reset"exit 1else- printf "%b[%s] All critical dependencies are installed%b\n" "$bgreen" "$(date +'%Y-%m-%d %H:%M:%S')" "$reset"- printf "%b#######################################################################%b\n\n" "$bgreen" "$reset"+ _print_status OK "All critical dependencies are installed"fi}+# Report optional API keys used by passive URL providers.+# Missing keys are informational only; scan continues in best-effort mode.+function check_optional_api_keys() {+ local urlscan_state="configured"+ local vt_state="configured"+ [[ -z "${URLSCAN_API_KEY:-}" ]] && urlscan_state="not configured (best-effort mode)"+ [[ -z "${VIRUSTOTAL_API_KEY:-}" ]] && vt_state="not configured (best-effort mode)"++ _print_status INFO "Optional API keys" "URLSCAN=${urlscan_state} | VT=${vt_state}"+}+###################################################################################################################################################### LOGGING #################################################################################################################################################################@@ -447,8 +438,7 @@ function log_init() {STRUCTURED_LOG_FILE="${dir}/.log/structured_$(date +%Y%m%d_%H%M%S).jsonl"mkdir -p "$(dirname "$STRUCTURED_LOG_FILE")"- printf "%b[%s] Structured logging enabled: %s%b\n" \- "$bgreen" "$(date +'%Y-%m-%d %H:%M:%S')" "$STRUCTURED_LOG_FILE" "$reset"+ _print_status OK "Structured logging enabled" "$STRUCTURED_LOG_FILE"}# Log structured JSON event@@ -1055,7 +1045,7 @@ function transfer {function sendToNotify {if [[ -z $1 ]]; then- printf "\n${yellow}[$(date +'%Y-%m-%d %H:%M:%S')] No file provided to send ${reset}\n"+ _print_status WARN "No file provided to send"elseif [[ -z $NOTIFY_CONFIG ]]; thenNOTIFY_CONFIG=~/.config/notify/provider-config.yaml@@ -1084,9 +1074,7 @@ function sendToNotify {}function start_func() {- if [[ "${OUTPUT_VERBOSITY:-1}" -ge 1 ]]; then- printf "${bgreen}#######################################################################"- fi+ _print_rulenotification "${2}" infoecho "[$current_date] Start function: ${1} " >>"${LOGFILE}"start=$(date +%s)@@ -1098,13 +1086,15 @@ function end_func() {end=$(date +%s)getElapsedTime "$start" "$end"record_func_timing "${2}" "$((end - start))"- notification "${2} Finished in ${runtime}" info+ local duration=$((end - start))echo "[$current_date] End function: ${2} " >>"${LOGFILE}"if [[ "${OUTPUT_VERBOSITY:-1}" -ge 1 ]]; then- printf "${bblue}[$current_date] ${1} ${reset}\n"- printf "${bgreen}#######################################################################${reset}\n"+ _print_status OK "${2}" "${duration}s"+ if [[ -n "${1:-}" ]]; then+ printf " %b%s%b\n" "${bblue:-}" "${1}" "${reset:-}"+ fifi- log_json "SUCCESS" "${2}" "Function completed" "runtime=${runtime}" "duration_sec=$((end - start))"+ log_json "SUCCESS" "${2}" "Function completed" "runtime=${runtime}" "duration_sec=${duration}"}function start_subfunc() {@@ -1118,11 +1108,12 @@ function end_subfunc() {touch "$called_fn_dir/.${2}"end_sub=$(date +%s)getElapsedTime "$start_sub" "$end_sub"+ local duration=$((end_sub - start_sub))if [[ "${OUTPUT_VERBOSITY:-1}" -ge 1 ]]; then- notification " ${1} in ${runtime}" good+ _print_status OK " ${2}" "${duration}s"fiecho "[$current_date] End subfunction: ${1} " >>"${LOGFILE}"- log_json "SUCCESS" "${2}" "Subfunction completed" "runtime=${runtime}" "duration_sec=$((end_sub - start_sub))"+ log_json "SUCCESS" "${2}" "Subfunction completed" "runtime=${runtime}" "duration_sec=${duration}"}function check_inscope() {@@ -1707,6 +1698,29 @@ function export_csv_artifacts() {fi}+# Export clean text artifacts for copy/paste workflows.+# Outputs:+# - report/subdomains_clean.txt+# - report/webs_clean.txt+# - report/ips_clean.txt+function export_clean_text_artifacts() {+ ensure_dirs report || return 1++ if [[ -s subdomains/subdomains.txt ]]; then+ sed '/^$/d' subdomains/subdomains.txt | sort -u >report/subdomains_clean.txt+ else+ : >report/subdomains_clean.txt+ fi++ if [[ -s webs/webs_all.txt ]]; then+ sed '/^$/d' webs/webs_all.txt | sort -u >report/webs_clean.txt+ else+ : >report/webs_clean.txt+ fi++ cat hosts/ips.txt hosts/ips_v6.txt 2>/dev/null | sed '/^$/d' | sort -u >report/ips_clean.txt+}+# Export orchestrator.# EXPORT_FORMAT values: json | html | csv | allfunction export_reports() {@@ -1719,19 +1733,23 @@ function export_reports() {case "$fmt" injson)export_findings_jsonl+ export_clean_text_artifactsnotification "Exported JSON artifacts under report/" info;;html)+ export_clean_text_artifactsnotification "Exported HTML report at report/index.html" info;;csv)export_findings_jsonlexport_csv_artifacts+ export_clean_text_artifactsnotification "Exported CSV artifacts under report/" info;;all)export_findings_jsonlexport_csv_artifacts+ export_clean_text_artifactsnotification "Exported JSONL + CSV + HTML artifacts under report/" info;;*)@@ -1744,78 +1762,71 @@ function health_check() {local failures=0local warnings=0- printf "\n%b#######################################################################%b\n" "$bgreen" "$reset"- printf "%b[%s] reconFTW Health Check%b\n\n" "$bblue" "$(date +'%Y-%m-%d %H:%M:%S')" "$reset"+ _print_section "Health Check"# 1. Check critical tools- printf "%b[*] Checking critical tools...%b\n" "$yellow" "$reset"+ _print_status INFO "Checking critical tools..."local critical_tools=("bash" "python3" "curl" "git" "jq")for tool in "${critical_tools[@]}"; doif command -v "$tool" >/dev/null 2>&1; then- printf " %b[OK]%b %s\n" "$bgreen" "$reset" "$tool"+ _print_status OK "$tool"else- printf " %b[FAIL]%b %s not found\n" "$bred" "$reset" "$tool"+ _print_status FAIL "$tool" "not found"((failures++))fidone# 2. Check key recon tools- printf "\n%b[*] Checking recon tools...%b\n" "$yellow" "$reset"+ _print_status INFO "Checking recon tools..."local recon_tools=("subfinder" "httpx" "nuclei" "naabu" "ffuf" "dnsx" "anew" "notify")for tool in "${recon_tools[@]}"; doif command -v "$tool" >/dev/null 2>&1; then- printf " %b[OK]%b %s\n" "$bgreen" "$reset" "$tool"+ _print_status OK "$tool"else- printf " %b[WARN]%b %s not found\n" "$byellow" "$reset" "$tool"+ _print_status WARN "$tool" "not found"((warnings++))fidone# 3. Check network connectivity- printf "\n%b[*] Checking network connectivity...%b\n" "$yellow" "$reset"+ _print_status INFO "Checking network connectivity..."if curl -s --connect-timeout 5 -o /dev/null -w "%{http_code}" "https://www.google.com" | grep -q "200\|301\|302"; then- printf " %b[OK]%b Internet connectivity\n" "$bgreen" "$reset"+ _print_status OK "Internet connectivity"else- printf " %b[WARN]%b No internet connectivity\n" "$byellow" "$reset"+ _print_status WARN "No internet connectivity"((warnings++))fi# 4. Check disk space- printf "\n%b[*] Checking disk space...%b\n" "$yellow" "$reset"+ _print_status INFO "Checking disk space..."local avail_gb- if [[ "$OSTYPE" == "darwin"* ]]; then- # macOS: df -g shows GB directly- avail_gb=$(df -g . 2>/dev/null | awk 'NR==2 {print $4}')- else- # Linux: df -BG shows GB with G suffix- avail_gb=$(df -BG . 2>/dev/null | awk 'NR==2 {gsub(/G/,"",$4); print $4}')- fi+ avail_gb=$(df -Pk . 2>/dev/null | awk 'NR==2 {print int($4 / 1024 / 1024)}')avail_gb=${avail_gb:-0}-+if [[ ${avail_gb} -ge 5 ]]; then- printf " %b[OK]%b %s GB available\n" "$bgreen" "$reset" "$avail_gb"+ _print_status OK "Disk space" "${avail_gb} GB available"elif [[ ${avail_gb} -ge 1 ]]; then- printf " %b[WARN]%b Only %s GB available (recommend 5+ GB)\n" "$byellow" "$reset" "$avail_gb"+ _print_status WARN "Disk space" "Only ${avail_gb} GB available (recommend 5+ GB)"((warnings++))else- printf " %b[FAIL]%b Less than 1 GB available\n" "$bred" "$reset"+ _print_status FAIL "Disk space" "Less than 1 GB available"((failures++))fi# 5. Check resolver files- printf "\n%b[*] Checking resolver files...%b\n" "$yellow" "$reset"+ _print_status INFO "Checking resolver files..."local resolvers_path="${resolvers:-${SCRIPTPATH}/resolvers.txt}"if [[ -s "$resolvers_path" ]]; thenlocal countcount=$(wc -l <"$resolvers_path")- printf " %b[OK]%b Resolvers file: %s (%s entries)\n" "$bgreen" "$reset" "$resolvers_path" "$count"+ _print_status OK "Resolvers file" "${resolvers_path} (${count} entries)"else- printf " %b[WARN]%b Resolvers file not found or empty: %s\n" "$byellow" "$reset" "$resolvers_path"+ _print_status WARN "Resolvers file" "not found or empty: ${resolvers_path}"((warnings++))fi# 6. Check API key status- printf "\n%b[*] Checking API keys...%b\n" "$yellow" "$reset"+ _print_status INFO "Checking API keys..."local -A api_keys=(["SHODAN_API_KEY"]="${SHODAN_API_KEY:-}"["WHOISXML_API"]="${WHOISXML_API:-}"@@ -1824,25 +1835,21 @@ function health_check() {)for key_name in "${!api_keys[@]}"; doif [[ -n "${api_keys[$key_name]}" ]]; then- printf " %b[OK]%b %s configured\n" "$bgreen" "$reset" "$key_name"+ _print_status OK "$key_name" "configured"else- printf " %b[INFO]%b %s not set\n" "$bblue" "$reset" "$key_name"+ _print_status INFO "$key_name" "not set"fidone# Summary- printf "\n%b#######################################################################%b\n" "$bgreen" "$reset"+ _print_ruleif [[ $failures -gt 0 ]]; then- printf "%b[%s] Health check: %d FAILURES, %d warnings%b\n" \- "$bred" "$(date +'%Y-%m-%d %H:%M:%S')" "$failures" "$warnings" "$reset"+ _print_status FAIL "Health check" "${failures} FAILURES, ${warnings} warnings"elif [[ $warnings -gt 0 ]]; then- printf "%b[%s] Health check: PASSED with %d warnings%b\n" \- "$byellow" "$(date +'%Y-%m-%d %H:%M:%S')" "$warnings" "$reset"+ _print_status WARN "Health check" "PASSED with ${warnings} warnings"else- printf "%b[%s] Health check: ALL PASSED%b\n" \- "$bgreen" "$(date +'%Y-%m-%d %H:%M:%S')" "$reset"+ _print_status OK "Health check" "ALL PASSED"fi- printf "%b#######################################################################%b\n\n" "$bgreen" "$reset"return $failures}diff --git a/modules/modes.sh b/modules/modes.shindex c0e9b21..a667ebf 100644--- a/modules/modes.sh+++ b/modules/modes.sh@@ -21,7 +21,7 @@ function start() {# Check available disk space before starting (require at least 5GB by default)local required_space_gb="${MIN_DISK_SPACE_GB:-5}"if ! check_disk_space "$required_space_gb" "."; then- printf "%b[%s] WARNING: Low disk space detected. Continuing anyway...%b\n" "$yellow" "$(date +'%Y-%m-%d %H:%M:%S')" "$reset"+ _print_status WARN "Low disk space detected" "Continuing anyway..."# Not exiting, just warning - user can set MIN_DISK_SPACE_GB=0 to disablefi@@ -44,6 +44,7 @@ function start() {notification "Monitor cycle ${MONITOR_CYCLE}: skipping repeated tools check" infoelsetools_installed+ check_optional_api_keysfi# Initialize incremental mode if enabled@@ -126,9 +127,16 @@ function start() {# Non-fatal error trap: log and continue (plus short explanation for common cases)trap 'rc=$?; ts=$(date +"%Y-%m-%d %H:%M:%S"); cmd=${BASH_COMMAND}; loc_fn=${FUNCNAME[0]:-main}; loc_ln=${BASH_LINENO[0]:-0}; msg="[$ts] ERR($rc) @ ${loc_fn}:${loc_ln} :: ${cmd}"; if [[ -n "${LOGFILE:-}" ]]; then echo "$msg" >>"$LOGFILE"; else echo "$msg" >&2; fi; explain_err "$rc" "$cmd" "$loc_fn" "$loc_ln"' ERR- printf "\n"- printf "${bred}[$(date +'%Y-%m-%d %H:%M:%S')] Target: ${domain}\n\n"- printf "%b[LEGAL]%b Authorized testing only. By running this scan you confirm you have explicit permission for the specified targets and will comply with all applicable laws and program rules. Unauthorized use is prohibited.\n\n" "$yellow" "$reset"+ _print_rule+ printf "%b Target: %s%b\n" "${bred:-}" "$domain" "${reset:-}"+ if [[ "${OUTPUT_VERBOSITY:-1}" -ge 2 ]]; then+ printf "%b Mode: %s | Parallel: %s | Verbosity: %s%b\n" \+ "${bblue:-}" "${opt_mode:-r}" "${PARALLEL_MODE:-true}" "${OUTPUT_VERBOSITY:-1}" "${reset:-}"+ fi+ _print_rule+ if [[ "${OUTPUT_VERBOSITY:-1}" -ge 1 ]]; then+ printf "%b[LEGAL]%b Authorized testing only. By running this scan you confirm you have explicit permission for the specified targets and will comply with all applicable laws and program rules. Unauthorized use is prohibited.\n\n" "$yellow" "$reset"+ fi}function end() {@@ -212,7 +220,7 @@ function end() {if [[ $FARADAY == true ]]; thenif ! faraday-cli status 2>>"$LOGFILE" >/dev/null; then- printf "%b[!] Faraday server is not running. Skipping Faraday integration.%b\n" "$bred" "$reset"+ _print_error "Faraday server is not running. Skipping Faraday integration"elseif [[ -s ".tmp/tko_json.txt" ]]; thenfaraday-cli tool report -w $FARADAY_WORKSPACE --plugin-id nuclei .tmp/tko_json.txt 2>>"$LOGFILE" >/dev/null@@ -273,13 +281,16 @@ function end() {global_end=$(date +%s)getElapsedTime $global_start $global_end- printf "${bgreen}#######################################################################${reset}\n"+ _print_section "Scan Complete"if [[ "${RECON_PARTIAL_RUN:-false}" == "true" ]]; then- notification "Run completed with non-fatal warnings (osint_parallel=${RECON_OSINT_PARALLEL_FAILURES:-0})" warn+ _print_status WARN "Run completed with non-fatal warnings" "osint_parallel=${RECON_OSINT_PARALLEL_FAILURES:-0}"fi+ printf "%b Target: %s%b\n" "${bgreen:-}" "$domain" "${reset:-}"+ printf "%b Duration: %s%b\n" "${bgreen:-}" "$runtime" "${reset:-}"+ printf "%b Output: %s%b\n" "${bgreen:-}" "$finaldir" "${reset:-}"+ _print_rulenotification "Finished Recon on: ${domain} under ${finaldir} in: ${runtime}" good "$(date +'%Y-%m-%d %H:%M:%S')"[ "$SOFT_NOTIFICATION" = true ] && echo "[$(date +'%Y-%m-%d %H:%M:%S')] Finished Recon on: ${domain} under ${finaldir} in: ${runtime}" | notify -silent- printf "${bgreen}#######################################################################${reset}\n"# Print performance timing summaryprint_timing_summary@@ -336,6 +347,9 @@ function build_hotlist() {function passive() {start++ _print_section "OSINT"+domain_infoip_infoemails@@ -366,8 +380,13 @@ function passive() {axiom_selectedfi+ _print_section "Subdomains"+subdomains_fullremove_big_files++ _print_section "Web Detection"+faviconcdnprovider# shellcheck disable=SC2034 # PORTSCAN_ACTIVE controls scan behavior@@ -409,7 +428,7 @@ function vulns() {if [[ $VULNS_GENERAL == true ]]; thenif [[ "${PARALLEL_MODE:-true}" == "true" ]] && declare -f parallel_funcs &>/dev/null; then# Parallel execution - group independent checks- printf "%b[*] Running vulnerability checks in parallel mode%b\n" "$bblue" "$reset"+ [[ "${OUTPUT_VERBOSITY:-1}" -ge 1 ]] && printf "%b[*] Running vulnerability checks in parallel mode%b\n" "$bblue" "$reset"parallel_funcs 4 cors open_redirect crlf_checks xsslocal vulns_g1_rc=$?if ((vulns_g1_rc > 0)); then@@ -559,6 +578,8 @@ function recon() {fiprogress_init "$progress_total"+ _print_section "OSINT"+if [[ "${PARALLEL_MODE:-true}" == "true" ]] && declare -f parallel_funcs &>/dev/null; thenprogress_step "OSINT: domain_info, ip_info, emails, dorks"parallel_funcs 4 domain_info ip_info emails google_dorks@@ -613,6 +634,8 @@ function recon() {axiom_selectedfi+ _print_section "Subdomains"+progress_step "subdomains_full"subdomains_fullprogress_step "webprobe_full"@@ -624,6 +647,8 @@ function recon() {s3bucketscloud_extra_providers+ _print_section "Web Detection"+if [[ "${PARALLEL_MODE:-true}" == "true" ]] && declare -f parallel_funcs &>/dev/null; thenprogress_step "screenshot, cdnprovider, portscan"parallel_funcs 3 screenshot cdnprovider portscan@@ -661,6 +686,8 @@ function recon() {${TIME_EST_FUZZ:-900} + ${TIME_EST_IIS:-60} + ${TIME_EST_URLCHECKS:-300} + ${TIME_EST_JSCHECKS:-300} + \${TIME_EST_PARAM:-240} + ${TIME_EST_GRPC:-120}))else+ _print_section "Web Analysis"+progress_step "waf_checks"waf_checksprogress_step "nuclei_check"@@ -687,6 +714,8 @@ function recon() {axiom_shutdownfi+ _print_section "Finalization"+progress_step "cms_scanner"cms_scannerprogress_step "url_gf"@@ -1001,6 +1030,8 @@ function subs_menu() {axiom_selectedfi+ _print_section "Subdomains"+subdomains_fullwebprobe_fullsubtakeover@@ -1018,10 +1049,15 @@ function subs_menu() {}function webs_menu() {+ _print_section "Web Detection"+subtakeoverremove_big_filesscreenshot# virtualhosts++ _print_section "Web Analysis"+waf_checksnuclei_checkgraphql_scan@@ -1038,6 +1074,9 @@ function webs_menu() {url_extparam_discoverygrpc_reflection++ _print_section "Vulnerability Checks"+vulnsend}@@ -1048,11 +1087,17 @@ function zen_menu() {axiom_launchaxiom_selectedfi++ _print_section "Subdomains"+subdomains_fullwebprobe_fullsubtakeoverremove_big_filess3buckets++ _print_section "Web Analysis"+screenshot# virtualhostscdnprovider@@ -1241,6 +1286,9 @@ function help() {printf " --incremental Only scan new findings since last run\n"printf " --adaptive-rate Automatically adjust rate limits on errors (429/503)\n"printf " --dry-run Show what would be executed without running commands\n"+ printf " --quiet Minimal output (errors and final summary only)\n"+ printf " --verbose Extra output (PIDs, debug info)\n"+ printf " --parallel-log m Parallel output mode: summary (default), tail, or full\n"printf " --parallel Run independent functions in parallel (faster but uses more resources)\n"printf " --no-parallel Force sequential execution\n"printf " --monitor Continuous monitoring mode (single target; -w supports -l)\n"diff --git a/modules/osint.sh b/modules/osint.shindex 706e19d..9513e7c 100644--- a/modules/osint.sh+++ b/modules/osint.sh@@ -21,7 +21,7 @@ function google_dorks() {start_func "${FUNCNAME[0]}" "Running: Google Dorks in process"if ! "${tools}/dorks_hunter/venv/bin/python3" "${tools}/dorks_hunter/dorks_hunter.py" -d "$domain" -o "osint/dorks.txt" 2>>"$LOGFILE"; then- printf "%b[!] dorks_hunter command failed.%b\n" "$bred" "$reset"+ _print_error "dorks_hunter command failed"fiend_func "Results are saved in $domain/osint/dorks.txt" "${FUNCNAME[0]}"else@@ -42,17 +42,17 @@ function github_dorks() {if [[ -s $GITHUB_TOKENS ]]; thenif [[ $DEEP == true ]]; thenif ! gitdorks_go -gd "${tools}/gitdorks_go/Dorks/medium_dorks.txt" -nws 20 -target "$domain" -tf "$GITHUB_TOKENS" -ew 3 | anew -q osint/gitdorks.txt; then- printf "%b[!] gitdorks_go command failed.%b\n" "$bred" "$reset"+ _print_error "gitdorks_go command failed"return 1fielseif ! gitdorks_go -gd "${tools}/gitdorks_go/Dorks/smalldorks.txt" -nws 20 -target "$domain" -tf "$GITHUB_TOKENS" -ew 3 | anew -q osint/gitdorks.txt; then- printf "%b[!] gitdorks_go command failed.%b\n" "$bred" "$reset"+ _print_error "gitdorks_go command failed"return 1fifielse- printf "\n%b[%s] Required file %s does not exist or is empty.%b\n" "$bred" "$(date +'%Y-%m-%d %H:%M:%S')" "$GITHUB_TOKENS" "$reset"+ _print_error "Required file ${GITHUB_TOKENS} does not exist or is empty"return 1fiend_func "Results are saved in $domain/osint/gitdorks.txt" "${FUNCNAME[0]}"@@ -76,12 +76,12 @@ function github_repos() {echo "$domain" | unfurl format %r >.tmp/company_name.txtif ! enumerepo -token-string "$GH_TOKEN" -usernames .tmp/company_name.txt -o .tmp/company_repos.txt 2>>"$LOGFILE" >/dev/null; then- printf "%b[!] enumerepo command failed.%b\n" "$bred" "$reset"+ _print_error "enumerepo command failed"fiif [[ -s ".tmp/company_repos.txt" ]]; thenif ! jq -r '.[].repos[]|.url' <.tmp/company_repos.txt >.tmp/company_repos_url.txt 2>>"$LOGFILE"; then- printf "%b[!] jq command failed.%b\n" "$bred" "$reset"+ _print_error "jq command failed"fifi@@ -89,7 +89,7 @@ function github_repos() {if [[ -s ".tmp/company_repos_url.txt" ]]; thenif ! interlace -tL .tmp/company_repos_url.txt -threads "$INTERLACE_THREADS" -c "git clone _target_ .tmp/github_repos/_cleantarget_" 2>>"$LOGFILE" >/dev/null; then- printf "%b[!] interlace git clone command failed.%b\n" "$bred" "$reset"+ _print_error "interlace git clone command failed"return 1fielse@@ -108,7 +108,7 @@ function github_repos() {if [[ -s ".tmp/github_repos_folders.txt" ]]; thenif ! interlace -tL .tmp/github_repos_folders.txt -threads "$INTERLACE_THREADS" -c "gitleaks detect --source .tmp/github_repos/_target_ --no-banner --no-color -r .tmp/github/gh_secret_cleantarget_.json" 2>>"$LOGFILE" >/dev/null; then- printf "%b[!] interlace gitleaks command failed.%b\n" "$bred" "$reset"+ _print_error "interlace gitleaks command failed"end_func "Results are saved in $domain/osint/github_company_secrets.json" "${FUNCNAME[0]}"return 1fi@@ -120,14 +120,14 @@ function github_repos() {if [[ -s ".tmp/company_repos_url.txt" ]]; thenif ! interlace -tL .tmp/company_repos_url.txt -threads "$INTERLACE_THREADS" -c "trufflehog git _target_ -j 2>&1 | jq -c > _output_/_cleantarget_" -o .tmp/github/ 2>>"$LOGFILE" >/dev/null; then- printf "%b[!] interlace trufflehog command failed.%b\n" "$bred" "$reset"+ _print_error "interlace trufflehog command failed"return 1fifiif [[ -d ".tmp/github/" ]]; thenif ! cat .tmp/github/* 2>/dev/null | jq -c | jq -r >"osint/github_company_secrets.json" 2>>"$LOGFILE"; then- printf "%b[!] Error combining results.%b\n" "$bred" "$reset"+ _print_error "Error combining results"return 1fielse@@ -138,7 +138,7 @@ function github_repos() {end_func "Results are saved in $domain/osint/github_company_secrets.json" "${FUNCNAME[0]}"else- printf "\n%s[%s] Required file %s does not exist or is empty.%b\n" "$bred" "$(date +'%Y-%m-%d %H:%M:%S')" "$GITHUB_TOKENS" "$reset"+ _print_error "Required file ${GITHUB_TOKENS} does not exist or is empty"return 1fielse@@ -159,20 +159,28 @@ function metadata() {ensure_dirs ".tmp/metagoofil_${domain}"pushd "${tools}/metagoofil" >/dev/null || {- printf "%b[!] Failed to change directory to %s in %s at line %s.%b\n" "${bred}" "${tools}/metagoofil" "${FUNCNAME[0]}" "${LINENO}" "${reset}"+ _print_error "Failed to change directory to ${tools}/metagoofil in ${FUNCNAME[0]} at line ${LINENO}"return 1}"${tools}/metagoofil/venv/bin/python3" "${tools}/metagoofil/metagoofil.py" -d "${domain}" -t pdf,docx,xlsx -l 10 -w -o "${dir}/.tmp/metagoofil_${domain}/" 2>>"${LOGFILE}" >/dev/nullpopd >/dev/null || {- printf "%b[!] Failed to return to the previous directory in %s at line %s.%b\n" "${bred}" "${FUNCNAME[0]}" "${LINENO}" "${reset}"+ _print_error "Failed to return to the previous directory in ${FUNCNAME[0]} at line ${LINENO}"return 1}# Check if exiftool is installed before runningif command -v exiftool &>/dev/null; then- exiftool -r .tmp/metagoofil_${domain}/* 2>>"${LOGFILE}" | tee /dev/null | egrep -i "Author|Creator|Email|Producer|Template" | sort -u | anew -q "osint/metadata_results.txt"+ if find ".tmp/metagoofil_${domain}" -type f -print -quit 2>/dev/null | grep -q .; then+ exiftool -r ".tmp/metagoofil_${domain}" 2>>"${LOGFILE}" \+ | tee /dev/null \+ | egrep -i "Author|Creator|Email|Producer|Template" \+ | sort -u \+ | anew -q "osint/metadata_results.txt" || true+ else+ log_note "metadata: no files downloaded by metagoofil; skipping exif extraction" "${FUNCNAME[0]}" "${LINENO}"+ fielse- printf "%b[!] exiftool is not installed. Skipping metadata extraction.%b\n" "${bred}" "${reset}"+ _print_error "exiftool is not installed. Skipping metadata extraction"printf "exiftool not installed - metadata extraction skipped\n" >>"${LOGFILE}"fi@@ -205,10 +213,13 @@ function apileaks() {log_note "porch-pirate failed even without --dump" "${FUNCNAME[0]}" "${LINENO}"fifi+ if [[ ! -s "${dir}/osint/postman_leaks.txt" ]]; then+ log_note "apileaks: porch-pirate returned empty output; continuing with swagger pipeline" "${FUNCNAME[0]}" "${LINENO}"+ fi# Change directory to SwaggerSpyif ! pushd "${tools}/SwaggerSpy" >/dev/null; then- printf "%b[!] Failed to change directory to %s in %s at line %s.%b\n" "$bred" "${tools}/SwaggerSpy" "${FUNCNAME[0]}" "$LINENO" "$reset"+ _print_error "Failed to change directory to ${tools}/SwaggerSpy in ${FUNCNAME[0]} at line ${LINENO}"return 1fi@@ -227,7 +238,7 @@ function apileaks() {# Return to the previous directoryif ! popd >/dev/null; then- printf "%b[!] Failed to return to the previous directory in %s at line %s.%b\n" "$bred" "${FUNCNAME[0]}" "$LINENO" "$reset"+ _print_error "Failed to return to the previous directory in ${FUNCNAME[0]} at line ${LINENO}"return 1fi@@ -270,7 +281,7 @@ function emails() {# Change directory to LeakSearchif ! pushd "${tools}/LeakSearch" >/dev/null; then- printf "%b[!] Failed to change directory to %s in %s at line %s.%b\n" "$bred" "${tools}/LeakSearch" "${FUNCNAME[0]}" "$LINENO" "$reset"+ _print_error "Failed to change directory to ${tools}/LeakSearch in ${FUNCNAME[0]} at line ${LINENO}"return 1fi@@ -279,7 +290,7 @@ function emails() {# Return to the previous directoryif ! popd >/dev/null; then- printf "%b[!] Failed to return to the previous directory in %s at line %s.%b\n" "$bred" "${FUNCNAME[0]}" "$LINENO" "$reset"+ _print_error "Failed to return to the previous directory in ${FUNCNAME[0]} at line ${LINENO}"return 1fidiff --git a/modules/subdomains.sh b/modules/subdomains.shindex 669c0ae..7b58984 100644--- a/modules/subdomains.sh+++ b/modules/subdomains.sh@@ -391,7 +391,7 @@ _subdomains_finalize() {local _sub_count _shown=0_sub_count=$(wc -l < "subdomains/subdomains.txt" | tr -d ' ')while IFS= read -r sub; do- ((_shown++))+ _shown=$((_shown + 1))if [[ $_shown -le 20 ]]; thenprintf "%b[%s] %s%b\n" "$yellow" "$(date +'%Y-%m-%d %H:%M:%S')" "$sub" "$reset"else@@ -416,7 +416,7 @@ _subdomains_finalize() {local _web_count _wshown=0_web_count=$(wc -l < "webs/webs.txt" | tr -d ' ')while IFS= read -r web; do- ((_wshown++))+ _wshown=$((_wshown + 1))if [[ $_wshown -le 20 ]]; thenprintf "%b[%s] %s%b\n" "$yellow" "$(date +'%Y-%m-%d %H:%M:%S')" "$web" "$reset"else@@ -627,33 +627,47 @@ function sub_crt() {if { [[ ! -f "$called_fn_dir/.${FUNCNAME[0]}" ]] || [[ $DIFF == true ]]; } && [[ $SUBCRT == true ]]; thenstart_subfunc "${FUNCNAME[0]}" "Running: Crtsh Subdomain Enumeration"+ : >.tmp/crtsh_subdomains.txt+ : >.tmp/crtsh_subs_tmp.txt+# Run crt command and check for errors# Apply time fencing if DNS_TIME_FENCE_DAYS is set and > 0if [[ ${DNS_TIME_FENCE_DAYS:-0} -gt 0 ]]; thenlocal cutoff_datecutoff_date=$(date -v-"${DNS_TIME_FENCE_DAYS}"d +%Y-%m-%d 2>/dev/null || date -d "-${DNS_TIME_FENCE_DAYS} days" +%Y-%m-%d 2>/dev/null)if [[ -n "$cutoff_date" ]]; then- run_command crt -s -json -l "${CTR_LIMIT}" "$domain" 2>>"$LOGFILE" \+ if ! run_command crt -s -json -l "${CTR_LIMIT}" "$domain" 2>>"$LOGFILE" \| jq -r --arg cutoff "$cutoff_date" '[.[] | select(.not_before >= $cutoff)] | .[].subdomain' 2>>"$LOGFILE" \- | sed -e 's/^\*\.//' >.tmp/crtsh_subdomains.txt+ | sed -e 's/^\*\.//' >.tmp/crtsh_subdomains.txt; then+ log_note "sub_crt: crt source returned no valid JSON; continuing with fallback sources" "${FUNCNAME[0]}" "${LINENO}"+ fiprintf "%b[*] Time fencing enabled: filtering crt.sh results to last %d days (since %s)%b\n" \"$bblue" "${DNS_TIME_FENCE_DAYS}" "$cutoff_date" "$reset"else# Fallback if date calculation fails- run_command crt -s -json -l "${CTR_LIMIT}" "$domain" 2>>"$LOGFILE" \+ if ! run_command crt -s -json -l "${CTR_LIMIT}" "$domain" 2>>"$LOGFILE" \| jq -r '.[].subdomain' 2>>"$LOGFILE" \- | sed -e 's/^\*\.//' >.tmp/crtsh_subdomains.txt+ | sed -e 's/^\*\.//' >.tmp/crtsh_subdomains.txt; then+ log_note "sub_crt: crt source returned no valid JSON; continuing with fallback sources" "${FUNCNAME[0]}" "${LINENO}"+ fifielse- run_command crt -s -json -l "${CTR_LIMIT}" "$domain" 2>>"$LOGFILE" \+ if ! run_command crt -s -json -l "${CTR_LIMIT}" "$domain" 2>>"$LOGFILE" \| jq -r '.[].subdomain' 2>>"$LOGFILE" \- | sed -e 's/^\*\.//' >.tmp/crtsh_subdomains.txt+ | sed -e 's/^\*\.//' >.tmp/crtsh_subdomains.txt; then+ log_note "sub_crt: crt source returned no valid JSON; continuing with fallback sources" "${FUNCNAME[0]}" "${LINENO}"+ fifi- run_command curl -s "https://bgp.he.net/certs/api/list?domain=$domain" | jq -r 'try .domains[].domain' | sed -e 's/^\*\.//' | anew -q .tmp/crtsh_subdomains.txt+ run_command curl -s "https://bgp.he.net/certs/api/list?domain=$domain" \+ | jq -r 'try .domains[].domain' \+ | sed -e 's/^\*\.//' \+ | anew -q .tmp/crtsh_subdomains.txt || true# Use anew to get new subdomains- cat .tmp/crtsh_subdomains.txt | anew -q .tmp/crtsh_subs_tmp.txt+ if [[ -s ".tmp/crtsh_subdomains.txt" ]]; then+ anew -q .tmp/crtsh_subs_tmp.txt <.tmp/crtsh_subdomains.txt || true+ fi# If INSCOPE is true, check inscopeif [[ $INSCOPE == true ]]; thenif ! check_inscope .tmp/crtsh_subs_tmp.txt 2>>"$LOGFILE" >/dev/null; then@@ -931,11 +945,16 @@ function sub_dns() {| grep -E '^([a-zA-Z0-9][-a-zA-Z0-9]*\.)+[a-zA-Z]{2,}$' | sort -u \| anew -q .tmp/subdomains_dns.txt- for i in $(jq -r '.. | strings | select(test("^(\\d{1,3}\\.){3}\\d{1,3}$|^[0-9a-fA-F:]+$"))' <"subdomains/subdomains_dnsregs.json" | sort -u); do- curl -s https://ip.thc.org/$i 2>>"$LOGFILE" | grep "\.${DOMAIN_ESCAPED}$" \- | grep -E '^([a-zA-Z0-9][-a-zA-Z0-9]*\.)+[a-zA-Z]{2,}$' | sort -u \- | anew -q .tmp/subdomains_dns.txt- done+ jq -r '.. | strings | select(test("^(\\d{1,3}\\.){3}\\d{1,3}$|^[0-9a-fA-F:]+$"))' <"subdomains/subdomains_dnsregs.json" \+ | sort -u \+ | while IFS= read -r ip; do+ [[ -z "$ip" ]] && continue+ curl -s "https://ip.thc.org/$ip" 2>>"$LOGFILE" \+ | grep "\.${DOMAIN_ESCAPED}$" \+ | grep -E '^([a-zA-Z0-9][-a-zA-Z0-9]*\.)+[a-zA-Z]{2,}$' \+ | sort -u \+ | anew -q .tmp/subdomains_dns.txt || true+ donejq -r 'select(.host) |"\(.host) - \((.a // [])[])", "\(.host) - \((.aaaa // [])[])"' <"subdomains/subdomains_dnsregs.json" \| grep -E ' - [0-9a-fA-F:.]+$' | sort -u | anew -q "subdomains/subdomains_ips.txt"@@ -1122,7 +1141,7 @@ function sub_scraping() {if [[ -s ".tmp/url_extract_tmp.txt" ]]; thencat .tmp/url_extract_tmp.txt | grep -a "$domain" \| grep -aEo 'https?://[^ ]+' \- | sed "s/^\*\.//" | unfurl -u domains 2>>"$LOGFILE" | anew -q .tmp/scrap_subs.txt+ | sed "s/^\*\.//" | unfurl -u domains 2>>"$LOGFILE" | anew -q .tmp/scrap_subs.txt || truefiif command -v waymore &>/dev/null; then@@ -1132,7 +1151,7 @@ function sub_scraping() {if [[ -s ".tmp/waymore_urls_subs.txt" ]]; thencat .tmp/waymore_urls_subs.txt | grep -a "$domain" \| grep -aEo 'https?://[^ ]+' \- | sed "s/^\*\.//" | unfurl -u domains 2>>"$LOGFILE" | anew -q .tmp/scrap_subs.txt+ | sed "s/^\*\.//" | unfurl -u domains 2>>"$LOGFILE" | anew -q .tmp/scrap_subs.txt || truefielselog_note "sub_scraping: waymore not found; skipping waymore passive collection" "${FUNCNAME[0]}" "${LINENO}"@@ -1157,12 +1176,12 @@ function sub_scraping() {| sed "s/^\*\.//" \| anew .tmp/probed_tmp_scrap.txt \| unfurl -u domains 2>>"$LOGFILE" \- | anew -q .tmp/scrap_subs.txt+ | anew -q .tmp/scrap_subs.txt || truefiif [[ -s ".tmp/probed_tmp_scrap.txt" ]]; thencat .tmp/probed_tmp_scrap.txt | csprecon -s | grep -a "$domain" | sed "s/^\*\.//" | sort -u \- | unfurl -u domains 2>>"$LOGFILE" | anew -q .tmp/scrap_subs.txt+ | unfurl -u domains 2>>"$LOGFILE" | anew -q .tmp/scrap_subs.txt || truefielse@@ -1184,12 +1203,12 @@ function sub_scraping() {| sed "s/^\*\.//" \| anew .tmp/probed_tmp_scrap.txt \| unfurl -u domains 2>>"$LOGFILE" \- | anew -q .tmp/scrap_subs.txt+ | anew -q .tmp/scrap_subs.txt || truefiif [[ -s ".tmp/probed_tmp_scrap.txt" ]]; thencat .tmp/probed_tmp_scrap.txt | csprecon -s | grep -a "$domain" | sed "s/^\*\.//" | sort -u \- | unfurl -u domains 2>>"$LOGFILE" | anew -q .tmp/scrap_subs.txt+ | unfurl -u domains 2>>"$LOGFILE" | anew -q .tmp/scrap_subs.txt || truefifi@@ -1201,7 +1220,7 @@ function sub_scraping() {--wildcard-batch "$PUREDNS_WILDCARDBATCH_LIMIT" 2>>"$LOGFILE" >/dev/nullfi- if [[ $INSCOPE == true ]]; then+ if [[ $INSCOPE == true ]] && [[ -s ".tmp/scrap_subs_resolved.txt" ]]; thenif ! check_inscope .tmp/scrap_subs_resolved.txt 2>>"$LOGFILE" >/dev/null; thenprintf "%b[!] check_inscope command failed.%b\n" "$bred" "$reset"fi@@ -1233,7 +1252,7 @@ function sub_scraping() {| sed "s/^\*\.//" \| anew .tmp/probed_tmp_scrap.txt \| unfurl -u domains 2>>"$LOGFILE" \- | anew -q .tmp/scrap_subs.txt+ | anew -q .tmp/scrap_subs.txt || truefifi@@ -2024,7 +2043,9 @@ function subtakeover() {# DNS Takeovercat .tmp/subs_no_resolved.txt .tmp/subdomains_dns.txt .tmp/scrap_subs.txt \- .tmp/analytics_subs_clean.txt .tmp/passive_recursive.txt 2>/dev/null | anew -q .tmp/subs_dns_tko.txt+ .tmp/analytics_subs_clean.txt .tmp/passive_recursive.txt 2>/dev/null \+ | sed '/^$/d' \+ | anew -q .tmp/subs_dns_tko.txt || trueif [[ -s ".tmp/subs_dns_tko.txt" ]]; thencat .tmp/subs_dns_tko.txt 2>/dev/null | dnstake -c "$DNSTAKE_THREADS" -s 2>>"$LOGFILE" \diff --git a/modules/utils.sh b/modules/utils.shindex a2f9037..1549bc0 100644--- a/modules/utils.sh+++ b/modules/utils.sh@@ -299,15 +299,9 @@ function check_disk_space() {local required_gb="$1"local check_path="${2:-.}"- # Get available space in GB+ # Get available space in GB (portable across macOS/Linux).local available_gb- if [[ "$OSTYPE" == "darwin"* ]]; then- # macOS- available_gb=$(df -g "$check_path" | awk 'NR==2 {print $4}')- else- # Linux- available_gb=$(df -BG "$check_path" | awk 'NR==2 {gsub(/G/, "", $4); print $4}')- fi+ available_gb=$(df -Pk "$check_path" 2>/dev/null | awk 'NR==2 {print int($4 / 1024 / 1024)}')if [ -z "$available_gb" ] || [ "$available_gb" -lt "$required_gb" ]; thenprintf "%b[%s] WARNING: Insufficient disk space. Required: %dGB, Available: %dGB at %s%b\n" \diff --git a/modules/web.sh b/modules/web.shindex 2dc78f9..9df7d6d 100644--- a/modules/web.sh+++ b/modules/web.sh@@ -419,13 +419,16 @@ function portscan() {else# Domain is an IP address- printf "%b\n" "$domain" | 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' | anew -q hosts/ips.txt+ printf "%b\n" "$domain" \+ | 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' \+ | anew -q hosts/ips.txt || truefi# Check for CDN providersif [[ ! -s "hosts/cdn_providers.txt" ]]; thenif [[ -s "hosts/ips.txt" ]]; then- cat hosts/ips.txt | cdncheck -silent -resp -cdn -waf -nc 2>/dev/null | anew -q hosts/cdn_providers.txt+ cat hosts/ips.txt | cdncheck -silent -resp -cdn -waf -nc 2>/dev/null | anew -q hosts/cdn_providers.txt || truefifi@@ -433,7 +436,7 @@ function portscan() {# Remove CDN IPscomm -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+ | sort -u | anew -q .tmp/ips_nocdn.txt || truefi# Display resolved IPs without CDN@@ -458,10 +461,10 @@ function portscan() {if [[ $IPV6_SCAN == true ]]; thenif [[ -s "subdomains/subdomains_dnsregs.json" ]]; thenjq -r '.. | strings | select(test("^[0-9a-fA-F:]+$"))' <"subdomains/subdomains_dnsregs.json" \- | grep -v '\\.' | sort -u | anew -q hosts/ips_v6.txt+ | grep -v '\\.' | sort -u | anew -q hosts/ips_v6.txt || truefi# Add target if it's an IPv6 literal- if [[ $domain =~ : ]]; then echo "$domain" | anew -q hosts/ips_v6.txt; fi+ if [[ $domain =~ : ]]; then echo "$domain" | anew -q hosts/ips_v6.txt || true; fifiif [[ $PORTSCAN_PASSIVE == true ]]; then@@ -1106,8 +1109,31 @@ function cms_scanner() {fi# Run CMSeeK with timeout- if ! timeout -k 1m "${CMSSCAN_TIMEOUT}s" "${tools}/CMSeeK/venv/bin/python3" "${tools}/CMSeeK/cmseek.py" -l .tmp/cms.txt --batch -r &>>"$LOGFILE"; then+ local cmseek_cmd=(+ timeout -k 1m "${CMSSCAN_TIMEOUT}s"+ "${tools}/CMSeeK/venv/bin/python3" "${tools}/CMSeeK/cmseek.py"+ -l .tmp/cms.txt --batch -r+ )+ local exit_status=0+ local log_start=0+ log_start=$(wc -l <"$LOGFILE" 2>/dev/null || echo 0)+ if ! "${cmseek_cmd[@]}" &>>"$LOGFILE"; thenexit_status=$?+ # Attempt one-time repair on known CMSeeK index corruption.+ if tail -n +"$((log_start + 1))" "$LOGFILE" 2>/dev/null | grep -q "cmseekdb/createindex.py" \+ && tail -n +"$((log_start + 1))" "$LOGFILE" 2>/dev/null | grep -q "JSONDecodeError"; then+ log_note "cms_scanner: detected CMSeeK index corruption, repairing index and retrying once" "${FUNCNAME[0]}" "${LINENO}"+ find "${tools}/CMSeeK/Result" -type f -name "*.json" -size 0 -delete 2>>"$LOGFILE" || true+ if [[ -f "${tools}/CMSeeK/cmseekdb/createindex.py" ]]; then+ "${tools}/CMSeeK/venv/bin/python3" "${tools}/CMSeeK/cmseekdb/createindex.py" &>>"$LOGFILE" || true+ fi+ if ! "${cmseek_cmd[@]}" &>>"$LOGFILE"; then+ exit_status=$?+ else+ exit_status=0+ fi+ fi+if [[ ${exit_status} -eq 124 || ${exit_status} -eq 137 ]]; thenecho "TIMEOUT cmseek.py - investigate manually for $dir" >>"$LOGFILE"end_func "TIMEOUT cmseek.py - investigate manually for $dir" "${FUNCNAME[0]}"@@ -1416,22 +1442,21 @@ function url_ext() {for t in "${ext[@]}"; do# Extract unique matching URLs- matches=$(- (grep -aEi "\.(${t})($|/|\?)" ".tmp/url_extract_tmp.txt" 2>>"$LOGFILE" || true) \- | sort -u | sed '/^$/d'- )+ grep -aEi "\.(${t})($|/|\?)" ".tmp/url_extract_tmp.txt" 2>>"$LOGFILE" \+ | sort -u \+ | sed '/^$/d' >".tmp/urls_by_ext_${t}.tmp" || true- NUMOFLINES=$(echo "$matches" | wc -l)+ NUMOFLINES=$(wc -l <".tmp/urls_by_ext_${t}.tmp" 2>/dev/null || echo 0)if [[ $NUMOFLINES -gt 0 ]]; thenprintf "\n############################\n + %s + \n############################\n" "$t" >>webs/urls_by_ext.txt- echo "$matches" >>webs/urls_by_ext.txt+ cat ".tmp/urls_by_ext_${t}.tmp" >>webs/urls_by_ext.txtfidone# Append ssrf.txt to redirect.txt if ssrf.txt exists and is not emptyif [[ -s "gf/ssrf.txt" ]]; then- cat "gf/ssrf.txt" | anew -q "gf/redirect.txt"+ cat "gf/ssrf.txt" | anew -q "gf/redirect.txt" || truefiend_func "Results are saved in $domain/webs/urls_by_ext.txt" "${FUNCNAME[0]}"@@ -1476,17 +1501,17 @@ function jschecks() {printf "%bRunning: Fetching URLs 1/6%b\n" "$yellow" "$reset"if [[ $AXIOM != true ]]; thensubjs -ua "Mozilla/5.0 (X11; Linux x86_64; rv:72.0) Gecko/20100101 Firefox/72.0" -c 40 <.tmp/url_extract_js.txt \- | grep "$domain" \- | grep -aEo 'https?://[^ ]+' | anew -q .tmp/subjslinks.txt+ | grep -F "$domain" \+ | grep -aEo 'https?://[^ ]+' | anew -q .tmp/subjslinks.txt || trueelseaxiom-scan .tmp/url_extract_js.txt -m subjs -o .tmp/subjslinks.txt "$AXIOM_EXTRA_ARGS" 2>>"$LOGFILE" >/dev/nullfi- if [[ -s ".tmp/subjslinks.txt" ]]; then- grep -Eiv "\.(eot|jpg|jpeg|gif|css|tif|tiff|png|ttf|otf|woff|woff2|ico|pdf|svg|txt|js)$" .tmp/subjslinks.txt \- | anew -q js/nojs_links.txt- grep -iE '\.js([?#].*)?$|\.js([/?&].*)' .tmp/subjslinks.txt | anew -q .tmp/url_extract_js.txt- fi+ if [[ -s ".tmp/subjslinks.txt" ]]; then+ grep -Eiv "\.(eot|jpg|jpeg|gif|css|tif|tiff|png|ttf|otf|woff|woff2|ico|pdf|svg|txt|js)$" .tmp/subjslinks.txt \+ | anew -q js/nojs_links.txt || true+ grep -iE '\.js([?#].*)?$|\.js([/?&].*)' .tmp/subjslinks.txt | anew -q .tmp/url_extract_js.txt || true+ fiurless <.tmp/url_extract_js.txt \| anew -q js/url_extract_js.txt 2>>"$LOGFILE" >/dev/null@@ -1505,7 +1530,7 @@ function jschecks() {-content-type -retries 2 -no-color -o .tmp/js_livelinks.txt "$AXIOM_EXTRA_ARGS" 2>>"$LOGFILE" >/dev/nullif [[ -s ".tmp/js_livelinks.txt" ]]; thencat .tmp/js_livelinks.txt | anew .tmp/web_full_info.txt \- | grep "[200]" | grep "javascript" | cut -d ' ' -f1 | anew -q js/js_livelinks.txt+ | grep "[200]" | grep "javascript" | cut -d ' ' -f1 | anew -q js/js_livelinks.txt || truefififi@@ -1527,7 +1552,7 @@ function jschecks() {fifind .tmp/sourcemapper/ \( -name "*.js" -o -name "*.ts" \) -type f \- | jsluice urls | jq -r .url | anew -q .tmp/js_endpoints.txt+ | jsluice urls | jq -r .url | anew -q .tmp/js_endpoints.txt || trueprintf "%bRunning: Gathering endpoints 4/6%b\n" "$yellow" "$reset"if [[ -s "js/js_livelinks.txt" ]]; then@@ -1537,19 +1562,24 @@ function jschecks() {if [[ -s ".tmp/js_endpoints.txt" ]]; thensed_i '/^\//!d' .tmp/js_endpoints.txt- cat .tmp/js_endpoints.txt | anew -q js/js_endpoints.txt+ cat .tmp/js_endpoints.txt | anew -q js/js_endpoints.txt || truefiprintf "%bRunning: Gathering secrets 5/6%b\n" "$yellow" "$reset"if [[ -s "js/js_livelinks.txt" ]]; thenif [[ $AXIOM != true ]]; then- cat js/js_livelinks.txt | mantra -ua \"$HEADER\" -s | anew -q js/js_secrets.txt 2>>"$LOGFILE" >/dev/null+ cat js/js_livelinks.txt | mantra -ua \"$HEADER\" -s | anew -q js/js_secrets.txt 2>>"$LOGFILE" >/dev/null || trueelseaxiom-exec "go install github.com/Brosck/mantra@latest" 2>>"$LOGFILE" >/dev/nullaxiom-scan js/js_livelinks.txt -m mantra -ua "$HEADER" -s -o js/js_secrets.txt "$AXIOM_EXTRA_ARGS" &>/dev/nullfimkdir -p .tmp/sourcemapper/secrets- for i in $(cat js/js_secrets.txt | cut -d' ' -f2); do wget -q -P .tmp/sourcemapper/secrets $i; done+ if [[ -s "js/js_secrets.txt" ]]; then+ while IFS= read -r i; do+ [[ -z "$i" ]] && continue+ wget -q -P .tmp/sourcemapper/secrets -- "$i" || true+ done < <(cut -d' ' -f2 js/js_secrets.txt)+ fitrufflehog filesystem .tmp/sourcemapper/ -j 2>/dev/null | jq -c | anew -q js/js_secrets_jsmap.txtfind .tmp/sourcemapper/ -type f -name "*.js" | jsluice secrets -j --patterns="${tools}/jsluice_patterns.json" | anew -q js/js_secrets_jsmap_jsluice.txtfi@@ -1561,11 +1591,11 @@ function jschecks() {(# shellcheck source=/dev/nullsource "${GETJSWORDS_VENV}/bin/activate"- if python3 -c "import jsbeautifier" 2>/dev/null; then+ if python3 -c "import jsbeautifier, requests" 2>/dev/null; theninterlace -tL js/js_livelinks.txt -threads "$INTERLACE_THREADS" \-c "python3 ${tools}/getjswords.py '_target_' | anew -q webs/dict_words.txt" 2>>"$LOGFILE" >/dev/nullelse- log_note "jsbeautifier not installed in venv ${GETJSWORDS_VENV}; skipping getjswords wordlist step" "${FUNCNAME[0]}" "${LINENO}"+ log_note "jschecks: jsbeautifier/requests missing in venv ${GETJSWORDS_VENV}; skipping getjswords wordlist step" "${FUNCNAME[0]}" "${LINENO}"fideactivate || true)@@ -1576,11 +1606,11 @@ function jschecks() {local getjs_py="${GETJSWORDS_PYTHON:-python3}"if ! command -v "$getjs_py" >/dev/null 2>&1; thenlog_note "getjswords python not found: ${getjs_py}; skipping wordlist step" "${FUNCNAME[0]}" "${LINENO}"- elif "$getjs_py" -c "import jsbeautifier" 2>/dev/null; then+ elif "$getjs_py" -c "import jsbeautifier, requests" 2>/dev/null; theninterlace -tL js/js_livelinks.txt -threads "$INTERLACE_THREADS" \-c "${getjs_py} ${tools}/getjswords.py '_target_' | anew -q webs/dict_words.txt" 2>>"$LOGFILE" >/dev/nullelse- log_note "jsbeautifier not installed in ${getjs_py}; skipping getjswords wordlist step" "${FUNCNAME[0]}" "${LINENO}"+ log_note "jschecks: jsbeautifier/requests missing in ${getjs_py}; skipping getjswords wordlist step" "${FUNCNAME[0]}" "${LINENO}"fififi@@ -1605,8 +1635,8 @@ function websocket_checks() {start_func "${FUNCNAME[0]}" "WebSocket discovery and handshake"# Collect ws/wss endpoints from JS endpoints and URLstouch .tmp/ws_endpoints_raw.txt- [[ -s js/js_endpoints.txt ]] && grep -aEo 'wss?://[^ ]+' js/js_endpoints.txt | anew -q .tmp/ws_endpoints_raw.txt- [[ -s webs/url_extract.txt ]] && grep -aEo 'wss?://[^ ]+' webs/url_extract.txt | anew -q .tmp/ws_endpoints_raw.txt+ [[ -s js/js_endpoints.txt ]] && grep -aEo 'wss?://[^ ]+' js/js_endpoints.txt | anew -q .tmp/ws_endpoints_raw.txt || true+ [[ -s webs/url_extract.txt ]] && grep -aEo 'wss?://[^ ]+' webs/url_extract.txt | anew -q .tmp/ws_endpoints_raw.txt || trueif [[ -s .tmp/ws_endpoints_raw.txt ]]; then# Normalize and de-dupcat .tmp/ws_endpoints_raw.txt | sed 's/\"//g' | sed 's/[\]\[ ]//g' | sort -u >.tmp/ws_endpoints.txt@@ -1624,7 +1654,7 @@ function websocket_checks() {-H 'Sec-WebSocket-Version: 13' \"$ws" || true)if [[ $code == "101" ]]; then- printf "HANDSHAKE %s\n" "$ws" | anew -q vulns/websockets.txt+ printf "HANDSHAKE %s\n" "$ws" | anew -q vulns/websockets.txt || true# Origin test: send a cross-origin header, expect failure ideallywskey2=$(head -c 16 /dev/urandom | base64 2>/dev/null || echo dGVzdGtleQ==)code2=$(curl -sk --http1.1 -o /dev/null -w '%{http_code}' \@@ -1634,7 +1664,7 @@ function websocket_checks() {-H 'Sec-WebSocket-Version: 13' \"$ws" || true)if [[ $code2 == "101" ]]; then- printf "ORIGIN-ALLOWED %s\n" "$ws" | anew -q vulns/websocket_misconfig.txt+ printf "ORIGIN-ALLOWED %s\n" "$ws" | anew -q vulns/websocket_misconfig.txt || truefifidone <.tmp/ws_endpoints.txtdiff --git a/reconftw.sh b/reconftw.shindex 48d510a..8defa5b 100755--- a/reconftw.sh+++ b/reconftw.sh@@ -90,19 +90,19 @@ fi# macOS PATH initialization, thanks @0xtavian <3if [[ $OSTYPE == "darwin"* ]]; thenif ! command -v brew &>/dev/null; then- printf "\n%bBrew is not installed or not in the PATH.%b\n\n" "$bred" "$reset"+ _print_error "Brew is not installed or not in the PATH"exit 1fiif [[ ! -x "$(brew --prefix gnu-getopt)/bin/getopt" ]]; then- printf "\n%bBrew formula gnu-getopt is not installed.%b\n\n" "$bred" "$reset"+ _print_error "Brew formula gnu-getopt is not installed"exit 1fiif [[ ! -d "$(brew --prefix coreutils)/libexec/gnubin" ]]; then- printf "\n%bBrew formula coreutils is not installed.%b\n\n" "$bred" "$reset"+ _print_error "Brew formula coreutils is not installed"exit 1fiif [[ ! -d "$(brew --prefix gnu-sed)/libexec/gnubin" ]]; then- printf "\n%bBrew formula gnu-sed is not installed.%b\n\n" "$bred" "$reset"+ _print_error "Brew formula gnu-sed is not installed"exit 1fi# Prefix is different depending on Intel vs Apple Silicon@@ -222,7 +222,7 @@ while true; docustom_function=$2# Validate that the custom function existsif ! declare -f "$custom_function" >/dev/null 2>&1; then- printf "%bError: Custom function '%s' is not defined%b\n" "$bred" "$custom_function" "$reset" >&2+ _print_error "Custom function '${custom_function}' is not defined"printf "Available functions can be found in modules/*.sh\n" >&2printf "Example: -c my_custom_recon\n" >&2exit $E_INVALID_INPUT@@ -453,7 +453,7 @@ fiif [[ -n $outOfScope_file ]]; thenisAsciiText "$outOfScope_file"if [[ "False" == "$IS_ASCII" ]]; then- printf "\n\n${bred} Out of Scope file is not a text file${reset}\n\n"+ _print_error "Out of Scope file is not a text file"exitfifi@@ -461,7 +461,7 @@ fiif [[ -n $inScope_file ]]; thenisAsciiText "$inScope_file"if [[ "False" == "$IS_ASCII" ]]; then- printf "\n\n${bred} In Scope file is not a text file${reset}\n\n"+ _print_error "In Scope file is not a text file"exitfifi@@ -492,9 +492,9 @@ fi# Show DRY_RUN mode warning if enabledif [[ "${DRY_RUN:-false}" == "true" ]]; then- printf "\n%b#######################################################################%b\n" "$bgreen" "$reset"- printf "%b[%s] DRY-RUN MODE ENABLED - Commands will be shown but not executed%b\n" "$yellow" "$(date +'%Y-%m-%d %H:%M:%S')" "$reset"- printf "%b#######################################################################%b\n\n" "$bgreen" "$reset"+ _print_rule+ _print_status WARN "DRY-RUN MODE ENABLED" "Commands will be shown but not executed"+ _print_rulefistartdir=${PWD}@@ -603,7 +603,7 @@ case $opt_mode incp "${SCRIPTPATH}/$list" "$dir/webs/webs.txt"fielse- printf "\n\n${bred} Web mode needs a website list file as target (./reconftw.sh -l target.txt -w) ${reset}\n\n"+ _print_error "Web mode needs a website list file as target (./reconftw.sh -l target.txt -w)"exitfiwebs_menudiff --git a/tests/unit/test_exports.bats b/tests/unit/test_exports.batsindex 97323db..a70fc92 100644--- a/tests/unit/test_exports.bats+++ b/tests/unit/test_exports.bats@@ -13,6 +13,7 @@ setup() {echo "a.example.com" > subdomains/subdomains.txtecho "https://a.example.com" > webs/webs_all.txtecho "1.1.1.1" > hosts/ips.txt+ echo "2606:4700:4700::1111" > hosts/ips_v6.txtecho '{"template-id":"tpl-h","matcher-name":"m1","type":"http","info":{"severity":"high","name":"High finding","tags":["x"]},"matched-at":"https://a.example.com","host":"a.example.com"}' > nuclei_output/high_json.txtecho '{"type":"finding","value":"test","ts":"2026-01-01","source":"unit"}' > assets.jsonlruntime="1 minutes 0 seconds"@@ -49,4 +50,11 @@ teardown() {[ -f report/report.json ][ -f report/findings.csv ][ -f report/export_all.jsonl ]+ [ -f report/subdomains_clean.txt ]+ [ -f report/webs_clean.txt ]+ [ -f report/ips_clean.txt ]+ grep -q "^a.example.com$" report/subdomains_clean.txt+ grep -q "^https://a.example.com$" report/webs_clean.txt+ grep -q "^1.1.1.1$" report/ips_clean.txt+ grep -q "^2606:4700:4700::1111$" report/ips_clean.txt}diff --git a/tests/unit/test_verbosity.bats b/tests/unit/test_verbosity.batsnew file mode 100644index 0000000..0739e90--- /dev/null+++ b/tests/unit/test_verbosity.bats@@ -0,0 +1,162 @@+#!/usr/bin/env bats+# Tests for OUTPUT_VERBOSITY gating across core functions++setup() {+ TEST_DIR=$(mktemp -d)+ cd "$TEST_DIR" || exit 1++ # Minimal color vars+ bred=""+ bblue=""+ bgreen=""+ byellow=""+ yellow=""+ reset=""+ cyan=""+ green=""+ red=""+ blue=""++ # Stubs for sourced modules+ SCRIPTPATH="${BATS_TEST_DIRNAME}/../.."+ LOGFILE="/dev/null"+ NOTIFICATION=false+ DIFF=false+ domain="test.com"+ called_fn_dir="$TEST_DIR/.called_fn"+ mkdir -p "$called_fn_dir"++ # Stubs for functions used by start_func/end_func+ getElapsedTime() { runtime="0s"; }+ record_func_timing() { :; }+ log_json() { :; }++ # Source common.sh (skip re-source guard)+ _COMMON_SH_LOADED=""+ source "${BATS_TEST_DIRNAME}/../../lib/common.sh"++ # Extract individual functions from core.sh using sed+ local corefile="${BATS_TEST_DIRNAME}/../../modules/core.sh"++ # Extract notification function+ eval "$(sed -n '/^function notification()/,/^}/p' "$corefile")"+ # Extract start_func+ eval "$(sed -n '/^function start_func()/,/^}/p' "$corefile")"+ # Extract end_func+ eval "$(sed -n '/^function end_func()/,/^}/p' "$corefile")"+ # Extract progress_step+ eval "$(sed -n '/^function progress_step()/,/^}/p' "$corefile")"+}++teardown() {+ cd /+ rm -rf "$TEST_DIR"+}++###############################################################################+# notification() verbosity tests+###############################################################################++@test "notification prints info at verbosity 1" {+ OUTPUT_VERBOSITY=1+ run notification "hello world" info+ [ "$status" -eq 0 ]+ [[ "$output" == *"hello world"* ]]+}++@test "notification suppresses info at verbosity 0" {+ OUTPUT_VERBOSITY=0+ run notification "hello world" info+ [ "$status" -eq 0 ]+ [[ "$output" == "" ]]+}++@test "notification shows errors at verbosity 0" {+ OUTPUT_VERBOSITY=0+ run notification "something broke" error+ [ "$status" -eq 0 ]+ [[ "$output" == *"something broke"* ]]+}++@test "notification shows all at verbosity 2" {+ OUTPUT_VERBOSITY=2+ run notification "detail info" info+ [ "$status" -eq 0 ]+ [[ "$output" == *"detail info"* ]]+}++###############################################################################+# skip_notification() verbosity tests+###############################################################################++@test "skip_notification prints at verbosity 1" {+ OUTPUT_VERBOSITY=1+ run skip_notification "disabled"+ [ "$status" -eq 0 ]+ [[ "$output" == *"skipped"* ]]+}++@test "skip_notification suppressed at verbosity 0" {+ OUTPUT_VERBOSITY=0+ run skip_notification "disabled"+ [ "$status" -eq 0 ]+ [[ "$output" == "" ]]+}++###############################################################################+# start_func / end_func verbosity tests+###############################################################################++@test "start_func shows rule at verbosity 1" {+ OUTPUT_VERBOSITY=1+ run start_func "test_fn" "Testing function"+ [ "$status" -eq 0 ]+ [[ "$output" == *"──"* ]]+}++@test "start_func hides rule at verbosity 0" {+ OUTPUT_VERBOSITY=0+ run start_func "test_fn" "Testing function"+ [ "$status" -eq 0 ]+ [[ "$output" != *"──"* ]]+}++@test "end_func shows status at verbosity 1" {+ OUTPUT_VERBOSITY=1+ start=1+ run end_func "Results" "test_fn"+ [ "$status" -eq 0 ]+ [[ "$output" == *"[OK"* ]]+}++@test "end_func hides status at verbosity 0" {+ OUTPUT_VERBOSITY=0+ start=1+ run end_func "Results" "test_fn"+ [ "$status" -eq 0 ]+ [[ "$output" != *"[OK"* ]]+}++###############################################################################+# progress_step() verbosity tests+###############################################################################++@test "progress_step prints at verbosity 1" {+ OUTPUT_VERBOSITY=1+ _PROGRESS_TOTAL_STEPS=10+ _PROGRESS_CURRENT_STEP=0+ _PROGRESS_START_TIME=$(date +%s)+ run progress_step "scanning"+ [ "$status" -eq 0 ]+ [[ "$output" == *"Progress"* ]]+}++@test "progress_step suppressed at verbosity 0" {+ OUTPUT_VERBOSITY=0+ _PROGRESS_TOTAL_STEPS=10+ _PROGRESS_CURRENT_STEP=0+ _PROGRESS_START_TIME=$(date +%s)+ run progress_step "scanning"+ [ "$status" -eq 0 ]+ [[ "$output" == "" ]]+}