Skip to content

Commit 9790181

Browse files
author
jvazquez-r7
committed
Land rapid7#2176, @wchen-r7's fix for [TestRM rapid7#8272]
2 parents ce62e12 + 8c47f1d commit 9790181

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

modules/exploits/windows/fileformat/ms11_006_createsizeddibsection.rb

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,16 +107,18 @@ def initialize(info = {})
107107

108108
register_options(
109109
[
110-
OptString.new('FILENAME', [ true, 'The file name.', 'msf.doc']),
111-
OptString.new('OUTPUTPATH', [ true, 'The output path to use.', Msf::Config.config_directory + "/data/exploits/"]),
110+
OptString.new('FILENAME', [ true, 'The file name.', 'msf.doc'])
112111
], self.class)
113112
end
114113

115114
def exploit
116115

117116
print_status("Creating '#{datastore['FILENAME']}' file ...")
118117

119-
out = ::File.expand_path(::File.join(datastore['OUTPUTPATH'], datastore['FILENAME']))
118+
fname = datastore['FILENAME']
119+
ltype = "exploit.fileformat.ms11_006"
120+
out = store_local(ltype, nil, '', fname)
121+
120122
stg = Rex::OLE::Storage.new(out, Rex::OLE::STGM_WRITE)
121123
if (not stg)
122124
fail_with(Exploit::Failure::BadConfig, 'Unable to create output file')
@@ -131,7 +133,7 @@ def exploit
131133

132134
stg.close
133135

134-
print_status("Generated output file #{out}")
136+
print_good("#{datastore['FILENAME']} created at #{out}")
135137

136138
end
137139

0 commit comments

Comments
 (0)