Skip to content

Commit c08d0a3

Browse files
committed
Update proxy string validation
1 parent 88a11b8 commit c08d0a3

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

lib/msf/core/opt_proxies.rb

+6-4
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,13 @@ def normalize(value)
2424
def valid?(value, check_empty: true, datastore: nil)
2525
return false if check_empty && empty_required_value?(value)
2626

27-
parsed = Rex::Socket::Proxies.parse(value)
28-
allowed_types = Rex::Socket::Proxies.supported_types
29-
parsed.all? do |type, host, port|
30-
allowed_types.include?(type) && host.present? && port.present?
27+
begin
28+
Rex::Socket::Proxies.parse(value)
29+
rescue Rex::RuntimeError
30+
return false
3131
end
32+
33+
true
3234
end
3335
end
3436

0 commit comments

Comments
 (0)