Module: Msf::Post::Solaris::Kernel

Includes:
Common
Defined in:
lib/msf/core/post/solaris/kernel.rb

Instance Method Summary collapse

Methods included from Common

#clear_screen, #cmd_exec, #cmd_exec_get_pid, #cmd_exec_with_result, #command_exists?, #get_env, #get_envs, #initialize, #peer, #report_virtualization, #rhost, #rport

Instance Method Details

#kernel_hardwareString

Returns the kernel hardware

Returns:

  • (String)


52
53
54
# File 'lib/msf/core/post/solaris/kernel.rb', line 52

def kernel_hardware
  uname('-m')
end

#kernel_nameString

Returns the kernel name

Returns:

  • (String)


43
44
45
# File 'lib/msf/core/post/solaris/kernel.rb', line 43

def kernel_name
  uname('-s')
end

#kernel_releaseString

Returns the kernel release

Returns:

  • (String)


25
26
27
# File 'lib/msf/core/post/solaris/kernel.rb', line 25

def kernel_release
  uname('-r')
end

#kernel_versionString

Returns the kernel version

Returns:

  • (String)


34
35
36
# File 'lib/msf/core/post/solaris/kernel.rb', line 34

def kernel_version
  uname('-v')
end

#uname(opts = '-a') ⇒ String

Returns uname output

Returns:

  • (String)


14
15
16
17
18
# File 'lib/msf/core/post/solaris/kernel.rb', line 14

def uname(opts='-a')
  cmd_exec("uname #{opts}").to_s.strip
rescue
  raise "Failed to run uname #{opts}"
end