@@ -6,45 +6,37 @@ dir=${tools}
6
6
double_check=false
7
7
8
8
# ARM Detection
9
- if [[ $( uname -m) == " amd64" ]] || [[ $( uname -m) == " x86_64" ]]; then
10
- IS_ARM=" False"
11
- fi
12
- if [[ $( uname -m) == " arm64" ]] || [[ $( uname -m) == " armv6l" ]]; then
13
- IS_ARM=" True"
14
- if [[ $( uname -m) == " arm64" ]]; then
15
- RPI_4=" False"
16
- else
17
- RPI_3=" True"
18
- fi
19
- fi
9
+ ARCH=$( uname -m)
10
+ case $ARCH in
11
+ amd64|x86_64) IS_ARM=" False" ;;
12
+ arm64|armv6l)
13
+ IS_ARM=" True"
14
+ RPI_4=$( [[ $ARCH == " arm64" ]] && echo " True" || echo " False" )
15
+ RPI_3=$( [[ $ARCH == " arm64" ]] && echo " False" || echo " True" )
16
+ ;;
17
+ esac
20
18
21
19
# Mac Osx Detecting
22
- if [[ " $OSTYPE " == " darwin" * ]]; then
23
- IS_MAC=" True"
24
- else
25
- IS_MAC=" False"
26
- fi
27
-
28
- # Check Bash version
29
- # (bash --version | awk 'NR==1{print $4}' | cut -d'.' -f1) 2&>/dev/null || echo "Unable to get bash version, for MacOS run 'brew install bash' and rerun installer in a new terminal" && exit 1
20
+ IS_MAC=$( [[ " $OSTYPE " == " darwin" * ]] && echo " True" || echo " False" )
30
21
31
22
BASH_VERSION=$( bash --version | awk ' NR==1{print $4}' | cut -d' .' -f1)
32
23
if [ " ${BASH_VERSION} " -lt 4 ]; then
33
24
printf " ${bred} Your Bash version is lower than 4, please update${reset} \n"
34
- printf " %s Your Bash version is lower than 4, please update%s\n" " ${bred} " " ${reset} "
25
+ printf " %s Your Bash version is lower than 4, please update%s\n" " ${bred} " " ${reset} " >&2
35
26
if [ " True" = " $IS_MAC " ]; then
36
27
printf " ${yellow} For MacOS run 'brew install bash' and rerun installer in a new terminal${reset} \n\n"
37
28
exit 1;
38
29
fi
39
30
fi
40
31
32
+ # Declaring Go tools and their installation commands
41
33
declare -A gotools
42
34
gotools[" gf" ]=" go install -v github.com/tomnomnom/gf@latest"
43
35
gotools[" qsreplace" ]=" go install -v github.com/tomnomnom/qsreplace@latest"
44
36
gotools[" amass" ]=" go install -v github.com/owasp-amass/amass/v3/...@master"
45
37
gotools[" ffuf" ]=" go install -v github.com/ffuf/ffuf/v2@latest"
46
38
gotools[" github-subdomains" ]=" go install -v github.com/gwen001/github-subdomains@latest"
47
- gotools[" gitlab-subdomains" ]=" go install github.com/gwen001/gitlab-subdomains@latest"
39
+ gotools[" gitlab-subdomains" ]=" go install -v github.com/gwen001/gitlab-subdomains@latest"
48
40
gotools[" nuclei" ]=" go install -v github.com/projectdiscovery/nuclei/v2/cmd/nuclei@latest"
49
41
gotools[" anew" ]=" go install -v github.com/tomnomnom/anew@latest"
50
42
gotools[" notify" ]=" go install -v github.com/projectdiscovery/notify/cmd/notify@latest"
@@ -54,7 +46,7 @@ gotools["github-endpoints"]="go install -v github.com/gwen001/github-endpoints@l
54
46
gotools[" dnsx" ]=" go install -v github.com/projectdiscovery/dnsx/cmd/dnsx@latest"
55
47
gotools[" subjs" ]=" go install -v github.com/lc/subjs@latest"
56
48
gotools[" Gxss" ]=" go install -v github.com/KathanP19/Gxss@latest"
57
- gotools[" katana" ]=" go install github.com/projectdiscovery/katana/cmd/katana@latest"
49
+ gotools[" katana" ]=" go install -v github.com/projectdiscovery/katana/cmd/katana@latest"
58
50
gotools[" crlfuzz" ]=" go install -v github.com/dwisiswant0/crlfuzz/cmd/crlfuzz@latest"
59
51
gotools[" dalfox" ]=" go install -v github.com/hahwul/dalfox/v2@latest"
60
52
gotools[" puredns" ]=" go install -v github.com/d3mondev/puredns/v2@latest"
@@ -66,21 +58,22 @@ gotools["mapcidr"]="go install -v github.com/projectdiscovery/mapcidr/cmd/mapcid
66
58
gotools[" cdncheck" ]=" go install -v github.com/projectdiscovery/cdncheck/cmd/cdncheck@latest"
67
59
gotools[" dnstake" ]=" go install -v github.com/pwnesia/dnstake/cmd/dnstake@latest"
68
60
gotools[" gowitness" ]=" go install -v github.com/sensepost/gowitness@latest"
69
- gotools[" tlsx" ]=" go install github.com/projectdiscovery/tlsx/cmd/tlsx@latest"
61
+ gotools[" tlsx" ]=" go install -v github.com/projectdiscovery/tlsx/cmd/tlsx@latest"
70
62
gotools[" gitdorks_go" ]=" go install -v github.com/damit5/gitdorks_go@latest"
71
63
gotools[" smap" ]=" go install -v github.com/s0md3v/smap/cmd/smap@latest"
72
64
gotools[" dsieve" ]=" go install -v github.com/trickest/dsieve@master"
73
- gotools[" inscope" ]=" go install github.com/tomnomnom/hacks/inscope@latest"
74
- gotools[" enumerepo" ]=" go install github.com/trickest/enumerepo@latest"
65
+ gotools[" inscope" ]=" go install -v github.com/tomnomnom/hacks/inscope@latest"
66
+ gotools[" enumerepo" ]=" go install -v github.com/trickest/enumerepo@latest"
75
67
gotools[" Web-Cache-Vulnerability-Scanner" ]=" go install -v github.com/Hackmanit/Web-Cache-Vulnerability-Scanner@latest"
76
68
gotools[" subfinder" ]=" go install -v github.com/projectdiscovery/subfinder/v2/cmd/subfinder@latest"
77
69
gotools[" byp4xx" ]=" go install -v github.com/lobuhi/byp4xx@latest"
78
- gotools[" hakip2host" ]=" go install github.com/hakluke/hakip2host@latest"
70
+ gotools[" hakip2host" ]=" go install -v github.com/hakluke/hakip2host@latest"
79
71
gotools[" gau" ]=" go install -v github.com/lc/gau/v2/cmd/gau@latest"
80
- gotools[" Mantra" ]=" go install github.com/MrEmpy/Mantra@latest"
81
- gotools[" crt" ]=" go install github.com/cemulus/crt@latest"
72
+ gotools[" Mantra" ]=" go install -v github.com/MrEmpy/Mantra@latest"
73
+ gotools[" crt" ]=" go install -v github.com/cemulus/crt@latest"
82
74
gotools[" s3scanner" ]=" go install -v github.com/sa7mon/s3scanner@latest"
83
75
76
+ # Declaring repositories and their paths
84
77
declare -A repos
85
78
repos[" dorks_hunter" ]=" six2dez/dorks_hunter"
86
79
repos[" pwndb" ]=" davidtavarez/pwndb"
@@ -115,7 +108,7 @@ repos["trufflehog"]="trufflesecurity/trufflehog"
115
108
116
109
117
110
function banner_web(){
118
- echo -en " \033c "
111
+ tput clear
119
112
printf " \n${bgreen} "
120
113
printf " ██▀███ ▓█████ ▄████▄ ▒█████ ███▄ █ █████▒▄▄▄█████▓ █ █░\n"
121
114
printf " ▓██ ▒ ██▒▓█ ▀ ▒██▀ ▀█ ▒██▒ ██▒ ██ ▀█ █ ▓██ ▒ ▓ ██▒ ▓▒▓█░ █ ░█░\n"
@@ -130,8 +123,18 @@ function banner_web(){
130
123
printf " ${reconftw_version} by @six2dez\n"
131
124
}
132
125
126
+ function install_ppfuzz() {
127
+ local url=$1
128
+ local tar_file=$2
129
+
130
+ wget -N -c " $url " $DEBUG_STD
131
+ eval $SUDO tar -C /usr/local/bin/ -xzf " $tar_file " $DEBUG_STD
132
+ eval $SUDO rm -rf " $tar_file " $DEBUG_STD
133
+ }
134
+
135
+ # This function installs various tools and repositories as per the configuration.
133
136
function install_tools(){
134
- # eval ln -s /usr/local/bin/pip3 /usr/local/bin/pip3 $DEBUG_STD
137
+
135
138
eval pip3 install -I -r requirements.txt $DEBUG_STD
136
139
137
140
printf " ${bblue} Running: Installing Golang tools (${# gotools[@]} )${reset} \n\n"
@@ -219,28 +222,18 @@ function install_tools(){
219
222
220
223
if [ " True" = " $IS_ARM " ]; then
221
224
if [ " True" = " $RPI_3 " ]; then
222
- eval wget -N -c https://github.com/dwisiswant0/ppfuzz/releases/download/v1.0.1/ppfuzz-v1.0.1-armv7-unknown-linux-gnueabihf.tar.gz $DEBUG_STD
223
- eval $SUDO tar -C /usr/local/bin/ -xzf ppfuzz-v1.0.1-armv7-unknown-linux-gnueabihf.tar.gz $DEBUG_STD
224
- eval $SUDO rm -rf ppfuzz-v1.0.1-armv7-unknown-linux-gnueabihf.tar.gz $DEBUG_STD
225
+ install_ppfuzz " https://github.com/dwisiswant0/ppfuzz/releases/download/v1.0.1/ppfuzz-v1.0.1-armv7-unknown-linux-gnueabihf.tar.gz" " ppfuzz-v1.0.1-armv7-unknown-linux-gnueabihf.tar.gz"
225
226
elif [ " True" = " $RPI_4 " ]; then
226
- eval wget -N -c https://github.com/dwisiswant0/ppfuzz/releases/download/v1.0.1/ppfuzz-v1.0.1-aarch64-unknown-linux-gnueabihf.tar.gz $DEBUG_STD
227
- eval $SUDO tar -C /usr/local/bin/ -xzf ppfuzz-v1.0.1-aarch64-unknown-linux-gnueabihf.tar.gz $DEBUG_STD
228
- eval $SUDO rm -rf ppfuzz-v1.0.1-aarch64-unknown-linux-gnueabihf.tar.gz $DEBUG_STD
227
+ install_ppfuzz " https://github.com/dwisiswant0/ppfuzz/releases/download/v1.0.1/ppfuzz-v1.0.1-aarch64-unknown-linux-gnueabihf.tar.gz" " ppfuzz-v1.0.1-aarch64-unknown-linux-gnueabihf.tar.gz"
229
228
fi
230
229
elif [ " True" = " $IS_MAC " ]; then
231
230
if [ " True" = " $IS_ARM " ]; then
232
- eval wget -N -c https://github.com/dwisiswant0/ppfuzz/releases/download/v1.0.1/ppfuzz-v1.0.1-armv7-unknown-linux-gnueabihf.tar.gz $DEBUG_STD
233
- eval $SUDO tar -C /usr/local/bin/ -xzf ppfuzz-v1.0.1-armv7-unknown-linux-gnueabihf.tar.gz $DEBUG_STD
234
- eval $SUDO rm -rf ppfuzz-v1.0.1-armv7-unknown-linux-gnueabihf.tar.gz $DEBUG_STD
231
+ install_ppfuzz " https://github.com/dwisiswant0/ppfuzz/releases/download/v1.0.1/ppfuzz-v1.0.1-armv7-unknown-linux-gnueabihf.tar.gz" " ppfuzz-v1.0.1-armv7-unknown-linux-gnueabihf.tar.gz"
235
232
else
236
- eval wget -N -c https://github.com/dwisiswant0/ppfuzz/releases/download/v1.0.1/ppfuzz-v1.0.1-x86_64-apple-darwin.tar.gz $DEBUG_STD
237
- eval $SUDO tar -C /usr/local/bin/ -xzf ppfuzz-v1.0.1-x86_64-apple-darwin.tar.gz $DEBUG_STD
238
- eval $SUDO rm -rf ppfuzz-v1.0.1-x86_64-apple-darwin.tar.gz $DEBUG_STD
233
+ install_ppfuzz " https://github.com/dwisiswant0/ppfuzz/releases/download/v1.0.1/ppfuzz-v1.0.1-x86_64-apple-darwin.tar.gz" " ppfuzz-v1.0.1-x86_64-apple-darwin.tar.gz"
239
234
fi
240
235
else
241
- eval wget -N -c https://github.com/dwisiswant0/ppfuzz/releases/download/v1.0.1/ppfuzz-v1.0.1-x86_64-unknown-linux-musl.tar.gz $DEBUG_STD
242
- eval $SUDO tar -C /usr/local/bin/ -xzf ppfuzz-v1.0.1-x86_64-unknown-linux-musl.tar.gz $DEBUG_STD
243
- eval $SUDO rm -rf ppfuzz-v1.0.1-x86_64-unknown-linux-musl.tar.gz $DEBUG_STD
236
+ install_ppfuzz " https://github.com/dwisiswant0/ppfuzz/releases/download/v1.0.1/ppfuzz-v1.0.1-x86_64-unknown-linux-musl.tar.gz" " ppfuzz-v1.0.1-x86_64-unknown-linux-musl.tar.gz"
244
237
fi
245
238
eval $SUDO chmod 755 /usr/local/bin/ppfuzz
246
239
eval $SUDO strip -s /usr/local/bin/ppfuzz $DEBUG_STD
@@ -272,7 +265,14 @@ install_webserver(){
272
265
$SUDO pip3 install -r $SCRIPTPATH /web/requirements.txt & > /dev/null
273
266
274
267
printf " ${yellow} Installing tools...${reset} \n\n"
268
+ if command -v apt > /dev/null; then
275
269
$SUDO apt install redis-server -y & > /dev/null
270
+ elif command -v yum > /dev/null; then
271
+ $SUDO yum install redis -y & > /dev/null
272
+ else
273
+ printf ' [ERROR] Unable to find a supported package manager. Please install redis manually.\n'
274
+ exit 1
275
+ fi
276
276
277
277
printf " ${yellow} Creating WEB User...${reset} \n\n"
278
278
$SUDO rm $SCRIPTPATH /web/db.sqlite3 & > /dev/null
@@ -305,9 +305,15 @@ display_menu(){
305
305
printf " ${bblue} 3. Setup Web Interface${reset} ${yellow} (User Interaction needed!)${reset} \n\n"
306
306
printf " ${bblue} 4. Exit${reset} \n\n"
307
307
printf " ${bgreen} #######################################################################${reset} \n\n"
308
- read -p " $( echo -e $ {bblue} " Insert option: " ${reset} ) " option
308
+ read -p " ${bblue} Insert option: ${reset} " option
309
309
printf " \n\n${bgreen} #######################################################################${reset} \n\n"
310
310
311
+ option=$( echo " $option " | tr -d ' [:space:]' )
312
+ if ! [[ " $option " =~ ^[1-4]$ ]]; then
313
+ printf " ${bred} Invalid option. Please try again.${reset} \n\n"
314
+ continue
315
+ fi
316
+
311
317
case $option in
312
318
1)
313
319
web=false
@@ -354,22 +360,26 @@ display_menu(){
354
360
exit 1
355
361
;;
356
362
* )
357
- printf " ${bblue } Invalid option. Exiting.. .${reset} \n\n"
363
+ printf " ${bred } Invalid option. Please try again .${reset} \n\n"
358
364
exit 1
359
365
;;
360
366
esac
361
367
fi
362
368
done
363
369
}
364
370
365
- if [ " $1 " = ' --tools' ]; then
366
- install_tools
367
- fi
368
-
369
- if [ " $1 " != ' --auto' ]; then
370
- echo " $1 "
371
- display_menu
372
- fi
371
+ case " $1 " in
372
+ --tools)
373
+ install_tools
374
+ ;;
375
+ --auto)
376
+ # possibly some other actions
377
+ ;;
378
+ * )
379
+ echo " $1 "
380
+ display_menu
381
+ ;;
382
+ esac
373
383
374
384
printf " ${yellow} This may take time. So, go grab a coffee! ${reset} \n\n"
375
385
@@ -432,7 +442,11 @@ eval git config --global --unset https.proxy $DEBUG_STD
432
442
433
443
printf " ${bblue} Running: Looking for new reconFTW version${reset} \n\n"
434
444
435
- eval git fetch $DEBUG_STD
445
+ if ! eval git fetch $DEBUG_STD ; then
446
+ echo " Failed to fetch updates."
447
+ exit 1
448
+ fi
449
+
436
450
BRANCH=$( git rev-parse --abbrev-ref HEAD)
437
451
HEADHASH=$( git rev-parse HEAD)
438
452
UPSTREAMHASH=$( git rev-parse " ${BRANCH} @{upstream}" )
@@ -608,6 +622,6 @@ if [ "$web" = true ]; then
608
622
printf " \n${bgreen} Web server is installed, to set it up run ./install.sh and select option 3 ${reset} \n\n"
609
623
fi
610
624
611
- 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} "
625
+ 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\n${reset} "
612
626
printf " ${bgreen} Finished!${reset} \n\n"
613
627
printf " \n\n${bgreen} #######################################################################${reset} \n"
0 commit comments