Fix single file

bug/bundler_fix
Meatballs 2013-04-26 00:55:10 +01:00
parent 590b8a3e26
commit d0f2717b43
1 changed files with 7 additions and 2 deletions

View File

@ -30,7 +30,7 @@ class Metasploit3 < Msf::Auxiliary
))
register_options([
OptPath.new('PATH', [true, 'Directory to parse.']),
OptPath.new('PATH', [true, 'Directory or file to parse.']),
OptBool.new('RECURSIVE', [true, 'Recursively check for files', false]),
])
end
@ -42,7 +42,12 @@ class Metasploit3 < Msf::Auxiliary
ext = "/*.xml"
end
filepath = File.join(datastore['PATH'], ext)
if datastore['PATH'].ends_with('.xml')
filepath = datastore['PATH']
else
filepath = File.join(datastore['PATH'], ext)
end
Dir.glob(filepath) do |item|
print_status "Processing #{item}"
file = File.read(item)