Land #7089, correct usage of OptPort and OptRegex

bug/bundler_fix
Brent Cook 2016-07-11 22:13:27 -05:00
commit 627fffdb08
No known key found for this signature in database
GPG Key ID: 1FFAA0B24B708F96
4 changed files with 10 additions and 8 deletions

View File

@ -302,7 +302,7 @@ module Msf
def probe_gateway(addr)
dst_host = datastore['GATEWAY_PROBE_HOST']
dst_port = datastore['GATEWAY_PROBE_PORT'] == 0 ? rand(30000) + 1024 : datastore['GATEWAY_PROBE_PORT']
dst_port = datastore['GATEWAY_PROBE_PORT'].to_i == 0 ? rand(30000) + 1024 : datastore['GATEWAY_PROBE_PORT']
preamble = [datastore['SECRET']].pack("N")
secret = "#{preamble}#{Rex::Text.rand_text(rand(0xff)+1)}"

View File

@ -28,8 +28,11 @@ class OptRegexp < OptBase
end
def normalize(value)
return nil if value.nil?
return Regexp.compile(value.to_s)
if value.nil? || value.kind_of?(Regexp)
value
else
Regexp.compile(value.to_s)
end
end
def display_value(value)
@ -38,8 +41,7 @@ class OptRegexp < OptBase
elsif value.kind_of?(String)
return display_value(normalize(value))
end
return super
super
end
end

View File

@ -59,7 +59,7 @@ class MetasploitModule < Msf::Auxiliary
end
end
if cert.issuer.to_s !~ /#{datastore['ISSUER']}/n
if cert.issuer.to_s !~ /#{datastore['ISSUER'].source}/n
print_good("#{ip} - '#{vhostn}' : #{cert.issuer} (BAD ISSUER)" )
elsif datastore['SHOWALL']
# show verbose as status

View File

@ -82,7 +82,7 @@ class MetasploitModule < Msf::Auxiliary
nbnsq_type = packet[46..47]
nbnsq_class = packet[48..49]
return unless nbnsq_decodedname =~ /#{datastore['REGEX']}/i
return unless nbnsq_decodedname =~ /#{datastore['REGEX'].source}/i
vprint_good("#{rhost.ljust 16} nbns - #{nbnsq_decodedname} matches regex, responding with #{spoof}")
@ -165,7 +165,7 @@ class MetasploitModule < Msf::Auxiliary
end
}
print_status("NBNS Spoofer started. Listening for NBNS requests with REGEX \"#{datastore['REGEX']}\" ...")
print_status("NBNS Spoofer started. Listening for NBNS requests with REGEX \"#{datastore['REGEX'].source}\" ...")
self.thread.join
print_status("NBNS Monitor thread exited...")