File tree Expand file tree Collapse file tree 2 files changed +3
-4
lines changed
modules/post/windows/gather Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,6 @@ def initialize(info={})
29
29
def run
30
30
print_status ( "Running module against #{ sysinfo [ 'Computer' ] } " ) if not sysinfo . nil?
31
31
domain = get_domain ( )
32
-
33
32
if not domain . empty?
34
33
hostname_list = get_domain_computers ( )
35
34
list_computers ( domain , hostname_list )
@@ -49,7 +48,7 @@ def gethost(hostname)
49
48
def get_domain_computers ( )
50
49
computer_list = [ ]
51
50
devisor = "-------------------------------------------------------------------------------\r \n "
52
- raw_list = client . shell_command_token ( " net view" ) . split ( devisor ) [ 1 ]
51
+ raw_list = cmd_exec ( ' net view' ) . split ( devisor ) [ 1 ]
53
52
if raw_list =~ /The command completed successfully/
54
53
raw_list . sub! ( /The command completed successfully\. / , '' )
55
54
raw_list . gsub! ( /\\ \\ / , '' )
Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ def run
58
58
# List local group members
59
59
def list_group_mem ( group )
60
60
devisor = "-------------------------------------------------------------------------------\r \n "
61
- raw_list = client . shell_command_token ( "net localgroup #{ group } " ) . split ( devisor ) [ 1 ]
61
+ raw_list = cmd_exec ( "net localgroup #{ group } " ) . split ( devisor ) [ 1 ]
62
62
account_list = raw_list . split ( "\r \n " )
63
63
account_list . delete ( "The command completed successfully." )
64
64
return account_list
@@ -68,7 +68,7 @@ def list_group_mem(group)
68
68
def list_domain_group_mem ( group )
69
69
account_list = [ ]
70
70
devisor = "-------------------------------------------------------------------------------\r \n "
71
- raw_list = client . shell_command_token ( "net groups \" #{ group } \" /domain" ) . split ( devisor ) [ 1 ]
71
+ raw_list = cmd_exec ( "net groups \" #{ group } \" /domain" ) . split ( devisor ) [ 1 ]
72
72
raw_list . split ( " " ) . each do |m |
73
73
account_list << m
74
74
end
You can’t perform that action at this time.
0 commit comments