Land #2944, add platforms to encoders

This allows encoders to advertise compatibility with a particular
platform (or more accurately, non-compatibility with everything that
isn't that platform).

See also #2939
bug/bundler_fix
James Lee 2014-02-07 13:37:22 -06:00
commit f0fd2f0598
No known key found for this signature in database
GPG Key ID: 2D6094C7CEA0A321
5 changed files with 7 additions and 4 deletions

View File

@ -746,7 +746,7 @@ class Exploit < Msf::Module
c_arch = (target and target.arch) ? target.arch : (arch == []) ? nil : arch
framework.encoders.each_module_ranked(
'Arch' => c_arch) { |name, mod|
'Arch' => c_arch, 'Platform' => c_platform) { |name, mod|
encoders << [ name, mod ]
}

View File

@ -414,7 +414,7 @@ class Payload < Msf::Module
encoders = []
framework.encoders.each_module_ranked(
'Arch' => self.arch) { |name, mod|
'Arch' => self.arch, 'Platform' => self.platform) { |name, mod|
encoders << [ name, mod ]
}

View File

@ -20,7 +20,8 @@ class Metasploit3 < Msf::Encoder
tricks to avoid commonly restricted characters.
},
'Author' => 'hdm',
'Arch' => ARCH_CMD)
'Arch' => ARCH_CMD,
'Platform' => 'unix')
end

View File

@ -21,7 +21,8 @@ class Metasploit3 < Msf::Encoder
to avoid spaces without being overly fancy.
},
'Author' => 'egypt',
'Arch' => ARCH_CMD)
'Arch' => ARCH_CMD,
'Platform' => 'unix')
end

View File

@ -30,6 +30,7 @@ class Metasploit3 < Msf::Encoder
},
'Author' => 'jduck',
'Arch' => ARCH_CMD,
'Platform' => 'unix',
'EncoderType' => Msf::Encoder::Type::PrintfPHPMagicQuotes)
end