@@ -169,6 +169,10 @@ function tools_installed() {
169
169
printf " ${bred} [*] regulator [NO]${reset} \n"
170
170
allinstalled=false
171
171
}
172
+ [ -f " ${tools} /dontgo403/dontgo403" ] || {
173
+ printf " ${bred} [*] dontgo403 [NO]${reset} \n"
174
+ allinstalled=false
175
+ }
172
176
command -v github-endpoints & > /dev/null || {
173
177
printf " ${bred} [*] github-endpoints [NO]${reset} \n"
174
178
allinstalled=false
@@ -341,10 +345,6 @@ function tools_installed() {
341
345
printf " ${bred} [*] subfinder [NO]${reset} \n${reset} "
342
346
allinstalled=false
343
347
}
344
- command -v byp4xx & > /dev/null || {
345
- printf " ${bred} [*] byp4xx [NO]${reset} \n${reset} "
346
- allinstalled=false
347
- }
348
348
command -v ghauri & > /dev/null || {
349
349
printf " ${bred} [*] ghauri [NO]${reset} \n${reset} "
350
350
allinstalled=false
@@ -503,24 +503,37 @@ function metadata() {
503
503
spinny::stop
504
504
}
505
505
506
- function postleaks () {
506
+ function apileaks () {
507
507
spinny::start
508
- if { [[ ! -f " $called_fn_dir /.${FUNCNAME[0]} " ]] || [[ $DIFF == true ]]; } && [[ $POSTMAN_LEAKS == true ]] && [[ $OSINT == true ]] && ! [[ $domain =~ ^[0-9]+\. [0-9]+\. [0-9]+\. [0-9] ]]; then
509
- start_func ${FUNCNAME[0]} " Scanning for leaks in postman public directory "
508
+ if { [[ ! -f " $called_fn_dir /.${FUNCNAME[0]} " ]] || [[ $DIFF == true ]]; } && [[ $API_LEAKS == true ]] && [[ $OSINT == true ]] && ! [[ $domain =~ ^[0-9]+\. [0-9]+\. [0-9]+\. [0-9] ]]; then
509
+ start_func ${FUNCNAME[0]} " Scanning for leaks in APIs public directories "
510
510
511
511
porch-pirate -s " $domain " --dump > osint/postman_leaks.txt || {
512
512
echo " porch-pirate command failed"
513
513
exit 1
514
514
}
515
515
516
+ pushd " ${tools} /SwaggerSpy" > /dev/null || {
517
+ echo " Failed to pushd to ${tools} /SwaggerSpy in ${FUNCNAME[0]} @ line ${LINENO} "
518
+ exit 1
519
+ }
520
+ python swaggerspy.py -d $domain -o ../osint/swagger_leaks.txt 2>> " $LOGFILE " || {
521
+ echo " swaggerspy command failed"
522
+ exit 1
523
+ }
524
+ popd > /dev/null || {
525
+ echo " Failed to popd in ${FUNCNAME[0]} @ line ${LINENO} "
526
+ exit 1
527
+ }
528
+
516
529
end_func " Results are saved in $domain /osint/[software/authors/metadata_results].txt" ${FUNCNAME[0]}
517
530
else
518
- if [[ $POSTMAN_LEAKS == false ]] || [[ $OSINT == false ]]; then
531
+ if [[ $API_LEAKS == false ]] || [[ $OSINT == false ]]; then
519
532
printf " \n${yellow} ${FUNCNAME[0]} skipped in this mode or defined in reconftw.cfg ${reset} \n"
520
533
elif [[ $domain =~ ^[0-9]+\. [0-9]+\. [0-9]+\. [0-9] ]]; then
521
534
return
522
535
else
523
- if [[ $POSTMAN_LEAKS == false ]] || [[ $OSINT == false ]]; then
536
+ if [[ $API_LEAKS == false ]] || [[ $OSINT == false ]]; then
524
537
printf " \n${yellow} ${FUNCNAME[0]} skipped in this mode or defined in reconftw.cfg ${reset} \n"
525
538
else
526
539
printf " ${yellow} ${FUNCNAME[0]} is already processed, to force executing ${FUNCNAME[0]} delete\n $called_fn_dir /.${FUNCNAME[0]} ${reset} \n\n"
@@ -996,13 +1009,16 @@ function sub_regex_permut() {
996
1009
spinny::start
997
1010
if { [[ ! -f " $called_fn_dir /.${FUNCNAME[0]} " ]] || [[ $DIFF == true ]]; } && [[ $SUBREGEXPERMUTE == true ]]; then
998
1011
start_subfunc ${FUNCNAME[0]} " Running : Permutations by regex analysis"
999
- cd " ${tools} /regulator" || {
1012
+
1013
+ pushd " ${tools} /regulator" > /dev/null || {
1000
1014
echo " Failed to cd directory in ${FUNCNAME[0]} @ line ${LINENO} "
1001
1015
exit 1
1002
1016
}
1017
+
1003
1018
python3 main.py -t $domain -f ${dir} /subdomains/subdomains.txt -o ${dir} /.tmp/${domain} .brute
1004
- cd " $dir " || {
1005
- echo " Failed to cd to $dir in ${FUNCNAME[0]} @ line ${LINENO} "
1019
+
1020
+ popd > /dev/null || {
1021
+ echo " Failed to popd in ${FUNCNAME[0]} @ line ${LINENO} "
1006
1022
exit 1
1007
1023
}
1008
1024
@@ -1423,10 +1439,11 @@ function favicon() {
1423
1439
spinny::start
1424
1440
if { [[ ! -f " $called_fn_dir /.${FUNCNAME[0]} " ]] || [[ $DIFF == true ]]; } && [[ $FAVICON == true ]] && ! [[ $domain =~ ^[0-9]+\. [0-9]+\. [0-9]+\. [0-9] ]]; then
1425
1441
start_func ${FUNCNAME[0]} " Favicon Ip Lookup"
1426
- cd " ${tools} /fav-up" || {
1442
+ pushd " ${tools} /fav-up" > /dev/null || {
1427
1443
echo " Failed to cd to $dir in ${FUNCNAME[0]} @ line ${LINENO} "
1428
1444
exit 1
1429
1445
}
1446
+
1430
1447
python3 favUp.py -w " $domain " -sc -o favicontest.json 2>> " $LOGFILE " > /dev/null
1431
1448
if [[ -s " favicontest.json" ]]; then
1432
1449
cat favicontest.json | jq -r ' try .found_ips' 2>> " $LOGFILE " | grep -v " not-found" > favicontest.txt
@@ -1435,8 +1452,9 @@ function favicon() {
1435
1452
mv favicontest.txt $dir /hosts/favicontest.txt 2>> " $LOGFILE "
1436
1453
rm -f favicontest.json 2>> " $LOGFILE "
1437
1454
fi
1438
- cd " $dir " || {
1439
- echo " Failed to cd to $dir in ${FUNCNAME[0]} @ line ${LINENO} "
1455
+
1456
+ popd > /dev/null || {
1457
+ echo " Failed to popd in ${FUNCNAME[0]} @ line ${LINENO} "
1440
1458
exit 1
1441
1459
}
1442
1460
end_func " Results are saved in hosts/favicontest.txt" ${FUNCNAME[0]}
@@ -2239,13 +2257,15 @@ function spraying() {
2239
2257
spinny::start
2240
2258
if { [[ ! -f " $called_fn_dir /.${FUNCNAME[0]} " ]] || [[ $DIFF == true ]]; } && [[ $SPRAY == true ]]; then
2241
2259
start_func ${FUNCNAME[0]} " Password spraying"
2242
- cd " ${tools} /brutespray" || {
2260
+
2261
+ pushd " ${tools} /brutespray" > /dev/null || {
2243
2262
echo " Failed to cd directory in ${FUNCNAME[0]} @ line ${LINENO} "
2244
2263
exit 1
2245
2264
}
2265
+
2246
2266
python3 brutespray.py --file $dir /hosts/portscan_active.gnmap --threads $BRUTESPRAY_THREADS --hosts $BRUTESPRAY_CONCURRENCE -o $dir /vulns/brutespray 2>> " $LOGFILE " > /dev/null
2247
- cd " $dir " || {
2248
- echo " Failed to cd directory in ${FUNCNAME[0]} @ line ${LINENO} "
2267
+ popd > /dev/null || {
2268
+ echo " Failed to popd in ${FUNCNAME[0]} @ line ${LINENO} "
2249
2269
exit 1
2250
2270
}
2251
2271
end_func " Results are saved in vulns/brutespray folder" ${FUNCNAME[0]}
@@ -2288,17 +2308,19 @@ function 4xxbypass() {
2288
2308
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
2289
2309
start_func " 403 bypass"
2290
2310
cat $dir /fuzzing/fuzzing_full.txt 2> /dev/null | grep -E ' ^4' | grep -Ev ' ^404' | cut -d ' ' -f3 > $dir /.tmp/403test.txt
2291
- cd " ${tools} /byp4xx" || {
2311
+
2312
+ pushd " ${tools} /dontgo403" > /dev/null || {
2292
2313
echo " Failed to cd directory in ${FUNCNAME[0]} @ line ${LINENO} "
2293
2314
exit 1
2294
2315
}
2295
- byp4xx -threads $BYP4XX_THREADS $dir /.tmp/403test.txt > $dir /.tmp/byp4xx.txt
2296
- cd " $dir " || {
2297
- echo " Failed to cd directory in ${FUNCNAME[0]} @ line ${LINENO} "
2316
+
2317
+ cat $dir /.tmp/403test.txt | ./dontgo403 > $dir /.tmp/4xxbypass.txt
2318
+ popd > /dev/null || {
2319
+ echo " Failed to popd in ${FUNCNAME[0]} @ line ${LINENO} "
2298
2320
exit 1
2299
2321
}
2300
- [ -s " .tmp/byp4xx .txt" ] && cat .tmp/byp4xx .txt | anew -q vulns/byp4xx .txt
2301
- end_func " Results are saved in vulns/byp4xx .txt" ${FUNCNAME[0]}
2322
+ [ -s " .tmp/4xxbypass .txt" ] && cat .tmp/4xxbypass .txt | anew -q vulns/4xxbypass .txt
2323
+ end_func " Results are saved in vulns/4xxbypass .txt" ${FUNCNAME[0]}
2302
2324
else
2303
2325
notification " Too many urls to bypass, skipping" warn
2304
2326
fi
@@ -2339,19 +2361,21 @@ function smuggling() {
2339
2361
start_func ${FUNCNAME[0]} " HTTP Request Smuggling checks"
2340
2362
[ ! -s " .tmp/webs_all.txt" ] && cat webs/webs.txt webs/webs_uncommon_ports.txt 2> /dev/null | anew -q .tmp/webs_all.txt
2341
2363
if [[ $DEEP == true ]] || [[ $( cat .tmp/webs_all.txt | wc -l) -le $DEEP_LIMIT ]]; then
2342
- cd " ${tools} /smuggler" || {
2364
+ pushd " ${tools} /smuggler" > /dev/null || {
2343
2365
echo " Failed to cd directory in ${FUNCNAME[0]} @ line ${LINENO} "
2344
2366
exit 1
2345
2367
}
2346
2368
cat $dir /.tmp/webs_all.txt | python3 smuggler.py -q --no-color 2> /dev/null | anew -q $dir /.tmp/smuggling.txt
2347
- cd " $dir " || {
2348
- echo " Failed to cd to $dir in ${FUNCNAME[0]} @ line ${LINENO} "
2369
+ mkdir -p $dir /vulns/smuggling/
2370
+ find payloads -type f ! -name " README*" -exec mv {} $dir /vulns/smuggling/ \;
2371
+ popd > /dev/null || {
2372
+ echo " Failed to popd in ${FUNCNAME[0]} @ line ${LINENO} "
2349
2373
exit 1
2350
- }
2351
- [ -s " .tmp/smuggling.txt" ] && cat .tmp/smuggling.txt | anew -q vulns/smuggling .txt
2352
- end_func " Results are saved in vulns/smuggling .txt" ${FUNCNAME[0]}
2374
+ }
2375
+ [ -s " .tmp/smuggling.txt" ] && cat .tmp/smuggling.txt | anew -q vulns/smuggling_log .txt
2376
+ end_func " Results are saved in vulns/smuggling_log .txt and findings in vulns/smuggling/ " ${FUNCNAME[0]}
2353
2377
else
2354
- end_func " Skipping Prototype Pollution : Too many webs to test, try with --deep flag" ${FUNCNAME[0]}
2378
+ end_func " Skipping Request Smuggling : Too many webs to test, try with --deep flag" ${FUNCNAME[0]}
2355
2379
fi
2356
2380
else
2357
2381
if [[ $SMUGGLING == false ]]; then
@@ -2369,13 +2393,14 @@ function webcache() {
2369
2393
start_func ${FUNCNAME[0]} " Web Cache Poisoning checks"
2370
2394
[ ! -s " .tmp/webs_all.txt" ] && cat webs/webs.txt webs/webs_uncommon_ports.txt 2> /dev/null | anew -q .tmp/webs_all.txt
2371
2395
if [[ $DEEP == true ]] || [[ $( cat .tmp/webs_all.txt | wc -l) -le $DEEP_LIMIT ]]; then
2372
- cd " ${tools} /Web-Cache-Vulnerability-Scanner" || {
2396
+ pushd " ${tools} /Web-Cache-Vulnerability-Scanner" > /dev/null || {
2373
2397
echo " Failed to cd directory in ${FUNCNAME[0]} @ line ${LINENO} "
2374
2398
exit 1
2375
2399
}
2400
+
2376
2401
Web-Cache-Vulnerability-Scanner -u file:$dir /.tmp/webs_all.txt -v 0 2> /dev/null | anew -q $dir /.tmp/webcache.txt
2377
- cd " $dir " || {
2378
- echo " Failed to cd to $dir in ${FUNCNAME[0]} @ line ${LINENO} "
2402
+ popd > /dev/null || {
2403
+ echo " Failed to popd in ${FUNCNAME[0]} @ line ${LINENO} "
2379
2404
exit 1
2380
2405
}
2381
2406
[ -s " .tmp/webcache.txt" ] && cat .tmp/webcache.txt | anew -q vulns/webcache.txt
@@ -2851,6 +2876,7 @@ function passive() {
2851
2876
github_dorks
2852
2877
github_repos
2853
2878
metadata
2879
+ apileaks
2854
2880
SUBNOERROR=false
2855
2881
SUBANALYTICS=false
2856
2882
SUBBRUTE=false
@@ -2893,6 +2919,7 @@ function osint() {
2893
2919
github_dorks
2894
2920
github_repos
2895
2921
metadata
2922
+ apileaks
2896
2923
zonetransfer
2897
2924
favicon
2898
2925
}
@@ -2977,6 +3004,7 @@ function multi_osint() {
2977
3004
github_dorks
2978
3005
github_repos
2979
3006
metadata
3007
+ apileaks
2980
3008
zonetransfer
2981
3009
favicon
2982
3010
done
@@ -2997,6 +3025,7 @@ function recon() {
2997
3025
github_dorks
2998
3026
github_repos
2999
3027
metadata
3028
+ apileaks
3000
3029
zonetransfer
3001
3030
favicon
3002
3031
@@ -3095,6 +3124,7 @@ function multi_recon() {
3095
3124
github_dorks
3096
3125
github_repos
3097
3126
metadata
3127
+ apileaks
3098
3128
zonetransfer
3099
3129
favicon
3100
3130
currently=$( date +" %H:%M:%S" )
0 commit comments