reconFTW is a tool designed to perform automated recon on a target domain by running the best set of tools to perform scanning and finding out vulnerabilities
Shell bug-bountybugbountybugbounty-tooldnshackingnucleiosintpenetration-testingpentestpentest-toolpentestingreconreconnaissancescannersecuritysecurity-toolssubdomainsubdomain-enumerationvulnerabilities
Install menu and script for Web Interface
悲しいオオカミaedd59e4f83e
diff --git a/install.sh b/install.shindex 64c42e1..b566eb1 100755--- a/install.sh+++ b/install.sh@@ -47,10 +47,10 @@ fideclare -A gotoolsgotools["gf"]="go install -v github.com/tomnomnom/gf@latest"gotools["qsreplace"]="go install -v github.com/tomnomnom/qsreplace@latest"-gotools["Amass"]="go install -v github.com/OWASP/Amass/v3/[email protected]"+gotools["Amass"]="go install -v github.com/OWASP/Amass/v3/...@master"gotools["ffuf"]="go install -v github.com/ffuf/ffuf@latest"gotools["github-subdomains"]="go install -v github.com/gwen001/github-subdomains@latest"-gotools["gitlab-subdomains"]="go install github.com/gwen001/gitlab-subdomains@latest"+gotools["waybackurls"]="go install -v github.com/tomnomnom/waybackurls@latest"gotools["nuclei"]="go install -v github.com/projectdiscovery/nuclei/v2/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"@@ -58,9 +58,10 @@ gotools["unfurl"]="go install -v github.com/tomnomnom/unfurl@latest"gotools["httpx"]="go install -v github.com/projectdiscovery/httpx/cmd/httpx@latest"gotools["github-endpoints"]="go install -v github.com/gwen001/github-endpoints@latest"gotools["dnsx"]="go install -v github.com/projectdiscovery/dnsx/cmd/dnsx@latest"+gotools["gau"]="go install -v github.com/lc/gau/v2/cmd/gau@latest"gotools["subjs"]="go install -v github.com/lc/subjs@latest"gotools["Gxss"]="go install -v github.com/KathanP19/Gxss@latest"-gotools["katana"]="go install github.com/projectdiscovery/katana/cmd/katana@latest"+gotools["gospider"]="go install -v github.com/jaeles-project/gospider@latest"gotools["crlfuzz"]="go install -v github.com/dwisiswant0/crlfuzz/cmd/crlfuzz@latest"gotools["dalfox"]="go install -v github.com/hahwul/dalfox/v2@latest"gotools["puredns"]="go install -v github.com/d3mondev/puredns/v2@latest"@@ -81,7 +82,6 @@ gotools["rush"]="go install github.com/shenwei356/rush@latest"gotools["enumerepo"]="go install github.com/trickest/enumerepo@latest"gotools["Web-Cache-Vulnerability-Scanner"]="go install -v github.com/Hackmanit/Web-Cache-Vulnerability-Scanner@latest"gotools["subfinder"]="go install -v github.com/projectdiscovery/subfinder/v2/cmd/subfinder@latest"-gotools["byp4xx"]="go install -v github.com/lobuhi/byp4xx@latest"declare -A reposrepos["dorks_hunter"]="six2dez/dorks_hunter"@@ -94,7 +94,6 @@ repos["gf"]="tomnomnom/gf"repos["Gf-Patterns"]="1ndianl33t/Gf-Patterns"repos["ctfr"]="UnaPibaGeek/ctfr"repos["xnLinkFinder"]="xnl-h4ck3r/xnLinkFinder"-repos["waymore"]="xnl-h4ck3r/waymore"repos["Corsy"]="s0md3v/Corsy"repos["CMSeeK"]="Tuhinshubhra/CMSeeK"repos["fav-up"]="pielco11/fav-up"@@ -111,11 +110,165 @@ repos["urless"]="xnl-h4ck3r/urless"repos["trufflehog"]="trufflesecurity/trufflehog"repos["smuggler"]="defparam/smuggler"repos["Web-Cache-Vulnerability-Scanner"]="Hackmanit/Web-Cache-Vulnerability-Scanner"-repos["regulator"]="cramppet/regulator"-repos["byp4xx"]="lobuhi/byp4xx"-printf "\n\n${bgreen}#######################################################################${reset}\n"-printf "${bgreen} reconFTW installer/updater script ${reset}\n\n"++function banner_web(){+ echo -en "\033c"+ printf "\n${bgreen}"+ printf " ██▀███ ▓█████ ▄████▄ ▒█████ ███▄ █ █████▒▄▄▄█████▓ █ █░\n"+ printf " ▓██ ▒ ██▒▓█ ▀ ▒██▀ ▀█ ▒██▒ ██▒ ██ ▀█ █ ▓██ ▒ ▓ ██▒ ▓▒▓█░ █ ░█░\n"+ printf " ▓██ ░▄█ ▒▒███ ▒▓█ ▄ ▒██░ ██▒▓██ ▀█ ██▒▒████ ░ ▒ ▓██░ ▒░▒█░ █ ░█ \n"+ printf " ▒██▀▀█▄ ▒▓█ ▄ ▒▓▓▄ ▄██▒▒██ ██░▓██▒ ▐▌██▒░▓█▒ ░ ░ ▓██▓ ░ ░█░ █ ░█ \n"+ printf " ░██▓ ▒██▒░▒████▒▒ ▓███▀ ░░ ████▓▒░▒██░ ▓██░░▒█░ ▒██▒ ░ ░░██▒██▓ \n"+ printf " ░ ▒▓ ░▒▓░░░ ▒░ ░░ ░▒ ▒ ░░ ▒░▒░▒░ ░ ▒░ ▒ ▒ ▒ ░ ▒ ░░ ░ ▓░▒ ▒ \n"+ printf " ░▒ ░ ▒░ ░ ░ ░ ░ ▒ ░ ▒ ▒░ ░ ░░ ░ ▒░ ░ ░ ▒ ░ ░ \n"+ printf " ░░ ░ ░ ░ ░ ░ ░ ▒ ░ ░ ░ ░ ░ ░ ░ ░ \n"+ printf " ░ ░ ░░ ░ ░ ░ ░ ░ \n"+ printf " ░ \n"+ printf " ${reconftw_version} by @six2dez\n"+ printf " Web Interface by @lur1el, @d3vchac, @mx61tt and @dd4n1b0y${reset}\n"+}+++install_webserver(){+ printf "${bblue} Running: Installing web reconftw ${reset}\n\n"+ printf "${yellow} Installing python libraries...${reset}\n\n"++ # Install venv+ printf "${yellow} python virtualenv install...${reset}\n\n"+ $SUDO rm -rf /web/.venv/+ $SUDO pip3 install virtualenv &>/dev/null+ $SUDO virtualenv $HOME/reconftw/web/.venv/ &>/dev/null+ if [ $? -eq 0 ]; then+ printf "${yellow} Activating virtualenv...${reset}\n\n"+ $SUDO source $HOME/reconftw/web/.venv/bin/activate+ $SUDO pip3 install --upgrade pip &>/dev/null+ else+ printf '[ERROR] Failed to create virtualenv. Please install requirements mentioned in Documentation.'+ exit 1+ fi++ printf "${yellow} Installing Requirements...${reset}\n\n"+ $SUDO pip3 install -r $HOME/reconftw/web/requirements.txt &>/dev/null++++ #$SUDO virtualenv web/env &>/dev/null+ #$SUDO source web/env/bin/activate+ #$SUDO pip3 install -r web/requirements.txt &>/dev/null++ printf "${yellow} Installing tools...${reset}\n\n"+ $SUDO apt install redis-server -y &>/dev/null+ #$SUDO apt install postgresql -y &>/dev/null++ # printf "${yellow} Database configuration...${reset}\n\n"+ #$SUDO service postgresql restart &>/dev/null+ #$SUDO su postgres -c 'psql -c "DROP DATABASE web;"' &>/dev/null+ #$SUDO su postgres -c 'psql -c "CREATE DATABASE web;"' &>/dev/null++ #read -p ' What Username is used in db: ' DBUser+ #read -s -p ' What Password is used in db: ' DBPass++ #$SUDO su postgres 'psql -c "DROP USER "'$DBUser &> /dev/null++ #sed -i "s/'USER': '.*/'USER': '$DBUser',/" web/web/settings.py+ #sed -i "s/'PASSWORD': '.*/'PASSWORD': '$DBPass',/" web/web/settings.py+ #echo ""++ #printf "${yellow} Creating DB User...${reset}\n\n"+ #$SUDO su postgres -c "psql -c \"CREATE USER $DBUser with PASSWORD '$DBPass';\""++ #$SUDO su postgres -c "psql -c \"ALTER ROLE $DBUser SET client_encoding TO 'utf8';\""+ #$SUDO su postgres -c "psql -c \"ALTER ROLE $DBUser SET default_transaction_isolation TO 'read committed';\""+ #$SUDO su postgres -c "psql -c \"ALTER ROLE $DBUser SET timezone TO 'UTC';\""+ #$SUDO su postgres -c "psql -c \"GRANT ALL PRIVILEGES ON DATABASE web TO $DBUser;\""++ printf "${yellow} Creating WEB User...${reset}\n\n"+ $SUDO rm $HOME/reconftw/web/db.sqlite3 &>/dev/null+ $SUDO python3 $HOME/reconftw/web/manage.py makemigrations &>/dev/null+ $SUDO python3 $HOME/reconftw/web/manage.py migrate &>/dev/null+ $SUDO python3 $HOME/reconftw/web/manage.py createsuperuser+}+++banner_web+printf "\n${bgreen} reconFTW installer/updater script ${reset}\n\n"+++if [[ -d $dir && -d ~/.gf && -d ~/.config/notify/ && -d ~/.config/amass/ && -d ~/.config/nuclei/ && -f $dir/.github_tokens ]]; then+ rftw_installed=true+else+ rftw_installed=false+fi+++# Display menu and wait for user input+while true; do+ printf "${bblue} Choose one of the following options: ${reset}\n\n"++ if $rftw_installed; then+ printf "${bblue} 1. Install/Update ReconFTW (without Web Interface)${reset}\n\n"+ printf "${bblue} 2. Install/Update ReconFTW + Install Web Interface${reset}\n\n"+ printf "${bblue} 3. Install only Web Interface${reset}\n\n"+ printf "${bblue} 4. Exit${reset}\n\n"+ printf "${bgreen}#######################################################################${reset}\n\n"+ read -p "$(echo -e ${bblue} "Insert option: "${reset})" option+ printf "\n\n${bgreen}#######################################################################${reset}\n\n"++ case $option in+ 1)+ web=false+ break+ ;;+ 2)+ web=true+ break+ ;;+ 3)+ install_webserver+ exit 1+ ;;+ 4)+ printf "${bblue} Exiting...${reset}\n\n"+ exit 1+ ;;+ *)+ printf "${bblue} Invalid option. Exiting...${reset}\n\n"+ exit 1+ ;;+ esac++ else+ printf "${bblue} 1. Install/Update ReconFTW${reset}\n\n"+ printf "${bblue} 2. Install/Update ReconFTW + Install Web Interface${reset}\n\n"+ printf "${bred} 3. Can't install Web Interface without ReconFTW${reset}\n\n"+ printf "${bblue} 4. Exit${reset}\n\n"+ printf "${bgreen}#######################################################################${reset}\n\n"+ read -p "$(echo -e ${bblue} "Insert option: "${reset})" option+ printf "\n${bgreen}#######################################################################${reset}\n\n"++ case $option in+ 1)+ web=false+ break+ ;;+ 2)+ web=true+ break+ ;;+ 4)+ printf "${bblue} Exiting...${reset}\n\n"+ exit 1+ ;;+ *)+ printf "${bblue} Invalid option. Exiting...${reset}\n\n"+ exit 1+ ;;+ esac+ fi+done++printf "${yellow} This may take time. So, go grab a coffee! ${reset}\n\n"if [[ $(id -u | grep -o '^0$') == "0" ]]; then@@ -153,8 +306,8 @@ install_brew(){export PATH="/opt/homebrew/opt/gnu-getopt/bin:$PATH"echo 'export PATH="/opt/homebrew/opt/gnu-getopt/bin:$PATH"' >> ~/.zshrceval brew services start tor $DEBUG_STD- brew install rustup- rustup-init+ eval brew install rustup $DEBUG_STD+ eval rustup-init $DEBUG_STDeval cargo install ripgen $DEBUG_STD}@@ -298,7 +451,7 @@ cd ~/nuclei-templates/extra_templates && eval git pull $DEBUG_STDcd "$dir" || { echo "Failed to cd to $dir in ${FUNCNAME[0]} @ line ${LINENO}"; exit 1; }eval git clone --depth 1 https://github.com/sqlmapproject/sqlmap.git $dir/sqlmap $DEBUG_STDeval git clone --depth 1 https://github.com/drwetter/testssl.sh.git $dir/testssl.sh $DEBUG_STD-eval $SUDO git clone https://gitlab.com/exploit-database/exploitdb /opt/exploitdb $DEBUG_STD+eval $SUDO git clone https://github.com/offensive-security/exploitdb.git /opt/exploitdb $DEBUG_STDeval $SUDO ln -sf /opt/exploitdb/searchsploit /usr/local/bin/searchsploit $DEBUG_STD# Standard repos installation@@ -332,7 +485,7 @@ for repo in "${!repos[@]}"; doelif [ "Gf-Patterns" = "$repo" ]; theneval mv ./*.json ~/.gf $DEBUG_ERRORelif [ "trufflehog" = "$repo" ]; then- eval go install $DEBUG_STD+ go installficd "$dir" || { echo "Failed to cd to $dir in ${FUNCNAME[0]} @ line ${LINENO}"; exit 1; }done@@ -377,7 +530,7 @@ eval $SUDO strip -s /usr/local/bin/unimap $DEBUG_STDeval $SUDO chmod 755 /usr/local/bin/ppfuzzeval $SUDO strip -s /usr/local/bin/ppfuzz $DEBUG_STDeval notify $DEBUG_STD-eval subfinder $DEBUG_STD+eval subfinder -h $DEBUG_STDprintf "${bblue}\n Running: Downloading required files ${reset}\n\n"## Downloads@@ -386,8 +539,8 @@ printf "${bblue}\n Running: Downloading required files ${reset}\n\n"wget -q -O - https://raw.githubusercontent.com/devanshbatham/ParamSpider/master/gf_profiles/potential.json > ~/.gf/potential.jsonwget -q -O - https://raw.githubusercontent.com/m4ll0k/Bug-Bounty-Toolz/master/getjswords.py > ${tools}/getjswords.pywget -q -O - https://wordlists-cdn.assetnote.io/data/manual/best-dns-wordlist.txt > ${subs_wordlist_big}-wget -q -O - https://raw.githubusercontent.com/six2dez/resolvers_reconftw/main/resolvers_trusted.txt > ${resolvers_trusted}-wget -q -O - https://raw.githubusercontent.com/trickest/resolvers/main/resolvers.txt > ${resolvers}+wget -q -O - https://gist.githubusercontent.com/six2dez/ae9ed7e5c786461868abd3f2344401b6/raw > ${resolvers_trusted}+wget -q -O - https://raw.githubusercontent.com/proabiral/Fresh-Resolvers/master/resolvers.txt > ${resolvers}wget -q -O - https://gist.github.com/six2dez/a307a04a222fab5a57466c51e1569acf/raw > ${subs_wordlist}wget -q -O - https://gist.github.com/six2dez/ffc2b14d283e8f8eff6ac83e20a3c4b4/raw > ${tools}/permutations_list.txtwget -q -O - https://raw.githubusercontent.com/six2dez/OneListForAll/main/onelistforallmicro.txt > ${fuzz_wordlist}@@ -455,20 +608,27 @@ if [ "$generate_resolvers" = true ]; thendnsvalidator -tL https://raw.githubusercontent.com/blechschmidt/massdns/master/lists/resolvers.txt -threads $DNSVALIDATOR_THREADS -o tmp_resolvers &>/dev/null[ -s "tmp_resolvers" ] && cat tmp_resolvers | anew -q $resolvers[ -s "tmp_resolvers" ] && rm -f tmp_resolvers &>/dev/null- [ ! -s "$resolvers" ] && wget -q -O - https://raw.githubusercontent.com/trickest/resolvers/main/resolvers.txt > ${resolvers}- [ ! -s "$resolvers_trusted" ] && wget -q -O - https://raw.githubusercontent.com/trickest/resolvers/main/resolvers.txt > ${resolvers_trusted}+ [ ! -s "$resolvers" ] && wget -q -O - https://raw.githubusercontent.com/proabiral/Fresh-Resolvers/master/resolvers.txt > ${resolvers}+ [ ! -s "$resolvers_trusted" ] && wget -q -O - https://gist.githubusercontent.com/six2dez/ae9ed7e5c786461868abd3f2344401b6/raw > ${resolvers_trusted}printf "${yellow} Resolvers updated\n ${reset}\n\n"figenerate_resolvers=falseelse[ ! -s "$resolvers" ] || if [[ $(find "$resolvers" -mtime +1 -print) ]] ; then${reset}"\n\nChecking resolvers lists...\n Accurate resolvers are the key to great results\n Downloading new resolvers ${reset}\n\n"- wget -q -O - https://raw.githubusercontent.com/trickest/resolvers/main/resolvers.txt > ${resolvers}- wget -q -O - https://raw.githubusercontent.com/trickest/resolvers/main/resolvers.txt > ${resolvers_trusted}+ wget -q -O - https://raw.githubusercontent.com/proabiral/Fresh-Resolvers/master/resolvers.txt > ${resolvers}+ wget -q -O - https://gist.githubusercontent.com/six2dez/ae9ed7e5c786461868abd3f2344401b6/raw > ${resolvers_trusted}printf "${yellow} Resolvers updated\n ${reset}\n\n"fifi++## Installing webserver+if [ web ]; then+ install_webserver+fi++eval h8mail -g $DEBUG_STD## Stripping all Go binaries@@ -476,6 +636,6 @@ eval strip -s "$HOME"/go/bin/* $DEBUG_STDeval $SUDO cp "$HOME"/go/bin/* /usr/local/bin/ $DEBUG_STD-printf "${yellow} Remember set your api keys:\n - amass (~/.config/amass/config.ini)\n - subfinder (~/.config/subfinder/provider-config.yaml)\n - GitLab (~/Tools/.gitlab_tokens)\n - SSRF Server (COLLAB_SERVER in reconftw.cfg or env var) \n - Blind XSS Server (XSS_SERVER in reconftw.cfg or env var) \n - notify (~/.config/notify/provider-config.yaml) \n - theHarvester (~/Tools/theHarvester/api-keys.yaml or /etc/theHarvester/api-keys.yaml)\n - H8mail (~/Tools/h8mail_config.ini)\n - WHOISXML API (WHOISXML_API in reconftw.cfg or env var)\n\n\n${reset}"+printf "${yellow} Remember set your api keys:\n - amass (~/.config/amass/config.ini)\n - subfinder (~/.config/subfinder/provider-config.yaml)\n - GitHub (~/Tools/.github_tokens)\n - SSRF Server (COLLAB_SERVER in reconftw.cfg or env var) \n - Blind XSS Server (XSS_SERVER in reconftw.cfg or env var) \n - notify (~/.config/notify/provider-config.yaml) \n - theHarvester (~/Tools/theHarvester/api-keys.yaml or /etc/theHarvester/api-keys.yaml)\n - H8mail (~/Tools/h8mail_config.ini)\n - WHOISXML API (WHOISXML_API in reconftw.cfg or env var)\n\n\n${reset}"printf "${bgreen} Finished!${reset}\n\n"printf "\n\n${bgreen}#######################################################################${reset}\n"diff --git a/reconftw.sh b/reconftw.shindex 34ac3e0..05755f4 100755--- a/reconftw.sh+++ b/reconftw.sh@@ -54,7 +54,6 @@ function tools_installed(){[ -f "$tools/ctfr/ctfr.py" ] || { printf "${bred} [*] ctfr [NO]${reset}\n"; allinstalled=false;}[ -f "$tools/fuzz_wordlist.txt" ] || { printf "${bred} [*] OneListForAll [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;}@@ -63,15 +62,15 @@ function tools_installed(){[ -f "$tools/pydictor/pydictor.py" ] || { printf "${bred} [*] pydictor [NO]${reset}\n"; allinstalled=false;}[ -f "$tools/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 gospider &>/dev/null || { printf "${bred} [*] gospider [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 waybackurls &>/dev/null || { printf "${bred} [*] Waybackurls [NO]${reset}\n"; allinstalled=false;}+ which gau &>/dev/null || { printf "${bred} [*] gau [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;}@@ -110,7 +109,6 @@ function tools_installed(){which trufflehog &>/dev/null || { printf "${bred} [*] trufflehog [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;}if [ "${allinstalled}" = true ]; thenprintf "${bgreen} Good! All installed! ${reset}\n\n"@@ -328,7 +326,6 @@ function subdomains_full(){sub_noerrorsub_brutesub_permut- sub_regex_permutsub_recursive_passivesub_recursive_brutesub_dns@@ -345,11 +342,11 @@ function subdomains_full(){webprobe_simpleif [ -s "subdomains/subdomains.txt" ]; then- [ -s "$outOfScope_file" ] && deleteOutScoped $outOfScope_file subdomains/subdomains.txt+ deleteOutScoped $outOfScope_file subdomains/subdomains.txtNUMOFLINES_subs=$(cat subdomains/subdomains.txt 2>>"$LOGFILE" | anew .tmp/subdomains_old.txt | sed '/^$/d' | wc -l)fiif [ -s "webs/webs.txt" ]; then- [ -s "$outOfScope_file" ] && deleteOutScoped $outOfScope_file webs/webs.txt+ deleteOutScoped $outOfScope_file webs/webs.txtNUMOFLINES_probed=$(cat webs/webs.txt 2>>"$LOGFILE" | anew .tmp/probed_old.txt | sed '/^$/d' | wc -l)fiprintf "${bblue}\n Total subdomains: ${reset}\n\n"@@ -382,13 +379,9 @@ function sub_passive(){github-subdomains -d $domain -k -q -t $GITHUB_TOKENS -o .tmp/github_subdomains_psub.txt 2>>"$LOGFILE" &>/dev/nullfifi- if [ -s "${GITLAB_TOKENS}" ]; then- gitlab-subdomains -d $domain -t $GITLAB_TOKENS -o .tmp/gitlab_subdomains_psub.txt 2>>"$LOGFILE" &>/dev/null- fiif [ "$INSCOPE" = true ]; thencheck_inscope .tmp/amass_psub.txt 2>>"$LOGFILE" &>/dev/nullcheck_inscope .tmp/github_subdomains_psub.txt 2>>"$LOGFILE" &>/dev/null- check_inscope .tmp/gitlab_subdomains_psub.txt 2>>"$LOGFILE" &>/dev/nullfiNUMOFLINES=$(find .tmp -type f -iname "*_psub.txt" -exec cat {} + | sed "s/*.//" | anew .tmp/passive_subs.txt | sed '/^$/d' | wc -l)end_subfunc "${NUMOFLINES} new subs (passive)" ${FUNCNAME[0]}@@ -421,7 +414,7 @@ function sub_active(){if [ ! -f "$called_fn_dir/.${FUNCNAME[0]}" ] || [ "$DIFF" = true ]; thenstart_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+ deleteOutScoped $outOfScope_file .tmp/subs_no_resolved.txtif [ ! "$AXIOM" = true ]; thenresolvers_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 &>/dev/null@@ -542,10 +535,18 @@ function sub_scraping(){[ -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.txtif [ "$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 &>/dev/null+ [ -s ".tmp/probed_tmp_scrap.txt" ] && gospider -S .tmp/probed_tmp_scrap.txt --js -t $GOSPIDER_THREADS -d 3 --sitemap --robots -w -r > .tmp/gospider.txtelse- [ -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 &>/dev/null+ [ -s ".tmp/probed_tmp_scrap.txt" ] && gospider -S .tmp/probed_tmp_scrap.txt --js -t $GOSPIDER_THREADS -d 2 --sitemap --robots -w -r > .tmp/gospider.txt+ fi+ sed -i '/^.\{2048\}./d' .tmp/gospider.txt+ [ -s ".tmp/gospider.txt" ] && cat .tmp/gospider.txt | grep -aEo 'https?://[^ ]+' | sed 's/]$//' | 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/nullfi+ 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 -H "${HEADER}" -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/nullelseresolvers_update_quick_axiomaxiom-scan subdomains/subdomains.txt -m httpx -follow-host-redirects -H \"${HEADER}\" -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@@ -553,19 +554,20 @@ function sub_scraping(){[ -s ".tmp/probed_tmp_scrap.txt" ] && axiom-scan .tmp/probed_tmp_scrap.txt -m httpx -tls-grab -tls-probe -csp-probe -H \"${HEADER}\" -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.txtif [ "$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+ [ -s ".tmp/probed_tmp_scrap.txt" ] && axiom-scan .tmp/probed_tmp_scrap.txt -m gospider --js -d 3 --sitemap --robots -w -r -o .tmp/gospider $AXIOM_EXTRA_ARGS 2>>"$LOGFILE" &>/dev/nullelse- [ -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+ [ -s ".tmp/probed_tmp_scrap.txt" ] && axiom-scan .tmp/probed_tmp_scrap.txt -m gospider --js -d 2 --sitemap --robots -w -r -o .tmp/gospider $AXIOM_EXTRA_ARGS 2>>"$LOGFILE" &>/dev/nullfi+ NUMFILES=0+ touch .tmp/gospider.txt+ [[ -d .tmp/gospider/ ]] && NUMFILES=$(find .tmp/gospider/ -type f | wc -l)+ [[ $NUMFILES -gt 0 ]] && find .tmp/gospider/ -type f -exec cat {} + | sed '/^.\{2048\}./d' | anew -q .tmp/gospider.txt+ [ -s ".tmp/gospider.txt" ] && cat .tmp/gospider.txt | grep -aEo 'https?://[^ ]+' | sed 's/]$//' | unfurl -u domains 2>>"$LOGFILE" | grep ".$domain$" | anew -q .tmp/scrap_subs.txt+ [ -s ".tmp/scrap_subs.txt" ] && axiom-scan .tmp/scrap_subs.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/scrap_subs_resolved.txt $AXIOM_EXTRA_ARGS 2>>"$LOGFILE" &>/dev/null+ [[ "$INSCOPE" = true ]] && check_inscope .tmp/scrap_subs_resolved.txt 2>>"$LOGFILE" &>/dev/null+ 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" ] && axiom-scan .tmp/diff_scrap.txt -m httpx -follow-host-redirects -H \"${HEADER}\" -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 $AXIOM_EXTRA_ARGS 2>>"$LOGFILE" &>/dev/nullfi- 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 -H "${HEADER}" -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.txtcat .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.txtend_subfunc "${NUMOFLINES} new subs (code scraping)" ${FUNCNAME[0]}@@ -652,7 +654,7 @@ function sub_permut(){cat .tmp/permute1.txt .tmp/permute2.txt 2>>"$LOGFILE" | anew -q .tmp/permute_subs.txtif [ -s ".tmp/permute_subs.txt" ]; then- [ -s "$outOfScope_file" ] && deleteOutScoped $outOfScope_file .tmp/permute_subs.txt+ deleteOutScoped $outOfScope_file .tmp/permute_subs.txt[[ "$INSCOPE" = true ]] && check_inscope .tmp/permute_subs.txt 2>>"$LOGFILE" &>/dev/nullNUMOFLINES=$(cat .tmp/permute_subs.txt 2>>"$LOGFILE" | grep ".$domain$" | anew subdomains/subdomains.txt | sed '/^$/d' | wc -l)else@@ -668,38 +670,6 @@ function sub_permut(){fi}-function 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)" ${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-}-function sub_recursive_passive(){if { [ ! -f "$called_fn_dir/.${FUNCNAME[0]}" ] || [ "$DIFF" = true ]; } && [ "$SUB_RECURSIVE_PASSIVE" = true ] && [ -s "subdomains/subdomains.txt" ]; thenstart_subfunc ${FUNCNAME[0]} "Running : Subdomains recursive search passive"@@ -773,16 +743,7 @@ function sub_recursive_brute(){check_inscope .tmp/permute_recursive.txt 2>>"$LOGFILE" &>/dev/nullcheck_inscope .tmp/brute_recursive.txt 2>>"$LOGFILE" &>/dev/nullfi-- # 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)+ NUMOFLINES=$(cat .tmp/permute_recursive.txt .tmp/brute_recursive.txt 2>>"$LOGFILE" | grep "\.$domain$\|^$domain$" | sed '/^$/d' | anew subdomains/subdomains.txt | wc -l)end_subfunc "${NUMOFLINES} new subs (recursive)" ${FUNCNAME[0]}elseif [ "$SUB_RECURSIVE_BRUTE" = false ]; then@@ -799,10 +760,10 @@ function subtakeover(){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.txtif [ ! "$AXIOM" = true ]; then- cat subdomains/subdomains.txt .tmp/webs_all.txt 2>/dev/null | nuclei -silent -nh -tags takeover -severity low,medium,high,critical -r $resolvers_trusted -retries 3 -rl $NUCLEI_RATELIMIT -o .tmp/tko.txt+ cat subdomains/subdomains.txt .tmp/webs_all.txt 2>/dev/null | nuclei -silent -tags takeover -severity low,medium,high,critical -r $resolvers_trusted -retries 3 -rl $NUCLEI_RATELIMIT -o .tmp/tko.txtelsecat 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 -tags takeover -nh -severity low,medium,high,critical -retries 3 -rl $NUCLEI_RATELIMIT -o .tmp/tko.txt $AXIOM_EXTRA_ARGS 2>>"$LOGFILE" &>/dev/null+ [ -s ".tmp/webs_subs.txt" ] && axiom-scan .tmp/webs_subs.txt -m nuclei -tags takeover -severity low,medium,high,critical -retries 3 -rl $NUCLEI_RATELIMIT -o .tmp/tko.txt $AXIOM_EXTRA_ARGS 2>>"$LOGFILE" &>/dev/nullfi# DNS_TAKEOVER@@ -909,7 +870,7 @@ function webprobe_simple(){ficat .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.txtcat webs/web_full_info.txt | jq -r 'try .url' 2>/dev/null | grep "$domain" | sed "s/*.//" | anew -q .tmp/probed_tmp.txt- [ -s "$outOfScope_file" ] && deleteOutScoped $outOfScope_file .tmp/probed_tmp.txt+ deleteOutScoped $outOfScope_file .tmp/probed_tmp.txtNUMOFLINES=$(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.txtend_subfunc "${NUMOFLINES} new websites resolved" ${FUNCNAME[0]}@@ -1186,7 +1147,7 @@ function nuclei_check(){docrit=${array[i]}printf "${yellow}\n Running : Nuclei $crit ${reset}\n\n"- cat .tmp/webs_subs.txt 2>/dev/null | nuclei $NUCLEI_FLAGS -severity $crit -nh -r $resolvers_trusted -rl $NUCLEI_RATELIMIT -o nuclei_output/${crit}.txt+ cat .tmp/webs_subs.txt 2>/dev/null | nuclei $NUCLEI_FLAGS -severity $crit -r $resolvers_trusted -rl $NUCLEI_RATELIMIT -o nuclei_output/${crit}.txtdoneprintf "\n\n"else@@ -1197,7 +1158,7 @@ function nuclei_check(){docrit=${array[i]}printf "${yellow}\n Running : Nuclei $crit ${reset}\n\n"- axiom-scan .tmp/webs_subs.txt -m nuclei -severity ${crit} -nh -rl $NUCLEI_RATELIMIT -o nuclei_output/${crit}.txt $AXIOM_EXTRA_ARGS 2>>"$LOGFILE" &>/dev/null+ axiom-scan .tmp/webs_subs.txt -m nuclei -severity ${crit} -rl $NUCLEI_RATELIMIT -o nuclei_output/${crit}.txt $AXIOM_EXTRA_ARGS 2>>"$LOGFILE" &>/dev/nulldoneprintf "\n\n"fi@@ -1244,7 +1205,6 @@ function fuzz(){donefind $dir/fuzzing/ -type f -iname "*.txt" -exec cat {} + 2>>"$LOGFILE" | anew -q $dir/fuzzing/fuzzing_full.txtfi- sort --numeric-sort --reverse -t ' ' -k1 -k2 -o $dir/fuzzing/fuzzing_full.txt{,}end_func "Results are saved in $domain/fuzzing/*subdomain*.txt" ${FUNCNAME[0]}elseend_func "No $domain/web/webs.txts file found, fuzzing skipped " ${FUNCNAME[0]}@@ -1306,53 +1266,56 @@ function urlchecks(){if [ -s ".tmp/webs_all.txt" ]; thenif [ ! "$AXIOM" = true ]; thenif [ "$URL_CHECK_PASSIVE" = true ]; then- if [ "$DEEP" = true ]; then- python3 $tools/waymore/waymore.py -i .tmp/webs_all.txt -mode U -f -o .tmp/url_extract_tmp.txt &>/dev/null- else- python3 $tools/waymore/waymore.py -i .tmp/webs_all.txt -mode U -f -lcc 1 -o .tmp/url_extract_tmp.txt &>/dev/null- fi+ cat .tmp/webs_all.txt | waybackurls -no-subs | anew -q .tmp/url_extract_tmp.txt+ cat .tmp/webs_all.txt | gau --threads $GAU_THREADS | anew -q .tmp/url_extract_tmp.txtif [ -s "${GITHUB_TOKENS}" ]; thengithub-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.txtfifidiff_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 [ $diff_webs != "0" ] || [ ! -s ".tmp/gospider.txt" ]; thenif [ "$URL_CHECK_ACTIVE" = true ]; thenif [ "$DEEP" = true ]; then- katana -silent -list .tmp/webs_all.txt -jc -kf all -c $KATANA_THREADS -d 3 -fs rdn -o .tmp/katana.txt &>/dev/null+ gospider -S .tmp/webs_all.txt --js -t $GOSPIDER_THREADS -d 3 --sitemap --robots -w -r > .tmp/gospider.txtelse- katana -silent -list .tmp/webs_all.txt -jc -kf all -c $KATANA_THREADS -d 2 -fs rdn -o .tmp/katana.txt &>/dev/null+ gospider -S .tmp/webs_all.txt --js -t $GOSPIDER_THREADS -d 2 --sitemap --robots -w -r > .tmp/gospider.txtfififi+ [ -s ".tmp/gospider.txt" ] && sed -i '/^.\{2048\}./d' .tmp/gospider.txt+ [ -s ".tmp/gospider.txt" ] && cat .tmp/gospider.txt | grep -aEo 'https?://[^ ]+' | sed 's/]$//' | grep -E "^(http|https):[\/]{2}([a-zA-Z0-9\-\.]+\.$domain)" | anew -q .tmp/url_extract_tmp.txtelseif [ "$URL_CHECK_PASSIVE" = true ]; then- axiom-scan .tmp/webs_all.txt -m waymore -o .tmp/url_extract_tmp.txt $AXIOM_EXTRA_ARGS 2>>"$LOGFILE" &>/dev/null+ axiom-scan .tmp/webs_all.txt -m waybackurls -o .tmp/url_extract_way_tmp.txt $AXIOM_EXTRA_ARGS 2>>"$LOGFILE" &>/dev/null+ [ -s ".tmp/url_extract_way_tmp.txt" ] && cat .tmp/url_extract_way_tmp.txt | anew -q .tmp/url_extract_tmp.txt+ axiom-scan .tmp/webs_all.txt -m gau -o .tmp/url_extract_gau_tmp.txt $AXIOM_EXTRA_ARGS 2>>"$LOGFILE" &>/dev/null+ [ -s ".tmp/url_extract_gau_tmp.txt" ] && cat .tmp/url_extract_gau_tmp.txt | anew -q .tmp/url_extract_tmp.txtif [ -s "${GITHUB_TOKENS}" ]; thengithub-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.txtfifidiff_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 [ $diff_webs != "0" ] || [ ! -s ".tmp/gospider.txt" ]; thenif [ "$URL_CHECK_ACTIVE" = true ]; thenif [ "$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+ axiom-scan .tmp/webs_all.txt -m gospider --js -d 3 --sitemap --robots -w -r -o .tmp/gospider $AXIOM_EXTRA_ARGS 2>>"$LOGFILE" &>/dev/nullelse- 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+ axiom-scan .tmp/webs_all.txt -m gospider --js -d 2 --sitemap --robots -w -r -o .tmp/gospider $AXIOM_EXTRA_ARGS 2>>"$LOGFILE" &>/dev/nullfi+ [[ -d .tmp/gospider/ ]] && find .tmp/gospider -type f -exec cat {} + | sed '/^.\{2048\}./d' | anew -q .tmp/gospider.txtfifi+ [[ -d .tmp/gospider/ ]] && NUMFILES=$(find .tmp/gospider/ -type f | wc -l)+ [[ $NUMFILES -gt 0 ]] && cat .tmp/gospider.txt | grep -aEo 'https?://[^ ]+' | sed 's/]$//' | grep -E "^(http|https):[\/]{2}([a-zA-Z0-9\-\.]+\.$domain)" | anew -q .tmp/url_extract_tmp.txtfi- [ -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+ [ -s ".tmp/url_extract_tmp.txt" ] && cat .tmp/url_extract_tmp.txt | grep "${domain}" | grep -aEi "\.(js)" | anew -q js/url_extract_js.txtif [ "$DEEP" = true ]; then- [ -s ".tmp/url_extract_js.txt" ] && cat .tmp/url_extract_js.txt | python3 $tools/JSA/jsa.py | anew -q .tmp/url_extract_tmp.txt+ [ -s "js/url_extract_js.txt" ] && cat js/url_extract_js.txt | python3 $tools/JSA/jsa.py | anew -q .tmp/url_extract_tmp.txtfi[ -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.py | anew -q .tmp/url_extract_uddup.txt 2>>"$LOGFILE" &>/dev/null+ [ -s ".tmp/url_extract_tmp2.txt" ] && cat .tmp/url_extract_tmp2.txt | $tools/urless/urless.py | anew -q .tmp/url_extract_uddup.txt 2>>"$LOGFILE" &>/dev/nullNUMOFLINES=$(cat .tmp/url_extract_uddup.txt 2>>"$LOGFILE" | anew webs/url_extract.txt | sed '/^$/d' | wc -l)notification "${NUMOFLINES} new urls with params" infoend_func "Results are saved in $domain/webs/url_extract.txt" ${FUNCNAME[0]}@@ -1426,22 +1389,21 @@ function url_ext(){function jschecks(){if { [ ! -f "$called_fn_dir/.${FUNCNAME[0]}" ] || [ "$DIFF" = true ]; } && [ "$JSCHECKS" = true ]; thenstart_func ${FUNCNAME[0]} "Javascript Scan"- if [ -s ".tmp/url_extract_js.txt" ]; then+ if [ -s "js/url_extract_js.txt" ]; thenprintf "${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+ cat js/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.txtelse- axiom-scan .tmp/url_extract_js.txt -m subjs -o .tmp/subjslinks.txt $AXIOM_EXTRA_ARGS 2>>"$LOGFILE" &>/dev/null+ axiom-scan js/url_extract_js.txt -m subjs -o .tmp/subjslinks.txt $AXIOM_EXTRA_ARGS 2>>"$LOGFILE" &>/dev/nullfi[ -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.py | anew -q js/url_extract_js.txt 2>>"$LOGFILE" &>/dev/null+ [ -s ".tmp/subjslinks.txt" ] && cat .tmp/subjslinks.txt | grep -iE "\.js" | anew -q js/url_extract_js.txtprintf "${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+ [ -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 -retries 2 -no-color | grep "[200]" | cut -d ' ' -f1 | anew -q js/js_livelinks.txtelse- [ -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+ [ -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 -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]" | cut -d ' ' -f1 | anew -q js/js_livelinks.txtfiprintf "${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 &>/dev/null@@ -1451,9 +1413,9 @@ function jschecks(){fiprintf "${yellow} Running : Gathering secrets 4/5${reset}\n"if [ ! "$AXIOM" = true ]; then- [ -s "js/js_livelinks.txt" ] && cat js/js_livelinks.txt | nuclei -silent -t ~/nuclei-templates/ $NUCLEI_FLAGS_JS -nh -r $resolvers_trusted -retries 3 -rl $NUCLEI_RATELIMIT -o js/js_secrets.txt 2>>"$LOGFILE" &>/dev/null+ [ -s "js/js_livelinks.txt" ] && cat js/js_livelinks.txt | nuclei -silent -t ~/nuclei-templates/ $NUCLEI_FLAGS_JS -r $resolvers_trusted -retries 3 -rl $NUCLEI_RATELIMIT -o js/js_secrets.txt 2>>"$LOGFILE" &>/dev/nullelse- [ -s "js/js_livelinks.txt" ] && axiom-scan js/js_livelinks.txt -m nuclei $NUCLEI_FLAGS_JS -retries 3 -nh -rl $NUCLEI_RATELIMIT -o js/js_secrets.txt $AXIOM_EXTRA_ARGS 2>>"$LOGFILE" &>/dev/null+ [ -s "js/js_livelinks.txt" ] && axiom-scan js/js_livelinks.txt -m nuclei $NUCLEI_FLAGS_JS -retries 3 -rl $NUCLEI_RATELIMIT -o js/js_secrets.txt $AXIOM_EXTRA_ARGS 2>>"$LOGFILE" &>/dev/nullfiprintf "${yellow} Running : Building wordlist 5/5${reset}\n"[ -s "js/js_livelinks.txt" ] && rush -j ${INTERLACE_THREADS} -i js/js_livelinks.txt "python3 $tools/getjswords.py '{}' | anew -q webs/dict_words.txt" &>/dev/null@@ -1536,25 +1498,25 @@ function brokenLinks(){start_func ${FUNCNAME[0]} "Broken links checks"[ ! -s ".tmp/webs_all.txt" ] && cat webs/webs.txt webs/webs_uncommon_ports.txt 2>/dev/null | anew -q .tmp/webs_all.txtif [ ! "$AXIOM" = true ]; then- if [ ! -s ".tmp/katana.txt" ]; then+ if [ ! -s ".tmp/gospider.txt" ]; thenif [ "$DEEP" = true ]; then- [ -s ".tmp/webs_all.txt" ] && katana -silent -list .tmp/webs_all.txt -jc -kf all -c $KATANA_THREADS -d 3 -o .tmp/katana.txt &>/dev/null+ [ -s ".tmp/webs_all.txt" ] && gospider -S .tmp/webs_all.txt --js -t $GOSPIDER_THREADS -d 3 --sitemap --robots -w -r > .tmp/gospider.txtelse- [ -s ".tmp/webs_all.txt" ] && katana -silent -list .tmp/webs_all.txt -jc -kf all -c $KATANA_THREADS -d 2 -o .tmp/katana.txt &>/dev/null+ [ -s ".tmp/webs_all.txt" ] && gospider -S .tmp/webs_all.txt --js -t $GOSPIDER_THREADS -d 2 --sitemap --robots -w -r > .tmp/gospider.txtfifi- [ -s ".tmp/katana.txt" ] && sed -i '/^.\{2048\}./d' .tmp/katana.txt+ [ -s ".tmp/gospider.txt" ] && sed -i '/^.\{2048\}./d' .tmp/gospider.txtelse- if [ ! -s ".tmp/katana.txt" ]; then+ if [ ! -s ".tmp/gospider.txt" ]; thenif [ "$DEEP" = true ]; then- [ -s ".tmp/webs_all.txt" ] && axiom-scan .tmp/webs_all.txt -m katana -jc -kf all -d 3 -o .tmp/katana.txt $AXIOM_EXTRA_ARGS 2>>"$LOGFILE" &>/dev/null+ [ -s ".tmp/webs_all.txt" ] && axiom-scan .tmp/webs_all.txt -m gospider --js -d 3 --sitemap --robots -w -r -o .tmp/gospider $AXIOM_EXTRA_ARGS 2>>"$LOGFILE" &>/dev/nullelse- [ -s ".tmp/webs_all.txt" ] && axiom-scan .tmp/webs_all.txt -m katana -jc -kf all -d 2 -o .tmp/katana.txt $AXIOM_EXTRA_ARGS 2>>"$LOGFILE" &>/dev/null+ [ -s ".tmp/webs_all.txt" ] && axiom-scan .tmp/webs_all.txt -m gospider --js -d 2 --sitemap --robots -w -r -o .tmp/gospider $AXIOM_EXTRA_ARGS 2>>"$LOGFILE" &>/dev/nullfi- [ -s ".tmp/katana.txt" ] && sed -i '/^.\{2048\}./d' .tmp/katana.txt+ find .tmp/gospider -type f -exec cat {} + | sed '/^.\{2048\}./d' | anew -q .tmp/gospider.txtfifi- [ -s ".tmp/katana.txt" ] && cat .tmp/katana.txt | sort -u | httpx -follow-redirects -H "${HEADER}" -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+ [ -s ".tmp/gospider.txt" ] && cat .tmp/gospider.txt | grep -aEo 'https?://[^ ]+' | sed 's/]$//' | sort -u | httpx -follow-redirects -H "${HEADER}" -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.txtNUMOFLINES=$(cat .tmp/brokenLinks_total.txt 2>>"$LOGFILE" | anew vulns/brokenLinks.txt | sed '/^$/d' | wc -l)notification "${NUMOFLINES} new broken links found" infoend_func "Results are saved in vulns/brokenLinks.txt" ${FUNCNAME[0]}@@ -1668,11 +1630,11 @@ function ssrf_checks(){if [ -z "$COLLAB_SERVER" ]; theninteractsh-client &>.tmp/ssrf_callback.txt &sleep 2- COLLAB_SERVER_FIX="FFUFHASH.$(cat .tmp/ssrf_callback.txt | tail -n1 | cut -c 16-)"+ COLLAB_SERVER_FIX=$(cat .tmp/ssrf_callback.txt | tail -n1 | cut -c 16-)COLLAB_SERVER_URL="http://$COLLAB_SERVER_FIX"INTERACT=trueelse- COLLAB_SERVER_FIX="FFUFHASH.$(echo ${COLLAB_SERVER} | sed -r "s/https?:\/\///")"+ COLLAB_SERVER_FIX=$(echo ${COLLAB_SERVER} | sed -r "s/https?:\/\///")INTERACT=falsefiif [ "$DEEP" = true ] || [[ $(cat gf/ssrf.txt | wc -l) -le $DEEP_LIMIT ]]; then@@ -1749,7 +1711,7 @@ function ssti(){if [ -s "gf/ssti.txt" ]; thencat gf/ssti.txt | qsreplace FUZZ | sed '/FUZZ/!d' | anew -q .tmp/tmp_ssti.txtif [ "$DEEP" = true ] || [[ $(cat .tmp/tmp_ssti.txt | wc -l) -le $DEEP_LIMIT ]]; then- rush -i .tmp/tmp_ssti.txt -j ${INTERLACE_THREADS} "ffuf -v -r -t ${FFUF_THREADS} -rate ${FFUF_RATELIMIT} -H \"${HEADER}\" -w ${ssti_wordlist} -u \"{}\" -mr \"ssti49\" " 2>/dev/null | grep "URL" | sed 's/| URL | //' | anew -q vulns/ssti.txt+ rush -i .tmp/tmp_ssti.txt -j ${INTERLACE_THREADS} "ffuf -v -r -t ${FFUF_THREADS} -rate ${FFUF_RATELIMIT} -H \"${HEADER}\" -w ${ssti_wordlist} -u \"{}\"-mr \"ssti49\" " 2>/dev/null | grep "URL" | sed 's/| URL | //' | anew -q vulns/ssti.txt#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.txtend_func "Results are saved in vulns/ssti.txt" ${FUNCNAME[0]}else@@ -1773,7 +1735,7 @@ function sqli(){cat gf/sqli.txt | qsreplace FUZZ | sed '/FUZZ/!d' | anew -q .tmp/tmp_sqli.txtif [ "$DEEP" = true ] || [[ $(cat .tmp/tmp_sqli.txt | wc -l) -le $DEEP_LIMIT ]]; then- python3 $tools/sqlmap/sqlmap.py -m .tmp/tmp_sqli.txt -b -o --smart --batch --disable-coloring --random-agent --output-dir=vulns/sqlmap &>/dev/null+ python3 /root/Tools/sqlmap/sqlmap.py -m .tmp/tmp_sqli.txt -b -o --smart --batch --disable-coloring --random-agent --output-dir=vulns/sqlmap &>/dev/nullend_func "Results are saved in vulns/sqlmap folder" ${FUNCNAME[0]}elseend_func "Skipping SQLi: Too many URLs to test, try with --deep flag" ${FUNCNAME[0]}@@ -1840,28 +1802,6 @@ function command_injection(){fi}-function 4xxbypass(){- if { [ ! -f "$called_fn_dir/.${FUNCNAME[0]}" ] || [ "$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- start_func "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 ${FUNCNAME[0]} @ line ${LINENO}"; exit 1; }- byp4xx -threads $BYP4XX_THREADS $dir/.tmp/403test.txt > $dir/.tmp/byp4xx.txt- cd "$dir" || { echo "Failed to cd directory in ${FUNCNAME[0]} @ line ${LINENO}"; exit 1; }- [ -s ".tmp/byp4xx.txt" ] && cat .tmp/dirdar.txt | anew -q vulns/byp4xx.txt- end_func "Results are saved in vulns/byp4xx.txt" ${FUNCNAME[0]}- else- notification "Too many urls to bypass, skipping" warn- fi- else- if [ "$BYPASSER4XX" = 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-}-function prototype_pollution(){if { [ ! -f "$called_fn_dir/.${FUNCNAME[0]}" ] || [ "$DIFF" = true ]; } && [ "$PROTO_POLLUTION" = true ] ; thenstart_func ${FUNCNAME[0]} "Prototype Pollution checks"@@ -1930,15 +1870,15 @@ function webcache(){###############################################################################################################function deleteOutScoped(){- if [ -s "$1" ]; then+ if [ -z "$1" ]; thencat $1 | while read outscopeddo- if grep -q "^[*]" <<< $outscoped+ if grep -q "^[*]" <<< $outscopedthenoutscoped="${outscoped:1}"- sed -i /"$outscoped$"/d $2+ sed -i /"$outscoped$"/d $2else- sed -i /$outscoped/d $2+ sed -i /$outscoped/d $2fidonefi@@ -1960,12 +1900,12 @@ function getElapsedTime {function zipSnedOutputFolder {zip_name=`date +"%Y_%m_%d-%H.%M.%S"`zip_name="$zip_name"_"$domain.zip"- (cd $dir && zip -r "$zip_name" .)+ (cd $dir && zip -r "../$zip_name" .)- echo "Sending zip file "${dir}/${zip_name}""- if [ -s "${dir}/$zip_name" ]; then- sendToNotify "$dir/$zip_name"- rm -f "${dir}/$zip_name"+ echo "Sending zip file "${dir_output}/${zip_name}""+ if [ -s "$dir_output/$zip_name" ]; then+ sendToNotify "$dir_output/$zip_name"+ rm -f "$dir_output/$zip_name"elsenotification "No Zip file to send" warnfi@@ -2094,8 +2034,8 @@ function resolvers_update(){dnsvalidator -tL https://raw.githubusercontent.com/blechschmidt/massdns/master/lists/resolvers.txt -threads $DNSVALIDATOR_THREADS -o tmp_resolvers &>/dev/null[ -s "tmp_resolvers" ] && cat tmp_resolvers | anew -q $resolvers[ -s "tmp_resolvers" ] && rm -f tmp_resolvers &>/dev/null- [ ! -s "$resolvers" ] && wget -q -O - ${resolvers_url} > $resolvers- [ ! -s "$resolvers_trusted" ] && wget -q -O - ${resolvers_trusted_url} > $resolvers_trusted+ [ ! -s "$resolvers" ] && wget -q -O - $resolvers_url > $resolvers+ [ ! -s "$resolvers_trusted" ] && wget -q -O - $resolvers_trusted_url > $resolvers_trustednotification "Updated\n" goodfielse@@ -2111,8 +2051,8 @@ function resolvers_update(){if [ ! -s "$resolvers" ] || [[ $(find "$resolvers" -mtime +1 -print) ]] ; thennotification "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+ wget -q -O - $resolvers_url > $resolvers+ wget -q -O - $resolvers_trusted_url > $resolvers_trustednotification "Resolvers updated\n" goodfifi@@ -2120,8 +2060,8 @@ function resolvers_update(){function resolvers_update_quick_local(){if [ "$update_resolvers" = true ]; then- wget -q -O - ${resolvers_url} > $resolvers- wget -q -O - ${resolvers_trusted_url} > $resolvers_trusted+ wget -q -O - $resolvers_url > $resolvers+ wget -q -O - $resolvers_trusted_url > $resolvers_trustedfi}@@ -2764,8 +2704,58 @@ function help(){printf " \n"printf " Full recon with custom output and excluded subdomains list:\n"printf " ./reconftw.sh -d example.com -x out.txt -a -o custom/path\n"+ printf " \n"+ printf " start the web server:\n"+ printf " ./reconftw.sh --web-server start\n"+ printf " \n"+ printf " stop the web server:\n"+ printf " ./reconftw.sh --web-server stop\n"}+###############################################################################################################+############################################# WEB SERVER ######################################################+###############################################################################################################++# webserver initialization, thanks @lur1el, @d3vchac, @mx61tt and @dd4n1b0y <3+++function webserver(){+ printf "${bgreen} Web Interface by @lur1el, @d3vchac, @mx61tt and @dd4n1b0y ${reset}\n"+ if [ "$1" == "start" ]; then+ ipAddress=$(hostname -I | cut -d ' ' -f1 | sed -e 's/ //')++ if [ "$ipAddress" != "" ]; then+ printf "\n ${bblue}Starting web server... ${reset}\n"+ cd web+ $SUDO source .venv/bin/activate+ # $SUDO service postgresql start+ $SUDO screen -S ReconftwWebserver -X kill &>/dev/null+ $SUDO screen -dmS ReconftwWebserver python3 manage.py runserver $ipAddress:8001 &>/dev/null+ $SUDO service redis-server start &>/dev/null+ $SUDO screen -S ReconftwCelery -X kill &>/dev/null+ $SUDO screen -dmS ReconftwCelery python3 -m celery -A web worker -l info -P prefork -Q run_scans,default &>/dev/null+ printf " ${bblue}Web server started! ${reset}\n"+ printf " ${bblue}Service Address: http://$ipAddress:8001${reset}\n"+ else+ printf "\n"+ printf " ${red}Server IP address not found.${reset}\n"+ printf "\n"+ printf " ${bblue}Check if the server has internet connection.${reset}\n"+ fi+ elif [ "$1" == "stop" ]; then+ printf "\n ${bblue}Stoping web server... ${reset}\n"+ # $SUDO service postgresql stop+ $SUDO screen -S ReconftwWebserver -X kill &>/dev/null+ $SUDO service redis-server stop &>/dev/null+ $SUDO screen -S ReconftwCelery -X kill &>/dev/null+ printf " ${bblue}Web server stoped! ${reset}\n"+ else+ printf "\n"+ printf " ${red}Invalid action${reset}\n"+ printf "\n"+ printf " ${bblue}Valid actions: start/stop${reset}\n"+ fi+}########################################################################################################################################################## START SCRIPT #####################################################@@ -2777,7 +2767,7 @@ if [[ "$OSTYPE" == "darwin"* ]]; thenPATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH"fi-PROGARGS=$(getopt -o 'd:m:l:x:i:o:f:q:c:rspanwvh::' --long 'domain:,list:,recon,subdomains,passive,all,web,osint,deep,help,vps' -n 'reconFTW' -- "$@")+PROGARGS=$(getopt -o 'd:m:l:x:i:o:f:q:c:rspanwvh::' --long 'domain:,list:,recon,subdomains,passive,all,web,osint,deep,web-server,help,vps' -n 'reconFTW' -- "$@")# Note the quotes around "$PROGARGS": they are essential!@@ -2889,6 +2879,12 @@ while true; doshiftbreak;;+ '--web-server')+ . ./reconftw.cfg+ banner+ webserver $3+ exit 1+ ;;'--help'| '-h'| *)# echo "Unknown argument: $1". ./reconftw.cfg