diff --git a/lib/msf/core/post/linux/system.rb b/lib/msf/core/post/linux/system.rb index 26d9df7f7e..6cbafe1011 100644 --- a/lib/msf/core/post/linux/system.rb +++ b/lib/msf/core/post/linux/system.rb @@ -99,6 +99,13 @@ module System system_data[:version] = '' end + + report_host({ + :host => rhost, + :os_name => system_data[:distro], + :os_flavor => system_data[:version] + }) + return system_data end @@ -148,7 +155,9 @@ module System # @return [String] # def get_hostname - cmd_exec('uname -n').to_s + hostname = cmd_exec('uname -n').to_s + report_host({:host => rhost, :name => hostname}) + rescue raise 'Unable to retrieve hostname' end diff --git a/lib/msf/core/post/osx/system.rb b/lib/msf/core/post/osx/system.rb index ca59a54902..c9a503b298 100644 --- a/lib/msf/core/post/osx/system.rb +++ b/lib/msf/core/post/osx/system.rb @@ -17,6 +17,13 @@ module Msf::Post::OSX::System system_info["Kernel"] = cmd_exec("uname -a") system_info["Hostname"] = system_info["Kernel"].split(" ")[1] + report_host({ + :host => rhost, + :os_name => 'osx', + :os_flavor => system_data["Kernel"], + :name => system_info["Hostname"] + }) + return system_info end diff --git a/lib/msf/core/post/solaris/system.rb b/lib/msf/core/post/solaris/system.rb index 817b3b032e..7cab610913 100644 --- a/lib/msf/core/post/solaris/system.rb +++ b/lib/msf/core/post/solaris/system.rb @@ -22,6 +22,15 @@ module System system_data[:version] = version system_data[:kernel] = kernel_version system_data[:hostname] = kernel_version.split(" ")[1] + host_info = { + :host => rhost, + :os_name => 'Solaris', + :name => system_data[:hostname] + } + if system_data[:version] =~ /([\d]?\d\.\d)/ + host_info[:os_flavor] = $1 + end + report_host(host_info) return system_data end