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

Small improvements

six2dez07f8428707fa
diff --git a/modules/osint.sh b/modules/osint.sh
index 7230494..a90cb83 100644
--- a/modules/osint.sh
+++ b/modules/osint.sh
@@ -451,21 +451,21 @@ function apileaks() {
return
fi
- merge_scoped_urls_into_url_extract "${dir}/osint/postman_leaks.txt" "apileaks_postman"
- merge_scoped_urls_into_url_extract "${dir}/osint/swagger_leaks.txt" "apileaks_swagger"
+ merge_scoped_urls_into_url_extract "${dir}/osint/postman_leaks.txt" "apileaks_postman"
+ merge_scoped_urls_into_url_extract "${dir}/osint/swagger_leaks.txt" "apileaks_swagger"
- # Analyze leaks with trufflehog
- if [[ -s "${dir}/osint/postman_leaks.txt" ]]; then
- run_command trufflehog filesystem "${dir}/osint/postman_leaks.txt" -j 2>/dev/null | jq -c | anew -q "${dir}/osint/postman_leaks_trufflehog.json"
- fi
- if [[ -d "${dir}/osint/postman_leaks_postleaksng" ]]; then
- run_command trufflehog filesystem "${dir}/osint/postman_leaks_postleaksng" -j 2>/dev/null | jq -c | anew -q "${dir}/osint/postman_leaks_trufflehog.json"
- fi
-
- if [[ -s "${dir}/osint/swagger_leaks.txt" ]]; then
- run_command trufflehog filesystem "${dir}/osint/swagger_leaks.txt" -j 2>/dev/null | jq -c | anew -q "${dir}/osint/swagger_leaks_trufflehog.json"
- fi
- end_func "Results are saved in $domain/osint/[postman_leaks_trufflehog.json, swagger_leaks_trufflehog.json]" "${FUNCNAME[0]}"
+ # Analyze leaks with trufflehog
+ if [[ -s "${dir}/osint/postman_leaks.txt" ]]; then
+ run_command trufflehog filesystem "${dir}/osint/postman_leaks.txt" -j 2>/dev/null | jq -c | anew -q "${dir}/osint/postman_leaks_trufflehog.json"
+ fi
+ if [[ -d "${dir}/osint/postman_leaks_postleaksng" ]]; then
+ run_command trufflehog filesystem "${dir}/osint/postman_leaks_postleaksng" -j 2>/dev/null | jq -c | anew -q "${dir}/osint/postman_leaks_trufflehog.json"
+ fi
+
+ if [[ -s "${dir}/osint/swagger_leaks.txt" ]]; then
+ run_command trufflehog filesystem "${dir}/osint/swagger_leaks.txt" -j 2>/dev/null | jq -c | anew -q "${dir}/osint/swagger_leaks_trufflehog.json"
+ fi
+ end_func "Results are saved in $domain/osint/[postman_leaks_trufflehog.json, swagger_leaks_trufflehog.json]" "${FUNCNAME[0]}"
else
if [[ $API_LEAKS == false ]] || [[ $OSINT == false ]]; then
skip_notification "disabled"
diff --git a/modules/utils.sh b/modules/utils.sh
index 808b419..10d6b31 100644
--- a/modules/utils.sh
+++ b/modules/utils.sh
@@ -30,7 +30,9 @@ function deleteOutScoped() {
fi
}
-merge_scoped_urls_into_url_extract() {
+# Callers (apileaks, jschecks) run sequentially (OSINT phase then Web phase).
+# If future changes run callers in parallel, add file locking around the anew+p1radup section.
+function merge_scoped_urls_into_url_extract() {
local source_file="$1"
local source_label="${2:-url source}"
local raw_file=".tmp/${source_label}_urls_raw.txt"
@@ -43,6 +45,8 @@ merge_scoped_urls_into_url_extract() {
[[ ! -s "$source_file" ]] && return 0
+ trap 'rm -f "$raw_file" "$scoped_file" "$normalized_file" "$query_file" "$plain_file" 2>/dev/null' RETURN
+
ensure_dirs .tmp webs || return 1
domain_regex=$(domain_match_regex "$domain")
: >"$raw_file"
diff --git a/modules/web.sh b/modules/web.sh
index 62c7baf..b8d5b9a 100644
--- a/modules/web.sh
+++ b/modules/web.sh
@@ -2513,7 +2513,7 @@ function well_known_pivots() {
-threads "${HTTPX_THREADS:-50}" -rl "${HTTPX_RATELIMIT:-0}" \
-timeout "${HTTPX_TIMEOUT:-10}" -retries 2 -no-color \
<.tmp/wellknown_hosts_resolved.txt \
- | awk '{print $1}' | anew -q webs/webs.txt 2>/dev/null || true
+ | awk '$2 ~ /^\[?[123]/ {print $1}' | anew -q webs/webs.txt 2>/dev/null || true
fi
fi
fi
diff --git a/tests/unit/test_new_tool_integrations.bats b/tests/unit/test_new_tool_integrations.bats
index bad6f43..162c775 100644
--- a/tests/unit/test_new_tool_integrations.bats
+++ b/tests/unit/test_new_tool_integrations.bats
@@ -1306,7 +1306,7 @@ SH
#!/usr/bin/env bash
while IFS= read -r host; do
[[ -z "$host" ]] && continue
- printf '%s 200\n' "https://${host}"
+ printf '%s [200]\n' "https://${host}"
done
SH
chmod +x "$MOCK_BIN/httpx"