stdapi_fs_file_copy

bug/bundler_fix
Tim 2016-11-22 16:24:09 +08:00
parent 19bcef0c92
commit 468bf4696f
No known key found for this signature in database
GPG Key ID: 62361A8B17EEED19
2 changed files with 20 additions and 0 deletions

View File

@ -226,6 +226,24 @@ class File < Rex::Post::Meterpreter::Extensions::Stdapi::Fs::IO
alias rename mv
end
#
# Performs a copy from oldname to newname
#
def File.cp(oldname, newname)
request = Packet.create_request('stdapi_fs_file_copy')
request.add_tlv(TLV_TYPE_FILE_NAME, client.unicode_filter_decode( oldname ))
request.add_tlv(TLV_TYPE_FILE_PATH, client.unicode_filter_decode( newname ))
response = client.send_request(request)
return response
end
class << self
alias copy cp
end
#
# Upload one or more files to the remote remote directory supplied in
# +destination+.

View File

@ -71,6 +71,7 @@ class Console::CommandDispatcher::Stdapi::Fs
'pwd' => 'Print working directory',
'rm' => 'Delete the specified file',
'mv' => 'Move source to destination',
'cp' => 'Copy source to destination',
'rmdir' => 'Remove directory',
'search' => 'Search for files',
'upload' => 'Upload a file or directory',
@ -95,6 +96,7 @@ class Console::CommandDispatcher::Stdapi::Fs
'rmdir' => ['stdapi_fs_delete_dir'],
'rm' => ['stdapi_fs_delete_file'],
'mv' => ['stdapi_fs_file_move'],
'cp' => ['stdapi_fs_file_copy'],
'search' => ['stdapi_fs_search'],
'upload' => [],
'show_mount' => ['stdapi_fs_mount_show'],