Fix windows enum modules

bug/bundler_fix
jvazquez-r7 2015-06-29 11:56:38 -05:00
parent 834c0e594a
commit 656e6f5c73
No known key found for this signature in database
GPG Key ID: 38D99152B9352D83
2 changed files with 3 additions and 4 deletions

View File

@ -29,7 +29,6 @@ class Metasploit3 < Msf::Post
def run
print_status("Running module against #{sysinfo['Computer']}") if not sysinfo.nil?
domain = get_domain()
if not domain.empty?
hostname_list = get_domain_computers()
list_computers(domain, hostname_list)
@ -49,7 +48,7 @@ class Metasploit3 < Msf::Post
def get_domain_computers()
computer_list = []
devisor = "-------------------------------------------------------------------------------\r\n"
raw_list = client.shell_command_token("net view").split(devisor)[1]
raw_list = cmd_exec('net view').split(devisor)[1]
if raw_list =~ /The command completed successfully/
raw_list.sub!(/The command completed successfully\./,'')
raw_list.gsub!(/\\\\/,'')

View File

@ -58,7 +58,7 @@ class Metasploit3 < Msf::Post
# List local group members
def list_group_mem(group)
devisor = "-------------------------------------------------------------------------------\r\n"
raw_list = client.shell_command_token("net localgroup #{group}").split(devisor)[1]
raw_list = cmd_exec("net localgroup #{group}").split(devisor)[1]
account_list = raw_list.split("\r\n")
account_list.delete("The command completed successfully.")
return account_list
@ -68,7 +68,7 @@ class Metasploit3 < Msf::Post
def list_domain_group_mem(group)
account_list = []
devisor = "-------------------------------------------------------------------------------\r\n"
raw_list = client.shell_command_token("net groups \"#{group}\" /domain").split(devisor)[1]
raw_list = cmd_exec("net groups \"#{group}\" /domain").split(devisor)[1]
raw_list.split(" ").each do |m|
account_list << m
end