Skip to content

Commit 0440c03

Browse files
committed
Land rapid7#1934 - Fix UltraISO Exploit File Creation
2 parents 81813a7 + cd64e35 commit 0440c03

File tree

3 files changed

+4
-16
lines changed

3 files changed

+4
-16
lines changed

lib/msf/core/exploit/fileformat.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ def file_format_filename
3030
datastore['FILENAME']
3131
end
3232

33-
def file_create(data)
34-
fname = file_format_filename
33+
def file_create(data, filename = nil)
34+
fname = filename || file_format_filename
3535
ltype = "exploit.fileformat.#{self.shortname}"
3636
full_path = store_local(ltype, nil, data, fname)
3737
print_good "#{fname} stored at #{full_path}"

modules/exploits/windows/fileformat/ultraiso_ccd.rb

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -206,14 +206,7 @@ def exploit
206206
sploit << idx_line
207207

208208
file_create(sploit)
209-
210-
# create the empty IMG file
211-
imgfn = datastore['FILENAME'].dup
212-
imgfn.gsub!(/\.ccd$/, '.img')
213-
out = imgfn
214-
File.new(out,"wb").close
215-
print_status("Created empty output file #{out}")
216-
209+
file_create('', datastore['FILENAME'].gsub(/\.ccd$/, '.img'))
217210
end
218211

219212
end

modules/exploits/windows/fileformat/ultraiso_cue.rb

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -111,13 +111,8 @@ def exploit
111111

112112
print_status("Creating '#{datastore['FILENAME']}' using target '#{target.name}' ...")
113113
file_create(cue_data)
114+
file_create('', datastore['FILENAME'].gsub(/\.cue$/, '.bin'))
114115

115-
# create the empty BIN file
116-
binfn = datastore['FILENAME'].dup
117-
binfn.gsub!(/\.cue$/, '.bin')
118-
out = binfn
119-
File.new(out,"wb").close
120-
print_status("Created empty output file #{out}")
121116

122117
end
123118

0 commit comments

Comments
 (0)