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, #command_exists?, #get_env, #get_envs, #has_pid?, #peer, #report_virtualization, #rhost, #rport

Instance Method Details

#kernel_hardwareString

Returns the kernel hardware

Returns:

  • (String)

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

def kernel_hardware
  uname('-m')
end

#kernel_nameString

Returns the kernel name

Returns:

  • (String)

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

def kernel_name
  uname('-s')
end

#kernel_releaseString

Returns the kernel release

Returns:

  • (String)

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

def kernel_release
  uname('-r')
end

#kernel_versionString

Returns the kernel version

Returns:

  • (String)

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

def kernel_version
  uname('-v')
end

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

Returns uname output

Returns:

  • (String)

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

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