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

Removed gotator tmp files && other fixes

six2dez6c8ed6a347a3
diff --git a/reconftw.sh b/reconftw.sh
index 25eeb2c..4e74797 100755
--- a/reconftw.sh
+++ b/reconftw.sh
@@ -195,8 +195,8 @@ function emails(){
cd "$tools/pwndb" || { echo "Failed to cd directory in ${FUNCNAME[0]} @ line ${LINENO}"; exit 1; }
python3 pwndb.py --target "@${domain}" | sed '/^[-]/d' | anew -q $dir/osint/passwords.txt
cd "$dir" || { echo "Failed to cd directory in ${FUNCNAME[0]} @ line ${LINENO}"; exit 1; }
- [ -f "osint/passwords.txt" ] && sed -r -i "s/\x1B\[([0-9]{1,3}(;[0-9]{1,2})?)?[mGK]//g" osint/passwords.txt
- [ -f "osint/passwords.txt" ] && sed -i '1,2d' osint/passwords.txt
+ [ -s "osint/passwords.txt" ] && sed -r -i "s/\x1B\[([0-9]{1,3}(;[0-9]{1,2})?)?[mGK]//g" osint/passwords.txt
+ [ -s "osint/passwords.txt" ] && sed -i '1,2d' osint/passwords.txt
else
text="${yellow}\n pwndb is currently down :(\n\n Check xjypo5vzgmo7jca6b322dnqbsdnp3amd24ybx26x5nxbusccjkm4pwid.onion${reset}\n"
printf "${text}" && printf "${text}" | $NOTIFY
@@ -275,11 +275,11 @@ function subdomains_full(){
sub_scraping
sub_analytics
webprobe_simple
- if [ -f "subdomains/subdomains.txt" ]; then
+ if [ -s "subdomains/subdomains.txt" ]; then
deleteOutScoped $outOfScope_file subdomains/subdomains.txt
NUMOFLINES_subs=$(cat subdomains/subdomains.txt 2>>"$LOGFILE" | anew .tmp/subdomains_old.txt | wc -l)
fi
- if [ -f "webs/webs.txt" ]; then
+ if [ -s "webs/webs.txt" ]; then
deleteOutScoped $outOfScope_file webs/webs.txt
NUMOFLINES_probed=$(cat webs/webs.txt 2>>"$LOGFILE" | anew .tmp/probed_old.txt | wc -l)
fi
@@ -445,22 +445,25 @@ function sub_permut(){
if { [ ! -f "$called_fn_dir/.${FUNCNAME[0]}" ] || [ "$DIFF" = true ]; } && [ "$SUBPERMUTE" = true ]; then
start_subfunc "Running : Permutations Subdomain Enumeration"
if [ "$DEEP" = true ] || [ "$(cat subdomains/subdomains.txt | wc -l)" -le 500 ] ; then
- [ -s "subdomains/subdomains.txt" ] && gotator -sub subdomains/subdomains.txt -perm $tools/permutations_list.txt -depth 1 -numbers 10 -md 2>>"$LOGFILE" | anew -q .tmp/gotator1.txt
+ [ -s "subdomains/subdomains.txt" ] && gotator -sub subdomains/subdomains.txt -perm $tools/permutations_list.txt -depth 1 -numbers 10 -md 2>>"$LOGFILE" > .tmp/gotator1_tmp.txt
+ [ -s ".tmp/gotator1_tmp.txt" ] && cat .tmp/gotator1_tmp.txt | anew -q .tmp/gotator1.txt && rm -f .tmp/gotator1_tmp.txt
elif [ "$(cat subdomains/subdomains.txt | wc -l)" -le 100 ] && [ "$(cat .tmp/subs_no_resolved.txt | wc -l)" -le 500 ]; then
- gotator -sub .tmp/subs_no_resolved.txt -perm $tools/permutations_list.txt -depth 1 -numbers 10 -md 2>>"$LOGFILE" | anew -q .tmp/gotator1.txt
+ gotator -sub .tmp/subs_no_resolved.txt -perm $tools/permutations_list.txt -depth 1 -numbers 10 -md 2>>"$LOGFILE" > .tmp/gotator1_tmp.txt
+ [ -s ".tmp/gotator1_tmp.txt" ] && cat .tmp/gotator1_tmp.txt | anew -q .tmp/gotator1.txt && rm -f .tmp/gotator1_tmp.txt
else
end_subfunc "Skipping Permutations: Too Many Subdomains" ${FUNCNAME[0]}
return 1
fi
[ -s ".tmp/gotator1.txt" ] && puredns resolve .tmp/gotator1.txt -w .tmp/permute1_tmp.txt -r $resolvers --resolvers-trusted $resolvers_trusted -l $PUREDNS_PUBLIC_LIMIT --rate-limit-trusted $PUREDNS_TRUSTED_LIMIT 2>>"$LOGFILE" &>/dev/null
[ -s ".tmp/permute1_tmp.txt" ] && cat .tmp/permute1_tmp.txt | anew -q .tmp/permute1.txt
- [ -s ".tmp/permute1.txt" ] && gotator -sub .tmp/permute1.txt -perm $tools/permutations_list.txt -depth 1 -numbers 10 -md 2>>"$LOGFILE" | anew -q .tmp/gotator2.txt
+ [ -s ".tmp/permute1.txt" ] && gotator -sub .tmp/permute1.txt -perm $tools/permutations_list.txt -depth 1 -numbers 10 -md 2>>"$LOGFILE" > .tmp/gotator2_tmp.txt
+ [ -s ".tmp/gotator2_tmp.txt" ] && cat .tmp/gotator2_tmp.txt | anew -q .tmp/gotator2.txt && rm -f .tmp/gotator2_tmp.txt
[ -s ".tmp/gotator2.txt" ] && puredns resolve .tmp/gotator2.txt -w .tmp/permute2_tmp.txt -r $resolvers --resolvers-trusted $resolvers_trusted -l $PUREDNS_PUBLIC_LIMIT --rate-limit-trusted $PUREDNS_TRUSTED_LIMIT 2>>"$LOGFILE" &>/dev/null
[ -s ".tmp/permute2_tmp.txt" ] && cat .tmp/permute2_tmp.txt | anew -q .tmp/permute2.txt
-
+ eval rm -rf .tmp/gotator*.txt 2>>"$LOGFILE"
cat .tmp/permute1.txt .tmp/permute2.txt 2>>"$LOGFILE" | anew -q .tmp/permute_subs.txt
- if [ -f ".tmp/permute_subs.txt" ]; then
+ if [ -s ".tmp/permute_subs.txt" ]; then
deleteOutScoped $outOfScope_file .tmp/permute_subs.txt
NUMOFLINES=$(cat .tmp/permute_subs.txt 2>>"$LOGFILE" | grep ".$domain$" | anew subdomains/subdomains.txt | wc -l)
else
@@ -481,7 +484,7 @@ function sub_recursive(){
start_subfunc "Running : Subdomains recursive search"
# Passive recursive
if [ "$SUB_RECURSIVE_PASSIVE" = true ]; then
- for sub in $( ( cat subdomains/subdomains.txt | rev | cut -d '.' -f 3,2,1 | rev | sort | uniq -c | sort -nr | grep -v '1 ' && cat subdomains/subdomains.txt | rev | cut -d '.' -f 4,3,2,1 | rev | sort | uniq -c | sort -nr | grep -v '1 ' ) | sed -e 's/^[[:space:]]*//' | cut -d ' ' -f 2);do
+ for sub in $( ( cat subdomains/subdomains.txt | rev | cut -d '.' -f 3,2,1 | rev | sort | uniq -c | sort -nr | grep -v '1 ' | head -n 10 && cat subdomains/subdomains.txt | rev | cut -d '.' -f 4,3,2,1 | rev | sort | uniq -c | sort -nr | grep -v '1 ' | head -n 10 ) | sed -e 's/^[[:space:]]*//' | cut -d ' ' -f 2);do
subfinder -d $sub -all -silent 2>>"$LOGFILE" | anew -q .tmp/passive_recursive.txt
assetfinder --subs-only $sub 2>>"$LOGFILE" | anew -q .tmp/passive_recursive.txt
amass enum -passive -d $sub -config $AMASS_CONFIG 2>>"$LOGFILE" | anew -q .tmp/passive_recursive.txt
@@ -498,12 +501,15 @@ function sub_recursive(){
done
[ -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 -w .tmp/brute_recursive_result.txt 2>>"$LOGFILE" &>/dev/null
[ -s ".tmp/brute_recursive_result.txt" ] && cat .tmp/brute_recursive_result.txt | anew -q .tmp/brute_recursive.txt
- [ -s ".tmp/brute_recursive.txt" ] && gotator -sub .tmp/brute_recursive.txt -perm $tools/permutations_list.txt -depth 1 -numbers 10 -md 2>>"$LOGFILE" | anew -q .tmp/gotator1_recursive.txt
+ [ -s ".tmp/brute_recursive.txt" ] && gotator -sub .tmp/brute_recursive.txt -perm $tools/permutations_list.txt -depth 1 -numbers 10 -md 2>>"$LOGFILE" > .tmp/gotator1_recursivetmp.txt
+ [ -s ".tmp/gotator1_recursivetmp.txt" ] && cat .tmp/gotator1_recursivetmp.txt | anew -q .tmp/gotator1_recursive.txt && rm -f .tmp/gotator1_recursivetmp.txt
[ -s ".tmp/gotator1_recursive.txt" ] && puredns resolve .tmp/gotator1_recursive.txt -w .tmp/permute1_recursive_tmp.txt -r $resolvers --resolvers-trusted $resolvers_trusted -l $PUREDNS_PUBLIC_LIMIT --rate-limit-trusted $PUREDNS_TRUSTED_LIMIT 2>>"$LOGFILE" &>/dev/null
[ -s ".tmp/permute1_recursive_tmp.txt" ] && cat .tmp/permute1_recursive_tmp.txt 2>>"$LOGFILE" | anew -q .tmp/permute1_recursive.txt
- [ -s ".tmp/permute1_recursive.txt" ] && gotator -sub .tmp/permute1_recursive.txt -perm $tools/permutations_list.txt -depth 1 -numbers 10 -md 2>>"$LOGFILE" | anew -q .tmp/gotator2_recursive.txt
+ [ -s ".tmp/permute1_recursive.txt" ] && gotator -sub .tmp/permute1_recursive.txt -perm $tools/permutations_list.txt -depth 1 -numbers 10 -md 2>>"$LOGFILE" > .tmp/gotator2_recursivetmp.txt
+ [ -s ".tmp/gotator2_recursivetmp.txt" ] && cat .tmp/gotator2_recursivetmp.txt | anew -q .tmp/gotator2_recursive.txt && rm -f .tmp/gotator2_recursivetmp.txt
[ -s ".tmp/gotator2_recursive.txt" ] && puredns resolve .tmp/gotator2_recursive.txt -w .tmp/permute2_recursive_tmp.txt -r $resolvers --resolvers-trusted $resolvers_trusted -l $PUREDNS_PUBLIC_LIMIT --rate-limit-trusted $PUREDNS_TRUSTED_LIMIT 2>>"$LOGFILE" &>/dev/null
cat .tmp/permute1_recursive.txt .tmp/permute2_recursive_tmp.txt 2>>"$LOGFILE" | anew -q .tmp/permute_recursive.txt
+ eval rm -rf .tmp/gotator*.txt 2>>"$LOGFILE"
NUMOFLINES=$(cat .tmp/permute_recursive.txt .tmp/brute_recursive.txt 2>>"$LOGFILE" | grep "\.$domain$\|^$domain$" | anew subdomains/subdomains.txt | wc -l)
end_subfunc "${NUMOFLINES} new subs (recursive)" ${FUNCNAME[0]}
else
@@ -855,6 +861,7 @@ function urlchecks(){
if [ -s "webs/webs.txt" ]; then
cat webs/webs.txt | waybackurls | anew -q .tmp/url_extract_tmp.txt
cat webs/webs.txt | gauplus -t $GAUPLUS_THREADS -subs | anew -q .tmp/url_extract_tmp.txt
+ cat webs/webs.txt | nuclei -t ~/nuclei-templates/headless/extract-urls.yaml -headless -silent -no-color | grep "^http" | anew -q .tmp/url_extract_tmp.txt
diff_webs=$(diff <(sort -u .tmp/probed_tmp.txt 2>>"$LOGFILE") <(sort -u webs/webs.txt 2>>"$LOGFILE") | wc -l)
if [ $diff_webs != "0" ] || [ ! -s ".tmp/gospider.txt" ]; then
if [ "$DEEP" = true ]; then
@@ -898,7 +905,7 @@ function url_gf(){
gf ssrf webs/url_extract.txt | anew -q gf/ssrf.txt
gf sqli webs/url_extract.txt | anew -q gf/sqli.txt
gf redirect webs/url_extract.txt | anew -q gf/redirect.txt
- [ -f "gf/ssrf.txt" ] && cat gf/ssrf.txt | anew -q gf/redirect.txt
+ [ -s "gf/ssrf.txt" ] && cat gf/ssrf.txt | anew -q gf/redirect.txt
gf rce webs/url_extract.txt | anew -q gf/rce.txt
gf potential webs/url_extract.txt | cut -d ':' -f3-5 |anew -q gf/potential.txt
[ -s ".tmp/url_extract_tmp.txt" ] && cat .tmp/url_extract_tmp.txt | grep -Eiv "\.(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
@@ -1322,7 +1329,7 @@ function zipSnedOutputFolder {
zip_name=`date +"%Y_%m_%d-%H.%M.%S"`
zip_name="$zip_name"_"$domain.zip"
cd $SCRIPTPATH && zip -r $zip_name $dir &>/dev/null
- if [ -f "$SCRIPTPATH/$zip_name" ]; then
+ if [ -s "$SCRIPTPATH/$zip_name" ]; then
sendToNotify "$SCRIPTPATH/$zip_name"
rm -f "$SCRIPTPATH/$zip_name"
else
@@ -1424,7 +1431,7 @@ function resolvers_update(){
if [ "$update_resolvers" = true ]; then
if [[ $(find "$resolvers" -mtime +1 -print) ]]; then
notification "Resolvers seem older than 1 day\n Generating custom resolvers..." warn
- eval rm -f $resolvers &>/dev/null
+ eval rm -f $resolvers 2>>"$LOGFILE"
dnsvalidator -tL https://public-dns.info/nameservers.txt -threads 100 -o $resolvers &>/dev/null
notification "Updated\n" good
update_resolvers=false
diff --git a/reconftw_axiom.sh b/reconftw_axiom.sh
index 72d8311..5b72c4f 100755
--- a/reconftw_axiom.sh
+++ b/reconftw_axiom.sh
@@ -196,8 +196,8 @@ function emails(){
cd "$tools/pwndb" || { echo "Failed to cd directory in ${FUNCNAME[0]} @ line ${LINENO}"; exit 1; }
python3 pwndb.py --target "@${domain}" | sed '/^[-]/d' | anew -q $dir/osint/passwords.txt
cd "$dir" || { echo "Failed to cd directory in ${FUNCNAME[0]} @ line ${LINENO}"; exit 1; }
- [ -f "osint/passwords.txt" ] && sed -r -i "s/\x1B\[([0-9]{1,3}(;[0-9]{1,2})?)?[mGK]//g" osint/passwords.txt
- [ -f "osint/passwords.txt" ] && sed -i '1,2d' osint/passwords.txt
+ [ -s "osint/passwords.txt" ] && sed -r -i "s/\x1B\[([0-9]{1,3}(;[0-9]{1,2})?)?[mGK]//g" osint/passwords.txt
+ [ -s "osint/passwords.txt" ] && sed -i '1,2d' osint/passwords.txt
else
text="${yellow}\n pwndb is currently down :(\n\n Check xjypo5vzgmo7jca6b322dnqbsdnp3amd24ybx26x5nxbusccjkm4pwid.onion${reset}\n"
printf "${text}" && printf "${text}" | $NOTIFY
@@ -276,11 +276,11 @@ function subdomains_full(){
sub_scraping
sub_analytics
webprobe_simple
- if [ -f "subdomains/subdomains.txt" ]; then
+ if [ -s "subdomains/subdomains.txt" ]; then
deleteOutScoped $outOfScope_file subdomains/subdomains.txt
NUMOFLINES_subs=$(cat subdomains/subdomains.txt 2>>"$LOGFILE" | anew .tmp/subdomains_old.txt | wc -l)
fi
- if [ -f "webs/webs.txt" ]; then
+ if [ -s "webs/webs.txt" ]; then
deleteOutScoped $outOfScope_file webs/webs.txt
NUMOFLINES_probed=$(cat webs/webs.txt 2>>"$LOGFILE" | anew .tmp/probed_old.txt | wc -l)
fi
@@ -457,22 +457,25 @@ function sub_permut(){
if { [ ! -f "$called_fn_dir/.${FUNCNAME[0]}" ] || [ "$DIFF" = true ]; } && [ "$SUBPERMUTE" = true ]; then
start_subfunc "Running : Permutations Subdomain Enumeration"
if [ "$DEEP" = true ] || [ "$(cat subdomains/subdomains.txt | wc -l)" -le 500 ] ; then
- [ -s "subdomains/subdomains.txt" ] && gotator -sub subdomains/subdomains.txt -perm $tools/permutations_list.txt -depth 1 -numbers 10 -md 2>>"$LOGFILE" | anew -q .tmp/gotator1.txt
+ [ -s "subdomains/subdomains.txt" ] && gotator -sub subdomains/subdomains.txt -perm $tools/permutations_list.txt -depth 1 -numbers 10 -md 2>>"$LOGFILE" > .tmp/gotator1_tmp.txt
+ [ -s ".tmp/gotator1_tmp.txt" ] && cat .tmp/gotator1_tmp.txt | anew -q .tmp/gotator1.txt && rm -f .tmp/gotator1_tmp.txt
elif [ "$(cat subdomains/subdomains.txt | wc -l)" -le 100 ] && [ "$(cat .tmp/subs_no_resolved.txt | wc -l)" -le 500 ]; then
- gotator -sub .tmp/subs_no_resolved.txt -perm $tools/permutations_list.txt -depth 1 -numbers 10 -md 2>>"$LOGFILE" | anew -q .tmp/gotator1.txt
+ gotator -sub .tmp/subs_no_resolved.txt -perm $tools/permutations_list.txt -depth 1 -numbers 10 -md 2>>"$LOGFILE" > .tmp/gotator1_tmp.txt
+ [ -s ".tmp/gotator1_tmp.txt" ] && cat .tmp/gotator1_tmp.txt | anew -q .tmp/gotator1.txt && rm -f .tmp/gotator1_tmp.txt
else
end_subfunc "Skipping Permutations: Too Many Subdomains" ${FUNCNAME[0]}
return 1
fi
[ -s ".tmp/gotator1.txt" ] && axiom-scan .tmp/gotator1.txt -m puredns-resolve -r /home/op/lists/resolvers.txt -o .tmp/permute1_tmp.txt 2>>"$LOGFILE" &>/dev/null
[ -s ".tmp/permute1_tmp.txt" ] && cat .tmp/permute1_tmp.txt | anew -q .tmp/permute1.txt
- [ -s ".tmp/permute1.txt" ] && gotator -sub .tmp/permute1.txt -perm $tools/permutations_list.txt -depth 1 -numbers 10 -md 2>>"$LOGFILE" | anew -q .tmp/gotator2.txt
+ [ -s ".tmp/permute1.txt" ] && gotator -sub .tmp/permute1.txt -perm $tools/permutations_list.txt -depth 1 -numbers 10 -md 2>>"$LOGFILE" > .tmp/gotator2_tmp.txt
+ [ -s ".tmp/gotator2_tmp.txt" ] && cat .tmp/gotator2_tmp.txt | anew -q .tmp/gotator2.txt && rm -f .tmp/gotator2_tmp.txt
[ -s ".tmp/gotator2.txt" ] && axiom-scan .tmp/gotator2.txt -m puredns-resolve -r /home/op/lists/resolvers.txt -o .tmp/permute2_tmp.txt 2>>"$LOGFILE" &>/dev/null
[ -s ".tmp/permute2_tmp.txt" ] && cat .tmp/permute2_tmp.txt | anew -q .tmp/permute2.txt
-
+ eval rm -rf .tmp/gotator*.txt 2>>"$LOGFILE"
cat .tmp/permute1.txt .tmp/permute2.txt 2>>"$LOGFILE" | anew -q .tmp/permute_subs.txt
- if [ -f ".tmp/permute_subs.txt" ]; then
+ if [ -s ".tmp/permute_subs.txt" ]; then
deleteOutScoped $outOfScope_file .tmp/permute_subs.txt
NUMOFLINES=$(cat .tmp/permute_subs.txt 2>>"$LOGFILE" | grep ".$domain$" | anew subdomains/subdomains.txt | wc -l)
else
@@ -493,7 +496,7 @@ function sub_recursive(){
start_subfunc "Running : Subdomains recursive search"
# Passive recursive
if [ "$SUB_RECURSIVE_PASSIVE" = true ]; then
- for sub in $( ( cat subdomains/subdomains.txt | rev | cut -d '.' -f 3,2,1 | rev | sort | uniq -c | sort -nr | grep -v '1 ' && cat subdomains/subdomains.txt | rev | cut -d '.' -f 4,3,2,1 | rev | sort | uniq -c | sort -nr | grep -v '1 ' ) | sed -e 's/^[[:space:]]*//' | cut -d ' ' -f 2);do
+ for sub in $( ( cat subdomains/subdomains.txt | rev | cut -d '.' -f 3,2,1 | rev | sort | uniq -c | sort -nr | grep -v '1 ' | head -n 10 && cat subdomains/subdomains.txt | rev | cut -d '.' -f 4,3,2,1 | rev | sort | uniq -c | sort -nr | grep -v '1 ' | head -n 10 ) | sed -e 's/^[[:space:]]*//' | cut -d ' ' -f 2);do
echo $sub | anew -q .tmp/sub_pass_recur_target.com
done
if [ -s ".tmp/sub_pass_recur_target.com" ]; then
@@ -514,12 +517,15 @@ function sub_recursive(){
done
[ -s ".tmp/brute_recursive_wordlist.txt" ] && axiom-scan .tmp/brute_recursive_wordlist.txt -m puredns-resolve -r /home/op/lists/resolvers.txt -o .tmp/brute_recursive_result.txt 2>>"$LOGFILE" &>/dev/null
[ -s ".tmp/brute_recursive_result.txt" ] && cat .tmp/brute_recursive_result.txt | anew -q .tmp/brute_recursive.txt
- [ -s ".tmp/brute_recursive.txt" ] && gotator -sub .tmp/brute_recursive.txt -perm $tools/permutations_list.txt -depth 1 -numbers 10 -md 2>>"$LOGFILE" | anew -q .tmp/gotator1_recursive.txt
+ [ -s ".tmp/brute_recursive.txt" ] && gotator -sub .tmp/brute_recursive.txt -perm $tools/permutations_list.txt -depth 1 -numbers 10 -md 2>>"$LOGFILE" > .tmp/gotator1_recursivetmp.txt
+ [ -s ".tmp/gotator1_recursivetmp.txt" ] && cat .tmp/gotator1_recursivetmp.txt | anew -q .tmp/gotator1_recursive.txt && rm -f .tmp/gotator1_recursivetmp.txt
[ -s ".tmp/gotator1_recursive.txt" ] && axiom-scan .tmp/gotator1_recursive.txt -m puredns-resolve -r /home/op/lists/resolvers.txt -o .tmp/permute1_recursive_tmp.txt 2>>"$LOGFILE" &>/dev/null
- [ -s ".tmp/permute1_recursive_tmp.txt" ] && cat .tmp/permute1_recursive_tmp.txt | anew -q .tmp/permute1_recursive.txt
- [ -s ".tmp/permute1_recursive.txt" ] && gotator -sub .tmp/permute1_recursive.txt -perm $tools/permutations_list.txt -depth 1 -numbers 10 -md 2>>"$LOGFILE" | anew -q .tmp/gotator2_recursive.txt
+ [ -s ".tmp/permute1_recursive_tmp.txt" ] && cat .tmp/permute1_recursive_tmp.txt 2>>"$LOGFILE" | anew -q .tmp/permute1_recursive.txt
+ [ -s ".tmp/permute1_recursive.txt" ] && gotator -sub .tmp/permute1_recursive.txt -perm $tools/permutations_list.txt -depth 1 -numbers 10 -md 2>>"$LOGFILE" > .tmp/gotator2_recursivetmp.txt
+ [ -s ".tmp/gotator2_recursivetmp.txt" ] && cat .tmp/gotator2_recursivetmp.txt | anew -q .tmp/gotator2_recursive.txt && rm -f .tmp/gotator2_recursivetmp.txt
[ -s ".tmp/gotator2_recursive.txt" ] && axiom-scan .tmp/gotator2_recursive.txt -m puredns-resolve -r /home/op/lists/resolvers.txt -o .tmp/permute2_recursive_tmp.txt 2>>"$LOGFILE" &>/dev/null
cat .tmp/permute1_recursive.txt .tmp/permute2_recursive_tmp.txt 2>>"$LOGFILE" | anew -q .tmp/permute_recursive.txt
+ eval rm -rf .tmp/gotator*.txt 2>>"$LOGFILE"
NUMOFLINES=$(cat .tmp/permute_recursive.txt .tmp/brute_recursive.txt 2>>"$LOGFILE" | grep "\.$domain$\|^$domain$" | anew subdomains/subdomains.txt | wc -l)
end_subfunc "${NUMOFLINES} new subs (recursive)" ${FUNCNAME[0]}
else
@@ -876,9 +882,11 @@ function urlchecks(){
mkdir -p js
if [ -s "webs/webs.txt" ]; then
axiom-scan webs/webs.txt -m waybackurls -o .tmp/url_extract_way_tmp.txt 2>>"$LOGFILE" &>/dev/null
- [ -f ".tmp/url_extract_way_tmp.txt" ] && cat .tmp/url_extract_way_tmp.txt | anew -q .tmp/url_extract_tmp.txt
+ [ -s ".tmp/url_extract_way_tmp.txt" ] && cat .tmp/url_extract_way_tmp.txt | anew -q .tmp/url_extract_tmp.txt
axiom-scan webs/webs.txt -m gau -o .tmp/url_extract_gau_tmp.txt 2>>"$LOGFILE" &>/dev/null
- [ -f ".tmp/url_extract_gau_tmp.txt" ] && cat .tmp/url_extract_gau_tmp.txt | anew -q .tmp/url_extract_tmp.txt
+ [ -s ".tmp/url_extract_gau_tmp.txt" ] && cat .tmp/url_extract_gau_tmp.txt | anew -q .tmp/url_extract_tmp.txt
+ axiom-scan webs/webs.txt -m nuclei -w /home/op/recon/nuclei/headless/extract-urls.yaml -o .tmp/url_extract_nuclei_tmp.txt 2>>"$LOGFILE" &>/dev/null
+ [ -s ".tmp/url_extract_nuclei_tmp.txt" ] && cat .tmp/url_extract_nuclei_tmp.txt | grep "^http" | anew -q .tmp/url_extract_tmp.txt
diff_webs=$(diff <(sort -u .tmp/probed_tmp.txt) <(sort -u webs/webs.txt) | wc -l)
if [ $diff_webs != "0" ] || [ ! -s ".tmp/gospider.txt" ]; then
if [ "$DEEP" = true ]; then
@@ -923,7 +931,7 @@ function url_gf(){
gf ssrf webs/url_extract.txt | anew -q gf/ssrf.txt
gf sqli webs/url_extract.txt | anew -q gf/sqli.txt
gf redirect webs/url_extract.txt | anew -q gf/redirect.txt
- [ -f "gf/ssrf.txt" ] && cat gf/ssrf.txt | anew -q gf/redirect.txt
+ [ -s "gf/ssrf.txt" ] && cat gf/ssrf.txt | anew -q gf/redirect.txt
gf rce webs/url_extract.txt | anew -q gf/rce.txt
gf potential webs/url_extract.txt | cut -d ':' -f3-5 |anew -q gf/potential.txt
[ -s ".tmp/url_extract_tmp.txt" ] && cat .tmp/url_extract_tmp.txt | grep -Eiv "\.(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
@@ -1349,7 +1357,7 @@ function zipSnedOutputFolder {
zip_name=`date +"%Y_%m_%d-%H.%M.%S"`
zip_name="$zip_name"_"$domain.zip"
cd $SCRIPTPATH && zip -r $zip_name $dir &>/dev/null
- if [ -f "$SCRIPTPATH/$zip_name" ]; then
+ if [ -s "$SCRIPTPATH/$zip_name" ]; then
sendToNotify "$SCRIPTPATH/$zip_name"
rm -f "$SCRIPTPATH/$zip_name"
else