Land #7470, fixes bad file refs for cmdstagers
commit
51ffea3e03
|
@ -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
|
||||||
|
|
|
@ -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)
|
||||||
|
|
|
@ -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'))
|
||||||
|
|
||||||
|
|
|
@ -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' =>
|
||||||
|
|
|
@ -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 ],
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue