From cd656ecdbba353ac3bb2cc40d07d47196d5eb742 Mon Sep 17 00:00:00 2001 From: bcoles Date: Fri, 21 Oct 2022 23:28:14 +1100 Subject: [PATCH] Msf::Post::File.append_file: Append not overwrite on *nix shell sessions --- lib/msf/core/post/file.rb | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/lib/msf/core/post/file.rb b/lib/msf/core/post/file.rb index 76ef0f0a38..0896a914b9 100644 --- a/lib/msf/core/post/file.rb +++ b/lib/msf/core/post/file.rb @@ -540,7 +540,7 @@ module Msf::Post::File return _win_bin_append_file(file_name, data) end else - return _write_file_unix_shell(file_name, data) + return _append_file_unix_shell(file_name, data) end end true @@ -909,6 +909,17 @@ protected end end + # + # Append +data+ to the remote file +file_name+. + # + # You should never call this method directly. Instead, call {#append_file} + # which will call this method if it is appropriate for the given session. + # + # @return [void] + def _append_file_unix_shell(file_name, data) + _write_file_unix_shell(file_name, data, true) + end + # # Write +data+ to the remote file +file_name+. #