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

Added BingGPT for subs discovery && removing theHarvester deps

six2dez692d65eb99c6
diff --git a/install.sh b/install.sh
index 0460cdb..0d2cf8c 100755
--- a/install.sh
+++ b/install.sh
@@ -661,6 +661,6 @@ if [ "$web" = true ]; then
install_webserver
fi
-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 - 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 - 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 - WHOISXML API (WHOISXML_API in reconftw.cfg or env var)\n - subgpt_cookies.json (subgpt_cookies.json file, follow instructions at https://github.com/s0md3v/SubGPT#getting-bing-cookie)\n\n\n${reset}"
printf "${bgreen} Finished!${reset}\n\n"
printf "\n\n${bgreen}#######################################################################${reset}\n"
diff --git a/reconftw.cfg b/reconftw.cfg
index 7004f6c..e2c83fb 100644
--- a/reconftw.cfg
+++ b/reconftw.cfg
@@ -26,6 +26,7 @@ export PATH=$GOPATH/bin:$GOROOT/bin:$HOME/.local/bin:$PATH
AMASS_CONFIG=~/.config/amass/config.ini
GITHUB_TOKENS=${tools}/.github_tokens
GITLAB_TOKENS=${tools}/.gitlab_tokens
+SUBGPT_COOKIE=${tools}/subgpt_cookies.json
#CUSTOM_CONFIG=custom_config_path.txt # In case you use a custom config file, uncomment this line and set your files path
# APIs/TOKENS - Uncomment the lines you want removing the '#' at the beginning of the line
@@ -64,6 +65,7 @@ SUBBRUTE=true # DNS bruteforcing
SUBSCRAPING=true # Subdomains extraction from web crawling
SUBPERMUTE=true # DNS permutations
SUBREGEXPERMUTE=true # Permutations by regex analysis
+SUBGPT=true # Permutations by BingGPT prediction
PERMUTATIONS_OPTION=gotator # The alternative is "ripgen" (faster, not deeper)
GOTATOR_FLAGS=" -depth 1 -numbers 3 -mindup -adv -md" # Flags for gotator
SUBTAKEOVER=false # Check subdomain takeovers, false by default cuz nuclei already check this
diff --git a/reconftw.sh b/reconftw.sh
index 3493af8..64014bc 100755
--- a/reconftw.sh
+++ b/reconftw.sh
@@ -114,6 +114,7 @@ function tools_installed(){
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 subgpt &>/dev/null || { printf "${bred} [*] subgpt [NO]${reset}\n${reset}"; allinstalled=false;}
if [ "${allinstalled}" = true ]; then
printf "${bgreen} Good! All installed! ${reset}\n\n"
@@ -342,6 +343,7 @@ function subdomains_full(){
sub_brute
sub_permut
sub_regex_permut
+ sub_gpt
sub_recursive_passive
sub_recursive_brute
sub_dns
@@ -713,6 +715,37 @@ function sub_regex_permut(){
fi
}
+function sub_gpt(){
+ if { [ ! -f "$called_fn_dir/.${FUNCNAME[0]}" ] || [ "$DIFF" = true ]; } && [ "$SUBGPT" = true ] && [ -s "$SUBGPT_COOKIE" ]; then
+ start_subfunc ${FUNCNAME[0]} "Running : Permutations by BingGPT prediction"
+ subgpt -i ${dir}/subdomains/subdomains.txt -c $SUBGPT_COOKIE --dont-resolve -o ${dir}/.tmp/gpt_subs.txt
+ if [ ! "$AXIOM" = true ]; then
+ resolvers_update_quick_local
+ [ -s "${dir}/.tmp/gpt_subs.txt" ] && puredns resolve ${dir}/.tmp/gpt_subs.txt -w .tmp/gpt_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 "${dir}/.tmp/gpt_subs.txt" ] && axiom-scan ${dir}/.tmp/gpt_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/gpt_resolved.txt $AXIOM_EXTRA_ARGS 2>>"$LOGFILE" &>/dev/null
+ fi
+
+ if [ -s ".tmp/gpt_resolved.txt" ]; then
+ [ -s "$outOfScope_file" ] && deleteOutScoped $outOfScope_file .tmp/gpt_resolved.txt
+ [[ "$INSCOPE" = true ]] && check_inscope .tmp/gpt_resolved.txt 2>>"$LOGFILE" &>/dev/null
+ NUMOFLINES=$(cat .tmp/gpt_resolved.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 [ "$SUBGPT" = false ]; then
+ printf "\n${yellow} ${FUNCNAME[0]} skipped in this mode or defined in reconftw.cfg ${reset}\n"
+ elif [ ! -s "$SUBGPT_COOKIE" ]; then
+ printf "\n${yellow} ${FUNCNAME[0]} SUBGPT_COOKIE not defined on config file (reconftw.cfg by default) ${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" ]; then
start_subfunc ${FUNCNAME[0]} "Running : Subdomains recursive search passive"
diff --git a/requirements.txt b/requirements.txt
index 41424b8..90bdbae 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -33,4 +33,4 @@ tldextract # dorks_hunter
tqdm # multiple
ujson # multiple
urllib3 # multiple
-uvloop;platform_system != "Windows" # theHarvester
+subgpt # subgpt
diff --git a/web/apikeys/views.py b/web/apikeys/views.py
index 277e841..8567a52 100644
--- a/web/apikeys/views.py
+++ b/web/apikeys/views.py
@@ -1,7 +1,8 @@
from django.shortcuts import render
from django.contrib.auth.decorators import login_required
from editprofile.imgUser import imgUser
-from apikeys.config import amassConfig, ReconConfig, theHarvesterConfig, GithubConfig, h8mailConfig
+from apikeys.config import amassConfig, ReconConfig, GithubConfig, h8mailConfig
+#from apikeys.config import amassConfig, ReconConfig, theHarvesterConfig, GithubConfig, h8mailConfig
# Create your views here.
otherNames = {'passivedns': '360PassiveDNS', 'digicert': 'CertCentral', 'psbdmp':'Pastebin', 'rikiq':'PassiveTotal', 'quake360':'quake', 'cisco':'Umbrella', 'leaklookup_priv':'leak-lookup_priv', 'leaklookup_pub':'leak-lookup_pub'}
@@ -43,14 +44,14 @@ def conf(request):
GithubConfig(number, key=key)
- elif keys["type"][0] == "TheHarvester":
- del keys["type"]
-
- for key in keys:
- name = key
- key = key=keys[key][0]
- if name != "spyse":
- theHarvesterConfig(name, key=key)
+# elif keys["type"][0] == "TheHarvester":
+# del keys["type"]
+#
+# for key in keys:
+# name = key
+# key = key=keys[key][0]
+# if name != "spyse":
+# theHarvesterConfig(name, key=key)
elif keys["type"][0] == "h8mail":
del keys["type"]
@@ -147,19 +148,19 @@ def index(request):
'token_5_value': GithubConfig('5', get=True),
'token_6_value': GithubConfig('6', get=True),
- 'binaryedge_value': theHarvesterConfig("binaryedge", get=True),
- 'bing_value': theHarvesterConfig("bing", get=True),
- 'censys2_value': theHarvesterConfig("censys", get=True),
- 'fullhunt2_value': theHarvesterConfig("fullhunt", get=True),
- 'github2_value': theHarvesterConfig("github", get=True),
- 'hunter2_value': theHarvesterConfig("hunter", get=True),
- 'intelx2_value': theHarvesterConfig("intelx", get=True),
- 'pentesttools2_value': theHarvesterConfig("pentestTools", get=True),
- 'chaos2_value': theHarvesterConfig("chaos", get=True),
- 'rocketreach_value': theHarvesterConfig("rocketreach", get=True),
- 'securitytrails2_value': theHarvesterConfig("securityTrails", get=True),
- 'shodan3_value': theHarvesterConfig("shodan", get=True),
- 'zoomeye2_value': theHarvesterConfig("zoomeye", get=True),
+# 'binaryedge_value': theHarvesterConfig("binaryedge", get=True),
+# 'bing_value': theHarvesterConfig("bing", get=True),
+# 'censys2_value': theHarvesterConfig("censys", get=True),
+# 'fullhunt2_value': theHarvesterConfig("fullhunt", get=True),
+# 'github2_value': theHarvesterConfig("github", get=True),
+# 'hunter2_value': theHarvesterConfig("hunter", get=True),
+# 'intelx2_value': theHarvesterConfig("intelx", get=True),
+# 'pentesttools2_value': theHarvesterConfig("pentestTools", get=True),
+# 'chaos2_value': theHarvesterConfig("chaos", get=True),
+# 'rocketreach_value': theHarvesterConfig("rocketreach", get=True),
+# 'securitytrails2_value': theHarvesterConfig("securityTrails", get=True),
+# 'shodan3_value': theHarvesterConfig("shodan", get=True),
+# 'zoomeye2_value': theHarvesterConfig("zoomeye", get=True),
'hunter3_value': h8mailConfig("hunter", get=True),
'snusbase_value': h8mailConfig("snusbase", get=True),