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

Fixes #885 #817 #789 #783 #719 #657

six2dez3c13980f4f35
diff --git a/Docker/Dockerfile b/Docker/Dockerfile
index 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 variables
ARG COLLAB_SERVER="XXXXXXXXXX"
ARG XSS_SERVER="XXXXXXXXXXX"
@@ -38,6 +30,7 @@ ARG LANGUAGE
ARG GIT_REPOSITORY_AXIOM="https://github.com/attacksurge/ax.git"
ARG GIT_REPOSITORY_RECONFTW="https://github.com/six2dez/reconftw"
+ARG INSTALL_AXIOM=true
ENV COLLAB_SERVER=$COLLAB_SERVER
ENV XSS_SERVER=$XSS_SERVER
@@ -50,6 +43,8 @@ ENV LC_ALL=$LANG
ENV GIT_REPOSITORY_AXIOM=$GIT_REPOSITORY_AXIOM
ENV GIT_REPOSITORY_RECONFTW=$GIT_REPOSITORY_RECONFTW
+ENV INSTALL_AXIOM=$INSTALL_AXIOM
+
ENV DEBIAN_FRONTEND=noninteractive
ENV 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 localepurge
localepurge
###>> 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/go
eot
COPY 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."
+fi
eot
#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 271
EXPOSE 85-90
diff --git a/README.md b/README.md
index 7153cc7..7868782 100644
--- a/README.md
+++ b/README.md
@@ -264,6 +264,15 @@ cd reconftw
six2dez/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.sh
index 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 .; then
if [[ $FORCE_UPDATE == "true" ]]; then
printf "%bLocal changes detected; forcing update.%b\n" "$yellow" "$reset"
@@ -590,12 +591,25 @@ function check_updates() {
fi
printf "%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"
fi
git reset --hard &>/dev/null
run_to 60 git pull &>/dev/null
printf "%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
+ fi
else
printf "%breconFTW is already up to date!%b\n" "$bgreen" "$reset"
fi
diff --git a/reconftw.cfg b/reconftw.cfg
index 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 and
upgrade_tools=true
upgrade_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 tweak
diff --git a/reconftw.sh b/reconftw.sh
index 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 directory
if ! popd >/dev/null; then
@@ -5902,6 +5932,7 @@ function start() {
LOGFILE="${dir}/.log/${NOW}_${NOWT}.txt"
touch .log/${NOW}_${NOWT}.txt
echo "[$(date +'%Y-%m-%d %H:%M:%S')] Start ${NOW} ${NOWT}" >"${LOGFILE}"
+ enable_command_trace
# init time saved estimator
TIME_SAVED_EST=0
@@ -6165,6 +6196,7 @@ function multi_osint() {
LOGFILE="${workdir}/.log/${NOW}_${NOWT}.txt"
touch .log/${NOW}_${NOWT}.txt
echo "[$(date +'%Y-%m-%d %H:%M:%S')] Start ${NOW} ${NOWT}" >"${LOGFILE}"
+ enable_command_trace
for domain in $targets; do
dir=$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_trace
loopstart=$(date +%s)
domain_info
@@ -6521,6 +6554,7 @@ function multi_custom() {
LOGFILE="${dir}/.log/${NOW}_${NOWT}.txt"
touch .log/${NOW}_${NOWT}.txt
echo "[$(date +'%Y-%m-%d %H:%M:%S')] Start ${NOW} ${NOWT}" >"${LOGFILE}"
+ enable_command_trace
[ -n "$flist" ] && entries=$(cat "$flist" | wc -l)