Skip to content

Commit 59660dd

Browse files
author
Brent Cook
committed
Land rapid7#6465, remove unneeded meterpreter extension post-installation copies
2 parents e7e63d9 + f7ce0df commit 59660dd

File tree

1 file changed

+0
-37
lines changed

1 file changed

+0
-37
lines changed

lib/metasploit/framework/common_engine.rb

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -42,44 +42,7 @@ module Metasploit::Framework::CommonEngine
4242
# `initializer`s
4343
#
4444

45-
initializer 'metasploit_framework.merge_meterpreter_extensions' do
46-
Rails.application.railties.engines.each do |engine|
47-
merge_meterpreter_extensions(engine)
48-
end
4945

50-
# The Rails.application itself could have paths['data/meterpreter'], but will not be part of
51-
# Rails.application.railties.engines because only direct subclasses of `Rails::Engine` are returned.
52-
merge_meterpreter_extensions(Rails.application)
53-
end
5446
end
5547

56-
#
57-
# Instance Methods
58-
#
59-
60-
private
61-
62-
# Merges the meterpreter extensions from `engine`'s `paths['data/meterpreter]`.
63-
#
64-
# @param engine [Rails::Engine] a Rails engine or application that has meterpreter extensions
65-
# @return [void]
66-
# @todo Make metasploit-framework look for meterpreter extension in paths['data/meterpreter'] from the engine instead of copying them.
67-
def merge_meterpreter_extensions(engine)
68-
data_meterpreter_paths = engine.paths['data/meterpreter']
69-
70-
# may be `nil` since 'data/meterpreter' is not part of the core Rails::Engine paths set.
71-
if data_meterpreter_paths
72-
source_paths = data_meterpreter_paths.existent
73-
destination_directory = root.join('data', 'meterpreter').to_path
74-
75-
source_paths.each do |source_path|
76-
basename = File.basename(source_path)
77-
destination_path = File.join(destination_directory, basename)
78-
79-
unless destination_path == source_path
80-
FileUtils.copy(source_path, destination_directory)
81-
end
82-
end
83-
end
84-
end
8548
end

0 commit comments

Comments
 (0)