From a13c01ed3eda0034e9de3991d5d59335f614179f Mon Sep 17 00:00:00 2001 From: HD Moore Date: Sun, 21 Jun 2009 15:59:09 +0000 Subject: [PATCH] Load the encoders/nops modules in msfpayload for encoding, load nops in msfencode git-svn-id: file:///home/svn/framework3/trunk@6694 4d416f70-5f16-0410-b530-b9f4589650da --- lib/msf/util/exe.rb | 5 +++-- msfencode | 2 +- msfpayload | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/msf/util/exe.rb b/lib/msf/util/exe.rb index f82f2dc8b4..45d8458420 100644 --- a/lib/msf/util/exe.rb +++ b/lib/msf/util/exe.rb @@ -90,8 +90,8 @@ class EXE return pe end - - def self.to_win32pe_service(framework, code, name="SERVICENAME") + + def self.to_win32pe_service(framework, code, name='SERVICENAME') pe = '' fd = File.open(File.join(File.dirname(__FILE__), "..", "..", "..", "data", "templates", "service.exe"), "rb") @@ -305,6 +305,7 @@ class EXE def self.encode_stub(framework, arch, code) + return code if not framework.encoders framework.encoders.each_module_ranked('Arch' => arch) do |name, mod| begin enc = framework.encoders.create(name) diff --git a/msfencode b/msfencode index 32dda39424..9513b3f9d2 100755 --- a/msfencode +++ b/msfencode @@ -139,7 +139,7 @@ $args.parse(ARGV) { |opt, idx, val| # Initialize the simplified framework instance. $framework = Msf::Simple::Framework.create( - :module_types => [ Msf::MODULE_ENCODER ] + :module_types => [ Msf::MODULE_ENCODER, Msf::MODULE_NOP ] ) # Get the list of encoders to try diff --git a/msfpayload b/msfpayload index 603315e650..e2b34a3a26 100755 --- a/msfpayload +++ b/msfpayload @@ -34,7 +34,7 @@ end # Initialize the simplified framework instance. $framework = Msf::Simple::Framework.create( - :module_types => [ Msf::MODULE_PAYLOAD ] + :module_types => [ Msf::MODULE_PAYLOAD, Msf::MODULE_ENCODER, Msf::MODULE_NOP ] )