Module: Msf::Post::Solaris::System

Includes:
Common, File, Unix
Defined in:
lib/msf/core/post/solaris/system.rb

Instance Method Summary collapse

Methods included from Unix

#enum_user_directories, #get_groups, #get_users

Methods included from File

#append_file, #cd, #directory?, #exist?, #expand_path, #file?, #file_local_digestmd5, #file_local_digestsha1, #file_local_digestsha2, #file_local_write, #file_remote_digestmd5, #file_remote_digestsha1, #file_remote_digestsha2, #file_rm, #pwd, #read_file, #rename_file, #rm_f, #upload_file, #write_file

Methods included from Common

#cmd_exec, #cmd_exec_get_pid, #get_env, #get_envs, #has_pid?, #peer, #report_vm, #rhost, #rport

Instance Method Details

#get_sysinfoObject

Returns a Hash containing Distribution Name, Version and Kernel Information


18
19
20
21
22
23
24
25
26
# File 'lib/msf/core/post/solaris/system.rb', line 18

def get_sysinfo
  system_data = {}
  kernel_version = cmd_exec("uname -a")
  version = read_file("/etc/release").split("\n")[0].strip
  system_data[:version] = version
  system_data[:kernel] = kernel_version
  system_data[:hostname] = kernel_version.split(" ")[1]
  return system_data
end