diff --git a/lib/msf/core/opt_address_range.rb b/lib/msf/core/opt_address_range.rb index 50c1653971..0a46621ab0 100644 --- a/lib/msf/core/opt_address_range.rb +++ b/lib/msf/core/opt_address_range.rb @@ -14,21 +14,18 @@ class OptAddressRange < OptBase def normalize(value) return nil unless value.kind_of?(String) - if (value =~ /^file:(.*)/) - path = $1 - return false if not File.exists?(path) or File.directory?(path) - return File.readlines(path).map{ |s| s.strip}.join(" ") - elsif (value =~ /^rand:(.*)/) + if value =~ /^rand:(.*)/ count = $1.to_i return false if count < 1 ret = '' - count.times { - ret << " " if not ret.empty? - ret << [ rand(0x100000000) ].pack("N").unpack("C*").map{|x| x.to_s }.join(".") - } + count.times do + ret << ' ' if not ret.empty? + ret << [ rand(0x100000000) ].pack('N').unpack('C*').map{|x| x.to_s }.join('.') + end return ret end - return value + + value end def valid?(value) diff --git a/lib/msf/core/opt_raw.rb b/lib/msf/core/opt_raw.rb index 7da13693d9..23d8e315e7 100644 --- a/lib/msf/core/opt_raw.rb +++ b/lib/msf/core/opt_raw.rb @@ -13,14 +13,6 @@ class OptRaw < OptBase end def normalize(value) - if (value =~ /^file:(.*)/) - path = $1 - begin - value = File.read(path) - rescue ::Errno::ENOENT, ::Errno::EISDIR - value = nil - end - end value end diff --git a/lib/msf/core/opt_string.rb b/lib/msf/core/opt_string.rb index 88818cb036..0ab9eb96d6 100644 --- a/lib/msf/core/opt_string.rb +++ b/lib/msf/core/opt_string.rb @@ -13,14 +13,6 @@ class OptString < OptBase end def normalize(value) - if (value =~ /^file:(.*)/) - path = $1 - begin - value = File.read(path) - rescue ::Errno::ENOENT, ::Errno::EISDIR - value = nil - end - end value end