0

(Debian GNU/Linux)

If a user only has execute +x access to a folder they can still cd and traverse into the folder but can't use many other commands that would read the contents of the folder or files within.

drwx--x--x (owner can rwx group and rest can only execute)

Changing permissions of the file is not an option in this scenario (retired pen-testing challenge)

With this limited access, would it be possible to exfiltrate a file within or read its contents?

1 Answer 1

1

It takes only a few lines to test and the answer is clear: if the user knows the name of the file he can still read its meta data and content as long the permissions of the file itself allow it:

$ mkdir x
$ echo foo > x/y
$ ls -l x
total 4
-rw-rw-r-- 1 user user 4 Nov 21 18:44 y
$ chmod 0100 x
$ ls -l x 
ls: cannot open directory 'x': Permission denied
$ ls -l x/y
-rw-rw-r-- 1 user user 4 Nov 21 18:44 x/y
$ cat x/y
foo
$
2
  • I see so it appears that in my scenario the permissions must also be x only on the files in the directory, resulting in a permission denial. You have answered the question however.
    – Wiper
    Nov 21, 2019 at 18:06
  • @Wiper: If the user has no read or write permissions for the file it cannot be read or written. This is independent from the permissions of the folder. Read on the folder means that one can do a directory listing, write on the folder that one can change the folder listing (i.e. add or remove file) and execute that one can chdir into the folder. Nov 21, 2019 at 21:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .