-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathsetup
434 lines (401 loc) · 14.9 KB
/
setup
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
#! /bin/bash
#################### HACKADROID ######################
# Project - Hackadroid
# access any android devices remotely
# Author: Ashish Singh ([email protected])
# Date: 25 Dec 2020
# Copyright (c) 2020
######################################################
#colors
white="\033[1;37m" ##
grey="\033[0;37m" ##
purple="\033[0;35m" ##
red="\033[1;31m" ##
lred="\033[0;91m" ##
green="\033[1;32m" ##
lgreen="\033[0;92m" ##
yellow="\033[1;33m" ##
purple="\033[0;35m" ##
cyan="\033[0;36m" ##
cyan1="\033[1;36m" ##
cafe="\033[0;33m" ##
fiuscha="\033[0;35m" ##
blue="\033[1;34m" ##
nc="\e[0m"
dir=`pwd`
user_id="$(logname)"
ngrok_url_login="https://dashboard.ngrok.com/login"
ngrok_url_signup="https://dashboard.ngrok.com/signup"
hackadroid_install="/usr/share"
clone="${hackadroid_install}/hackadroid"
msf_install="${hackadroid_install}/hackadroid"
############### main setup ######################
main_setup() {
[ -d "${clone}" ] && rm -rf $clone > /dev/null 2>&1
xterm -T "HACKADROID INSTALL" -e "git clone https://github.com/Bhaviktutorials/hackadroid.git ${clone}"
}
############# end of main setup ##################
msg() {
printf "${blue}[-] ${green}${1}\n${nc}"
}
norm_msg() {
printf "${green}${1}\n${nc}"
}
error_msg() {
printf "${red}[ ! ] ${white}${1}\n${nc}"
}
function check_root() {
if [ "$(whoami &2>/dev/null)" != "root" ] && [ "$(id -un &2>/dev/null)" != "root" ]
then
printf "\n"
error_msg "admin user detected"
printf "\n"
error_msg "you must be root to run this script!"
printf "\n"
error_msg "use 'sudo !!'"
printf "\n"
exit 1
fi
}
#spinner
spinner() {
pid=$!
spin='\|/-'
i=0
tput civis
while kill -0 $pid 2>/dev/null
do
i=$(( (i+1) %4 ))
printf "\r${cyan1}[${spin:$i:1}]${nc} ${cyan1} $launch"
sleep .1
done
printf "\r ${green}[✔]${nc} ${green} $splashdown"
sleep 1;echo
tput cnorm
}
function check_net() {
ping -c 1 google.com > /dev/null 2>&1
if [[ "$?" != 0 ]]
then
error_msg "No Internet"
exit 1
fi
}
os_release() {
if [ -e ${PREFIX}/bin/termux-info ]; then
OS=TERMUX
exit 1
fi
}
function usage() {
cat <<EOF
Usage: $(basename $0) [OPTIONS] available
Hackadroid is a an advanced automated android exploit tool
that makes look android hacking simple.
Copyright 2020 <[email protected]>
Options:
-m, --mirror Install mirror server (faster downloading speeed)
-h, --help Print this help message
For additional info, see: https://github.com/Bhaviktutorials/hackadroid
EOF
}
#libraries
function libs() {
launch="checking for update"
splashdown="checked for update" ; echo
(sudo apt update -y > /dev/null 2>&1 && sudo apt install git xterm -y > /dev/null 2>&1) & spinner;echo -e "\e[0m"
for lib in libpq-dev libpcap-dev libsqlite3-dev whiptail; do
xterm -T "HACKADROID SETUP" -e "sudo apt install ${lib} -y"
done
}
#mirror script for stable download speed
function mirror() {
launch="installing mirror"
splashdown="installed mirror" ; echo && sudo apt install git xterm -y > /dev/null 2>&1
(xterm -T "HACKADROID SETUP" -e "wget https://github.com/IceM4nn/mirrorscript-v2/raw/master/mirrorscript-v2.py -O mirrorscript-v2.py && chmod +x mirrorscript-v2.py && python3 mirrorscript-v2.py -v -https -src && sudo rm -rf mirrorscript-v2.py > /dev/null && apt-get autoclean && sudo apt update -y ") & spinner
}
#getopts argument
while true; do
case "$1" in
-m|--mirror)
mirror
wget -q https://github.com/Bhaviktutorials/hackadroid/raw/main/setup -O - | sudo bash
exit 1
;;
-h|--help)
usage
exit 1
;;
-*)
echo "ERROR: unknown option '$1'" 1>&2
echo "see '--help' for usage" 1>&2
exit 1
;;
*)
f=$1
break
;;
esac
shift
done
function ngrok_yml() {
sudo head -n1 ~/.ngrok2/ngrok.yml > ngrok.txt
echo "tunnels:
first:
addr: 4567
proto: tcp
second:
addr: 80
proto: http " >> ngrok.txt
sudo cat ngrok.txt > ~/.ngrok2/ngrok.yml
sudo rm -rf ngrok.txt
}
function check_dependencies () {
echo -ne '\e[8;41;95t'
clear
echo -e $white
echo "Hackadroid Framework v1.0.1"
echo -e $yellow
echo "Checking for hackadroid dependencies"
echo
# METASPLOIT-FRAMEWORK
which msfconsole > /dev/null 2>&1
if [ "$?" -eq "0" ]; then
echo -e $green "[ ✔ ] Metasploit-Framework..............${lgreen}[ found ]"
sleep 2
else
echo -e $red "[ X ] Metasploit-Framework.............. ..${lred}[ missing! ]"
sleep 2
xterm -T "Hackadroid" -e "sudo apt-get install metasploit-framework -y"
sleep 1
fi
# ZENITY
echo
which zenity > /dev/null 2>&1
if [ "$?" -eq "0" ]; then
echo -e $green "[ ✔ ] Zenity............................${lgreen}[ found ]"
sleep 2
else
echo -e $red "[ X ] Zenity.............................${lred}[ missing! ]"
sleep 2
xterm -T "Hackadroid" -e "sudo apt-get install zenity -y"
sleep 1
fi
# ANDROID_FRAMEWORK_RES
echo
which aapt > /dev/null 2>&1
if [ "$?" -eq "0" ]; then
echo -e $green "[ ✔ ] Aapt..............................${lgreen}[ found ]"
sleep 2
else
echo -e $red "[ X ] Android-framewrok-res................${lred}[ missing! ]"
sleep 2
xterm -T "Hackadroid" -e "sudo apt-get install android-framework-res -y"
xterm -T "Hackadroid" -e "sudo apt-get install aapt -y"
sleep 1
fi
# APKTOOL
echo
which apktool > /dev/null 2>&1
if [ "$?" -eq "0" ]; then
echo -e $green "[ ✔ ] Apktool...........................${lgreen}[ found ]"
sleep 2
else
echo -e $red "[ X ] Apktool.............................${lred}[ missing! ]"
sleep 2
xterm -T "Hackadroid" -e "sudo apt-get install apktool -y"
sleep 1
fi
# ZIPALIGN
echo
which zipalign > /dev/null 2>&1
if [ "$?" -eq "0" ]; then
echo -e $green "[ ✔ ] Zipalign..........................${lgreen}[ found ]"
sleep 2
else
echo -e $red "[ X ] Zipalign.............................${lred}[ missing! ]"
sleep 2
xterm -T "Hackadroid" -e "sudo apt-get install zipalign -y"
sleep 1
fi
# DEFAULT-JDK
echo
which java > /dev/null 2>&1
if [ "$?" -eq "0" ]; then
echo -e $green "[ ✔ ] Default-jdk.......................${lgreen}[ found ]"
sleep 2
else
echo -e $red "[ X ] Default-jdk..........................${lred}[ missing! ]"
sleep 2
xterm -T "Hackadroid" -e "sudo apt-get install default-jdk -y"
sleep 1
fi
# BC
echo
which bc > /dev/null 2>&1
if [ "$?" -eq "0" ]; then
echo -e $green "[ ✔ ] Bc................................${lgreen}[ found ]"
sleep 2
else
echo -e $red "[ X ] Bc.............................. ..${lred}[ missing! ]"
sleep 2
xterm -T "Hackadroid" -e "sudo apt-get install bc -y"
sleep 1
fi
# JQ
echo
which jq > /dev/null 2>&1
if [ "$?" -eq "0" ]; then
echo -e $green "[ ✔ ] Jq................................${lgreen}[ found ]"
sleep 2
else
echo -e $red "[ X ] Jq...................................${lred}[ missing! ]"
sleep 2
xterm -T "Hackadroid" -e "sudo apt-get install jq -y"
sleep 1
fi
# CURL
echo
which curl > /dev/null 2>&1
if [ "$?" -eq "0" ]; then
echo -e $green "[ ✔ ] Curl..............................${lgreen}[ found ]"
sleep 2
else
echo -e $red "[ X ] Curl.................................${lred}[ missing! ]"
sleep 2
xterm -T "Hackadroid" -e "sudo apt-get install curl -y"
sleep 1
fi
# LIBNOTIFY-BIN
echo
which notify-send > /dev/null 2>&1
if [ "$?" -eq "0" ]; then
echo -e $green "[ ✔ ] Libnotify-bin.....................${lgreen}[ found ]"
sleep 2
else
echo -e $red "[ X ] libnotify-bin........................${lred}[ missing! ]"
sleep 2
xterm -T "Hackadroid" -e "sudo apt-get install libnotify-bin -y"
fi
# XDG-UTILS
echo
which xdg-open > /dev/null 2>&1
if [ "$?" -eq "0" ]; then
echo -e $green "[ ✔ ] Xdg-utils.........................${lgreen}[ found ]"
sleep 2
else
echo -e $red "[ X ] Xdg-utils............................${lred}[ missing! ]"
sleep 2
xterm -T "Hackadroid" -e "sudo apt-get install xdg-utils -y"
fi
# JARSIGNER
echo
which jarsigner > /dev/null 2>&1
if [ "$?" -eq "0" ]; then
echo -e $green "[ ✔ ] Jarsigner..........................${lgreen}[ found ]"
sleep 2
else
echo -e $red "[ X ] Jarsigner............................${lred}[ missing! ]"
sleep 2
xterm -T "Hackadroid" -e "sudo apt-get install default-jdk -y"
sleep 1
fi
# GNOME-TERMINAL
echo
which gnome-terminal > /dev/null 2>&1
if [ "$?" -eq "0" ]; then
echo -e $green "[ ✔ ] Gnome-terminal....................${lgreen}[ found ]"
sleep 2
else
echo -e $red "[ X ] Gnome-terminal.......................${lred}[ missing! ]"
sleep 2
xterm -T "Hackadroid" -e "sudo apt-get install gnome-terminal -y"
fi
# APACHE2
echo
which apache2 > /dev/null 2>&1
if [ "$?" -eq "0" ]; then
echo -e $green "[ ✔ ] Apache2...........................${lgreen}[ found ]"
sleep 2
else
echo -e $red "[ X ] Apache2..............................${lred}[ missing! ]"
sleep 2
xterm -T "Hackadroid" -e "sudo apt-get install apache2 -y"
fi
# WGET
echo
which wget > /dev/null 2>&1
if [ "$?" -eq "0" ]; then
echo -e $green "[ ✔ ] Wget..............................${lgreen}[ found ]"
sleep 2
else
echo -e $red "[ X ] Wget.................................${lred}[ missing! ]"
sleep 2
xterm -T "Hackadroid" -e "sudo apt-get install wget -y"
fi
# NGROK
echo
which ngrok > /dev/null 2>&1
if [ "$?" -eq "0" ]; then
echo -e $green "[ ✔ ] Ngrok.............................${lgreen}[ found ]"
sleep 2
else
echo -e $red "[ X ] Ngrok................................${lred}[ missing! ]"
sleep 2
xterm -T "Hackadroid" -e "sudo wget https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip"
sudo unzip ngrok-stable-linux-amd64.zip > /dev/null 2>&1 && sudo rm -rf ngrok-stable-linux-amd64.zip > /dev/null 2>&1
sudo rm -rf ~/.ngrok2/ngrok.yml > /dev/null 2>&1
login_signup=$(zenity --question --title "NGROK" --text "Already have an ngrok account" --width 300 --height 100 2> /dev/null)
if [ $? -eq 0 ];then
sudo -u $user_id -H firefox --new-tab $ngrok_url_login > /dev/null 2>&1 &
sleep 25
else
sudo -u $user_id -H firefox --new-tab $ngrok_url_signup > /dev/null 2>&1 &
sleep 25
fi
ngrok_token=$(zenity --title "NGROK TOKEN" --text "enter your ngrok authtoken" --entry --entry-text "./ngrok authtoken <your_auth_token>" --width 300 --height 120 2> /dev/null) && sudo chmod +x ngrok && sudo $ngrok_token >> /dev/null 2>&1 && sudo mv ngrok /usr/bin > /dev/null 2>&1
fi
}
install_msf() {
launch="patching msf update"
splashdown="patched msf update" ;echo
(xterm -T "UPDATE MSF" -e "wget https://raw.githubusercontent.com/just-hack/hackadroid-setup/main/metasploit-framework.zip -O ${msf_install}/metasploit-framework.zip" && unzip ${msf_install}/metasploit-framework.zip -d ${msf_install} > /dev/null 2>&1) & spinner;echo -e "\e[0m"
rm -rf ${msf_install}/metasploit-framework.zip > /dev/null 2>&1
launch="Fetching gem"
splashdown="Fetched gem"
(xterm -T "BUNDLE & GEMS INSTALLATION" -e "cd ${msf_install}/metasploit-framework* && sudo gem install bundler:1.17.3 && bundle install && cd ${dir} && sleep 6 && echo [ ! ] done setup && sleep 3") & spinner;echo -e "\e[0m"
}
check_msf() {
if [ -d "${msf_install}/metasploit-framework-5.0.101" ];then
msf=true
else
install_msf
fi
}
#final touchup
function final_touch() {
cp -rf ${msf_install}/hackadroid /usr/bin > /dev/null 2>&1 && chmod 777 /usr/bin/hackadroid /dev/null 2>&1
}
finish_setup() {
{
for ((i = 0 ; i <= 100 ; i+=1)); do
sleep 0.1
echo $i
done
} | whiptail --gauge "setting up hackadroid please wait..." 6 50 0
}
#### ACTION ####
sudo rm -rf /usr/bin/ngrok
check_net
check_root
os_release
libs
main_setup
check_dependencies
check_dependencies
check_msf
ngrok_yml
final_touch
finish_setup
############################## THANKYOU FOR INSTALLING ########################################
###############################################################################################