Merge #3476 into #3481 for meterpreter smilies

This incoporates @OJ's fixes as a result of gemification.
bug/bundler_fix
Tod Beardsley 2014-07-03 22:54:56 -05:00
commit a471f298a5
No known key found for this signature in database
GPG Key ID: 1EFFB682ADB9F193
3 changed files with 37 additions and 48 deletions

36
.gitignore vendored
View File

@ -54,31 +54,19 @@ external/source/exploits/**/Release
# Avoid checking in Meterpreter binaries. These are supplied upstream by # Avoid checking in Meterpreter binaries. These are supplied upstream by
# the meterpreter_bins gem. # the meterpreter_bins gem.
data/meterpreter/elevator.x64.dll data/meterpreter/elevator.*.dll
data/meterpreter/elevator.x86.dll data/meterpreter/ext_server_espia.*.dll
data/meterpreter/ext_server_espia.x64.dll data/meterpreter/ext_server_extapi.*.dll
data/meterpreter/ext_server_espia.x86.dll data/meterpreter/ext_server_incognito.*.dll
data/meterpreter/ext_server_extapi.x64.dll data/meterpreter/ext_server_kiwi.*.dll
data/meterpreter/ext_server_extapi.x86.dll data/meterpreter/ext_server_lanattacks.*.dll
data/meterpreter/ext_server_incognito.x64.dll data/meterpreter/ext_server_mimikatz.*.dll
data/meterpreter/ext_server_incognito.x86.dll data/meterpreter/ext_server_priv.*.dll
data/meterpreter/ext_server_kiwi.x64.dll data/meterpreter/ext_server_stdapi.*.dll
data/meterpreter/ext_server_kiwi.x86.dll data/meterpreter/metsrv.*.dll
data/meterpreter/ext_server_lanattacks.x64.dll data/meterpreter/screenshot.*.dll
data/meterpreter/ext_server_lanattacks.x86.dll
data/meterpreter/ext_server_mimikatz.x64.dll
data/meterpreter/ext_server_mimikatz.x86.dll
data/meterpreter/ext_server_priv.x64.dll
data/meterpreter/ext_server_priv.x86.dll
data/meterpreter/ext_server_stdapi.x64.dll
data/meterpreter/ext_server_stdapi.x86.dll
data/meterpreter/metsrv.x64.dll
data/meterpreter/metsrv.x86.dll
data/meterpreter/screenshot.x64.dll
data/meterpreter/screenshot.x86.dll
# Avoid checking in Meterpreter libs that are built from # Avoid checking in Meterpreter libs that are built from
# private source. If you're interested in this functionality, # private source. If you're interested in this functionality,
# check out Metasploit Pro: http://metasploit.com/download # check out Metasploit Pro: http://metasploit.com/download
data/meterpreter/ext_server_pivot.x86.dll data/meterpreter/ext_server_pivot.*.dll
data/meterpreter/ext_server_pivot.x64.dll

View File

@ -45,7 +45,7 @@ class Priv < Extension
elevator_name = Rex::Text.rand_text_alpha_lower( 6 ) elevator_name = Rex::Text.rand_text_alpha_lower( 6 )
elevator_path = MeterpreterBinaries.path(elevator, client.binary_suffix) elevator_path = MeterpreterBinaries.path('elevator', client.binary_suffix)
elevator_path = ::File.expand_path( elevator_path ) elevator_path = ::File.expand_path( elevator_path )

View File

@ -1,4 +1,5 @@
# -*- coding: binary -*- # -*- coding: binary -*-
require 'set'
require 'rex/post/meterpreter' require 'rex/post/meterpreter'
require 'rex/parser/arguments' require 'rex/parser/arguments'
@ -415,23 +416,23 @@ class Console::CommandDispatcher::Core
@@load_opts.parse(args) { |opt, idx, val| @@load_opts.parse(args) { |opt, idx, val|
case opt case opt
when "-l" when "-l"
exts = [] exts = SortedSet.new
msf_path = MeterpreterBinaries.metasploit_data_dir msf_path = MeterpreterBinaries.metasploit_data_dir
gem_path = MeterpreterBinaries.local_dir gem_path = MeterpreterBinaries.local_dir
[msf_path, gem_path].each do |path| [msf_path, gem_path].each do |path|
::Dir.entries(path).each { |f| ::Dir.entries(path).each { |f|
if (::File.file?(::File.join(path, f)) && f =~ /ext_server_(.*)\.#{client.binary_suffix}/ ) if (::File.file?(::File.join(path, f)) && f =~ /ext_server_(.*)\.#{client.binary_suffix}/ )
exts.push($1) unless exts.include?($1) exts.add($1)
end end
} }
end end
print(exts.sort.join("\n") + "\n") print(exts.to_a.join("\n") + "\n")
return true return true
when "-h" when "-h"
cmd_load_help cmd_load_help
return true return true
end end
} }
@ -464,19 +465,19 @@ class Console::CommandDispatcher::Core
end end
def cmd_load_tabs(str, words) def cmd_load_tabs(str, words)
tabs = [] tabs = SortedSet.new
msf_path = MeterpreterBinaries.metasploit_data_dir msf_path = MeterpreterBinaries.metasploit_data_dir
gem_path = MeterpreterBinaries.local_dir gem_path = MeterpreterBinaries.local_dir
[msf_path, gem_path].each do |path| [msf_path, gem_path].each do |path|
::Dir.entries(path).each { |f| ::Dir.entries(path).each { |f|
if (::File.file?(::File.join(path, f)) && f =~ /ext_server_(.*)\.#{client.binary_suffix}/ ) if (::File.file?(::File.join(path, f)) && f =~ /ext_server_(.*)\.#{client.binary_suffix}/ )
if (not extensions.include?($1)) if (not extensions.include?($1))
tabs.push($1) unless tabs.include?($1) tabs.add($1)
end end
end end
} }
end end
return tabs return tabs.to_a
end end
def cmd_use(*args) def cmd_use(*args)
@ -736,10 +737,10 @@ class Console::CommandDispatcher::Core
@@write_opts.parse(args) { |opt, idx, val| @@write_opts.parse(args) { |opt, idx, val|
case opt case opt
when "-f" when "-f"
src_file = val src_file = val
else else
cid = val.to_i cid = val.to_i
end end
} }