Add reference name enforcement to cmd_use

bug/bundler_fix
William Vu 2016-12-20 15:49:06 -06:00
parent d9f5385260
commit 41605c533c
1 changed files with 8 additions and 0 deletions

View File

@ -597,6 +597,14 @@ module Msf
# Try to create an instance of the supplied module name
mod_name = args[0]
# Ensure we have a reference name and not a path
if mod_name.start_with?('modules/')
mod_name.sub!(/^modules\//, '')
end
if mod_name.end_with?('.', '.rb')
mod_name.sub!(/\.(?:rb)?$/, '')
end
begin
mod = framework.modules.create(mod_name)
unless mod