From 5918e6c0acea1c3918aa734867b7eef7607f6b10 Mon Sep 17 00:00:00 2001 From: HD Moore Date: Sun, 24 Apr 2011 00:48:05 +0000 Subject: [PATCH] Allow report_auth_info() to accept a Host object instead of an address like all the other methods. git-svn-id: file:///home/svn/framework3/trunk@12415 4d416f70-5f16-0410-b530-b9f4589650da --- lib/msf/core/db.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/msf/core/db.rb b/lib/msf/core/db.rb index e9aa821c5d..196f0e8c01 100644 --- a/lib/msf/core/db.rb +++ b/lib/msf/core/db.rb @@ -892,7 +892,7 @@ class DBManager # report_vuln() now. # # opts must contain - # :host -- an IP address + # :host -- an IP address or Host object reference # :port -- a port number # # opts can contain @@ -917,8 +917,12 @@ class DBManager def report_auth_info(opts={}) return if not active raise ArgumentError.new("Missing required option :host") if opts[:host].nil? - raise ArgumentError.new("Invalid address for :host") unless validate_ips(opts[:host]) raise ArgumentError.new("Missing required option :port") if opts[:port].nil? + + if opts[:host].kind_of?(Host) or validate_ips(opts[:host]) + raise ArgumentError.new("Invalid address or object for :host") + end + host = opts.delete(:host) ptype = opts.delete(:type) || "password" token = [opts.delete(:user), opts.delete(:pass)]