Land #10645, writable? method for Msf::Post::File

4.x
William Vu 2018-09-15 17:27:42 -05:00 committed by Metasploit
parent 057228c60b
commit 1c21ec588a
No known key found for this signature in database
GPG Key ID: CDFB5FA52007B954
1 changed files with 13 additions and 0 deletions

View File

@ -135,6 +135,19 @@ module Msf::Post::File
end
end
#
# See if +path+ on the remote system exists and is writable
#
# @param path [String] Remote path to check
#
# @return [Boolean] true if +path+ exists and is writable
#
def writable?(path)
raise "writable?' method does not support Windows systems" if session.platform == 'windows'
cmd_exec("test -w '#{path}' && echo true").to_s.include? 'true'
end
#
# Check for existence of +path+ on the remote file system
#