File tree Expand file tree Collapse file tree 1 file changed +0
-37
lines changed Expand file tree Collapse file tree 1 file changed +0
-37
lines changed Original file line number Diff line number Diff line change @@ -42,44 +42,7 @@ module Metasploit::Framework::CommonEngine
42
42
# `initializer`s
43
43
#
44
44
45
- initializer 'metasploit_framework.merge_meterpreter_extensions' do
46
- Rails . application . railties . engines . each do |engine |
47
- merge_meterpreter_extensions ( engine )
48
- end
49
45
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
54
46
end
55
47
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
85
48
end
You can’t perform that action at this time.
0 commit comments