stdapi_fs_file_copy
parent
19bcef0c92
commit
468bf4696f
|
@ -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+.
|
||||
|
|
|
@ -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'],
|
||||
|
|
Loading…
Reference in New Issue