Skip to content

Commit

Permalink
Fix a typo and add missing build tuples
Browse files Browse the repository at this point in the history
  • Loading branch information
zeroSteiner committed Apr 28, 2021
1 parent dc6f4a6 commit cbd7a31
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions lib/rex/post/meterpreter/ui/console/command_dispatcher/core.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1320,26 +1320,31 @@ def cmd_load(*args)
log_error("Failed to load extension: #{ex.message}")
if ex.kind_of?(ExtensionLoadError) && ex.name
# MetasploitPayloads and MetasploitPayloads::Mettle do things completely differently, build an array of
# suggestion keys (binary_suffixs and Mettle build-tuples)
suggestion_keys = MetasploitPayloads.list_meterpreter_extension_suffixs(ex.name) + MetasploitPayloads::Mettle.available_platforms(ex.name)
# suggestion keys (binary_suffixes and Mettle build-tuples)
suggestion_keys = MetasploitPayloads.list_meterpreter_extension_suffixes(ex.name) + MetasploitPayloads::Mettle.available_platforms(ex.name)
suggestion_map = {
# Extension Suffixes
'jar' => 'java',
'php' => 'php',
'py' => 'python',
'x64.dll' => 'windows/x64',
'x86.dll' => 'windows',
# Mettle Platforms
'aarch64-iphone-darwin' => 'apple_ios/aarch64',
'aarch64-linux-musl' => 'linux/aarch64',
'arm-iphone-darwin' => 'apple_ios/armle',
'armv5b-linux-musleabi' => 'linux/armbe',
'armv5l-linux-musleabi' => 'linux/armle',
'i486-linux-musl' => 'linux/x86',
'mips64-linux-muslsf' => 'linux/mips64',
'mipsel-linux-muslsf' => 'linux/mipsle',
'powerpc64le-linux-musl' => 'linux/ppc64le',
'mips-linux-muslsf' => 'linux/mipsbe',
'powerpc64le-linux-musl' => 'linux/ppc64le',
'powerpc-e500v2-linux-musl' => 'linux/ppce500v2',
'powerpc-linux-muslsf' => 'linux/ppc',
's390x-linux-musl' => 'linux/zarch',
'x86_64-apple-darwin' => 'osx/x64',
'x86_64-linux-musl' => 'linux/x64',
'i486-linux-musl' => 'linux/x86',
'armv5l-linux-musleabi' => 'linux/armle',
'aarch64-linux-musl' => 'linux/aarch64',
'armv5b-linux-musleabi' => 'linux/armbe',
'powerpc-e500v2-linux-musl' => 'linux/ppce500v2',
}
suggestions = suggestion_map.select { |k,_v| suggestion_keys.include?(k) }.values
unless suggestions.empty?
Expand Down

0 comments on commit cbd7a31

Please sign in to comment.