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

refactor(02-03): migrate AXIOM_EXTRA_ARGS to global array AXIOM_EXTRA_ARGS_ARR

six2dez1f2db13aa22c
diff --git a/modules/subdomains.sh b/modules/subdomains.sh
index e17b2f7..65ecfe8 100644
--- a/modules/subdomains.sh
+++ b/modules/subdomains.sh
@@ -669,7 +669,7 @@ function sub_active() {
--resolvers-trusted ${AXIOM_RESOLVERS_TRUSTED_PATH} \
--wildcard-tests "$PUREDNS_WILDCARDTEST_LIMIT" \
--wildcard-batch "$PUREDNS_WILDCARDBATCH_LIMIT" \
- -o .tmp/subdomains_tmp.txt $AXIOM_EXTRA_ARGS \
+ -o .tmp/subdomains_tmp.txt "${AXIOM_EXTRA_ARGS_ARR[@]}" \
2>>"$LOGFILE" >/dev/null
fi
fi
@@ -734,7 +734,7 @@ function sub_tls() {
else
run_command axiom-scan subdomains/subdomains.txt -m tlsx \
-san -cn -silent -ro -c "$TLSX_THREADS" -p "$TLS_PORTS" \
- -o .tmp/subdomains_tlsx.txt $AXIOM_EXTRA_ARGS 2>>"$LOGFILE" >/dev/null
+ -o .tmp/subdomains_tlsx.txt "${AXIOM_EXTRA_ARGS_ARR[@]}" 2>>"$LOGFILE" >/dev/null
fi
else
if [[ $AXIOM != true ]]; then
@@ -742,7 +742,7 @@ function sub_tls() {
else
run_command axiom-scan subdomains/subdomains.txt -m tlsx \
-san -cn -silent -ro -c "$TLSX_THREADS" \
- -o .tmp/subdomains_tlsx.txt $AXIOM_EXTRA_ARGS 2>>"$LOGFILE" >/dev/null
+ -o .tmp/subdomains_tlsx.txt "${AXIOM_EXTRA_ARGS_ARR[@]}" 2>>"$LOGFILE" >/dev/null
fi
fi
@@ -765,7 +765,7 @@ function sub_tls() {
run_command axiom-scan .tmp/subdomains_tlsx_clean.txt -m puredns-resolve \
-r ${AXIOM_RESOLVERS_PATH} --resolvers-trusted ${AXIOM_RESOLVERS_TRUSTED_PATH} \
--wildcard-tests "$PUREDNS_WILDCARDTEST_LIMIT" --wildcard-batch "$PUREDNS_WILDCARDBATCH_LIMIT" \
- -o .tmp/subdomains_tlsx_resolved.txt $AXIOM_EXTRA_ARGS \
+ -o .tmp/subdomains_tlsx_resolved.txt "${AXIOM_EXTRA_ARGS_ARR[@]}" \
2>>"$LOGFILE" >/dev/null
fi
fi
@@ -959,7 +959,7 @@ function sub_dns() {
run_command axiom-scan .tmp/subdomains_dns.txt -m puredns-resolve \
-r "${AXIOM_RESOLVERS_PATH}" --resolvers-trusted "${AXIOM_RESOLVERS_TRUSTED_PATH}" \
--wildcard-tests "$PUREDNS_WILDCARDTEST_LIMIT" --wildcard-batch "$PUREDNS_WILDCARDBATCH_LIMIT" \
- -o .tmp/subdomains_dns_resolved.txt "$AXIOM_EXTRA_ARGS" \
+ -o .tmp/subdomains_dns_resolved.txt "${AXIOM_EXTRA_ARGS_ARR[@]}" \
2>>"$LOGFILE" >/dev/null
fi
fi
@@ -1097,14 +1097,14 @@ function sub_brute() {
run_command axiom-scan "$wordlist" -m puredns-single "$domain" -r ${AXIOM_RESOLVERS_PATH} \
--resolvers-trusted ${AXIOM_RESOLVERS_TRUSTED_PATH} \
--wildcard-tests "$PUREDNS_WILDCARDTEST_LIMIT" --wildcard-batch "$PUREDNS_WILDCARDBATCH_LIMIT" \
- -o .tmp/subs_brute.txt "$AXIOM_EXTRA_ARGS" 2>>"$LOGFILE" >/dev/null
+ -o .tmp/subs_brute.txt "${AXIOM_EXTRA_ARGS_ARR[@]}" 2>>"$LOGFILE" >/dev/null
# Resolve the subdomains using axiom-scan
if [[ -s ".tmp/subs_brute.txt" ]]; then
run_command axiom-scan .tmp/subs_brute.txt -m puredns-resolve -r "${AXIOM_RESOLVERS_PATH}" \
--resolvers-trusted "${AXIOM_RESOLVERS_TRUSTED_PATH}" \
--wildcard-tests "$PUREDNS_WILDCARDTEST_LIMIT" --wildcard-batch "$PUREDNS_WILDCARDBATCH_LIMIT" \
- -o .tmp/subs_brute_valid.txt "$AXIOM_EXTRA_ARGS" 2>>"$LOGFILE" >/dev/null
+ -o .tmp/subs_brute_valid.txt "${AXIOM_EXTRA_ARGS_ARR[@]}" 2>>"$LOGFILE" >/dev/null
fi
fi
@@ -1230,7 +1230,7 @@ function sub_scraping() {
run_command axiom-scan subdomains/subdomains.txt -m httpx -follow-host-redirects -random-agent -status-code \
-threads "$HTTPX_THREADS" -rl "$HTTPX_RATELIMIT" -timeout "$HTTPX_TIMEOUT" -silent -retries 2 \
-title -web-server -tech-detect -location -no-color -json -o .tmp/web_full_info1.txt \
- $AXIOM_EXTRA_ARGS 2>>"$LOGFILE" >/dev/null
+ "${AXIOM_EXTRA_ARGS_ARR[@]}" 2>>"$LOGFILE" >/dev/null
if [[ -s ".tmp/web_full_info1.txt" ]]; then
cat .tmp/web_full_info1.txt | jq -r 'try .url' 2>/dev/null \
@@ -1363,7 +1363,7 @@ function sub_analytics() {
run_command axiom-scan .tmp/analytics_subs_clean.txt -m puredns-resolve \
-r ${AXIOM_RESOLVERS_PATH} --resolvers-trusted ${AXIOM_RESOLVERS_TRUSTED_PATH} \
--wildcard-tests "$PUREDNS_WILDCARDTEST_LIMIT" --wildcard-batch "$PUREDNS_WILDCARDBATCH_LIMIT" \
- -o .tmp/analytics_subs_resolved.txt $AXIOM_EXTRA_ARGS \
+ -o .tmp/analytics_subs_resolved.txt "${AXIOM_EXTRA_ARGS_ARR[@]}" \
2>>"$LOGFILE" >/dev/null
fi
fi
@@ -1567,7 +1567,7 @@ function sub_permut() {
run_command axiom-scan .tmp/gotator1.txt -m puredns-resolve -r "${AXIOM_RESOLVERS_PATH}" \
--resolvers-trusted "${AXIOM_RESOLVERS_TRUSTED_PATH}" \
--wildcard-tests "$PUREDNS_WILDCARDTEST_LIMIT" --wildcard-batch "$PUREDNS_WILDCARDBATCH_LIMIT" \
- -o .tmp/permute1.txt "$AXIOM_EXTRA_ARGS" 2>>"$LOGFILE" >/dev/null
+ -o .tmp/permute1.txt "${AXIOM_EXTRA_ARGS_ARR[@]}" 2>>"$LOGFILE" >/dev/null
fi
fi
@@ -1584,7 +1584,7 @@ function sub_permut() {
run_command axiom-scan .tmp/gotator2.txt -m puredns-resolve -r "${AXIOM_RESOLVERS_PATH}" \
--resolvers-trusted "${AXIOM_RESOLVERS_TRUSTED_PATH}" \
--wildcard-tests "$PUREDNS_WILDCARDTEST_LIMIT" --wildcard-batch "$PUREDNS_WILDCARDBATCH_LIMIT" \
- -o .tmp/permute2.txt "$AXIOM_EXTRA_ARGS" 2>>"$LOGFILE" >/dev/null
+ -o .tmp/permute2.txt "${AXIOM_EXTRA_ARGS_ARR[@]}" 2>>"$LOGFILE" >/dev/null
fi
fi
@@ -1663,7 +1663,7 @@ function sub_regex_permut() {
run_command axiom-scan ".tmp/${domain}.brute" -m puredns-resolve \
-r ${AXIOM_RESOLVERS_PATH} --resolvers-trusted ${AXIOM_RESOLVERS_TRUSTED_PATH} \
--wildcard-tests "$PUREDNS_WILDCARDTEST_LIMIT" --wildcard-batch "$PUREDNS_WILDCARDBATCH_LIMIT" \
- -o .tmp/regulator.txt $AXIOM_EXTRA_ARGS \
+ -o .tmp/regulator.txt "${AXIOM_EXTRA_ARGS_ARR[@]}" \
2>>"$LOGFILE" >/dev/null
fi
fi
@@ -1739,7 +1739,7 @@ function sub_ia_permut() {
run_command axiom-scan ".tmp/subwiz.txt" -m puredns-resolve \
-r ${AXIOM_RESOLVERS_PATH} --resolvers-trusted ${AXIOM_RESOLVERS_TRUSTED_PATH} \
--wildcard-tests "$PUREDNS_WILDCARDTEST_LIMIT" --wildcard-batch "$PUREDNS_WILDCARDBATCH_LIMIT" \
- -o .tmp/subwiz_resolved.txt $AXIOM_EXTRA_ARGS \
+ -o .tmp/subwiz_resolved.txt "${AXIOM_EXTRA_ARGS_ARR[@]}" \
2>>"$LOGFILE" >/dev/null
fi
fi
@@ -1822,7 +1822,7 @@ function sub_recursive_passive() {
else
if [[ -s ".tmp/subdomains_recurs_top.txt" ]]; then
- run_command axiom-scan .tmp/subdomains_recurs_top.txt -m subfinder -all -o .tmp/subfinder_prec.txt "$AXIOM_EXTRA_ARGS" 2>>"$LOGFILE" >/dev/null
+ run_command axiom-scan .tmp/subdomains_recurs_top.txt -m subfinder -all -o .tmp/subfinder_prec.txt "${AXIOM_EXTRA_ARGS_ARR[@]}" 2>>"$LOGFILE" >/dev/null
else
return 1
fi
@@ -1835,7 +1835,7 @@ function sub_recursive_passive() {
run_command axiom-scan .tmp/passive_recursive.txt -m puredns-resolve \
-r ${AXIOM_RESOLVERS_PATH} --resolvers-trusted ${AXIOM_RESOLVERS_TRUSTED_PATH} \
--wildcard-tests "$PUREDNS_WILDCARDTEST_LIMIT" --wildcard-batch "$PUREDNS_WILDCARDBATCH_LIMIT" \
- -o .tmp/passive_recurs_tmp.txt "$AXIOM_EXTRA_ARGS" 2>>"$LOGFILE" >/dev/null
+ -o .tmp/passive_recurs_tmp.txt "${AXIOM_EXTRA_ARGS_ARR[@]}" 2>>"$LOGFILE" >/dev/null
fi
fi
@@ -1902,7 +1902,7 @@ function sub_recursive_brute() {
run_command axiom-scan "$subs_wordlist" -m puredns-single "$subdomain_top" \
-r ${AXIOM_RESOLVERS_PATH} --resolvers-trusted ${AXIOM_RESOLVERS_TRUSTED_PATH} \
--wildcard-tests "$PUREDNS_WILDCARDTEST_LIMIT" --wildcard-batch "$PUREDNS_WILDCARDBATCH_LIMIT" \
- -o .tmp/brute_recursive_result_part.txt $AXIOM_EXTRA_ARGS \
+ -o .tmp/brute_recursive_result_part.txt "${AXIOM_EXTRA_ARGS_ARR[@]}" \
2>>"$LOGFILE" >/dev/null
fi
if [[ -s .tmp/brute_recursive_result_part.txt ]]; then
@@ -1923,7 +1923,7 @@ function sub_recursive_brute() {
run_command axiom-scan .tmp/gotator1_recursive.txt -m puredns-resolve \
-r ${AXIOM_RESOLVERS_PATH} --resolvers-trusted ${AXIOM_RESOLVERS_TRUSTED_PATH} \
--wildcard-tests "$PUREDNS_WILDCARDTEST_LIMIT" --wildcard-batch "$PUREDNS_WILDCARDBATCH_LIMIT" \
- -o .tmp/permute1_recursive.txt $AXIOM_EXTRA_ARGS \
+ -o .tmp/permute1_recursive.txt "${AXIOM_EXTRA_ARGS_ARR[@]}" \
2>>"$LOGFILE" >/dev/null
fi
fi
@@ -1941,7 +1941,7 @@ function sub_recursive_brute() {
run_command axiom-scan .tmp/gotator2_recursive.txt -m puredns-resolve \
-r ${AXIOM_RESOLVERS_PATH} --resolvers-trusted ${AXIOM_RESOLVERS_TRUSTED_PATH} \
--wildcard-tests "$PUREDNS_WILDCARDTEST_LIMIT" --wildcard-batch "$PUREDNS_WILDCARDBATCH_LIMIT" \
- -o .tmp/permute2_recursive.txt $AXIOM_EXTRA_ARGS \
+ -o .tmp/permute2_recursive.txt "${AXIOM_EXTRA_ARGS_ARR[@]}" \
2>>"$LOGFILE" >/dev/null
fi
fi
@@ -1987,7 +1987,7 @@ function sub_recursive_brute() {
run_command axiom-scan .tmp/brute_perm_recursive.txt -m puredns-resolve \
-r ${AXIOM_RESOLVERS_PATH} --resolvers-trusted ${AXIOM_RESOLVERS_TRUSTED_PATH} \
--wildcard-tests "$PUREDNS_WILDCARDTEST_LIMIT" --wildcard-batch "$PUREDNS_WILDCARDBATCH_LIMIT" \
- -o .tmp/brute_perm_recursive_final.txt $AXIOM_EXTRA_ARGS \
+ -o .tmp/brute_perm_recursive_final.txt "${AXIOM_EXTRA_ARGS_ARR[@]}" \
2>>"$LOGFILE" >/dev/null
fi
fi
@@ -2065,7 +2065,7 @@ function subtakeover() {
print_notice RUN "takeover_nuclei" "scanning takeovers on axiom"
run_command axiom-scan .tmp/webs_subs.txt -m nuclei --nuclei-templates "${NUCLEI_TEMPLATES_PATH}" \
-tags takeover -nh -severity info,low,medium,high,critical -retries 3 -rl "$NUCLEI_RATELIMIT" \
- -t "${NUCLEI_TEMPLATES_PATH}" -j -o .tmp/tko_json.txt $AXIOM_EXTRA_ARGS 2>>"$LOGFILE" >/dev/null
+ -t "${NUCLEI_TEMPLATES_PATH}" -j -o .tmp/tko_json.txt "${AXIOM_EXTRA_ARGS_ARR[@]}" 2>>"$LOGFILE" >/dev/null
fi
fi
@@ -2194,7 +2194,7 @@ function s3buckets() {
run_command s3scanner -bucket-file subdomains/subdomains.txt 2>>"$LOGFILE" | anew -q .tmp/s3buckets.txt
fi
else
- run_command axiom-scan subdomains/subdomains.txt -m s3scanner -o .tmp/s3buckets_tmp.txt "$AXIOM_EXTRA_ARGS" 2>>"$LOGFILE" >/dev/null
+ run_command axiom-scan subdomains/subdomains.txt -m s3scanner -o .tmp/s3buckets_tmp.txt "${AXIOM_EXTRA_ARGS_ARR[@]}" 2>>"$LOGFILE" >/dev/null
if [[ -s ".tmp/s3buckets_tmp.txt" ]]; then
if ! cat .tmp/s3buckets_tmp.txt .tmp/s3buckets_tmp2.txt 2>>"$LOGFILE" | anew -q .tmp/s3buckets.txt; then
diff --git a/modules/web.sh b/modules/web.sh
index accab42..d252f10 100644
--- a/modules/web.sh
+++ b/modules/web.sh
@@ -141,19 +141,10 @@ function webprobe_full() {
local probe_out=".tmp/web_full_info_probe.txt"
local common_json_tmp=".tmp/web_full_info_common_current.txt"
local uncommon_json_tmp=".tmp/web_full_info_uncommon_current.txt"
- local -a axiom_extra_args=()
-
: >"$probe_out" 2>/dev/null || true
: >"$common_json_tmp" 2>/dev/null || true
: >"$uncommon_json_tmp" 2>/dev/null || true
- if [[ $AXIOM == true ]] && [[ -n "${AXIOM_EXTRA_ARGS:-}" ]]; then
- local _ifs="$IFS"
- IFS=' '
- read -r -a axiom_extra_args <<<"$AXIOM_EXTRA_ARGS"
- IFS="$_ifs"
- fi
-
if [[ $AXIOM != true ]]; then
local -a httpx_cmd=(
httpx
@@ -196,8 +187,8 @@ function webprobe_full() {
-json
-o "$probe_out"
)
- if [[ ${#axiom_extra_args[@]} -gt 0 ]]; then
- axiom_cmd+=("${axiom_extra_args[@]}")
+ if [[ ${#AXIOM_EXTRA_ARGS_ARR[@]} -gt 0 ]]; then
+ axiom_cmd+=("${AXIOM_EXTRA_ARGS_ARR[@]}")
fi
run_command "${axiom_cmd[@]}" 2>>"$LOGFILE" >/dev/null
fi
@@ -337,7 +328,7 @@ function screenshot() {
fi
else
if [[ -s "webs/webs_all.txt" ]]; then
- run_command axiom-scan webs/webs_all.txt -m nuclei-screenshots -o screenshots "$AXIOM_EXTRA_ARGS" 2>>"$LOGFILE" >/dev/null
+ run_command axiom-scan webs/webs_all.txt -m nuclei-screenshots -o screenshots "${AXIOM_EXTRA_ARGS_ARR[@]}" 2>>"$LOGFILE" >/dev/null
fi
fi
end_func "Results are saved in $domain/screenshots" "${FUNCNAME[0]}"
@@ -428,7 +419,7 @@ function tls_ip_pivots() {
-p "$tls_ports" \
-c "$TLSX_THREADS" \
-json \
- -o hosts/tls_ip_certs.jsonl $AXIOM_EXTRA_ARGS 2>>"$LOGFILE" >/dev/null
+ -o hosts/tls_ip_certs.jsonl "${AXIOM_EXTRA_ARGS_ARR[@]}" 2>>"$LOGFILE" >/dev/null
fi
# Extract hostnames from SAN/CN in JSONL
@@ -503,7 +494,7 @@ function tls_ip_pivots() {
run_command axiom-scan subdomains/tls_ip_pivots.txt -m puredns-resolve \
-r "${AXIOM_RESOLVERS_PATH}" --resolvers-trusted "${AXIOM_RESOLVERS_TRUSTED_PATH}" \
--wildcard-tests "$PUREDNS_WILDCARDTEST_LIMIT" --wildcard-batch "$PUREDNS_WILDCARDBATCH_LIMIT" \
- -o .tmp/tls_ip_pivots_resolved.txt "$AXIOM_EXTRA_ARGS" 2>>"$LOGFILE" >/dev/null
+ -o .tmp/tls_ip_pivots_resolved.txt "${AXIOM_EXTRA_ARGS_ARR[@]}" 2>>"$LOGFILE" >/dev/null
fi
if [[ -s ".tmp/tls_ip_pivots_resolved.txt" ]]; then
@@ -783,7 +774,7 @@ function portscan() {
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
+ -oA hosts/portscan_active "${AXIOM_EXTRA_ARGS_ARR[@]}" 2>>"$LOGFILE" >/dev/null
fi
fi
fi
@@ -1005,7 +996,7 @@ function waf_checks() {
fi
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
+ run_command axiom-scan "webs/webs_all.txt" -m wafw00f -o ".tmp/wafs.txt" "${AXIOM_EXTRA_ARGS_ARR[@]}" 2>>"$LOGFILE" >/dev/null
fi
# Process wafs.txt if it exists and is not empty
@@ -1149,7 +1140,7 @@ _nuclei_scan_axiom() {
run_with_heartbeat "axiom nuclei" axiom-scan .tmp/webs_subs.txt -m nuclei \
--nuclei-templates "$NUCLEI_TEMPLATES_PATH" \
-severity "$all_severities" -nh -rl "$NUCLEI_RATELIMIT" \
- -silent -retries 2 $NUCLEI_EXTRA_ARGS -j -o ".tmp/nuclei_combined_json.txt" "$AXIOM_EXTRA_ARGS"
+ -silent -retries 2 $NUCLEI_EXTRA_ARGS -j -o ".tmp/nuclei_combined_json.txt" "${AXIOM_EXTRA_ARGS_ARR[@]}"
# Split combined results into per-severity files for backward compatibility
_nuclei_split_by_severity
@@ -1534,7 +1525,7 @@ _fuzz_run_local() {
# Run ffuf via axiom-scan and parse per-subdomain results
_fuzz_run_axiom() {
cached_download_typed "${fuzzing_remote_list}" ".tmp/fuzzing_remote_list.txt" "onelistforallmicro.txt" "wordlists"
- run_with_heartbeat "axiom ffuf" axiom-scan webs/webs_all.txt -m ffuf -wL .tmp/fuzzing_remote_list.txt -H "${HEADER}" "$FFUF_FLAGS" -s -maxtime "$FFUF_MAXTIME" -oJ "$dir/.tmp/ffuf-content.json" "$AXIOM_EXTRA_ARGS"
+ run_with_heartbeat "axiom ffuf" axiom-scan webs/webs_all.txt -m ffuf -wL .tmp/fuzzing_remote_list.txt -H "${HEADER}" "$FFUF_FLAGS" -s -maxtime "$FFUF_MAXTIME" -oJ "$dir/.tmp/ffuf-content.json" "${AXIOM_EXTRA_ARGS_ARR[@]}"
while read -r sub; do
local sub_out
@@ -1985,9 +1976,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 $katana_headless_flags -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_ARR[@]}"
else
- 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"
+ 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_ARR[@]}"
fi
fi
fi
@@ -2254,7 +2245,7 @@ function jschecks() {
| grep -F "$domain" \
| grep -aEo 'https?://[^ ]+' | anew -q .tmp/subjslinks.txt || true
else
- run_command axiom-scan .tmp/url_extract_js.txt -m subjs -o .tmp/subjslinks.txt "$AXIOM_EXTRA_ARGS" 2>>"$LOGFILE" >/dev/null
+ run_command axiom-scan .tmp/url_extract_js.txt -m subjs -o .tmp/subjslinks.txt "${AXIOM_EXTRA_ARGS_ARR[@]}" 2>>"$LOGFILE" >/dev/null
fi
if [[ -s ".tmp/subjslinks.txt" ]]; then
@@ -2277,7 +2268,7 @@ function jschecks() {
if [[ -s "js/url_extract_js.txt" ]]; then
run_command axiom-scan js/url_extract_js.txt -m httpx -follow-host-redirects -H "$HEADER" -status-code \
-threads "$HTTPX_THREADS" -rl "$HTTPX_RATELIMIT" -timeout "$HTTPX_TIMEOUT" -silent \
- -content-type -retries 2 -no-color -o .tmp/js_livelinks.txt "$AXIOM_EXTRA_ARGS" 2>>"$LOGFILE" >/dev/null
+ -content-type -retries 2 -no-color -o .tmp/js_livelinks.txt "${AXIOM_EXTRA_ARGS_ARR[@]}" 2>>"$LOGFILE" >/dev/null
if [[ -s ".tmp/js_livelinks.txt" ]]; then
awk '/\\[200\\]/ && /javascript/ {print $1}' .tmp/js_livelinks.txt | anew -q js/js_livelinks.txt || true
fi
@@ -2338,7 +2329,7 @@ function jschecks() {
cat js/js_livelinks.txt | mantra -ua \"$HEADER\" -s | anew -q js/js_secrets.txt 2>>"$LOGFILE" >/dev/null || true
else
axiom-exec "go install github.com/Brosck/mantra@latest" 2>>"$LOGFILE" >/dev/null
- run_command axiom-scan js/js_livelinks.txt -m mantra -ua "$HEADER" -s -o js/js_secrets.txt "$AXIOM_EXTRA_ARGS" &>/dev/null
+ run_command axiom-scan js/js_livelinks.txt -m mantra -ua "$HEADER" -s -o js/js_secrets.txt "${AXIOM_EXTRA_ARGS_ARR[@]}" &>/dev/null
fi
mkdir -p .tmp/sourcemapper/secrets
if [[ -s "js/js_secrets.txt" ]]; then
@@ -2476,7 +2467,7 @@ function sub_js_extract() {
run_command axiom-scan .tmp/js_extracted_hosts_new.txt -m puredns-resolve \
-r "${AXIOM_RESOLVERS_PATH}" --resolvers-trusted "${AXIOM_RESOLVERS_TRUSTED_PATH}" \
--wildcard-tests "$PUREDNS_WILDCARDTEST_LIMIT" --wildcard-batch "$PUREDNS_WILDCARDBATCH_LIMIT" \
- -o .tmp/js_extracted_hosts_resolved.txt "$AXIOM_EXTRA_ARGS" 2>>"$LOGFILE" >/dev/null
+ -o .tmp/js_extracted_hosts_resolved.txt "${AXIOM_EXTRA_ARGS_ARR[@]}" 2>>"$LOGFILE" >/dev/null
fi
if [[ -s ".tmp/js_extracted_hosts_resolved.txt" ]]; then
@@ -2922,9 +2913,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 $katana_legacy_headless -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_ARR[@]}" 2>>"$LOGFILE" >/dev/null
else
- 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
+ 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_ARR[@]}" 2>>"$LOGFILE" >/dev/null
fi
# Remove lines longer than 2048 characters
if [[ -s ".tmp/katana.txt" ]]; then
diff --git a/reconftw.sh b/reconftw.sh
index 482b67d..ae90b50 100755
--- a/reconftw.sh
+++ b/reconftw.sh
@@ -118,6 +118,19 @@ function normalize_vps_count_args() {
printf '%s\0' "${normalized_args[@]}"
}
+# Initialise AXIOM_EXTRA_ARGS_ARR from the current environment value so that
+# --source-only callers (unit tests) can rely on the array without running the
+# full config-source sequence. The canonical production parse re-runs below
+# after reconftw.cfg + secrets.cfg + CUSTOM_CONFIG are sourced (overwriting this).
+declare -a AXIOM_EXTRA_ARGS_ARR=()
+if [[ -n "${AXIOM_EXTRA_ARGS:-}" ]]; then
+ _axiom_ifs_saved="$IFS"
+ IFS=' '
+ read -r -a AXIOM_EXTRA_ARGS_ARR <<<"${AXIOM_EXTRA_ARGS}"
+ IFS="$_axiom_ifs_saved"
+ unset _axiom_ifs_saved
+fi
+
# Allow sourcing functions without execution (for testing)
# Must be checked before argument parsing to avoid side effects
if [[ "${1:-}" == "--source-only" ]]; then
@@ -510,6 +523,18 @@ if [[ -s $CUSTOM_CONFIG ]]; then
}
fi
+# Global parse of AXIOM_EXTRA_ARGS once after config load — single source of truth.
+# Consumed via "${AXIOM_EXTRA_ARGS_ARR[@]}" in modules/subdomains.sh and modules/web.sh.
+# Empty/unset env → empty array → expands to nothing at the call sites.
+declare -a AXIOM_EXTRA_ARGS_ARR=()
+if [[ -n "${AXIOM_EXTRA_ARGS:-}" ]]; then
+ _axiom_ifs_saved="$IFS"
+ IFS=' '
+ read -r -a AXIOM_EXTRA_ARGS_ARR <<<"${AXIOM_EXTRA_ARGS}"
+ IFS="$_axiom_ifs_saved"
+ unset _axiom_ifs_saved
+fi
+
# Re-apply CLI overrides after config load (config defaults should not clobber CLI flags)
if [[ "${CLI_MONITOR_MODE:-false}" == "true" ]]; then
MONITOR_MODE=true