metasploit-payloads 2.0.46 → 2.0.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/metasploit-payloads.rb +69 -25
- data/lib/metasploit-payloads/version.rb +1 -1
- metadata +2 -2
- metadata.gz.sig +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 563ad798c2cdbc68e144dbb312d1d3831b6993fb4cc8a88e95fdabe4c33d93e0
|
4
|
+
data.tar.gz: 91db92d06af935bb7af3eff1caead492630396c22e05381525176b3de5c72283
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2dc4b62ffefb079c51955cb5ddd203eed4d2a8eb90d0f63b292be5b2262e841acdc9bdc956cf9b5f689ec10fa9d8eeca205efe2da91ed7fddae6e100d101bc1f
|
7
|
+
data.tar.gz: 903b4e3a4e753aff9b25d7a0be43a1de802ebd4d64fea2ec2731b9ed63b0a040a4a28db99aba7c9b2ff63fe6f0d6850de585590644873ea7baf8ad58d9719353
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/metasploit-payloads.rb
CHANGED
@@ -69,30 +69,24 @@ module MetasploitPayloads
|
|
69
69
|
end
|
70
70
|
|
71
71
|
#
|
72
|
-
# List all the available extensions
|
72
|
+
# List all the available extensions, optionally filtered by the given suffix.
|
73
73
|
#
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
# is installed.
|
81
|
-
if metasploit_installed?
|
82
|
-
root_dirs.unshift(msf_meterpreter_dir)
|
83
|
-
root_dirs.unshift(user_meterpreter_dir)
|
84
|
-
end
|
85
|
-
|
86
|
-
root_dirs.each do |dir|
|
87
|
-
next unless ::File.directory?(dir)
|
88
|
-
|
89
|
-
# Merge in any that don't already exist in the collection.
|
90
|
-
meterpreter_enum_ext(dir, binary_suffix).each do |e|
|
91
|
-
extensions.push(e) unless extensions.include?(e)
|
92
|
-
end
|
93
|
-
end
|
74
|
+
# @param [String] binary_suffix An optional suffix to use for filtering results. If omitted, all extensions will be
|
75
|
+
# returned.
|
76
|
+
# @return [Array<String>] Returns an array of extensions.
|
77
|
+
def self.list_meterpreter_extensions(binary_suffix=nil)
|
78
|
+
list_meterpreter_dirs { |dir| meterpreter_enum_ext(dir, binary_suffix) }
|
79
|
+
end
|
94
80
|
|
95
|
-
|
81
|
+
#
|
82
|
+
# List all the available suffixes, optionally filtered by the given extension name. This is mostly useful for
|
83
|
+
# determining support for a specific extension.
|
84
|
+
#
|
85
|
+
# @param [String] extension_name An optional extension name to use for filtering results. If omitted, all suffixes
|
86
|
+
# will be returned.
|
87
|
+
# @return [Array<String>] Returns an array of binary suffixes.
|
88
|
+
def self.list_meterpreter_extension_suffixes(extension_name=nil)
|
89
|
+
list_meterpreter_dirs { |dir| meterpreter_enum_ext_suffixes(dir, extension_name) }
|
96
90
|
end
|
97
91
|
|
98
92
|
#
|
@@ -124,19 +118,43 @@ module MetasploitPayloads
|
|
124
118
|
end
|
125
119
|
|
126
120
|
#
|
127
|
-
# Enumerate extensions in the given root folder based on
|
121
|
+
# Enumerate extensions in the given root folder based on an optional suffix.
|
128
122
|
#
|
129
|
-
|
123
|
+
# @param [String] root_dir The path to the directory from which to enumerate extensions.
|
124
|
+
# @param [String] binary_suffix An optional suffix to use for filtering results. If omitted, all extensions will be
|
125
|
+
# returned.
|
126
|
+
# @return [Array<String>] Returns an array of extensions.
|
127
|
+
def self.meterpreter_enum_ext(root_dir, binary_suffix=nil)
|
130
128
|
exts = []
|
129
|
+
binary_suffix ||= '.*'
|
131
130
|
::Dir.entries(root_dir).each do |f|
|
132
131
|
if ::File.readable?(::File.join(root_dir, f)) && \
|
133
|
-
f =~ /#{EXTENSION_PREFIX}(
|
132
|
+
f =~ /#{EXTENSION_PREFIX}(\w+)\.#{binary_suffix}/
|
134
133
|
exts.push($1)
|
135
134
|
end
|
136
135
|
end
|
137
136
|
exts
|
138
137
|
end
|
139
138
|
|
139
|
+
#
|
140
|
+
# Enumerate binary suffixes in the given root folder based on an optional extension name.
|
141
|
+
#
|
142
|
+
# @param [String] root_dir The path to the directory from which to enumerate extension suffixes.
|
143
|
+
# @param [String] extension_name An optional extension name to use for filtering results. If omitted, all suffixes will
|
144
|
+
# be returned.
|
145
|
+
# @return [Array<String>] Returns an array of binary suffixes.
|
146
|
+
def self.meterpreter_enum_ext_suffixes(root_dir, extension_name=nil)
|
147
|
+
suffixes = []
|
148
|
+
extension_name ||= '\w+'
|
149
|
+
::Dir.entries(root_dir).each do |f|
|
150
|
+
if ::File.readable?(::File.join(root_dir, f)) && \
|
151
|
+
f =~ /#{EXTENSION_PREFIX}#{extension_name}\.(\w+(\.\w+)*)/
|
152
|
+
suffixes.push($1)
|
153
|
+
end
|
154
|
+
end
|
155
|
+
suffixes
|
156
|
+
end
|
157
|
+
|
140
158
|
private
|
141
159
|
|
142
160
|
#
|
@@ -164,4 +182,30 @@ module MetasploitPayloads
|
|
164
182
|
@local_paths << path
|
165
183
|
end
|
166
184
|
end
|
185
|
+
|
186
|
+
class << self
|
187
|
+
private
|
188
|
+
def list_meterpreter_dirs(&block)
|
189
|
+
things = [] # *things* is whatever is being enumerated (extension names, suffixes, etc.) as determined by the block
|
190
|
+
root_dirs = [local_meterpreter_dir]
|
191
|
+
|
192
|
+
# Find the valid extensions in the data folder first, if MSF
|
193
|
+
# is installed.
|
194
|
+
if metasploit_installed?
|
195
|
+
root_dirs.unshift(msf_meterpreter_dir)
|
196
|
+
root_dirs.unshift(user_meterpreter_dir)
|
197
|
+
end
|
198
|
+
|
199
|
+
root_dirs.each do |dir|
|
200
|
+
next unless ::File.directory?(dir)
|
201
|
+
|
202
|
+
# Merge in any that don't already exist in the collection.
|
203
|
+
(yield dir).each do |e|
|
204
|
+
things.push(e) unless things.include?(e)
|
205
|
+
end
|
206
|
+
end
|
207
|
+
|
208
|
+
things
|
209
|
+
end
|
210
|
+
end
|
167
211
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metasploit-payloads
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.47
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- OJ Reeves
|
@@ -96,7 +96,7 @@ cert_chain:
|
|
96
96
|
EknWpNgVhohbot1lfVAMmIhdtOVaRVcQQixWPwprDj/ydB8ryDMDosIMcw+fkoXU
|
97
97
|
9GJsSaSRRYQ9UUkVL27b64okU8D48m8=
|
98
98
|
-----END CERTIFICATE-----
|
99
|
-
date: 2021-
|
99
|
+
date: 2021-06-09 00:00:00.000000000 Z
|
100
100
|
dependencies:
|
101
101
|
- !ruby/object:Gem::Dependency
|
102
102
|
name: rake
|
metadata.gz.sig
CHANGED
@@ -1 +1 @@
|
|
1
|
-
�
|
1
|
+
%ǀ����$�M$���v�_���5/�~3x�П�����:VQ�t� F&������ �z���,e.�?��~�{�um;���XD�-���u�f�C�J2 �P�D �N�`�ݬ�JG��+.;ˣ<��K̶�/ۂ�K7A��������j��CE8]$0�����z*�m
|