Land #7470, fixes bad file refs for cmdstagers

bug/bundler_fix
Pearce Barry 2016-10-21 14:01:04 -05:00
commit 51ffea3e03
No known key found for this signature in database
GPG Key ID: 0916F4DEA5C5DE0A
7 changed files with 12 additions and 12 deletions

View File

@ -26,10 +26,10 @@ module Exploit::CmdStager
# Constant for decoders - used when checking the default flavor decoder. # Constant for decoders - used when checking the default flavor decoder.
DECODERS = { DECODERS = {
:debug_asm => File.join(Msf::Config.install_root, "data", "exploits", "cmdstager", "debug_asm"), :debug_asm => File.join(Rex::Exploitation::DATA_DIR, "exploits", "cmdstager", "debug_asm"),
:debug_write => File.join(Msf::Config.install_root, "data", "exploits", "cmdstager", "debug_write"), :debug_write => File.join(Rex::Exploitation::DATA_DIR, "exploits", "cmdstager", "debug_write"),
:vbs => File.join(Msf::Config.install_root, "data", "exploits", "cmdstager", "vbs_b64"), :vbs => File.join(Rex::Exploitation::DATA_DIR, "exploits", "cmdstager", "vbs_b64"),
:vbs_adodb => File.join(Msf::Config.install_root, "data", "exploits", "cmdstager", "vbs_b64_adodb") :vbs_adodb => File.join(Rex::Exploitation::DATA_DIR, "exploits", "cmdstager", "vbs_b64_adodb")
} }
attr_accessor :stager_instance attr_accessor :stager_instance

View File

@ -201,7 +201,7 @@ SH
end end
def generate_decoder_vbs(opts = {}) def generate_decoder_vbs(opts = {})
decoder_path = File.join(Msf::Config.data_directory, "exploits", "cmdstager", "vbs_b64") decoder_path = File.join(Rex::Exploitation::DATA_DIR, "exploits", "cmdstager", "vbs_b64")
f = File.new(decoder_path, "rb") f = File.new(decoder_path, "rb")
decoder = f.read(f.stat.size) decoder = f.read(f.stat.size)

View File

@ -50,7 +50,7 @@ class MetasploitModule < Msf::Exploit::Remote
'DefaultTarget' => 0, 'DefaultTarget' => 0,
'DefaultOptions' => 'DefaultOptions' =>
{ {
'CMDSTAGER::DECODER' => File.join(Msf::Config.data_directory, "exploits", "cmdstager", "vbs_b64_noquot") 'CMDSTAGER::DECODER' => File.join(Rex::Exploitation::DATA_DIR, "exploits", "cmdstager", "vbs_b64_noquot")
}, },
'DisclosureDate' => 'Jul 29 2013')) 'DisclosureDate' => 'Jul 29 2013'))

View File

@ -44,7 +44,7 @@ class MetasploitModule < Msf::Exploit::Remote
}, },
'DefaultOptions' => 'DefaultOptions' =>
{ {
'CMDSTAGER::DECODER' => File.join(Msf::Config.data_directory, "exploits", "cmdstager", "vbs_b64_noquot") 'CMDSTAGER::DECODER' => File.join(Rex::Exploitation::DATA_DIR, "exploits", "cmdstager", "vbs_b64_noquot")
}, },
'Platform' => 'win', 'Platform' => 'win',
'Targets' => 'Targets' =>

View File

@ -41,7 +41,7 @@ class MetasploitModule < Msf::Exploit::Remote
'WfsDelay' => 30, 'WfsDelay' => 30,
'EXITFUNC' => 'thread', 'EXITFUNC' => 'thread',
'InitialAutoRunScript' => 'post/windows/manage/priv_migrate', 'InitialAutoRunScript' => 'post/windows/manage/priv_migrate',
'CMDSTAGER::DECODER' => File.join(Msf::Config.install_root, "data", "exploits", "cmdstager", "vbs_b64_sleep") 'CMDSTAGER::DECODER' => File.join(Rex::Exploitation::DATA_DIR, "exploits", "cmdstager", "vbs_b64_sleep")
}, },
'Platform' => 'win', 'Platform' => 'win',
'Arch' => [ ARCH_X86, ARCH_X86_64 ], 'Arch' => [ ARCH_X86, ARCH_X86_64 ],

View File

@ -201,7 +201,7 @@ class MetasploitModule < Msf::Post
#:nodelete => true # keep temp files (for debugging) #:nodelete => true # keep temp files (for debugging)
} }
if session.platform =~ /win/i if session.platform =~ /win/i
opts[:decoder] = File.join(Msf::Config.data_directory, 'exploits', 'cmdstager', 'vbs_b64') opts[:decoder] = File.join(Rex::Exploitation::DATA_DIR, "exploits", "cmdstager", 'vbs_b64')
cmdstager = Rex::Exploitation::CmdStagerVBS.new(exe) cmdstager = Rex::Exploitation::CmdStagerVBS.new(exe)
else else
opts[:background] = true opts[:background] = true

View File

@ -601,7 +601,7 @@ RSpec.describe Msf::Exploit::CmdStager do
context "when decoder set in the datastore" do context "when decoder set in the datastore" do
let(:decoder) do let(:decoder) do
File.join(Msf::Config.install_root, "data", "exploits", "cmdstager", "vbs_b64") File.join(Rex::Exploitation::DATA_DIR, "exploits", "cmdstager", "vbs_b64")
end end
subject do subject do
@ -619,7 +619,7 @@ RSpec.describe Msf::Exploit::CmdStager do
context "and decoder set in the opts" do context "and decoder set in the opts" do
let(:decoder_opts) do let(:decoder_opts) do
File.join(Msf::Config.install_root, "data", "exploits", "cmdstager", "vbs_b64_adodb") File.join(Rex::Exploitation::DATA_DIR, "exploits", "cmdstager", "vbs_b64_adodb")
end end
it "returns the decoder_opts" do it "returns the decoder_opts" do
@ -637,7 +637,7 @@ RSpec.describe Msf::Exploit::CmdStager do
context "with :decoder option" do context "with :decoder option" do
let(:decoder) do let(:decoder) do
File.join(Msf::Config.install_root, "data", "exploits", "cmdstager", "vbs_b64") File.join(Rex::Exploitation::DATA_DIR, "exploits", "cmdstager", "vbs_b64")
end end
it "returns the :decoder option" do it "returns the :decoder option" do