Module: Msf::Post::Solaris::Priv

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

Instance Method Summary collapse

Methods included from Common

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

Instance Method Details

#is_root?Boolean

Returns true if running as root, false if not.

Returns:

  • (Boolean)

13
14
15
16
17
18
19
20
# File 'lib/msf/core/post/solaris/priv.rb', line 13

def is_root?
  root_priv = false
  user_id = cmd_exec("/usr/xpg4/bin/id -u")
  if user_id.to_i == 0
    root_priv = true
  end
  return root_priv
end