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

First commit for v3.0 dev

six2dezdedb585bf878
diff --git a/bin/rftw_ip_cdnprovider b/bin/rftw_ip_cdnprovider
new file mode 100755
index 0000000..0da6e30
--- /dev/null
+++ b/bin/rftw_ip_cdnprovider
@@ -0,0 +1,65 @@
+#!/bin/bash
+# Check manually, the logic for extracting the ips from dnsx results should be on reconftw.sh script, this script should only scan the ips
+
+# Default config path
+CONFIG_PATH="$RECONFTW_CFG"
+
+# Check if the config file exists
+if [ -f "$CONFIG_PATH" ]; then
+ source "$CONFIG_PATH"
+else
+ echo "Error: reconftw.cfg not found at $CONFIG_PATH!"
+ exit 1
+fi
+
+# Help function
+help_menu() {
+ cat <<- EOF
+Usage: $0 [OPTIONS] <input_file>
+
+CDN Provider Check Tool
+
+Options:
+ -h, --help Show this help menu
+ -i, --input Specify the input IP lists file (required)
+ -f, --force Force the execution even if already processed
+ -o, --output Specify the output file (default is print to stdout)
+EOF
+}
+
+# Default values
+FORCE=false
+INPUT_FILE=""
+OUTPUT_FILE=""
+
+# Parse arguments
+while [[ "$#" -gt 0 ]]; do
+ case $1 in
+ -i|--input) INPUT_FILE="$2"; shift ;;
+ -h|--help) help_menu; exit 0 ;;
+ -f|--force) FORCE=true; shift ;;
+ -o|--output) OUTPUT_FILE="$2"; shift ;;
+ *)
+ if [ -z "$INPUT_FILE" ]; then
+ INPUT_FILE=$1
+ else
+ echo "Unknown parameter passed: $1"; exit 1;
+ fi
+ ;;
+ esac
+ shift
+done
+
+# Validate input file
+if [ ! -f "$INPUT_FILE" ] || [ ! -s "$INPUT_FILE" ]; then
+ echo "Invalid or empty input file!"
+ help_menu
+ exit 1
+fi
+
+# Handle the output of the cdncheck command based on the presence of the -o flag
+if [ -z "$OUTPUT_FILE" ]; then
+ cdncheck -silent -resp -nc < "$INPUT_FILE"
+else
+ cdncheck -silent -resp -nc < "$INPUT_FILE" | sort -u > "$OUTPUT_FILE"
+fi
diff --git a/bin/rftw_ip_favicon b/bin/rftw_ip_favicon
new file mode 100755
index 0000000..ec07f8b
--- /dev/null
+++ b/bin/rftw_ip_favicon
@@ -0,0 +1,86 @@
+#!/bin/bash
+# Looks good, needs testing
+
+# Load environment variables
+if [ -f "reconftw.cfg" ]; then
+ source reconftw.cfg
+else
+ echo "Error: reconftw.cfg not found!"
+ exit 1
+fi
+
+help_menu() {
+ echo "Usage: $0 [OPTIONS] DOMAIN"
+ echo ""
+ echo "Favicon Ip Lookup Tool"
+ echo ""
+ echo "Options:"
+ echo " -h, --help Show this help menu"
+ echo " -d, --domain DOMAIN Specify the domain to process"
+ echo " -f, --force Force the execution even if already processed"
+}
+
+# Start function
+start_func() {
+ echo "Starting $1..."
+}
+
+# End function
+end_func() {
+ echo "$1"
+ echo "End of $2..."
+}
+
+# Default values
+FORCE=false
+DOMAIN=""
+
+# Parse arguments
+while [[ "$#" -gt 0 ]]; do
+ case $1 in
+ -h|--help) help_menu; exit 0 ;;
+ -d|--domain) DOMAIN="$2"; shift ;;
+ -f|--force) FORCE=true ;;
+ *)
+ # Set the domain if it's not specified with -d
+ [ -z "$DOMAIN" ] && DOMAIN="$1" || { echo "Unknown parameter passed: $1"; exit 1; }
+ ;;
+ esac
+ shift
+done
+
+# Input validation
+if [ -z "$DOMAIN" ]; then
+ help_menu
+ exit 1
+fi
+
+# Validate domain format
+if [[ ! "$DOMAIN" =~ ^[a-zA-Z0-9.-]+$ ]]; then
+ echo "Invalid domain format."
+ exit 1
+fi
+
+if { [ ! -f "$called_fn_dir/.favicon" ] || [ "$FORCE" = true ]; } && [ "$FAVICON" = true ] && ! [[ $DOMAIN =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9] ]]; then
+ start_func "Favicon Ip Lookup"
+
+ cd "$tools/fav-up" || { echo "Failed to cd to $tools/fav-up in favicon"; exit 1; }
+ python3 favUp.py -w "$DOMAIN" -sc -o favicontest.json 2>>"$LOGFILE" >/dev/null
+
+ if [ -s "favicontest.json" ]; then
+ jq -r 'try .found_ips' favicontest.json 2>>"$LOGFILE" | grep -v "not-found" > favicontest.txt
+ sed -i "s/|/\n/g" favicontest.txt
+ cat favicontest.txt 2>>"$LOGFILE"
+ mv favicontest.txt $dir/hosts/favicontest.txt 2>>"$LOGFILE"
+ rm -f favicontest.json 2>>"$LOGFILE"
+ fi
+
+ cd "$dir" || { echo "Failed to cd to $dir in favicon"; exit 1; }
+ end_func "Results are saved in hosts/favicontest.txt" "favicon"
+else
+ if [ "$FAVICON" = false ] || [[ $DOMAIN =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9] ]]; then
+ echo -e "\n${yellow} favicon skipped in this mode, defined in reconftw.cfg, or the domain is an IP address${reset}\n"
+ else
+ echo -e "${yellow} favicon is already processed. To force executing favicon, delete\n $called_fn_dir/.favicon ${reset}\n\n"
+ fi
+fi
diff --git a/bin/rftw_ip_info b/bin/rftw_ip_info
new file mode 100755
index 0000000..240e6d9
--- /dev/null
+++ b/bin/rftw_ip_info
@@ -0,0 +1,101 @@
+#!/bin/bash
+# Looks good, needs testing
+
+# Load environment variables
+if [ -f "reconftw.cfg" ]; then
+ source reconftw.cfg
+else
+ echo "Error: reconftw.cfg not found!"
+ exit 1
+fi
+
+# Variables
+called_fn_dir="./called_functions"
+LOGFILE="./log.txt"
+IP_INFO=true
+OSINT=true
+WHOISXML_API_LOCAL="YOUR_API_KEY_HERE" # Replace with your actual API key
+
+# If WHOISXML_API is not in reconftw.cfg the use the one in the script
+if $WHOISXML_API; then
+ WHOISXML_API=$WHOISXML_API_LOCAL
+fi
+
+# If WHOISXML_API is not present or empty, exit the program
+if [ -z "$WHOISXML_API" ]; then
+ echo "No WHOISXML_API var defined, exiting..."
+ exit 1
+fi
+
+# Function to display help menu
+help_menu() {
+ cat <<- EOF
+Usage: $0 -i <input_file> -o <output_file>
+
+Search for IP information.
+
+Options:
+ -i, --input Target IP address
+ -o, --output Output file to save results
+ -h, --help Display this help menu
+EOF
+ exit 0
+}
+
+# Function to start the process
+start_func() {
+ echo "[*] $1"
+}
+
+# Function to end the process
+end_func() {
+ echo "[+] $1"
+}
+
+# Main function to gather IP info
+ip_info_func() {
+ local ip="$1"
+ if { [ ! -f "$called_fn_dir/.ip_info" ]; } && [ "$IP_INFO" = true ] && [ "$OSINT" = true ] && [[ $ip =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9] ]]; then
+ start_func "Searching IP info for $ip"
+
+ if [ -n "$WHOISXML_API" ]; then
+ # IP Relations
+ curl "https://reverse-ip.whoisxmlapi.com/api/v1?apiKey=${WHOISXML_API}&ip=${ip}" 2>/dev/null | jq -r '.result[].name' 2>>"$LOGFILE" >> "$OUTPUT_FILE"
+ # IP Whois
+ curl "https://www.whoisxmlapi.com/whoisserver/WhoisService?apiKey=${WHOISXML_API}&domainName=${ip}&outputFormat=json&da=2&registryRawText=1&registrarRawText=1&ignoreRawTexts=1" 2>/dev/null | jq 2>>"$LOGFILE" >> "$OUTPUT_FILE"
+ # IP Location
+ curl "https://ip-geolocation.whoisxmlapi.com/api/v1?apiKey=${WHOISXML_API}&ipAddress=${ip}" 2>/dev/null | jq -r '.ip,.location' 2>>"$LOGFILE" >> "$OUTPUT_FILE"
+ else
+ echo "${yellow} No WHOISXML_API var defined, skipping function ${reset}"
+ fi
+ else
+ echo "Skipped ip_info for $ip due to conditions or configuration."
+ fi
+}
+
+# Default values
+INPUT_FILE=""
+OUTPUT_FILE=""
+
+# Parse arguments
+while [[ "$#" -gt 0 ]]; do
+ case $1 in
+ -i|--input) INPUT_FILE="$2"; shift ;;
+ -o|--output) OUTPUT_FILE="$2"; shift ;;
+ -h|--help) help_menu ;;
+ *) echo "Unknown parameter passed: $1"; exit 1 ;;
+ esac
+ shift
+done
+
+# Input validation
+if [[ -z "$INPUT_FILE" || -z "$OUTPUT_FILE" ]]; then
+ help_menu
+fi
+
+# Process IPs
+while IFS= read -r IP; do
+ ip_info_func "$IP"
+done < "$INPUT_FILE"
+
+echo "Completed. Check $OUTPUT_FILE for the results."
diff --git a/bin/rftw_ip_portscan b/bin/rftw_ip_portscan
new file mode 100755
index 0000000..b751eba
--- /dev/null
+++ b/bin/rftw_ip_portscan
@@ -0,0 +1,100 @@
+#!/bin/bash
+# Check manually, the logic for extracting the ips from dnsx results should be on reconftw.sh script, this script should only scan the ips
+
+# Load environment variables
+if [ -f "reconftw.cfg" ]; then
+ source reconftw.cfg
+else
+ echo "Error: reconftw.cfg not found!"
+ exit 1
+fi
+
+# Help function
+help_menu() {
+ echo "Usage: $0 [OPTIONS] DOMAIN"
+ echo ""
+ echo "Port Scan Tool"
+ echo ""
+ echo "Options:"
+ echo " -h, --help Show this help menu"
+ echo " -d, --domain DOMAIN Specify the domain to process"
+ echo " -f, --force Force the execution even if already processed"
+}
+
+# Start function
+start_func() {
+ echo "Starting $1..."
+}
+
+# End function
+end_func() {
+ echo "$1"
+ echo "End of $2..."
+}
+
+# Input validation
+if [ -z "$1" ]; then
+ help_menu
+ exit 1
+fi
+
+# Default values
+FORCE=false
+
+# Parse arguments
+while [[ "$#" -gt 0 ]]; do
+ case $1 in
+ -h|--help) help_menu; exit 0 ;;
+ -d|--domain) DOMAIN="$2"; shift ;;
+ -f|--force) FORCE=true ;;
+ *) echo "Unknown parameter passed: $1"; exit 1 ;;
+ esac
+ shift
+done
+
+# Validate domain format
+if [[ ! "$DOMAIN" =~ ^[a-zA-Z0-9.-]+$ ]] && ! [[ $DOMAIN =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
+ echo "Invalid domain format."
+ exit 1
+fi
+
+if { [ ! -f "$called_fn_dir/.portscan" ] || [ "$FORCE" = true ]; } && [ "$PORTSCANNER" = true ]; then
+ start_func "portscan" "Port scan"
+
+ if ! [[ $DOMAIN =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
+ # The following checks and actions are based on the original function logic
+ [ -s "subdomains/subdomains_dnsregs.json" ] && jq -r 'try . | "\(.host) \(.a[0])"' subdomains/subdomains_dnsregs.json | anew -q .tmp/subs_ips.txt
+ [ -s ".tmp/subs_ips.txt" ] && awk '{ print $2 " " $1}' .tmp/subs_ips.txt | sort -k2 -n | anew -q hosts/subs_ips_vhosts.txt
+ [ -s "hosts/subs_ips_vhosts.txt" ] && cut -d ' ' -f1 hosts/subs_ips_vhosts.txt | grep -aEiv "^(127|10|169\.154|172\.1[6789]|172\.2[0-9]|172\.3[01]|192\.168)\." | grep -oE "\b([0-9]{1,3}\.){3}[0-9]{1,3}\b" | anew -q hosts/ips.txt
+ else
+ echo $DOMAIN | grep -aEiv "^(127|10|169\.154|172\.1[6789]|172\.2[0-9]|172\.3[01]|192\.168)\." | grep -oE "\b([0-9]{1,3}\.){3}[0-9]{1,3}\b" | anew -q hosts/ips.txt
+ fi
+
+ [ ! -s "hosts/cdn_providers.txt" ] && [ -s "hosts/ips.txt" ] && cdncheck -silent -resp -nc < hosts/ips.txt 2>/dev/null > hosts/cdn_providers.txt
+
+ [ -s "hosts/ips.txt" ] && comm -23 <(sort -u hosts/ips.txt) <(cut -d'[' -f1 hosts/cdn_providers.txt | sed 's/[[:space:]]*$//' | sort -u) | grep -aEiv "^(127|10|169\.154|172\.1[6789]|172\.2[0-9]|172\.3[01]|192\.168)\." | grep -oE "\b([0-9]{1,3}\.){3}[0-9]{1,3}\b" | sort -u | anew -q .tmp/ips_nocdn.txt
+
+ printf "${bblue}\n Resolved IP addresses (No CDN) ${reset}\n\n"
+ [ -s ".tmp/ips_nocdn.txt" ] && sort .tmp/ips_nocdn.txt
+ printf "${bblue}\n Scanning ports... ${reset}\n\n"
+
+ if [ "$PORTSCAN_PASSIVE" = true ] && [ ! -f "hosts/portscan_passive.txt" ] && [ -s ".tmp/ips_nocdn.txt" ]; then
+ smap -iL .tmp/ips_nocdn.txt > hosts/portscan_passive.txt
+ fi
+
+ if [ "$PORTSCAN_ACTIVE" = true ]; then
+ if [ "$AXIOM" = true ]; then
+ [ -s ".tmp/ips_nocdn.txt" ] && axiom-scan .tmp/ips_nocdn.txt -m nmapx --top-ports 200 -sV -n -Pn --open --max-retries 2 --script vulners -oA hosts/portscan_active $AXIOM_EXTRA_ARGS 2>>"$LOGFILE" >/dev/null
+ else
+ [ -s ".tmp/ips_nocdn.txt" ] && $SUDO nmap --top-ports 200 -sV -n --max-retries 2 -Pn --open --script vulners -iL .tmp/ips_nocdn.txt -oA hosts/portscan_active 2>>"$LOGFILE" >/dev/null
+ fi
+ fi
+
+ end_func "Results are saved in hosts/portscan_[passive|active].txt" "portscan"
+else
+ if [ "$PORTSCANNER" = false ]; then
+ printf "\n${yellow} portscan skipped in this mode or defined in reconftw.cfg ${reset}\n"
+ else
+ printf "${yellow} portscan is already processed, to force executing portscan delete\n $called_fn_dir/.portscan ${reset}\n\n"
+ fi
+fi
diff --git a/bin/rftw_osint_emails b/bin/rftw_osint_emails
new file mode 100755
index 0000000..d8207b0
--- /dev/null
+++ b/bin/rftw_osint_emails
@@ -0,0 +1,95 @@
+#!/bin/bash
+
+# Looks good, needs testing
+
+# Load environment variables
+if [ -f "reconftw.cfg" ]; then
+ source reconftw.cfg
+else
+ echo "Error: reconftw.cfg not found!"
+ exit 1
+fi
+
+
+
+function help_menu(){
+ echo "Usage: $0 [OPTIONS] [DOMAIN]"
+ echo ""
+ echo "Email Finder Tool"
+ echo ""
+ echo "Options:"
+ echo " -h, --help Show this help menu"
+ echo " -d, --domain DOMAIN Specify the domain target"
+ echo " -o, --output DIR Specify the output directory"
+ echo " -f, --force Force the execution even if already processed"
+}
+
+function validate_domain(){
+ if [[ ! "$1" =~ ^[a-zA-Z0-9.-]+$ ]]; then
+ echo "Error: Invalid domain format."
+ exit 1
+ fi
+}
+
+function emails(){
+ if { [ ! -f "$called_fn_dir/.${FUNCNAME[0]}" ] || [ "$DIFF" = true ]; } && [ "$EMAILS" = true ] && [ "$OSINT" = true ] && ! [[ $domain =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9] ]]; then
+ echo "Searching emails/users/passwords leaks"
+ emailfinder -d $domain 2>>"$LOGFILE" | anew -q .tmp/emailfinder.txt || { echo "emailfinder command failed"; exit 1; }
+ [ -s ".tmp/emailfinder.txt" ] && cat .tmp/emailfinder.txt | grep "@" | grep -iv "|_" | anew -q osint/emails.txt
+ echo "Results are saved in $domain/osint/emails.txt"
+ else
+ if [ "$EMAILS" = false ] || [ "$OSINT" = false ]; then
+ echo "${FUNCNAME[0]} skipped in this mode or defined in reconftw.cfg"
+ else
+ echo "${FUNCNAME[0]} is already processed, to force executing ${FUNCNAME[0]} delete $called_fn_dir/.${FUNCNAME[0]}"
+ fi
+ fi
+}
+
+function main(){
+ local OUTPUT_DIR="./"
+ local FORCE=false
+ local DOMAIN=""
+
+ # Parse arguments
+ while [[ "$#" -gt 0 ]]; do
+ case $1 in
+ -h|--help) help_menu; exit 0 ;;
+ -d|--domain) DOMAIN="$2"; shift ;;
+ -o|--output) OUTPUT_DIR="$2"; shift ;;
+ -f|--force) FORCE=true ;;
+ *)
+ # If a domain wasn't set using -d, then set it using the last argument
+ if [[ -z "$DOMAIN" ]]; then
+ DOMAIN="$1"
+ else
+ echo "Unknown parameter or multiple domains passed: $1"; exit 1;
+ fi
+ ;;
+ esac
+ shift
+ done
+
+ if [[ -z "$DOMAIN" ]]; then
+ echo "No domain provided."
+ help_menu
+ exit 1
+ fi
+
+ validate_domain "$DOMAIN"
+
+ # Define other variables
+ called_fn_dir="./called_functions"
+ DIFF=true
+ EMAILS=true
+ OSINT=true
+ LOGFILE="./log.txt"
+
+ echo "Processing domain: $DOMAIN"
+
+ # Call the emails function
+ emails
+}
+
+# Execute the main function
+main "$@"
\ No newline at end of file
diff --git a/bin/rftw_osint_ghdorks b/bin/rftw_osint_ghdorks
new file mode 100755
index 0000000..7d06cd1
--- /dev/null
+++ b/bin/rftw_osint_ghdorks
@@ -0,0 +1,67 @@
+#!/bin/bash
+
+# Default config path
+CONFIG_PATH="$RECONFTW_CFG"
+
+# Check if the config file exists
+if [ -f "$CONFIG_PATH" ]; then
+ source "$CONFIG_PATH"
+else
+ echo "Error: reconftw.cfg not found at $CONFIG_PATH!"
+ exit 1
+fi
+
+# Help menu
+function help_menu() {
+ echo -e "Usage: ./github_dorks_script.sh [OPTIONS] [DOMAIN]"
+ echo -e "Options:"
+ echo -e " -d, --domain DOMAIN Specify the domain"
+ echo -e " -g, --github-tokens FILE Specify the path to the GitHub tokens file"
+ echo -e " -D, --deep Use deep dorking (optional)"
+ echo -e " -h, --help Display this help menu"
+ exit 1
+}
+
+# Main function
+function github_dorks() {
+ if [ -s "${github_tokens}" ]; then
+ local dorks_file="$tools/gitdorks_go/Dorks/smalldorks.txt"
+ [ "$deep" = true ] && dorks_file="$tools/gitdorks_go/Dorks/medium_dorks.txt"
+ gitdorks_go -gd "$dorks_file" -nws 20 -target "$domain" -tf "${github_tokens}" -ew 3 || { echo "gitdorks_go/anew command failed" >&2; exit 1; }
+ else
+ echo -e "${bred}Required file ${github_tokens} not exists or empty${reset}" >&2
+ fi
+}
+
+# Default values
+domain=""
+github_tokens=""
+deep=false
+
+# Parse command-line arguments
+while [[ "$#" -gt 0 ]]; do
+ case $1 in
+ -d|--domain) domain="$2"; shift ;;
+ -g|--github-tokens) github_tokens="$2"; shift ;;
+ -D|--deep) deep=true ;;
+ -h|--help) help_menu ;;
+ *)
+ if [ -z "$domain" ]; then
+ domain="$1"
+ else
+ echo -e "${bred}Unknown parameter passed: $1${reset}" >&2; help_menu
+ fi
+ ;;
+ esac
+ shift
+done
+
+# Validate inputs
+if [ -z "$domain" ] || [ -z "$github_tokens" ]; then
+ echo -e "${bred}Error: Missing required parameters.${reset}" >&2
+ help_menu
+ exit 1
+fi
+
+# Execute the main function
+github_dorks
\ No newline at end of file
diff --git a/bin/rftw_osint_ghrepos b/bin/rftw_osint_ghrepos
new file mode 100755
index 0000000..52c138d
--- /dev/null
+++ b/bin/rftw_osint_ghrepos
@@ -0,0 +1,89 @@
+#!/bin/bash
+
+# Default config path
+CONFIG_PATH="$RECONFTW_CFG"
+
+# Check if the config file exists
+if [ -f "$CONFIG_PATH" ]; then
+ source "$CONFIG_PATH"
+else
+ echo "Error: reconftw.cfg not found at $CONFIG_PATH!"
+ exit 1
+fi
+
+# Help menu
+function help_menu() {
+ echo -e "Usage: ./github_repos_script.sh [OPTIONS] [DOMAIN]"
+ echo -e "Options:"
+ echo -e " -d, --domain DOMAIN Specify the domain"
+ echo -e " -t, --tools-dir DIRECTORY Specify the tools directory path"
+ echo -e " -g, --github-tokens FILE Specify the path to the GitHub tokens file"
+ echo -e " -o, --output FILE (Optional )Specify the output file path (prints to stdout if not set)"
+ echo -e " -h, --help Display this help menu"
+ exit 1
+}
+
+# Main function
+function github_repos() {
+ # Validate tools
+ mkdir -p .tmp >>"$LOGFILE" 2>&1
+ for tool in unfurl enumerepo jq interlace gitleaks trufflehog; do
+ if ! command -v $tool &> /dev/null; then
+ echo -e "${bred}Error: ${tool} is not installed.${reset}" >&2
+ exit 1
+ fi
+ done
+ if [ -s "${github_tokens}" ]; then
+ GH_TOKEN=$(cat ${github_tokens} | head -1)
+ echo $domain | unfurl format %r > .tmp/company_name.txt
+ enumerepo -token-string "${GH_TOKEN}" -usernames .tmp/company_name.txt -o .tmp/company_repos.txt
+ [ -s ".tmp/company_repos.txt" ] && jq -r '.[].repos[]|.url' < .tmp/company_repos.txt > .tmp/company_repos_url.txt
+ mkdir -p .tmp/github_repos
+ mkdir -p .tmp/github
+ [ -s ".tmp/company_repos_url.txt" ] && interlace -tL .tmp/company_repos_url.txt -threads ${INTERLACE_THREADS} -c "git clone _target_ .tmp/github_repos/_cleantarget_"
+ [ -d ".tmp/github/" ] && ls .tmp/github_repos > .tmp/github_repos_folders.txt
+ [ -s ".tmp/github_repos_folders.txt" ] && 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"
+ [ -s ".tmp/company_repos_url.txt" ] && interlace -tL .tmp/company_repos_url.txt -threads ${INTERLACE_THREADS} -c "trufflehog git _target_ -j 2>&1 | jq -c > _output_/_cleantarget_" -o .tmp/github/
+ if [ -d ".tmp/github/" ]; then
+ if [ -z "$output_file" ]; then
+ cat .tmp/github/* 2>/dev/null | jq -c | jq -r
+ else
+ cat .tmp/github/* 2>/dev/null | jq -c | jq -r > "$output_file"
+ fi
+ fi
+ else
+ printf "\n${bred} Required file ${GITHUB_TOKENS} not exists or empty${reset}\n"
+ fi
+}
+
+# Default values
+domain=""
+github_tokens=""
+
+# Parse command-line arguments
+while [[ "$#" -gt 0 ]]; do
+ case $1 in
+ -d|--domain) domain="$2"; shift ;;
+ -g|--github-tokens) github_tokens="$2"; shift ;;
+ -o|--output) output_file="$2"; shift ;; # Added this line to handle the -o flag
+ -h|--help) help_menu ;;
+ *)
+ if [ -z "$domain" ]; then
+ domain="$1"
+ else
+ echo -e "${bred}Unknown parameter passed: $1${reset}" >&2; help_menu
+ fi
+ ;;
+ esac
+ shift
+done
+
+# Validate inputs
+if [ -z "$domain" ] || [ -z "$github_tokens" ]; then
+ echo -e "${bred}Error: Missing required parameters.${reset}" >&2
+ help_menu
+ exit 1
+fi
+
+# Execute the main function
+github_repos
\ No newline at end of file
diff --git a/bin/rftw_osint_googledorks b/bin/rftw_osint_googledorks
new file mode 100755
index 0000000..94e3113
--- /dev/null
+++ b/bin/rftw_osint_googledorks
@@ -0,0 +1,58 @@
+#!/bin/bash
+
+# Default config path
+CONFIG_PATH="$RECONFTW_CFG"
+
+# Check if the config file exists
+if [ -f "$CONFIG_PATH" ]; then
+ source "$CONFIG_PATH"
+else
+ echo "Error: reconftw.cfg not found at $CONFIG_PATH!"
+ exit 1
+fi
+
+# Help menu
+function help_menu() {
+ echo -e "Usage: ./google_dorks_script.sh [OPTIONS]"
+ echo -e "Options:"
+ echo -e " -d, --domain DOMAIN Specify the domain"
+ echo -e " -o, --output FILE (Optional) Specify the output directory file"
+ echo -e " -h, --help Display this help menu"
+ exit 1
+}
+
+# Main function
+function google_dorks() {
+ output_file_arg=""
+ if [ -n "$output" ]; then
+ output_file_arg="-o ${output}"
+ fi
+
+ python3 "${tools}/dorks_hunter/dorks_hunter.py" -d "$domain" $output_file_arg || {
+ echo -e "${bred}Error: dorks_hunter.py failed.${reset}" >&2;
+ exit 1;
+ }
+}
+
+# Parse command-line arguments
+domain=""
+output_dir=""
+while [[ "$#" -gt 0 ]]; do
+ case $1 in
+ -d|--domain) domain="$2"; shift ;;
+ -o|--output) output="$2"; shift ;;
+ -h|--help) help_menu ;;
+ *) echo -e "${bred}Unknown parameter passed: $1${reset}" >&2; help_menu ;;
+ esac
+ shift
+done
+
+# Validate inputs
+if [ -z "$domain" ]; then
+ echo -e "${bred}Error: Missing required parameters.${reset}" >&2
+ help_menu
+ exit 1
+fi
+
+# Execute the main function
+google_dorks
diff --git a/bin/rftw_osint_metadata b/bin/rftw_osint_metadata
new file mode 100755
index 0000000..b9be0d0
--- /dev/null
+++ b/bin/rftw_osint_metadata
@@ -0,0 +1,40 @@
+#!/bin/bash
+
+# Load environment variables
+if [ -f "reconftw.cfg" ]; then
+ source reconftw.cfg
+else
+ echo "Error: reconftw.cfg not found!"
+ exit 1
+fi
+
+# Define global variables
+called_fn_dir="/path/to/called_fn_dir"
+LOGFILE="/path/to/logfile"
+METAFINDER_LIMIT=100
+domain=$1
+
+function gather_metadata() {
+ if { [ ! -f "$called_fn_dir/.metadata" ] || [ "$DIFF" = true ]; } && [ "$METADATA" = true ] && [ "$OSINT" = true ] && ! [[ $domain =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9] ]]; then
+ echo -e "${yellow}Scanning metadata in public files${reset}"
+
+ metafinder -d "$domain" -l $METAFINDER_LIMIT -o osint -go -bi -ba &>> "$LOGFILE" || { echo "metafinder command failed"; exit 1; }
+ mv "osint/${domain}/"*".txt" "osint/" 2>>"$LOGFILE"
+ rm -rf "osint/${domain}" 2>>"$LOGFILE"
+ echo "Results are saved in $domain/osint/[software/authors/metadata_results].txt"
+ elif [ "$METADATA" = false ] || [ "$OSINT" = false ]; then
+ echo -e "${yellow}metadata skipped as defined in reconftw.cfg${reset}"
+ else
+ echo -e "${yellow}metadata is already processed or input is an IP. To force, delete\n $called_fn_dir/.metadata${reset}"
+ fi
+}
+
+function main() {
+ if [ -z "$domain" ]; then
+ echo "Usage: $0 <domain>"
+ exit 1
+ fi
+ gather_metadata
+}
+
+main
diff --git a/bin/rftw_osint_postleaks b/bin/rftw_osint_postleaks
new file mode 100755
index 0000000..bb40b02
--- /dev/null
+++ b/bin/rftw_osint_postleaks
@@ -0,0 +1,51 @@
+#!/bin/bash
+
+# Load environment variables
+if [ -f "reconftw.cfg" ]; then
+ source reconftw.cfg
+else
+ echo "Error: reconftw.cfg not found!"
+ exit 1
+fi
+
+# Help menu function
+function help_menu() {
+ echo -e "Usage: $0 [-d DOMAIN] or $0 [DOMAIN]"
+ echo -e "Options:"
+ echo -e " -d DOMAIN Specify the domain to scan for postman leaks."
+ echo -e " -h, --help Display this help menu"
+ exit 1
+}
+
+function postleaks() {
+ if { [ ! -f "$called_fn_dir/.postleaks" ] || [ "$DIFF" = true ]; } && [ "$POSTMAN_LEAKS" = true ] && [ "$OSINT" = true ] && ! [[ $domain =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9] ]]; then
+ echo -e "${yellow}Scanning for leaks in postman public directory${reset}"
+
+ postleaksNg -k "$domain" > .tmp/postleaks.txt || { echo "postleaksNg command failed"; exit 1; }
+ echo "Results are saved in .tmp/postleaks.txt"
+ elif [ "$POSTMAN_LEAKS" = false ] || [ "$OSINT" = false ]; then
+ echo -e "${yellow}postleaks skipped as defined in reconftw.cfg${reset}"
+ else
+ echo -e "${yellow}postleaks is already processed or input is an IP. To force, delete\n $called_fn_dir/.postleaks${reset}"
+ fi
+}
+
+# Main function to execute the postleaks function
+function main() {
+ if [[ -z "$domain" ]]; then
+ help_menu
+ fi
+ postleaks
+}
+
+# Parse command-line arguments
+while [[ "$#" -gt 0 ]]; do
+ case $1 in
+ -d) domain="$2"; shift ;;
+ -h|--help) help_menu ;;
+ *) domain="$1" ;;
+ esac
+ shift
+done
+
+main
diff --git a/bin/rftw_osint_whois b/bin/rftw_osint_whois
new file mode 100755
index 0000000..99a6e0a
--- /dev/null
+++ b/bin/rftw_osint_whois
@@ -0,0 +1,68 @@
+#!/bin/bash
+
+# Load environment variables
+if [ -f "reconftw.cfg" ]; then
+ source reconftw.cfg
+else
+ echo "Error: reconftw.cfg not found!"
+ exit 1
+fi
+
+# Function to display help menu
+help_menu() {
+ echo "Usage: $0 <domain>"
+ echo "Search for domain information."
+ echo ""
+ echo "Options:"
+ echo " -h, --help Display this help menu"
+ exit 0
+}
+
+# Parse command-line arguments
+while [[ "$#" -gt 0 ]]; do
+ case $1 in
+ -h|--help) help_menu ;;
+ *) domain="$1" ;;
+ esac
+ shift
+done
+
+# Input validation
+if [ -z "$domain" ] || [[ "$domain" == "-h" ]] || [[ "$domain" == "--help" ]]; then
+ help_menu
+fi
+
+# Function to start the process
+start_func() {
+ echo "[*] $1"
+}
+
+# Function to end the process
+end_func() {
+ echo "[+] $1"
+}
+
+# Main function to gather domain info
+domain_info_func() {
+ if { [ ! -f "$called_fn_dir/.domain_info" ]; } && [ "$DOMAIN_INFO" = true ] && [ "$OSINT" = true ] && ! [[ $domain =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9] ]]; then
+ start_func "Searching domain info (whois, registrant name/email domains)"
+
+ # Domain General Info
+ whois -H $domain > osint/domain_info_general.txt || { echo "whois command failed"; exit 1; }
+
+ # Reverse Whois (if DEEP or REVERSE_WHOIS is true)
+ if [ "$DEEP" = true ] || [ "$REVERSE_WHOIS" = true ]; then
+ timeout -k 1m ${AMASS_INTEL_TIMEOUT}m amass intel -d ${domain} -whois -timeout $AMASS_INTEL_TIMEOUT -o osint/domain_info_reverse_whois.txt 2>>"$LOGFILE" &>/dev/null
+ fi
+
+ # Azure Tenant Domains
+ curl -s "https://aadinternals.azurewebsites.net/api/tenantinfo?domainName=${domain}" -H "Origin: https://aadinternals.com" | jq -r .domains[].name > osint/azure_tenant_domains.txt
+
+ end_func "Results are saved in $domain/osint/domain_info_[general/name/email/ip].txt"
+ else
+ echo "Skipped domain_info due to conditions or configuration."
+ fi
+}
+
+# Call the main function
+domain_info_func
diff --git a/bin/rftw_sub_active b/bin/rftw_sub_active
new file mode 100755
index 0000000..97e51a6
--- /dev/null
+++ b/bin/rftw_sub_active
@@ -0,0 +1,75 @@
+#!/bin/bash
+
+# Load environment variables
+if [ -f "reconftw.cfg" ]; then
+ source reconftw.cfg
+else
+ echo "Error: reconftw.cfg not found!"
+ exit 1
+fi
+
+# Help menu
+display_help() {
+ echo "Usage: $0 [Options]"
+ echo
+ echo " -d, --domain Domain for which subdomain enumeration is required"
+ echo " -l, --log Log file location"
+ echo " -p, --public-limit PUREDNS Public Limit"
+ echo " ... Other options here ..."
+ echo " -h, --help Display this help and exit"
+ echo
+ echo "Example: $0 -d example.com -l /path/to/log"
+ exit 1
+}
+
+# Input validation
+if [ "$#" -eq 0 ]; then
+ display_help
+ exit 1
+fi
+
+# Parse input arguments
+while [[ "$#" -gt 0 ]]; do
+ case $1 in
+ -d|--domain) domain="$2"; shift ;;
+ -l|--log) LOGFILE="$2"; shift ;; # Add this
+ -h|--help) display_help ;;
+ *) echo "Unknown parameter passed: $1"; exit 1 ;;
+ esac
+ shift
+done
+
+# Check if domain has been provided
+if [ -z "$domain" ]; then
+ echo "Error: Domain not specified."
+ exit 1
+fi
+
+sub_active() {
+ if [ ! -f "$called_fn_dir/.${FUNCNAME[0]}" ] || [ "$DIFF" = true ]; then
+ start_subfunc ${FUNCNAME[0]} "Running : Active Subdomain Enumeration"
+ find .tmp -type f -iname "*_subs.txt" -exec cat {} + | anew -q .tmp/subs_no_resolved.txt
+ [ -s "$outOfScope_file" ] && deleteOutScoped $outOfScope_file .tmp/subs_no_resolved.txt
+ if [ ! "$AXIOM" = true ]; then
+ resolvers_update_quick_local
+ [ -s ".tmp/subs_no_resolved.txt" ] && puredns resolve .tmp/subs_no_resolved.txt -w .tmp/subdomains_tmp.txt -r $resolvers --resolvers-trusted $resolvers_trusted -l $PUREDNS_PUBLIC_LIMIT --rate-limit-trusted $PUREDNS_TRUSTED_LIMIT --wildcard-tests $PUREDNS_WILDCARDTEST_LIMIT --wildcard-batch $PUREDNS_WILDCARDBATCH_LIMIT 2>>"$LOGFILE" >/dev/null
+ else
+ resolvers_update_quick_axiom
+ [ -s ".tmp/subs_no_resolved.txt" ] && axiom-scan .tmp/subs_no_resolved.txt -m puredns-resolve -r /home/op/lists/resolvers.txt --resolvers-trusted /home/op/lists/resolvers_trusted.txt --wildcard-tests $PUREDNS_WILDCARDTEST_LIMIT --wildcard-batch $PUREDNS_WILDCARDBATCH_LIMIT -o .tmp/subdomains_tmp.txt $AXIOM_EXTRA_ARGS 2>>"$LOGFILE" >/dev/null
+ fi
+ echo $domain | dnsx -retry 3 -silent -r $resolvers_trusted 2>>"$LOGFILE" | anew -q .tmp/subdomains_tmp.txt
+ if [ "$DEEP" = true ]; then
+ cat .tmp/subdomains_tmp.txt | tlsx -san -cn -silent -ro -c $TLSX_THREADS -p $TLS_PORTS | anew -q .tmp/subdomains_tmp.txt
+ else
+ cat .tmp/subdomains_tmp.txt | tlsx -san -cn -silent -ro -c $TLSX_THREADS | anew -q .tmp/subdomains_tmp.txt
+ fi
+ [[ "$INSCOPE" = true ]] && check_inscope .tmp/subdomains_tmp.txt 2>>"$LOGFILE" >/dev/null
+ NUMOFLINES=$(cat .tmp/subdomains_tmp.txt 2>>"$LOGFILE" | grep "\.$domain$\|^$domain$" | anew subdomains/subdomains.txt | sed '/^$/d' | wc -l)
+ end_subfunc "${NUMOFLINES} subs DNS resolved from passive" ${FUNCNAME[0]}
+ else
+ printf "${yellow} ${FUNCNAME[0]} is already processed, to force executing ${FUNCNAME[0]} delete\n $called_fn_dir/.${FUNCNAME[0]} ${reset}\n\n"
+ fi
+}
+
+# Run the function
+sub_active
\ No newline at end of file
diff --git a/bin/rftw_sub_analytics b/bin/rftw_sub_analytics
new file mode 100755
index 0000000..f31f902
--- /dev/null
+++ b/bin/rftw_sub_analytics
@@ -0,0 +1,96 @@
+#!/bin/bash
+
+# Load environment variables
+if [ -f "reconftw.cfg" ]; then
+ source reconftw.cfg
+else
+ echo "Error: reconftw.cfg not found!"
+ exit 1
+fi
+
+function usage() {
+ echo "Usage: $0 [-h] [-d DOMAIN] [-i INPUT_FILE] [-o OUTPUT_FILE]"
+ echo " -h Display this help message."
+ echo " -d DOMAIN Specify the target domain."
+ echo " -i INPUT_FILE Specify the input file."
+ echo " -o OUTPUT_FILE Specify the output file."
+ exit 1
+}
+
+# Validate input arguments
+input_file=""
+output_file=""
+while getopts ":hd:i:o:" opt; do
+ case ${opt} in
+ h)
+ usage
+ ;;
+ d)
+ domain="$OPTARG"
+ ;;
+ i)
+ input_file="$OPTARG"
+ if [[ ! -f "$input_file" ]]; then
+ echo "Error: Input file does not exist."
+ exit 1
+ fi
+ ;;
+ o)
+ output_file="$OPTARG"
+ touch "$output_file" 2>/dev/null || { echo "Error: Cannot write to the specified output file."; exit 1; }
+ ;;
+ *)
+ echo "Invalid option: -$OPTARG" 1>&2
+ usage
+ ;;
+ esac
+done
+shift $((OPTIND -1))
+
+if [[ -z "$domain" ]]; then
+ echo "Error: No domain specified."
+ usage
+fi
+
+function sub_analytics() {
+ if { [ ! -f "$called_fn_dir/.sub_analytics" ] || [ "$DIFF" = true ]; } && [ "$SUBANALYTICS" = true ]; then
+ echo "Running : Analytics Subdomain Enumeration"
+
+ if [ -s ".tmp/probed_tmp_scrap.txt" ]; then
+ mkdir -p .tmp/output_analytics/
+ analyticsrelationships -ch < .tmp/probed_tmp_scrap.txt >> .tmp/analytics_subs_tmp.txt 2>>"$LOGFILE"
+
+ [ -s ".tmp/analytics_subs_tmp.txt" ] && cat .tmp/analytics_subs_tmp.txt | grep "\.$domain$\|^$domain$" | sed "s/|__ //" | anew -q .tmp/analytics_subs_clean.txt
+
+ if [ ! "$AXIOM" = true ]; then
+ resolvers_update_quick_local
+ [ -s ".tmp/analytics_subs_clean.txt" ] && puredns resolve .tmp/analytics_subs_clean.txt -w .tmp/analytics_subs_resolved.txt -r $resolvers --resolvers-trusted $resolvers_trusted -l $PUREDNS_PUBLIC_LIMIT --rate-limit-trusted $PUREDNS_TRUSTED_LIMIT --wildcard-tests $PUREDNS_WILDCARDTEST_LIMIT --wildcard-batch $PUREDNS_WILDCARDBATCH_LIMIT 2>>"$LOGFILE" >/dev/null
+ else
+ resolvers_update_quick_axiom
+ [ -s ".tmp/analytics_subs_clean.txt" ] && axiom-scan .tmp/analytics_subs_clean.txt -m puredns-resolve -r /home/op/lists/resolvers.txt --resolvers-trusted /home/op/lists/resolvers_trusted.txt --wildcard-tests $PUREDNS_WILDCARDTEST_LIMIT --wildcard-batch $PUREDNS_WILDCARDBATCH_LIMIT -o .tmp/analytics_subs_resolved.txt $AXIOM_EXTRA_ARGS 2>>"$LOGFILE" >/dev/null
+ fi
+ fi
+
+ [[ "$INSCOPE" = true ]] && check_inscope .tmp/analytics_subs_resolved.txt 2>>"$LOGFILE" >/dev/null
+ NUMOFLINES=$(cat .tmp/analytics_subs_resolved.txt 2>>"$LOGFILE" | anew subdomains/subdomains.txt | sed '/^$/d' | wc -l)
+
+ echo "${NUMOFLINES} new subs (analytics relationship)"
+ else
+ if [ "$SUBANALYTICS" = false ]; then
+ echo -e "\n${yellow} sub_analytics skipped in this mode or defined in reconftw.cfg ${reset}\n"
+ else
+ echo -e "${yellow} sub_analytics is already processed, to force executing sub_analytics delete\n $called_fn_dir/.sub_analytics ${reset}\n\n"
+ fi
+ fi
+}
+
+# At the end where you save the output, you can redirect the output to the specified file
+if [[ ! -z "$output_file" ]]; then
+ # For example, if you were saving data like this:
+ # echo "${NUMOFLINES} new subs (analytics relationship)"
+ # Change it to:
+ echo "${NUMOFLINES} new subs (analytics relationship)" > "$output_file"
+fi
+
+# Execute the function
+sub_analytics
\ No newline at end of file
diff --git a/bin/rftw_sub_brute b/bin/rftw_sub_brute
new file mode 100755
index 0000000..6e64bf4
--- /dev/null
+++ b/bin/rftw_sub_brute
@@ -0,0 +1,88 @@
+#!/bin/bash
+
+# Load environment variables from reconftw.cfg
+if [ -f "reconftw.cfg" ]; then
+ source reconftw.cfg
+else
+ echo "Error: reconftw.cfg not found!"
+ exit 1
+fi
+
+# Help menu
+display_help() {
+ echo "Usage: $0 [Options]"
+ echo "Options:"
+ echo " -h, --help Display this help and exit"
+ echo " -i, --input INPUT_FILE Specify the input file"
+ echo " -o, --output OUTPUT_FILE Specify the output file"
+ echo
+ echo "Ensure all required environment variables are set in reconftw.cfg"
+ exit 1
+}
+
+# Input validation for environment variables
+if [ -z "$domain" ] || [ -z "$resolvers_trusted" ] || [ -z "$LOGFILE" ] || [ -z "$subs_wordlist" ] || [ -z "$subs_wordlist_big" ]; then
+ echo "Error: One or more required environment variables are missing in reconftw.cfg."
+ display_help
+fi
+
+# Initialize input_file and output_file variables
+input_file=""
+output_file=""
+
+# Parse input arguments
+while [[ "$#" -gt 0 ]]; do
+ case $1 in
+ -h|--help) display_help ;;
+ -i|--input)
+ shift;
+ input_file="$1";
+ if [[ ! -f "$input_file" ]]; then
+ echo "Error: Input file does not exist."
+ exit 1
+ fi
+ ;;
+ -o|--output)
+ shift;
+ output_file="$1";
+ touch "$output_file" 2>/dev/null || { echo "Error: Cannot write to the specified output file."; exit 1; }
+ ;;
+ *) echo "Unknown parameter passed: $1"; display_help ;;
+ esac
+ shift
+done
+
+# Main logic
+sub_brute() {
+ if { [ ! -f "$called_fn_dir/.${FUNCNAME[0]}" ] || [ "$DIFF" = true ]; } && [ "$SUBBRUTE" = true ]; then
+ start_subfunc ${FUNCNAME[0]} "Running : Bruteforce Subdomain Enumeration"
+ if [ ! "$AXIOM" = true ]; then
+ resolvers_update_quick_local
+ if [ "$DEEP" = true ]; then
+ puredns bruteforce $subs_wordlist_big $domain -w .tmp/subs_brute.txt -r $resolvers --resolvers-trusted $resolvers_trusted -l $PUREDNS_PUBLIC_LIMIT --rate-limit-trusted $PUREDNS_TRUSTED_LIMIT --wildcard-tests $PUREDNS_WILDCARDTEST_LIMIT --wildcard-batch $PUREDNS_WILDCARDBATCH_LIMIT 2>>"$LOGFILE" >/dev/null
+ else
+ puredns bruteforce $subs_wordlist $domain -w .tmp/subs_brute.txt -r $resolvers --resolvers-trusted $resolvers_trusted -l $PUREDNS_PUBLIC_LIMIT --rate-limit-trusted $PUREDNS_TRUSTED_LIMIT --wildcard-tests $PUREDNS_WILDCARDTEST_LIMIT --wildcard-batch $PUREDNS_WILDCARDBATCH_LIMIT 2>>"$LOGFILE" >/dev/null
+ fi
+ [ -s ".tmp/subs_brute.txt" ] && puredns resolve .tmp/subs_brute.txt -w .tmp/subs_brute_valid.txt -r $resolvers --resolvers-trusted $resolvers_trusted -l $PUREDNS_PUBLIC_LIMIT --rate-limit-trusted $PUREDNS_TRUSTED_LIMIT --wildcard-tests $PUREDNS_WILDCARDTEST_LIMIT --wildcard-batch $PUREDNS_WILDCARDBATCH_LIMIT 2>>"$LOGFILE" >/dev/null
+ else
+ resolvers_update_quick_axiom
+ if [ "$DEEP" = true ]; then
+ axiom-scan $subs_wordlist_big -m puredns-single $domain -r /home/op/lists/resolvers.txt --resolvers-trusted /home/op/lists/resolvers_trusted.txt --wildcard-tests $PUREDNS_WILDCARDTEST_LIMIT --wildcard-batch $PUREDNS_WILDCARDBATCH_LIMIT -o .tmp/subs_brute.txt $AXIOM_EXTRA_ARGS 2>>"$LOGFILE" >/dev/null
+ else
+ axiom-scan $subs_wordlist -m puredns-single $domain -r /home/op/lists/resolvers.txt --resolvers-trusted /home/op/lists/resolvers_trusted.txt --wildcard-tests $PUREDNS_WILDCARDTEST_LIMIT --wildcard-batch $PUREDNS_WILDCARDBATCH_LIMIT -o .tmp/subs_brute.txt $AXIOM_EXTRA_ARGS 2>>"$LOGFILE" >/dev/null
+ fi
+ [ -s ".tmp/subs_brute.txt" ] && axiom-scan .tmp/subs_brute.txt -m puredns-resolve -r /home/op/lists/resolvers.txt --resolvers-trusted /home/op/lists/resolvers_trusted.txt --wildcard-tests $PUREDNS_WILDCARDTEST_LIMIT --wildcard-batch $PUREDNS_WILDCARDBATCH_LIMIT -o .tmp/subs_brute_valid.txt $AXIOM_EXTRA_ARGS 2>>"$LOGFILE" >/dev/null
+ fi
+ [[ "$INSCOPE" = true ]] && check_inscope .tmp/subs_brute_valid.txt 2>>"$LOGFILE" >/dev/null
+ NUMOFLINES=$(cat .tmp/subs_brute_valid.txt 2>>"$LOGFILE" | sed "s/*.//" | grep ".$domain$" | anew subdomains/subdomains.txt | sed '/^$/d' | wc -l)
+ end_subfunc "${NUMOFLINES} new subs (bruteforce)" ${FUNCNAME[0]}
+ else
+ if [ "$SUBBRUTE" = false ]; then
+ printf "\n${yellow} ${FUNCNAME[0]} skipped in this mode or defined in reconftw.cfg ${reset}\n"
+ else
+ printf "${yellow} ${FUNCNAME[0]} is already processed, to force executing ${FUNCNAME[0]} delete\n $called_fn_dir/.${FUNCNAME[0]} ${reset}\n\n"
+ fi
+ fi
+}
+
+sub_brute
\ No newline at end of file
diff --git a/bin/rftw_sub_crt b/bin/rftw_sub_crt
new file mode 100755
index 0000000..806e48d
--- /dev/null
+++ b/bin/rftw_sub_crt
@@ -0,0 +1,75 @@
+#!/bin/bash
+
+# Load environment variables from reconftw.cfg
+if [ -f "reconftw.cfg" ]; then
+ source reconftw.cfg
+else
+ echo "Error: reconftw.cfg not found!"
+ exit 1
+fi
+
+# Help Menu
+function display_help() {
+ echo "Usage: $0 [OPTIONS]"
+ echo "Options:"
+ echo " -d, --domain Set the target domain."
+ echo " -l, --limit Set the crt limit (default 100)."
+ echo " -D, --diff Set DIFF to true."
+ echo " -s, --subcrt Run crt subdomain enumeration."
+ echo " -i, --inscope Check inscope."
+ echo " -o, --output Specify the output file."
+ echo " -h, --help Display this help menu."
+}
+
+# Other functions
+function start_subfunc() {
+ echo "[+] Starting $1: $2"
+}
+
+function end_subfunc() {
+ echo "[+] Ending $1: $2"
+}
+
+function check_inscope() {
+ echo "Checking inscope for $1"
+ # TODO: Add your inscope logic here
+}
+# Variables for input and output
+output_file=""
+
+# Input validation and argument parsing
+while [[ "$#" -gt 0 ]]; do
+ case $1 in
+ -d|--domain) domain="$2"; shift;;
+ -l|--limit) CTR_LIMIT="$2"; shift;;
+ -D|--diff) DIFF=true;;
+ -s|--subcrt) SUBCRT=true;;
+ -i|--inscope) INSCOPE=true;;
+ -o|--output)
+ shift;
+ output_file="$1";
+ touch "$output_file" 2>/dev/null || { echo "Error: Cannot write to the specified output file."; exit 1; }
+ ;;
+ -h|--help) display_help; exit 0;;
+ *) echo "Unknown parameter passed: $1"; display_help; exit 1;;
+ esac
+ shift
+done
+
+# Main Functionality
+script_name=$(basename $0)
+if [[ ! -f "$called_fn_dir/.$script_name" ]] || [[ "$DIFF" = true ]] && [[ "$SUBCRT" = true ]]; then
+ start_subfunc "$script_name" "Running : Crtsh Subdomain Enumeration"
+
+ crt -s -json -l ${CTR_LIMIT} $domain 2>>"$LOGFILE" | jq -r '.[].subdomain' 2>>"$LOGFILE" | sed -e "s/^\\*\\.//" | anew -q .tmp/crtsh_subs_tmp.txt 2>>"$LOGFILE" >/dev/null
+ [[ "$INSCOPE" = true ]] && check_inscope .tmp/crtsh_subs_tmp.txt 2>>"$LOGFILE" >/dev/null
+ NUMOFLINES=$(cat .tmp/crtsh_subs_tmp.txt 2>>"$LOGFILE" | sed 's/\*.//g' | anew .tmp/crtsh_subs.txt | sed '/^$/d' | wc -l)
+ end_subfunc "${NUMOFLINES} new subs (cert transparency)" "$script_name"
+
+else
+ if [[ "$SUBCRT" = false ]]; then
+ echo "${script_name} skipped in this mode or defined in reconftw.cfg"
+ else
+ echo "${script_name} is already processed, to force executing ${script_name} delete $called_fn_dir/.${script_name}"
+ fi
+fi
\ No newline at end of file
diff --git a/bin/rftw_sub_dns b/bin/rftw_sub_dns
new file mode 100755
index 0000000..51483ef
--- /dev/null
+++ b/bin/rftw_sub_dns
@@ -0,0 +1,85 @@
+#!/bin/bash
+
+# Load environment variables from reconftw.cfg
+if [ -f "reconftw.cfg" ]; then
+ source reconftw.cfg
+else
+ echo "Error: reconftw.cfg not found!"
+ exit 1
+fi
+
+# Color definitions for output (optional, you can adjust or remove)
+yellow='\033[1;33m'
+reset='\033[0m'
+
+# Help menu
+display_help() {
+ echo "Usage: $0 [OPTIONS]"
+ echo "Options:"
+ echo " -d, --domain Set the target domain."
+ echo " -h, --help Display this help and exit."
+ echo " -f, --input-file Specify the input file with a list of domains."
+ echo " -o, --output-file Specify the output file for saving results."
+ echo
+ echo "Ensure all required environment variables are set in reconftw.cfg"
+}
+
+# Input validation
+if [ -z "$domain" ] || [ -z "$resolvers_trusted" ] || [ -z "$LOGFILE" ]; then
+ echo "Error: One or more required environment variables are missing in reconftw.cfg."
+ display_help
+ exit 1
+fi
+
+# Default values for input and output files
+INPUTFILE=""
+OUTPUTFILE="subdomains/subdomains.txt"
+
+# Parse input arguments
+while [[ "$#" -gt 0 ]]; do
+ case $1 in
+ -d|--domain) domain="$2"; shift;;
+ -f|--input-file) INPUTFILE="$2"; shift;;
+ -o|--output-file) OUTPUTFILE="$2"; shift;;
+ -h|--help) display_help; exit 0;;
+ *) echo "Unknown parameter passed: $1"; display_help; exit 1;;
+ esac
+ shift
+done
+
+# If an input file is provided, validate it
+if [ -n "$INPUTFILE" ] && [ ! -f "$INPUTFILE" ]; then
+ echo "Error: Input file $INPUTFILE not found!"
+ exit 1
+fi
+
+# Main logic (Original function content)
+sub_dns() {
+ if [ ! -f "$called_fn_dir/.${FUNCNAME[0]}" ] || [ "$DIFF" = true ]; then
+ start_subfunc ${FUNCNAME[0]} "Running : DNS Subdomain Enumeration and PTR search"
+ if [ ! "$AXIOM" = true ]; then
+ [ -s "subdomains/subdomains.txt" ] && cat subdomains/subdomains.txt | dnsx -r $resolvers_trusted -a -aaaa -cname -ns -ptr -mx -soa -silent -retry 3 -json -o subdomains/subdomains_dnsregs.json 2>>"$LOGFILE" >/dev/null
+ [ -s "subdomains/subdomains_dnsregs.json" ] && cat subdomains/subdomains_dnsregs.json | jq -r 'try .a[], try .aaaa[], try .cname[], try .ns[], try .ptr[], try .mx[], try .soa[]' 2>/dev/null | grep ".$domain$" | anew -q .tmp/subdomains_dns.txt
+ [ -s "subdomains/subdomains_dnsregs.json" ] && cat subdomains/subdomains_dnsregs.json | jq -r 'try .a[]' | sort -u | hakip2host | cut -d' ' -f 3 | unfurl -u domains | sed -e 's/*\.//' -e 's/\.$//' -e '/\./!d' | grep ".$domain$" | anew -q .tmp/subdomains_dns.txt
+ [ -s "subdomains/subdomains_dnsregs.json" ] && cat subdomains/subdomains_dnsregs.json | jq -r 'try "\(.host) - \(.a[])"' 2>/dev/null | sort -u -k2 | anew -q subdomains/subdomains_ips.txt
+ resolvers_update_quick_local
+ [ -s ".tmp/subdomains_dns.txt" ] && puredns resolve .tmp/subdomains_dns.txt -w .tmp/subdomains_dns_resolved.txt -r $resolvers --resolvers-trusted $resolvers_trusted -l $PUREDNS_PUBLIC_LIMIT --rate-limit-trusted $PUREDNS_TRUSTED_LIMIT --wildcard-tests $PUREDNS_WILDCARDTEST_LIMIT --wildcard-batch $PUREDNS_WILDCARDBATCH_LIMIT 2>>"$LOGFILE" >/dev/null
+ else
+ [ -s "subdomains/subdomains.txt" ] && axiom-scan subdomains/subdomains.txt -m dnsx -retry 3 -a -aaaa -cname -ns -ptr -mx -soa -json -o subdomains/subdomains_dnsregs.json $AXIOM_EXTRA_ARGS 2>>"$LOGFILE" >/dev/null
+ [ -s "subdomains/subdomains_dnsregs.json" ] && cat subdomains/subdomains_dnsregs.json | jq -r 'try .a[]' | sort -u | anew -q .tmp/subdomains_dns_a_records.txt
+ [ -s "subdomains/subdomains_dnsregs.json" ] && cat subdomains/subdomains_dnsregs.json | jq -r 'try .a[]' | sort -u | hakip2host | cut -d' ' -f 3 | unfurl -u domains | sed -e 's/*\.//' -e 's/\.$//' -e '/\./!d' | grep ".$domain$" | anew -q .tmp/subdomains_dns.txt
+ [ -s "subdomains/subdomains_dnsregs.json" ] && cat subdomains/subdomains_dnsregs.json | jq -r 'try .a[], try .aaaa[], try .cname[], try .ns[], try .ptr[], try .mx[], try .soa[]' 2>/dev/null | grep ".$domain$" | anew -q .tmp/subdomains_dns.txt
+ [ -s "subdomains/subdomains_dnsregs.json" ] && cat subdomains/subdomains_dnsregs.json | jq -r 'try "\(.host) - \(.a[])"' 2>/dev/null | sort -u -k2 | anew -q subdomains/subdomains_ips.txt
+ resolvers_update_quick_axiom
+ [ -s ".tmp/subdomains_dns.txt" ] && axiom-scan .tmp/subdomains_dns.txt -m puredns-resolve -r /home/op/lists/resolvers.txt --resolvers-trusted /home/op/lists/resolvers_trusted.txt --wildcard-tests $PUREDNS_WILDCARDTEST_LIMIT --wildcard-batch $PUREDNS_WILDCARDBATCH_LIMIT -o .tmp/subdomains_dns_resolved.txt $AXIOM_EXTRA_ARGS 2>>"$LOGFILE" >/dev/null
+ fi
+ [[ "$INSCOPE" = true ]] && check_inscope .tmp/subdomains_dns_resolved.txt 2>>"$LOGFILE" >/dev/null
+ NUMOFLINES=$(cat .tmp/subdomains_dns_resolved.txt 2>>"$LOGFILE" | grep "\.$domain$\|^$domain$" | anew subdomains/subdomains.txt | sed '/^$/d' | wc -l)
+ end_subfunc "${NUMOFLINES} new subs (dns resolution)" ${FUNCNAME[0]}
+ else
+ printf "${yellow} ${FUNCNAME[0]} is already processed, to force executing ${FUNCNAME[0]} delete\n $called_fn_dir/.${FUNCNAME[0]} ${reset}\n\n"
+ fi
+}
+
+# Call the main logic function
+sub_dns
diff --git a/bin/rftw_sub_full b/bin/rftw_sub_full
new file mode 100755
index 0000000..a1e7c44
--- /dev/null
+++ b/bin/rftw_sub_full
@@ -0,0 +1,130 @@
+#!/bin/bash
+
+# Load environment variables from reconftw.cfg
+if [ -f "reconftw.cfg" ]; then
+ source reconftw.cfg
+else
+ echo "Error: reconftw.cfg not found!"
+ exit 1
+fi
+
+# Function to display help menu
+help_menu() {
+ echo "Usage: $0 [OPTIONS]"
+ echo "Options:"
+ echo " -d, --domain Set the target domain."
+ echo " -h, --help Display this help and exit."
+ echo " -f, --input-file Specify the input file with a list of domains."
+ echo " -o, --output-file Specify the output file for saving results."
+ echo "Ensure all required environment variables are set in reconftw.cfg"
+ exit 0
+}
+
+# Parse input arguments
+while [[ "$#" -gt 0 ]]; do
+ case $1 in
+ -d|--domain) domain="$2"; shift;;
+ -f|--input-file) INPUTFILE="$2"; shift;;
+ -o|--output-file) OUTPUTFILE="$2"; shift;;
+ -h|--help) help_menu;;
+ *) echo "Unknown parameter passed: $1"; help_menu; exit 1;;
+ esac
+ shift
+done
+
+# If an input file is provided, validate it
+if [ -n "$INPUTFILE" ] && [ ! -f "$INPUTFILE" ]; then
+ echo "Error: Input file $INPUTFILE not found!"
+ exit 1
+fi
+
+# Input validation
+if [ -z "$domain" ] || [[ "$domain" == "-h" ]] || [[ "$domain" == "--help" ]]; then
+ help_menu
+fi
+
+# Function to start the process
+start_func() {
+ echo "[*] $1"
+}
+
+# Function to end the process
+end_func() {
+ echo "[+] $1"
+}
+
+# Function to notify the user
+notification() {
+ echo "[!] $1"
+}
+
+# Main function to gather subdomain info
+subdomains_full_func() {
+ echo "Starting subdomain enumeration for $domain"
+
+ NUMOFLINES_subs="0"
+ NUMOFLINES_probed="0"
+ printf "${bgreen}#######################################################################\n\n"
+ ! [[ $domain =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9] ]] && printf "${bblue} Subdomain Enumeration $domain\n\n"
+ [[ $domain =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9] ]] && printf "${bblue} Scanning IP $domain\n\n"
+ [ -s "subdomains/subdomains.txt" ] && cp subdomains/subdomains.txt .tmp/subdomains_old.txt
+ [ -s "webs/webs.txt" ] && cp webs/webs.txt .tmp/probed_old.txt
+
+ if ( [ ! -f "$called_fn_dir/.sub_active" ] || [ ! -f "$called_fn_dir/.sub_brute" ] || [ ! -f "$called_fn_dir/.sub_permut" ] || [ ! -f "$called_fn_dir/.sub_recursive_brute" ] ) || [ "$DIFF" = true ] ; then
+ resolvers_update
+ fi
+
+ [ -s "${inScope_file}" ] && cat ${inScope_file} | anew -q subdomains/subdomains.txt
+
+ if ! [[ $domain =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9] ]] && [ "$SUBDOMAINS_GENERAL" = true ]; then
+ rftw_sub_passive
+ rftw_sub_crt
+ rftw_sub_active
+ rftw_sub_noerror
+ rftw_sub_brute
+ rftw_sub_permut
+ rftw_sub_regex_permut
+ rftw_sub_recursive_passive
+ rftw_sub_recursive_brute
+ rftw_sub_dns
+ rftw_sub_scraping
+ rftw_sub_analytics
+ else
+ notification "IP/CIDR detected, subdomains search skipped"
+ echo $domain | anew -q subdomains/subdomains.txt
+ fi
+
+ webprobe_simple
+ if [ -s "subdomains/subdomains.txt" ]; then
+ [ -s "$outOfScope_file" ] && deleteOutScoped $outOfScope_file subdomains/subdomains.txt
+ NUMOFLINES_subs=$(cat subdomains/subdomains.txt 2>>"$LOGFILE" | anew .tmp/subdomains_old.txt | sed '/^$/d' | wc -l)
+ fi
+ if [ -s "webs/webs.txt" ]; then
+ [ -s "$outOfScope_file" ] && deleteOutScoped $outOfScope_file webs/webs.txt
+ NUMOFLINES_probed=$(cat webs/webs.txt 2>>"$LOGFILE" | anew .tmp/probed_old.txt | sed '/^$/d' | wc -l)
+ fi
+
+ if [ -n "$OUTPUTFILE" ]; then
+ cat subdomains/subdomains.txt > "$OUTPUTFILE"
+ cat webs/webs.txt >> "$OUTPUTFILE"
+ fi
+
+ printf "${bblue}\n Total subdomains: ${reset}\n\n"
+ notification "- ${NUMOFLINES_subs} alive" good
+ [ -s "subdomains/subdomains.txt" ] && cat subdomains/subdomains.txt | sort
+ notification "- ${NUMOFLINES_probed} new web probed" good
+ [ -s "webs/webs.txt" ] && cat webs/webs.txt | sort
+ notification "Subdomain Enumeration Finished" good
+ printf "${bblue} Results are saved in $domain/subdomains/subdomains.txt and webs/webs.txt${reset}\n"
+ printf "${bgreen}#######################################################################\n\n"
+}
+
+# Call the main function
+# Logic to handle multiple domains if INPUTFILE is provided
+if [ -n "$INPUTFILE" ]; then
+ while read -r domain; do
+ subdomains_full_func
+ done < "$INPUTFILE"
+else
+ subdomains_full_func
+fi
diff --git a/bin/rftw_sub_noerror b/bin/rftw_sub_noerror
new file mode 100755
index 0000000..c98f392
--- /dev/null
+++ b/bin/rftw_sub_noerror
@@ -0,0 +1,74 @@
+#!/bin/bash
+
+# Load environment variables from reconftw.cfg
+if [ -f "reconftw.cfg" ]; then
+ source reconftw.cfg
+else
+ echo "Error: reconftw.cfg not found!"
+ exit 1
+fi
+
+# Help menu
+display_help() {
+ echo "Usage: $0 [Options]"
+ echo
+ echo " -d, --domain Domain to check"
+ echo " -i, --input-file Input file with domains"
+ echo " -o, --output-file File to save results"
+ echo " -h, --help Display this help and exit"
+ echo
+ echo "Example: $0 -d example.com"
+ exit 1
+}
+
+# Parse input arguments
+while [[ "$#" -gt 0 ]]; do
+ case $1 in
+ -d|--domain) domain="$2"; shift ;;
+ -i|--input-file) INPUTFILE="$2"; shift ;;
+ -o|--output-file) OUTPUTFILE="$2"; shift ;;
+ -h|--help) display_help ;;
+ *) echo "Unknown parameter passed: $1"; display_help ;;
+ esac
+ shift
+done
+
+# Input validation
+if [ -z "$domain" ] && [ -z "$INPUTFILE" ]; then
+ echo "Error: Either domain or input file must be specified."
+ display_help
+fi
+
+sub_noerror() {
+ if { [ ! -f "$called_fn_dir/.${FUNCNAME[0]}" ] || [ "$DIFF" = true ]; } && [ "$SUBNOERROR" = true ]; then
+ start_subfunc ${FUNCNAME[0]} "Running : Checking NOERROR DNS response"
+ if [[ $(echo "${RANDOM}thistotallynotexist${RANDOM}.$domain" | dnsx -r $resolvers -rcode noerror,nxdomain -retry 3 -silent | cut -d' ' -f2) == "[NXDOMAIN]" ]]; then
+ resolvers_update_quick_local
+ if [ "$DEEP" = true ]; then
+ dnsx -d $domain -r $resolvers -silent -rcode noerror -w $subs_wordlist_big | cut -d' ' -f1 | anew -q .tmp/subs_noerror.txt 2>>"$LOGFILE" >/dev/null
+ else
+ dnsx -d $domain -r $resolvers -silent -rcode noerror -w $subs_wordlist | cut -d' ' -f1 | anew -q .tmp/subs_noerror.txt 2>>"$LOGFILE" >/dev/null
+ fi
+ [[ "$INSCOPE" = true ]] && check_inscope .tmp/subs_noerror.txt 2>>"$LOGFILE" >/dev/null
+ NUMOFLINES=$(cat .tmp/subs_noerror.txt 2>>"$LOGFILE" | sed "s/*.//" | grep ".$domain$" | anew subdomains/subdomains.txt | sed '/^$/d' | wc -l)
+ end_subfunc "${NUMOFLINES} new subs (DNS noerror)" ${FUNCNAME[0]}
+ else
+ printf "\n${yellow} Detected DNSSEC black lies, skipping this technique ${reset}\n"
+ fi
+ else
+ if [ "$SUBBRUTE" = false ]; then
+ printf "\n${yellow} ${FUNCNAME[0]} skipped in this mode or defined in reconftw.cfg ${reset}\n"
+ else
+ printf "${yellow} ${FUNCNAME[0]} is already processed, to force executing ${FUNCNAME[0]} delete\n $called_fn_dir/.${FUNCNAME[0]} ${reset}\n\n"
+ fi
+ fi
+}
+
+# Logic to handle multiple domains if INPUTFILE is provided
+if [ -n "$INPUTFILE" ]; then
+ while read -r domain; do
+ sub_noerror
+ done < "$INPUTFILE"
+else
+ sub_noerror
+fi
\ No newline at end of file
diff --git a/bin/rftw_sub_passive b/bin/rftw_sub_passive
new file mode 100755
index 0000000..113d208
--- /dev/null
+++ b/bin/rftw_sub_passive
@@ -0,0 +1,79 @@
+#!/bin/bash
+
+# Variables
+AMASS_ENUM_TIMEOUT=10m
+DIFF=false
+SUBPASSIVE=false
+RUNAMASS=false
+RUNSUBFINDER=false
+DEEP=false
+INSCOPE=false
+
+# Help menu
+function display_help() {
+ echo "Usage: $0 [OPTIONS]"
+ echo "Options:"
+ echo " -d, --domain Set the target domain."
+ echo " -a, --amass Run amass."
+ echo " -s, --subfinder Run subfinder."
+ echo " -g, --github-tokens Specify GitHub tokens file."
+ echo " -l, --gitlab-tokens Specify GitLab tokens file."
+ echo " -D, --deep Run in deep mode."
+ echo " -i, --inscope Check inscope."
+ echo " -h, --help Display this help menu."
+}
+
+function start_subfunc() {
+ echo "[+] Starting $1: $2"
+}
+
+function end_subfunc() {
+ echo "[+] Ending $1: $2"
+}
+
+function check_inscope() {
+ echo "Checking inscope for $1"
+ # TODO: Add your inscope logic here
+}
+
+# Input validation and argument parsing
+while [[ "$#" -gt 0 ]]; do
+ case $1 in
+ -d|--domain) domain="$2"; shift;;
+ -a|--amass) RUNAMASS=true;;
+ -s|--subfinder) RUNSUBFINDER=true;;
+ -g|--github-tokens) GITHUB_TOKENS="$2"; shift;;
+ -l|--gitlab-tokens) GITLAB_TOKENS="$2"; shift;;
+ -D|--deep) DEEP=true;;
+ -i|--inscope) INSCOPE=true;;
+ -h|--help) display_help; exit 0;;
+ *) echo "Unknown parameter passed: $1"; display_help; exit 1;;
+ esac
+ shift
+done
+
+# Main functionality
+if [[ ! -f "$called_fn_dir/.$0" ]] || [[ "$DIFF" = true ]] && [[ "$SUBPASSIVE" = true ]]; then
+ start_subfunc $0 "Running : Passive Subdomain Enumeration"
+
+ [[ $RUNAMASS == true ]] && timeout -k 1m ${AMASS_ENUM_TIMEOUT} amass enum -passive -d $domain -config $AMASS_CONFIG -timeout $AMASS_ENUM_TIMEOUT -json .tmp/amass_json.json 2>>"$LOGFILE" &>/dev/null
+ [ -s ".tmp/amass_json.json" ] && cat .tmp/amass_json.json | jq -r '.name' | anew -q .tmp/amass_psub.txt
+ [[ $RUNSUBFINDER == true ]] && subfinder -all -d "$domain" -silent -o .tmp/subfinder_psub.txt 2>>"$LOGFILE" >/dev/null
+ if [ -s "${GITHUB_TOKENS}" ]; then
+ if [ "$DEEP" = true ]; then
+ github-subdomains -d $domain -t $GITHUB_TOKENS -o .tmp/github_subdomains_psub.txt 2>>"$LOGFILE" >/dev/null
+ else
+ github-subdomains -d $domain -k -q -t $GITHUB_TOKENS -o .tmp/github_subdomains_psub.txt 2>>"$LOGFILE" >/dev/null
+ fi
+ fi
+ if [ -s "${GITLAB_TOKENS}" ]; then
+ gitlab-subdomains -d $domain -t $GITLAB_TOKENS > .tmp/gitlab_subdomains_psub.txt 2>>"$LOGFILE" >/dev/null
+ fi
+
+else
+ if [[ "$SUBPASSIVE" = false ]]; then
+ echo "${FUNCNAME[0]} skipped in this mode or defined in reconftw.cfg"
+ else
+ echo "${FUNCNAME[0]} is already processed, to force executing ${FUNCNAME[0]} delete $called_fn_dir/.${FUNCNAME[0]}"
+ fi
+fi
diff --git a/bin/rftw_sub_permut b/bin/rftw_sub_permut
new file mode 100755
index 0000000..e207704
--- /dev/null
+++ b/bin/rftw_sub_permut
@@ -0,0 +1,92 @@
+#!/bin/bash
+
+# Configuration file loading
+CONFIG_FILE="reconftw.cfg"
+if [[ -f "$CONFIG_FILE" ]]; then
+ source "$CONFIG_FILE"
+else
+ echo "Configuration file '$CONFIG_FILE' not found. Exiting."
+ exit 1
+fi
+
+# Helper function to display usage/help menu
+usage() {
+ echo "Usage: $0 [OPTIONS]"
+ echo
+ echo "Options:"
+ echo " -h, --help Display this help and exit."
+ echo
+ echo "Make sure to set up 'reconftw.cfg' with required environment variables."
+ exit 1
+}
+
+# Input validation
+if [[ "$#" -eq 1 && ("$1" == "-h" || "$1" == "--help") ]]; then
+ usage
+fi
+
+# Check for mandatory variables
+if [[ -z "$SUBPERMUTE" || -z "$called_fn_dir" || -z "$DIFF" ]]; then
+ echo "Mandatory variables not set in the configuration file. Exiting."
+ exit 1
+fi
+
+sub_permut() {
+ if { [ ! -f "$called_fn_dir/.${FUNCNAME[0]}" ] || [ "$DIFF" = true ]; } && [ "$SUBPERMUTE" = true ]; then
+ start_subfunc ${FUNCNAME[0]} "Running : Permutations Subdomain Enumeration"
+ if [ "$DEEP" = true ] || [ "$(cat subdomains/subdomains.txt | wc -l)" -le $DEEP_LIMIT ] ; then
+ if [ "$PERMUTATIONS_OPTION" = "gotator" ] ; then
+ [ -s "subdomains/subdomains.txt" ] && gotator -sub subdomains/subdomains.txt -perm $tools/permutations_list.txt $GOTATOR_FLAGS -silent 2>>"$LOGFILE" | head -c $PERMUTATIONS_LIMIT > .tmp/gotator1.txt
+ else
+ [ -s "subdomains/subdomains.txt" ] && ripgen -d subdomains/subdomains.txt -w $tools/permutations_list.txt 2>>"$LOGFILE" | head -c $PERMUTATIONS_LIMIT > .tmp/gotator1.txt
+ fi
+ elif [ "$(cat .tmp/subs_no_resolved.txt | wc -l)" -le $DEEP_LIMIT2 ]; then
+ if [ "$PERMUTATIONS_OPTION" = "gotator" ] ; then
+ [ -s ".tmp/subs_no_resolved.txt" ] && gotator -sub .tmp/subs_no_resolved.txt -perm $tools/permutations_list.txt $GOTATOR_FLAGS -silent 2>>"$LOGFILE" | head -c $PERMUTATIONS_LIMIT > .tmp/gotator1.txt
+ else
+ [ -s ".tmp/subs_no_resolved.txt" ] && ripgen -d .tmp/subs_no_resolved.txt -w $tools/permutations_list.txt 2>>"$LOGFILE" | head -c $PERMUTATIONS_LIMIT > .tmp/gotator1.txt
+ fi
+ else
+ end_subfunc "Skipping Permutations: Too Many Subdomains" ${FUNCNAME[0]}
+ return 1
+ fi
+ if [ ! "$AXIOM" = true ]; then
+ resolvers_update_quick_local
+ [ -s ".tmp/gotator1.txt" ] && puredns resolve .tmp/gotator1.txt -w .tmp/permute1.txt -r $resolvers --resolvers-trusted $resolvers_trusted -l $PUREDNS_PUBLIC_LIMIT --rate-limit-trusted $PUREDNS_TRUSTED_LIMIT --wildcard-tests $PUREDNS_WILDCARDTEST_LIMIT --wildcard-batch $PUREDNS_WILDCARDBATCH_LIMIT 2>>"$LOGFILE" >/dev/null
+ else
+ resolvers_update_quick_axiom
+ [ -s ".tmp/gotator1.txt" ] && axiom-scan .tmp/gotator1.txt -m puredns-resolve -r /home/op/lists/resolvers.txt --resolvers-trusted /home/op/lists/resolvers_trusted.txt --wildcard-tests $PUREDNS_WILDCARDTEST_LIMIT --wildcard-batch $PUREDNS_WILDCARDBATCH_LIMIT -o .tmp/permute1.txt $AXIOM_EXTRA_ARGS 2>>"$LOGFILE" >/dev/null
+ fi
+
+ if [ "$PERMUTATIONS_OPTION" = "gotator" ] ; then
+ [ -s ".tmp/permute1.txt" ] && gotator -sub .tmp/permute1.txt -perm $tools/permutations_list.txt $GOTATOR_FLAGS -silent 2>>"$LOGFILE" | head -c $PERMUTATIONS_LIMIT > .tmp/gotator2.txt
+ else
+ [ -s ".tmp/permute1.txt" ] && ripgen -d .tmp/permute1.txt -w $tools/permutations_list.txt 2>>"$LOGFILE" | head -c $PERMUTATIONS_LIMIT > .tmp/gotator2.txt
+ fi
+
+ if [ ! "$AXIOM" = true ]; then
+ [ -s ".tmp/gotator2.txt" ] && puredns resolve .tmp/gotator2.txt -w .tmp/permute2.txt -r $resolvers --resolvers-trusted $resolvers_trusted -l $PUREDNS_PUBLIC_LIMIT --rate-limit-trusted $PUREDNS_TRUSTED_LIMIT --wildcard-tests $PUREDNS_WILDCARDTEST_LIMIT --wildcard-batch $PUREDNS_WILDCARDBATCH_LIMIT 2>>"$LOGFILE" >/dev/null
+ else
+ [ -s ".tmp/gotator2.txt" ] && axiom-scan .tmp/gotator2.txt -m puredns-resolve -r /home/op/lists/resolvers.txt --resolvers-trusted /home/op/lists/resolvers_trusted.txt --wildcard-tests $PUREDNS_WILDCARDTEST_LIMIT --wildcard-batch $PUREDNS_WILDCARDBATCH_LIMIT -o .tmp/permute2.txt $AXIOM_EXTRA_ARGS 2>>"$LOGFILE" >/dev/null
+ fi
+ cat .tmp/permute1.txt .tmp/permute2.txt 2>>"$LOGFILE" | anew -q .tmp/permute_subs.txt
+
+ if [ -s ".tmp/permute_subs.txt" ]; then
+ [ -s "$outOfScope_file" ] && deleteOutScoped $outOfScope_file .tmp/permute_subs.txt
+ [[ "$INSCOPE" = true ]] && check_inscope .tmp/permute_subs.txt 2>>"$LOGFILE" >/dev/null
+ NUMOFLINES=$(cat .tmp/permute_subs.txt 2>>"$LOGFILE" | grep ".$domain$" | anew subdomains/subdomains.txt | sed '/^$/d' | wc -l)
+ else
+ NUMOFLINES=0
+ fi
+ end_subfunc "${NUMOFLINES} new subs (permutations)" ${FUNCNAME[0]}
+ else
+ if [ "$SUBPERMUTE" = false ]; then
+ printf "\n${yellow} ${FUNCNAME[0]} skipped in this mode or defined in reconftw.cfg ${reset}\n"
+ else
+ printf "${yellow} ${FUNCNAME[0]} is already processed, to force executing ${FUNCNAME[0]} delete\n $called_fn_dir/.${FUNCNAME[0]} ${reset}\n\n"
+ fi
+ fi
+}
+
+# Execute the main function
+sub_permut
\ No newline at end of file
diff --git a/bin/rftw_sub_recbrute b/bin/rftw_sub_recbrute
new file mode 100755
index 0000000..ff79892
--- /dev/null
+++ b/bin/rftw_sub_recbrute
@@ -0,0 +1,130 @@
+#!/bin/bash
+
+# Load environment variables from reconftw.cfg
+# Load environment variables
+if [ -f "reconftw.cfg" ]; then
+ source reconftw.cfg
+else
+ echo "Error: reconftw.cfg not found!"
+ exit 1
+fi
+
+function print_help() {
+ echo "Usage: $0 [-d <domain>] [-h]"
+ echo ""
+ echo "Options:"
+ echo " -d <domain> Specify target domain"
+ echo " -h Display this help message"
+ echo ""
+}
+
+function start_subfunc() {
+ # This function is just a placeholder as the original function details were not provided.
+ echo "Starting function $1 with message: $2"
+}
+
+function end_subfunc() {
+ # This function is just a placeholder as the original function details were not provided.
+ echo "Ending function $2 with result: $1"
+}
+
+function check_inscope() {
+ # Placeholder for check_inscope function
+ echo "Checking inscope for file $1"
+}
+
+function resolvers_update_quick_local() {
+ # Placeholder for resolvers_update_quick_local function
+ echo "Updating local resolvers"
+}
+
+function resolvers_update_quick_axiom() {
+ # Placeholder for resolvers_update_quick_axiom function
+ echo "Updating axiom resolvers"
+}
+
+domain=""
+while getopts "d:h" option; do
+ case "${option}" in
+ d) domain=${OPTARG};;
+ h) print_help; exit 0;;
+ *) print_help; exit 1;;
+ esac
+done
+
+if [[ -z $domain ]]; then
+ echo "Error: Domain is required!"
+ print_help
+ exit 1
+fi
+
+# Main function
+sub_recursive_brute() {
+ if { [ ! -f "$called_fn_dir/.$FUNCNAME" ] || [ "$DIFF" = true ]; } && [ "$SUB_RECURSIVE_BRUTE" = true ] && [ -s "subdomains/subdomains.txt" ]; then
+ start_subfunc ${FUNCNAME[0]} "Running : Subdomains recursive search active"
+ if [[ $(cat subdomains/subdomains.txt | wc -l) -le $DEEP_LIMIT ]] ; then
+ [ ! -s ".tmp/subdomains_recurs_top.txt" ] && dsieve -if subdomains/subdomains.txt -f 3 -top $DEEP_RECURSIVE_PASSIVE > .tmp/subdomains_recurs_top.txt
+ ripgen -d .tmp/subdomains_recurs_top.txt -w $subs_wordlist > .tmp/brute_recursive_wordlist.txt
+ if [ ! "$AXIOM" = true ]; then
+ resolvers_update_quick_local
+ [ -s ".tmp/brute_recursive_wordlist.txt" ] && puredns resolve .tmp/brute_recursive_wordlist.txt -r $resolvers --resolvers-trusted $resolvers_trusted -l $PUREDNS_PUBLIC_LIMIT --rate-limit-trusted $PUREDNS_TRUSTED_LIMIT --wildcard-tests $PUREDNS_WILDCARDTEST_LIMIT --wildcard-batch $PUREDNS_WILDCARDBATCH_LIMIT -w .tmp/brute_recursive_result.txt 2>>"$LOGFILE" >/dev/null
+ else
+ resolvers_update_quick_axiom
+ [ -s ".tmp/brute_recursive_wordlist.txt" ] && axiom-scan .tmp/brute_recursive_wordlist.txt -m puredns-resolve -r /home/op/lists/resolvers.txt --resolvers-trusted /home/op/lists/resolvers_trusted.txt --wildcard-tests $PUREDNS_WILDCARDTEST_LIMIT --wildcard-batch $PUREDNS_WILDCARDBATCH_LIMIT -o .tmp/brute_recursive_result.txt $AXIOM_EXTRA_ARGS 2>>"$LOGFILE" >/dev/null
+ fi
+ [ -s ".tmp/brute_recursive_result.txt" ] && cat .tmp/brute_recursive_result.txt | anew -q .tmp/brute_recursive.txt
+
+ if [ "$PERMUTATIONS_OPTION" = "gotator" ] ; then
+ [ -s ".tmp/brute_recursive.txt" ] && gotator -sub .tmp/brute_recursive.txt -perm $tools/permutations_list.txt $GOTATOR_FLAGS -silent 2>>"$LOGFILE" | head -c $PERMUTATIONS_LIMIT > .tmp/gotator1_recursive.txt
+ else
+ [ -s ".tmp/brute_recursive.txt" ] && ripgen -d .tmp/brute_recursive.txt -w $tools/permutations_list.txt 2>>"$LOGFILE" | head -c $PERMUTATIONS_LIMIT > .tmp/gotator1_recursive.txt
+ fi
+
+ if [ ! "$AXIOM" = true ]; then
+ [ -s ".tmp/gotator1_recursive.txt" ] && puredns resolve .tmp/gotator1_recursive.txt -w .tmp/permute1_recursive.txt -r $resolvers --resolvers-trusted $resolvers_trusted -l $PUREDNS_PUBLIC_LIMIT --rate-limit-trusted $PUREDNS_TRUSTED_LIMIT --wildcard-tests $PUREDNS_WILDCARDTEST_LIMIT --wildcard-batch $PUREDNS_WILDCARDBATCH_LIMIT 2>>"$LOGFILE" >/dev/null
+ else
+ [ -s ".tmp/gotator1_recursive.txt" ] && axiom-scan .tmp/gotator1_recursive.txt -m puredns-resolve -r /home/op/lists/resolvers.txt --resolvers-trusted /home/op/lists/resolvers_trusted.txt --wildcard-tests $PUREDNS_WILDCARDTEST_LIMIT --wildcard-batch $PUREDNS_WILDCARDBATCH_LIMIT -o .tmp/permute1_recursive.txt $AXIOM_EXTRA_ARGS 2>>"$LOGFILE" >/dev/null
+ fi
+
+ if [ "$PERMUTATIONS_OPTION" = "gotator" ] ; then
+ [ -s ".tmp/permute1_recursive.txt" ] && gotator -sub .tmp/permute1_recursive.txt -perm $tools/permutations_list.txt $GOTATOR_FLAGS -silent 2>>"$LOGFILE" | head -c $PERMUTATIONS_LIMIT > .tmp/gotator2_recursive.txt
+ else
+ [ -s ".tmp/permute1_recursive.txt" ] && ripgen -d .tmp/permute1_recursive.txt -w $tools/permutations_list.txt 2>>"$LOGFILE" | head -c $PERMUTATIONS_LIMIT > .tmp/gotator2_recursive.txt
+ fi
+
+ if [ ! "$AXIOM" = true ]; then
+ [ -s ".tmp/gotator2_recursive.txt" ] && puredns resolve .tmp/gotator2_recursive.txt -w .tmp/permute2_recursive.txt -r $resolvers --resolvers-trusted $resolvers_trusted -l $PUREDNS_PUBLIC_LIMIT --rate-limit-trusted $PUREDNS_TRUSTED_LIMIT --wildcard-tests $PUREDNS_WILDCARDTEST_LIMIT --wildcard-batch $PUREDNS_WILDCARDBATCH_LIMIT 2>>"$LOGFILE" >/dev/null
+ else
+ [ -s ".tmp/gotator2_recursive.txt" ] && axiom-scan .tmp/gotator2_recursive.txt -m puredns-resolve -r /home/op/lists/resolvers.txt --resolvers-trusted /home/op/lists/resolvers_trusted.txt --wildcard-tests $PUREDNS_WILDCARDTEST_LIMIT --wildcard-batch $PUREDNS_WILDCARDBATCH_LIMIT -o .tmp/permute2_recursive.txt $AXIOM_EXTRA_ARGS 2>>"$LOGFILE" >/dev/null
+ fi
+ cat .tmp/permute1_recursive.txt .tmp/permute2_recursive.txt 2>>"$LOGFILE" | anew -q .tmp/permute_recursive.txt
+ else
+ end_subfunc "skipped in this mode or defined in reconftw.cfg" ${FUNCNAME[0]}
+ fi
+ if [ "$INSCOPE" = true ]; then
+ check_inscope .tmp/permute_recursive.txt 2>>"$LOGFILE" >/dev/null
+ check_inscope .tmp/brute_recursive.txt 2>>"$LOGFILE" >/dev/null
+ fi
+
+ # Last validation
+ cat .tmp/permute_recursive.txt .tmp/brute_recursive.txt 2>>"$LOGFILE" | anew -q .tmp/brute_perm_recursive.txt
+ if [ ! "$AXIOM" = true ]; then
+ [ -s ".tmp/brute_recursive.txt" ] && puredns resolve .tmp/brute_perm_recursive.txt -w .tmp/brute_perm_recursive_final.txt -r $resolvers --resolvers-trusted $resolvers_trusted -l $PUREDNS_PUBLIC_LIMIT --rate-limit-trusted $PUREDNS_TRUSTED_LIMIT --wildcard-tests $PUREDNS_WILDCARDTEST_LIMIT --wildcard-batch $PUREDNS_WILDCARDBATCH_LIMIT 2>>"$LOGFILE" >/dev/null
+ else
+ [ -s ".tmp/brute_recursive.txt" ] && axiom-scan .tmp/brute_perm_recursive.txt -m puredns-resolve -r /home/op/lists/resolvers.txt --resolvers-trusted /home/op/lists/resolvers_trusted.txt --wildcard-tests $PUREDNS_WILDCARDTEST_LIMIT --wildcard-batch $PUREDNS_WILDCARDBATCH_LIMIT -o .tmp/brute_perm_recursive_final.txt $AXIOM_EXTRA_ARGS 2>>"$LOGFILE" >/dev/null
+ fi
+
+ NUMOFLINES=$(cat .tmp/brute_perm_recursive_final.txt 2>>"$LOGFILE" | grep "\.$domain$\|^$domain$" | sed '/^$/d' | anew subdomains/subdomains.txt | wc -l)
+ end_subfunc "${NUMOFLINES} new subs (recursive active)" ${FUNCNAME[0]}
+
+ else
+ if [ "$SUB_RECURSIVE_BRUTE" = false ]; then
+ printf "\n${yellow} ${FUNCNAME} skipped in this mode or defined in reconftw.cfg ${reset}\n"
+ else
+ printf "${yellow} ${FUNCNAME} is already processed, to force executing ${FUNCNAME} delete\n $called_fn_dir/.${FUNCNAME} ${reset}\n\n"
+ fi
+ fi
+}
+
+# Call main function
+sub_recursive_brute
\ No newline at end of file
diff --git a/bin/rftw_sub_recpassive b/bin/rftw_sub_recpassive
new file mode 100755
index 0000000..c2f1028
--- /dev/null
+++ b/bin/rftw_sub_recpassive
@@ -0,0 +1,68 @@
+#!/bin/bash
+
+# Load the configuration
+CONFIG_FILE="reconftw.cfg"
+if [[ -f "$CONFIG_FILE" ]]; then
+ source "$CONFIG_FILE"
+else
+ echo "Configuration file '$CONFIG_FILE' not found. Exiting."
+ exit 1
+fi
+
+# Helper function to display usage/help menu
+usage() {
+ echo "Usage: $0 -d domain"
+ echo
+ echo "Options:"
+ echo " -d, --domain domain Specify the domain to perform recursive passive search."
+ echo " -h, --help Display this help and exit."
+ echo
+ echo "Make sure to set up 'reconftw.cfg' with required environment variables."
+ exit 1
+}
+
+# Input validation and parsing
+domain=""
+while [[ "$#" -gt 0 ]]; do
+ case $1 in
+ -d|--domain) domain="$2"; shift ;;
+ -h|--help) usage ;;
+ *) echo "Unknown parameter: $1"; usage ;;
+ esac
+ shift
+done
+
+if [[ -z "$domain" ]]; then
+ echo "Domain not specified!"
+ usage
+fi
+
+sub_recursive_passive() {
+ if { [ ! -f "$called_fn_dir/.${FUNCNAME[0]}" ] || [ "$DIFF" = true ]; } && [ "$SUB_RECURSIVE_PASSIVE" = true ] && [ -s "subdomains/subdomains.txt" ]; then
+ start_subfunc ${FUNCNAME[0]} "Running : Subdomains recursive search passive"
+ # Passive recursive
+ [ -s "subdomains/subdomains.txt" ] && dsieve -if subdomains/subdomains.txt -f 3 -top $DEEP_RECURSIVE_PASSIVE > .tmp/subdomains_recurs_top.txt
+ if [ ! "$AXIOM" = true ]; then
+ resolvers_update_quick_local
+ [ -s ".tmp/subdomains_recurs_top.txt" ] && timeout -k 1m ${AMASS_ENUM_TIMEOUT}m amass enum -passive -df .tmp/subdomains_recurs_top.txt -nf subdomains/subdomains.txt -config $AMASS_CONFIG -timeout $AMASS_ENUM_TIMEOUT 2>>"$LOGFILE" | anew -q .tmp/passive_recursive.txt
+ [ -s ".tmp/passive_recursive.txt" ] && puredns resolve .tmp/passive_recursive.txt -w .tmp/passive_recurs_tmp.txt -r $resolvers --resolvers-trusted $resolvers_trusted -l $PUREDNS_PUBLIC_LIMIT --rate-limit-trusted $PUREDNS_TRUSTED_LIMIT --wildcard-tests $PUREDNS_WILDCARDTEST_LIMIT --wildcard-batch $PUREDNS_WILDCARDBATCH_LIMIT 2>>"$LOGFILE" &>/dev/null
+ else
+ resolvers_update_quick_axiom
+ [ -s ".tmp/subdomains_recurs_top.txt" ] && axiom-scan .tmp/subdomains_recurs_top.txt -m amass -passive -o .tmp/amass_prec.txt $AXIOM_EXTRA_ARGS 2>>"$LOGFILE" >/dev/null
+ [ -s ".tmp/amass_prec.txt" ] && cat .tmp/amass_prec.txt | anew -q .tmp/passive_recursive.txt
+ [ -s ".tmp/passive_recursive.txt" ] && axiom-scan .tmp/passive_recursive.txt -m puredns-resolve -r /home/op/lists/resolvers.txt --resolvers-trusted /home/op/lists/resolvers_trusted.txt --wildcard-tests $PUREDNS_WILDCARDTEST_LIMIT --wildcard-batch $PUREDNS_WILDCARDBATCH_LIMIT -o .tmp/passive_recurs_tmp.txt $AXIOM_EXTRA_ARGS 2>>"$LOGFILE" >/dev/null
+ fi
+ [[ "$INSCOPE" = true ]] && check_inscope .tmp/passive_recurs_tmp.txt 2>>"$LOGFILE" >/dev/null
+ NUMOFLINES=$(cat .tmp/passive_recurs_tmp.txt 2>>"$LOGFILE" | grep "\.$domain$\|^$domain$" | sed '/^$/d' | anew subdomains/subdomains.txt | wc -l)
+ end_subfunc "${NUMOFLINES} new subs (recursive)" ${FUNCNAME[0]}
+ else
+ if [ "$SUB_RECURSIVE_PASSIVE" = false ]; then
+ printf "\n${yellow} ${FUNCNAME[0]} skipped in this mode or defined in reconftw.cfg ${reset}\n"
+ else
+ printf "${yellow} ${FUNCNAME[0]} is already processed, to force executing ${FUNCNAME[0]} delete\n $called_fn_dir/.${FUNCNAME[0]} ${reset}\n\n"
+ fi
+ fi
+}
+
+# Execute the main function
+sub_recursive_passive
\ No newline at end of file
diff --git a/bin/rftw_sub_regex b/bin/rftw_sub_regex
new file mode 100755
index 0000000..1258f47
--- /dev/null
+++ b/bin/rftw_sub_regex
@@ -0,0 +1,67 @@
+#!/bin/bash
+
+# Configuration file loading
+CONFIG_FILE="reconftw.cfg"
+if [[ -f "$CONFIG_FILE" ]]; then
+ source "$CONFIG_FILE"
+else
+ echo "Configuration file '$CONFIG_FILE' not found. Exiting."
+ exit 1
+fi
+
+# Helper function to display usage/help menu
+usage() {
+ echo "Usage: $0 [OPTIONS]"
+ echo
+ echo "Options:"
+ echo " -h, --help Display this help and exit."
+ echo
+ echo "Make sure to set up 'reconftw.cfg' with required environment variables."
+ exit 1
+}
+
+# Input validation
+if [[ "$#" -eq 1 && ("$1" == "-h" || "$1" == "--help") ]]; then
+ usage
+fi
+
+# Check for mandatory variables
+if [[ -z "$SUBREGEXPERMUTE" || -z "$called_fn_dir" || -z "$DIFF" ]]; then
+ echo "Mandatory variables not set in the configuration file. Exiting."
+ exit 1
+fi
+
+sub_regex_permut() {
+ if { [ ! -f "$called_fn_dir/.${FUNCNAME[0]}" ] || [ "$DIFF" = true ]; } && [ "$SUBREGEXPERMUTE" = true ]; then
+ start_subfunc ${FUNCNAME[0]} "Running : Permutations by regex analysis"
+ cd "$tools/regulator" || { echo "Failed to cd directory in ${FUNCNAME[0]} @ line ${LINENO}"; exit 1; }
+ python3 main.py -t $domain -f ${dir}/subdomains/subdomains.txt -o ${dir}/.tmp/${domain}.brute
+ cd "$dir" || { echo "Failed to cd to $dir in ${FUNCNAME[0]} @ line ${LINENO}"; exit 1; }
+
+ if [ ! "$AXIOM" = true ]; then
+ resolvers_update_quick_local
+ [ -s ".tmp/${domain}.brute" ] && puredns resolve .tmp/${domain}.brute -w .tmp/regulator.txt -r $resolvers --resolvers-trusted $resolvers_trusted -l $PUREDNS_PUBLIC_LIMIT --rate-limit-trusted $PUREDNS_TRUSTED_LIMIT --wildcard-tests $PUREDNS_WILDCARDTEST_LIMIT --wildcard-batch $PUREDNS_WILDCARDBATCH_LIMIT 2>>"$LOGFILE" >/dev/null
+ else
+ resolvers_update_quick_axiom
+ [ -s ".tmp/${domain}.brute" ] && axiom-scan .tmp/${domain}.brute -m puredns-resolve -r /home/op/lists/resolvers.txt --resolvers-trusted /home/op/lists/resolvers_trusted.txt --wildcard-tests $PUREDNS_WILDCARDTEST_LIMIT --wildcard-batch $PUREDNS_WILDCARDBATCH_LIMIT -o .tmp/regulator.txt $AXIOM_EXTRA_ARGS 2>>"$LOGFILE" >/dev/null
+ fi
+
+ if [ -s ".tmp/regulator.txt" ]; then
+ [ -s "$outOfScope_file" ] && deleteOutScoped $outOfScope_file .tmp/regulator.txt
+ [[ "$INSCOPE" = true ]] && check_inscope .tmp/regulator.txt 2>>"$LOGFILE" >/dev/null
+ NUMOFLINES=$(cat .tmp/regulator.txt 2>>"$LOGFILE" | grep ".$domain$" | anew subdomains/subdomains.txt | sed '/^$/d' | wc -l)
+ else
+ NUMOFLINES=0
+ fi
+ end_subfunc "${NUMOFLINES} new subs (permutations by regex)" ${FUNCNAME[0]}
+ else
+ if [ "$SUBREGEXPERMUTE" = false ]; then
+ printf "\n${yellow} ${FUNCNAME[0]} skipped in this mode or defined in reconftw.cfg ${reset}\n"
+ else
+ printf "${yellow} ${FUNCNAME[0]} is already processed, to force executing ${FUNCNAME[0]} delete\n $called_fn_dir/.${FUNCNAME[0]} ${reset}\n\n"
+ fi
+ fi
+}
+
+# Execute the main function
+sub_regex_permut
\ No newline at end of file
diff --git a/bin/rftw_sub_s3buckets b/bin/rftw_sub_s3buckets
new file mode 100755
index 0000000..db6342f
--- /dev/null
+++ b/bin/rftw_sub_s3buckets
@@ -0,0 +1,79 @@
+#!/bin/bash
+
+# Load environment variables from reconftw.cfg
+# Load environment variables
+if [ -f "reconftw.cfg" ]; then
+ source reconftw.cfg
+else
+ echo "Error: reconftw.cfg not found!"
+ exit 1
+fi
+
+help_menu() {
+ echo "Usage: $0 [DOMAIN] [OPTIONS]"
+ echo "AWS S3 buckets and cloud assets checker."
+ echo
+ echo "Options:"
+ echo " -h, --help Display this help menu and exit"
+ echo " -f, --force Force the execution even if it was already processed"
+}
+
+validate_inputs() {
+ if [[ -z "$domain" ]]; then
+ echo -e "${yellow} No domain provided! ${reset}"
+ exit 1
+ fi
+
+ if [[ $domain =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9] ]]; then
+ echo -e "${yellow} Invalid domain format: IP address provided instead of a domain name ${reset}"
+ exit 1
+ fi
+
+ if [ "$S3BUCKETS" != true ] && [ "$FORCE_EXECUTION" != true ]; then
+ echo -e "${yellow} s3buckets skipped in this mode or defined in reconftw.cfg ${reset}"
+ exit 0
+ fi
+}
+
+run_s3buckets() {
+ start_func "s3buckets" "AWS S3 buckets search"
+ # S3Scanner
+ if [ ! "$AXIOM" = true ]; then
+ [ -s "subdomains/subdomains.txt" ] && s3scanner scan -f subdomains/subdomains.txt 2>>"$LOGFILE" | anew -q .tmp/s3buckets.txt
+ else
+ axiom-scan subdomains/subdomains.txt -m s3scanner -o .tmp/s3buckets_tmp.txt $AXIOM_EXTRA_ARGS 2>>"$LOGFILE" >/dev/null
+ [ -s ".tmp/s3buckets_tmp.txt" ] && cat .tmp/s3buckets_tmp.txt .tmp/s3buckets_tmp2.txt 2>>"$LOGFILE" | anew -q .tmp/s3buckets.txt && sed -i '/^$/d' .tmp/s3buckets.txt
+ fi
+ # Cloudenum
+ keyword=${domain%%.*}
+ python3 ~/Tools/cloud_enum/cloud_enum.py -k $keyword -qs -l .tmp/output_cloud.txt 2>>"$LOGFILE" >/dev/null
+
+ NUMOFLINES1=$(cat .tmp/output_cloud.txt 2>>"$LOGFILE" | sed '/^#/d' | sed '/^$/d' | anew subdomains/cloud_assets.txt | wc -l)
+ if [ "$NUMOFLINES1" -gt 0 ]; then
+ notification "${NUMOFLINES1} new cloud assets found" info
+ fi
+
+ NUMOFLINES2=$(cat .tmp/s3buckets.txt 2>>"$LOGFILE" | grep -aiv "not_exist" | grep -aiv "Warning:" | grep -aiv "invalid_name" | grep -aiv "^http" | awk 'NF' | anew subdomains/s3buckets.txt | sed '/^$/d' | wc -l)
+ if [ "$NUMOFLINES2" -gt 0 ]; then
+ notification "${NUMOFLINES2} new S3 buckets found" info
+ fi
+
+ end_func "Results are saved in subdomains/s3buckets.txt and subdomains/cloud_assets.txt" "s3buckets"
+}
+
+# Main
+FORCE_EXECUTION=false
+domain="$1"
+
+shift
+while [[ "$#" -gt 0 ]]; do
+ case $1 in
+ -h|--help) help_menu; exit 0 ;;
+ -f|--force) FORCE_EXECUTION=true; shift ;;
+ *) echo "Unknown parameter passed: $1"; exit 1 ;;
+ esac
+ shift
+done
+
+validate_inputs
+run_s3buckets
diff --git a/bin/rftw_sub_scraping b/bin/rftw_sub_scraping
new file mode 100755
index 0000000..b378b95
--- /dev/null
+++ b/bin/rftw_sub_scraping
@@ -0,0 +1,92 @@
+#!/bin/bash
+
+# Load the environment variables from the configuration file
+# Load environment variables
+if [ -f "reconftw.cfg" ]; then
+ source reconftw.cfg
+else
+ echo "Error: reconftw.cfg not found!"
+ exit 1
+fi
+
+# Function to display the help menu
+help_menu() {
+ echo "Usage: sub_scraping.sh [OPTIONS]"
+ echo ""
+ echo "Options:"
+ echo " -h, --help Display this help menu"
+ echo " --deep Run in deep mode"
+ echo " --no-axiom Disable Axiom"
+ echo " --diff Enable DIFF mode"
+}
+
+# Input validation and options parsing
+while [[ "$#" -gt 0 ]]; do
+ case $1 in
+ -h|--help) help_menu; exit 0 ;;
+ --deep) DEEP=true; shift ;;
+ --no-axiom) AXIOM=false; shift ;;
+ --diff) DIFF=true; shift ;;
+ *) echo "Unknown parameter: $1"; help_menu; exit 1 ;;
+ esac
+done
+
+# The main sub_scraping function
+sub_scraping() {
+ if { [ ! -f "$called_fn_dir/.${FUNCNAME[0]}" ] || [ "$DIFF" = true ]; } && [ "$SUBSCRAPING" = true ]; then
+ start_subfunc ${FUNCNAME[0]} "Running : Source code scraping subdomain search"
+ touch .tmp/scrap_subs.txt
+ if [ -s "$dir/subdomains/subdomains.txt" ]; then
+ if [[ $(cat subdomains/subdomains.txt | wc -l) -le $DEEP_LIMIT ]] || [ "$DEEP" = true ] ; then
+ if [ ! "$AXIOM" = true ]; then
+ resolvers_update_quick_local
+ cat subdomains/subdomains.txt | httpx -follow-host-redirects -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 2>>"$LOGFILE" >/dev/null
+ [ -s ".tmp/web_full_info1.txt" ] && cat .tmp/web_full_info1.txt | jq -r 'try .url' 2>/dev/null | grep "$domain" | sed "s/*.//" | anew .tmp/probed_tmp_scrap.txt | unfurl -u domains 2>>"$LOGFILE" | anew -q .tmp/scrap_subs.txt
+ [ -s ".tmp/probed_tmp_scrap.txt" ] && cat .tmp/probed_tmp_scrap.txt | httpx -tls-grab -tls-probe -csp-probe -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_info2.txt 2>>"$LOGFILE" >/dev/null
+ [ -s ".tmp/web_full_info2.txt" ] && cat .tmp/web_full_info2.txt | jq -r 'try ."tls-grab"."dns_names"[],try .csp.domains[],try .url' 2>/dev/null | grep "$domain" | sed "s/*.//" | sort -u | httpx -silent | anew .tmp/probed_tmp_scrap.txt | unfurl -u domains 2>>"$LOGFILE" | anew -q .tmp/scrap_subs.txt
+
+ if [ "$DEEP" = true ]; then
+ [ -s ".tmp/probed_tmp_scrap.txt" ] && katana -silent -list .tmp/probed_tmp_scrap.txt -jc -kf all -c $KATANA_THREADS -d 3 -fs rdn -o .tmp/katana.txt 2>>"$LOGFILE" >/dev/null
+ else
+ [ -s ".tmp/probed_tmp_scrap.txt" ] && katana -silent -list .tmp/probed_tmp_scrap.txt -jc -kf all -c $KATANA_THREADS -d 2 -fs rdn -o .tmp/katana.txt 2>>"$LOGFILE" >/dev/null
+ fi
+ else
+ resolvers_update_quick_axiom
+ 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
+ [ -s ".tmp/web_full_info1.txt" ] && cat .tmp/web_full_info1.txt | jq -r 'try .url' 2>/dev/null | grep "$domain" | sed "s/*.//" | anew .tmp/probed_tmp_scrap.txt | unfurl -u domains 2>>"$LOGFILE" | anew -q .tmp/scrap_subs.txt
+ [ -s ".tmp/probed_tmp_scrap.txt" ] && axiom-scan .tmp/probed_tmp_scrap.txt -m httpx -tls-grab -tls-probe -csp-probe -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_info2.txt $AXIOM_EXTRA_ARGS 2>>"$LOGFILE" >/dev/null
+ [ -s ".tmp/web_full_info2.txt" ] && cat .tmp/web_full_info2.txt | jq -r 'try ."tls-grab"."dns_names"[],try .csp.domains[],try .url' 2>/dev/null | grep "$domain" | sed "s/*.//" | sort -u | httpx -silent | anew .tmp/probed_tmp_scrap.txt | unfurl -u domains 2>>"$LOGFILE" | anew -q .tmp/scrap_subs.txt
+ if [ "$DEEP" = true ]; then
+ [ -s ".tmp/probed_tmp_scrap.txt" ] && axiom-scan .tmp/probed_tmp_scrap.txt -m katana -jc -kf all -d 3 -fs rdn -o .tmp/katana.txt $AXIOM_EXTRA_ARGS 2>>"$LOGFILE" >/dev/null
+ else
+ [ -s ".tmp/probed_tmp_scrap.txt" ] && axiom-scan .tmp/probed_tmp_scrap.txt -m katana -jc -kf all -d 2 -fs rdn -o .tmp/katana.txt $AXIOM_EXTRA_ARGS 2>>"$LOGFILE" >/dev/null
+ fi
+ fi
+ sed -i '/^.\{2048\}./d' .tmp/katana.txt
+ [ -s ".tmp/katana.txt" ] && cat .tmp/katana.txt | unfurl -u domains 2>>"$LOGFILE" | grep ".$domain$" | anew -q .tmp/scrap_subs.txt
+ [ -s ".tmp/scrap_subs.txt" ] && puredns resolve .tmp/scrap_subs.txt -w .tmp/scrap_subs_resolved.txt -r $resolvers --resolvers-trusted $resolvers_trusted -l $PUREDNS_PUBLIC_LIMIT --rate-limit-trusted $PUREDNS_TRUSTED_LIMIT --wildcard-tests $PUREDNS_WILDCARDTEST_LIMIT --wildcard-batch $PUREDNS_WILDCARDBATCH_LIMIT 2>>"$LOGFILE" >/dev/null
+ if [ "$INSCOPE" = true ]; then
+ check_inscope .tmp/scrap_subs_resolved.txt 2>>"$LOGFILE" >/dev/null
+ fi
+ NUMOFLINES=$(cat .tmp/scrap_subs_resolved.txt 2>>"$LOGFILE" | grep "\.$domain$\|^$domain$" | anew subdomains/subdomains.txt | tee .tmp/diff_scrap.txt | sed '/^$/d' | wc -l)
+ [ -s ".tmp/diff_scrap.txt" ] && cat .tmp/diff_scrap.txt | 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_info3.txt 2>>"$LOGFILE" >/dev/null
+ [ -s ".tmp/web_full_info3.txt" ] && cat .tmp/web_full_info3.txt | jq -r 'try .url' 2>/dev/null | grep "$domain" | sed "s/*.//" | anew .tmp/probed_tmp_scrap.txt | unfurl -u domains 2>>"$LOGFILE" | anew -q .tmp/scrap_subs.txt
+ cat .tmp/web_full_info1.txt .tmp/web_full_info2.txt .tmp/web_full_info3.txt 2>>"$LOGFILE" | jq -s 'try .' | jq 'try unique_by(.input)' | jq 'try .[]' 2>>"$LOGFILE" > .tmp/web_full_info.txt
+ end_subfunc "${NUMOFLINES} new subs (code scraping)" ${FUNCNAME[0]}
+ else
+ end_subfunc "Skipping Subdomains Web Scraping: Too Many Subdomains" ${FUNCNAME[0]}
+ fi
+ else
+ end_subfunc "No subdomains to search (code scraping)" ${FUNCNAME[0]}
+ fi
+ else
+ if [ "$SUBSCRAPING" = false ]; then
+ printf "\n${yellow} ${FUNCNAME[0]} skipped in this mode or defined in reconftw.cfg ${reset}\n"
+ else
+ printf "${yellow} ${FUNCNAME[0]} is already processed, to force executing ${FUNCNAME[0]} delete\n $called_fn_dir/.${FUNCNAME[0]} ${reset}\n\n"
+ fi
+ fi
+}
+
+# Execute the function
+sub_scraping
\ No newline at end of file
diff --git a/bin/rftw_sub_takeover b/bin/rftw_sub_takeover
new file mode 100755
index 0000000..1951ac8
--- /dev/null
+++ b/bin/rftw_sub_takeover
@@ -0,0 +1,66 @@
+#!/bin/bash
+
+# Load environment variables from reconftw.cfg
+# Load environment variables
+if [ -f "reconftw.cfg" ]; then
+ source reconftw.cfg
+else
+ echo "Error: reconftw.cfg not found!"
+ exit 1
+fi
+
+help_menu() {
+ echo "Usage: $0 [OPTIONS]"
+ echo "Subdomain and DNS takeover checker."
+ echo
+ echo "Options:"
+ echo " -h, --help Display this help menu and exit"
+ echo " -f, --force Force the execution even if it was already processed"
+}
+
+validate_inputs() {
+ if [ "$SUBTAKEOVER" != true ] && [ "$FORCE_EXECUTION" != true ]; then
+ echo -e "${yellow} subtakeover skipped in this mode or defined in reconftw.cfg ${reset}"
+ exit 0
+ fi
+}
+
+run_subtakeover() {
+ start_func ${FUNCNAME[0]} "Looking for possible subdomain and DNS takeover"
+ touch .tmp/tko.txt
+ [ ! -s ".tmp/webs_all.txt" ] && cat webs/webs.txt webs/webs_uncommon_ports.txt 2>/dev/null | anew -q .tmp/webs_all.txt
+ if [ ! "$AXIOM" = true ]; then
+ nuclei -update 2>>"$LOGFILE" >/dev/null
+ cat subdomains/subdomains.txt .tmp/webs_all.txt 2>/dev/null | nuclei -silent -nh -tags takeover -severity info,low,medium,high,critical -retries 3 -rl $NUCLEI_RATELIMIT -t ${NUCLEI_TEMPLATES_PATH} -o .tmp/tko.txt
+ else
+ cat subdomains/subdomains.txt .tmp/webs_all.txt 2>>"$LOGFILE" | sed '/^$/d' | anew -q .tmp/webs_subs.txt
+ [ -s ".tmp/webs_subs.txt" ] && 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} -o .tmp/tko.txt $AXIOM_EXTRA_ARGS 2>>"$LOGFILE" >/dev/null
+ fi
+
+ # DNS_TAKEOVER
+ cat .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
+ cat .tmp/subs_dns_tko.txt 2>/dev/null | dnstake -c $DNSTAKE_THREADS -s 2>>"$LOGFILE" | sed '/^$/d' | anew -q .tmp/tko.txt
+
+ sed -i '/^$/d' .tmp/tko.txt
+
+ NUMOFLINES=$(cat .tmp/tko.txt 2>>"$LOGFILE" | anew webs/takeover.txt | sed '/^$/d' | wc -l)
+ if [ "$NUMOFLINES" -gt 0 ]; then
+ notification "${NUMOFLINES} new possible takeovers found" info
+ fi
+ end_func "Results are saved in $domain/webs/takeover.txt" ${FUNCNAME[0]}
+}
+
+# Main
+FORCE_EXECUTION=false
+
+while [[ "$#" -gt 0 ]]; do
+ case $1 in
+ -h|--help) help_menu; exit 0 ;;
+ -f|--force) FORCE_EXECUTION=true; shift ;;
+ *) echo "Unknown parameter passed: $1"; exit 1 ;;
+ esac
+ shift
+done
+
+validate_inputs
+run_subtakeover
\ No newline at end of file
diff --git a/bin/rftw_sub_vhosts b/bin/rftw_sub_vhosts
new file mode 100755
index 0000000..d6994fb
--- /dev/null
+++ b/bin/rftw_sub_vhosts
@@ -0,0 +1,69 @@
+#!/bin/bash
+
+# Load environment variables from reconftw.cfg
+# Load environment variables
+if [ -f "reconftw.cfg" ]; then
+ source reconftw.cfg
+else
+ echo "Error: reconftw.cfg not found!"
+ exit 1
+fi
+
+help_menu() {
+ echo "Usage: $0 [DOMAIN] [OPTIONS]"
+ echo "Virtual Hosts discovery tool for the specified domain."
+ echo
+ echo "Options:"
+ echo " -h, --help Display this help menu and exit"
+ echo " -f, --force Force the execution even if it was already processed"
+}
+
+validate_inputs() {
+ if [[ -z "$domain" ]]; then
+ echo -e "${yellow} No domain provided! ${reset}"
+ exit 1
+ fi
+
+ if [ "$VIRTUALHOSTS" != true ] && [ "$FORCE_EXECUTION" != true ]; then
+ echo -e "${yellow} virtualhosts skipped in this mode or defined in reconftw.cfg ${reset}"
+ exit 0
+ fi
+}
+
+run_virtualhosts() {
+ start_func "virtualhosts" "Virtual Hosts discovery"
+
+ [ ! -s ".tmp/webs_all.txt" ] && cat webs/webs.txt webs/webs_uncommon_ports.txt 2>/dev/null | anew -q .tmp/webs_all.txt
+
+ if [ -s ".tmp/webs_all.txt" ]; then
+ mkdir -p $dir/virtualhosts $dir/.tmp/virtualhosts
+ interlace -tL .tmp/webs_all.txt -threads ${INTERLACE_THREADS} -c "ffuf -ac -t ${FFUF_THREADS} -rate ${FFUF_RATELIMIT} -H \"${HEADER}\" -H \"Host: FUZZ._cleantarget_\" -w ${fuzz_wordlist} -maxtime ${FFUF_MAXTIME} -u _target_ -of json -o _output_/_cleantarget_.json" -o $dir/.tmp/virtualhosts 2>>"$LOGFILE" >/dev/null
+
+ for sub in $(cat .tmp/webs_all.txt); do
+ sub_out=$(echo $sub | sed -e 's|^[^/]*//||' -e 's|/.*$||')
+ [ -s "$dir/.tmp/virtualhosts/${sub_out}.json" ] && cat $dir/.tmp/virtualhosts/${sub_out}.json | jq -r 'try .results[] | "\(.status) \(.length) \(.url)"' | sort | anew -q $dir/virtualhosts/${sub_out}.txt
+ done
+
+ find $dir/virtualhosts/ -type f -iname "*.txt" -exec cat {} + 2>>"$LOGFILE" | anew -q $dir/virtualhosts/virtualhosts_full.txt
+ end_func "Results are saved in $domain/virtualhosts/*subdomain*.txt" "virtualhosts"
+ else
+ end_func "No $domain/web/webs.txts file found, virtualhosts skipped " "virtualhosts"
+ fi
+}
+
+# Main
+FORCE_EXECUTION=false
+domain="$1"
+
+shift
+while [[ "$#" -gt 0 ]]; do
+ case $1 in
+ -h|--help) help_menu; exit 0 ;;
+ -f|--force) FORCE_EXECUTION=true; shift ;;
+ *) echo "Unknown parameter passed: $1"; exit 1 ;;
+ esac
+ shift
+done
+
+validate_inputs
+run_virtualhosts
diff --git a/bin/rftw_sub_zonetransfer b/bin/rftw_sub_zonetransfer
new file mode 100755
index 0000000..e6b5a5a
--- /dev/null
+++ b/bin/rftw_sub_zonetransfer
@@ -0,0 +1,64 @@
+#!/bin/bash
+
+# Load environment variables from reconftw.cfg
+# Load environment variables
+if [ -f "reconftw.cfg" ]; then
+ source reconftw.cfg
+else
+ echo "Error: reconftw.cfg not found!"
+ exit 1
+fi
+
+help_menu() {
+ echo "Usage: $0 [DOMAIN] [OPTIONS]"
+ echo "Zone transfer checker."
+ echo
+ echo "Options:"
+ echo " -h, --help Display this help menu and exit"
+ echo " -f, --force Force the execution even if it was already processed"
+}
+
+validate_inputs() {
+ if [[ -z "$domain" ]]; then
+ echo -e "${yellow} No domain provided! ${reset}"
+ exit 1
+ fi
+
+ if [[ $domain =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9] ]]; then
+ echo -e "${yellow} Invalid domain format: IP address provided instead of a domain name ${reset}"
+ exit 1
+ fi
+
+ if [ "$ZONETRANSFER" != true ] && [ "$FORCE_EXECUTION" != true ]; then
+ echo -e "${yellow} zonetransfer skipped in this mode or defined in reconftw.cfg ${reset}"
+ exit 0
+ fi
+}
+
+run_zonetransfer() {
+ start_func "zonetransfer" "Zone transfer check"
+ for ns in $(dig +short ns "$domain"); do
+ dig axfr "$domain" @"$ns" >> subdomains/zonetransfer.txt
+ done
+ if [ -s "subdomains/zonetransfer.txt" ] && ! grep -q "Transfer failed" subdomains/zonetransfer.txt ; then
+ notification "Zone transfer found on ${domain}!" info
+ fi
+ end_func "Results are saved in $domain/subdomains/zonetransfer.txt" "zonetransfer"
+}
+
+# Main
+FORCE_EXECUTION=false
+domain="$1"
+
+shift
+while [[ "$#" -gt 0 ]]; do
+ case $1 in
+ -h|--help) help_menu; exit 0 ;;
+ -f|--force) FORCE_EXECUTION=true; shift ;;
+ *) echo "Unknown parameter passed: $1"; exit 1 ;;
+ esac
+ shift
+done
+
+validate_inputs
+run_zonetransfer
diff --git a/bin/rftw_uti_transfer b/bin/rftw_uti_transfer
new file mode 100755
index 0000000..4170bbe
--- /dev/null
+++ b/bin/rftw_uti_transfer
@@ -0,0 +1,62 @@
+#!/bin/bash
+
+# Load environment variables from reconftw.cfg
+# Load environment variables
+if [ -f "reconftw.cfg" ]; then
+ source reconftw.cfg
+else
+ echo "Error: reconftw.cfg not found!"
+ exit 1
+fi
+
+# Display help information
+function display_help() {
+ echo "Usage: $0 <file|directory>"
+ echo " ... | $0 <file_name>"
+ echo
+ echo "Uploads a specified file or directory to https://transfer.sh/"
+ echo
+ echo "Options:"
+ echo " -h, --help Display this help and exit"
+ echo
+}
+
+# Uploads a file or directory to transfer.sh
+function transfer() {
+ if [ $# -eq 0 ]; then
+ echo "Error: No arguments specified."
+ display_help
+ exit 1
+ fi
+
+ if tty -s; then
+ local file="$1"
+ local file_name=$(basename "$file")
+
+ if [ ! -e "$file" ]; then
+ echo "Error: $file: No such file or directory" >&2
+ exit 1
+ fi
+
+ if [ -d "$file" ]; then
+ # If the given input is a directory, zip and transfer it.
+ file_name="$file_name.zip"
+ (cd "$file" && zip -r -q - .) | curl --progress-bar --upload-file "-" "https://transfer.sh/$file_name" | tee /dev/null
+ else
+ # If the given input is a file, transfer it.
+ cat "$file" | curl --progress-bar --upload-file "-" "https://transfer.sh/$file_name" | tee /dev/null
+ fi
+ else
+ # Transfer data from standard input.
+ local file_name=$1
+ curl --progress-bar --upload-file "-" "https://transfer.sh/$file_name" | tee /dev/null
+ fi
+}
+
+# Main script execution
+if [[ "$1" == "-h" || "$1" == "--help" ]]; then
+ display_help
+ exit 0
+fi
+
+transfer "$@"
diff --git a/bin/rftw_util_ascii b/bin/rftw_util_ascii
new file mode 100755
index 0000000..4ffd115
--- /dev/null
+++ b/bin/rftw_util_ascii
@@ -0,0 +1,57 @@
+#!/bin/bash
+
+# Load environment variables from reconftw.cfg
+# Load environment variables
+if [ -f "reconftw.cfg" ]; then
+ source reconftw.cfg
+else
+ echo "Error: reconftw.cfg not found!"
+ exit 1
+fi
+
+# Colors for console output
+green="\033[1;32m"
+red="\033[1;31m"
+reset="\033[0m"
+
+# Help menu function
+function display_help() {
+ echo "Usage: $0 [FILE]"
+ echo
+ echo "Checks if the provided file contains ASCII text."
+ echo "Options:"
+ echo " -h, --help Display this help and exit"
+ echo
+}
+
+# Validate arguments function
+function validate_args() {
+ if [[ -z "$1" ]]; then
+ echo -e "${red}Error: FILE is required.${reset}"
+ display_help
+ exit 1
+ fi
+ if [[ ! -f "$1" ]]; then
+ echo -e "${red}Error: $1 is not a file.${reset}"
+ exit 2
+ fi
+}
+
+# Check ASCII text function
+function is_ascii_text() {
+ local filepath="$1"
+ if [[ $(file "$filepath" | grep -o 'ASCII text$') == "ASCII text" ]]; then
+ echo -e "${green}$filepath contains ASCII text.${reset}"
+ else
+ echo -e "${red}$filepath does not contain ASCII text.${reset}"
+ fi
+}
+
+# Main script execution
+if [[ "$1" == "-h" || "$1" == "--help" ]]; then
+ display_help
+ exit 0
+fi
+
+validate_args "$1"
+is_ascii_text "$1"
diff --git a/bin/rftw_util_axiomoff b/bin/rftw_util_axiomoff
new file mode 100755
index 0000000..e93754a
--- /dev/null
+++ b/bin/rftw_util_axiomoff
@@ -0,0 +1,60 @@
+#!/bin/bash
+
+# Load environment variables from reconftw.cfg
+# Load environment variables
+if [ -f "reconftw.cfg" ]; then
+ source reconftw.cfg
+else
+ echo "Error: reconftw.cfg not found!"
+ exit 1
+fi
+
+# Help menu function
+function display_help() {
+ echo "Usage: $0 [MODE]"
+ echo
+ echo "Shut down the Axiom fleet based on configurations in reconftw.cfg."
+ echo
+ echo "MODE: Specifies the mode for the shutdown. (e.g., 'subs_menu', 'passive', 'all')"
+ echo
+ echo "Options:"
+ echo " -h, --help Display this help and exit"
+ echo
+}
+
+# Main Axiom shutdown function
+function axiom_shutdown() {
+ local mode="$1"
+ if [ "$AXIOM_FLEET_LAUNCH" = true ] && [ "$AXIOM_FLEET_SHUTDOWN" = true ] && [ -n "$AXIOM_FLEET_NAME" ]; then
+ # Check mode conditions
+ if [[ "$mode" == "subs_menu" || "$mode" == "passive" || "$mode" == "all" ]]; then
+ # You might want to add a logging function here for "notification"
+ # notification "Automatic Axiom fleet shutdown is not enabled in this mode" info
+ echo "Automatic Axiom fleet shutdown is not enabled in mode: $mode"
+ return
+ fi
+
+ # Remove the Axiom fleet
+ eval axiom-rm -f "$AXIOM_FLEET_NAME*"
+ echo "Axiom fleet $AXIOM_FLEET_NAME shutdown" | $NOTIFY
+ # Another potential place for a logging function
+ # notification "Axiom fleet $AXIOM_FLEET_NAME shutdown" info
+ echo "Axiom fleet $AXIOM_FLEET_NAME shutdown"
+ else
+ echo "Axiom fleet conditions not met for shutdown."
+ fi
+}
+
+# Check arguments
+if [[ "$1" == "-h" || "$1" == "--help" ]]; then
+ display_help
+ exit 0
+else
+ # Ensure mode is specified
+ if [ -z "$1" ]; then
+ echo "Error: Mode not specified."
+ display_help
+ exit 1
+ fi
+ axiom_shutdown "$1"
+fi
diff --git a/bin/rftw_util_axiomon b/bin/rftw_util_axiomon
new file mode 100755
index 0000000..c86754f
--- /dev/null
+++ b/bin/rftw_util_axiomon
@@ -0,0 +1,64 @@
+#!/bin/bash
+
+# Load environment variables from reconftw.cfg
+# Load environment variables
+if [ -f "reconftw.cfg" ]; then
+ source reconftw.cfg
+else
+ echo "Error: reconftw.cfg not found!"
+ exit 1
+fi
+
+# Help menu
+function display_help() {
+ echo "Usage: $0"
+ echo
+ echo "Launch an Axiom fleet based on configurations in reconftw.cfg."
+ echo
+ echo "Options:"
+ echo " -h, --help Display this help and exit"
+ echo
+}
+
+# Main Axiom launch function
+function axiom_launch() {
+ if [ "$AXIOM_FLEET_LAUNCH" = true ] && [ -n "$AXIOM_FLEET_NAME" ] && [ -n "$AXIOM_FLEET_COUNT" ]; then
+ # Additional logging function can be used here, example:
+ # start_func ${FUNCNAME[0]} "Launching our Axiom fleet"
+
+ # Ensure the linode-cli tool is up-to-date
+ python3 -m pip install --upgrade linode-cli 2>>"$LOGFILE" >/dev/null
+
+ # Check the current number of nodes
+ NUMOFNODES=$(timeout 30 axiom-ls | grep -c "$AXIOM_FLEET_NAME")
+
+ if [[ $NUMOFNODES -ge $AXIOM_FLEET_COUNT ]]; then
+ axiom-select "$AXIOM_FLEET_NAME*"
+ # Logging/notification example:
+ # end_func "Axiom fleet $AXIOM_FLEET_NAME already has $NUMOFNODES instances"
+ else
+ [ $NUMOFNODES -eq 0 ] && startcount=$AXIOM_FLEET_COUNT || startcount=$((AXIOM_FLEET_COUNT-NUMOFNODES))
+
+ AXIOM_ARGS=" -i $startcount"
+ # Execute the axiom fleet command
+ axiom-fleet ${AXIOM_FLEET_NAME} ${AXIOM_ARGS}
+
+ axiom-select "$AXIOM_FLEET_NAME*"
+
+ [ -n "$AXIOM_POST_START" ] && eval "$AXIOM_POST_START" 2>>"$LOGFILE" >/dev/null
+
+ NUMOFNODES=$(timeout 30 axiom-ls | grep -c "$AXIOM_FLEET_NAME")
+ # Notification/logging example:
+ # echo "Axiom fleet $AXIOM_FLEET_NAME launched w/ $NUMOFNODES instances" | $NOTIFY
+ # end_func "Axiom fleet $AXIOM_FLEET_NAME launched w/ $NUMOFNODES instances"
+ fi
+ fi
+}
+
+# Main execution starts here
+if [[ "$1" == "-h" || "$1" == "--help" ]]; then
+ display_help
+ exit 0
+else
+ axiom_launch
+fi
diff --git a/bin/rftw_util_axiomsel b/bin/rftw_util_axiomsel
new file mode 100755
index 0000000..7b7f9f1
--- /dev/null
+++ b/bin/rftw_util_axiomsel
@@ -0,0 +1,50 @@
+#!/bin/bash
+
+# Load environment variables from reconftw.cfg
+# Load environment variables
+if [ -f "reconftw.cfg" ]; then
+ source reconftw.cfg
+else
+ echo "Error: reconftw.cfg not found!"
+ exit 1
+fi
+
+# Help menu function
+function display_help() {
+ echo "Usage: $0"
+ echo
+ echo "Check for running Axiom instances and whether any instances are selected."
+ echo
+ echo "Options:"
+ echo " -h, --help Display this help and exit"
+ echo
+}
+
+# Main Axiom check function
+function axiom_selected() {
+ # Check if there are any running axiom instances
+ if [[ ! $(axiom-ls | tail -n +2 | sed '$ d' | wc -l) -gt 0 ]]; then
+ # You might want to add a logging function here for "notification"
+ # notification "\n\n${bred} No axiom instances running ${reset}\n\n" error
+ echo -e "\n\n${bred} No axiom instances running ${reset}\n\n"
+ exit 1
+ fi
+
+ # Check if there are any selected axiom instances
+ if [[ ! $(cat ~/.axiom/selected.conf | sed '/^\s*$/d' | wc -l) -gt 0 ]]; then
+ # Again, consider adding a logging function here for "notification"
+ # notification "\n\n${bred} No axiom instances selected ${reset}\n\n" error
+ echo -e "\n\n${bred} No axiom instances selected ${reset}\n\n"
+ exit 1
+ fi
+
+ echo "Axiom instances are running and selected."
+}
+
+# Check arguments
+if [[ "$1" == "-h" || "$1" == "--help" ]]; then
+ display_help
+ exit 0
+else
+ axiom_selected
+fi
diff --git a/bin/rftw_util_deleteoos b/bin/rftw_util_deleteoos
new file mode 100755
index 0000000..31a2d04
--- /dev/null
+++ b/bin/rftw_util_deleteoos
@@ -0,0 +1,72 @@
+#!/bin/bash
+
+# Load environment variables from reconftw.cfg
+# Load environment variables
+if [ -f "reconftw.cfg" ]; then
+ source reconftw.cfg
+else
+ echo "Error: reconftw.cfg not found!"
+ exit 1
+fi
+
+# Colors
+yellow="\033[1;33m"
+red="\033[1;31m"
+reset="\033[0m"
+
+# Help menu function
+function display_help() {
+ echo "Usage: $0 [OPTIONS] [SCOPE_FILE] [TARGET_FILE]"
+ echo
+ echo "Remove out-of-scope items from a target file based on a scope file."
+ echo "Options:"
+ echo " -h, --help Display this help and exit"
+ echo
+}
+
+# Validate arguments function
+function validate_args() {
+ if [[ -z "$1" || -z "$2" ]]; then
+ echo -e "${red}Error: Both SCOPE_FILE and TARGET_FILE are required.${reset}"
+ display_help
+ exit 1
+ fi
+
+ if [[ ! -f "$1" ]]; then
+ echo -e "${red}Error: SCOPE_FILE '$1' does not exist.${reset}"
+ exit 1
+ fi
+
+ if [[ ! -f "$2" ]]; then
+ echo -e "${red}Error: TARGET_FILE '$2' does not exist.${reset}"
+ exit 1
+ fi
+}
+
+# Delete out-of-scope items function
+function delete_out_scoped() {
+ local scope_file="$1"
+ local target_file="$2"
+
+ if [ -s "$scope_file" ]; then
+ while IFS= read -r outscoped
+ do
+ if grep -q "^[*]" <<< "$outscoped"; then
+ outscoped="${outscoped:1}"
+ sed -i "/$outscoped$/d" "$target_file"
+ else
+ sed -i "/$outscoped/d" "$target_file"
+ fi
+ done < "$scope_file"
+ fi
+}
+
+# Main script execution
+if [[ "$1" == "-h" || "$1" == "--help" ]]; then
+ display_help
+ exit 0
+fi
+
+validate_args "$1" "$2"
+delete_out_scoped "$1" "$2"
+echo -e "${yellow}Processed $2 based on out-of-scope items from $1.${reset}"
diff --git a/bin/rftw_util_gettime b/bin/rftw_util_gettime
new file mode 100755
index 0000000..67cc782
--- /dev/null
+++ b/bin/rftw_util_gettime
@@ -0,0 +1,65 @@
+#!/bin/bash
+
+# Load environment variables from reconftw.cfg
+# Load environment variables
+if [ -f "reconftw.cfg" ]; then
+ source reconftw.cfg
+else
+ echo "Error: reconftw.cfg not found!"
+ exit 1
+fi
+
+# Colors
+yellow="\033[1;33m"
+red="\033[1;31m"
+reset="\033[0m"
+
+# Help menu function
+function display_help() {
+ echo "Usage: $0 [START_TIME] [END_TIME]"
+ echo
+ echo "Calculate the elapsed time between two time values in seconds."
+ echo "Options:"
+ echo " -h, --help Display this help and exit"
+ echo
+}
+
+# Validate arguments function
+function validate_args() {
+ if [[ -z "$1" || -z "$2" ]]; then
+ echo -e "${red}Error: Both START_TIME and END_TIME are required.${reset}"
+ display_help
+ exit 1
+ fi
+
+ if ! [[ "$1" =~ ^[0-9]+$ && "$2" =~ ^[0-9]+$ ]]; then
+ echo -e "${red}Error: Both START_TIME and END_TIME should be numeric.${reset}"
+ exit 1
+ fi
+}
+
+# Get elapsed time function
+function get_elapsed_time() {
+ local start_time="$1"
+ local end_time="$2"
+ runtime=""
+ local T=$((end_time - start_time))
+ local D=$((T/60/60/24))
+ local H=$((T/60/60%24))
+ local M=$((T/60%60))
+ local S=$((T%60))
+ (( D > 0 )) && runtime="$runtime$D days, "
+ (( H > 0 )) && runtime="$runtime$H hours, "
+ (( M > 0 )) && runtime="$runtime$M minutes, "
+ runtime="$runtime$S seconds."
+ echo -e "${yellow}$runtime${reset}"
+}
+
+# Main script execution
+if [[ "$1" == "-h" || "$1" == "--help" ]]; then
+ display_help
+ exit 0
+fi
+
+validate_args "$1" "$2"
+get_elapsed_time "$1" "$2"
diff --git a/bin/rftw_util_ipcidr b/bin/rftw_util_ipcidr
new file mode 100755
index 0000000..3f6f477
--- /dev/null
+++ b/bin/rftw_util_ipcidr
@@ -0,0 +1,61 @@
+#!/bin/bash
+
+# Load environment variables from reconftw.cfg
+# Load environment variables
+if [ -f "reconftw.cfg" ]; then
+ source reconftw.cfg
+else
+ echo "Error: reconftw.cfg not found!"
+ exit 1
+fi
+
+# Help menu
+function display_help() {
+ echo "Usage: $0 [IP CIDR] [OPTIONAL FILE]"
+ echo
+ echo "Processes an IP CIDR, maps it, and optionally saves the output to a file."
+ echo
+ echo "Options:"
+ echo " -h, --help Display this help and exit"
+ echo
+}
+
+function process_ip_cidr() {
+ local IP_CIDR=$1
+ local OUTFILE=$2
+ local IP_CIDR_REGEX='(((25[0-5]|2[0-4][0-9]|1?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|1?[0-9][0-9]?))(\/([8-9]|[1-2][0-9]|3[0-2]))([^0-9.]|$)|(((25[0-5]|2[0-4][0-9]|1?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|1?[0-9][0-9]?)$)'
+
+ if [[ $IP_CIDR =~ ^$IP_CIDR_REGEX ]]; then
+ echo $IP_CIDR | mapcidr -silent | anew -q target_reconftw_ipcidr.txt
+
+ if [ -s "./target_reconftw_ipcidr.txt" ]; then
+ [ "$REVERSE_IP" = true ] && cat ./target_reconftw_ipcidr.txt | hakip2host | cut -d' ' -f 3 | unfurl -u domains 2>/dev/null | sed -e 's/*\.//' -e 's/\.$//' -e '/\./!d' | anew -q ./target_reconftw_ipcidr.txt
+
+ if [[ $(cat ./target_reconftw_ipcidr.txt | wc -l) -eq 1 ]]; then
+ domain=$(cat ./target_reconftw_ipcidr.txt)
+ elif [[ $(cat ./target_reconftw_ipcidr.txt | wc -l) -gt 1 ]]; then
+ unset domain
+ list=${PWD}/target_reconftw_ipcidr.txt
+ fi
+ fi
+
+ if [ -n "$OUTFILE" ]; then
+ cat $list | anew -q $OUTFILE
+ sed -i '/\/[0-9]*$/d' $OUTFILE
+ fi
+ else
+ echo "Invalid IP CIDR format provided. Please check the input."
+ exit 1
+ fi
+}
+
+# Main execution starts here
+if [[ "$1" == "-h" || "$1" == "--help" ]]; then
+ display_help
+ exit 0
+elif [[ -z "$1" ]]; then
+ echo "Error: No IP CIDR provided. Use -h or --help for more information."
+ exit 1
+else
+ process_ip_cidr "$1" "$2"
+fi
diff --git a/bin/rftw_util_notification b/bin/rftw_util_notification
new file mode 100755
index 0000000..cc91501
--- /dev/null
+++ b/bin/rftw_util_notification
@@ -0,0 +1,74 @@
+#!/bin/bash
+
+# Load environment variables from reconftw.cfg
+# Load environment variables
+if [ -f "reconftw.cfg" ]; then
+ source reconftw.cfg
+else
+ echo "Error: reconftw.cfg not found!"
+ exit 1
+fi
+
+# Colors for console output
+bblue="\033[1;34m"
+yellow="\033[1;33m"
+reset="\033[0m"
+bred="\033[1;31m"
+bgreen="\033[1;32m"
+
+# Help menu function
+function display_help() {
+ echo "Usage: $0 <message> <type>"
+ echo
+ echo "Sends notification based on the given message and type."
+ echo "Types:"
+ echo " info - Informational message (Blue)"
+ echo " warn - Warning message (Yellow)"
+ echo " error - Error message (Red)"
+ echo " good - Positive message (Green)"
+ echo
+ echo "Options:"
+ echo " -h, --help Display this help and exit"
+ echo
+}
+
+# Send notification function
+function notification() {
+ local message=$1
+ local type=$2
+ local text=""
+
+ if [[ -z "$message" || -z "$type" ]]; then
+ echo -e "${bred}Error: Both message and type are required.${reset}"
+ exit 2
+ fi
+
+ case $type in
+ info)
+ text="\n${bblue} ${message} ${reset}"
+ ;;
+ warn)
+ text="\n${yellow} ${message} ${reset}"
+ ;;
+ error)
+ text="\n${bred} ${message} ${reset}"
+ ;;
+ good)
+ text="\n${bgreen} ${message} ${reset}"
+ ;;
+ *)
+ echo -e "${bred}Error: Invalid type. Valid types are: info, warn, error, good.${reset}"
+ exit 2
+ ;;
+ esac
+
+ printf "${text}\n" && printf "${text} - ${domain}\n" | $NOTIFY
+}
+
+# Main script execution
+if [[ "$1" == "-h" || "$1" == "--help" ]]; then
+ display_help
+ exit 0
+fi
+
+notification "$1" "$2"
diff --git a/bin/rftw_util_output b/bin/rftw_util_output
new file mode 100755
index 0000000..d783ff0
--- /dev/null
+++ b/bin/rftw_util_output
@@ -0,0 +1,56 @@
+#!/bin/bash
+
+# Load environment variables from reconftw.cfg
+# Load environment variables
+if [ -f "reconftw.cfg" ]; then
+ source reconftw.cfg
+else
+ echo "Error: reconftw.cfg not found!"
+ exit 1
+fi
+
+# Colors for console output
+green="\033[1;32m"
+red="\033[1;31m"
+reset="\033[0m"
+
+# Help menu function
+function display_help() {
+ echo "Usage: $0"
+ echo
+ echo "Copies content of directory specified in 'dir' variable to 'dir_output' variable."
+ echo "If 'dir' is different from 'dir_output', then 'dir' will be deleted."
+ echo "Both 'dir' and 'dir_output' are sourced from the reconftw.cfg configuration file."
+ echo "Options:"
+ echo " -h, --help Display this help and exit"
+ echo
+}
+
+# Validate directory existence function
+function validate_dirs() {
+ if [[ ! -d "$dir" ]]; then
+ echo -e "${red}Error: '$dir' directory does not exist.${reset}"
+ exit 2
+ fi
+}
+
+# Output function
+function output() {
+ mkdir -p "$dir_output"
+ cp -r "$dir" "$dir_output"
+ if [[ "$(dirname "$dir")" != "$dir_output" ]]; then
+ rm -rf "$dir"
+ echo -e "${green}Content copied and original directory deleted.${reset}"
+ else
+ echo -e "${green}Content copied.${reset}"
+ fi
+}
+
+# Main script execution
+if [[ "$1" == "-h" || "$1" == "--help" ]]; then
+ display_help
+ exit 0
+fi
+
+validate_dirs
+output
diff --git a/bin/rftw_util_removebig b/bin/rftw_util_removebig
new file mode 100755
index 0000000..3c806ed
--- /dev/null
+++ b/bin/rftw_util_removebig
@@ -0,0 +1,53 @@
+#!/bin/bash
+
+# Load environment variables from reconftw.cfg
+# Load environment variables
+if [ -f "reconftw.cfg" ]; then
+ source reconftw.cfg
+else
+ echo "Error: reconftw.cfg not found!"
+ exit 1
+fi
+
+# Colors for console output
+green="\033[1;32m"
+red="\033[1;31m"
+reset="\033[0m"
+
+# Help menu function
+function display_help() {
+ echo "Usage: $0"
+ echo
+ echo "Removes specific files and any files larger than 200MB from .tmp directory."
+ echo "Logs errors to 'LOGFILE' specified in reconftw.cfg."
+ echo "Options:"
+ echo " -h, --help Display this help and exit"
+ echo
+}
+
+# Validate logfile existence function
+function validate_logfile() {
+ if [[ ! -w "$(dirname "$LOGFILE")" ]]; then
+ echo -e "${red}Error: Unable to write to LOGFILE directory: $(dirname "$LOGFILE").${reset}"
+ exit 2
+ fi
+}
+
+# Remove big files function
+function remove_big_files() {
+ rm -rf .tmp/gotator*.txt 2>>"$LOGFILE"
+ rm -rf .tmp/brute_recursive_wordlist.txt 2>>"$LOGFILE"
+ rm -rf .tmp/subs_dns_tko.txt 2>>"$LOGFILE"
+ rm -rf .tmp/subs_no_resolved.txt .tmp/subdomains_dns.txt .tmp/brute_dns_tko.txt .tmp/scrap_subs.txt .tmp/analytics_subs_clean.txt .tmp/gotator1.txt .tmp/gotator2.txt .tmp/passive_recursive.txt .tmp/brute_recursive_wordlist.txt .tmp/gotator1_recursive.txt .tmp/gotator2_recursive.txt 2>>"$LOGFILE"
+ find .tmp -type f -size +200M -exec rm -f {} + 2>>"$LOGFILE"
+ echo -e "${green}Specified files and large files in .tmp directory removed successfully.${reset}"
+}
+
+# Main script execution
+if [[ "$1" == "-h" || "$1" == "--help" ]]; then
+ display_help
+ exit 0
+fi
+
+validate_logfile
+remove_big_files
diff --git a/bin/rftw_util_resolver b/bin/rftw_util_resolver
new file mode 100755
index 0000000..cfcee0e
--- /dev/null
+++ b/bin/rftw_util_resolver
@@ -0,0 +1,63 @@
+#!/bin/bash
+
+# Load environment variables from reconftw.cfg
+# Load environment variables
+if [ -f "reconftw.cfg" ]; then
+ source reconftw.cfg
+else
+ echo "Error: reconftw.cfg not found!"
+ exit 1
+fi
+
+# Display help information
+function display_help() {
+ echo "Usage: $0"
+ echo
+ echo "Update resolvers for reconftw."
+ echo
+ echo "Options:"
+ echo " -h, --help Display this help and exit"
+ echo
+}
+
+function update_resolvers() {
+ if [ "$generate_resolvers" = true ]; then
+ if [ ! "$AXIOM" = true ]; then
+ if [ ! -s "$resolvers" ] || [[ $(find "$resolvers" -mtime +1 -print) ]]; then
+ notification "Resolvers seem older than 1 day\n Generating custom resolvers..." warn
+ rm -f $resolvers 2>>"$LOGFILE"
+ dnsvalidator -tL https://public-dns.info/nameservers.txt -threads $DNSVALIDATOR_THREADS -o $resolvers 2>>"$LOGFILE" >/dev/null
+ dnsvalidator -tL https://raw.githubusercontent.com/blechschmidt/massdns/master/lists/resolvers.txt -threads $DNSVALIDATOR_THREADS -o tmp_resolvers 2>>"$LOGFILE" >/dev/null
+
+ [ -s "tmp_resolvers" ] && cat tmp_resolvers | anew -q $resolvers
+ [ -s "tmp_resolvers" ] && rm -f tmp_resolvers 2>>"$LOGFILE" >/dev/null
+
+ [ ! -s "$resolvers" ] && wget -q -O - ${resolvers_url} > $resolvers
+ [ ! -s "$resolvers_trusted" ] && wget -q -O - ${resolvers_trusted_url} > $resolvers_trusted
+ notification "Updated\n" good
+ fi
+ else
+ notification "Checking resolvers lists...\n Accurate resolvers are the key to great results\n This may take around 10 minutes if it's not updated" warn
+ axiom-exec 'if [ $(find "/home/op/lists/resolvers.txt" -mtime +1 -print) ] || [ $(cat /home/op/lists/resolvers.txt | wc -l) -le 40 ] ; then dnsvalidator -tL https://public-dns.info/nameservers.txt -threads 200 -o /home/op/lists/resolvers.txt ; fi' &>/dev/null
+ axiom-exec "wget -q -O - ${resolvers_url} > /home/op/lists/resolvers.txt" 2>>"$LOGFILE" >/dev/null
+ axiom-exec "wget -q -O - ${resolvers_trusted_url} > /home/op/lists/resolvers_trusted.txt" 2>>"$LOGFILE" >/dev/null
+ notification "Updated\n" good
+ fi
+ generate_resolvers=false
+ else
+ if [ ! -s "$resolvers" ] || [[ $(find "$resolvers" -mtime +1 -print) ]]; then
+ notification "Resolvers seem older than 1 day\n Downloading new resolvers..." warn
+ wget -q -O - ${resolvers_url} > $resolvers
+ wget -q -O - ${resolvers_trusted_url} > $resolvers_trusted
+ notification "Resolvers updated\n" good
+ fi
+ fi
+}
+
+# Check arguments and call the main function
+if [[ "$1" == "-h" || "$1" == "--help" ]]; then
+ display_help
+ exit 0
+else
+ update_resolvers
+fi
diff --git a/bin/rftw_util_sendnotify b/bin/rftw_util_sendnotify
new file mode 100755
index 0000000..81de22d
--- /dev/null
+++ b/bin/rftw_util_sendnotify
@@ -0,0 +1,78 @@
+#!/bin/bash
+
+# Load environment variables from reconftw.cfg
+# Load environment variables
+if [ -f "reconftw.cfg" ]; then
+ source reconftw.cfg
+else
+ echo "Error: reconftw.cfg not found!"
+ exit 1
+fi
+
+# Display help information
+function display_help() {
+ echo "Usage: $0 <file>"
+ echo
+ echo "Send a specified file to notify providers based on configurations."
+ echo
+ echo "Options:"
+ echo " -h, --help Display this help and exit"
+ echo
+}
+
+# Main sendToNotify function
+function sendToNotify() {
+ local file="$1"
+
+ if [[ -z "$file" ]]; then
+ printf "\n${yellow}Error: No file provided to send${reset}\n"
+ display_help
+ exit 1
+ fi
+
+ if [[ -z "$NOTIFY_CONFIG" ]]; then
+ NOTIFY_CONFIG=~/.config/notify/provider-config.yaml
+ fi
+
+ if [ -n "$(find "$file" -prune -size +8000000c)" ]; then
+ printf '%s is larger than 8MB, sending over transfer.sh\n' "$file"
+ transfer "$file" | notify
+ return 0
+ fi
+
+ local config_value
+ for provider in telegram discord slack; do
+ if grep -q -E "^( )?${provider}" "$NOTIFY_CONFIG"; then
+ case $provider in
+ telegram)
+ notification "Sending ${domain} data over Telegram" info
+ config_value=$(grep -E "^( )?telegram_(chat_id|api_key)" "$NOTIFY_CONFIG" | xargs)
+ telegram_chat_id=$(echo "$config_value" | cut -d' ' -f2)
+ telegram_key=$(echo "$config_value" | cut -d' ' -f4)
+ curl -F document=@"$file" "https://api.telegram.org/bot${telegram_key}/sendDocument?chat_id=${telegram_chat_id}" 2>>"$LOGFILE" >/dev/null
+ ;;
+
+ discord)
+ notification "Sending ${domain} data over Discord" info
+ discord_url=$(grep -E "^( )?discord_webhook_url" "$NOTIFY_CONFIG" | xargs | cut -d' ' -f2)
+ curl -v -i -H "Accept: application/json" -H "Content-Type: multipart/form-data" -X POST -F file1=@"$file" "$discord_url" 2>>"$LOGFILE" >/dev/null
+ ;;
+
+ slack)
+ if [[ -n "$slack_channel" ]] && [[ -n "$slack_auth" ]]; then
+ notification "Sending ${domain} data over Slack" info
+ curl -F file=@"$file" -F "initial_comment=reconftw zip file" -F channels="$slack_channel" -H "Authorization: Bearer ${slack_auth}" https://slack.com/api/files.upload 2>>"$LOGFILE" >/dev/null
+ fi
+ ;;
+ esac
+ fi
+ done
+}
+
+# Check arguments and call the main function
+if [[ "$1" == "-h" || "$1" == "--help" ]]; then
+ display_help
+ exit 0
+else
+ sendToNotify "$1"
+fi
diff --git a/bin/rftw_util_tools b/bin/rftw_util_tools
new file mode 100755
index 0000000..9ebcbbe
--- /dev/null
+++ b/bin/rftw_util_tools
@@ -0,0 +1,142 @@
+#!/bin/bash
+
+# Default config path
+CONFIG_PATH="$RECONFTW_CFG"
+
+# Check if the config file exists
+if [ -f "$CONFIG_PATH" ]; then
+ source "$CONFIG_PATH"
+else
+ echo "Error: reconftw.cfg not found at $CONFIG_PATH!"
+ exit 1
+fi
+
+# Help menu
+function help_menu() {
+ echo -e "Usage: ./tools_installed_script.sh [OPTIONS]"
+ echo -e "Options:"
+ echo -e " -t, --tools-dir DIRECTORY Specify the tools directory path"
+ echo -e " -h, --help Display this help menu"
+ exit 1
+}
+
+# Main function
+function tools_installed() {
+ printf "\n\n${bgreen}#######################################################################${reset}\n"
+ printf "${bblue} Checking installed tools ${reset}\n\n"
+
+ allinstalled=true
+
+ [ -n "$GOPATH" ] || { printf "${bred} [*] GOPATH var [NO]${reset}\n"; allinstalled=false;}
+ [ -n "$GOROOT" ] || { printf "${bred} [*] GOROOT var [NO]${reset}\n"; allinstalled=false;}
+ [ -n "$PATH" ] || { printf "${bred} [*] PATH var [NO]${reset}\n"; allinstalled=false;}
+ [ -f "$tools/dorks_hunter/dorks_hunter.py" ] || { printf "${bred} [*] dorks_hunter [NO]${reset}\n"; allinstalled=false;}
+ [ -f "$tools/brutespray/brutespray.py" ] || { printf "${bred} [*] brutespray [NO]${reset}\n"; allinstalled=false;}
+ [ -f "$tools/fav-up/favUp.py" ] || { printf "${bred} [*] fav-up [NO]${reset}\n"; allinstalled=false;}
+ [ -f "$tools/Corsy/corsy.py" ] || { printf "${bred} [*] Corsy [NO]${reset}\n"; allinstalled=false;}
+ [ -f "$tools/testssl.sh/testssl.sh" ] || { printf "${bred} [*] testssl [NO]${reset}\n"; allinstalled=false;}
+ [ -f "$tools/CMSeeK/cmseek.py" ] || { printf "${bred} [*] CMSeeK [NO]${reset}\n"; allinstalled=false;}
+ [ -f "${fuzz_wordlist}" ] || { printf "${bred} [*] OneListForAll [NO]${reset}\n"; allinstalled=false;}
+ [ -f "${lfi_wordlist}" ] || { printf "${bred} [*] lfi_wordlist [NO]${reset}\n"; allinstalled=false;}
+ [ -f "${ssti_wordlist}" ] || { printf "${bred} [*] ssti_wordlist [NO]${reset}\n"; allinstalled=false;}
+ [ -f "${subs_wordlist}" ] || { printf "${bred} [*] subs_wordlist [NO]${reset}\n"; allinstalled=false;}
+ [ -f "${subs_wordlist_big}" ] || { printf "${bred} [*] subs_wordlist_big [NO]${reset}\n"; allinstalled=false;}
+ [ -f "${resolvers}" ] || { printf "${bred} [*] resolvers [NO]${reset}\n"; allinstalled=false;}
+ [ -f "${resolvers_trusted}" ] || { printf "${bred} [*] resolvers_trusted [NO]${reset}\n"; allinstalled=false;}
+ [ -f "$tools/xnLinkFinder/xnLinkFinder.py" ] || { printf "${bred} [*] xnLinkFinder [NO]${reset}\n"; allinstalled=false;}
+ [ -f "$tools/waymore/waymore.py" ] || { printf "${bred} [*] waymore [NO]${reset}\n"; allinstalled=false;}
+ [ -f "$tools/commix/commix.py" ] || { printf "${bred} [*] commix [NO]${reset}\n"; allinstalled=false;}
+ [ -f "$tools/getjswords.py" ] || { printf "${bred} [*] getjswords [NO]${reset}\n"; allinstalled=false;}
+ [ -f "$tools/JSA/jsa.py" ] || { printf "${bred} [*] JSA [NO]${reset}\n"; allinstalled=false;}
+ [ -f "$tools/cloud_enum/cloud_enum.py" ] || { printf "${bred} [*] cloud_enum [NO]${reset}\n"; allinstalled=false;}
+ [ -f "$tools/ultimate-nmap-parser/ultimate-nmap-parser.sh" ] || { printf "${bred} [*] nmap-parse-output [NO]${reset}\n"; allinstalled=false;}
+ [ -f "$tools/pydictor/pydictor.py" ] || { printf "${bred} [*] pydictor [NO]${reset}\n"; allinstalled=false;}
+ [ -f "$tools/urless/urless/urless.py" ] || { printf "${bred} [*] urless [NO]${reset}\n"; allinstalled=false;}
+ [ -f "$tools/smuggler/smuggler.py" ] || { printf "${bred} [*] smuggler [NO]${reset}\n"; allinstalled=false;}
+ [ -f "$tools/regulator/main.py" ] || { printf "${bred} [*] regulator [NO]${reset}\n"; allinstalled=false;}
+ which github-endpoints &>/dev/null || { printf "${bred} [*] github-endpoints [NO]${reset}\n"; allinstalled=false;}
+ which github-subdomains &>/dev/null || { printf "${bred} [*] github-subdomains [NO]${reset}\n"; allinstalled=false;}
+ which gitlab-subdomains &>/dev/null || { printf "${bred} [*] gitlab-subdomains [NO]${reset}\n"; allinstalled=false;}
+ which katana &>/dev/null || { printf "${bred} [*] katana [NO]${reset}\n"; allinstalled=false;}
+ which wafw00f &>/dev/null || { printf "${bred} [*] wafw00f [NO]${reset}\n"; allinstalled=false;}
+ which dnsvalidator &>/dev/null || { printf "${bred} [*] dnsvalidator [NO]${reset}\n"; allinstalled=false;}
+ which gowitness &>/dev/null || { printf "${bred} [*] gowitness [NO]${reset}\n"; allinstalled=false;}
+ which amass &>/dev/null || { printf "${bred} [*] Amass [NO]${reset}\n"; allinstalled=false;}
+ which dnsx &>/dev/null || { printf "${bred} [*] dnsx [NO]${reset}\n"; allinstalled=false;}
+ which gotator &>/dev/null || { printf "${bred} [*] gotator [NO]${reset}\n"; allinstalled=false;}
+ which nuclei &>/dev/null || { printf "${bred} [*] Nuclei [NO]${reset}\n"; allinstalled=false;}
+ [ -d ${NUCLEI_TEMPLATES_PATH} ] || { printf "${bred} [*] Nuclei templates [NO]${reset}\n"; allinstalled=false;}
+ [ -d ${tools}/fuzzing-templates ] || { printf "${bred} [*] Fuzzing templates [NO]${reset}\n"; allinstalled=false;}
+ which gf &>/dev/null || { printf "${bred} [*] Gf [NO]${reset}\n"; allinstalled=false;}
+ which Gxss &>/dev/null || { printf "${bred} [*] Gxss [NO]${reset}\n"; allinstalled=false;}
+ which subjs &>/dev/null || { printf "${bred} [*] subjs [NO]${reset}\n"; allinstalled=false;}
+ which ffuf &>/dev/null || { printf "${bred} [*] ffuf [NO]${reset}\n"; allinstalled=false;}
+ which massdns &>/dev/null || { printf "${bred} [*] Massdns [NO]${reset}\n"; allinstalled=false;}
+ which qsreplace &>/dev/null || { printf "${bred} [*] qsreplace [NO]${reset}\n"; allinstalled=false;}
+ which interlace &>/dev/null || { printf "${bred} [*] interlace [NO]${reset}\n"; allinstalled=false;}
+ which anew &>/dev/null || { printf "${bred} [*] Anew [NO]${reset}\n"; allinstalled=false;}
+ which unfurl &>/dev/null || { printf "${bred} [*] unfurl [NO]${reset}\n"; allinstalled=false;}
+ which crlfuzz &>/dev/null || { printf "${bred} [*] crlfuzz [NO]${reset}\n"; allinstalled=false;}
+ which httpx &>/dev/null || { printf "${bred} [*] Httpx [NO]${reset}\n${reset}"; allinstalled=false;}
+ which jq &>/dev/null || { printf "${bred} [*] jq [NO]${reset}\n${reset}"; allinstalled=false;}
+ which notify &>/dev/null || { printf "${bred} [*] notify [NO]${reset}\n${reset}"; allinstalled=false;}
+ which dalfox &>/dev/null || { printf "${bred} [*] dalfox [NO]${reset}\n${reset}"; allinstalled=false;}
+ which puredns &>/dev/null || { printf "${bred} [*] puredns [NO]${reset}\n${reset}"; allinstalled=false;}
+ which emailfinder &>/dev/null || { printf "${bred} [*] emailfinder [NO]${reset}\n"; allinstalled=false;}
+ which analyticsrelationships &>/dev/null || { printf "${bred} [*] analyticsrelationships [NO]${reset}\n"; allinstalled=false;}
+ which mapcidr &>/dev/null || { printf "${bred} [*] mapcidr [NO]${reset}\n"; allinstalled=false;}
+ which ppfuzz &>/dev/null || { printf "${bred} [*] ppfuzz [NO]${reset}\n"; allinstalled=false;}
+ which cdncheck &>/dev/null || { printf "${bred} [*] cdncheck [NO]${reset}\n"; allinstalled=false;}
+ which interactsh-client &>/dev/null || { printf "${bred} [*] interactsh-client [NO]${reset}\n"; allinstalled=false;}
+ which tlsx &>/dev/null || { printf "${bred} [*] tlsx [NO]${reset}\n"; allinstalled=false;}
+ which smap &>/dev/null || { printf "${bred} [*] smap [NO]${reset}\n"; allinstalled=false;}
+ which gitdorks_go &>/dev/null || { printf "${bred} [*] gitdorks_go [NO]${reset}\n"; allinstalled=false;}
+ which ripgen &>/dev/null || { printf "${bred} [*] ripgen [NO]${reset}\n${reset}"; allinstalled=false;}
+ which dsieve &>/dev/null || { printf "${bred} [*] dsieve [NO]${reset}\n${reset}"; allinstalled=false;}
+ which inscope &>/dev/null || { printf "${bred} [*] inscope [NO]${reset}\n${reset}"; allinstalled=false;}
+ which enumerepo &>/dev/null || { printf "${bred} [*] enumerepo [NO]${reset}\n${reset}"; allinstalled=false;}
+ which Web-Cache-Vulnerability-Scanner &>/dev/null || { printf "${bred} [*] Web-Cache-Vulnerability-Scanner [NO]${reset}\n"; allinstalled=false;}
+ which subfinder &>/dev/null || { printf "${bred} [*] subfinder [NO]${reset}\n${reset}"; allinstalled=false;}
+ which byp4xx &>/dev/null || { printf "${bred} [*] byp4xx [NO]${reset}\n${reset}"; allinstalled=false;}
+ which ghauri &>/dev/null || { printf "${bred} [*] ghauri [NO]${reset}\n${reset}"; allinstalled=false;}
+ which hakip2host &>/dev/null || { printf "${bred} [*] hakip2host [NO]${reset}\n${reset}"; allinstalled=false;}
+ which gau &>/dev/null || { printf "${bred} [*] gau [NO]${reset}\n${reset}"; allinstalled=false;}
+ which crt &>/dev/null || { printf "${bred} [*] crt [NO]${reset}\n${reset}"; allinstalled=false;}
+ which gitleaks &>/dev/null || { printf "${bred} [*] gitleaks [NO]${reset}\n${reset}"; allinstalled=false;}
+ which trufflehog &>/dev/null || { printf "${bred} [*] trufflehog [NO]${reset}\n${reset}"; allinstalled=false;}
+ which s3scanner &>/dev/null || { printf "${bred} [*] s3scanner [NO]${reset}\n${reset}"; allinstalled=false;}
+
+ if [ "${allinstalled}" = true ]; then
+ printf "${bgreen} Good! All installed! ${reset}\n\n"
+ else
+ printf "\n${yellow} Try running the installer script again ./install.sh"
+ printf "\n${yellow} If it fails for any reason try to install manually the tools missed"
+ printf "\n${yellow} Finally remember to set the ${bred}\$tools${yellow} variable at the start of this script"
+ printf "\n${yellow} If nothing works and the world is gonna end you can always ping me :D ${reset}\n\n"
+ fi
+
+ printf "${bblue} Tools check finished\n"
+ printf "${bgreen}#######################################################################\n${reset}"
+
+}
+
+# Parse command-line arguments
+tools_dir=""
+while [[ "$#" -gt 0 ]]; do
+ case $1 in
+ -t|--tools-dir) tools_dir="$2"; shift ;;
+ -h|--help) help_menu ;;
+ *) echo -e "${bred}Unknown parameter passed: $1${reset}" >&2; help_menu ;;
+ esac
+ shift
+done
+
+# Validate tools directory
+if [ -z "$tools_dir" ]; then
+ echo -e "${bred}Error: Tools directory not specified.${reset}" >&2
+ help_menu
+ exit 1
+fi
+
+# Execute the main function
+tools_installed
\ No newline at end of file
diff --git a/bin/rftw_util_version b/bin/rftw_util_version
new file mode 100755
index 0000000..5c54074
--- /dev/null
+++ b/bin/rftw_util_version
@@ -0,0 +1,56 @@
+#!/bin/bash
+
+
+# Default config path
+CONFIG_PATH="$RECONFTW_CFG"
+
+# Check if the config file exists
+if [ -f "$CONFIG_PATH" ]; then
+ source "$CONFIG_PATH"
+else
+ echo "Error: reconftw.cfg not found at $CONFIG_PATH!"
+ exit 1
+fi
+
+# Help menu
+function help_menu() {
+ echo -e "Usage: ./check_version_script.sh"
+ echo -e "Checks for updates to the current git repository."
+ echo -e "Options:"
+ echo -e " -h, --help Display this help menu"
+ exit 1
+}
+
+# Main function
+function check_version() {
+ # Check if current directory is a git repository
+ if ! git rev-parse --is-inside-work-tree > /dev/null 2>&1; then
+ echo -e "${bred}Error: This is not a git repository.${reset}" >&2
+ exit 1
+ fi
+
+ timeout 10 git fetch
+ exit_status=$?
+ if [ $exit_status -eq 0 ]; then
+ BRANCH=$(git rev-parse --abbrev-ref HEAD)
+ HEADHASH=$(git rev-parse HEAD)
+ UPSTREAMHASH=$(git rev-parse "${BRANCH}"@\{upstream\})
+ if [ "$HEADHASH" != "$UPSTREAMHASH" ]; then
+ echo -e "\n${yellow} There is a new version, run ./install.sh to get the latest version${reset}\n\n"
+ fi
+ else
+ echo -e "\n${bred} Unable to check updates ${reset}\n\n" >&2
+ fi
+}
+
+# Parse command-line arguments
+while [[ "$#" -gt 0 ]]; do
+ case $1 in
+ -h|--help) help_menu ;;
+ *) echo -e "${bred}Unknown parameter passed: $1${reset}" >&2; help_menu ;;
+ esac
+ shift
+done
+
+# Execute the main function
+check_version
\ No newline at end of file
diff --git a/bin/rftw_util_zipfolder b/bin/rftw_util_zipfolder
new file mode 100755
index 0000000..5f17151
--- /dev/null
+++ b/bin/rftw_util_zipfolder
@@ -0,0 +1,60 @@
+#!/bin/bash
+
+# Load environment variables from reconftw.cfg
+# Load environment variables
+if [ -f "reconftw.cfg" ]; then
+ source reconftw.cfg
+else
+ echo "Error: reconftw.cfg not found!"
+ exit 1
+fi
+
+# Colors for console output
+yellow="\033[1;33m"
+red="\033[1;31m"
+reset="\033[0m"
+
+# Help menu function
+function display_help() {
+ echo "Usage: $0 [DOMAIN]"
+ echo
+ echo "Zips the specified domain's output folder and sends the zip file."
+ echo "Options:"
+ echo " -h, --help Display this help and exit"
+ echo
+}
+
+# Validate arguments function
+function validate_args() {
+ if [[ -z "$1" ]]; then
+ echo -e "${red}Error: DOMAIN is required.${reset}"
+ display_help
+ exit 1
+ fi
+}
+
+# Main zipping and sending function
+function zip_send_output_folder() {
+ local domain="$1"
+ local zip_name1=$(date +"%Y_%m_%d-%H.%M.%S")
+ local zip_name="${zip_name1}_${domain}.zip"
+ (cd "$dir" && zip -r "$zip_name" .)
+
+ echo "Creating and sending zip file "${dir}/${zip_name}""
+
+ if [ -s "${dir}/$zip_name" ]; then
+ sendToNotify "$dir/$zip_name"
+ rm -f "${dir}/$zip_name"
+ else
+ notification "No Zip file to send" warn
+ fi
+}
+
+# Main script execution
+if [[ "$1" == "-h" || "$1" == "--help" ]]; then
+ display_help
+ exit 0
+fi
+
+validate_args "$1"
+zip_send_output_folder "$1"
diff --git a/bin/rftw_vuln_4xx b/bin/rftw_vuln_4xx
new file mode 100755
index 0000000..e7b202b
--- /dev/null
+++ b/bin/rftw_vuln_4xx
@@ -0,0 +1,77 @@
+#!/bin/bash
+
+# Load environment variables from reconftw.cfg
+# Load environment variables
+if [ -f "reconftw.cfg" ]; then
+ source reconftw.cfg
+else
+ echo "Error: reconftw.cfg not found!"
+ exit 1
+fi
+
+# Colors
+yellow="\033[1;33m"
+reset="\033[0m"
+
+# Help menu function
+function display_help() {
+ echo "Usage: $0 [OPTIONS]"
+ echo
+ echo "Perform 4XX Bypass checks on provided inputs."
+ echo "Options:"
+ echo " -h, --help Display this help and exit"
+ echo
+}
+
+# Validate requirements function
+function validate_requirements() {
+ if ! [ -x "$(command -v byp4xx)" ]; then
+ echo "Error: byp4xx not found." >&2
+ exit 1
+ fi
+ if ! [ -f "fuzzing/fuzzing_full.txt" ]; then
+ echo "Error: fuzzing_full.txt not found." >&2
+ exit 1
+ fi
+}
+
+# 4XX Bypass test function
+function bypass_4xx_test() {
+ if { [ ! -f "$called_fn_dir/.4xxbypass" ] || [ "$DIFF" = true ]; } && [ "$BYPASSER4XX" = true ]; then
+ if [[ $(cat fuzzing/fuzzing_full.txt 2>/dev/null | grep -E '^4' | grep -Ev '^404' | cut -d ' ' -f3 | wc -l) -le 1000 ]] || [ "$DEEP" = true ]; then
+ echo "[*] Starting 403 bypass"
+ cat $dir/fuzzing/fuzzing_full.txt 2>/dev/null | grep -E '^4' | grep -Ev '^404' | cut -d ' ' -f3 > $dir/.tmp/403test.txt
+ cd "$tools/byp4xx" || { echo "Failed to cd directory in 4xxbypass @ line ${LINENO}"; exit 1; }
+ byp4xx -threads $BYP4XX_THREADS $dir/.tmp/403test.txt > $dir/.tmp/byp4xx.txt
+ cd "$dir" || { echo "Failed to cd directory in 4xxbypass @ line ${LINENO}"; exit 1; }
+ [ -s ".tmp/byp4xx.txt" ] && cat .tmp/byp4xx.txt | anew -q vulns/byp4xx.txt
+ echo "[+] Results are saved in vulns/byp4xx.txt"
+ else
+ echo "[!] Too many URLs to bypass, skipping"
+ fi
+ else
+ if [ "$BYPASSER4XX" = false ]; then
+ echo -e "\n${yellow} 4xxbypass skipped in this mode or defined in reconftw.cfg ${reset}"
+ else
+ echo -e "${yellow} 4xxbypass is already processed, to force executing 4xxbypass delete\n $called_fn_dir/.4xxbypass ${reset}\n"
+ fi
+ fi
+}
+
+# Main script execution
+while (( "$#" )); do
+ case "$1" in
+ -h|--help)
+ display_help
+ exit 0
+ ;;
+ *)
+ echo "Unknown parameter passed: $1"
+ display_help
+ exit 1
+ ;;
+ esac
+done
+
+validate_requirements
+bypass_4xx_test
diff --git a/bin/rftw_vuln_brokenlink b/bin/rftw_vuln_brokenlink
new file mode 100755
index 0000000..56fc9b8
--- /dev/null
+++ b/bin/rftw_vuln_brokenlink
@@ -0,0 +1,68 @@
+#!/bin/bash
+
+# Load environment variables from reconftw.cfg
+# Load environment variables
+if [ -f "reconftw.cfg" ]; then
+ source reconftw.cfg
+else
+ echo "Error: reconftw.cfg not found!"
+ exit 1
+fi
+
+# Help menu
+help_menu() {
+ echo "Usage: $0 [OPTIONS]"
+ echo "Broken Links Check using katana and axiom"
+ echo ""
+ echo "Options:"
+ echo " -d, --deep Set deep mode (optional)"
+ echo " -h, --help Display this help message and exit"
+ exit 0
+}
+
+# Input validation
+DEEP_MODE=false
+while [ "$1" != "" ]; do
+ case $1 in
+ -d | --deep ) DEEP_MODE=true
+ ;;
+ -h | --help ) help_menu
+ exit
+ ;;
+ * ) echo "Unknown option: $1"
+ exit 1
+ esac
+ shift
+done
+
+broken_links_check() {
+ local deep_mode=$1
+
+ if { [ ! -f "$called_fn_dir/.${FUNCNAME[0]}" ] || [ "$DIFF" = true ]; } && [ "$BROKENLINKS" = true ]; then
+ start_func ${FUNCNAME[0]} "Broken links checks"
+
+ # The code remains mostly unchanged, with only minor adjustments for clarity.
+ [ ! -s ".tmp/webs_all.txt" ] && cat webs/webs.txt webs/webs_uncommon_ports.txt 2>/dev/null | anew -q .tmp/webs_all.txt
+ if [ ! "$AXIOM" = true ]; then
+ depth_level=$([ "$deep_mode" = true ] && echo 3 || echo 2)
+ [ -s ".tmp/webs_all.txt" ] && katana -silent -list .tmp/webs_all.txt -jc -kf all -c $KATANA_THREADS -d $depth_level -o .tmp/katana.txt 2>>"$LOGFILE" >/dev/null
+ [ -s ".tmp/katana.txt" ] && sed -i '/^.\{2048\}./d' .tmp/katana.txt
+ else
+ depth_level=$([ "$deep_mode" = true ] && echo 3 || echo 2)
+ [ -s ".tmp/webs_all.txt" ] && axiom-scan .tmp/webs_all.txt -m katana -jc -kf all -d $depth_level -o .tmp/katana.txt $AXIOM_EXTRA_ARGS 2>>"$LOGFILE" >/dev/null
+ [ -s ".tmp/katana.txt" ] && sed -i '/^.\{2048\}./d' .tmp/katana.txt
+ fi
+ [ -s ".tmp/katana.txt" ] && cat .tmp/katana.txt | sort -u | httpx -follow-redirects -random-agent -status-code -threads $HTTPX_THREADS -rl $HTTPX_RATELIMIT -timeout $HTTPX_TIMEOUT -silent -retries 2 -no-color | grep "\[4" | cut -d ' ' -f1 | anew -q .tmp/brokenLinks_total.txt
+ NUMOFLINES=$(cat .tmp/brokenLinks_total.txt 2>>"$LOGFILE" | anew vulns/brokenLinks.txt | sed '/^$/d' | wc -l)
+ notification "${NUMOFLINES} new broken links found" info
+ end_func "Results are saved in vulns/brokenLinks.txt" ${FUNCNAME[0]}
+ else
+ if [ "$BROKENLINKS" = false ]; then
+ printf "\n${yellow} ${FUNCNAME[0]} skipped in this mode or defined in reconftw.cfg ${reset}\n"
+ else
+ printf "${yellow} ${FUNCNAME[0]} is already processed, to force executing ${FUNCNAME[0]} delete\n $called_fn_dir/.${FUNCNAME[0]} ${reset}\n\n"
+ fi
+ fi
+}
+
+broken_links_check $DEEP_MODE
diff --git a/bin/rftw_vuln_comminject b/bin/rftw_vuln_comminject
new file mode 100755
index 0000000..a641bfb
--- /dev/null
+++ b/bin/rftw_vuln_comminject
@@ -0,0 +1,76 @@
+#!/bin/bash
+
+# Load environment variables from reconftw.cfg
+# Load environment variables
+if [ -f "reconftw.cfg" ]; then
+ source reconftw.cfg
+else
+ echo "Error: reconftw.cfg not found!"
+ exit 1
+fi
+
+# Colors
+yellow="\033[1;33m"
+reset="\033[0m"
+
+# Help menu function
+function display_help() {
+ echo "Usage: $0 [OPTIONS]"
+ echo
+ echo "Perform Command Injection checks on provided inputs."
+ echo "Options:"
+ echo " -h, --help Display this help and exit"
+ echo
+}
+
+# Validate requirements function
+function validate_requirements() {
+ if ! [ -x "$(command -v python3)" ]; then
+ echo "Error: python3 not found." >&2
+ exit 1
+ fi
+ if ! [ -f "gf/rce.txt" ]; then
+ echo "Error: rce.txt not found." >&2
+ exit 1
+ fi
+}
+
+# Command Injection test function
+function command_injection_test() {
+ if { [ ! -f "$called_fn_dir/.command_injection" ] || [ "$DIFF" = true ]; } && [ "$COMM_INJ" = true ] && [ -s "gf/rce.txt" ]; then
+ echo "[*] Starting Command Injection checks"
+ [ -s "gf/rce.txt" ] && cat gf/rce.txt | qsreplace FUZZ | sed '/FUZZ/!d' | anew -q .tmp/tmp_rce.txt
+ if [ "$DEEP" = true ] || [[ $(cat .tmp/tmp_rce.txt | wc -l) -le $DEEP_LIMIT ]]; then
+ [ -s ".tmp/tmp_rce.txt" ] && python3 $tools/commix/commix.py --batch -m .tmp/tmp_rce.txt --output-dir vulns/command_injection.txt 2>>"$LOGFILE" >/dev/null
+ echo "[+] Results are saved in vulns/command_injection folder"
+ else
+ echo "[!] Skipping Command injection: Too many URLs to test, try with --deep flag"
+ fi
+ else
+ if [ "$COMM_INJ" = false ]; then
+ echo -e "\n${yellow} command_injection_test skipped in this mode or defined in reconftw.cfg ${reset}"
+ elif [ ! -s "gf/rce.txt" ]; then
+ echo -e "\n${yellow} command_injection_test No URLs potentially vulnerables to Command Injection ${reset}\n"
+ else
+ echo -e "${yellow} command_injection_test is already processed, to force executing command_injection_test delete\n $called_fn_dir/.command_injection ${reset}\n"
+ fi
+ fi
+}
+
+# Main script execution
+while (( "$#" )); do
+ case "$1" in
+ -h|--help)
+ display_help
+ exit 0
+ ;;
+ *)
+ echo "Unknown parameter passed: $1"
+ display_help
+ exit 1
+ ;;
+ esac
+done
+
+validate_requirements
+command_injection_test
diff --git a/bin/rftw_vuln_cors b/bin/rftw_vuln_cors
new file mode 100755
index 0000000..1e11c67
--- /dev/null
+++ b/bin/rftw_vuln_cors
@@ -0,0 +1,82 @@
+#!/bin/bash
+
+# Load environment variables from reconftw.cfg
+# Load environment variables
+if [ -f "reconftw.cfg" ]; then
+ source reconftw.cfg
+else
+ echo "Error: reconftw.cfg not found!"
+ exit 1
+fi
+
+# Help menu
+function display_help() {
+ echo "Usage: $0 [OPTIONS]"
+ echo
+ echo "Perform CORS scan on provided inputs."
+ echo "Options:"
+ echo " -h, --help Display this help and exit"
+ echo
+}
+
+# Validate the required tools and files
+function validate_requirements() {
+ if ! [ -x "$(command -v python3)" ]; then
+ echo "Error: python3 is not installed." >&2
+ exit 1
+ fi
+ if [ ! -f "$tools/Corsy/corsy.py" ]; then
+ echo "Error: Corsy tool is missing." >&2
+ exit 1
+ fi
+ if [ ! -f "webs/webs.txt" ] || [ ! -f "webs/webs_uncommon_ports.txt" ]; then
+ echo "Error: Required input files are missing." >&2
+ exit 1
+ fi
+}
+
+# Main CORS function
+function cors_scan() {
+ if { [ ! -f "$called_fn_dir/.cors_scan" ] || [ "$DIFF" = true ]; } && [ "$CORS" = true ]; then
+ echo "[*] Starting CORS Scan"
+
+ # Check and consolidate input files
+ [ ! -s ".tmp/webs_all.txt" ] && cat webs/webs.txt webs/webs_uncommon_ports.txt 2>/dev/null | anew -q .tmp/webs_all.txt
+
+ # Perform CORS scan
+ [ -s ".tmp/webs_all.txt" ] && python3 $tools/Corsy/corsy.py -i .tmp/webs_all.txt -o vulns/cors.txt 2>>"$LOGFILE" >/dev/null
+
+ echo "[+] Results are saved in vulns/cors.txt"
+ else
+ if [ "$CORS" = false ]; then
+ echo -e "\n${yellow} cors_scan skipped in this mode or defined in reconftw.cfg ${reset}"
+ else
+ echo -e "${yellow} cors_scan is already processed, to force executing cors_scan delete\n $called_fn_dir/.cors_scan ${reset}\n"
+ fi
+ fi
+}
+
+# Main script execution
+if [ "$#" -eq 0 ]; then
+ display_help
+ exit 0
+fi
+
+while (( "$#" )); do
+ case "$1" in
+ -h|--help)
+ display_help
+ exit 0
+ ;;
+ *)
+ echo "Unknown parameter passed: $1"
+ display_help
+ exit 1
+ ;;
+ esac
+ shift
+done
+
+validate_requirements
+cors_scan
+
diff --git a/bin/rftw_vuln_crlf b/bin/rftw_vuln_crlf
new file mode 100755
index 0000000..2e7c559
--- /dev/null
+++ b/bin/rftw_vuln_crlf
@@ -0,0 +1,83 @@
+#!/bin/bash
+
+# Load environment variables from reconftw.cfg
+# Load environment variables
+if [ -f "reconftw.cfg" ]; then
+ source reconftw.cfg
+else
+ echo "Error: reconftw.cfg not found!"
+ exit 1
+fi
+
+# Colors
+yellow="\033[1;33m"
+reset="\033[0m"
+
+# Help menu function
+function display_help() {
+ echo "Usage: $0 [OPTIONS]"
+ echo
+ echo "Perform CRLF checks on provided inputs."
+ echo "Options:"
+ echo " -d, --deep Perform deep scanning"
+ echo " -h, --help Display this help and exit"
+ echo
+}
+
+# Validate requirements function
+function validate_requirements() {
+ if ! [ -x "$(command -v crlfuzz)" ]; then
+ echo "Error: crlfuzz is not installed." >&2
+ exit 1
+ fi
+}
+
+# CRLF checks function
+function crlf_checks() {
+ local deep_flag=$1
+
+ if { [ ! -f "$called_fn_dir/.crlf_checks" ] || [ "$DIFF" = true ]; } && [ "$CRLF_CHECKS" = true ]; then
+ echo "[*] Starting CRLF checks"
+
+ if [ ! -s ".tmp/webs_all.txt" ]; then
+ cat webs/webs.txt webs/webs_uncommon_ports.txt 2>/dev/null | anew -q .tmp/webs_all.txt
+ fi
+
+ if [ "$deep_flag" = true ] || [[ $(cat .tmp/webs_all.txt | wc -l) -le $DEEP_LIMIT ]]; then
+ crlfuzz -l .tmp/webs_all.txt -o vulns/crlf.txt 2>>"$LOGFILE" >/dev/null
+ echo "[+] Results are saved in vulns/crlf.txt"
+ else
+ echo "[!] Skipping CRLF: Too many URLs to test, try with --deep flag"
+ fi
+ else
+ if [ "$CRLF_CHECKS" = false ]; then
+ echo -e "\n${yellow} crlf_checks skipped in this mode or defined in reconftw.cfg ${reset}"
+ else
+ echo -e "${yellow} crlf_checks is already processed, to force executing crlf_checks delete\n $called_fn_dir/.crlf_checks ${reset}\n"
+ fi
+ fi
+}
+
+# Main script execution
+deep_flag=false
+
+while (( "$#" )); do
+ case "$1" in
+ -d|--deep)
+ deep_flag=true
+ shift
+ ;;
+ -h|--help)
+ display_help
+ exit 0
+ ;;
+ *)
+ echo "Unknown parameter passed: $1"
+ display_help
+ exit 1
+ ;;
+ esac
+done
+
+validate_requirements
+crlf_checks $deep_flag
diff --git a/bin/rftw_vuln_fuzzparam b/bin/rftw_vuln_fuzzparam
new file mode 100755
index 0000000..2e479cf
--- /dev/null
+++ b/bin/rftw_vuln_fuzzparam
@@ -0,0 +1,81 @@
+#!/bin/bash
+
+# Load environment variables from reconftw.cfg
+# Load environment variables
+if [ -f "reconftw.cfg" ]; then
+ source reconftw.cfg
+else
+ echo "Error: reconftw.cfg not found!"
+ exit 1
+fi
+
+# Colors
+yellow="\033[1;33m"
+reset="\033[0m"
+
+# Help menu function
+function display_help() {
+ echo "Usage: $0 [OPTIONS]"
+ echo
+ echo "Perform Fuzzing params values checks on provided inputs."
+ echo "Options:"
+ echo " -h, --help Display this help and exit"
+ echo
+}
+
+# Validate requirements function
+function validate_requirements() {
+ if ! [ -x "$(command -v nuclei)" ]; then
+ echo "Error: nuclei not found." >&2
+ exit 1
+ fi
+ if ! [ -d "$tools/fuzzing-templates" ]; then
+ echo "Error: fuzzing-templates directory not found." >&2
+ exit 1
+ fi
+}
+
+# Fuzzing params values test function
+function fuzzparams_test() {
+ if { [ ! -f "$called_fn_dir/.fuzzparams" ] || [ "$DIFF" = true ]; } && [ "$FUZZPARAMS" = true ]; then
+ echo "[*] Starting Fuzzing params values checks"
+ if [ "$DEEP" = true ] || [[ $(cat webs/url_extract.txt | wc -l) -le $DEEP_LIMIT2 ]]; then
+ if [ ! "$AXIOM" = true ]; then
+ nuclei -update 2>>"$LOGFILE" >/dev/null
+ git -C $tools/fuzzing-templates pull
+ cat webs/url_extract.txt 2>/dev/null | nuclei -silent -retries 3 -rl $NUCLEI_RATELIMIT -t $tools/fuzzing-templates -o .tmp/fuzzparams.txt
+ else
+ axiom-exec "git clone https://github.com/projectdiscovery/fuzzing-templates /home/op/fuzzing-templates" &>/dev/null
+ axiom-scan webs/url_extract.txt -m nuclei -nh -retries 3 -w /home/op/fuzzing-templates -rl $NUCLEI_RATELIMIT -o .tmp/fuzzparams.txt $AXIOM_EXTRA_ARGS 2>>"$LOGFILE" >/dev/null
+ fi
+ [ -s ".tmp/fuzzparams.txt" ] && cat .tmp/fuzzparams.txt | anew -q vulns/fuzzparams.txt
+ echo "[+] Results are saved in vulns/fuzzparams.txt"
+ else
+ echo "[!] Fuzzing params values: Too many entries to test, try with --deep flag"
+ fi
+ else
+ if [ "$FUZZPARAMS" = false ]; then
+ echo -e "\n${yellow} fuzzparams skipped in this mode or defined in reconftw.cfg ${reset}"
+ else
+ echo -e "${yellow} fuzzparams is already processed, to force executing fuzzparams delete\n $called_fn_dir/.fuzzparams ${reset}\n"
+ fi
+ fi
+}
+
+# Main script execution
+while (( "$#" )); do
+ case "$1" in
+ -h|--help)
+ display_help
+ exit 0
+ ;;
+ *)
+ echo "Unknown parameter passed: $1"
+ display_help
+ exit 1
+ ;;
+ esac
+done
+
+validate_requirements
+fuzzparams_test
diff --git a/bin/rftw_vuln_lfi b/bin/rftw_vuln_lfi
new file mode 100755
index 0000000..209d35b
--- /dev/null
+++ b/bin/rftw_vuln_lfi
@@ -0,0 +1,83 @@
+#!/bin/bash
+
+# Load environment variables from reconftw.cfg
+# Load environment variables
+if [ -f "reconftw.cfg" ]; then
+ source reconftw.cfg
+else
+ echo "Error: reconftw.cfg not found!"
+ exit 1
+fi
+
+# Colors
+yellow="\033[1;33m"
+reset="\033[0m"
+
+# Help menu function
+function display_help() {
+ echo "Usage: $0 [OPTIONS]"
+ echo
+ echo "Perform LFI checks on provided inputs."
+ echo "Options:"
+ echo " -d, --deep Perform deep scanning"
+ echo " -h, --help Display this help and exit"
+ echo
+}
+
+# Validate requirements function
+function validate_requirements() {
+ if ! [ -x "$(command -v ffuf)" ] || ! [ -x "$(command -v interlace)" ]; then
+ echo "Error: ffuf and/or interlace are not installed." >&2
+ exit 1
+ fi
+}
+
+# LFI checks function
+function lfi_checks() {
+ local deep_flag=$1
+
+ if { [ ! -f "$called_fn_dir/.lfi_checks" ] || [ "$DIFF" = true ]; } && [ "$LFI" = true ] && [ -s "gf/lfi.txt" ]; then
+ echo "[*] Starting LFI checks"
+
+ cat gf/lfi.txt | qsreplace FUZZ | sed '/FUZZ/!d' | anew -q .tmp/tmp_lfi.txt
+
+ if [ "$deep_flag" = true ] || [[ $(cat .tmp/tmp_lfi.txt | wc -l) -le $DEEP_LIMIT ]]; then
+ interlace -tL .tmp/tmp_lfi.txt -threads ${INTERLACE_THREADS} -c "ffuf -v -r -t ${FFUF_THREADS} -rate ${FFUF_RATELIMIT} -H \"${HEADER}\" -w ${lfi_wordlist} -u \"_target_\" -mr \"root:\" " 2>/dev/null | grep "URL" | sed 's/| URL | //' | anew -q vulns/lfi.txt
+ echo "[+] Results are saved in vulns/lfi.txt"
+ else
+ echo "[!] Skipping LFI: Too many URLs to test, try with --deep flag"
+ fi
+ else
+ if [ "$LFI" = false ]; then
+ echo -e "\n${yellow} lfi_checks skipped in this mode or defined in reconftw.cfg ${reset}"
+ elif [ ! -s "gf/lfi.txt" ]; then
+ echo -e "\n${yellow} lfi_checks No URLs potentially vulnerables to LFI ${reset}\n"
+ else
+ echo -e "${yellow} lfi_checks is already processed, to force executing lfi_checks delete\n $called_fn_dir/.lfi_checks ${reset}\n"
+ fi
+ fi
+}
+
+# Main script execution
+deep_flag=false
+
+while (( "$#" )); do
+ case "$1" in
+ -d|--deep)
+ deep_flag=true
+ shift
+ ;;
+ -h|--help)
+ display_help
+ exit 0
+ ;;
+ *)
+ echo "Unknown parameter passed: $1"
+ display_help
+ exit 1
+ ;;
+ esac
+done
+
+validate_requirements
+lfi_checks $deep_flag
diff --git a/bin/rftw_vuln_openredir b/bin/rftw_vuln_openredir
new file mode 100755
index 0000000..53bc5fd
--- /dev/null
+++ b/bin/rftw_vuln_openredir
@@ -0,0 +1,89 @@
+#!/bin/bash
+
+# Load environment variables from reconftw.cfg
+# Load environment variables
+if [ -f "reconftw.cfg" ]; then
+ source reconftw.cfg
+else
+ echo "Error: reconftw.cfg not found!"
+ exit 1
+fi
+
+# Colors
+yellow="\033[1;33m"
+bgreen="\033[1;32m"
+reset="\033[0m"
+
+# Help menu
+function display_help() {
+ echo "Usage: $0 [OPTIONS]"
+ echo
+ echo "Perform Open Redirects scan on provided inputs."
+ echo "Options:"
+ echo " -d, --deep Perform deep scanning"
+ echo " -h, --help Display this help and exit"
+ echo
+}
+
+# Validate the required tools and files
+function validate_requirements() {
+ if ! [ -x "$(command -v python3)" ]; then
+ echo "Error: python3 is not installed." >&2
+ exit 1
+ fi
+ if [ ! -f "$tools/Oralyzer/oralyzer.py" ] || [ ! -f "$tools/Oralyzer/payloads.txt" ]; then
+ echo "Error: Oralyzer tool or its payloads are missing." >&2
+ exit 1
+ fi
+}
+
+# Main Open Redirect function
+function open_redirect_scan() {
+ local deep_flag=$1
+
+ if { [ ! -f "$called_fn_dir/.open_redirect_scan" ] || [ "$DIFF" = true ]; } && [ "$OPEN_REDIRECT" = true ] && [ -s "gf/redirect.txt" ]; then
+ echo "[*] Starting Open Redirects checks"
+
+ if [ "$deep_flag" = true ] || [[ $(cat gf/redirect.txt | wc -l) -le $DEEP_LIMIT ]]; then
+ cat gf/redirect.txt | qsreplace FUZZ | sed '/FUZZ/!d' | anew -q .tmp/tmp_redirect.txt
+ python3 $tools/Oralyzer/oralyzer.py -l .tmp/tmp_redirect.txt -p $tools/Oralyzer/payloads.txt > vulns/redirect.txt
+ sed -r -i "s/\x1B\[([0-9]{1,3}(;[0-9]{1,2})?)?[mGK]//g" vulns/redirect.txt
+ echo "[+] Results are saved in vulns/redirect.txt"
+ else
+ echo "[!] Skipping Open redirects: Too many URLs to test, try with --deep flag"
+ fi
+ else
+ if [ "$OPEN_REDIRECT" = false ]; then
+ echo -e "\n${yellow} open_redirect_scan skipped in this mode or defined in reconftw.cfg ${reset}"
+ elif [ ! -s "gf/redirect.txt" ]; then
+ echo -e "\n${yellow} open_redirect_scan No URLs potentially vulnerables to Open Redirect ${reset}\n"
+ else
+ echo -e "${yellow} open_redirect_scan is already processed, to force executing open_redirect_scan delete\n $called_fn_dir/.open_redirect_scan ${reset}\n"
+ fi
+ fi
+}
+
+# Main script execution
+deep_flag=false
+
+while (( "$#" )); do
+ case "$1" in
+ -d|--deep)
+ deep_flag=true
+ shift
+ ;;
+ -h|--help)
+ display_help
+ exit 0
+ ;;
+ *)
+ echo "Unknown parameter passed: $1"
+ display_help
+ exit 1
+ ;;
+ esac
+done
+
+validate_requirements
+open_redirect_scan $deep_flag
+
diff --git a/bin/rftw_vuln_protpollut b/bin/rftw_vuln_protpollut
new file mode 100755
index 0000000..7f9d9c6
--- /dev/null
+++ b/bin/rftw_vuln_protpollut
@@ -0,0 +1,74 @@
+#!/bin/bash
+
+# Load environment variables from reconftw.cfg
+# Load environment variables
+if [ -f "reconftw.cfg" ]; then
+ source reconftw.cfg
+else
+ echo "Error: reconftw.cfg not found!"
+ exit 1
+fi
+
+# Colors
+yellow="\033[1;33m"
+reset="\033[0m"
+
+# Help menu function
+function display_help() {
+ echo "Usage: $0 [OPTIONS]"
+ echo
+ echo "Perform Prototype Pollution checks on provided inputs."
+ echo "Options:"
+ echo " -h, --help Display this help and exit"
+ echo
+}
+
+# Validate requirements function
+function validate_requirements() {
+ if ! [ -x "$(command -v ppfuzz)" ]; then
+ echo "Error: ppfuzz not found." >&2
+ exit 1
+ fi
+ if ! [ -f "webs/url_extract.txt" ]; then
+ echo "Error: url_extract.txt not found." >&2
+ exit 1
+ fi
+}
+
+# Prototype Pollution test function
+function prototype_pollution_test() {
+ if { [ ! -f "$called_fn_dir/.prototype_pollution" ] || [ "$DIFF" = true ]; } && [ "$PROTO_POLLUTION" = true ]; then
+ echo "[*] Starting Prototype Pollution checks"
+ if [ "$DEEP" = true ] || [[ $(cat webs/url_extract.txt | wc -l) -le $DEEP_LIMIT ]]; then
+ [ -s "webs/url_extract.txt" ] && ppfuzz -l webs/url_extract.txt -c $PPFUZZ_THREADS 2>/dev/null | anew -q .tmp/prototype_pollution.txt
+ [ -s ".tmp/prototype_pollution.txt" ] && cat .tmp/prototype_pollution.txt | sed -e '1,8d' | sed '/^\[ERR/d' | anew -q vulns/prototype_pollution.txt
+ echo "[+] Results are saved in vulns/prototype_pollution.txt"
+ else
+ echo "[!] Skipping Prototype Pollution: Too many URLs to test, try with --deep flag"
+ fi
+ else
+ if [ "$PROTO_POLLUTION" = false ]; then
+ echo -e "\n${yellow} prototype_pollution skipped in this mode or defined in reconftw.cfg ${reset}"
+ else
+ echo -e "${yellow} prototype_pollution is already processed, to force executing prototype_pollution delete\n $called_fn_dir/.prototype_pollution ${reset}\n"
+ fi
+ fi
+}
+
+# Main script execution
+while (( "$#" )); do
+ case "$1" in
+ -h|--help)
+ display_help
+ exit 0
+ ;;
+ *)
+ echo "Unknown parameter passed: $1"
+ display_help
+ exit 1
+ ;;
+ esac
+done
+
+validate_requirements
+prototype_pollution_test
diff --git a/bin/rftw_vuln_smuggling b/bin/rftw_vuln_smuggling
new file mode 100755
index 0000000..828416f
--- /dev/null
+++ b/bin/rftw_vuln_smuggling
@@ -0,0 +1,77 @@
+#!/bin/bash
+
+# Load environment variables from reconftw.cfg
+# Load environment variables
+if [ -f "reconftw.cfg" ]; then
+ source reconftw.cfg
+else
+ echo "Error: reconftw.cfg not found!"
+ exit 1
+fi
+
+# Colors
+yellow="\033[1;33m"
+reset="\033[0m"
+
+# Help menu function
+function display_help() {
+ echo "Usage: $0 [OPTIONS]"
+ echo
+ echo "Perform HTTP Request Smuggling checks on provided inputs."
+ echo "Options:"
+ echo " -h, --help Display this help and exit"
+ echo
+}
+
+# Validate requirements function
+function validate_requirements() {
+ if ! [ -x "$(command -v python3)" ]; then
+ echo "Error: python3 not found." >&2
+ exit 1
+ fi
+ if ! [ -d "$tools/smuggler" ]; then
+ echo "Error: smuggler tool directory not found." >&2
+ exit 1
+ fi
+}
+
+# HTTP Request Smuggling test function
+function smuggling_test() {
+ if { [ ! -f "$called_fn_dir/.smuggling" ] || [ "$DIFF" = true ]; } && [ "$SMUGGLING" = true ]; then
+ echo "[*] Starting HTTP Request Smuggling checks"
+ [ ! -s ".tmp/webs_all.txt" ] && cat webs/webs.txt webs/webs_uncommon_ports.txt 2>/dev/null | anew -q .tmp/webs_all.txt
+ if [ "$DEEP" = true ] || [[ $(cat .tmp/webs_all.txt | wc -l) -le $DEEP_LIMIT ]]; then
+ cd "$tools/smuggler" || { echo "Failed to cd directory in smuggling @ line $LINENO"; exit 1; }
+ cat $dir/.tmp/webs_all.txt | python3 smuggler.py -q --no-color 2>/dev/null | anew -q $dir/.tmp/smuggling.txt
+ cd "$dir" || { echo "Failed to cd to $dir in smuggling @ line $LINENO"; exit 1; }
+ [ -s ".tmp/smuggling.txt" ] && cat .tmp/smuggling.txt | anew -q vulns/smuggling.txt
+ echo "[+] Results are saved in vulns/smuggling.txt"
+ else
+ echo "[!] Skipping HTTP Request Smuggling: Too many webs to test, try with --deep flag"
+ fi
+ else
+ if [ "$SMUGGLING" = false ]; then
+ echo -e "\n${yellow} smuggling skipped in this mode or defined in reconftw.cfg ${reset}"
+ else
+ echo -e "${yellow} smuggling is already processed, to force executing smuggling delete\n $called_fn_dir/.smuggling ${reset}\n"
+ fi
+ fi
+}
+
+# Main script execution
+while (( "$#" )); do
+ case "$1" in
+ -h|--help)
+ display_help
+ exit 0
+ ;;
+ *)
+ echo "Unknown parameter passed: $1"
+ display_help
+ exit 1
+ ;;
+ esac
+done
+
+validate_requirements
+smuggling_test
diff --git a/bin/rftw_vuln_spray b/bin/rftw_vuln_spray
new file mode 100755
index 0000000..e087b34
--- /dev/null
+++ b/bin/rftw_vuln_spray
@@ -0,0 +1,71 @@
+#!/bin/bash
+
+# Load environment variables from reconftw.cfg
+# Load environment variables
+if [ -f "reconftw.cfg" ]; then
+ source reconftw.cfg
+else
+ echo "Error: reconftw.cfg not found!"
+ exit 1
+fi
+
+# Colors
+yellow="\033[1;33m"
+reset="\033[0m"
+
+# Help menu function
+function display_help() {
+ echo "Usage: $0 [OPTIONS]"
+ echo
+ echo "Perform Password spraying tests on provided inputs."
+ echo "Options:"
+ echo " -h, --help Display this help and exit"
+ echo
+}
+
+# Validate requirements function
+function validate_requirements() {
+ if ! [ -x "$(command -v python3)" ]; then
+ echo "Error: python3 not found." >&2
+ exit 1
+ fi
+ if ! [ -f "$dir/hosts/portscan_active.gnmap" ]; then
+ echo "Error: portscan_active.gnmap not found." >&2
+ exit 1
+ fi
+}
+
+# Password spraying test function
+function spraying_test() {
+ if { [ ! -f "$called_fn_dir/.spraying" ] || [ "$DIFF" = true ]; } && [ "$SPRAY" = true ]; then
+ echo "[*] Starting Password spraying"
+ cd "$tools/brutespray" || { echo "Failed to cd directory in spraying_test @ line ${LINENO}"; exit 1; }
+ python3 brutespray.py --file $dir/hosts/portscan_active.gnmap --threads $BRUTESPRAY_THREADS --hosts $BRUTESPRAY_CONCURRENCE -o $dir/vulns/brutespray 2>>"$LOGFILE" >/dev/null
+ cd "$dir" || { echo "Failed to cd directory in spraying_test @ line ${LINENO}"; exit 1; }
+ echo "[+] Results are saved in vulns/brutespray folder"
+ else
+ if [ "$SPRAY" = false ]; then
+ echo -e "\n${yellow} spraying_test skipped in this mode or defined in reconftw.cfg ${reset}"
+ else
+ echo -e "${yellow} spraying_test is already processed, to force executing spraying_test delete\n $called_fn_dir/.spraying ${reset}\n"
+ fi
+ fi
+}
+
+# Main script execution
+while (( "$#" )); do
+ case "$1" in
+ -h|--help)
+ display_help
+ exit 0
+ ;;
+ *)
+ echo "Unknown parameter passed: $1"
+ display_help
+ exit 1
+ ;;
+ esac
+done
+
+validate_requirements
+spraying_test
diff --git a/bin/rftw_vuln_sqli b/bin/rftw_vuln_sqli
new file mode 100755
index 0000000..adb97d6
--- /dev/null
+++ b/bin/rftw_vuln_sqli
@@ -0,0 +1,92 @@
+#!/bin/bash
+
+# Load environment variables from reconftw.cfg
+# Load environment variables
+if [ -f "reconftw.cfg" ]; then
+ source reconftw.cfg
+else
+ echo "Error: reconftw.cfg not found!"
+ exit 1
+fi
+
+# Colors
+yellow="\033[1;33m"
+reset="\033[0m"
+
+# Help menu function
+function display_help() {
+ echo "Usage: $0 [OPTIONS]"
+ echo
+ echo "Perform SQLi checks on provided inputs."
+ echo "Options:"
+ echo " -d, --deep Perform deep scanning"
+ echo " -h, --help Display this help and exit"
+ echo
+}
+
+# Validate requirements function
+function validate_requirements() {
+ if ! [ -x "$(command -v python3)" ] || ! [ -x "$(command -v interlace)" ]; then
+ echo "Error: python3 and/or interlace are not installed." >&2
+ exit 1
+ fi
+ if [ "$SQLMAP" = true ] && ! [ -f "$tools/sqlmap/sqlmap.py" ]; then
+ echo "Error: sqlmap.py not found at specified location." >&2
+ exit 1
+ fi
+}
+
+# SQLi checks function
+function sqli_checks() {
+ local deep_flag=$1
+
+ if { [ ! -f "$called_fn_dir/.sqli_checks" ] || [ "$DIFF" = true ]; } && [ "$SQLI" = true ] && [ -s "gf/sqli.txt" ]; then
+ echo "[*] Starting SQLi checks"
+
+ cat gf/sqli.txt | qsreplace FUZZ | sed '/FUZZ/!d' | anew -q .tmp/tmp_sqli.txt
+
+ if [ "$deep_flag" = true ] || [[ $(cat .tmp/tmp_sqli.txt | wc -l) -le $DEEP_LIMIT ]]; then
+ if [ "$SQLMAP" = true ]; then
+ python3 $tools/sqlmap/sqlmap.py -m .tmp/tmp_sqli.txt -b -o --smart --batch --disable-coloring --random-agent --output-dir=vulns/sqlmap 2>>"$LOGFILE" >/dev/null
+ fi
+ if [ "$GHAURI" = true ]; then
+ interlace -tL .tmp/tmp_sqli.txt -threads ${INTERLACE_THREADS} -c "ghauri -u _target_ --batch -H \"${HEADER}\" --force-ssl >> vulns/ghauri_log.txt" 2>>"$LOGFILE" >/dev/null
+ fi
+ echo "[+] Results are saved in vulns/sqlmap folder"
+ else
+ echo "[!] Skipping SQLi: Too many URLs to test, try with --deep flag"
+ fi
+ else
+ if [ "$SQLI" = false ]; then
+ echo -e "\n${yellow} sqli_checks skipped in this mode or defined in reconftw.cfg ${reset}"
+ elif [ ! -s "gf/sqli.txt" ]; then
+ echo -e "\n${yellow} sqli_checks No URLs potentially vulnerables to SQLi ${reset}\n"
+ else
+ echo -e "${yellow} sqli_checks is already processed, to force executing sqli_checks delete\n $called_fn_dir/.sqli_checks ${reset}\n"
+ fi
+ fi
+}
+
+# Main script execution
+deep_flag=false
+
+while (( "$#" )); do
+ case "$1" in
+ -d|--deep)
+ deep_flag=true
+ shift
+ ;;
+ -h|--help)
+ display_help
+ exit 0
+ ;;
+ *)
+ echo "Unknown parameter passed: $1"
+ display_help
+ exit 1
+ ;;
+ esac
+done
+
+validate_requirements
+sqli_checks $deep_flag
diff --git a/bin/rftw_vuln_ssrf b/bin/rftw_vuln_ssrf
new file mode 100755
index 0000000..6f70f37
--- /dev/null
+++ b/bin/rftw_vuln_ssrf
@@ -0,0 +1,108 @@
+#!/bin/bash
+
+# Load environment variables from reconftw.cfg
+# Load environment variables
+if [ -f "reconftw.cfg" ]; then
+ source reconftw.cfg
+else
+ echo "Error: reconftw.cfg not found!"
+ exit 1
+fi
+
+# Colors
+yellow="\033[1;33m"
+bgreen="\033[1;32m"
+reset="\033[0m"
+
+# Help menu
+function display_help() {
+ echo "Usage: $0 [OPTIONS]"
+ echo
+ echo "Perform SSRF checks on provided inputs."
+ echo "Options:"
+ echo " -d, --deep Perform deep scanning"
+ echo " -h, --help Display this help and exit"
+ echo
+}
+
+# Validate the required tools and files
+function validate_requirements() {
+ if ! [ -x "$(command -v python3)" ]; then
+ echo "Error: python3 is not installed." >&2
+ exit 1
+ fi
+ if [ ! -f "$tools/Oralyzer/oralyzer.py" ]; then
+ echo "Error: Oralyzer tool is missing." >&2
+ exit 1
+ fi
+}
+
+# Main SSRF checks function
+function ssrf_checks() {
+ local deep_flag=$1
+
+ if { [ ! -f "$called_fn_dir/.ssrf_checks" ] || [ "$DIFF" = true ]; } && [ "$SSRF_CHECKS" = true ] && [ -s "gf/ssrf.txt" ]; then
+ echo "[*] Starting SSRF checks"
+
+ if [ -z "$COLLAB_SERVER" ]; then
+ interactsh-client &>.tmp/ssrf_callback.txt &
+ sleep 2
+ COLLAB_SERVER_FIX="FFUFHASH.$(cat .tmp/ssrf_callback.txt | tail -n1 | cut -c 16-)"
+ COLLAB_SERVER_URL="http://$COLLAB_SERVER_FIX"
+ INTERACT=true
+ else
+ COLLAB_SERVER_FIX="FFUFHASH.$(echo ${COLLAB_SERVER} | sed -r "s/https?:\/\///")"
+ INTERACT=false
+ fi
+ if [ "$deep_flag" = true ] || [[ $(cat gf/ssrf.txt | wc -l) -le $DEEP_LIMIT ]]; then
+ cat gf/ssrf.txt | qsreplace ${COLLAB_SERVER_FIX} | anew -q .tmp/tmp_ssrf.txt
+ cat gf/ssrf.txt | qsreplace ${COLLAB_SERVER_URL} | anew -q .tmp/tmp_ssrf.txt
+ ffuf -v -H "${HEADER}" -t $FFUF_THREADS -rate $FFUF_RATELIMIT -w .tmp/tmp_ssrf.txt -u FUZZ 2>/dev/null | grep "URL" | sed 's/| URL | //' | anew -q vulns/ssrf_requested_url.txt
+ ffuf -v -w .tmp/tmp_ssrf.txt:W1,$tools/headers_inject.txt:W2 -H "${HEADER}" -H "W2: ${COLLAB_SERVER_FIX}" -t $FFUF_THREADS -rate $FFUF_RATELIMIT -u W1 2>/dev/null | anew -q vulns/ssrf_requested_headers.txt
+ ffuf -v -w .tmp/tmp_ssrf.txt:W1,$tools/headers_inject.txt:W2 -H "${HEADER}" -H "W2: ${COLLAB_SERVER_URL}" -t $FFUF_THREADS -rate $FFUF_RATELIMIT -u W1 2>/dev/null | anew -q vulns/ssrf_requested_headers.txt
+ sleep 5
+ if [ -s ".tmp/ssrf_callback.txt" ]; then
+ cat .tmp/ssrf_callback.txt | tail -n+11 | anew -q vulns/ssrf_callback.txt
+ NUMOFLINES=$(cat .tmp/ssrf_callback.txt | tail -n+12 | sed '/^$/d' | wc -l)
+ [ "$INTERACT" = true ] && echo "SSRF: ${NUMOFLINES} callbacks received"
+ fi
+ echo "[+] Results are saved in vulns/ssrf_*"
+ else
+ echo "[!] Skipping SSRF: Too many URLs to test, try with --deep flag"
+ fi
+ pkill -f interactsh-client &
+ else
+ if [ "$SSRF_CHECKS" = false ]; then
+ echo -e "\n${yellow} ssrf_checks skipped in this mode or defined in reconftw.cfg ${reset}"
+ elif [ ! -s "gf/ssrf.txt" ]; then
+ echo -e "\n${yellow} ssrf_checks No URLs potentially vulnerables to SSRF ${reset}\n"
+ else
+ echo -e "${yellow} ssrf_checks is already processed, to force executing ssrf_checks delete\n $called_fn_dir/.ssrf_checks ${reset}\n"
+ fi
+ fi
+}
+
+# Main script execution
+deep_flag=false
+
+while (( "$#" )); do
+ case "$1" in
+ -d|--deep)
+ deep_flag=true
+ shift
+ ;;
+ -h|--help)
+ display_help
+ exit 0
+ ;;
+ *)
+ echo "Unknown parameter passed: $1"
+ display_help
+ exit 1
+ ;;
+ esac
+done
+
+validate_requirements
+ssrf_checks $deep_flag
+
diff --git a/bin/rftw_vuln_ssti b/bin/rftw_vuln_ssti
new file mode 100755
index 0000000..d57ba1f
--- /dev/null
+++ b/bin/rftw_vuln_ssti
@@ -0,0 +1,83 @@
+#!/bin/bash
+
+# Load environment variables from reconftw.cfg
+# Load environment variables
+if [ -f "reconftw.cfg" ]; then
+ source reconftw.cfg
+else
+ echo "Error: reconftw.cfg not found!"
+ exit 1
+fi
+
+# Colors
+yellow="\033[1;33m"
+reset="\033[0m"
+
+# Help menu function
+function display_help() {
+ echo "Usage: $0 [OPTIONS]"
+ echo
+ echo "Perform SSTI checks on provided inputs."
+ echo "Options:"
+ echo " -d, --deep Perform deep scanning"
+ echo " -h, --help Display this help and exit"
+ echo
+}
+
+# Validate requirements function
+function validate_requirements() {
+ if ! [ -x "$(command -v ffuf)" ] || ! [ -x "$(command -v interlace)" ]; then
+ echo "Error: ffuf and/or interlace are not installed." >&2
+ exit 1
+ fi
+}
+
+# SSTI checks function
+function ssti_checks() {
+ local deep_flag=$1
+
+ if { [ ! -f "$called_fn_dir/.ssti_checks" ] || [ "$DIFF" = true ]; } && [ "$SSTI" = true ] && [ -s "gf/ssti.txt" ]; then
+ echo "[*] Starting SSTI checks"
+
+ cat gf/ssti.txt | qsreplace FUZZ | sed '/FUZZ/!d' | anew -q .tmp/tmp_ssti.txt
+
+ if [ "$deep_flag" = true ] || [[ $(cat .tmp/tmp_ssti.txt | wc -l) -le $DEEP_LIMIT ]]; then
+ interlace -tL .tmp/tmp_ssti.txt -threads ${INTERLACE_THREADS} -c "ffuf -v -r -t ${FFUF_THREADS} -rate ${FFUF_RATELIMIT} -H \"${HEADER}\" -w ${ssti_wordlist} -u \"_target_\" -mr \"ssti49\" " 2>/dev/null | grep "URL" | sed 's/| URL | //' | anew -q vulns/ssti.txt
+ echo "[+] Results are saved in vulns/ssti.txt"
+ else
+ echo "[!] Skipping SSTI: Too many URLs to test, try with --deep flag"
+ fi
+ else
+ if [ "$SSTI" = false ]; then
+ echo -e "\n${yellow} ssti_checks skipped in this mode or defined in reconftw.cfg ${reset}"
+ elif [ ! -s "gf/ssti.txt" ]; then
+ echo -e "\n${yellow} ssti_checks No URLs potentially vulnerables to SSTI ${reset}\n"
+ else
+ echo -e "${yellow} ssti_checks is already processed, to force executing ssti_checks delete\n $called_fn_dir/.ssti_checks ${reset}\n"
+ fi
+ fi
+}
+
+# Main script execution
+deep_flag=false
+
+while (( "$#" )); do
+ case "$1" in
+ -d|--deep)
+ deep_flag=true
+ shift
+ ;;
+ -h|--help)
+ display_help
+ exit 0
+ ;;
+ *)
+ echo "Unknown parameter passed: $1"
+ display_help
+ exit 1
+ ;;
+ esac
+done
+
+validate_requirements
+ssti_checks $deep_flag
diff --git a/bin/rftw_vuln_testssl b/bin/rftw_vuln_testssl
new file mode 100755
index 0000000..6323779
--- /dev/null
+++ b/bin/rftw_vuln_testssl
@@ -0,0 +1,69 @@
+#!/bin/bash
+
+# Load environment variables from reconftw.cfg
+# Load environment variables
+if [ -f "reconftw.cfg" ]; then
+ source reconftw.cfg
+else
+ echo "Error: reconftw.cfg not found!"
+ exit 1
+fi
+
+# Colors
+yellow="\033[1;33m"
+reset="\033[0m"
+
+# Help menu function
+function display_help() {
+ echo "Usage: $0 [OPTIONS]"
+ echo
+ echo "Perform SSL tests on provided inputs."
+ echo "Options:"
+ echo " -h, --help Display this help and exit"
+ echo
+}
+
+# Validate requirements function
+function validate_requirements() {
+ if ! [ -x "$(command -v $tools/testssl.sh/testssl.sh)" ]; then
+ echo "Error: testssl.sh not found at specified location." >&2
+ exit 1
+ fi
+ if ! [ -f "hosts/ips.txt" ]; then
+ echo "Error: hosts/ips.txt not found." >&2
+ exit 1
+ fi
+}
+
+# SSL test function
+function ssl_test() {
+ if { [ ! -f "$called_fn_dir/.ssl_test" ] || [ "$DIFF" = true ]; } && [ "$TEST_SSL" = true ]; then
+ echo "[*] Starting SSL Test"
+ $tools/testssl.sh/testssl.sh --quiet --color 0 -U -iL hosts/ips.txt 2>>"$LOGFILE" > vulns/testssl.txt
+ echo "[+] Results are saved in vulns/testssl.txt"
+ else
+ if [ "$TEST_SSL" = false ]; then
+ echo -e "\n${yellow} ssl_test skipped in this mode or defined in reconftw.cfg ${reset}"
+ else
+ echo -e "${yellow} ssl_test is already processed, to force executing ssl_test delete\n $called_fn_dir/.ssl_test ${reset}\n"
+ fi
+ fi
+}
+
+# Main script execution
+while (( "$#" )); do
+ case "$1" in
+ -h|--help)
+ display_help
+ exit 0
+ ;;
+ *)
+ echo "Unknown parameter passed: $1"
+ display_help
+ exit 1
+ ;;
+ esac
+done
+
+validate_requirements
+ssl_test
diff --git a/bin/rftw_vuln_webcache b/bin/rftw_vuln_webcache
new file mode 100755
index 0000000..bd51745
--- /dev/null
+++ b/bin/rftw_vuln_webcache
@@ -0,0 +1,77 @@
+#!/bin/bash
+
+# Load environment variables from reconftw.cfg
+# Load environment variables
+if [ -f "reconftw.cfg" ]; then
+ source reconftw.cfg
+else
+ echo "Error: reconftw.cfg not found!"
+ exit 1
+fi
+
+# Colors
+yellow="\033[1;33m"
+reset="\033[0m"
+
+# Help menu function
+function display_help() {
+ echo "Usage: $0 [OPTIONS]"
+ echo
+ echo "Perform Web Cache Poisoning checks on provided inputs."
+ echo "Options:"
+ echo " -h, --help Display this help and exit"
+ echo
+}
+
+# Validate requirements function
+function validate_requirements() {
+ if ! [ -x "$(command -v anew)" ]; then
+ echo "Error: anew not found." >&2
+ exit 1
+ fi
+ if ! [ -d "$tools/Web-Cache-Vulnerability-Scanner" ]; then
+ echo "Error: Web-Cache-Vulnerability-Scanner directory not found." >&2
+ exit 1
+ fi
+}
+
+# Web Cache Poisoning test function
+function webcache_test() {
+ if { [ ! -f "$called_fn_dir/.webcache" ] || [ "$DIFF" = true ]; } && [ "$WEBCACHE" = true ]; then
+ echo "[*] Starting Web Cache Poisoning checks"
+ [ ! -s ".tmp/webs_all.txt" ] && cat webs/webs.txt webs/webs_uncommon_ports.txt 2>/dev/null | anew -q .tmp/webs_all.txt
+ if [ "$DEEP" = true ] || [[ $(cat .tmp/webs_all.txt | wc -l) -le $DEEP_LIMIT ]]; then
+ cd "$tools/Web-Cache-Vulnerability-Scanner" || { echo "Failed to cd directory in webcache @ line $LINENO"; exit 1; }
+ Web-Cache-Vulnerability-Scanner -u file:$dir/.tmp/webs_all.txt -v 0 2>/dev/null | anew -q $dir/.tmp/webcache.txt
+ cd "$dir" || { echo "Failed to cd to $dir in webcache @ line $LINENO"; exit 1; }
+ [ -s ".tmp/webcache.txt" ] && cat .tmp/webcache.txt | anew -q vulns/webcache.txt
+ echo "[+] Results are saved in vulns/webcache.txt"
+ else
+ echo "[!] Skipping Web Cache Poisoning: Too many webs to test, try with --deep flag"
+ fi
+ else
+ if [ "$WEBCACHE" = false ]; then
+ echo -e "\n${yellow} webcache skipped in this mode or defined in reconftw.cfg ${reset}"
+ else
+ echo -e "${yellow} webcache is already processed, to force executing webcache delete\n $called_fn_dir/.webcache ${reset}\n"
+ fi
+ fi
+}
+
+# Main script execution
+while (( "$#" )); do
+ case "$1" in
+ -h|--help)
+ display_help
+ exit 0
+ ;;
+ *)
+ echo "Unknown parameter passed: $1"
+ display_help
+ exit 1
+ ;;
+ esac
+done
+
+validate_requirements
+webcache_test
diff --git a/bin/rftw_vuln_xss b/bin/rftw_vuln_xss
new file mode 100755
index 0000000..033b5ba
--- /dev/null
+++ b/bin/rftw_vuln_xss
@@ -0,0 +1,120 @@
+#!/bin/bash
+
+# Load environment variables from reconftw.cfg
+# Load environment variables
+if [ -f "reconftw.cfg" ]; then
+ source reconftw.cfg
+else
+ echo "Error: reconftw.cfg not found!"
+ exit 1
+fi
+
+# Help menu
+function display_help() {
+ echo "Usage: $0 [OPTIONS]"
+ echo
+ echo "Perform XSS analysis on provided inputs."
+ echo "Options:"
+ echo " -h, --help Display this help and exit"
+ echo
+}
+
+# Validate the required tools and files
+function validate_requirements() {
+ if ! [ -x "$(command -v dalfox)" ]; then
+ echo "Error: dalfox is not installed." >&2
+ exit 1
+ fi
+ if [ ! -f "gf/xss.txt" ]; then
+ echo "Error: gf/xss.txt does not exist." >&2
+ exit 1
+ fi
+}
+
+# Main xss function
+function xss_analysis() {
+ if { [ ! -f "$called_fn_dir/.xss_analysis" ] || [ "$DIFF" = true ]; } && [ "$XSS" = true ] && [ -s "gf/xss.txt" ]; then
+ echo "[*] Starting XSS Analysis"
+
+ # Check if gf/xss.txt exists and process it
+ [ -s "gf/xss.txt" ] && cat gf/xss.txt | qsreplace FUZZ | sed '/FUZZ/!d' | Gxss -c 100 -p Xss | qsreplace FUZZ | sed '/FUZZ/!d' | anew -q .tmp/xss_reflected.txt
+
+ # Check if AXIOM is true or not and perform the corresponding operations
+ if [ ! "$AXIOM" = true ]; then
+ if [ "$DEEP" = true ]; then
+ if [ -n "$XSS_SERVER" ]; then
+ [ -s ".tmp/xss_reflected.txt" ] && cat .tmp/xss_reflected.txt | dalfox pipe --silence --no-color --no-spinner --only-poc r --ignore-return 302,404,403 --skip-bav -b ${XSS_SERVER} -w $DALFOX_THREADS 2>>"$LOGFILE" | anew -q vulns/xss.txt
+ else
+ printf "${yellow}\n No XSS_SERVER defined, blind xss skipped\n\n"
+ [ -s ".tmp/xss_reflected.txt" ] && cat .tmp/xss_reflected.txt | dalfox pipe --silence --no-color --no-spinner --only-poc r --ignore-return 302,404,403 --skip-bav -w $DALFOX_THREADS 2>>"$LOGFILE" | anew -q vulns/xss.txt
+ fi
+ else
+ if [[ $(cat .tmp/xss_reflected.txt | wc -l) -le $DEEP_LIMIT ]]; then
+ if [ -n "$XSS_SERVER" ]; then
+ cat .tmp/xss_reflected.txt | dalfox pipe --silence --no-color --no-spinner --skip-bav --skip-mining-dom --skip-mining-dict --only-poc r --ignore-return 302,404,403 -b ${XSS_SERVER} -w $DALFOX_THREADS 2>>"$LOGFILE" | anew -q vulns/xss.txt
+ else
+ printf "${yellow}\n No XSS_SERVER defined, blind xss skipped\n\n"
+ cat .tmp/xss_reflected.txt | dalfox pipe --silence --no-color --no-spinner --skip-bav --skip-mining-dom --skip-mining-dict --only-poc r --ignore-return 302,404,403 -w $DALFOX_THREADS 2>>"$LOGFILE" | anew -q vulns/xss.txt
+ fi
+ else
+ printf "${bred} Skipping XSS: Too many URLs to test, try with --deep flag${reset}\n"
+ fi
+ fi
+ else
+ if [ "$DEEP" = true ]; then
+ if [ -n "$XSS_SERVER" ]; then
+ [ -s ".tmp/xss_reflected.txt" ] && axiom-scan .tmp/xss_reflected.txt -m dalfox --skip-bav -b ${XSS_SERVER} -w $DALFOX_THREADS -o vulns/xss.txt $AXIOM_EXTRA_ARGS 2>>"$LOGFILE" >/dev/null
+ else
+ printf "${yellow}\n No XSS_SERVER defined, blind xss skipped\n\n"
+ [ -s ".tmp/xss_reflected.txt" ] && axiom-scan .tmp/xss_reflected.txt -m dalfox --skip-bav -w $DALFOX_THREADS -o vulns/xss.txt $AXIOM_EXTRA_ARGS 2>>"$LOGFILE" >/dev/null
+ fi
+ else
+ if [[ $(cat .tmp/xss_reflected.txt | wc -l) -le $DEEP_LIMIT ]]; then
+ if [ -n "$XSS_SERVER" ]; then
+ axiom-scan .tmp/xss_reflected.txt -m dalfox --skip-bav --skip-grepping --skip-mining-all --skip-mining-dict -b ${XSS_SERVER} -w $DALFOX_THREADS -o vulns/xss.txt $AXIOM_EXTRA_ARGS 2>>"$LOGFILE" >/dev/null
+ else
+ printf "${yellow}\n No XSS_SERVER defined, blind xss skipped\n\n"
+ axiom-scan .tmp/xss_reflected.txt -m dalfox --skip-bav --skip-grepping --skip-mining-all --skip-mining-dict -w $DALFOX_THREADS -o vulns/xss.txt $AXIOM_EXTRA_ARGS 2>>"$LOGFILE" >/dev/null
+ fi
+ else
+ printf "${bred} Skipping XSS: Too many URLs to test, try with --deep flag${reset}\n"
+ fi
+ fi
+ fi
+ echo "[+] Results are saved in vulns/xss.txt"
+ end_func "Results are saved in vulns/xss.txt" ${FUNCNAME[0]}
+ else
+ if [ "$XSS" = false ]; then
+ echo -e "\n${yellow} xss_analysis skipped in this mode or defined in reconftw.cfg ${reset}"
+ elif [ ! -s "gf/xss.txt" ]; then
+ echo -e "\n${yellow} xss_analysis: No URLs potentially vulnerable to XSS ${reset}\n"
+ else
+ echo -e "${yellow} xss_analysis is already processed, to force executing xss_analysis delete\n $called_fn_dir/.xss_analysis ${reset}\n"
+ fi
+ fi
+}
+
+# Main script execution
+if [ "$#" -eq 0 ]; then
+ display_help
+ exit 0
+fi
+
+while (( "$#" )); do
+ case "$1" in
+ -h|--help)
+ display_help
+ exit 0
+ ;;
+ *)
+ echo "Unknown parameter passed: $1"
+ display_help
+ exit 1
+ ;;
+ esac
+ shift
+done
+
+validate_requirements
+xss_analysis
+
diff --git a/bin/rftw_web_cms b/bin/rftw_web_cms
new file mode 100755
index 0000000..df1631a
--- /dev/null
+++ b/bin/rftw_web_cms
@@ -0,0 +1,86 @@
+#!/bin/bash
+
+# Load environment variables from reconftw.cfg
+# Load environment variables
+if [ -f "reconftw.cfg" ]; then
+ source reconftw.cfg
+else
+ echo "Error: reconftw.cfg not found!"
+ exit 1
+fi
+
+# Help function
+help_menu() {
+ echo "Usage: $0 [OPTIONS]"
+ echo ""
+ echo "CMS Scanner"
+ echo ""
+ echo "Options:"
+ echo " -h, --help Show this help menu"
+ echo " -f, --force Force the execution even if already processed"
+}
+
+# Start function
+start_func() {
+ echo "Starting $1: $2..."
+}
+
+# End function
+end_func() {
+ echo "$1"
+ echo "End of $2..."
+}
+
+# Default values
+FORCE=false
+
+# Parse arguments
+while [[ "$#" -gt 0 ]]; do
+ case $1 in
+ -h|--help) help_menu; exit 0 ;;
+ -f|--force) FORCE=true ;;
+ *) echo "Unknown parameter passed: $1"; exit 1 ;;
+ esac
+ shift
+done
+
+if { [ ! -f "$called_fn_dir/.cms_scanner" ] || [ "$FORCE" = true ]; } && [ "$CMS_SCANNER" = true ]; then
+ start_func "cms_scanner" "CMS Scanner"
+
+ mkdir -p $dir/cms && rm -rf $dir/cms/*
+ anew -q .tmp/webs_all.txt < <(cat webs/webs.txt webs/webs_uncommon_ports.txt 2>/dev/null)
+
+ if [ -s ".tmp/webs_all.txt" ]; then
+ tr '\n' ',' < .tmp/webs_all.txt > .tmp/cms.txt
+ timeout -k 1m ${CMSSCAN_TIMEOUT}s python3 $tools/CMSeeK/cmseek.py -l .tmp/cms.txt --batch -r 2>>"$LOGFILE" &>/dev/null
+ exit_status=$?
+ if [[ $exit_status -eq 125 ]]; then
+ echo "TIMEOUT cmseek.py - investigate manually for $dir" >> "$LOGFILE"
+ end_func "TIMEOUT cmseek.py - investigate manually for $dir" "cms_scanner"
+ exit 1
+ elif [[ $exit_status -ne 0 ]]; then
+ echo "ERROR cmseek.py - investigate manually for $dir" >> "$LOGFILE"
+ end_func "ERROR cmseek.py - investigate manually for $dir" "cms_scanner"
+ exit 1
+ fi
+ while read -r sub; do
+ sub_out=$(echo "$sub" | sed -e 's|^[^/]*//||' -e 's|/.*$||')
+ cms_id=$(jq -r 'try .cms_id' "$tools/CMSeeK/Result/${sub_out}/cms.json" 2>/dev/null)
+ if [ -z "$cms_id" ]; then
+ rm -rf "$tools/CMSeeK/Result/${sub_out}"
+ else
+ mv -f "$tools/CMSeeK/Result/${sub_out}" $dir/cms/ 2>>"$LOGFILE"
+ fi
+ done < .tmp/webs_all.txt
+
+ end_func "Results are saved in $domain/cms/*subdomain* folder" "cms_scanner"
+ else
+ end_func "No $domain/web/webs.txts file found, cms scanner skipped" "cms_scanner"
+ fi
+else
+ if [ "$CMS_SCANNER" = false ]; then
+ printf "\n${yellow} cms_scanner skipped in this mode or defined in reconftw.cfg ${reset}\n"
+ else
+ printf "${yellow} cms_scanner is already processed. To force executing cms_scanner, delete\n $called_fn_dir/.cms_scanner ${reset}\n\n"
+ fi
+fi
diff --git a/bin/rftw_web_fuzz b/bin/rftw_web_fuzz
new file mode 100755
index 0000000..39ddb39
--- /dev/null
+++ b/bin/rftw_web_fuzz
@@ -0,0 +1,92 @@
+#!/bin/bash
+
+# Load environment variables from reconftw.cfg
+# Load environment variables
+if [ -f "reconftw.cfg" ]; then
+ source reconftw.cfg
+else
+ echo "Error: reconftw.cfg not found!"
+ exit 1
+fi
+
+# Help function
+help_menu() {
+ echo "Usage: $0 [OPTIONS]"
+ echo ""
+ echo "Web Directory Fuzzing"
+ echo ""
+ echo "Options:"
+ echo " -h, --help Show this help menu"
+ echo " -f, --force Force the execution even if already processed"
+}
+
+# Start function
+start_func() {
+ echo "Starting $1: $2..."
+}
+
+# End function
+end_func() {
+ echo "$1"
+ echo "End of $2..."
+}
+
+# Default values
+FORCE=false
+
+# Parse arguments
+while [[ "$#" -gt 0 ]]; do
+ case $1 in
+ -h|--help) help_menu; exit 0 ;;
+ -f|--force) FORCE=true ;;
+ *) echo "Unknown parameter passed: $1"; exit 1 ;;
+ esac
+ shift
+done
+
+if { [ ! -f "$called_fn_dir/.fuzz" ] || [ "$FORCE" = true ]; } && [ "$FUZZ" = true ]; then
+ start_func "fuzz" "Web directory fuzzing"
+
+ anew -q .tmp/webs_all.txt < <(cat webs/webs.txt webs/webs_uncommon_ports.txt 2>/dev/null)
+
+ if [ -s ".tmp/webs_all.txt" ]; then
+ mkdir -p $dir/fuzzing $dir/.tmp/fuzzing
+
+ if [ ! "$AXIOM" = true ]; then
+ interlace -tL .tmp/webs_all.txt -threads ${INTERLACE_THREADS} -c "ffuf ${FFUF_FLAGS} -t ${FFUF_THREADS} -rate ${FFUF_RATELIMIT} -H \"${HEADER}\" -w ${fuzz_wordlist} -maxtime ${FFUF_MAXTIME} -u _target_/FUZZ -o _output_/_cleantarget_.json" -o $dir/.tmp/fuzzing 2>>"$LOGFILE" >/dev/null
+
+ while read -r sub; do
+ sub_out=$(echo "$sub" | sed -e 's|^[^/]*//||' -e 's|/.*$||')
+ if [ -s "$dir/.tmp/fuzzing/${sub_out}.json" ]; then
+ jq -r 'try .results[] | "\(.status) \(.length) \(.url)"' < "$dir/.tmp/fuzzing/${sub_out}.json" | sort -k1 | anew -q $dir/fuzzing/${sub_out}.txt
+ fi
+ done < .tmp/webs_all.txt
+
+ sort -k1 < <(find $dir/fuzzing/ -type f -iname "*.txt" -exec cat {} + 2>>"$LOGFILE") | anew -q $dir/fuzzing/fuzzing_full.txt
+ else
+ axiom-exec "mkdir -p /home/op/lists/seclists/Discovery/Web-Content/" &>/dev/null
+ axiom-exec "wget -q -O - ${fuzzing_remote_list} > /home/op/lists/fuzz_wordlist.txt" &>/dev/null
+ axiom-exec "wget -q -O - ${fuzzing_remote_list} > /home/op/lists/seclists/Discovery/Web-Content/big.txt" &>/dev/null
+ axiom-scan .tmp/webs_all.txt -m ffuf_base -H "${HEADER}" $FFUF_FLAGS -s -maxtime $FFUF_MAXTIME -o $dir/.tmp/ffuf-content.json $AXIOM_EXTRA_ARGS 2>>"$LOGFILE" >/dev/null
+
+ while read -r sub; do
+ sub_out=$(echo "$sub" | sed -e 's|^[^/]*//||' -e 's|/.*$||')
+ if [ -s "$dir/.tmp/ffuf-content.json" ]; then
+ grep "$sub" < <(jq -r 'try .results[] | "\(.status) \(.length) \(.url)"' .tmp/ffuf-content.json) | sort -k1 | anew -q fuzzing/${sub_out}.txt
+ fi
+ done < .tmp/webs_all.txt
+
+ sort -k1 < <(find $dir/fuzzing/ -type f -iname "*.txt" -exec cat {} + 2>>"$LOGFILE") | anew -q $dir/fuzzing/fuzzing_full.txt
+ fi
+
+ end_func "Results are saved in $domain/fuzzing/*subdomain*.txt" "fuzz"
+ else
+ end_func "No $domain/web/webs.txts file found, fuzzing skipped " "fuzz"
+ fi
+else
+ if [ "$FUZZ" = false ]; then
+ printf "\n${yellow} fuzz skipped in this mode or defined in reconftw.cfg ${reset}\n"
+ else
+ printf "${yellow} fuzz is already processed. To force executing fuzz, delete\n $called_fn_dir/.fuzz ${reset}\n\n"
+ fi
+fi
diff --git a/bin/rftw_web_jschecks b/bin/rftw_web_jschecks
new file mode 100755
index 0000000..001cc6a
--- /dev/null
+++ b/bin/rftw_web_jschecks
@@ -0,0 +1,98 @@
+#!/bin/bash
+
+# Load environment variables from reconftw.cfg
+# Load environment variables
+if [ -f "reconftw.cfg" ]; then
+ source reconftw.cfg
+else
+ echo "Error: reconftw.cfg not found!"
+ exit 1
+fi
+
+# Help menu
+help_menu() {
+ echo "Usage: $0 [OPTIONS]"
+ echo "Perform Javascript Checks"
+ echo ""
+ echo "Options:"
+ echo " -d, --domain DOMAIN Set domain (required)"
+ echo " -h, --help Display this help message and exit"
+ exit 0
+}
+
+# Input validation
+if [ $# -eq 0 ]; then
+ help_menu
+fi
+
+DOMAIN=""
+while [ "$1" != "" ]; do
+ case $1 in
+ -d | --domain ) shift
+ DOMAIN=$1
+ ;;
+ -h | --help ) help_menu
+ exit
+ ;;
+ * ) echo "Unknown option: $1"
+ exit 1
+ esac
+ shift
+done
+
+if [ -z "$DOMAIN" ]; then
+ echo "Error: Domain is required!"
+ exit 1
+fi
+
+jschecks() {
+ local domain=$1
+
+ if { [ ! -f "$called_fn_dir/.${FUNCNAME[0]}" ] || [ "$DIFF" = true ]; } && [ "$JSCHECKS" = true ]; then
+ start_func ${FUNCNAME[0]} "Javascript Scan"
+ if [ -s ".tmp/url_extract_js.txt" ]; then
+ printf "${yellow} Running : Fetching Urls 1/5${reset}\n"
+ if [ ! "$AXIOM" = true ]; then
+ cat .tmp/url_extract_js.txt | subjs -ua "Mozilla/5.0 (X11; Linux x86_64; rv:72.0) Gecko/20100101 Firefox/72.0" -c 40 | grep "$domain" | anew -q .tmp/subjslinks.txt
+ else
+ axiom-scan .tmp/url_extract_js.txt -m subjs -o .tmp/subjslinks.txt $AXIOM_EXTRA_ARGS 2>>"$LOGFILE" >/dev/null
+ fi
+ [ -s ".tmp/subjslinks.txt" ] && cat .tmp/subjslinks.txt | egrep -iv "\.(eot|jpg|jpeg|gif|css|tif|tiff|png|ttf|otf|woff|woff2|ico|pdf|svg|txt|js)" | anew -q js/nojs_links.txt
+ [ -s ".tmp/subjslinks.txt" ] && cat .tmp/subjslinks.txt | grep -iE "\.js($|\?)" | anew -q .tmp/url_extract_js.txt
+ cat .tmp/url_extract_js.txt | python3 $tools/urless/urless/urless.py | anew -q js/url_extract_js.txt 2>>"$LOGFILE" >/dev/null
+ printf "${yellow} Running : Resolving JS Urls 2/5${reset}\n"
+ if [ ! "$AXIOM" = true ]; then
+ [ -s "js/url_extract_js.txt" ] && cat js/url_extract_js.txt | httpx -follow-redirects -random-agent -silent -timeout $HTTPX_TIMEOUT -threads $HTTPX_THREADS -rl $HTTPX_RATELIMIT -status-code -content-type -retries 2 -no-color | grep "[200]" | grep "javascript" | cut -d ' ' -f1 | anew -q js/js_livelinks.txt
+ else
+ [ -s "js/url_extract_js.txt" ] && 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
+ [ -s ".tmp/js_livelinks.txt" ] && cat .tmp/js_livelinks.txt | anew .tmp/web_full_info.txt | grep "[200]" | grep "javascript" | cut -d ' ' -f1 | anew -q js/js_livelinks.txt
+ fi
+ printf "${yellow} Running : Gathering endpoints 3/5${reset}\n"
+ [ -s "js/js_livelinks.txt" ] && python3 $tools/xnLinkFinder/xnLinkFinder.py -i js/js_livelinks.txt -sf subdomains/subdomains.txt -d $XNLINKFINDER_DEPTH -o .tmp/js_endpoints.txt 2>>"$LOGFILE" >/dev/null
+ [ -s "parameters.txt" ] && rm -f parameters.txt 2>>"$LOGFILE" >/dev/null
+ if [ -s ".tmp/js_endpoints.txt" ]; then
+ sed -i '/^\//!d' .tmp/js_endpoints.txt
+ cat .tmp/js_endpoints.txt | anew -q js/js_endpoints.txt
+ fi
+ printf "${yellow} Running : Gathering secrets 4/5${reset}\n"
+ if [ ! "$AXIOM" = true ]; then
+ [ -s "js/js_livelinks.txt" ] && cat js/js_livelinks.txt | Mantra -ua ${HEADER} -s | anew -q js/js_secrets.txt
+ else
+ [ -s "js/js_livelinks.txt" ] && axiom-scan js/js_livelinks.txt -m mantra -ua ${HEADER} -s -o js/js_secrets.txt $AXIOM_EXTRA_ARGS &>/dev/null
+ fi
+ [ -s "js/js_secrets.txt" ] && sed -r "s/\x1B\[([0-9]{1,3}(;[0-9]{1,2};?)?)?[mGK]//g" -i js/js_secrets.txt
+ printf "${yellow} Running : Building wordlist 5/5${reset}\n"
+ [ -s "js/js_livelinks.txt" ] && interlace -tL js/js_livelinks.txt -threads ${INTERLACE_THREADS} -c "python3 $tools/getjswords.py '_target_' | anew -q webs/dict_words.txt" 2>>"$LOGFILE" >/dev/null
+ else
+ end_func "No JS urls found for $domain, function skipped" ${FUNCNAME[0]}
+ fi
+ else
+ if [ "$JSCHECKS" = false ]; then
+ printf "\n${yellow} ${FUNCNAME[0]} skipped in this mode or defined in reconftw.cfg ${reset}\n"
+ else
+ printf "${yellow} ${FUNCNAME[0]} is already processed, to force executing ${FUNCNAME[0]} delete\n $called_fn_dir/.${FUNCNAME[0]} ${reset}\n\n"
+ fi
+ fi
+}
+
+jschecks $DOMAIN
diff --git a/bin/rftw_web_nucleicheck b/bin/rftw_web_nucleicheck
new file mode 100755
index 0000000..463bf60
--- /dev/null
+++ b/bin/rftw_web_nucleicheck
@@ -0,0 +1,82 @@
+#!/bin/bash
+
+# Load environment variables from reconftw.cfg
+# Load environment variables
+if [ -f "reconftw.cfg" ]; then
+ source reconftw.cfg
+else
+ echo "Error: reconftw.cfg not found!"
+ exit 1
+fi
+
+# Help function
+help_menu() {
+ echo "Usage: $0 [OPTIONS]"
+ echo ""
+ echo "Templates Based Web Scanner"
+ echo ""
+ echo "Options:"
+ echo " -h, --help Show this help menu"
+ echo " -f, --force Force the execution even if already processed"
+}
+
+# Start function
+start_func() {
+ echo "Starting $1: $2..."
+}
+
+# End function
+end_func() {
+ echo "$1"
+ echo "End of $2..."
+}
+
+# Default values
+FORCE=false
+
+# Parse arguments
+while [[ "$#" -gt 0 ]]; do
+ case $1 in
+ -h|--help) help_menu; exit 0 ;;
+ -f|--force) FORCE=true ;;
+ *) echo "Unknown parameter passed: $1"; exit 1 ;;
+ esac
+ shift
+done
+
+if { [ ! -f "$called_fn_dir/.nuclei_check" ] || [ "$FORCE" = true ]; } && [ "$NUCLEICHECK" = true ]; then
+ start_func "nuclei_check" "Templates based web scanner"
+ nuclei -update 2>>"$LOGFILE" >/dev/null
+ mkdir -p nuclei_output
+
+ anew -q .tmp/webs_all.txt < <(cat webs/webs.txt webs/webs_uncommon_ports.txt 2>/dev/null)
+ anew -q .tmp/webs_subs.txt < <(cat subdomains/subdomains.txt .tmp/webs_all.txt 2>>"$LOGFILE")
+
+ if [ ! "$AXIOM" = true ]; then
+ IFS=',' read -ra severity_array <<< "$NUCLEI_SEVERITY"
+ for crit in "${severity_array[@]}"
+ do
+ printf "${yellow}\n Running : Nuclei $crit ${reset}\n\n"
+ nuclei $NUCLEI_FLAGS -severity $crit -nh -rl $NUCLEI_RATELIMIT -o nuclei_output/${crit}.txt < .tmp/webs_subs.txt
+ done
+ printf "\n\n"
+ else
+ if [ -s ".tmp/webs_subs.txt" ]; then
+ IFS=',' read -ra severity_array <<< "$NUCLEI_SEVERITY"
+ for crit in "${severity_array[@]}"
+ do
+ printf "${yellow}\n Running : Nuclei $crit, check results on nuclei_output folder${reset}\n\n"
+ axiom-scan .tmp/webs_subs.txt -m nuclei --nuclei-templates ${NUCLEI_TEMPLATES_PATH} -severity ${crit} -nh -rl $NUCLEI_RATELIMIT -o nuclei_output/${crit}.txt $AXIOM_EXTRA_ARGS 2>>"$LOGFILE" >/dev/null
+ [ -s "nuclei_output/${crit}.txt" ] && cat nuclei_output/${crit}.txt
+ done
+ printf "\n\n"
+ fi
+ fi
+ end_func "Results are saved in $domain/nuclei_output folder" "nuclei_check"
+else
+ if [ "$NUCLEICHECK" = false ]; then
+ printf "\n${yellow} nuclei_check skipped in this mode or defined in reconftw.cfg ${reset}\n"
+ else
+ printf "${yellow} nuclei_check is already processed. To force executing nuclei_check, delete\n $called_fn_dir/.nuclei_check ${reset}\n\n"
+ fi
+fi
diff --git a/bin/rftw_web_passdict b/bin/rftw_web_passdict
new file mode 100755
index 0000000..1a7a749
--- /dev/null
+++ b/bin/rftw_web_passdict
@@ -0,0 +1,67 @@
+#!/bin/bash
+
+# Load environment variables from reconftw.cfg
+# Load environment variables
+if [ -f "reconftw.cfg" ]; then
+ source reconftw.cfg
+else
+ echo "Error: reconftw.cfg not found!"
+ exit 1
+fi
+
+# Help menu
+help_menu() {
+ echo "Usage: $0 [OPTIONS]"
+ echo "Password Dictionary Generation using pydictor"
+ echo ""
+ echo "Options:"
+ echo " -d, --domain DOMAIN Set domain (required)"
+ echo " -h, --help Display this help message and exit"
+ exit 0
+}
+
+# Input validation
+if [ $# -eq 0 ]; then
+ help_menu
+fi
+
+DOMAIN=""
+while [ "$1" != "" ]; do
+ case $1 in
+ -d | --domain ) shift
+ DOMAIN=$1
+ ;;
+ -h | --help ) help_menu
+ exit
+ ;;
+ * ) echo "Unknown option: $1"
+ exit 1
+ esac
+ shift
+done
+
+if [ -z "$DOMAIN" ]; then
+ echo "Error: Domain is required!"
+ exit 1
+fi
+
+password_dict() {
+ local domain=$1
+
+ if { [ ! -f "$called_fn_dir/.${FUNCNAME[0]}" ] || [ "$DIFF" = true ]; } && [ "$PASSWORD_DICT" = true ]; then
+ start_func ${FUNCNAME[0]} "Password dictionary generation"
+
+ local word=${domain%%.*}
+ python3 $tools/pydictor/pydictor.py -extend $word --leet 0 1 2 11 21 --len ${PASSWORD_MIN_LENGTH} ${PASSWORD_MAX_LENGTH} -o webs/password_dict.txt 2>>"$LOGFILE" >/dev/null
+
+ end_func "Results are saved in $domain/webs/password_dict.txt" ${FUNCNAME[0]}
+ else
+ if [ "$PASSWORD_DICT" = false ]; then
+ printf "\n${yellow} ${FUNCNAME[0]} skipped in this mode or defined in reconftw.cfg ${reset}\n"
+ else
+ printf "${yellow} ${FUNCNAME[0]} is already processed, to force executing ${FUNCNAME[0]} delete\n $called_fn_dir/.${FUNCNAME[0]} ${reset}\n\n"
+ fi
+ fi
+}
+
+password_dict $DOMAIN
diff --git a/bin/rftw_web_probecommon b/bin/rftw_web_probecommon
new file mode 100755
index 0000000..934f86a
--- /dev/null
+++ b/bin/rftw_web_probecommon
@@ -0,0 +1,70 @@
+#!/bin/bash
+
+# Load environment variables from reconftw.cfg
+# Load environment variables
+if [ -f "reconftw.cfg" ]; then
+ source reconftw.cfg
+else
+ echo "Error: reconftw.cfg not found!"
+ exit 1
+fi
+
+help_menu() {
+ echo "Usage: $0 [DOMAIN] [OPTIONS]"
+ echo "Web probing tool for specified domain."
+ echo
+ echo "Options:"
+ echo " -h, --help Display this help menu and exit"
+ echo " -f, --force Force the execution even if it was already processed"
+}
+
+validate_inputs() {
+ if [[ -z "$domain" ]]; then
+ echo -e "${yellow} No domain provided! ${reset}"
+ exit 1
+ fi
+
+ if [ "$WEBPROBESIMPLE" != true ] && [ "$FORCE_EXECUTION" != true ]; then
+ echo -e "${yellow} webprobe_simple skipped in this mode or defined in reconftw.cfg ${reset}"
+ exit 0
+ fi
+}
+
+run_webprobe_simple() {
+ start_subfunc "webprobe_simple" "Running : Http probing $domain"
+ if [ ! "$AXIOM" = true ]; then
+ cat subdomains/subdomains.txt | httpx ${HTTPX_FLAGS} -no-color -json -random-agent -threads $HTTPX_THREADS -rl $HTTPX_RATELIMIT -retries 2 -timeout $HTTPX_TIMEOUT -o .tmp/web_full_info_probe.txt 2>>"$LOGFILE" >/dev/null
+ else
+ axiom-scan subdomains/subdomains.txt -m httpx ${HTTPX_FLAGS} -no-color -json -random-agent -threads $HTTPX_THREADS -rl $HTTPX_RATELIMIT -retries 2 -timeout $HTTPX_TIMEOUT -o .tmp/web_full_info_probe.txt $AXIOM_EXTRA_ARGS 2>>"$LOGFILE" >/dev/null
+ fi
+
+ cat .tmp/web_full_info.txt .tmp/web_full_info_probe.txt webs/web_full_info.txt 2>>"$LOGFILE" | jq -s 'try .' | jq 'try unique_by(.input)' | jq 'try .[]' 2>>"$LOGFILE" > webs/web_full_info.txt
+ [ -s "webs/web_full_info.txt" ] && cat webs/web_full_info.txt | jq -r 'try .url' 2>/dev/null | grep "$domain" | sed "s/*.//" | anew -q .tmp/probed_tmp.txt
+ [ -s "webs/web_full_info.txt" ] && cat webs/web_full_info.txt | jq -r 'try . |"\(.url) [\(.status_code)] [\(.title)] [\(.webserver)] \(.tech)"' | grep "$domain" | anew -q webs/web_full_info_plain.txt
+ [ -s "$outOfScope_file" ] && deleteOutScoped $outOfScope_file .tmp/probed_tmp.txt
+ NUMOFLINES=$(cat .tmp/probed_tmp.txt 2>>"$LOGFILE" | anew webs/webs.txt | sed '/^$/d' | wc -l)
+ cat webs/webs.txt webs/webs_uncommon_ports.txt 2>/dev/null | anew -q .tmp/webs_all.txt
+ end_subfunc "${NUMOFLINES} new websites resolved" "webprobe_simple"
+
+ if [ "$PROXY" = true ] && [ -n "$proxy_url" ] && [[ $(cat webs/webs.txt| wc -l) -le $DEEP_LIMIT2 ]]; then
+ notification "Sending websites to proxy" info
+ ffuf -mc all -w webs/webs.txt -u FUZZ -replay-proxy $proxy_url 2>>"$LOGFILE" >/dev/null
+ fi
+}
+
+# Main
+FORCE_EXECUTION=false
+domain="$1"
+
+shift
+while [[ "$#" -gt 0 ]]; do
+ case $1 in
+ -h|--help) help_menu; exit 0 ;;
+ -f|--force) FORCE_EXECUTION=true; shift ;;
+ *) echo "Unknown parameter passed: $1"; exit 1 ;;
+ esac
+ shift
+done
+
+validate_inputs
+run_webprobe_simple
\ No newline at end of file
diff --git a/bin/rftw_web_probeuncommon b/bin/rftw_web_probeuncommon
new file mode 100755
index 0000000..3e1e936
--- /dev/null
+++ b/bin/rftw_web_probeuncommon
@@ -0,0 +1,81 @@
+#!/bin/bash
+
+# Load environment variables from reconftw.cfg
+# Load environment variables
+if [ -f "reconftw.cfg" ]; then
+ source reconftw.cfg
+else
+ echo "Error: reconftw.cfg not found!"
+ exit 1
+fi
+
+help_menu() {
+ echo "Usage: $0 [DOMAIN] [OPTIONS]"
+ echo "Web probing tool for non-standard ports for the specified domain."
+ echo
+ echo "Options:"
+ echo " -h, --help Display this help menu and exit"
+ echo " -f, --force Force the execution even if it was already processed"
+}
+
+validate_inputs() {
+ if [[ -z "$domain" ]]; then
+ echo -e "${yellow} No domain provided! ${reset}"
+ exit 1
+ fi
+
+ if [ "$WEBPROBEFULL" != true ] && [ "$FORCE_EXECUTION" != true ]; then
+ echo -e "${yellow} webprobe_full skipped in this mode or defined in reconftw.cfg ${reset}"
+ exit 0
+ fi
+}
+
+run_webprobe_full() {
+ start_func "webprobe_full" "Http probing non-standard ports"
+ if [ -s "subdomains/subdomains.txt" ]; then
+ if [ ! "$AXIOM" = true ]; then
+ cat subdomains/subdomains.txt | httpx -follow-host-redirects -random-agent -status-code -p $UNCOMMON_PORTS_WEB -threads $HTTPX_UNCOMMONPORTS_THREADS -timeout $HTTPX_UNCOMMONPORTS_TIMEOUT -silent -retries 2 -title -web-server -tech-detect -location -no-color -json -o .tmp/web_full_info_uncommon.txt 2>>"$LOGFILE" >/dev/null
+ else
+ axiom-scan subdomains/subdomains.txt -m httpx -follow-host-redirects -H \"${HEADER}\" -status-code -p $UNCOMMON_PORTS_WEB -threads $HTTPX_UNCOMMONPORTS_THREADS -timeout $HTTPX_UNCOMMONPORTS_TIMEOUT -silent -retries 2 -title -web-server -tech-detect -location -no-color -json -o .tmp/web_full_info_uncommon.txt $AXIOM_EXTRA_ARGS 2>>"$LOGFILE" >/dev/null
+ fi
+ fi
+
+ if [ -s ".tmp/web_full_info_uncommon.txt" ]; then
+ cat .tmp/web_full_info_uncommon.txt | jq -r 'try .url' 2>/dev/null | grep "$domain" | sed "s/*.//" | anew -q .tmp/probed_uncommon_ports_tmp.txt
+ cat .tmp/web_full_info_uncommon.txt | jq -r 'try . |"\(.url) [\(.status_code)] [\(.title)] [\(.webserver)] \(.tech)"' | anew -q webs/web_full_info_uncommon_plain.txt
+
+ if [[ $domain =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9] ]]; then
+ cat .tmp/web_full_info_uncommon.txt 2>>"$LOGFILE" | anew -q webs/web_full_info_uncommon.txt
+ else
+ cat .tmp/web_full_info_uncommon.txt 2>>"$LOGFILE" | grep "$domain" | anew -q webs/web_full_info_uncommon.txt
+ fi
+ fi
+
+ NUMOFLINES=$(cat .tmp/probed_uncommon_ports_tmp.txt 2>>"$LOGFILE" | anew webs/webs_uncommon_ports.txt | sed '/^$/d' | wc -l)
+ notification "Uncommon web ports: ${NUMOFLINES} new websites" good
+ [ -s "webs/webs_uncommon_ports.txt" ] && cat webs/webs_uncommon_ports.txt
+ cat webs/webs.txt webs/webs_uncommon_ports.txt 2>/dev/null | anew -q .tmp/webs_all.txt
+ end_func "Results are saved in $domain/webs/webs_uncommon_ports.txt" "webprobe_full"
+
+ if [ "$PROXY" = true ] && [ -n "$proxy_url" ] && [[ $(cat webs/webs_uncommon_ports.txt| wc -l) -le $DEEP_LIMIT2 ]]; then
+ notification "Sending websites with uncommon ports to proxy" info
+ ffuf -mc all -w webs/webs_uncommon_ports.txt -u FUZZ -replay-proxy $proxy_url 2>>"$LOGFILE" >/dev/null
+ fi
+}
+
+# Main
+FORCE_EXECUTION=false
+domain="$1"
+
+shift
+while [[ "$#" -gt 0 ]]; do
+ case $1 in
+ -h|--help) help_menu; exit 0 ;;
+ -f|--force) FORCE_EXECUTION=true; shift ;;
+ *) echo "Unknown parameter passed: $1"; exit 1 ;;
+ esac
+ shift
+done
+
+validate_inputs
+run_webprobe_full
diff --git a/bin/rftw_web_roboxtractor b/bin/rftw_web_roboxtractor
new file mode 100755
index 0000000..ec5aa1c
--- /dev/null
+++ b/bin/rftw_web_roboxtractor
@@ -0,0 +1,69 @@
+#!/bin/bash
+
+# Load environment variables from reconftw.cfg
+# Load environment variables
+if [ -f "reconftw.cfg" ]; then
+ source reconftw.cfg
+else
+ echo "Error: reconftw.cfg not found!"
+ exit 1
+fi
+
+# Help menu
+help_menu() {
+ echo "Usage: $0 [OPTIONS]"
+ echo "Robots Wordlist Generation using roboxtractor"
+ echo ""
+ echo "Options:"
+ echo " -d, --domain DOMAIN Set domain (required)"
+ echo " -h, --help Display this help message and exit"
+ exit 0
+}
+
+# Input validation
+if [ $# -eq 0 ]; then
+ help_menu
+fi
+
+DOMAIN=""
+while [ "$1" != "" ]; do
+ case $1 in
+ -d | --domain ) shift
+ DOMAIN=$1
+ ;;
+ -h | --help ) help_menu
+ exit
+ ;;
+ * ) echo "Unknown option: $1"
+ exit 1
+ esac
+ shift
+done
+
+if [ -z "$DOMAIN" ]; then
+ echo "Error: Domain is required!"
+ exit 1
+fi
+
+wordlist_gen_roboxtractor() {
+ local domain=$1
+
+ if { [ ! -f "$called_fn_dir/.${FUNCNAME[0]}" ] || [ "$DIFF" = true ]; } && [ "$ROBOTSWORDLIST" = true ]; then
+ start_func ${FUNCNAME[0]} "Robots wordlist generation"
+
+ [ ! -s ".tmp/webs_all.txt" ] && cat webs/webs.txt webs/webs_uncommon_ports.txt 2>/dev/null | anew -q .tmp/webs_all.txt
+ if [ -s ".tmp/webs_all.txt" ]; then
+ cat .tmp/webs_all.txt | roboxtractor -m 1 -wb 2>/dev/null | anew -q webs/robots_wordlist.txt
+ fi
+
+ end_func "Results are saved in $domain/webs/robots_wordlist.txt" ${FUNCNAME[0]}
+ else
+ if [ "$ROBOTSWORDLIST" = false ]; then
+ printf "\n${yellow} ${FUNCNAME[0]} skipped in this mode or defined in reconftw.cfg ${reset}\n"
+ else
+ printf "${yellow} ${FUNCNAME[0]} is already processed, to force executing ${FUNCNAME[0]} delete\n $called_fn_dir/.${FUNCNAME[0]} ${reset}\n\n"
+ fi
+ fi
+}
+
+wordlist_gen_roboxtractor $DOMAIN
diff --git a/bin/rftw_web_screenshot b/bin/rftw_web_screenshot
new file mode 100755
index 0000000..81935df
--- /dev/null
+++ b/bin/rftw_web_screenshot
@@ -0,0 +1,65 @@
+#!/bin/bash
+
+# Load environment variables from reconftw.cfg
+# Load environment variables
+if [ -f "reconftw.cfg" ]; then
+ source reconftw.cfg
+else
+ echo "Error: reconftw.cfg not found!"
+ exit 1
+fi
+
+help_menu() {
+ echo "Usage: $0 [DOMAIN] [OPTIONS]"
+ echo "Web Screenshots tool for the specified domain."
+ echo
+ echo "Options:"
+ echo " -h, --help Display this help menu and exit"
+ echo " -f, --force Force the execution even if it was already processed"
+}
+
+validate_inputs() {
+ if [[ -z "$domain" ]]; then
+ echo -e "${yellow} No domain provided! ${reset}"
+ exit 1
+ fi
+
+ if [ "$WEBSCREENSHOT" != true ] && [ "$FORCE_EXECUTION" != true ]; then
+ echo -e "${yellow} screenshot skipped in this mode or defined in reconftw.cfg ${reset}"
+ exit 0
+ fi
+}
+
+run_screenshot() {
+ start_func "screenshot" "Web Screenshots"
+
+ [ ! -s ".tmp/webs_all.txt" ] && cat webs/webs.txt webs/webs_uncommon_ports.txt 2>/dev/null | anew -q .tmp/webs_all.txt
+
+ num_lines=$(wc -l < .tmp/webs_all.txt)
+ dynamic_gowitness_timeout=$(expr $num_lines \* $GOWITNESS_TIMEOUT_PER_SITE)
+
+ if [ ! "$AXIOM" = true ]; then
+ [ -s ".tmp/webs_all.txt" ] && timeout -k 1m ${dynamic_gowitness_timeout}s gowitness file -f .tmp/webs_all.txt -t $GOWITNESS_THREADS $GOWITNESS_FLAGS 2>>"$LOGFILE"
+ else
+ timeout -k 1m ${dynamic_gowitness_timeout}s axiom-scan .tmp/webs_all.txt -m gowitness -t $GOWITNESS_THREADS $GOWITNESS_FLAGS -o screenshots $AXIOM_EXTRA_ARGS 2>>"$LOGFILE" >/dev/null
+ fi
+
+ end_func "Results are saved in $domain/screenshots folder" "screenshot"
+}
+
+# Main
+FORCE_EXECUTION=false
+domain="$1"
+
+shift
+while [[ "$#" -gt 0 ]]; do
+ case $1 in
+ -h|--help) help_menu; exit 0 ;;
+ -f|--force) FORCE_EXECUTION=true; shift ;;
+ *) echo "Unknown parameter passed: $1"; exit 1 ;;
+ esac
+ shift
+done
+
+validate_inputs
+run_screenshot
diff --git a/bin/rftw_web_urlchecks b/bin/rftw_web_urlchecks
new file mode 100755
index 0000000..a83bb38
--- /dev/null
+++ b/bin/rftw_web_urlchecks
@@ -0,0 +1,133 @@
+#!/bin/bash
+
+# Load environment variables
+if [ -f "reconftw.cfg" ]; then
+ source reconftw.cfg
+else
+ echo "Error: reconftw.cfg not found!"
+ exit 1
+fi
+
+# Help menu function
+help_menu() {
+ echo "Usage: urlchecks.sh [OPTIONS]"
+ echo ""
+ echo "Options:"
+ echo " -d, --domain <domain> Specify the domain to scan."
+ echo " -h, --help Display this help menu."
+ echo ""
+ echo "Example:"
+ echo " urlchecks.sh -d example.com"
+}
+
+# Input validation function
+validate_input() {
+ if [ -z "$domain" ]; then
+ echo "Error: Domain not specified."
+ help_menu
+ exit 1
+ fi
+}
+
+# URL checks function
+urlchecks() {
+ if { [ ! -f "$called_fn_dir/.urlchecks" ] || [ "$DIFF" = true ]; } && [ "$URL_CHECK" = true ]; then
+ echo "[+] Starting URL Extraction"
+
+ mkdir -p js
+ [ ! -s ".tmp/webs_all.txt" ] && cat webs/webs.txt webs/webs_uncommon_ports.txt 2>/dev/null | anew -q .tmp/webs_all.txt
+ if [ -s ".tmp/webs_all.txt" ]; then
+ if [ ! "$AXIOM" = true ]; then
+ if [ "$URL_CHECK_PASSIVE" = true ]; then
+ if [ "$DEEP" = true ]; then
+ cat .tmp/webs_all.txt | unfurl -u domains > .tmp/waymore_input.txt
+ python3 ${tools}/waymore/waymore.py -i .tmp/waymore_input.txt -mode U -f -oU .tmp/url_extract_tmp.txt 2>>"$LOGFILE" >/dev/null
+ else
+ cat .tmp/webs_all.txt | gau --threads $GAU_THREADS | anew -q .tmp/url_extract_tmp.txt
+ fi
+ if [ -s "${GITHUB_TOKENS}" ]; then
+ github-endpoints -q -k -d $domain -t ${GITHUB_TOKENS} -o .tmp/github-endpoints.txt 2>>"$LOGFILE" >/dev/null
+ [ -s ".tmp/github-endpoints.txt" ] && cat .tmp/github-endpoints.txt | anew -q .tmp/url_extract_tmp.txt
+ fi
+ fi
+ diff_webs=$(diff <(sort -u .tmp/probed_tmp.txt 2>>"$LOGFILE") <(sort -u .tmp/webs_all.txt 2>>"$LOGFILE") | wc -l)
+ if [ $diff_webs != "0" ] || [ ! -s ".tmp/katana.txt" ]; then
+ if [ "$URL_CHECK_ACTIVE" = true ]; then
+ if [ "$DEEP" = true ]; then
+ katana -silent -list .tmp/webs_all.txt -jc -kf all -c $KATANA_THREADS -d 3 -fs rdn -o .tmp/katana.txt 2>>"$LOGFILE" >/dev/null
+ else
+ katana -silent -list .tmp/webs_all.txt -jc -kf all -c $KATANA_THREADS -d 2 -fs rdn -o .tmp/katana.txt 2>>"$LOGFILE" >/dev/null
+ fi
+ fi
+ fi
+ else
+ if [ "$URL_CHECK_PASSIVE" = true ]; then
+ if [ "$DEEP" = true ]; then
+ cat .tmp/webs_all.txt | unfurl -u domains > .tmp/waymore_input.txt
+ axiom-scan .tmp/waymore_input.txt -m waymore -o .tmp/url_extract_tmp.txt $AXIOM_EXTRA_ARGS 2>>"$LOGFILE" >/dev/null
+ else
+ axiom-scan .tmp/webs_all.txt -m gau -o .tmp/url_extract_tmp.txt $AXIOM_EXTRA_ARGS 2>>"$LOGFILE" >/dev/null
+ fi
+ if [ -s "${GITHUB_TOKENS}" ]; then
+ github-endpoints -q -k -d $domain -t ${GITHUB_TOKENS} -o .tmp/github-endpoints.txt 2>>"$LOGFILE" >/dev/null
+ [ -s ".tmp/github-endpoints.txt" ] && cat .tmp/github-endpoints.txt | anew -q .tmp/url_extract_tmp.txt
+ fi
+ fi
+ diff_webs=$(diff <(sort -u .tmp/probed_tmp.txt) <(sort -u .tmp/webs_all.txt) | wc -l)
+ if [ $diff_webs != "0" ] || [ ! -s ".tmp/katana.txt" ]; then
+ if [ "$URL_CHECK_ACTIVE" = true ]; then
+ if [ "$DEEP" = true ]; then
+ axiom-scan .tmp/webs_all.txt -m katana -jc -kf all -d 3 -fs rdn -fs rdn -o .tmp/katana.txt $AXIOM_EXTRA_ARGS 2>>"$LOGFILE" >/dev/null
+ else
+ axiom-scan .tmp/webs_all.txt -m katana -jc -kf all -d 2 -fs rdn -fs rdn -o .tmp/katana.txt $AXIOM_EXTRA_ARGS 2>>"$LOGFILE" >/dev/null
+ fi
+ fi
+ fi
+ fi
+ [ -s ".tmp/katana.txt" ] && sed -i '/^.\{2048\}./d' .tmp/katana.txt
+ [ -s ".tmp/katana.txt" ] && cat .tmp/katana.txt | anew -q .tmp/url_extract_tmp.txt
+ [ -s ".tmp/url_extract_tmp.txt" ] && cat .tmp/url_extract_tmp.txt | grep "${domain}" | grep -aEi "\.(js)" | anew -q .tmp/url_extract_js.txt
+ if [ "$DEEP" = true ]; then
+ [ -s ".tmp/url_extract_js.txt" ] && interlace -tL .tmp/url_extract_js.txt -threads 10 -c "python3 $tools/JSA/jsa.py -f target | anew -q .tmp/url_extract_tmp.txt" &>/dev/null
+ fi
+ [ -s ".tmp/url_extract_tmp.txt" ] && cat .tmp/url_extract_tmp.txt | grep "${domain}" | grep "=" | qsreplace -a 2>>"$LOGFILE" | grep -aEiv "\.(eot|jpg|jpeg|gif|css|tif|tiff|png|ttf|otf|woff|woff2|ico|pdf|svg|txt|js)$" | anew -q .tmp/url_extract_tmp2.txt
+ [ -s ".tmp/url_extract_tmp2.txt" ] && cat .tmp/url_extract_tmp2.txt | python3 $tools/urless/urless/urless.py | anew -q .tmp/url_extract_uddup.txt 2>>"$LOGFILE" >/dev/null
+ NUMOFLINES=$(cat .tmp/url_extract_uddup.txt 2>>"$LOGFILE" | anew webs/url_extract.txt | sed '/^$/d' | wc -l)
+ notification "${NUMOFLINES} new urls with params" info
+ end_func "Results are saved in $domain/webs/url_extract.txt" ${FUNCNAME[0]}
+ if [ "$PROXY" = true ] && [ -n "$proxy_url" ] && [[ $(cat webs/url_extract.txt | wc -l) -le $DEEP_LIMIT2 ]]; then
+ notification "Sending urls to proxy" info
+ ffuf -mc all -w webs/url_extract.txt -u FUZZ -replay-proxy $proxy_url 2>>"$LOGFILE" >/dev/null
+ fi
+ fi
+ else
+ if [ "$URL_CHECK" = false ]; then
+ echo "[!] URL checks skipped in this mode or defined in reconftw.cfg"
+ else
+ echo "[!] URL checks are already processed, to force executing delete $called_fn_dir/.urlchecks"
+ fi
+ fi
+}
+
+# Parse command-line arguments
+while [ "$#" -gt 0 ]; do
+ case "$1" in
+ -d|--domain)
+ domain="$2"
+ shift 2
+ ;;
+ -h|--help)
+ help_menu
+ exit 0
+ ;;
+ *)
+ echo "Unknown parameter: $1"
+ help_menu
+ exit 1
+ ;;
+ esac
+done
+
+# Validate input and start main function
+validate_input
+urlchecks
diff --git a/bin/rftw_web_urlext b/bin/rftw_web_urlext
new file mode 100755
index 0000000..620dab2
--- /dev/null
+++ b/bin/rftw_web_urlext
@@ -0,0 +1,97 @@
+#!/bin/bash
+
+# Load environment variables
+if [ -f "reconftw.cfg" ]; then
+ source reconftw.cfg
+else
+ echo "Error: reconftw.cfg not found!"
+ exit 1
+fi
+
+# Help menu function
+help_menu() {
+ echo "Usage: url_ext.sh [OPTIONS]"
+ echo ""
+ echo "Options:"
+ echo " -i, --input-file <file> Specify the input URL file for extraction."
+ echo " -o, --output-file <file> Specify the output file for URLs by extension."
+ echo " -h, --help Display this help menu."
+ echo ""
+ echo "Example:"
+ echo " url_ext.sh -i .tmp/url_extract_tmp.txt -o webs/urls_by_ext.txt"
+}
+
+# Input validation function
+validate_input() {
+ if [ -z "$input_file" ]; then
+ echo "Error: Input file not specified."
+ help_menu
+ exit 1
+ elif [ ! -f "$input_file" ]; then
+ echo "Error: Specified input file does not exist."
+ exit 1
+ fi
+
+ if [ -z "$output_file" ]; then
+ echo "Error: Output file not specified."
+ help_menu
+ exit 1
+ fi
+}
+
+# Extract URLs by extension function
+url_ext() {
+ if { [ ! -f "$called_fn_dir/.url_ext" ] || [ "$DIFF" = true ]; } && [ "$URL_EXT" = true ]; then
+ if [ -s "$input_file" ]; then
+ echo "[+] Extracting URLs by extension..."
+
+ ext=("7z" "achee" "action" "adr" "apk" "arj" "ascx" "asmx" "asp" "aspx" "axd" "backup" "bak" "bat" "bin" "bkf" "bkp" "bok" "cab" "cer" "cfg" "cfm" "cfml" "cgi" "cnf" "conf" "config" "cpl" "crt" "csr" "csv" "dat" "db" "dbf" "deb" "dmg" "dmp" "doc" "docx" "drv" "email" "eml" "emlx" "env" "exe" "gadget" "gz" "html" "ica" "inf" "ini" "iso" "jar" "java" "jhtml" "json" "jsp" "key" "log" "lst" "mai" "mbox" "mbx" "md" "mdb" "msg" "msi" "nsf" "ods" "oft" "old" "ora" "ost" "pac" "passwd" "pcf" "pdf" "pem" "pgp" "php" "php3" "php4" "php5" "phtm" "phtml" "pkg" "pl" "plist" "pst" "pwd" "py" "rar" "rb" "rdp" "reg" "rpm" "rtf" "sav" "sh" "shtm" "shtml" "skr" "sql" "swf" "sys" "tar" "tar.gz" "tmp" "toast" "tpl" "txt" "url" "vcd" "vcf" "wml" "wpd" "wsdl" "wsf" "xls" "xlsm" "xlsx" "xml" "xsd" "yaml" "yml" "z" "zip")
+
+ # Truncate or create the output file
+ echo "" > "$output_file"
+
+ for t in "${ext[@]}"; do
+ NUMOFLINES=$(grep -aEi "\.(${t})($|\/|\?)" "$input_file" | sort -u | sed '/^$/d' | wc -l)
+ if [[ $NUMOFLINES -gt 0 ]]; then
+ echo -e "\n############################\n + ${t} + \n############################\n" >> "$output_file"
+ grep -aEi "\.(${t})($|\/|\?)" "$input_file" >> "$output_file"
+ fi
+ done
+
+ echo "[+] Results are saved in $output_file"
+ fi
+ else
+ if [ "$URL_EXT" = false ]; then
+ echo "[!] URL_Ext skipped in this mode or defined in reconftw.cfg"
+ else
+ echo "[!] URL_Ext is already processed, to force executing delete $called_fn_dir/.url_ext"
+ fi
+ fi
+}
+
+# Parse command-line arguments
+while [ "$#" -gt 0 ]; do
+ case "$1" in
+ -i|--input-file)
+ input_file="$2"
+ shift 2
+ ;;
+ -o|--output-file)
+ output_file="$2"
+ shift 2
+ ;;
+ -h|--help)
+ help_menu
+ exit 0
+ ;;
+ *)
+ echo "Unknown parameter: $1"
+ help_menu
+ exit 1
+ ;;
+ esac
+done
+
+# Validate input and start the main function
+validate_input
+url_ext
diff --git a/bin/rftw_web_urlgf b/bin/rftw_web_urlgf
new file mode 100755
index 0000000..d2f002e
--- /dev/null
+++ b/bin/rftw_web_urlgf
@@ -0,0 +1,84 @@
+#!/bin/bash
+
+# Load environment variables
+if [ -f "reconftw.cfg" ]; then
+ source reconftw.cfg
+else
+ echo "Error: reconftw.cfg not found!"
+ exit 1
+fi
+
+# Help menu function
+help_menu() {
+ echo "Usage: url_gf.sh [OPTIONS]"
+ echo ""
+ echo "Options:"
+ echo " -u, --url-file <file> Specify the URL file to scan."
+ echo " -h, --help Display this help menu."
+ echo ""
+ echo "Example:"
+ echo " url_gf.sh -u webs/url_extract.txt"
+}
+
+# Input validation function
+validate_input() {
+ if [ -z "$url_file" ]; then
+ echo "Error: URL file not specified."
+ help_menu
+ exit 1
+ elif [ ! -f "$url_file" ]; then
+ echo "Error: Specified URL file does not exist."
+ exit 1
+ fi
+}
+
+# Vulnerable pattern search function
+url_gf() {
+ if { [ ! -f "$called_fn_dir/.url_gf" ] || [ "$DIFF" = true ]; } && [ "$URL_GF" = true ]; then
+ echo "[+] Starting Vulnerable Pattern Search"
+
+ mkdir -p gf
+ if [ -s "$url_file" ]; then
+ gf xss "$url_file" | anew -q gf/xss.txt
+ gf ssti "$url_file" | anew -q gf/ssti.txt
+ gf ssrf "$url_file" | anew -q gf/ssrf.txt
+ gf sqli "$url_file" | anew -q gf/sqli.txt
+ gf redirect "$url_file" | anew -q gf/redirect.txt
+ [ -s "gf/ssrf.txt" ] && cat gf/ssrf.txt | anew -q gf/redirect.txt
+ gf rce "$url_file" | anew -q gf/rce.txt
+ gf potential "$url_file" | cut -d ':' -f3-5 | anew -q gf/potential.txt
+ [ -s ".tmp/url_extract_tmp.txt" ] && cat .tmp/url_extract_tmp.txt | grep -aEiv "\.(eot|jpg|jpeg|gif|css|tif|tiff|png|ttf|otf|woff|woff2|ico|pdf|svg|txt|js)$" | unfurl -u format %s://%d%p 2>>"$LOGFILE" | anew -q gf/endpoints.txt
+ gf lfi "$url_file" | anew -q gf/lfi.txt
+ fi
+ echo "[+] Results are saved in $domain/gf folder"
+ else
+ if [ "$URL_GF" = false ]; then
+ echo "[!] URL_Gf skipped in this mode or defined in reconftw.cfg"
+ else
+ echo "[!] URL_Gf is already processed, to force executing delete $called_fn_dir/.url_gf"
+ fi
+ fi
+}
+
+# Parse command-line arguments
+while [ "$#" -gt 0 ]; do
+ case "$1" in
+ -u|--url-file)
+ url_file="$2"
+ shift 2
+ ;;
+ -h|--help)
+ help_menu
+ exit 0
+ ;;
+ *)
+ echo "Unknown parameter: $1"
+ help_menu
+ exit 1
+ ;;
+ esac
+done
+
+# Validate input and start main function
+validate_input
+url_gf
diff --git a/bin/rftw_web_wafcheck b/bin/rftw_web_wafcheck
new file mode 100755
index 0000000..3ae55f0
--- /dev/null
+++ b/bin/rftw_web_wafcheck
@@ -0,0 +1,82 @@
+#!/bin/bash
+
+# Load environment variables
+if [ -f "reconftw.cfg" ]; then
+ source reconftw.cfg
+else
+ echo "Error: reconftw.cfg not found!"
+ exit 1
+fi
+
+# Help function
+help_menu() {
+ echo "Usage: $0 [OPTIONS]"
+ echo ""
+ echo "Website's WAF Detection Tool"
+ echo ""
+ echo "Options:"
+ echo " -h, --help Show this help menu"
+ echo " -f, --force Force the execution even if already processed"
+}
+
+# Start function
+start_func() {
+ echo "Starting $1: $2..."
+}
+
+# End function
+end_func() {
+ echo "$1"
+ echo "End of $2..."
+}
+
+# Notification function
+notification() {
+ echo "$1"
+}
+
+# Default values
+FORCE=false
+
+# Parse arguments
+while [[ "$#" -gt 0 ]]; do
+ case $1 in
+ -h|--help) help_menu; exit 0 ;;
+ -f|--force) FORCE=true ;;
+ *) echo "Unknown parameter passed: $1"; exit 1 ;;
+ esac
+ shift
+done
+
+if { [ ! -f "$called_fn_dir/.waf_checks" ] || [ "$FORCE" = true ]; } && [ "$WAF_DETECTION" = true ]; then
+ start_func "waf_checks" "Website's WAF detection"
+
+ if [ ! -s ".tmp/webs_all.txt" ]; then
+ anew -q .tmp/webs_all.txt < <(cat webs/webs.txt webs/webs_uncommon_ports.txt 2>/dev/null)
+ fi
+
+ if [ -s ".tmp/webs_all.txt" ]; then
+ if [ ! "$AXIOM" = true ]; then
+ wafw00f -i .tmp/webs_all.txt -o .tmp/wafs.txt 2>>"$LOGFILE" >/dev/null
+ else
+ axiom-scan .tmp/webs_all.txt -m wafw00f -o .tmp/wafs.txt $AXIOM_EXTRA_ARGS 2>>"$LOGFILE" >/dev/null
+ fi
+
+ if [ -s ".tmp/wafs.txt" ]; then
+ sed -e 's/^[ \t]*//' -e 's/ \+ /\t/g' -e '/(None)/d' .tmp/wafs.txt | tr -s "\t" ";" > webs/webs_wafs.txt
+ NUMOFLINES=$(sed '/^$/d' webs/webs_wafs.txt 2>>"$LOGFILE" | wc -l)
+ notification "${NUMOFLINES} websites protected by waf" info
+ end_func "Results are saved in $domain/webs/webs_wafs.txt" "waf_checks"
+ else
+ end_func "No results found" "waf_checks"
+ fi
+ else
+ end_func "No websites to scan" "waf_checks"
+ fi
+else
+ if [ "$WAF_DETECTION" = false ]; then
+ printf "\n${yellow} waf_checks skipped in this mode or defined in reconftw.cfg ${reset}\n"
+ else
+ printf "${yellow} waf_checks is already processed. To force executing waf_checks, delete\n $called_fn_dir/.waf_checks ${reset}\n\n"
+ fi
+fi
diff --git a/bin/rftw_web_wordlists b/bin/rftw_web_wordlists
new file mode 100755
index 0000000..234a505
--- /dev/null
+++ b/bin/rftw_web_wordlists
@@ -0,0 +1,73 @@
+#!/bin/bash
+
+# Load environment variables from reconftw.cfg
+# Load environment variables
+if [ -f "reconftw.cfg" ]; then
+ source reconftw.cfg
+else
+ echo "Error: reconftw.cfg not found!"
+ exit 1
+fi
+
+# Help menu
+help_menu() {
+ echo "Usage: $0 [OPTIONS]"
+ echo "Wordlist Generation"
+ echo ""
+ echo "Options:"
+ echo " -d, --domain DOMAIN Set domain (required)"
+ echo " -h, --help Display this help message and exit"
+ exit 0
+}
+
+# Input validation
+if [ $# -eq 0 ]; then
+ help_menu
+fi
+
+DOMAIN=""
+while [ "$1" != "" ]; do
+ case $1 in
+ -d | --domain ) shift
+ DOMAIN=$1
+ ;;
+ -h | --help ) help_menu
+ exit
+ ;;
+ * ) echo "Unknown option: $1"
+ exit 1
+ esac
+ shift
+done
+
+if [ -z "$DOMAIN" ]; then
+ echo "Error: Domain is required!"
+ exit 1
+fi
+
+wordlist_gen() {
+ local domain=$1
+ if { [ ! -f "$called_fn_dir/.${FUNCNAME[0]}" ] || [ "$DIFF" = true ]; } && [ "$WORDLIST" = true ]; then
+ start_func ${FUNCNAME[0]} "Wordlist generation"
+ if [ -s ".tmp/url_extract_tmp.txt" ]; then
+ cat .tmp/url_extract_tmp.txt | unfurl -u keys 2>>"$LOGFILE" | sed 's/[][]//g' | sed 's/[#]//g' | sed 's/[}{]//g' | anew -q webs/dict_params.txt
+ cat .tmp/url_extract_tmp.txt | unfurl -u values 2>>"$LOGFILE" | sed 's/[][]//g' | sed 's/[#]//g' | sed 's/[}{]//g' | anew -q webs/dict_values.txt
+ cat .tmp/url_extract_tmp.txt | tr "[:punct:]" "\n" | anew -q webs/dict_words.txt
+ fi
+ [ -s ".tmp/js_endpoints.txt" ] && cat .tmp/js_endpoints.txt | unfurl -u format %s://%d%p 2>>"$LOGFILE" | anew -q webs/all_paths.txt
+ [ -s ".tmp/url_extract_tmp.txt" ] && cat .tmp/url_extract_tmp.txt | unfurl -u format %s://%d%p 2>>"$LOGFILE" | anew -q webs/all_paths.txt
+ end_func "Results are saved in $domain/webs/dict_[words|paths].txt" ${FUNCNAME[0]}
+ if [ "$PROXY" = true ] && [ -n "$proxy_url" ] && [[ $(cat webs/all_paths.txt | wc -l) -le $DEEP_LIMIT2 ]]; then
+ notification "Sending urls to proxy" info
+ ffuf -mc all -w webs/all_paths.txt -u FUZZ -replay-proxy $proxy_url 2>>"$LOGFILE" >/dev/null
+ fi
+ else
+ if [ "$WORDLIST" = false ]; then
+ printf "\n${yellow} ${FUNCNAME[0]} skipped in this mode or defined in reconftw.cfg ${reset}\n"
+ else
+ printf "${yellow} ${FUNCNAME[0]} is already processed, to force executing ${FUNCNAME[0]} delete\n $called_fn_dir/.${FUNCNAME[0]} ${reset}\n\n"
+ fi
+ fi
+}
+
+wordlist_gen $DOMAIN
diff --git a/images/banner.png b/images/banner.png
old mode 100644
new mode 100755
diff --git a/images/docker.png b/images/docker.png
old mode 100644
new mode 100755
diff --git a/images/reconFTW.gif b/images/reconFTW.gif
old mode 100644
new mode 100755
diff --git a/install.sh b/install.sh
index 9a7090f..6723704 100755
--- a/install.sh
+++ b/install.sh
@@ -37,7 +37,7 @@ gotools["amass"]="go install -v github.com/owasp-amass/amass/v3/...@master"
gotools["ffuf"]="go install -v github.com/ffuf/ffuf/v2@latest"
gotools["github-subdomains"]="go install -v github.com/gwen001/github-subdomains@latest"
gotools["gitlab-subdomains"]="go install -v github.com/gwen001/gitlab-subdomains@latest"
-gotools["nuclei"]="go install -v github.com/projectdiscovery/nuclei/v2/cmd/nuclei@latest"
+gotools["nuclei"]="go install -v github.com/projectdiscovery/nuclei/v3/cmd/nuclei@latest"
gotools["anew"]="go install -v github.com/tomnomnom/anew@latest"
gotools["notify"]="go install -v github.com/projectdiscovery/notify/cmd/notify@latest"
gotools["unfurl"]="go install -v github.com/tomnomnom/[email protected]"
diff --git a/reconftw.cfg b/reconftw.cfg
index 40be4fd..fee6c73 100644
--- a/reconftw.cfg
+++ b/reconftw.cfg
@@ -6,7 +6,7 @@
tools=~/Tools # Path installed tools
SCRIPTPATH="$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )" # Get current script's path
profile_shell=".$(basename $(echo $SHELL))rc" # Get current shell profile
-reconftw_version=$(git rev-parse --abbrev-ref HEAD)-$(git describe --tags) # Fetch current reconftw version
+#reconftw_version=$(git rev-parse --abbrev-ref HEAD)-$(git describe --tags) # Fetch current reconftw version
generate_resolvers=false # Generate custom resolvers with dnsvalidator
update_resolvers=true # Fetch and rewrite resolvers from trickest/resolvers before DNS resolution
resolvers_url="https://raw.githubusercontent.com/trickest/resolvers/main/resolvers.txt"
diff --git a/reconftw.sh b/reconftw.sh
index 779be01..d62b2c9 100755
--- a/reconftw.sh
+++ b/reconftw.sh
@@ -1,5 +1,18 @@
#!/usr/bin/env bash
+# Welcome to reconFTW main script
+# ██▀███ ▓█████ ▄████▄ ▒█████ ███▄ █ █████▒▄▄▄█████▓ █ █░
+# ▓██ ▒ ██▒▓█ ▀ ▒██▀ ▀█ ▒██▒ ██▒ ██ ▀█ █ ▓██ ▒ ▓ ██▒ ▓▒▓█░ █ ░█░
+# ▓██ ░▄█ ▒▒███ ▒▓█ ▄ ▒██░ ██▒▓██ ▀█ ██▒▒████ ░ ▒ ▓██░ ▒░▒█░ █ ░█
+# ▒██▀▀█▄ ▒▓█ ▄ ▒▓▓▄ ▄██▒▒██ ██░▓██▒ ▐▌██▒░▓█▒ ░ ░ ▓██▓ ░ ░█░ █ ░█
+# ░██▓ ▒██▒░▒████▒▒ ▓███▀ ░░ ████▓▒░▒██░ ▓██░░▒█░ ▒██▒ ░ ░░██▒██▓
+# ░ ▒▓ ░▒▓░░░ ▒░ ░░ ░▒ ▒ ░░ ▒░▒░▒░ ░ ▒░ ▒ ▒ ▒ ░ ▒ ░░ ░ ▓░▒ ▒
+# ░▒ ░ ▒░ ░ ░ ░ ░ ▒ ░ ▒ ▒░ ░ ░░ ░ ▒░ ░ ░ ▒ ░ ░
+# ░░ ░ ░ ░ ░ ░ ░ ▒ ░ ░ ░ ░ ░ ░ ░ ░
+# ░ ░ ░░ ░ ░ ░ ░ ░
+#
+# by @six2dez
+
function banner_graber(){
source "${SCRIPTPATH}"/banners.txt
randx=$(shuf -i 1-23 -n 1)
@@ -17,119 +30,9 @@ function banner(){
################################################### TOOLS #####################################################
###############################################################################################################
-function check_version(){
- timeout 10 git fetch
- exit_status=$?
- if [ $exit_status -eq 0 ]; then
- BRANCH=$(git rev-parse --abbrev-ref HEAD)
- HEADHASH=$(git rev-parse HEAD)
- UPSTREAMHASH=$(git rev-parse "${BRANCH}"@\{upstream\})
- if [ "$HEADHASH" != "$UPSTREAMHASH" ]; then
- printf "\n${yellow} There is a new version, run ./install.sh to get latest version${reset}\n\n"
- fi
- else
- printf "\n${bred} Unable to check updates ${reset}\n\n"
- fi
-}
-
-function tools_installed(){
-
- printf "\n\n${bgreen}#######################################################################${reset}\n"
- printf "${bblue} Checking installed tools ${reset}\n\n"
-
- allinstalled=true
-
- [ -n "$GOPATH" ] || { printf "${bred} [*] GOPATH var [NO]${reset}\n"; allinstalled=false;}
- [ -n "$GOROOT" ] || { printf "${bred} [*] GOROOT var [NO]${reset}\n"; allinstalled=false;}
- [ -n "$PATH" ] || { printf "${bred} [*] PATH var [NO]${reset}\n"; allinstalled=false;}
- [ -f "$tools/dorks_hunter/dorks_hunter.py" ] || { printf "${bred} [*] dorks_hunter [NO]${reset}\n"; allinstalled=false;}
- [ -f "$tools/brutespray/brutespray.py" ] || { printf "${bred} [*] brutespray [NO]${reset}\n"; allinstalled=false;}
- [ -f "$tools/fav-up/favUp.py" ] || { printf "${bred} [*] fav-up [NO]${reset}\n"; allinstalled=false;}
- [ -f "$tools/Corsy/corsy.py" ] || { printf "${bred} [*] Corsy [NO]${reset}\n"; allinstalled=false;}
- [ -f "$tools/testssl.sh/testssl.sh" ] || { printf "${bred} [*] testssl [NO]${reset}\n"; allinstalled=false;}
- [ -f "$tools/CMSeeK/cmseek.py" ] || { printf "${bred} [*] CMSeeK [NO]${reset}\n"; allinstalled=false;}
- [ -f "${fuzz_wordlist}" ] || { printf "${bred} [*] OneListForAll [NO]${reset}\n"; allinstalled=false;}
- [ -f "${lfi_wordlist}" ] || { printf "${bred} [*] lfi_wordlist [NO]${reset}\n"; allinstalled=false;}
- [ -f "${ssti_wordlist}" ] || { printf "${bred} [*] ssti_wordlist [NO]${reset}\n"; allinstalled=false;}
- [ -f "${subs_wordlist}" ] || { printf "${bred} [*] subs_wordlist [NO]${reset}\n"; allinstalled=false;}
- [ -f "${subs_wordlist_big}" ] || { printf "${bred} [*] subs_wordlist_big [NO]${reset}\n"; allinstalled=false;}
- [ -f "${resolvers}" ] || { printf "${bred} [*] resolvers [NO]${reset}\n"; allinstalled=false;}
- [ -f "${resolvers_trusted}" ] || { printf "${bred} [*] resolvers_trusted [NO]${reset}\n"; allinstalled=false;}
- [ -f "$tools/xnLinkFinder/xnLinkFinder.py" ] || { printf "${bred} [*] xnLinkFinder [NO]${reset}\n"; allinstalled=false;}
- [ -f "$tools/waymore/waymore.py" ] || { printf "${bred} [*] waymore [NO]${reset}\n"; allinstalled=false;}
- [ -f "$tools/commix/commix.py" ] || { printf "${bred} [*] commix [NO]${reset}\n"; allinstalled=false;}
- [ -f "$tools/getjswords.py" ] || { printf "${bred} [*] getjswords [NO]${reset}\n"; allinstalled=false;}
- [ -f "$tools/JSA/jsa.py" ] || { printf "${bred} [*] JSA [NO]${reset}\n"; allinstalled=false;}
- [ -f "$tools/cloud_enum/cloud_enum.py" ] || { printf "${bred} [*] cloud_enum [NO]${reset}\n"; allinstalled=false;}
- [ -f "$tools/ultimate-nmap-parser/ultimate-nmap-parser.sh" ] || { printf "${bred} [*] nmap-parse-output [NO]${reset}\n"; allinstalled=false;}
- [ -f "$tools/pydictor/pydictor.py" ] || { printf "${bred} [*] pydictor [NO]${reset}\n"; allinstalled=false;}
- [ -f "$tools/urless/urless/urless.py" ] || { printf "${bred} [*] urless [NO]${reset}\n"; allinstalled=false;}
- [ -f "$tools/smuggler/smuggler.py" ] || { printf "${bred} [*] smuggler [NO]${reset}\n"; allinstalled=false;}
- [ -f "$tools/regulator/main.py" ] || { printf "${bred} [*] regulator [NO]${reset}\n"; allinstalled=false;}
- which github-endpoints &>/dev/null || { printf "${bred} [*] github-endpoints [NO]${reset}\n"; allinstalled=false;}
- which github-subdomains &>/dev/null || { printf "${bred} [*] github-subdomains [NO]${reset}\n"; allinstalled=false;}
- which gitlab-subdomains &>/dev/null || { printf "${bred} [*] gitlab-subdomains [NO]${reset}\n"; allinstalled=false;}
- which katana &>/dev/null || { printf "${bred} [*] katana [NO]${reset}\n"; allinstalled=false;}
- which wafw00f &>/dev/null || { printf "${bred} [*] wafw00f [NO]${reset}\n"; allinstalled=false;}
- which dnsvalidator &>/dev/null || { printf "${bred} [*] dnsvalidator [NO]${reset}\n"; allinstalled=false;}
- which gowitness &>/dev/null || { printf "${bred} [*] gowitness [NO]${reset}\n"; allinstalled=false;}
- which amass &>/dev/null || { printf "${bred} [*] Amass [NO]${reset}\n"; allinstalled=false;}
- which dnsx &>/dev/null || { printf "${bred} [*] dnsx [NO]${reset}\n"; allinstalled=false;}
- which gotator &>/dev/null || { printf "${bred} [*] gotator [NO]${reset}\n"; allinstalled=false;}
- which nuclei &>/dev/null || { printf "${bred} [*] Nuclei [NO]${reset}\n"; allinstalled=false;}
- [ -d ${NUCLEI_TEMPLATES_PATH} ] || { printf "${bred} [*] Nuclei templates [NO]${reset}\n"; allinstalled=false;}
- [ -d ${tools}/fuzzing-templates ] || { printf "${bred} [*] Fuzzing templates [NO]${reset}\n"; allinstalled=false;}
- which gf &>/dev/null || { printf "${bred} [*] Gf [NO]${reset}\n"; allinstalled=false;}
- which Gxss &>/dev/null || { printf "${bred} [*] Gxss [NO]${reset}\n"; allinstalled=false;}
- which subjs &>/dev/null || { printf "${bred} [*] subjs [NO]${reset}\n"; allinstalled=false;}
- which ffuf &>/dev/null || { printf "${bred} [*] ffuf [NO]${reset}\n"; allinstalled=false;}
- which massdns &>/dev/null || { printf "${bred} [*] Massdns [NO]${reset}\n"; allinstalled=false;}
- which qsreplace &>/dev/null || { printf "${bred} [*] qsreplace [NO]${reset}\n"; allinstalled=false;}
- which interlace &>/dev/null || { printf "${bred} [*] interlace [NO]${reset}\n"; allinstalled=false;}
- which anew &>/dev/null || { printf "${bred} [*] Anew [NO]${reset}\n"; allinstalled=false;}
- which unfurl &>/dev/null || { printf "${bred} [*] unfurl [NO]${reset}\n"; allinstalled=false;}
- which crlfuzz &>/dev/null || { printf "${bred} [*] crlfuzz [NO]${reset}\n"; allinstalled=false;}
- which httpx &>/dev/null || { printf "${bred} [*] Httpx [NO]${reset}\n${reset}"; allinstalled=false;}
- which jq &>/dev/null || { printf "${bred} [*] jq [NO]${reset}\n${reset}"; allinstalled=false;}
- which notify &>/dev/null || { printf "${bred} [*] notify [NO]${reset}\n${reset}"; allinstalled=false;}
- which dalfox &>/dev/null || { printf "${bred} [*] dalfox [NO]${reset}\n${reset}"; allinstalled=false;}
- which puredns &>/dev/null || { printf "${bred} [*] puredns [NO]${reset}\n${reset}"; allinstalled=false;}
- which emailfinder &>/dev/null || { printf "${bred} [*] emailfinder [NO]${reset}\n"; allinstalled=false;}
- which analyticsrelationships &>/dev/null || { printf "${bred} [*] analyticsrelationships [NO]${reset}\n"; allinstalled=false;}
- which mapcidr &>/dev/null || { printf "${bred} [*] mapcidr [NO]${reset}\n"; allinstalled=false;}
- which ppfuzz &>/dev/null || { printf "${bred} [*] ppfuzz [NO]${reset}\n"; allinstalled=false;}
- which cdncheck &>/dev/null || { printf "${bred} [*] cdncheck [NO]${reset}\n"; allinstalled=false;}
- which interactsh-client &>/dev/null || { printf "${bred} [*] interactsh-client [NO]${reset}\n"; allinstalled=false;}
- which tlsx &>/dev/null || { printf "${bred} [*] tlsx [NO]${reset}\n"; allinstalled=false;}
- which smap &>/dev/null || { printf "${bred} [*] smap [NO]${reset}\n"; allinstalled=false;}
- which gitdorks_go &>/dev/null || { printf "${bred} [*] gitdorks_go [NO]${reset}\n"; allinstalled=false;}
- which ripgen &>/dev/null || { printf "${bred} [*] ripgen [NO]${reset}\n${reset}"; allinstalled=false;}
- which dsieve &>/dev/null || { printf "${bred} [*] dsieve [NO]${reset}\n${reset}"; allinstalled=false;}
- which inscope &>/dev/null || { printf "${bred} [*] inscope [NO]${reset}\n${reset}"; allinstalled=false;}
- which enumerepo &>/dev/null || { printf "${bred} [*] enumerepo [NO]${reset}\n${reset}"; allinstalled=false;}
- which Web-Cache-Vulnerability-Scanner &>/dev/null || { printf "${bred} [*] Web-Cache-Vulnerability-Scanner [NO]${reset}\n"; allinstalled=false;}
- which subfinder &>/dev/null || { printf "${bred} [*] subfinder [NO]${reset}\n${reset}"; allinstalled=false;}
- which byp4xx &>/dev/null || { printf "${bred} [*] byp4xx [NO]${reset}\n${reset}"; allinstalled=false;}
- which ghauri &>/dev/null || { printf "${bred} [*] ghauri [NO]${reset}\n${reset}"; allinstalled=false;}
- which hakip2host &>/dev/null || { printf "${bred} [*] hakip2host [NO]${reset}\n${reset}"; allinstalled=false;}
- which gau &>/dev/null || { printf "${bred} [*] gau [NO]${reset}\n${reset}"; allinstalled=false;}
- which crt &>/dev/null || { printf "${bred} [*] crt [NO]${reset}\n${reset}"; allinstalled=false;}
- which gitleaks &>/dev/null || { printf "${bred} [*] gitleaks [NO]${reset}\n${reset}"; allinstalled=false;}
- which trufflehog &>/dev/null || { printf "${bred} [*] trufflehog [NO]${reset}\n${reset}"; allinstalled=false;}
- which s3scanner &>/dev/null || { printf "${bred} [*] s3scanner [NO]${reset}\n${reset}"; allinstalled=false;}
-
- if [ "${allinstalled}" = true ]; then
- printf "${bgreen} Good! All installed! ${reset}\n\n"
- else
- printf "\n${yellow} Try running the installer script again ./install.sh"
- printf "\n${yellow} If it fails for any reason try to install manually the tools missed"
- printf "\n${yellow} Finally remember to set the ${bred}\$tools${yellow} variable at the start of this script"
- printf "\n${yellow} If nothing works and the world is gonna end you can always ping me :D ${reset}\n\n"
- fi
+rftw_util_version
- printf "${bblue} Tools check finished\n"
- printf "${bgreen}#######################################################################\n${reset}"
-}
+rftw_util_tools -t $tools
###############################################################################################################
################################################### OSINT #####################################################
@@ -137,7 +40,7 @@ function tools_installed(){
function google_dorks(){
if { [ ! -f "$called_fn_dir/.${FUNCNAME[0]}" ] || [ "$DIFF" = true ]; } && [ "$GOOGLE_DORKS" = true ] && [ "$OSINT" = true ]; then
- python3 $tools/dorks_hunter/dorks_hunter.py -d "$domain" -o osint/dorks.txt || { echo "dorks_hunter command failed"; exit 1; }
+ rftw_osint_googledorks -d "$domain" -o osint/dorks.txt || { echo "dorks_hunter command failed"; exit 1; } 2>>"$LOGFILE" >/dev/null 2>&1
end_func "Results are saved in $domain/osint/dorks.txt" "${FUNCNAME[0]}"
else
if [ "$GOOGLE_DORKS" = false ] || [ "$OSINT" = false ]; then
@@ -151,15 +54,7 @@ function google_dorks(){
function github_dorks(){
if { [ ! -f "$called_fn_dir/.${FUNCNAME[0]}" ] || [ "$DIFF" = true ]; } && [ "$GITHUB_DORKS" = true ] && [ "$OSINT" = true ]; then
start_func "${FUNCNAME[0]}" "Github Dorks in process"
- if [ -s "${GITHUB_TOKENS}" ]; then
- if [ "$DEEP" = true ]; then
- gitdorks_go -gd $tools/gitdorks_go/Dorks/medium_dorks.txt -nws 20 -target "$domain" -tf "${GITHUB_TOKENS}" -ew 3 | anew -q osint/gitdorks.txt || { echo "gitdorks_go/anew command failed"; exit 1; }
- else
- gitdorks_go -gd $tools/gitdorks_go/Dorks/smalldorks.txt -nws 20 -target $domain -tf "${GITHUB_TOKENS}" -ew 3 | anew -q osint/gitdorks.txt || { echo "gitdorks_go/anew command failed"; exit 1; }
- fi
- else
- printf "\n${bred} Required file ${GITHUB_TOKENS} not exists or empty${reset}\n"
- fi
+ rftw_osint_gh_dorks -d "$domain" -t "${GITHUB_TOKENS}" -D "$DEEP" | anew -q osint/gitdorks.txt || { echo "gitdorks_go command failed"; exit 1; } 2>>"$LOGFILE" >/dev/null 2>&1
end_func "Results are saved in $domain/osint/gitdorks.txt" "${FUNCNAME[0]}"
else
if [ "$GITHUB_DORKS" = false ] || [ "$OSINT" = false ]; then
@@ -1090,7 +985,7 @@ function cdnprovider(){
if { [ ! -f "$called_fn_dir/.${FUNCNAME[0]}" ] || [ "$DIFF" = true ]; } && [ "$CDN_IP" = true ]; then
start_func ${FUNCNAME[0]} "CDN provider check"
[ -s "subdomains/subdomains_dnsregs.json" ] && cat subdomains/subdomains_dnsregs.json | jq -r 'try . | .a[]' | grep -aEiv "^(127|10|169\.154|172\.1[6789]|172\.2[0-9]|172\.3[01]|192\.168)\." | grep -oE "\b([0-9]{1,3}\.){3}[0-9]{1,3}\b" | sort -u > .tmp/ips_cdn.txt
- [ -s ".tmp/ips_cdn.txt" ] && cat .tmp/ips_cdn.txt | cdncheck -silent -resp -nc | anew -q $dir/hosts/cdn_providers.txt
+ [ -s ".tmp/ips_cdn.txt" ] && cat .tmp/ips_cdn.txt | rftw_ip_cdnprovider | anew -q $dir/hosts/cdn_providers.txt
end_func "Results are saved in hosts/cdn_providers.txt" ${FUNCNAME[0]}
else
if [ "$CDN_IP" = false ]; then