diff --git a/lib/msf/core/exploit/cmdstager.rb b/lib/msf/core/exploit/cmdstager.rb index 0129a07493..40ce8a75c6 100644 --- a/lib/msf/core/exploit/cmdstager.rb +++ b/lib/msf/core/exploit/cmdstager.rb @@ -33,7 +33,7 @@ module Exploit::CmdStager raise RuntimeError, "No platform restrictions were specified -- cannot generate cmdstager" end - cmdstager = Rex::Exploitation::CmdStager.new(pl, framework, los, larch) + cmdstager = Rex::Exploitation::CmdStager.new(pl.encoded, framework, los, larch) cmd_list = cmdstager.generate(opts, linelen) if (cmd_list.nil? or cmd_list.length < 1) diff --git a/lib/rex/exploitation/cmdstager.rb b/lib/rex/exploitation/cmdstager.rb index 1f406f42ef..6b291095fe 100644 --- a/lib/rex/exploitation/cmdstager.rb +++ b/lib/rex/exploitation/cmdstager.rb @@ -13,7 +13,7 @@ module Exploitation class CmdStager - def initialize(payload, framework, platform, arch = nil) + def initialize(code, framework, platform, arch = nil) @var_decoder = Rex::Text.rand_text_alpha(5) @var_encoded = Rex::Text.rand_text_alpha(5) @var_batch = Rex::Text.rand_text_alpha(5) @@ -22,7 +22,7 @@ class CmdStager @linelen = 2047 # covers most likely cases # XXX: TODO: support multipl architectures/platforms - @exe = Msf::Util::EXE.to_win32pe(@framework, payload.encoded) + @exe = Msf::Util::EXE.to_win32pe(@framework, code) end