Module: Msf::Post::Linux::User
- Includes:
- Common
- Defined in:
- lib/msf/core/post/linux/user.rb
Instance Method Summary collapse
-
#get_home_dir(user) ⇒ Object
Returns a string of the user’s home directory.
Methods included from Common
#clear_screen, #cmd_exec, #cmd_exec_get_pid, #cmd_exec_with_result, #command_exists?, #create_process, #get_env, #get_envs, #initialize, #peer, #report_virtualization, #rhost, #rport
Instance Method Details
#get_home_dir(user) ⇒ Object
Returns a string of the user’s home directory
11 12 13 14 |
# File 'lib/msf/core/post/linux/user.rb', line 11 def get_home_dir(user) cmd_exec("grep '^#{user}:' /etc/passwd | cut -d ':' -f 6").chomp # could also be: "getent passwd #{user} | cut -d: -f6" end |