Fix UltraISO file creation
This makes file creation where datastore['FILENAME'] is not used when a different filename is required, and ends up creating files in the wrong place.
This commit is contained in:
@@ -30,8 +30,8 @@ module Exploit::FILEFORMAT
|
||||
datastore['FILENAME']
|
||||
end
|
||||
|
||||
def file_create(data)
|
||||
fname = file_format_filename
|
||||
def file_create(data, filename = nil)
|
||||
fname = filename || file_format_filename
|
||||
ltype = "exploit.fileformat.#{self.shortname}"
|
||||
full_path = store_local(ltype, nil, data, fname)
|
||||
print_good "#{fname} stored at #{full_path}"
|
||||
|
||||
@@ -206,18 +206,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
sploit << idx_line
|
||||
|
||||
file_create(sploit)
|
||||
|
||||
# This extends the current class, and changes the file_format_name.
|
||||
# This allows us to use the file_create(data) to store the created
|
||||
# file in the correct directory.
|
||||
|
||||
class << self
|
||||
def file_format_filename
|
||||
datastore['FILENAME'].gsub(/\.ccd$/, '.img')
|
||||
end
|
||||
end
|
||||
|
||||
file_create('')
|
||||
file_create('', datastore['FILENAME'].gsub(/\.ccd$/, '.img'))
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -111,18 +111,9 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
|
||||
print_status("Creating '#{datastore['FILENAME']}' using target '#{target.name}' ...")
|
||||
file_create(cue_data)
|
||||
file_create('', datastore['FILENAME'].gsub(/\.cue$/, '.bin'))
|
||||
|
||||
# This extends the current class, and changes the file_format_name.
|
||||
# This allows us to use the file_create(data) to store the created
|
||||
# file in the correct directory.
|
||||
|
||||
class << self
|
||||
def file_format_filename
|
||||
datastore['FILENAME'].gsub(/\.cue$/, '.bin')
|
||||
end
|
||||
end
|
||||
|
||||
file_create('')
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user