Skip to content

Commit 8bdd89f

Browse files
committed
[FixRM:rapid7#4704] - Fix EOFError in filezilla_server_port
If login fails, the module shouldn't continue sending commands to the server, otherwise this causes an EOF.
1 parent eb3c6fa commit 8bdd89f

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

modules/auxiliary/dos/windows/ftp/filezilla_server_port.rb

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,17 @@ def initialize(info = {})
3535
end
3636

3737
def run
38-
connect_login
38+
begin
39+
c = connect_login
40+
rescue Rex::ConnectionRefused
41+
print_error("Connection refused.")
42+
return
43+
rescue Rex::ConnectionTimeout
44+
print_error("Connection timed out")
45+
return
46+
end
47+
48+
return if not c
3949

4050
send_cmd(['PASV', 'A*'], true) # Assigns PASV port
4151
send_cmd(['PORT', 'A*'], true) # Rejected but seems to assign NULL to pointer

0 commit comments

Comments
 (0)