metasploit_payloads-mettle 0.0.8 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 498071710ed3a91ca6a33273882639c9975240f5
4
- data.tar.gz: b17b04225d08ac93b606997825ee85efc67e0794
3
+ metadata.gz: 7240c2fbb8b9d8e8d42c969a00efef4799cc3425
4
+ data.tar.gz: 811684a8e1ac33fc58d2ab57af48262b68303454
5
5
  SHA512:
6
- metadata.gz: 78139582034b0459cda2dc7297fd111361535c711c9b6b758e470277c390f4006aaede50168105019e72431d934e937e2eaaec32374ecced343bffd9a735d9a2
7
- data.tar.gz: 9c7d116b6b2902f10dab1fc316e2091fd65756e841bfc448b8c6fd3b72d1284e320270442537c692721cdf8dcf015b19f32c2f5c283f4af6a95091a7b66a4692
6
+ metadata.gz: d159039daba3c937ad1cfa266dc7d3c112a6243e9f56aeb797678e0df01e2d22bdeab6353d761e0adbdf860ed6363b07ee2d3da7c7ce9c026137d5c008cab747
7
+ data.tar.gz: 4e8684def051ab79000f5c675c38f717e7205cd44ced3dfd08b1c3f37562cfc5626bb786388859a2739d04e4ea902cc779ec3ab1778680d8b96da3000d8401af
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
@@ -1 +1,5 @@
1
- �X��� �"D���L]׌書l%���2�M ��79%���J�ʩR �.L��"�N����p������l��Q ��՛zT(�|e��ڹ�9��[V�їenfMU� W�u6�Gd�����p��z��I��:M�_�Ƞ��Q�‡
1
+ y�탉���!Zj�ǤUi$���6J�c&��
2
+ �9�L[U�� �p���;ojp��j���D��
3
+ 7~���C��3����G�I�H�3�7�� ����~Gw���xwB��ߑ�$�̕ xC��T���/�I�����lަ>_k-����̦,��Ops�1�$y����P��
4
+ ����{*��FD0��K�
5
+ ~y��6B�(ێ?�ډ⃶�I��6������ߏ;�y�����+����%Zz�~�:��
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -8,7 +8,68 @@ end
8
8
  # This module dispenses Mettle payload binary files
9
9
  #
10
10
  module MetasploitPayloads
11
- module Mettle
11
+ class Mettle
12
+
13
+ #
14
+ # Config is a hash. Valid keys are:
15
+ # :uri to connect to
16
+ # :uuid of the payload
17
+ # :debug to enable
18
+ # :log_file to log to places other than stderr
19
+ #
20
+ attr_accessor :config
21
+
22
+ def initialize(triple, config={})
23
+ @platform = triple.clone
24
+ @config = config.clone
25
+ end
26
+
27
+ #
28
+ # Available formats are :process_image and :exec
29
+ #
30
+ def to_binary(format=:process_image)
31
+ bin = self.class.read(@platform, format)
32
+ params = generate_argv
33
+ add_args(bin, params)
34
+ end
35
+
36
+ private
37
+
38
+ def generate_argv
39
+ cmd_line = 'mettle '
40
+ @config.each do |opt, val|
41
+ cmd_line << "-#{short_opt(opt)} \"#{val}\" "
42
+ end
43
+ if cmd_line.length > 264
44
+ fail RuntimeError, 'mettle argument list too big', caller
45
+ end
46
+
47
+ cmd_line + "\x00" * (264 - cmd_line.length)
48
+ end
49
+
50
+ def short_opt(opt)
51
+ case opt
52
+ when :uri
53
+ 'u'
54
+ when :uuid
55
+ 'U'
56
+ when :debug
57
+ 'd'
58
+ when :log_file
59
+ 'o'
60
+ else
61
+ fail RuntimeError, "unknown mettle option #{opt}", caller
62
+ end
63
+ end
64
+
65
+ def add_args(bin, params)
66
+ if params[8] != "\x00"
67
+ bin.sub('DEFAULT_OPTS' + ' ' * 252, params)
68
+ else
69
+ bin
70
+ end
71
+ end
72
+
12
73
  def self.readable_path(gem_path, msf_path)
13
74
  # Try the MSF path first to see if the file exists, allowing the MSF data
14
75
  # folder to override what is in the gem. This is very helpful for
@@ -25,7 +86,16 @@ module MetasploitPayloads
25
86
  #
26
87
  # Get the contents of any file packaged in this gem by local path and name.
27
88
  #
28
- def self.read(triple, file)
89
+ def self.read(triple, format)
90
+ file =
91
+ case format
92
+ when :process_image
93
+ 'mettle.bin'
94
+ when :exec
95
+ 'mettle'
96
+ else
97
+ fail RuntimeError, "unknown mettle format #{format}", caller
98
+ end
29
99
  file_path = path("#{triple}", 'bin', file)
30
100
  if file_path.nil?
31
101
  full_path = ::File.join([triple, file])
@@ -35,14 +105,12 @@ module MetasploitPayloads
35
105
  ::File.binread(file_path)
36
106
  end
37
107
 
38
- private
39
-
40
108
  #
41
109
  # Get the full path to any file packaged in this gem by local path and name.
42
110
  #
43
111
  def self.path(*path_parts)
44
112
  gem_path = expand(data_directory, ::File.join(path_parts))
45
- msf_path = 'thisisnotthefileyouarelookingfor'
113
+ msf_path = 'thisisnotthefileyouarelookingfor'
46
114
  if metasploit_installed?
47
115
  msf_path = expand(Msf::Config.data_directory, ::File.join('mettle', path_parts))
48
116
  end
@@ -1,7 +1,7 @@
1
1
  # -*- coding:binary -*-
2
2
  module MetasploitPayloads
3
- module Mettle
4
- VERSION = '0.0.8'
3
+ class Mettle
4
+ VERSION = '0.1.0'
5
5
 
6
6
  def self.version
7
7
  VERSION
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metasploit_payloads-mettle
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Cammack
@@ -89,7 +89,7 @@ cert_chain:
89
89
  G+Hmcg1v810agasPdoydE0RTVZgEOOMoQ07qu7JFXVWZ9ZQpHT7qJATWL/b2csFG
90
90
  8mVuTXnyJOKRJA==
91
91
  -----END CERTIFICATE-----
92
- date: 2016-10-11 00:00:00.000000000 Z
92
+ date: 2016-11-16 00:00:00.000000000 Z
93
93
  dependencies:
94
94
  - !ruby/object:Gem::Dependency
95
95
  name: bundler
@@ -159,6 +159,8 @@ files:
159
159
  - build/powerpc-linux-muslsf/bin/mettle.bin
160
160
  - build/powerpc64le-linux-musl/bin/mettle
161
161
  - build/powerpc64le-linux-musl/bin/mettle.bin
162
+ - build/s390x-linux-musl/bin/mettle
163
+ - build/s390x-linux-musl/bin/mettle.bin
162
164
  - build/x86_64-linux-musl/bin/mettle
163
165
  - build/x86_64-linux-musl/bin/mettle.bin
164
166
  - lib/metasploit_payloads/mettle.rb
metadata.gz.sig CHANGED
Binary file