Results 1 to 2 of 2

Thread: Non-sudo user can freely access/copy root's homedir?!

  1. #1
    Join Date
    2019-Dec
    Posts
    1

    Exclamation Non-sudo user can freely access/copy root's homedir?!

    Hello,

    I've just created a non-sudo user, with no extra permissions.

    Code:
    $ useradd -m test
    $ su - test
    $ whoami
    test
    $ ls -la
    total 24
    drwxr-xr-x 2 test test 4096 Dec 14 11:43 .
    drwxr-xr-x 4 root root 4096 Dec 14 11:43 ..
    -rw-r--r-- 1 test test  220 Nov 10 12:45 .bash_logout
    -rw-r--r-- 1 test test 3391 Nov 25 13:36 .bashrc
    -rw-r--r-- 1 test test 3526 Nov 10 12:45 .bashrc.original
    -rw-r--r-- 1 test test  807 Nov 10 12:45 .profile
    Next, we're having a file in root's home directory:

    Code:
    $ cd /root/Downloads/
    $ ls -la
    total 19832
    drwxr-xr-x  2 root root     4096 Dec 14 11:44 .
    drwxr-xr-x 16 root root     4096 Dec 14 11:24 ..
    -rw-r--r--  1 root root 20298848 Dec 13 22:38 test.file
    Now let's see what's happening:
    $ su - test
    $ cd /root/Downloads
    $ ls -la
    total 19832
    drwxr-xr-x 2 root root 4096 Dec 14 11:44 .
    drwxr-xr-x 16 root root 4096 Dec 14 11:24 ..
    -rw-r--r-- 1 root root 20298848 Dec 13 22:38 test.file
    $ cp test.file ~
    $ cd ~
    $ ls -la
    total 19848
    drwxr-xr-x 2 test test 4096 Dec 14 11:47 .
    drwxr-xr-x 4 root root 4096 Dec 14 11:43 ..
    -rw-r--r-- 1 test test 220 Nov 10 12:45 .bash_logout
    -rw-r--r-- 1 test test 3391 Nov 25 13:36 .bashrc
    -rw-r--r-- 1 test test 3526 Nov 10 12:45 .bashrc.original
    -rw-r--r-- 1 test test 807 Nov 10 12:45 .profile
    -rw-r--r-- 1 test test 20298848 Dec 14 11:47 test.file
    [/CODE]

    How is this even possible? How can a non-sudo, basic user access root's Downloads and copy a file that's owned by root (from root's own homedir)?!

    Please note that this is a fresh/clean/untouched Kali install.

    Any hints?

  2. #2
    Join Date
    2019-Dec
    Posts
    1
    Just need to keep in mind Kali isn't a normal Linux distro. On Kali things are designed to be run under root and there isn't really any need for non-root users to be created. If you run under root, things like permissions on /root/ files are a mute point.
    The others permissions on /root/Downloads (o+rx) and test.file (o+r) are allowing this access.

Similar Threads

  1. kali user without root access
    By hypnotizex in forum TroubleShooting Archive
    Replies: 0
    Last Post: 2022-02-21, 11:30
  2. Confusion on Root / Sudo / Normal User
    By kaliqubes in forum TroubleShooting Archive
    Replies: 0
    Last Post: 2021-10-31, 20:10
  3. Accessing Root user, sudo not working
    By b|ackout in forum TroubleShooting Archive
    Replies: 0
    Last Post: 2021-01-02, 20:59
  4. Replies: 1
    Last Post: 2016-12-06, 16:18
  5. create new user (user) as copy from existing user (root)
    By D0NKbet in forum General Archive
    Replies: 2
    Last Post: 2013-11-21, 07:24

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •