Land #5627, more cmd_exec fixes
commit
70191bfa0e
|
@ -52,7 +52,7 @@ class Metasploit3 < Msf::Post
|
|||
when /meterpreter/
|
||||
host = sysinfo["Computer"]
|
||||
when /shell/
|
||||
host = session.shell_command_token("hostname").chomp
|
||||
host = cmd_exec("hostname").chomp
|
||||
end
|
||||
|
||||
return host
|
||||
|
|
|
@ -89,7 +89,7 @@ class Metasploit3 < Msf::Post
|
|||
when /meterpreter/
|
||||
host = sysinfo["Computer"]
|
||||
when /shell/
|
||||
host = session.shell_command_token("hostname").chomp
|
||||
host = cmd_exec("hostname").chomp
|
||||
end
|
||||
|
||||
print_status("Running module against #{host}")
|
||||
|
|
|
@ -51,7 +51,7 @@ class Metasploit3 < Msf::Post
|
|||
when /meterpreter/
|
||||
host = sysinfo["Computer"]
|
||||
when /shell/
|
||||
host = session.shell_command_token("hostname").chomp
|
||||
host = cmd_exec("hostname").chomp
|
||||
end
|
||||
|
||||
return host
|
||||
|
|
|
@ -79,31 +79,12 @@ class Metasploit3 < Msf::Post
|
|||
print_status("#{msg} stored in #{loot}")
|
||||
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)
|
||||
vprint_status("Execute: #{cmd}")
|
||||
output = cmd_exec(cmd)
|
||||
output
|
||||
end
|
||||
|
||||
def cat_file(filename)
|
||||
vprint_status("Download: #{filename}")
|
||||
output = read_file(filename)
|
||||
output
|
||||
end
|
||||
|
||||
def get_packages(distro)
|
||||
packages_installed = ""
|
||||
case distro
|
||||
|
|
|
@ -66,17 +66,6 @@ class Metasploit3 < Msf::Post
|
|||
print_status("#{msg} stored in #{loot.to_s}")
|
||||
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)
|
||||
vprint_status("Execute: #{cmd}")
|
||||
output = cmd_exec(cmd)
|
||||
|
|
Loading…
Reference in New Issue