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
Fixes #885 #817 #789 #783 #719 #657
six2dez3c13980f4f35
diff --git a/Docker/Dockerfile b/Docker/Dockerfileindex 9a4fd08..7a00932 100644--- a/Docker/Dockerfile+++ b/Docker/Dockerfile@@ -1,13 +1,5 @@# syntax=docker/dockerfile:1.4-FROM ubuntu:latest AS base_reconftw-USER nonrootuser--# Add a healthcheck instruction-HEALTHCHECK --interval=30s --timeout=5s --start-period=5s --retries=3 CMD curl --fail http://localhost/ || exit 1--#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-## You can change these variablesARG COLLAB_SERVER="XXXXXXXXXX"ARG XSS_SERVER="XXXXXXXXXXX"@@ -38,6 +30,7 @@ ARG LANGUAGEARG GIT_REPOSITORY_AXIOM="https://github.com/attacksurge/ax.git"ARG GIT_REPOSITORY_RECONFTW="https://github.com/six2dez/reconftw"+ARG INSTALL_AXIOM=trueENV COLLAB_SERVER=$COLLAB_SERVERENV XSS_SERVER=$XSS_SERVER@@ -50,6 +43,8 @@ ENV LC_ALL=$LANGENV GIT_REPOSITORY_AXIOM=$GIT_REPOSITORY_AXIOMENV GIT_REPOSITORY_RECONFTW=$GIT_REPOSITORY_RECONFTW+ENV INSTALL_AXIOM=$INSTALL_AXIOM+ENV DEBIAN_FRONTEND=noninteractiveENV DEBCONF_NONINTERACTIVE_SEEN=true@@ -57,13 +52,13 @@ ENV GOROOT='/usr/local/go'ENV GOPATH='/root/go'ENV AXIOMPATH='/root/.axiom/interact'ENV CARGOPATH='/root/.cargo/bin'-ENV PATH="${GOROOT}:${PATH}:${GOPATH}:${AXIOMPATH}:${CARGOPATH}"+ENV PATH="${GOROOT}/bin:${GOPATH}/bin:${AXIOMPATH}:${CARGOPATH}:${PATH}"COPY 01_nodoc /etc/dpkg/dpkg.cfg.d/RUN <<eot#!/bin/bash-set -x+set -euxo pipefail###>> Backup .bashrc <<###cp /root/.bashrc /root/original.bashrc@@ -87,13 +82,17 @@ dpkg-reconfigure localepurgelocalepurge###>> Configure Axiom <<###-mkdir -p /root/.axiom/-git clone ${GIT_REPOSITORY_AXIOM} /root/.axiom/-cd /root/.axiom/interact-./axiom-configure --unattended --shell Bash-## This avoids useless error messages later.-touch /root/.axiom/axiom.json-touch /root/.axiom/interact/includes/functions.sh+if [[ "${INSTALL_AXIOM}" == "true" ]]; then+ mkdir -p /root/.axiom/+ git clone ${GIT_REPOSITORY_AXIOM} /root/.axiom/+ cd /root/.axiom/interact+ ./axiom-configure --unattended --shell Bash || echo "Axiom configure failed or was skipped; continue without cloud fleet."+ ## This avoids useless error messages later.+ touch /root/.axiom/axiom.json+ touch /root/.axiom/interact/includes/functions.sh+else+ echo "INSTALL_AXIOM=${INSTALL_AXIOM}; skipping Axiom tooling."+fi###>> Install reconFTW <<###mkdir -p /root/Tools@@ -120,35 +119,40 @@ rm -rf /root/goeotCOPY github_tokens.txt /root/Tools/.github_tokens-COPY notify.conf /root/.config/notify/notify.conf+COPY notify.conf /root/.config/notify/provider-config.yaml###>> Configure Axiom Provider <<###RUN <<eot-###>> Regenerate SSH Keys <<###-apt update && apt install -y --no-install-recommends openssh-client--mkdir -p /root/.ssh-mkdir -p /root/.axiom/configs--ssh-keygen -b 2048 -t rsa -f /root/.ssh/axiom_rsa -q -N ""-cat /root/.ssh/axiom_rsa.pub > /root/.axiom/configs/authorized_keys--apt remove --purge -y openssh-client && apt autoremove -y && apt clean all-find /var/lib/apt/lists -type f -delete-find /var/cache -type f -delete-find /var/log -type f -delete-find /tmp -type f -delete-rm -rf /root/.cache+set -euxo pipefail+if [[ "${INSTALL_AXIOM}" == "true" ]]; then+ ###>> Regenerate SSH Keys <<###+ apt update && apt install -y --no-install-recommends openssh-client++ mkdir -p /root/.ssh+ mkdir -p /root/.axiom/configs++ ssh-keygen -b 2048 -t rsa -f /root/.ssh/axiom_rsa -q -N ""+ cat /root/.ssh/axiom_rsa.pub > /root/.axiom/configs/authorized_keys++ apt remove --purge -y openssh-client && apt autoremove -y && apt clean all+ find /var/lib/apt/lists -type f -delete+ find /var/cache -type f -delete+ find /var/log -type f -delete+ find /tmp -type f -delete+ rm -rf /root/.cache+else+ echo "INSTALL_AXIOM=${INSTALL_AXIOM}; skipping Axiom provider setup."+fieot#COPY axiom-config.ini /root/.axiom/configs/config.ini#COPY axiom-custom-provider.json /root/.axiom/accounts/personal.json-RUN axiom-account personal+RUN if [[ "${INSTALL_AXIOM}" == "true" ]]; then axiom-account personal || echo "Axiom account not configured; provide provider config to enable it."; fi# RUN az group delete --name axiom --yes --no-wait# This command exits with return code 1, so leave the '|| :' or the build will fail.# COPY axiom-custom-provider.json /root/.axiom/accounts/personal.json-RUN axiom-build reconftw || :+RUN if [[ "${INSTALL_AXIOM}" == "true" ]]; then axiom-build reconftw || :; fi## Issue 271EXPOSE 85-90diff --git a/README.md b/README.mdindex 7153cc7..7868782 100644--- a/README.md+++ b/README.md@@ -264,6 +264,15 @@ cd reconftwsix2dez/reconftw:main -d example.com -r```+ For a list of targets, bind the list file into the container and reference the in-container path:++ ```bash+ docker run -it --rm \+ -v "${PWD}/domains.txt:/reconftw/domains.txt:ro" \+ -v "${PWD}/OutputFolder/:/reconftw/Recon/" \+ six2dez/reconftw:main -l /reconftw/domains.txt -r+ ```+3. **View Results**:- Results are saved in the `OutputFolder` directory on the host (not inside the container).diff --git a/install.sh b/install.shindex 87ee709..c48f205 100755--- a/install.sh+++ b/install.sh@@ -580,6 +580,7 @@ function check_updates() {UPSTREAMHASH=$(git rev-parse "@{u}")if [[ $HEADHASH != "$UPSTREAMHASH" ]]; then+ local cfg_backup="" cfg_backup_ts=""if git status --porcelain | grep -q .; thenif [[ $FORCE_UPDATE == "true" ]]; thenprintf "%bLocal changes detected; forcing update.%b\n" "$yellow" "$reset"@@ -590,12 +591,25 @@ function check_updates() {fiprintf "%bA new version is available. Updating...%b\n" "$yellow" "$reset"if git status --porcelain | grep -q 'reconftw.cfg$'; then- mv reconftw.cfg reconftw.cfg_bck- printf "%breconftw.cfg has been backed up to reconftw.cfg_bck%b\n" "$yellow" "$reset"+ cfg_backup_ts=$(date +%Y%m%d_%H%M%S)+ cfg_backup="reconftw.cfg.bak.${cfg_backup_ts}"+ cp reconftw.cfg "$cfg_backup"+ printf "%breconftw.cfg has been backed up to %s%b\n" "$yellow" "$cfg_backup" "$reset"figit reset --hard &>/dev/nullrun_to 60 git pull &>/dev/nullprintf "%bUpdated! Running the new installer version...%b\n" "$bgreen" "$reset"++ # Show config diff against new default+ if [[ -n $cfg_backup && -f reconftw.cfg ]]; then+ mkdir -p .tmp+ cfg_diff_file=".tmp/reconftw_cfg_diff_${cfg_backup_ts}.patch"+ if diff -u "$cfg_backup" reconftw.cfg >"$cfg_diff_file"; then+ printf "%bConfig unchanged between versions (diff: %s).%b\n" "$yellow" "$cfg_diff_file" "$reset"+ else+ printf "%bConfig differences saved to %s (old -> new).%b\n" "$yellow" "$cfg_diff_file" "$reset"+ fi+ fielseprintf "%breconFTW is already up to date!%b\n" "$bgreen" "$reset"fidiff --git a/reconftw.cfg b/reconftw.cfgindex 4f24660..0dde131 100644--- a/reconftw.cfg+++ b/reconftw.cfg@@ -22,6 +22,7 @@ install_golang=true # Set it to false if you already have Golang configured andupgrade_tools=trueupgrade_before_running=false # Upgrade tools before running#dir_output=/custom/output/path+SHOW_COMMANDS=false # Set true to log every executed command to the per-target log (verbose; may include sensitive data)# Golang Vars (Comment or change on your own)export GOROOT="${GOROOT:-/usr/local/go}"@@ -294,3 +295,4 @@ blue='\033[0;34m'green='\033[0;32m'yellow='\033[0;33m'reset='\033[0m'+# local tweakdiff --git a/reconftw.sh b/reconftw.shindex 4f0bd70..c71c03d 100755--- a/reconftw.sh+++ b/reconftw.sh@@ -46,6 +46,27 @@ pt_msg_err() { printf "\n%b[%s] %s%b\n" "$bred" "$(date +'%Y-%m-%d %H:%M:%S')" "# If LOGFILE is unset or empty, send logs to /dev/null until later initialization: "${LOGFILE:=/dev/null}"+enable_command_trace() {+ # Enable bash xtrace to the current LOGFILE when SHOW_COMMANDS=true+ if [[ ${SHOW_COMMANDS:-false} != true ]]; then+ return+ fi+ [[ -z ${LOGFILE:-} ]] && return++ # Close any previous trace descriptor+ if [[ -n ${TRACE_FD:-} ]]; then+ eval "exec ${TRACE_FD}>&-"+ fi++ # Open a new descriptor against the active log+ if ! exec {TRACE_FD}>>"$LOGFILE"; then+ return+ fi+ export BASH_XTRACEFD=$TRACE_FD+ export PS4='+ ${BASH_SOURCE##*/}:${LINENO}: '+ set -x+}+function banner_grabber() {local banner_file="${SCRIPTPATH}/banners.txt"@@ -517,7 +538,16 @@ function apileaks() {fi# Run swaggerspy.py and handle errors- "${tools}/SwaggerSpy/venv/bin/python3" swaggerspy.py "$domain" 2>>"$LOGFILE" | grep -i "[*]\|URL" >"${dir}/osint/swagger_leaks.txt"+ local swag_cmd=("${tools}/SwaggerSpy/venv/bin/python3" "swaggerspy.py" "$domain")+ [[ -n ${TIMEOUT_CMD:-} ]] && swag_cmd=("$TIMEOUT_CMD" 2m "${swag_cmd[@]}")+ local swagger_rc=0+ {+ "${swag_cmd[@]}" 2>>"$LOGFILE" | grep -i "[*]\|URL" >"${dir}/osint/swagger_leaks.txt"+ swagger_rc=${PIPESTATUS[0]:-0} # ignore grep exit code (no matches is fine)+ } || true+ if (( swagger_rc != 0 )); then+ printf "%b[%s] SwaggerSpy failed (exit %s), continuing without swagger results.%b\n" "$yellow" "$(date +'%Y-%m-%d %H:%M:%S')" "$swagger_rc" "$reset" | tee -a "$LOGFILE" >/dev/null+ fi# Return to the previous directoryif ! popd >/dev/null; then@@ -5902,6 +5932,7 @@ function start() {LOGFILE="${dir}/.log/${NOW}_${NOWT}.txt"touch .log/${NOW}_${NOWT}.txtecho "[$(date +'%Y-%m-%d %H:%M:%S')] Start ${NOW} ${NOWT}" >"${LOGFILE}"+ enable_command_trace# init time saved estimatorTIME_SAVED_EST=0@@ -6165,6 +6196,7 @@ function multi_osint() {LOGFILE="${workdir}/.log/${NOW}_${NOWT}.txt"touch .log/${NOW}_${NOWT}.txtecho "[$(date +'%Y-%m-%d %H:%M:%S')] Start ${NOW} ${NOWT}" >"${LOGFILE}"+ enable_command_tracefor domain in $targets; dodir=$workdir/targets/$domain@@ -6333,6 +6365,7 @@ function multi_recon() {exit 1}echo "[$(date +'%Y-%m-%d %H:%M:%S')] Start ${NOW} ${NOWT}" >"$LOGFILE"+ enable_command_traceloopstart=$(date +%s)domain_info@@ -6521,6 +6554,7 @@ function multi_custom() {LOGFILE="${dir}/.log/${NOW}_${NOWT}.txt"touch .log/${NOW}_${NOWT}.txtecho "[$(date +'%Y-%m-%d %H:%M:%S')] Start ${NOW} ${NOWT}" >"${LOGFILE}"+ enable_command_trace[ -n "$flist" ] && entries=$(cat "$flist" | wc -l)