Skip to content

Commit 8f720ef

Browse files
committed
Use get_env in runas
1 parent 844460d commit 8f720ef

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/msf/core/post/windows/runas.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ module Msf::Post::Windows::Runas
1212
def shell_execute_exe(filename = nil, path = nil)
1313
exe_payload = generate_payload_exe
1414
payload_filename = filename || Rex::Text.rand_text_alpha((rand(8) + 6)) + '.exe'
15-
payload_path = path || expand_path('%TEMP%')
15+
payload_path = path || get_env('TEMP')
1616
cmd_location = "#{payload_path}\\#{payload_filename}"
1717
print_status("Uploading #{payload_filename} - #{exe_payload.length} bytes to the filesystem...")
1818
write_file(cmd_location, exe_payload)

0 commit comments

Comments
 (0)