Land #5627, more cmd_exec fixes

bug/bundler_fix
William Vu 2015-06-29 11:30:46 -05:00
commit 70191bfa0e
No known key found for this signature in database
GPG Key ID: 68BD00CE25866743
5 changed files with 3 additions and 33 deletions

View File

@ -52,7 +52,7 @@ class Metasploit3 < Msf::Post
when /meterpreter/ when /meterpreter/
host = sysinfo["Computer"] host = sysinfo["Computer"]
when /shell/ when /shell/
host = session.shell_command_token("hostname").chomp host = cmd_exec("hostname").chomp
end end
return host return host

View File

@ -89,7 +89,7 @@ class Metasploit3 < Msf::Post
when /meterpreter/ when /meterpreter/
host = sysinfo["Computer"] host = sysinfo["Computer"]
when /shell/ when /shell/
host = session.shell_command_token("hostname").chomp host = cmd_exec("hostname").chomp
end end
print_status("Running module against #{host}") print_status("Running module against #{host}")

View File

@ -51,7 +51,7 @@ class Metasploit3 < Msf::Post
when /meterpreter/ when /meterpreter/
host = sysinfo["Computer"] host = sysinfo["Computer"]
when /shell/ when /shell/
host = session.shell_command_token("hostname").chomp host = cmd_exec("hostname").chomp
end end
return host return host

View File

@ -79,31 +79,12 @@ class Metasploit3 < Msf::Post
print_status("#{msg} stored in #{loot}") print_status("#{msg} stored in #{loot}")
end end
def get_host
case session.type
when /meterpreter/
host = sysinfo["Computer"]
when /shell/
host = session.shell_command_token("hostname").chomp
end
print_status("Running module against #{host}")
host
end
def execute(cmd) def execute(cmd)
vprint_status("Execute: #{cmd}") vprint_status("Execute: #{cmd}")
output = cmd_exec(cmd) output = cmd_exec(cmd)
output output
end end
def cat_file(filename)
vprint_status("Download: #{filename}")
output = read_file(filename)
output
end
def get_packages(distro) def get_packages(distro)
packages_installed = "" packages_installed = ""
case distro case distro

View File

@ -66,17 +66,6 @@ class Metasploit3 < Msf::Post
print_status("#{msg} stored in #{loot.to_s}") print_status("#{msg} stored in #{loot.to_s}")
end end
def get_host
case session.type
when /meterpreter/
host = sysinfo['Computer']
when /shell/
host = session.shell_command_token('hostname').chomp
end
print_status("Running module against #{host}")
host
end
def execute(cmd) def execute(cmd)
vprint_status("Execute: #{cmd}") vprint_status("Execute: #{cmd}")
output = cmd_exec(cmd) output = cmd_exec(cmd)