From 5c2c1ccc3942b938cc68b1df1d15c044f1b6eb78 Mon Sep 17 00:00:00 2001 From: Meatballs1 Date: Mon, 2 Jul 2012 10:15:58 +0100 Subject: [PATCH] Added extra logic and fixes for user supplied domains option --- modules/post/windows/gather/credentials/gpp.rb | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/modules/post/windows/gather/credentials/gpp.rb b/modules/post/windows/gather/credentials/gpp.rb index 07a5574686..cef026e165 100644 --- a/modules/post/windows/gather/credentials/gpp.rb +++ b/modules/post/windows/gather/credentials/gpp.rb @@ -79,8 +79,18 @@ class Metasploit3 < Msf::Post domains.reject!{|n| n == "WORKGROUP" || n.to_s.empty?} end - datastore['DOMAINS'].split('').each{|ud| domains << ud} if datastore['DOMAINS'] - domains << get_domain_reg + # Add user specified domains to list. + if datastore['DOMAINS'] + user_domains = datastore['DOMAINS'].split(' ') + print_status "Looking for the user supplied domains: #{user_domains}" + user_domains.each{|ud| domains << ud} if datastore['DOMAINS'] + end + + # If we find a local policy store then assume we are on DC and do not wish to enumerate the current DC again. + if locals.blank? + domains << get_domain_reg + end + domains.flatten! domains.compact! domains.uniq!