metasploit-payloads 1.1.2 → 1.1.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c6699dfd3baa43b3d87b1f201e6d5d859d82572d
4
- data.tar.gz: 2b81c9eaa0d693288d59ab8633584cd5458ae6e4
3
+ metadata.gz: 1e0ef667259cb500ad14f6990fa77ef1fe5af5c9
4
+ data.tar.gz: 39aec139c0cf4eed41529cec436e6769850a76e2
5
5
  SHA512:
6
- metadata.gz: 9adff287ce261753634c426a8173decba2dd5f23c1065f3457fdd7c76fb15a966a737533819c67f334920e401f04bef913eede53cd589da85c58377ce89d1172
7
- data.tar.gz: d3a4f026e71514fbe3555c37aa001531bbc224ab749c3f4ac2d5bf1365666998bc235145a3a5a90bf50886b7e0bf73550847a59085db22068702722ec7f2564b
6
+ metadata.gz: 740a16fa2292e855c560d270383ffc98730c3bee76019e58691f401aae17b552975c43ce70f3e515bf261448c5d126cf64b873834f5c6bde7287b7d6362b69c3
7
+ data.tar.gz: 676dde7a59ac14f0fadebbe4f2e23747852f04b802a7fa21666fb2554683faff3b50c13be202b8e19a6e5322bc5d24e4198d696e37c661a745fd7db8c43696f6
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -10,27 +10,29 @@ end
10
10
  module MetasploitPayloads
11
11
  EXTENSION_PREFIX = 'ext_server_'
12
12
  METERPRETER_SUBFOLDER = 'meterpreter'
13
+ USER_DATA_SUBFOLDER = 'payloads'
13
14
 
14
15
  #
15
16
  # Get the path to an extension based on its name (no prefix).
16
17
  #
17
18
  def self.meterpreter_ext_path(ext_name, binary_suffix)
18
- path("#{EXTENSION_PREFIX}#{ext_name}", binary_suffix)
19
+ path(METERPRETER_SUBFOLDER, "#{EXTENSION_PREFIX}#{ext_name}.#{binary_suffix}")
19
20
  end
20
21
 
21
- def self.readable_path(gem_path, msf_path)
22
+ def self.readable_path(gem_path, *extra_paths)
22
23
  # Try the MSF path first to see if the file exists, allowing the MSF data
23
24
  # folder to override what is in the gem. This is very helpful for
24
25
  # testing/development without having to move the binaries to the gem folder
25
26
  # each time. We only do this is MSF is installed.
26
- if ::File.readable? msf_path
27
- warn_local_path(msf_path) if ::File.readable? gem_path
28
- return msf_path
29
-
30
- elsif ::File.readable? gem_path
31
- return gem_path
27
+ extra_paths.each do |extra_path|
28
+ if ::File.readable? extra_path
29
+ warn_local_path(extra_path) if ::File.readable? gem_path
30
+ return extra_path
31
+ end
32
32
  end
33
33
 
34
+ return gem_path if ::File.readable? gem_path
35
+
34
36
  nil
35
37
  end
36
38
 
@@ -38,12 +40,7 @@ module MetasploitPayloads
38
40
  # Get the path to a meterpreter binary by full name.
39
41
  #
40
42
  def self.meterpreter_path(name, binary_suffix)
41
- file_name = "#{name}.#{binary_suffix}".downcase
42
- gem_path = expand(local_meterpreter_dir, file_name)
43
- if metasploit_installed?
44
- msf_path = expand(msf_meterpreter_dir, file_name)
45
- end
46
- readable_path(gem_path, msf_path)
43
+ path(METERPRETER_SUBFOLDER, "#{name}.#{binary_suffix}".downcase)
47
44
  end
48
45
 
49
46
  #
@@ -52,9 +49,10 @@ module MetasploitPayloads
52
49
  def self.path(*path_parts)
53
50
  gem_path = expand(data_directory, ::File.join(path_parts))
54
51
  if metasploit_installed?
52
+ user_path = expand(Msf::Config.config_directory, ::File.join(USER_DATA_SUBFOLDER, path_parts))
55
53
  msf_path = expand(Msf::Config.data_directory, ::File.join(path_parts))
56
54
  end
57
- readable_path(gem_path, msf_path)
55
+ readable_path(gem_path, user_path, msf_path)
58
56
  end
59
57
 
60
58
  #
@@ -80,7 +78,10 @@ module MetasploitPayloads
80
78
 
81
79
  # Find the valid extensions in the data folder first, if MSF
82
80
  # is installed.
83
- root_dirs.unshift(msf_meterpreter_dir) if metasploit_installed?
81
+ if metasploit_installed?
82
+ root_dirs.unshift(msf_meterpreter_dir)
83
+ root_dirs.unshift(user_meterpreter_dir)
84
+ end
84
85
 
85
86
  root_dirs.each do |dir|
86
87
  # Merge in any that don't already exist in the collection.
@@ -106,6 +107,13 @@ module MetasploitPayloads
106
107
  ::File.join(Msf::Config.data_directory, METERPRETER_SUBFOLDER)
107
108
  end
108
109
 
110
+ #
111
+ # Full path to the user's MSF data folder which contains the meterpreter binaries.
112
+ #
113
+ def self.user_meterpreter_dir
114
+ ::File.join(Msf::Config.config_directory, USER_DATA_SUBFOLDER, METERPRETER_SUBFOLDER)
115
+ end
116
+
109
117
  #
110
118
  # Full path to the local gem folder which contains the meterpreter binaries.
111
119
  #
@@ -149,7 +157,7 @@ module MetasploitPayloads
149
157
  unless @local_paths.include?(path)
150
158
  STDERR.puts("WARNING: Local file #{path} is being used")
151
159
  if @local_paths.empty?
152
- STDERR.puts('WARNING: Local files may be incompatible Metasploit framework')
160
+ STDERR.puts('WARNING: Local files may be incompatible with the Metasploit Framework')
153
161
  end
154
162
  @local_paths << path
155
163
  end
@@ -1,6 +1,6 @@
1
1
  # -*- coding:binary -*-
2
2
  module MetasploitPayloads
3
- VERSION = '1.1.2'
3
+ VERSION = '1.1.3'
4
4
 
5
5
  def self.version
6
6
  VERSION
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: 1.1.2
4
+ version: 1.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - OJ Reeves
@@ -88,7 +88,7 @@ cert_chain:
88
88
  2SpuQH+SWteq3NXkAmFEEqvLJQ4sbptZt8OP8ghL3pVAvZNFmww/YVszSkShSzcg
89
89
  QdihYCSEL2drS2cFd50jBeq71sxUtxbv82DUa2b+
90
90
  -----END CERTIFICATE-----
91
- date: 2016-03-02 00:00:00.000000000 Z
91
+ date: 2016-03-14 00:00:00.000000000 Z
92
92
  dependencies:
93
93
  - !ruby/object:Gem::Dependency
94
94
  name: bundler
metadata.gz.sig CHANGED
Binary file