Skip to content

Commit 3339c3b

Browse files
committed
remove magic, because it causes complications with complex RC scripts
1 parent 0c867d9 commit 3339c3b

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

lib/msf/base/sessions/meterpreter.rb

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -305,11 +305,8 @@ def desc
305305
# Runs the Meterpreter script or resource file
306306
#
307307
def execute_file(full_path, args)
308-
# Infer a Meterpreter script by it either having the .rb extension, or it
309-
# containing a reference to the client object. This is for backward
310-
# compatibility, since the API is not explicit to the user whether this
311-
# should be a resource file or a Meterpreter script.
312-
if File.extname(full_path) == ".rb" || File.read(full_path).match?(/\s*client\./)
308+
# Infer a Meterpreter script by it having an .rb extension
309+
if File.extname(full_path) == ".rb"
313310
Rex::Script::Meterpreter.new(self, full_path).run(args)
314311
else
315312
console.load_resource(full_path)

0 commit comments

Comments
 (0)