Skip to content

Commit 656e6f5

Browse files
committed
Fix windows enum modules
1 parent 834c0e5 commit 656e6f5

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

modules/post/windows/gather/enum_computers.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ def initialize(info={})
2929
def run
3030
print_status("Running module against #{sysinfo['Computer']}") if not sysinfo.nil?
3131
domain = get_domain()
32-
3332
if not domain.empty?
3433
hostname_list = get_domain_computers()
3534
list_computers(domain, hostname_list)
@@ -49,7 +48,7 @@ def gethost(hostname)
4948
def get_domain_computers()
5049
computer_list = []
5150
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]
5352
if raw_list =~ /The command completed successfully/
5453
raw_list.sub!(/The command completed successfully\./,'')
5554
raw_list.gsub!(/\\\\/,'')

modules/post/windows/gather/enum_domain_tokens.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def run
5858
# List local group members
5959
def list_group_mem(group)
6060
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]
6262
account_list = raw_list.split("\r\n")
6363
account_list.delete("The command completed successfully.")
6464
return account_list
@@ -68,7 +68,7 @@ def list_group_mem(group)
6868
def list_domain_group_mem(group)
6969
account_list = []
7070
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]
7272
raw_list.split(" ").each do |m|
7373
account_list << m
7474
end

0 commit comments

Comments
 (0)