Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support enumerating platforms for a extension #215

Merged
merged 3 commits into from
Jun 9, 2021

Conversation

zeroSteiner
Copy link
Contributor

@zeroSteiner zeroSteiner commented Apr 27, 2021

This allows enumerating the platforms (build tuples) that a particular extension has built binaries for. This is foundational work for Metasploit to be able to identify which Meterpreters a particular extension is available for.

Testing Steps

  • Install the gem locally.
  • Start msfconsole and then load IRB.
  • Run MetasploitPayloads::Mettle.available_platforms('sniffer')
    • The sniffer and stdapi extensions are the only ones that Mettle provides. The stdapi is a special case though that's baked into Mettle. It's technically present even if it's not backed by files on disk.
  • See a list of platforms where the sniffer extension is available.

Example

>> MetasploitPayloads::Mettle.available_platforms('sniffer')
=> 
["mips64-linux-muslsf",
 "mipsel-linux-muslsf",
 "powerpc64le-linux-musl",
 "mips-linux-muslsf",
 "powerpc-linux-muslsf",
 "s390x-linux-musl",
 "x86_64-linux-musl",
 "i486-linux-musl",
 "armv5l-linux-musleabi",
 "aarch64-linux-musl",
 "armv5b-linux-musleabi",
 "powerpc-e500v2-linux-musl"]
>> MetasploitPayloads::Mettle.available_extensions('x86_64-linux-musl')
=> ["sniffer", "stdapi"]
>> 

Copy link
Contributor

@gwillcox-r7 gwillcox-r7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor comments but overall this looks good to go

lib/metasploit_payloads/mettle.rb Outdated Show resolved Hide resolved
lib/metasploit_payloads/mettle.rb Show resolved Hide resolved
@gwillcox-r7
Copy link
Contributor

Looks like this is working well:

msf6 > irb
[*] Starting IRB shell...
[*] You are in the "framework" object

>> MetasploitPayloads::Mettle.available_platforms('sniffer')
=> 
["powerpc-linux-muslsf",
 "mips64-linux-muslsf",
 "armv5b-linux-musleabi",
 "i486-linux-musl",
 "x86_64-linux-musl",
 "s390x-linux-musl",
 "mips-linux-muslsf",
 "powerpc-e500v2-linux-musl",
 "arm-iphone-darwin",
 "powerpc64le-linux-musl",
 "mipsel-linux-muslsf",
 "x86_64-apple-darwin",
 "aarch64-linux-musl",
 "aarch64-iphone-darwin",
 "armv5l-linux-musleabi"]
>>  MetasploitPayloads::Mettle.available_extensions('x86_64-linux-musl')
=> ["sniffer", "stdapi"]
>> 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants