Skip to content

Commit 1b306ca

Browse files
Fixed ftp.rb to get files larger than 16384
Existing ftp.rb did get_once, which limits file DL to 16384 (def_block_size). Change to get and added one more timeout variable see: http://www.rubydoc.info/gems/librex/Rex%2FIO%2FStream:def_block_size and http://www.rubydoc.info/gems/librex/Rex%2FIO%2FStream:get_once and http://www.rubydoc.info/gems/librex/Rex%2FIO%2FStream:get
1 parent 9b219f4 commit 1b306ca

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

lib/msf/core/exploit/ftp.rb

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ def send_cmd_data(args, data, mode = 'a', nsock = self.sock)
213213
if (type == "get")
214214
# failed listings just disconnect..
215215
begin
216-
data = self.datasocket.get_once(-1, ftp_timeout)
216+
data = datasocket.get(ftp_timeout, ftp_data_timeout)
217217
rescue ::EOFError
218218
data = nil
219219
end
@@ -335,6 +335,13 @@ def ftp_timeout
335335
(datastore['FTPTimeout'] || 10).to_i
336336
end
337337

338+
#
339+
# Returns the number of seconds to wait to get more FTP data
340+
#
341+
def ftp_data_timeout
342+
(datastore['FTPDataTimeout'] || 1).to_i
343+
end
344+
338345
protected
339346

340347
#

0 commit comments

Comments
 (0)