Skip to content

Commit aa134b0

Browse files
author
jvazquez-r7
committed
Land rapid7#1973, @wchen-r7's fix to handle ftp auth correctly
2 parents 8ae8f25 + 820f589 commit aa134b0

14 files changed

+28
-15
lines changed

modules/auxiliary/scanner/ftp/titanftp_xcrc_traversal.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ def initialize
5454

5555
def run_host(ip)
5656

57-
connect_login
57+
c = connect_login
58+
return if not c
5859

5960
path = datastore['TRAVERSAL'] + datastore['PATH']
6061

modules/exploits/windows/ftp/ability_server_stor.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,8 @@ def check
9191
end
9292

9393
def exploit
94-
connect_login
94+
c = connect_login
95+
return if not c
9596

9697
myhost = datastore['LHOST'] == '0.0.0.0' ? Rex::Socket.source_address : datastore['LHOST']
9798

modules/exploits/windows/ftp/cesarftp_mkd.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ def check
7070
end
7171

7272
def exploit
73-
connect_login
73+
c = connect_login
74+
return if not c
7475

7576
sploit = "\n" * 671 + rand_text_english(3, payload_badchars)
7677
sploit << [target.ret].pack('V') + make_nops(40) + payload.encoded

modules/exploits/windows/ftp/filecopa_list_overflow.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ def initialize(info = {})
4747

4848

4949
def exploit
50-
connect_login
50+
c = connect_login
51+
return if not c
5152

5253
print_status("Trying target #{target.name}...")
5354

modules/exploits/windows/ftp/globalscapeftp_input.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ def initialize(info = {})
5151
end
5252

5353
def exploit
54-
connect_login
54+
c = connect_login
55+
return if not c
5556

5657
buf = make_nops(3047)
5758
buf[2043, 4] = [ target.ret ].pack('V')

modules/exploits/windows/ftp/httpdx_tolog_format.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,8 @@ def exploit
173173
end
174174

175175
# proceed with chosen target...
176-
connect_login
176+
c = connect_login
177+
return if not c
177178

178179
# '<ip>\n PWD '
179180
ip_length = Rex::Socket.source_address(datastore['RHOST']).length

modules/exploits/windows/ftp/oracle9i_xdb_ftp_unlock.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ def check
7676
end
7777

7878
def exploit
79-
connect_login
79+
c = connect_login
80+
return if not c
8081

8182
print_status("Trying target #{target.name}...")
8283

modules/exploits/windows/ftp/servu_chmod.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ def check
6767

6868

6969
def exploit
70-
connect_login
70+
c = connect_login
71+
return if not c
7172

7273
eggoptions =
7374
{

modules/exploits/windows/ftp/servu_mdtm.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,8 @@ def check
129129
end
130130

131131
def exploit
132-
133-
connect_login
132+
c = connect_login
133+
return if not c
134134

135135
print_status("Trying target #{target.name}...")
136136

modules/exploits/windows/ftp/slimftpd_list_concat.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ def initialize(info = {})
5252
end
5353

5454
def exploit
55-
connect_login
55+
c = connect_login
56+
return if not c
5657

5758
print_status("Trying target #{target.name}...")
5859

0 commit comments

Comments
 (0)