Land #5627, more cmd_exec fixes
commit
70191bfa0e
|
@ -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
|
||||||
|
|
|
@ -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}")
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue