parent
9a15a2be04
commit
7571fe1f68
|
@ -57,7 +57,6 @@ module Metasploit
|
|||
inclusion: { in: [:debug, :info, :warn, :error, :fatal] }
|
||||
|
||||
validates :stop_on_success,
|
||||
presence: true,
|
||||
inclusion: { in: [true, false] }
|
||||
|
||||
validates :host, presence: true
|
||||
|
@ -202,7 +201,12 @@ module Metasploit
|
|||
errors.add(:host, "must be a string")
|
||||
end
|
||||
begin
|
||||
::Rex::Socket.getaddress(value, true)
|
||||
::Rex::Socket.getaddress(host, true)
|
||||
if host =~ /^\d{1,3}(\.\d{1,3}){1,3}$/
|
||||
unless host =~ Rex::Socket::MATCH_IPV4
|
||||
errors.add(:host, "could not be resolved")
|
||||
end
|
||||
end
|
||||
rescue
|
||||
errors.add(:host, "could not be resolved")
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue