Skip to content

Commit ba03890

Browse files
committed
Land rapid7#3171, Fix NameError for "r" in Msf::Auxiliary::Nmap
2 parents 9cef210 + 8fd4f50 commit ba03890

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

lib/msf/core/auxiliary/nmap.rb

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,6 @@ def nmap_validate_rports
184184
if datastore['RPORT'] && (datastore['RPORT'].kind_of?(Fixnum) || !datastore['RPORT'].empty?)
185185
return true
186186
end
187-
bad_port = false
188187
if rports.nil? || rports.empty?
189188
print_error "Missing RPORTS"
190189
return false
@@ -193,14 +192,10 @@ def nmap_validate_rports
193192
if r =~ /^([TU]:)?[0-9]*-?[0-9]*$/
194193
next
195194
else
196-
bad_port = true
197-
break
195+
print_error "Malformed nmap port: #{r}"
196+
return false
198197
end
199198
end
200-
if bad_port
201-
print_error "Malformed nmap port: #{r}"
202-
return false
203-
end
204199
print_status "Using RPORTS range #{datastore['RPORTS']}"
205200
return true
206201
end

0 commit comments

Comments
 (0)