Skip to content

Commit 402e926

Browse files
author
Brent Cook
committed
Land rapid7#9081, Fix ftp.rb to get files larger than 16384
2 parents c6bc55a + 1b306ca commit 402e926

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
@@ -219,7 +219,7 @@ def send_cmd_data(args, data, mode = 'a', nsock = self.sock)
219219
if (type == "get")
220220
# failed listings just disconnect..
221221
begin
222-
data = self.datasocket.get_once(-1, ftp_timeout)
222+
data = datasocket.get(ftp_timeout, ftp_data_timeout)
223223
rescue ::EOFError
224224
data = nil
225225
end
@@ -341,6 +341,13 @@ def ftp_timeout
341341
(datastore['FTPTimeout'] || 10).to_i
342342
end
343343

344+
#
345+
# Returns the number of seconds to wait to get more FTP data
346+
#
347+
def ftp_data_timeout
348+
(datastore['FTPDataTimeout'] || 1).to_i
349+
end
350+
344351
protected
345352

346353
#

0 commit comments

Comments
 (0)